Thread: PID question
View Single Post
  #3   Spotlight this post!  
Unread 10-01-2008, 16:19
lukevanoort lukevanoort is offline
in between teams
AKA: Luke Van Oort
no team
 
Join Date: Oct 2005
Rookie Year: 2005
Location: Waterloo, ON, Canada
Posts: 1,873
lukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond repute
Send a message via AIM to lukevanoort
Re: PID question

I don't think it is realistically possible to choose constants that keep the output between 0 and 254. As for the division thing, it lets you get decimal precision without making the uC do floating point operations, which it is very bad at. (ex 34/100 is the same as .34, but the robot executes it much faster)

To find gains, we just make the setpoint something near the middle of the mechanism's travel (to keep oscillations from damaging the mechanism). Then we link the P, I, and D constants to an analog input on the OI. After that we twiddle the knobs in this order: increase P until it gets near the setpoint, increase I until it reaches the setpoint, and finish by increasing D until any oscillations present are damped. We then use the numbers determined this way as our constants. It actually takes very little time to do it this way, I think it took us maybe 20 minutes to tune three loops last year.
__________________
Team 1219: 2009 - Mentor
Team 587: 2005 - Animator, 2006-2008 - Team Captain

Last edited by lukevanoort : 10-01-2008 at 16:41.