Differential Drive Robot hardware interface

asked 2020-03-11 12:26:11 -0500

Herobone gravatar image

So I'm still working on this never ending project on building a small autonomous robot.

First of all, here are the specifications of my robot:

  • 2 * Encoded DC Motors
  • Arduino Nano for controlling the PWM of the Motor
  • Arduino Nano for counting encoder pulses

So now the problem. I have a Twist message and want to get the robot to move when it's published, since that's the basic function of a robot. But i don't find any good controllers to convert this Twist message to the PWM signals.

The Motor controller subscribes to a topic for each motor. This topic is an Int16 that simply represents the PWM value for the motor. So it's not a m/s or a ticks/second value.

Now I need a controller that can convert that. Yes, I searched for controllers. I found the diff_drive_controller but that one needs a PID controller (and I don't know how to use that), and the differential_drive but that one does not work (I tried tuning it for hours, but it either overshoots by excessive amounts or slows down until it stops)

I read all the documentations, but they are written extremely bad and unspecified.

So if you could tell me how I can control this differential driven robot it would be very helpful.

edit retag flag offensive close merge delete

Comments

Yes, PID tuning is not easy. I guess the question here is something like "How do I control my motor with a given speed?" I think this is a robot specific question and not a ROS question. My recommendation: There are PID controllers libraries for the Arduino: Execute the PID on the Arduino, it can do this faster then your main computer (Whatever you are using as ROS computer)

Humpelstilzchen gravatar image Humpelstilzchen  ( 2020-03-12 01:26:04 -0500 )edit