PID traction Control

One of our mentors mentioned doing PID loops for traction control. I read the theory behind it, and understand most of it. I am just not sure where to get SetPoint values and where to take sensor readings, especially considering they say you should programatically get the set point value. I want to code in C++ (eveyone else wants to use LabView), so I need a little help with this. Do I use an accelerometer or encoders, or both and How do I get my setpoint ?

You will need to be able to read both the wheel speed and the actual speed of the robot.

I would do this by putting an encoder on the wheel (to tell wheel speed) and a follower wheel with encoder (Watch to make sure it does not provide too much traction).

From there you can find the delta speed (differental between the 2 speeds … usually called error) and then adjust the power to the motors until both are spinning at the same rate (or whithin x%)

A simpler, but less precise way to do this is to figure out what the maximum possible accelleration of your robot is (theory and experimentation), then tune the controls so that your wheel speed does not accellerate faster than this. In this set up you only need one encoder from each side of the drivetrain… but at the cost of getting real-time feedback from non-driven wheels.

You might want to try graphing the wheel speed of your robot (again, you’ll need encoders) with a computer attached to the driver station and see if there are sudden spikes in wheel speed to determin when slipping occurrs.

Mind you, we have yet to experiment with this… we’re still waiting for our missing KoP parts to arrive and they are kind of crucial to this task. (We do, however, know they are on the way.)


Thanks. I was informed (in so many words) that we are not going with Daniel_LaFleur’s idea. I wrote the code for that and asked if someone could check it over. I was then refered to a link about PID in LabView. They don’t just want to keep the wheels spinning at the same rate. They also want this to act as an acceleration curve, which is why I was referd to the PID control.

PID is fine for an acceleration curve (and I highly reccommend it), but will not tell you if your wheels are slipping. This will happen when you get into a pushing match.

I noticed today that WPI has PID control built in. I didn’t see that before. I makes more sense now on how to use it. Thanks. Would Q_score logic help any with figuring out the best reaction to slipping, especially if another bot was pushing during autonomus?