Re: Memsic 2125 code?

Originally Posted by
Ramius
I have to believe that the people building robots must have a simple way to keep their robot "balanced". Again, going back to the Subtech APC-3 and 4 these Automatic Pitch Controllers which drive a servo were on the market long before the code using the "trig" include was created.
Hi Ed,
I suspect that the Subtech APC-3 or 4 may not really care about angle, and just looks at how far off a neutral horizon you are, adjusting the pitch accordingly (much like some simpler robots). It may use a lookup table of some sort to do this, or some math, or a combination of the two. From what I read about one of the sensors mentioned (in another forum) PitchControlStamp LR2 , it doesn't really state if it is working off a 1,2 or 3 axis accelerometer. As I mentioned earlier, a lookup table could get you close for angle. For example, at 75 degrees a (1 axis) pitch lookup table would start to get off by more than 3 degrees, and even more if there was any roll involved. This error goes up to about 10 degrees as you approach 90 degrees. And remember with some roll involved, it would be much higher error. Perhaps there is not much roll in a sub, I am not sure. If these are close enough, then certainly it can be done with a lookup table, and many on this site, including myself would be willing to help you with that. As for cost of on the market pitch controllers, even the Subtech parts look to be about $55 each, the LR2 $95 each, and both seem to only control 1 axis.
Looking up your ideal sensor made us realize there is a need for an inexpensive sensor that outputs an angle. I did find this one, and it fit the bill, all except for the inexpensive part: http://www.sparkfun.com/products/8656 .
We are making a similar sensor, giving an angle output for Pitch, Roll and a tilt compensated compass heading. But price will be much less. It should take about 4 weeks to get the PCB made and code finalized.
http://www.scalerobotics.com
Bookmarks