LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID control - why is the overshoot so long?

Hello,

 

I have a PID control program and something is wrong.

 

The output from the PID is converted to a percentage, this then becomes a PWM signal for my servo motor. The problem is that I seem to get overshoot that takes far to long to go away. It seems to sit in steady state for a while before trying to come back down to the setpoint

 

I though this may be integral windup but I tried resetting the PID when the setpoint and sensor value are close but this gave me an unstable output.

 

Any help is appreciated, the graphs are attached. 

 

Thanks

Adam 

0 Kudos
Message 1 of 60
(16,578 Views)

 

 

?

 

A little less "I" and a little more "P" ?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 60
(16,567 Views)

Hi,

 

It seems the problem is related to your PWM converter. Here is what I think: Meanwhile you have a steady error, the control signal is changing slightly. When it reaches a threshold, the output of the PWM converter changes and eliminates the error.

 

Solution:

1- increase I gain to make the PID output changes steeper (You do not have integration windup as I can see) 

or

2- increase the resolution of PWM converter (in view point of the steps in time)

  

 

Soroush 

Message 3 of 60
(16,563 Views)

Soroush wrote:

Hi,

 

It seems the problem is related to your PWM converter. Here is what I think: Meanwhile you have a steady error, the control signal is changing slightly. When it reaches a threshold, the output of the PWM converter changes and eliminates the error.

 

Solution:

1- increase I gain to make the PID output changes steeper (You do not have integration windup as I can see) 

or

2- increase the resolution of PWM converter (in view point of the steps in time)

  

 

Soroush 


OK, now we have conflisting suggestions. I am not an expert at tuning PIDs so I would like to hear an updates as to what the final solution is so I can learn as well.

 

Thank you,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 60
(16,559 Views)

Thank for the fast replys guys.

 

Ben, I tried your suggestion and the problem is still there for small step inputs but for large step inputs the response is very slow.

 

PID graphs - something wrong more P less I.png 

 

Soroush, I will try you suggestion as soon as I can. 

 

 

Message 5 of 60
(16,534 Views)
What are the values for your PID Gains? It seems from your response that you have a large overshoot. I would also try to decrease P gain. Did you set any output limit range from PID VI?
Andy Chang
National Instruments
Message 6 of 60
(16,530 Views)

Yes I forget the I term is inverted as shown on page 2-1 of the user manual. 

 

Inverse.PNG

 

My bad.

 

We agrre now, leason re-learned.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 60
(16,513 Views)

Adam,

 

If you are using the NI supplied advanced PID or the PID function block, can you post your settings. I would like to see everything, not just the P,I and D.

 

Essentially your graphs show that for a large error SP to PV, the system responds quickly as the gain numbers are what you entered. Once you are close to the setpoint, the gain is reduced so much that it is essentially 0.00. The loop now needs to wait for the "I" to wind up and move the process.

 

What it looks like is that you may have your linearity set to zero. The linearity is a way to accomplish gain scheduling. When the system is far away from the setpoint, it will see the full gain. As you get closer, the gain is reduced in a parabolic fashion. The intent is to allow a system to respond to large changes quickly but turn down the gain when close to the setpoint to provide more stable operation. It works very well, but if set improperly can yield some really confusing results.

 

 

From the PID Function Block Help:

Linearity: Specifies the linearity of the error response. The valid range of linearity values is 0 through 1.0. A linearity value of 1.0 generates a normal linear response, while a value of 0.1 generates an approximately parabolic (square law) response.

 

Greg Sussman
Sr Business Manager A/D/G BU
0 Kudos
Message 8 of 60
(16,501 Views)

To get the optimum response, I would try to tune your PID via Ziegler–Nichols method.

 

 Set I and D to zero. Then increase P gain until the output of the loop starts to oscillate, which indicates that you've reached the ultimate gain Ku and oscillation period Pu

 

Then by  the following formula

 

Ziegler–Nichols method
Control Type Kp Ki Kd
P 0.50Ku - -
PI 0.45Ku 1.2Kp / Pu -
PID 0.60Ku 2Kp / Pu KpPu / 8

 

You should be able to get a better tuned system

Andy Chang
National Instruments
0 Kudos
Message 9 of 60
(16,496 Views)

Ben wrote:

Yes I forget the I term is inverted as shown on page 2-1 of the user manual. 

 

Inverse.PNG

 

My bad.

 

We agrre now, leason re-learned.

 

Ben


Be careful with that, in your formula the notation is different. The I gain Ki would be Ki = Kc/Ti. So unless you were talking about the integral time constant (Ti) it's NOT inverted.

 

Daniel

 

Message 10 of 60
(16,492 Views)