Thread: PID Tuning Help
View Single Post
  #24   Spotlight this post!  
Unread 18-02-2015, 18:32
Jared's Avatar
Jared Jared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2012
Location: Connecticut
Posts: 602
Jared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond repute
Re: PID Tuning Help

Here's what I've done for PID that seems to work very well for us.

We've used it for:
Velocity PID on flywheel shooter
Position PID on window motor for bridge stinger
Position PID on window motor for turret
Position PID on climber
Position PID on elevator

To avoid breaking things, I start with p = .00001, so nothing happens. I increase p by one order of magnitude until the thing starts moving. At this point, we make sure that the mechanism is heading in the right direction. Finally, we increase P until the steady state error is 3 to 5 times larger than our largest acceptable error. This value usually ends up being near half the P value that causes uncontrollable acceleration. At this point, we slowly increase I (start with .00001, increase by orders of magnitude until something happens, then by increasingly smaller amounts) until the mechanism reaches the setpoint, even if it oscillates on reaching the setpoint. Then, we increase D very slowly (start at .00001, increase by order of magnitudes).

If D ends up too large and causes oscillations, use more low pass filter on your sensor data (or use a moving average with more samples).