We have bought 2WD turtle bot with Arduino. http://www.dfrobot.com/index.php?route=product/product&product_id=65#.UZxObIoW3RQ Now we need to turn it to 90 angle. We need to understand how we can do it. We don't have encoders.

  • 1
    \$\begingroup\$ You can always make a rotation encoder with an LED and a photodetector placed on opposite sides of the spokes of each wheel, assuming the wheel is a spoked one. An expectation of angular control Without some form of encoder makes the question a bit "pie in the sky", hence down-voting. \$\endgroup\$ – Anindo Ghosh May 22 '13 at 7:19

Drive the left and right motors in opposite directions.

If your design requirements constrain you to having no feedback, your best bet is to experiment with the time you turn on your motors. Note that this value can change based on things like the battery voltage and floor texture.

Since it has an Arduino, I'd suggest adding a nice gyroscope and integrating the output to find your angular displacement. Or some other way to find out how far you've turned.

  • \$\begingroup\$ The problem with the time-based approach is, the degrees per second will vary widely due to floor resistance, battery charge level, wheel bearing wear, even minuscule slope of the floor, and any grit or dirt on the floor. The gyroscope solution is much more practical, though gyros too will have significant drift and jitter (due to motor vibration) so repeatibility will be poor at best. \$\endgroup\$ – Anindo Ghosh May 22 '13 at 7:17
  • \$\begingroup\$ I agree with you about dead reckoning. But my robotics team has seen good results with the SparkFun 9DOF Razor IMU for heading. With some filtering and calibration, we see less than 1 degree per minute drift in heading measurements. \$\endgroup\$ – Kevin Chen May 22 '13 at 17:05
  • \$\begingroup\$ Fair enough: A 9 DOF IMU which incorporates an accelerometer and a compass should be just about right. \$\endgroup\$ – Anindo Ghosh May 22 '13 at 17:32

The turtle bot has two geared motors. These can be turned ON and OFF and FORWARD and REVERSE. Without an encoder to measure the actual rotation you will need to basically guess (experiment with) the LENGTH OF TIME (DELAY) you activate the motors.

There are two ways you can turn a 90 degree angle.

(i) Turn ONE motor ON for a 'lazy' turn that will pivot around the other wheel. Depending on the speed of the geared down motor start with a 1 second DELAY and measure the angle turned. From this value (degrees per second) you can calculate the delay needed to turn 90 degrees. enter image description here

(ii) Turn one motor ON + FORWARD, turn the other motor ON + REVERSE. This will produce a 'sharp' turn pivoting about a central point on the axis. This turn is much faster and effectively turns the bot on the spot. Again experiment with a given time (DELAY) and measure the angle turned the calculate the delay time needed. enter image description here

  • \$\begingroup\$ The problem with this approach is, the degrees per second will vary widely due to floor resistance, battery charge level, wheel bearing wear, even minuscule slope of the floor, and any grit or dirt on the floor. It is a thoroughly impractical theoretician's approach. \$\endgroup\$ – Anindo Ghosh May 22 '13 at 7:15
  • \$\begingroup\$ @ Anindo - I think it answers the question that was actually asked with a constraint of no encoder - The question does not ask how can they build an encoder or angle measurement device to turn the bot accurately though 90 degrees which would have made a better question and produced a totally different solution from me - I totally agree that it would accumulate errors due to the variety of conditions you have stated but I was already aware of those. With over 50 years of practical experience I really object to your use of the personally derogatory term 'impractical theoretician'. \$\endgroup\$ – JIm Dearden May 26 '13 at 18:15
  • \$\begingroup\$ I called it like I saw it - The answer is what it is, your personal credentials notwithstanding. Sorry. \$\endgroup\$ – Anindo Ghosh May 26 '13 at 18:19

You can know, approximately, how fast the motor is turning by sensing the back-EMF of the motors without encoders. See How can I measure back-EMF to infer the speed of a DC motor?

Unfortunately this doesn't really tell you how much the robot has turned. Any error in your measurement will accumulate, and these errors will be significant. You will have errors from your back-EMF measurement. Most likely you will have more serious errors from wheel slip, which will vary based on the surface the robot is on and the dust accumulating on the wheels. Thus, back-EMF measurement, or even direct motor speed measurement with encoders, may not be productive.

A gyroscope would allow your robot to measure how much its turned. Integrate this into a feedback loop. A gyroscope is still subject to drift, but much less than other methods. An alternate method would be using a magnetometer to sense Earth's magnetic field like a compass.

  • \$\begingroup\$ Make sure you shield the motors so the magnetic field doesn't affect the compass. I do know someone who claims to have wandered in circles on night excersizes with a magnetic tourch and compass... \$\endgroup\$ – Spoon May 22 '13 at 11:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.