Gyro/Accelerometer

I would like to measure how far my Robot Rover has turned. What I would like to do is to start the robot turning and stop it when it has turned a certain amount, say 15°, from where it started. Would this be easier or even possible using an accelerameter or a gyro?

In order to make my Robot Rover autonomous, I had planned to run two threads, one to keep track of its surroundings by contructing a map and the other to plan a route and then tell the robot to turn a number of degrees.

I was hoping to use a gyro, but I don’t understand the output from an electronic gyro. What exactly does 300°/s mean? I’ve looked at some code samples including the one from Sparkfun , but they don’t give me much of an idea. One explanation involved differential equations in explaining how a system would work to balance a robot using gyro(s) and accelerometer(s). I’ve completely forgottten calculus more than once and don’t feature relearning it again. Forget about differential equations.

Maybe I could calculate it based on a time series. Any ideas on how I might do that?

I seem to be going off the deep end with this. :wink:

Robot building is becomming really fun. Seriously!

Thanks for any advice.

Dennis

Somehow, it didn’t connect that I could use a compass to determine how far something had turned. Makes a lot more sense doesn’t it.The idea of using a gyro must have seduced me.

BTW, the links on your page for the Devantech CMPS03 Technical Info seems to have moved. It’s now at robot-electronics.co.uk/htm/cmps3tech.htm.

This brings up another question. Could I use a Phidgets Magnetic Sensor to determine speed if I put a magnet on one of the robot’s wheels? Or a SFE Reed Switch - Magnetic Field Sensor?

Have you considered using a simple digital compass to obtain a heading feedback? This would be alot simpler then using a gyro and calculating drift. This is what most of these gyros output, a drift.

The Devantech CMPS03 would be a good choice, offering 0.1 degree resolution.

Hi stonechild,

You could certainly use a magnet with a magnetic sensor to measure distance travelled, though you would need to add them to the rear wheels, as far away from the motors and electronics as possible. This unfortunately does not give great accuracy though. The Rover’s distance and heading can also be approximated by the time and speed each motor turns. You can calculate how long (and at what speed) each motor needs to turn to rotate 90 or 180 degrees, then just take fractions of the time to move other angles. Another approach is GPS or an accelerometer (accelerometers are now fairly low cost, starting at $25 Canadian). A last (as yet untested) approach would be to modify the Phidgets USB rotary encoder to fit the rear idler sprockets.