Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: cpctc1234 on November 30, 2010, 11:24:44 AM
-
Hey guys I'm building a robot that needs to know its orientation based of a starting direction. Like a compass in way that if the robot starts off in the North direction it will always know which direction it started in and finishes in.
I've been looking at a compass module, but I'm worried about EMF interference so I was leaning toward an accelerometer or gyro, but I'm unsure if they can be used to measure orientation.
Do you guys have any idea of what I can use if any of these above?
-
couldn't it be done with encoders?
encoders could keep it straight, and you would know how much it turned and could turn it back on track.
-
You can use all of them (encoders, accelerometers, compasses, gyros - in order of drift), but you'll need to write a closed control loop. Take a look at Admin's PID control tutorial. If you decide to use accelerometers, be aware they have integral drift - correction with a gyro is the best way to avoid it, using a Kalman filter. Then you'll have an IMU (inertial measurement unit)
-
couldn't it be done with encoders?
encoders could keep it straight, and you would know how much it turned and could turn it back on track.
Yeah I thought of using encoders. I was really wanting to use something else because I'm not sure if my wheels will accommodate encoders.
-
You can use all of them (encoders, accelerometers, compasses, gyros - in order of drift), but you'll need to write a closed control loop. Take a look at Admin's PID control tutorial. If you decide to use accelerometers, be aware they have integral drift - correction with a gyro is the best way to avoid it, using a Kalman filter. Then you'll have an IMU (inertial measurement unit)
So your saying that in order to accelerometers I would have to predict the error and account for it. So are you saying in your opinion wheel encoders would be best?
-
Encoders are easier. Arguably, an IMU would be "best", but likely the total error over total runtime will be pretty small, so it's not much different.