# Reply To: Differential drive PID tuning

PID Tuner Forum Forums General PID Discussion Differential drive PID tuning Reply To: Differential drive PID tuning

#44
mdbirley
Participant

Many thanks for your reply. I am looking forward to getting my data into your tuner as I am sure I will then get a better understanding of the whole system. Currently I do have quite a few gaps in my control theory knowledge

I am enclosing a data file that we record from each robot mission.

I am also enclosing 2 drawing to explain what we are attempting to do with the pure pursuit PID We first start with 2 waypoints. The robot calculates the heading to a point on the straight line between the 2 way points at is a fixed distance from the robot. As the robot moves the aim point is continuously recalculated.

We then calculate a heading to this aimpoint and from the RTK dual antenna gps we determing an accurate heading of the robot. The difference in the angle between the aimpoint and the gps heading (error) is fed into the PID controller on an Arduino Due.

The output of the controller is a turnSpeed. This turnSpeed is then added to a constant forwardSpeed of 550 to formulate a left and right wheel speed. So if both L and R wheel speeds are 550 the robot drives straight. As the turnspeed increases in one direction so does the differential between the 2 wheels speeds. The wheelspeeds are fed to the Roboteq MDC2230 motor controller with a number from -1000 to +1000 and this generates a voltage to the wheel motors. The application of the differential voltage caused the robot to drive forward and if required drive in a direction to reduce the error between the Aimpoint and GPS to ZERO

So the input to the controller is the difference between aimpoint and gps heading The output of the PID controller is a turnSpeed which is modified to by 2 wheelspeeds.

These wheelspeeds then cause the robot to drive in some direction until the whole system is updated

The loop time for the PID is 5 Hz. We print the data for the excel every second however we can increase that to 5 Hz as well

If you can use the info I have provided to help me select the correct data for your tuning model I would be very grateful.

Also not sure how to do a step impulse for this system. A little clarity on this will also be appreciated.