Dexter IMU sensor

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc

Moderators: roger, 99jonathan, imaqine

Dexter IMU sensor

Postby gazcrowbar » Fri Oct 21, 2011 12:15 am

Hi,
Does anyone have any info on if this is going to be supported in the future, or even at the moment. It isnt listed on the tutorial as having support, and doing a search on here for imu returns nothing. I would like to buy this sensor to play around with but dont want to switch to another firmware/programming language.
Thanks.
gazcrowbar
New User
 
Posts: 10
Joined: Mon Jul 25, 2011 4:29 pm

Re: Dexter IMU sensor

Postby Aswin » Fri Oct 21, 2011 6:36 am

Hi,

Dexter Industries sent me an IMU to evaluate. I wrote Lejos drivers for it and submitted these to the Lejos developers. So they can be used with Lejos and might be supported ( but that is up to the developers).

The IMU is a very nice sensor and good value for money too.

Aswin
My NXT blog: http://nxttime.wordpress.com/
Aswin
Active User
 
Posts: 122
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands

Re: Dexter IMU sensor

Postby skoehler » Fri Oct 21, 2011 12:47 pm

Aswin wrote:I wrote Lejos drivers for it and submitted these to the Lejos developers.


To whom did you send it?
skoehler
leJOS Team Member
 
Posts: 1114
Joined: Thu Oct 30, 2008 4:54 pm

Re: Dexter IMU sensor

Postby Aswin » Fri Oct 21, 2011 1:18 pm

I send it to Kirk as part of a "proof of concept" for more standardization of sensors. He has forwarded this to you as well. I can imagine it escaped your attention as there was more than just these drivers in the proof of concept.

The drivers, there is one for the gyro and one for the accelerometer, are called L3G4200D (gyro) and MMA7455L. There are two test programs as well, called testL3G4200D and testMMA7455L.

Then there is a filter that combines the two sensors to get a drift free low noice tilt/heading signal. Also included is a demo application that utilizes this filter to display on the NXT screen a compass rose that stays horizontal and facing north no matter how you turn or tilt the NXT. You can see its output in this short lousy video. Make sure you select 720p to see whats going on on the screen.
(in the code I sent to Kirk this demo still has a display bug.)
My NXT blog: http://nxttime.wordpress.com/
Aswin
Active User
 
Posts: 122
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands

Re: Dexter IMU sensor

Postby skoehler » Fri Oct 21, 2011 2:06 pm

Aswin wrote:The drivers, there is one for the gyro and one for the accelerometer, are called L3G4200D (gyro) and MMA7455L.


Found them. They are pretty basic, for example you can switch the range of the MMA7455L and the class only support 10bit readings. Didn't take a look at the gyro class yet.
Also, I have to integrate them into the existing leJOS sensor hierarchy somehow, which doesn't use your interfaces yet.

I'm not sure when I have the time to do this.
skoehler
leJOS Team Member
 
Posts: 1114
Joined: Thu Oct 30, 2008 4:54 pm

Re: Dexter IMU sensor

Postby Aswin » Fri Oct 21, 2011 3:43 pm

Pretty basic? Show me another driver that supports calibration for an accelerometer! (via the abstract accelerometer class)

It is true I only implemented the 10 bit dtat registers. There is no need to use the 8 bit registers. In theory this could give a speed advantage. But given the internal rate of update of the sensor and the i2c speed of lejos this is useless.

The gyro has more useful settings. These are all implemented except from the high pass filter, I didn't notice any effect of this filter when testing it.
My NXT blog: http://nxttime.wordpress.com/
Aswin
Active User
 
Posts: 122
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands

Re: Dexter IMU sensor

Postby skoehler » Fri Oct 21, 2011 3:59 pm

Aswin wrote:Pretty basic? Show me another driver that supports calibration for an accelerometer! (via the abstract accelerometer class)


LeJOS has a problem, namely that we don't have all the hardware to test different features etc. - and the datasheets are usually pretty bad.
Concerning the driver part, it is pretty basic. I will have a look at the calibration routine. However, calibration is one layer above what I'm interested in.

Aswin wrote:It is true I only implemented the 10 bit dtat registers. There is no need to use the 8 bit registers. In theory this could give a speed advantage. But given the internal rate of update of the sensor and the i2c speed of lejos this is useless.


Thanks for clearing that up.

Aswin wrote:The gyro has more useful settings. These are all implemented except from the high pass filter, I didn't notice any effect of this filter when testing it.


Thanks for the input.
skoehler
leJOS Team Member
 
Posts: 1114
Joined: Thu Oct 30, 2008 4:54 pm

Re: Dexter IMU sensor

Postby gazcrowbar » Sat Oct 22, 2011 11:51 pm

Thanks for the replies.

I'm hoping to get the sensor in December, it will be my first forray into accelerometers and gyros, along with complex/non-standard sensors. I was wishing that I could just plug it in and use a standard class to get the data in a nice and easy form.

Aswin if that is your video and related blog then thats what first drew me to the idea :), so thanks.

If I understand correctly can i use the kalman filter class included in lejos to combine the data to account for drift? Im going to need to do a lot of research until December :? .
gazcrowbar
New User
 
Posts: 10
Joined: Mon Jul 25, 2011 4:29 pm

Re: Dexter IMU sensor

Postby Aswin » Sat Oct 29, 2011 11:20 am

You can download drivers for the Dexter IMU sensor here.
My NXT blog: http://nxttime.wordpress.com/
Aswin
Active User
 
Posts: 122
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands

Re: Dexter IMU sensor

Postby nate » Sun Oct 30, 2011 12:37 am

Thanks Aswin. The only thing missing is your nl.totan.util.Formatter, which I assume formats floating point numbers ala printf?

Also, why did you do the following:

SensorPort.S4.i2cEnable(I2CPort.HIGH_SPEED);
DIMUAccel accel = new DIMUAccel(SensorPort.S4);
DIMUGyro gyro = new DIMUGyro(SensorPort.S4);

public DIMUGyro(I2CPort port) {
super(port, I2C_ADDR, I2CPort.LEGO_MODE, I2CPort.TYPE_LOWSPEED);

You set the port to HIGH_SPEED, and then change it to LEGO_MODE in the constructor? Also, I wrote my own driver, and I had a of issues with it not accepting configuration values without some delays after starting up, and I noticed you're not checking the results from sendData().

// put in sleep mode;
sendData(CTRL_REG1, (byte)0x08);

When I do something like this, I keep getting errors.

// Finally, enable the gyro on all axes, and disable power-down
if (sendData(CTRL_REG1, (byte)0x0F) != 0)
throw new RuntimeException("Unable to enable gyro");


Nate
nate
New User
 
Posts: 14
Joined: Sat Oct 29, 2011 11:40 pm

Re: Dexter IMU sensor

Postby Aswin » Sun Oct 30, 2011 9:36 am

Nate,

I have included the formatter in the zip-file.

The port configuration is meant to enable high speed I2C. The code is vey confusing, but Andy explains it well in this post.

It is not a good thing that I do not check return codes for sendData. I've added 'basic error checking to the drivers.
My NXT blog: http://nxttime.wordpress.com/
Aswin
Active User
 
Posts: 122
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands

Re: Dexter IMU sensor

Postby nate » Sun Oct 30, 2011 3:34 pm

Thanks Aswin, I now understand why you set LEGO_MODE in the driver, and high-speed outside the driver.

Also, thanks for updating the zipfile with the contents of the Formatter.


Nate
nate
New User
 
Posts: 14
Joined: Sat Oct 29, 2011 11:40 pm

Re: Dexter IMU sensor

Postby gazcrowbar » Sun Nov 27, 2011 5:11 pm

Ok, I'm should receive the sensor this week.

The link to the drivers now doesnt work and I havent saved them, can someone repost them? And will these easily allow me to easily query the output of the sensor in a normal small program?

Thanks.
gazcrowbar
New User
 
Posts: 10
Joined: Mon Jul 25, 2011 4:29 pm

Re: Dexter IMU sensor

Postby Aswin » Sun Nov 27, 2011 6:47 pm

You'll find drivers and a user guide here.
My NXT blog: http://nxttime.wordpress.com/
Aswin
Active User
 
Posts: 122
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands

Re: Dexter IMU sensor

Postby gazcrowbar » Sun Nov 27, 2011 7:50 pm

Wow! Simple but detailed explanations really help.

Think I may try using the position to alter sounds that the robot makes to start off with, then a segway and maybe integrate with a java balancing game. Would love to have the space to play with a UAV :( . Should keep me occupied anyway.

Thanks.
gazcrowbar
New User
 
Posts: 10
Joined: Mon Jul 25, 2011 4:29 pm

Next

Return to NXJ Hardware

Who is online

Users browsing this forum: Google [Bot] and 2 guests

more stuff