0

I'm working on a tank simulation in MATLAB. The tank has two motors, a left motor and a right motor. These can each be individually written to run at anywhere from (-100%) to (+100%) speed. So, if I write L, R = (100%, 100%), each motor will be spinning at the same speed and will therefore drive in a perfectly straight line. Writing L, R = (-100%, 100%) makes the robot stay in the same (x, y) coordinate, but changes its angle. L, R = (50%, 100%) makes the robot drive forward AND turn its angle.

My question: how can I translate these left and right motor speeds into a path or curvature equation?

1 Answers1

4

Assuming no slip, the velocity of the tank will be the average of the speeds of the two engines. The rate of rotation will be directly proportional to the difference in speed of the two engines. If w is the width of the tank, and v_delta is the difference in distance traveled per second of the two sides, the tank will turn around once in 2 * PI * w / v_delta seconds so the turning rate is v_delta / 2 * PI * w rotations per second, or v_delta / w radians.

This gives you the velocity as a function of time. And now you can just track the location and angle of the tank just like you would any other moving and accelerating object. (I personally would use Runge Kutta.)

btilly
  • 43,296
  • 3
  • 59
  • 88