What is the best way to turn in 2WD simple differential drive line following robot?

I've used 4 sensors & a standard smart robot chassis kit with geared motors & L298 motor driver.

What is the difference between turning in:

1. One wheel stopped, one wheel moves.
2. Both wheels moves, but in opposite direction.

What is the best way to go in a curve? What is the best way to turn 90°?

• what do you man by best way ? – jsotola Jan 27 '18 at 9:47
• what are you asking here? What is the difference between turning in .... – jsotola Jan 27 '18 at 9:47

Your question is a little bit fuzzy. You achieve different results with these two turning scenarios.

If you keep one wheel stopped the the radius of the curve (turn) you make equals the robot width and your turning point is the stopped wheel, while when you move both the wheels with opposite but same velocity (rpm) then you achieve a maneuver with 0 radius, turning in place, and also the turning point is the center of the robot.

In the first case the curve you make is more smooth, while in the second is more "aggressive".

In the end what matters is what you want the robot to do, and the shape of the curve you want to follow.

Maybe this paper, Design of a Differential-Drive Wheeled Robot Controller withPulse-Width Modulation - Farshad Arvin, Khairulmizam Samsudin, and M. Ali Nasseri, could be of some help.

The question is subjective along two directions

1. what is best way ? Fastest turning speed or best way to conserve momentum ?
2. How do you want to turn ? do you want to turn with the CoM remaining almost still or with the CoM following a curve ?

I guess that you would like to follow curves in general in this case usually you command different velocities to both wheels, and in most case you don't need to stop or revert one wheel (this is conditioned by the curvature of the path and the robot kinematics/dynamics).

In small spaces or at low speed it might be useful to turn while keeping the CoM steady, ie turn instantaneously around an vertical axis passing by the middle point between you wheels, which should be where you try to have your CoM. In this case the best is to use opposite sign spinning commands of the same magnitude to your wheels so that there is no lateral motion induced.

In the end, you can generate a control algorithm going from one hand of the scope to the other hand based on the desired trajectory you want to follow.

You should use inverse kinematics equations for teleoperation/derive your robot:

The best way to the deriving curve is use from inverse kinematics equation and the best way for turning 90 degree (Both wheels move, but in opposite direction until 90 degree (this reason to your robot's dimensional )) which that handled by inverse kinematics too.

Which r is wheel radius, d is robot width, v is linear velocities, w is angular velocities, and thetaR and thetaL are left/right wheel RPM that you must get them.

And before these, you must obtain/solve v, w from using wheels encoder.

In additional, check this post: calculating differential drive robot ICC position