View Single Post
  #2   Spotlight this post!  
Unread 17-03-2009, 09:17
EricS-Team180's Avatar
EricS-Team180 EricS-Team180 is offline
SPAM, the lunchmeat of superheroes!
AKA: Eric Schreffler
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Stuart, Florida
Posts: 561
EricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond repute
Re: Traction control: How do I tune a PID controller with variable gain?

hmmmm of course you have to work with what sensor feedback you have in your design....but here's one approach out of many. We have not tried this, but here goes:

Let's say you can calculate slip ratio.
1) Pick the ratio you want as the "set point"
2) find the slip ratio you currently have.
3) the difference is your error
4) pick a multiplier (Kp, the proportional gain in controllese)

Kp*error becomes the input to you motors, but limit it to -1.<0.<1.
or...Kp*error could be a delta to the last pass motor pwm (better? worse? dunno)

So, the choice of Kp is critical! too big and you get wildly big swings in pwm (unstable control system) and too small and you get no effect. As a swag, I'd guess that an error of twice the slip would need 100% drive...something like 1./slip_ratio_set_point...just guessing


As for the integral term, (the I in PI) keep a running sum of the error and choose a Ki, the term becomes Ki*(sum_error). Add it to Kp*error for your overall output

Output_to_motor = Kp*error + Ki*(sum_error)

The integral part is tricky. It is good for trimming out long-term biases, but you need to limit how big you want the sum_error to grow or you will experience "integrator wind-up" - really big Integral terms in your output that can adversely effect you controller. Add the fact that this is not a continuously running process - you will be starting and stopping, and and you can guess how wind-up could mess with your driver's head!

My recommendation would be to try only the P part first and add the I if you really have to. Also, Google PID controller...there's a wealth of better descriptions out there.

This approach will always drive you to some slip... interesting...even when you want to stop?!?

Eric
PS heh - our programming is never done 'til our last match at the Championship
__________________

Don't PANIC!
S. P. A. M.

Last edited by EricS-Team180 : 17-03-2009 at 09:32.