View Single Post
  #7   Spotlight this post!  
Unread 26-01-2006, 14:48
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Gyro not accurate - Problem

Im not aware of a solid state MEMs gyro that gives angular position.

The NS ADXRSxxx devices output angular rate (degrees / second). This is exactly what you want for motion control feedback if you have an input that is commanding desired degree/S turn rate (ie, a joystick)

you simply compare the joystick input to the sensor output to see if the bot is turning as fast as the driver is commanding it to turn. That is your error signal for a feedback PID loop.

The same sensor can be integrated to get relative compass heading. Its simple to do.

assuming you scale the yaw rate sensor down to 8 bits, you would have a 16 bit variable, initialized to 32,000. Then on every loop through your code read the sensor, add it to that HEADING variable, and subtract 128 (for the zero reading offset)

then as your bot turns one way, the HEADING variable will increase, and decrease when turning the other way.

you can also let the bot sit still for a few seconds at power-up, and read the 'not moving' output of the sensor. That will be your zero point (might be 126 or 130... instead of 128). This way you compensate for drift, and you have control over the 'calibration'.

If there are MEMs gyro chips that output heading, Id be interested in seeing the spec sheets. I know there are magnetic sensors that work that way, they tell you which way magnetic north is (in 3 dimensional space).