go away spammer

Author Topic: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer  (Read 9232 times)

0 Members and 1 Guest are viewing this topic.

Offline InvictaTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 1

Hi all

Heads-up........There is a topic on the SparkFun Forum regarding Non-Linear Output from the SparkFun 9DoF Razor IMU X-axis accelerometer. See;

       Board index » Technical Discussions » Projects and SparkFun Product Questions

      Post subject: Question regarding Razor IMU X-axis accelerometer behavior

Has anyone else noticed such behaviour?

I was planning to buy a 9DoF Razor IMU but I do not wish to buy a potential Pig-in-a-Poke.

Regards

Invicta

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #1 on: July 12, 2010, 03:33:58 PM »
I wouldn't freak out, yet.

Its a single data point from a single test - it could simply be experimental error. Perhaps the student bumped the table or adjusted wiring right at the beginning of the test? Who knows . . .

I guess that means I need to run a test myself now . . . doh!

Offline InvictaTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 1
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #2 on: July 12, 2010, 05:51:54 PM »
Admin

I would very much like to know the test results. Can you publish a graph, or table the results in a spreadsheet?

How is the firmware for the Razor 9DoF coming along. Have you got anywhere with the Kalman Filter yet? Please send me your latest version that works with Webbotlib 1.22 and the Webbot's  updated (for the Razor) Project Designer.

How do I upload your firmware to the Razor. Do I connect the FTDI breakout board to the Razor, then connect the mini USB cable I use for the Axon2 to the FTDI and upload just as for the Axon2 using F-Boot GUI?

I hate to ask but will you be including a tutorial for uploading firmware to the Razor on the SoR website?

If you like, give me the clues as to how it is done and I will try to produce the tutorial.

Thanks for all your help.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #3 on: July 13, 2010, 06:52:14 AM »
I used an ISP programmer to simply upload the .hex to the Razor. Although I seem to remember it also has the Arduino bootloader on it - just follow the Arduino tutorial to upload the .hex.

I ran a crude/quick test and the data from the accelerometer is definitely whack, and kinda noisy too . . . I'm going to redo the experiment and get back to you when I'm confident of my conclusions . . .

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #4 on: July 13, 2010, 09:29:54 AM »
edit: a bug in the data output resulted in the posting of incorrect sensor noise data

see new data posted below ;D
« Last Edit: July 21, 2010, 09:10:05 AM by Admin »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #5 on: July 13, 2010, 12:04:40 PM »
It just occurred to me that the Razor is a 3.3V device but we used a 5V calibration when writing the WebbotLib code . . . doh!

Ignore the results above until we get this figured out . . . .

Offline InvictaTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 1
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #6 on: July 14, 2010, 06:22:40 PM »

It just occurred to me that the Razor is a 3.3V device but we used a 5V calibration when writing the WebbotLib code.

Not sure what you mean by the 5V calibration?

SparkFun say that:

The 9DOF operates at 3.3VDC; any power supplied (3.5-16VDC) to the white JST connector will be regulated down to this operating voltage.

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
    • RazorConcepts
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #7 on: July 14, 2010, 06:26:51 PM »

It just occurred to me that the Razor is a 3.3V device but we used a 5V calibration when writing the WebbotLib code.

Not sure what you mean by the 5V calibration?

SparkFun say that:

The 9DOF operates at 3.3VDC; any power supplied (3.5-16VDC) to the white JST connector will be regulated down to this operating voltage.

If he assumed that the accelerometers were at 5 volts, but were actually running at 3.3, his code to interpret the accelerometer data would have been off, since everything is based on converting the ADC value of 0-1024 to something more understandable

Offline InvictaTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 1
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #8 on: July 14, 2010, 06:49:21 PM »

Just trying to understand how it all works.

Do you know where the 5V calibration is defined in WebbotLib. I could only find the following comment in ADXL345.c:

 *  This uses FULL_RESOLUTION mode so that the values are consistent across g ranges.
 *  Multiple by 3.9 to convert values to 'mg'

Is this it?

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #9 on: July 14, 2010, 07:04:46 PM »
There is nothing you guys can do to fix it - I'm working on it at the moment for the next release.

In summary: the previously supported boards Axon etc all use 5v as the ADC reference voltage. But on the Razor Board itself it uses 3.3v as the ADC reference voltage. So all the sensors that use ADC need to be rewritten to support ANY reference voltage rather than just assuming its 5v. Once I'm done then Admin can release a new hex file for uploading to the Razor.

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline InvictaTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 1
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #10 on: July 16, 2010, 06:43:51 AM »


There is nothing you guys can do to fix it........

I was not planning to try and fix the ADC reference voltage "a man has to know his limitations". I was just curious as to where the fix would be made.

Offline InvictaTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 1
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #11 on: July 16, 2010, 07:39:28 AM »
Razor 9DoF gets clean bill of health from the "Flying Gator" Project


Heads-up........There is a topic on the SparkFun Forum regarding Non-Linear Output from the SparkFun 9DoF Razor IMU X-axis accelerometer. See;

       Board index » Technical Discussions » Projects and SparkFun Product Questions

      Post subject: Question regarding Razor IMU X-axis accelerometer behavior

I am happy and relieved to report that the 'issue' with the SparkFun 9DoF Razor IMU X-axis accelerometer as identified by the Flying Gator Project has been resolved. It would seem that in a similar manner to the WebbotLib they were caught out by the 3.3 ADC voltage. With the correct reference voltage applied the Razor is now delivering smooth sinusoidal output as the accelerometers are rotated about their axis. See.......http://www.rockalypse.org/blogs/flyinggator/2010/07/15/problem-solved/

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #12 on: July 16, 2010, 05:22:03 PM »
Always good to know that others aren't perfect either  :)
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline InvictaTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 1
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #13 on: July 20, 2010, 11:19:56 AM »

Admin

In summary: the previously supported boards Axon etc all use 5v as the ADC reference voltage. But on the Razor Board itself it uses 3.3v as the ADC reference voltage. So all the sensors that use ADC need to be rewritten to support ANY reference voltage rather than just assuming its 5v. Once I'm done then Admin can release a new hex file for uploading to the Razor.

WebbotLib Version 1.23 has been released with the following features:-
    * a2d.h - Added a2dReadMv
    * Reworked ALL analogue sensors to work with different ADC reference voltages


Have you by any chance released the new hex file yet? The 'c' and 'h' files would also be useful. Please indicate when and where they can be found.

Thanks

Offline InvictaTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 1
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #14 on: July 20, 2010, 11:29:18 AM »
Admin

I have ordered my SparkFun 9DoF Razor IMU, I should get it by the end of the week, hopefully.

Have you completed any more testing of the Razor accelerometers using the new WebbotLib and your firmware? I plan to test my Razor when it arrives and would like to compare my results with yours.

Thanks

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #15 on: July 20, 2010, 12:22:25 PM »
Razor hex attached.

Just use WebbotLib for the Axon side. I've verified everything works correctly in v1.23.

I haven't had time to characterize it again since I discovered the bug in the previous version ;D

Offline InvictaTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 1
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #16 on: July 20, 2010, 02:19:00 PM »
Admin

Many thanks for the hex file.

I am almost afraid to ask because I do not want to be a pain in the neck but I would like:

*   A copy of the hardware.h file used in the firmware.
*   A copy of the Razor_9DoF_Board.c file if there has been any changes since the last version you sent to me.

I am asking because I wish to understand how they work, and I wish to improve my 'c' skills from your superior coding experience :D.

Thanks

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #17 on: July 20, 2010, 02:34:49 PM »
@Invicta
Nothing in the code I sent you has changed. What had changed were the hidden WebbotLib functions, hence the recompiled hex I sent you.

That said, Webbot rewrote my code in a much more difficult to understand manner, but he says its better so I believe him :P

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #18 on: July 20, 2010, 06:57:33 PM »
Nothing in the code I sent you has changed. What had changed were the hidden WebbotLib functions, hence the recompiled hex I sent you.
The code that runs on the Razor itself links in the new WebbotLib sensor code that copes with non-5V ADC - so as Admin says that wont change his main program at all. However: assuming that Admin used Project Designer to generate his Razor code then the 'hardware.h' produced by Project Designed will contain an extra line declaring that the Razor uses 3300mV as the ADC reference voltage.

Quote
That said, Webbot rewrote my code in a much more difficult to understand manner, but he says its better so I believe him :P
I only rewrote your code that talks/listens to the Razor, ie on the Axon. It had to be redone to make it compatible with Project Designer and also to add timeouts so that the Axon doesn't hang if the Razor isn't connected.

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #19 on: July 21, 2010, 09:08:54 AM »
I just re-completed a noise test with the Razor flat on a metal table. Listed is the noise range  of each sensor. The noise is relatively small, so it gets a passing grade :P

accelerometer
x: 15mG
y: 12mG
z: 36mG

gyro
x: 1 deg/s
y: 1 deg/s
z: 1 deg/s

compass
x: 9 deg
y: 3 deg
z: 3 deg

My previous post has been 'corrected' to avoid spreading of false information ::)

My next post will be a linearity test.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #20 on: July 21, 2010, 10:01:22 AM »
This is the results from a crude range test of the IMU.

I basically rotated it about each axis slowly by hand. The accelerometer looks sinusoidal as it should. Sorry, but too lazy to set up a proper experiment :P

Offline InvictaTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 1
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #21 on: July 21, 2010, 04:15:24 PM »
Webbot

Many thanks, I have finally taken on board all the hints you have been giving me and I have generated a hardware.h for the razor using Project Designer. Sorry I was a bit slow to realise that the Razor with an AtMega can be considered as another MCU and therefore can be configured with Project Designer just like the Axon2. Obvious now that I have done it.

Project designer and WebbotLib are both fantastic resources.

Thanks for all your patience and understanding.



Offline InvictaTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 1
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #22 on: July 21, 2010, 04:27:53 PM »
Admin

Many thanks to you also. I know that if you tell us newbies everything we should be doing we will never learn it for ourselves and you will not have any time for your own work, but the odd hint along the way does help tremendously. I will post my test results for the Razor as soon as I can, it is still in the postal system somewhere.

Thanks for all your help and guidance.

p.s. What does the @ before a name mean? I hope it is not derogatory :P

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #23 on: July 21, 2010, 04:42:30 PM »
@ means 'at'

for example, the comment was directed 'at' you ;D


Just return the favor by helping the next beginner, once you got things figured out. :P

Offline InvictaTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 1
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #24 on: August 11, 2010, 02:09:52 PM »
I have done some testing of my Razor using a rotating platform I built some years ago. I measured the outputs from the ADXL345 (triple-axis accelerometer) and the HMC5843 (triple-axis magnetometer) for every 15 degrees, see chart below and photo of the test rig. I will test the gyros later.

Update

I have completed the testing of the Gyros. I used a record player ($2 from Ebay) to test the Gyros at +- 33 1/3 rpm (200 Degree/Sec) and +- 45 rpm (270 Degrees/Sec). See chart below. As far as I can tell, allowing for experimental errors, the gyros are functioning correctly.

Cheers
« Last Edit: September 06, 2010, 03:18:31 PM by Invicta »

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #25 on: August 11, 2010, 02:16:25 PM »
good info

Looks sinusoidal to me !

+1 help  :)
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #26 on: August 11, 2010, 02:34:32 PM »
Have you made any progress with the Kalman filter?
Nope! We are still trying to figure out the best way to go about it . . . expect it to take a few more months . . .

Takes forever to chew when I put everything on my plate at once!

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
    • Personal Website
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #27 on: August 11, 2010, 05:20:33 PM »
Not to mention Kalman filter is one big bite.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #28 on: August 11, 2010, 06:10:18 PM »
Have pointed Invicta to a DCM solution giving similar results. Uses matrix stuff which WebbotLib already supports.

Could be a good solution but requires someone, ie not me, with the relevant hardware to write and test.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Non-Linear Output fromSparkFun 9DoF Razor IMU X-axis accelerometer
« Reply #29 on: August 11, 2010, 07:18:31 PM »
Have pointed Invicta to a DCM solution giving similar results. Uses matrix stuff which WebbotLib already supports.

Could be a good solution but requires someone, ie not me, with the relevant hardware to write and test.
I'll volunteer.

And actually, we have a simulator for our robot fish that can probably do it, if you forward me the relevant code to convert into MatLab code.

Not sure how well a robot fish Kalman filter will translate into a plane or ground based robot, however . . .

 


Get Your Ad Here