[Dprglist] straight lines

David P. Anderson davida at smu.edu
Thu Jan 13 11:48:57 PST 2022


Howdy DPRG,

We talked Tuesday night about PID controllers for the two wheels of a 
differentially driven robot, and potentially using a third PID that 
looks at the difference between the integral errors of the two wheels 
for steering.    I believe this is how Doug P steers his robots.

I mentioned that the robot should be able to maintain a straight line 
without this 3rd steering PID, just using the two PIDs on the wheels.   
(Navigation on my robots is handled at a higher level using a gyro and a 
linear controller, and is not part of the lower level PID structure).

Ted had some question about this and I said I had some videos that might 
make it more clear.   Not sure if Ted is on the list, but if not I can 
go over this at next Tuesday's meeting.

So I have these horrible little videos I shot out in the shop in an 
attempt to clarify.   They each show the robot driving with one wheel 
over an obstruction.  It happens pretty quickly, so let me describe what 
you will be seeing.

The first video shows the robot moving at 10% full speed, to try to 
exaggerate the effect.  At the beginning both wheels are on the tile 
surface, both are instructed to go the same velocity as maintained by 
the PID controllers, and the robot drives in a straight line.

Then the right wheel runs into the edge of a couple of stacked 
doormats.  That causes the right wheel to slow down, because the voltage 
is enough to maintain the velocity on a smooth surface, but not enough 
to climb over the edge of the carpet.    Because the left wheel is still 
going at 10%, the robot rotates to the right, toward the slower wheel, 
and away from the straight line the robot is attempting.

Now the PID controller sees the right wheel slow down and so increases 
the voltage to climb over the carpet edge.   Once it climbs over the 
edge, however, it now has too much voltage for a constant 10% speed, and 
so the right wheel actually speeds up and goes faster that 10%.  That 
causes the robot to rotate back to the left, toward the "slower" left wheel.

But the PID controller sees the right wheel speed up and so decreases 
the voltage to whatever value is needed for that wheel to go 10% full 
speed on the carpet.

The sum total of those two corrections is a little "S" curve, when the 
robot rotates right and then back left.  Those two tend to cancel each 
other out, and so the robot maintains the straight line.   Note that it 
does the inverse when the robot drives off the carpet on the far side, 
rotating left as the right wheel speeds up coming off the carpet, and 
back right as the PID controller corrects.

http://www.geology.smu.edu/dpa-www/robo/rcat/rug-pid2.mpg

This second video is the same thing but at 50% full speed, about the 
fastest it can run in the house.  You can see the same "S" curve and the 
robot maintaining it's heading.

http://www.geology.smu.edu/dpa-www/robo/rcat/rcat_10082.mpg

When the PID controller for the right wheel sees that wheel slowing 
down, it can increase the voltage up to the max that the robot can 
produce, if necessary.   This third video shows the same sequence, again 
at 10% full speed, but in this case the little block of wood that it is 
climbing over was not held in place with a bag of lead shot, and so gets 
stuck.   You can see the PID controller increasing the voltage to that 
wheel until it finally breaks free and, again, returns to the original path.

http://www.geology.smu.edu/dpa-www/robo/rcat/rcat_10076.mpg

So, as mentioned, a differentially driven two wheel robot with a 
separate PID controller for each wheel should be able to maintain a 
straight line without additional steering control, PID or otherwise, 
just by driving both wheels at the same velocity.

Hope this is useful.

cheers!

dpa





More information about the DPRGlist mailing list