|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#16
|
||||
|
||||
|
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). |
|
#17
|
|||||
|
|||||
|
Re: PID Tuning Help
It could be runaway, though that seems unlikely after passing through the previous steps in this process.
|
|
#18
|
||||
|
||||
|
Re: PID Tuning Help
Quote:
|
|
#19
|
||||
|
||||
|
Re: PID Tuning Help
Quote:
I stay on the mechanical side of FIRST robots, so I am somewhat clueless as to the implementation in the default code. What are the units on the integrated error? Is it error*frame or error*second? error*frame would be a much larger value, and explain why you need such a small value for Ki. The answer is often integrator management. This means, when the integrator is not helpful, you turn it off. The great thing about integrators is that they will do everything in their power to satisfy the command. The bad thing about integrators is that they will do everything in their power to satisfy the command. A step command of the full length of the field is going to wind up the integrator. Your robot can't satisfy the command of being 54 feet away in .1 second. One way to avoid this is to not command 54 feet in .1 second, instead ramp it in over several seconds. See this post by Ether. Another way to is to shut off the integrator for most of the travel -- just start counting when you are close to the final value to make sure you achieve the commanded position. Or you limit the integrator's authority to some fraction of the maximum command. |
|
#20
|
|||||
|
|||||
|
Re: PID Tuning Help
Quote:
I read "and not oscillating" in OP above as a clarification; in some contexts (acoustics, radio, etc), oscillating is considered stable. This is not one of those contexts. |
|
#21
|
|||
|
|||
|
Re: PID Tuning Help
Yeah, if OP need more than basic P with just a tad (or none) of I. They really need to get into how PID works and why each of the variables do what they do.. A simple generic manual tuning procedure isn't going to do it beyond some very basic system. I've had to tweak D in scenarios where I've had impulse spikes in the error, and I where there were ramps/drifts.
Without knowing the underlying system, it would be difficult to go beyond the generic manual tuning. |
|
#22
|
||||
|
||||
|
Re: PID Tuning Help
http://www.inpharmix.com/jps/PID_Con...ms_Robots.html
Simple and detail explanation about pid, tuning. We wrote our own pid for the elevator this year, about a week into the debug, one of the students says, hey Labview has a PID instruction, why didn't we use that... A week after that a mechanical mentor says, hey the Talon SRX does PID on the talon, why didn't we use that... The answers are the same, because I wanted them to learn it. . . We found the Kc and oscillation period, (we log elevator motor output and elevator encoder feed back to .csv file) to be pretty good values, we had to tweek them down a bit from the chart, but the same gains worked for both lifting loaded, unloaded, lowering loaded and unloaded. We also do the calcs in timed tasks loop with a 20ms metronome timer. Last edited by tr6scott : 26-02-2015 at 15:06. Reason: sp |
|
#23
|
||||
|
||||
|
Re: PID Tuning Help
Quote:
http://www.qxdesign.com/Download%20A...r%20CSDG2e.EXE ... and it's free. Download, install (with admin privileges), read the user guide, and start learning by doing. |
|
#24
|
|||||
|
|||||
|
Re: PID Tuning Help
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|