|
Post by dgustavus on Feb 17, 2015 9:40:21 GMT -8
Hi James,
This is not a big thing, but I wanted to know if you have seen it before. My GD2 is a "console" on my robot to show what is going on and replace switches and knobs for settings. I wrote the code with the GD2 mounted on an arduino which was connected to USB for power. Now that it is on the robot, I power the arduino from the power jack with a 7.4V battery instead of from the USB. As it turns out, when the GD2 is powered that way, there is a significant offset in both X and Y (and maybe Z but I am not showing that) from what it is when powered by the USB. I am wondering if the accelerometer is some place close to the voltage regulator (I am using a Sparkfun Red board) and is causing this offset? I say it is not a big deal because I can measure the offset and subtract it out of the readings, but it would be nice to know what is going on.
Thanks, Duane
|
|
|
Post by jamesbowman on Feb 17, 2015 14:55:00 GMT -8
Could be a couple of things. Is the orientation of the GD2 different? If so, the accelerometer will report a different direction for gravity.
The accelerometer is an analog unit, and uses the Arduino A/D to take the measurements. If the Arduino is getting a voltage other than 5V, then this will affect the Arduino's analog reported numbers. This sounds likely: perhaps on the USB power the 5V is "drooping" a bit to 4.5V. But on the robot the 7.4V is giving a nice clean 5V on the redboard.
Also, please post a photo of the GD on the robot!
|
|
|
Post by dgustavus on Feb 18, 2015 6:14:50 GMT -8
> perhaps on the USB power the 5V is "drooping" a bit to 4.5V. But on the robot the 7.4V is giving a nice clean 5V on the redboard. > That sounds likely as the display shows offsets in the same direction but of greater magnitude. I am using a version of the code you put in the book to measure the accelerometer, and the line is longer but in the same general direction. I will try to get some measurements of the two situations to compare. I will try to get a photo today, but will need to look around to see how to post it. Thanks, Duane ps attaching a photo Attachments:
|
|