PID - The most difficult system so far.

Join Date
Apr 2002
Location
No income tax, no capital gains tax. Freedom!
Posts
8,351
The goal this week is to tune a very difficult system using both feedwords and a PID.

System requiring PID AND Feed Forward tuning

This system is too difficult to tune by just cranking up the gains. The feed forwards must be used too. Even with the feed forward the system still has some pretty big error. If you look through the spread sheet you will see the error often get to .125 inches which is too high for many purposes.

The system is like a motor system with a flexible coupling. The motor adds the time constant and the integrating the velocity to position. The flexible coupling adds the complex poles. If you remember, complex poles ring or oscillate. A springy coupler is detrimental to performance yet I see too many applications that use them just because it makes like easier for the mechanical 'engineers'.

A hydraulic system can be modeled like this with caution. The real pole is from the valve response and the complex pair of poles comes from the cylinder. A hydraulic cylinder is really a mass on a spring. The problem with hydraulics is that nothing is linear. A well designed hydraulic system will not be too non-linear.

If you can tune this system then you can tune just about any reasonable system. This is the last of the tuning exercises.
Hopefully you have modified or experimented with the spread sheets or look at the formulas that are used in them.

BTW, the ISE to beat is 268.79. If you have difficulty in tuning this system then reduce the frequency of the target at cell E5.
 
I just realized that I screwed up.

I sent the file with my answers. oops. :oops: I ruined the fun.
Now what? I am p!ssed at myself. It took a lot of effort to make this spread sheet so that it was on-the-edge, but still working. I still encourage you to experiment.

Rytko, the transfer function for this system is

Code:
             G*alpha*omega^2
T(s)=----------------------------------------
     s*(s*alpha)*(s^2+2*zeta*omega*s+omega^2)

Where:
G is the gain in inches per second per volt
alpha is 1/time constant. This is the real pole.
zeta is the damping factor.
omega is the natural frequency in radians per second. rps=2*PI*Hz
This is not a simple system.

Omega and zeta define the complex poles. These represent a mass on the spring.


Notice:

As s goes to zero the transfer function approaches a gain of G.
It is much easier to tune at lower frequencies.
It takes much more control signal to tune at higher frequencies. This is not only because of the higher speed but also because of the required acceleration and jerk


While writing this I just got a pm telling me I screwed up.
oops. I guess I was in too much hurry to enjoy the sun.
 
It's not very often that I will admit defeat. I could not tune the spreadsheet well enough to even post results. Nothing "logical" I did seemed to help, the best I could do was around 2000. I will try again when I have time.
 
I said it is tough.

allscott said:
It's not very often that I will admit defeat. I could not tune the spreadsheet well enough to even post results. Nothing "logical" I did seemed to help, the best I could do was around 2000. I will try again when I have time.

Hint, reduce the frequency of the target on cell E5 to 1 HZ. You should be able to tune it at 1 HZ. Tune it at 1 HZ and then increase the target frequency back to 5 HZ.

Hint, get the feed forwards right. There is no way this system can be tuned with the PID gains alone.

This system is hard to tune because the natural frequency is only 10 HZ or 62.83 radians per second. The natural frequency of the system should be much higher than the frequency that you wish to move the actuator which in this case is 5 HZ. Notice that there is no way you can tune the system at 6 HZ as the control output saturates at +/- 10 volts. There is also a real pole, but it is not the worst that you have seen. However, the combination of all the poles make tuning more difficult and the individual poles.

To make life easier one would want to increase alpha which decreases the real poles time constant ( alpha = 1/time constant ). This would be like getting a faster responding valve or increasing the ration of torque to interia on a motor. Increasing the natural frequency ( omega ) also helps. The can be done by making the diameter of the hydraulic cylinder larger. On a motor would would make the shaft the load is on less flexible ( larger diameter or shorter ).

I am surprised that no one has asked me about the jerk feed forward.
It doesn't surprise me that people would have trouble tuning this system.
 
PID
Kp 7.500
Ki 10.000
Kd 0.000
Kv 0.120
Ka 0.005
Kj 0.000

ITAE 242.007


That was tough, I'm not sure I understand why these values work. I couldn't get the jerk value to do anything good for me. It was definately a help starting at lower freq. I don't think this system would respond well to any fluctuations.

Interesting, thanks Peter
 
Another oops

Kj , jerk feed forward, should be formated as having 6 decimal places. Kj is smaller than .001. There is nothing keeping you from entering smaller numbers, but it isn't obvious to do so. Sometimes you must think outside the box.

Allscott. That is pretty good. Try again using the feed forwards.

BTW, Kv is alway 1/G. In this case it should be .2. It works for me.
 
Last edited:
Peter:

Kp 11.500
Ki 69.300
Kd 0.300
Kv 0.130
Ka 0.0055
Kj 0.000047

ISE 112.026

That was a challenge . . .

Marc
 
Peter,

kp = 8.0
ki = 100
kd = 0.11
kv = 0.126
ka = 0.0055
kj = 0.000025
ise = 46.632

It was very hard. Also, the graph at the start time doesn't look very good. First half of period actual doesn't track target.

Paul.
 
paulB, that is very good.

I plugged in your numbers and the control and motion still look very smooth. The reason why the actual can't track the target during the first few milliseconds is that the velocity instantaneously starts at over 31 inches per second. I didn't properly ramping the target so that the position, velocity, accelerations and jerk all start at 0. This is why the target generator is SO important. The first my target generator is unacceptable for a real motion application.
 
I plugged in PaulB's numbers and am getting ISE of 502.845 (that is at target frequency of 5 Hz). Is something wrong with my Excel file?

My best attempt (before I got tired) is ISE = 108.289 with the following parameters:

Kp 38
Ki 350
Kd 0.32
Kv 0.6
Ka 0.006
Kj 0.00004
 
Ladder logic, something is wrong.

LadderLogic said:
I plugged in PaulB's numbers and am getting ISE of 502.845 (that is at target frequency of 5 Hz). Is something wrong with my Excel file?

My best attempt (before I got tired) is ISE = 108.289 with the following parameters:

Kp 38
Ki 350
Kd 0.32
Kv 0.6
Ka 0.006
Kj 0.00004

I have verified PaulB's numbers. They look good.

Ladder logic, your numbers do not provide the ISE of 108.289. Are you sure you are tuning the spread sheet as it is on the website?
 
Peter, my bad.

I've changed target generator amplitude from 1 to 2 - just so the graph reads better. Only now I realized it affected all the numbers dramatically.

My apologies to you and PaulB. Anyway, the experience of trying to tune the system - even not with the numbers you intended - is invaluable. Thanks a lot.
 
There is more to this than geting the lowest ISE

Ladder Logic, if you increased the amplitude to 2 then you should have noticed that the control output saturates at both +10 and -10 volts. It is not good to have a PID saturate. Many PIDs will suffer from integrator wind up with resulting overshoot. This PID doesn't because use a incremental or velocity form of PID.


WARNING MATH AHEAD!!!

When executing a sinusoidal motion profile the maximum speeds and accelerations are calucated like

Max speed = 2 * pi * frequency * amplitude
Max acceleration = (2 * pi * frequency )^2 * amplitude.
Max jerk = (2 * pi * frequency )^3 * amplitude

When you doubled the amplitude, the maximum speed and jerk were doubled. The resulting maximum speed is

(2*3.14*5 )^2 * 2 = 62.83 inches per second.

The maximum speed of the system is only 50 inches per second. WHY?
Does anybody know?

Other than saturating the control output, you are right, changing the amplitude should have no effect on the tuning.
 
Peter,

Kp 7.000
Ki 44.000
Kd 0.040
Kv 0.100
Ka 0.005
Kj 0.000000
ISE 112.519

I tried to add jerk but it really messsed up the graph.
Thanks,
Bob

A quick guess to your above question ...Resonance.
 

Similar Topics

I have S7 1512C controler for controlling 48 PID temperature loop, the output is PWM. Please I need the best, most efficient way to write the...
Replies
5
Views
212
Hi all, I'm having trouble solving a problem I've been working on for several months, and thought you might like a stab at it. The machine runs...
Replies
22
Views
836
How can I connect PID Output to a valve. In ladder logic program is there any logic do I want to add between valve and PID? PV=SP What will be the...
Replies
7
Views
383
I'm setting up a PID for a 50hp RO pump in a water treatment plant. When I go to manual mode on hmi I set the swm bit, I also ons the pid output%...
Replies
5
Views
523
I am setting up control for Hypochlorite dosing. The easy part is the dosing calculation for flow pacing but I would also like to setup trimming...
Replies
8
Views
889
Back
Top Bottom