.

PID Tuning:
Step Behavior - Stability Criteria

The idea behind this method is to turn up the gain until you get instability and then turn it down a set amount. This is done one parameter at a time in the order Kd, Kp, Ki. This method is similar to the step input overshoot method, but uses instability as a limiting criteria, not overshoot.

Remember during this entire tuning procedure that you don't want the command output (DAC) clipping with the step command. If the command output clips, you have a non linear system.

 

Before You Start

Kd: With Kp, Ki, Kpff, Kaff, Kvff, and Kfff set to zero, command a small motion. You are going to make your step command with this motion, so choose a length accordingly. Small moves are usually best. In any case, don't clip the command output (DAC) severely, as that will make the result less representative of a normal move.

Use an extremely large acceleration, deceleration, and velocity (1e10?) to make the commanded motion a step.

On this page, Motion Scope shows Commanded Position, Actual Position, Position Error, and DAC Output. This is so that you can see the position step input (Commanded Position), and the response (Actual Position). The Position Error is helpful to see the difference in the commanded and actual position when the difference is small. The DAC output shows the torque command to the motor. High frequency oscillations are sometimes easier to see on the DAC output than on the position plots.

 
100 Count Step Commanded
(Trapezoidal move, 1e10 accel, decel, vel)
Green - Commanded Position
Yellow - Actual Position         
Red - Position Error
White - DAC Output

 

1. Optimize Kd

GOAL: To find the largest Kd value that can be used to command a step without getting any oscillation and then turn down Kd to a fixed amount (approx. 1/3 of the limit value).

Starting with a small Kd (what is a good value to start with?), command a step. Look and listen for oscillation. If you can see oscillation in MoScope or hear or see an objectionable oscillation from the motor, turn Kd down and repeat. If you can not find oscillation, turn Kd up and repeat. Stop when you find the largest Kd you can command a step with and get no oscillation. After you find this limit Kd value, turn it down a fixed amount. I find setting Kd to 1/3 of the limit value is a decent place to start. You can try turning Kd down less if you need more performance. Keep in mind that the less you turn down Kd, the less stable your system will be. At some point, if Kd is too large, you will get oscillation (buzzing, humming, etc). Remember that if you are tuning for production, you will get a stage that is less stable at some point. Leave your self some breathing room for this stage by not pushing Kd too much.

Small, high frequency oscillations sometimes are hard to see on position plots. DAC output plots can sometimes be easier to see the oscillation. Remember, you are looking to find the limits of how high you can turn up Kd, not to find the most accurate motion. A Trust TA 9000 will be used for the following examples, unless noted (http://www.trustautomation.com).

 
Acceptable motion on 100 count step move
Green - Commanded Position
Yellow - Actual Position
Red - Position Error    
White - DAC Output
 

Kd = 2000

 

 

Excessive oscillation on 100 count step move

Green - Commanded Position
Yellow - Actual Position
Red - Position Error    
White - DAC Output
 

Kd = 7000

In this example instability is found, both in MoScope and very audibly at Kd > 6000. Let's turn down Kd by 2/3 (6000 / 3 = 2000) and continue to tuning Kp.

 

2. Optimize Kp

GOAL: To turn up Kp until there is half the overshoot of a step command.

When tuning Kp, look for two things as a sign of a Kp limit: Ringing of 4-5 oscillations on step command Buzzing or other undesirable audible noises

Pay attention to the control output levels (DAC output). When the control output starts clipping, the actual position will start oscillating. To get a fair idea of how resonant the actual position is, keep the control output out of clipping. To do this, lower the size of the step command. An example:

image here
 

Excessive oscillation on 100 count step move

Green - Commanded Position
Yellow - Actual Position
Red - Position Error    
White - DAC Output
 

Kp = 2000
Kd = 1200

 

 

Acceptable overshoot (26%) on 100 count step move

Green - Commanded Position
Yellow - Actual Position
Red - Position Error    
White - DAC Output
 

Kp = 100
Kd = 2000

Reducing the commanded step improves the settling picture somewhat. During tuning, attention should be paid to keeping the clipping of the DAC. Keeping the DAC command out of clipping (mostly) reduces the number of overshoots from 9+ (above) to 7/8 with no change in Kp.

 

3. Optimize Ki

Once you have tuned Kp, start to tune Ki. Set ImaxMoving and ImaxRest to the same value as Output Limit. In this case Output Limit is 32767.
          - ImaxMoving = ImaxRest = Output Limit = 32767

Ki is the last closed loop parameter, so we will want to turn up Ki until we get the specified overshoot. Turning up Ki will close the steady state error.

 

Acceptable overshoot (50%) on 100 count step move

Green - Commanded Position
Yellow - Actual Position
Red - Position Error    
White - DAC Output
 

Kp = 100
Ki = 0.43

Kd = 2000

 

Integral Limits

In a PID system, the proportional (Kp), derivative (Kd), and integral (Ki) terms all contribute to the total controller output (the three terms are added together). When a system oscillates at low frequency (the frequency varies, but is often a few Hertz lower), the integral term is likely the term that is oscillating. Kp and Kd are along for the ride are not affected. In an effort to control an oscillation due to the integral term, we can limit how much it contributes to the controller output. We limit the maximum contribution of the integral term while the stage is at rest with IMaxRest. We limit the maximum contribution of the integral term during a motion with IMaxLimit. There are several ways you can set these limits:

Full integral effect always - By setting IMaxRest and IMaxLimit equal to Output Limit, you will have no effective limit on the integral term. (IMaxRest = IMaxLimit = Output Limit)

Full integral at rest - Some systems may already cause enough disturbances when set in motion. The integral will simply make things worse by trying to compensate for the disturbances. If an integral term is still needed to close steady state error, setting IMaxLimit to zero and IMaxRest equal to Output Limit will turn off the integral during motion, thereby enhancing stability.

     To close steady state error when in motion, (Integral is ON)
          - IMaxLimit = 0
          - IMaxRest = Output Limit

     To close steady state error when at rest, (Integral is OFF)

Half integral limit - It is possible to tune a stage so that it visually appears stable when in reality it is very unstable and may result in violent oscillation when the stage is grossly disturbed (ex: some large external force jars the stage). This is likely the result of an oscillating integral. By setting the integral limit to far less than the Output limit, integral oscillation can be damped out by the proportional and derivative terms. This is why it is important to set the integral limit to be larger than what is typically used during normally operation while also making sure that it is still significantly less than the output limit. It is often good to start with half of the output limit.

Previous | Next


       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2021 Motion Engineering