View Single Post
  #2   Spotlight this post!  
Unread 17-01-2011, 09:47
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: PID Speed Control

Your intuition is correct: If speed is your source of error and Jaguar PWM is your output, then your proportional term will become 0 once you hit the setpoint.

Here is a great thread on this topic from a couple of years ago: http://www.chiefdelphi.com/forums/sh...&highlight=PID

The short answer: You need to accumulate your output over time and use that instead. In essense, yes, you are controlling motor acceleration (just as in a position loop, you are controlling motor velocity).

What you have now:
Jaguar_PWM = Kp*error + Kd*error_derivative + Ki*error_sum

What fixes the problem:
Jaguar_PWM += Kp*error + Kd*error_derivative + Ki*error_sum
Reply With Quote