I have a mobile robot that has a differential drive technique. I try to control the robot with PID controller. Is the best way for controlling differential drive robots?

If I want to compare different control techniques for this robot, which techniques do I search for?

  • $\begingroup$ Welcome to Robotics bb0667, but I'm afraid that it is not clear what you are asking. We prefer practical, answerable questions based on actual problems that you face, so it's a good idea to include details of what you want to achieve, what you tried, what you saw & what you expected to see. Please take a look at How to Ask & tour for more information on how stack exchange works and work through the Robotics question checklist to edit your question to make it clearer. $\endgroup$
    – Ben
    Commented Dec 22, 2021 at 14:33
  • 1
    $\begingroup$ First you should have applied your questions to a web search. Both your phrases "is pid the best control for differential drive robot" and "robot control techniques" turn up good hits. $\endgroup$
    – r-bryan
    Commented Dec 22, 2021 at 23:24

1 Answer 1


One way to do this easily is with a constant step controller. It's a controller that looks at the error and then just adds (or subtracts) a constant amount (usually very small). It's very easy to implement. However, it is slow to reach the desired velocity. This can be mitigated with a feed forward mechanism; when starting from 'stopped' calculate the initial control value (throttle pwm value) based on measured values for stall throttle (the throttle (pwm value) below which the motor will not turn; so this also corresponds to the minimum possible non-zero velocity). Given the target velocity, you can do a linear interpolation between min and max velocity to estimate the feed forward value for throttle. Then the constant step controller will converge quickly from a standing start. If there is a large perturbation while moving it will still respond slowly.

This differential drive robot uses a feed forward constant step controller for speed control and a constant step controller for heading control during goal to goal behavior. https://github.com/Ezward/Esp32CameraRover2 Speed control is here https://github.com/Ezward/Esp32CameraRover2/blob/3cb95bc326873d1e354887132699924332c0c7e8/src/wheel/drive_wheel.cpp#L323, kinematic pose estimation is here https://github.com/Ezward/Esp32CameraRover2/blob/3cb95bc326873d1e354887132699924332c0c7e8/src/rover/rover.cpp#L313, and heading controller is here https://github.com/Ezward/Esp32CameraRover2/blob/3cb95bc326873d1e354887132699924332c0c7e8/src/rover/goto_goal.cpp#L333 Here an example of it in operation https://youtu.be/TjE9ceNOTJE

  • $\begingroup$ Sorry for the late reply. Step controller is the easy way for this. You're right. But it's not the best solution. I just want to ask here. Doesn't the step controller's response delay the axiom time in the wheel? Or does it not respond to the system later than PID? @Ezward $\endgroup$
    – bb0667
    Commented Jun 27, 2022 at 7:50
  • $\begingroup$ Also, your robot is pretty good. $\endgroup$
    – bb0667
    Commented Jun 27, 2022 at 7:51
  • $\begingroup$ It does respond slower. The feed forward helps considerably when starting from stop. The robot I am using it on is for education, so as an intro to closed loop speed control the step controller is very easy to understand and implement and calibrate. $\endgroup$
    – Ezward
    Commented Jun 28, 2022 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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