Author |
Message |
Hobbes
Rookie
Joined: Tue Jan 13, 2015 11:30 pm Posts: 10
|
 Dexter IMU
Just got a Dexter Industries IMU. Has anyone used it on an EV3?
I am trying to get "dexterind-imu-test1.c" to run on my brick. The code compiles on Ver. 4.30 and downloads. Running the code only gets me:
ERROR, You have not setup the sensor port correctly. Please refer to one of the examples. Detected SensorType on port[0]: 0
Is my sensor bad? Any suggestions?
|
Mon Feb 23, 2015 12:23 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Dexter IMU
Change the top of the file from: to Let me know if that worked for you. = Xander
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Mon Feb 23, 2015 1:05 am |
|
 |
Hobbes
Rookie
Joined: Tue Jan 13, 2015 11:30 pm Posts: 10
|
 Re: Dexter IMU
I tried the new line of code and got the following:
ERROR, You have not setup the sensor port correctly. Please refer to one of the examples. Detected SensorType on port[0]: 97
Using Program Debug's Step Into I was able to capture the following local variables:
Offset Variable Value Type 0x0000 x_val 0 float 0x0004 y_val 0 float 0x0008 z_val 0 float
0x0000 link DIMU tSensors 0x0004 range 4('.') ubyte
0x0000 link DIMU tSensors 0x0004 request 0x403C31C8 tByteArray &
|
Mon Feb 23, 2015 2:46 pm |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Dexter IMU
97 is the sensorEV3_EnergyMeter, that is not quite right, it should be 98 (sensorEV3_GenericI2C). I don't have the dIMU handy to test this with. I'll see if I can find it though.
= Xander
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Mon Feb 23, 2015 3:05 pm |
|
 |
Hobbes
Rookie
Joined: Tue Jan 13, 2015 11:30 pm Posts: 10
|
 Re: Dexter IMU
Thanks for looking into things. Let me know if there is any other info I can provide or tests I can run that may be helpful.
|
Tue Feb 24, 2015 12:34 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Dexter IMU
Thanks for the info guys, I am still looking for my dIMU, but I have not been able to locate it yet.
= Xander
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Fri Feb 27, 2015 1:23 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Dexter IMU
Hey peeps, I have a work-around for you. Make sure you are using the latest driver suite from the Github repo (I committed some changes just a few minutes ago). Then simply change the include line to this: That will disable the sensor type check. The compiler will have a warning like this: You can ignore it  I will work on a better sensor checking system in the mean time, but this should keep you going for now  = Xander
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Fri Feb 27, 2015 2:47 am |
|
 |
Hobbes
Rookie
Joined: Tue Jan 13, 2015 11:30 pm Posts: 10
|
 Re: Dexter IMU
Xander,
Thanks for working on the issue.
I did some testing. The accelerometer looks like it is working in all 3 axes and resolutions. Values at rest are:
x < 0.1 y < 0.1 z ~ 1.0
The gyro looks like it is only working in Y and Z. Values at rest are:
x ~ 572 (RANGE_250) x ~ 1146 (RANGE_500) x ~ 4587 (RANGE_2000) - drops to near zero every second or two. y < 0.5 z < 0.5
|
Sat Feb 28, 2015 12:54 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Dexter IMU
Could you share your test program, so I can play with it here?
= Xander
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Sat Feb 28, 2015 1:56 am |
|
 |
Hobbes
Rookie
Joined: Tue Jan 13, 2015 11:30 pm Posts: 10
|
 Re: Dexter IMU
Xander,
I download the latest master.zip files from Github repo and replace all the example and include files in the EV3 3rd Party Driver Library.
Attached are the test programs. They are just a simple mod of dexterind-imu-test1.c and dexterind-imu-test2.c
I see 3 files is the limit so I will upload the raw data in the next post.
Jim
|
Sat Feb 28, 2015 12:30 pm |
|
 |
Hobbes
Rookie
Joined: Tue Jan 13, 2015 11:30 pm Posts: 10
|
 Re: Dexter IMU
Xander,
Attached is raw data captures from the accl and gyro with the test2 programs. Accl data is for 10bit/2G mode. Gyro data is for 250, 500, and 2000 modes.
Jim
|
Sat Feb 28, 2015 12:35 pm |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Dexter IMU
I have found the root cause of the issue and am in the process of fixing the driver and adding a calibration routine while I'm at it. I'll let you know when the code has been committed. PS: if you want to stay up to date on the latest changes to the driver suite, follow me on twitter: https://twitter.com/xandersoldaat. All commits end up being posted there automagically like this: = Xander
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Sun Mar 01, 2015 9:55 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Dexter IMU
Fixes are up! Get 'em while they're fresh!
= Xander
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Sun Mar 01, 2015 11:18 am |
|
 |
Hobbes
Rookie
Joined: Tue Jan 13, 2015 11:30 pm Posts: 10
|
 Re: Dexter IMU
Xander,
Thanks for all your work. The sensor is working. I'm good to go. I tested every mode and function I could find with “dexterind-imu-test2.c”. The following is just FYI:
The accelerometer looks good for all modes (2G, 4G, 8G) and all functions:
DIMUreadAccelAxes8Bit(DIMU, xvals[i], yvals[i], zvals[i]) DIMUreadAccelAxes10Bit(DIMU, xvals[i], yvals[i], zvals[i])
xvals[i] = DIMUreadAccelAxis8Bit(DIMU, DIMU_ACC_X_AXIS) yvals[i] = DIMUreadAccelAxis8Bit(DIMU, DIMU_ACC_Y_AXIS) zvals[i] = DIMUreadAccelAxis8Bit(DIMU, DIMU_ACC_Z_AXIS) xvals[i] = DIMUreadAccelAxis10Bit(DIMU, DIMU_ACC_X_AXIS) yvals[i] = DIMUreadAccelAxis10Bit(DIMU, DIMU_ACC_Y_AXIS) zvals[i] = DIMUreadAccelAxis10Bit(DIMU, DIMU_ACC_Z_AXIS)
The gyro is working in modes 250 & 500 for the function:
DIMUreadGyroAxes(DIMU, xvals[i], yvals[i], zvals[i])
In mode 2000 the values for x, y, & z only read:
-0.000000 or 0.000000
The gyro does not seem to be working with the functions:
xvals[i] = DIMUreadGyroAxis(DIMU, DIMU_GYRO_X_AXIS) yvals[i] = DIMUreadGyroAxis(DIMU, DIMU_GYRO_Y_AXIS) zvals[i] = DIMUreadGyroAxis(DIMU, DIMU_GYRO_Z_AXIS) Mode 250 X ~ 7481943 y mostly < 10000 z mostly < 10000 Mode 500 X ~ 3741885 y mostly < 10000 z mostly < 10000
Mode 2000 X = inf or nan y = inf or nan z = inf or nan
|
Sun Mar 01, 2015 6:34 pm |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: Dexter IMU
Hey there, I can reproduce the 2000 dps issue, but I don't have time right now to investigate it. You can fix the single axis issue by changing the following line:
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Mon Mar 02, 2015 1:50 am |
|
|