Discussion in 'Homework Help' started by YukiWong, Dec 6, 2011.

1. ### YukiWong Thread Starter New Member

Dec 5, 2011
27
1
Hi all,

I have an first order plus time delay system with K=58.46, T(time constant)=0.55s, Td(Time delay)=0.06s and i had some trouble in design this PI Controller by using Ziegler Nichols tuning method.

The system is defined as G=58.46/(0.55*s+1)*exp(-0.06*s)

There is some calculation given by ZN tuning method for FOPDT system
where Kc=0.9*T/(K*Td) and Ti=3.33*Td

I had work out for the Kc and Ti and found that

Kc=0.9*0.55/(58.46*0.06)=0.1411

Ti=3.33*(0.06)=0.2

Gc is given that Kc*[1+(1/Ti*s)],
so Gc=0.1411*[1+(1/0.2s)] = 0.1441*[(0.2s+1)/0.2s]

but once i put this Gc into my system by Simulink, my wave seen oscillated very much. Can anyone tell me what i had done wrong and which parameter should i tunning ? Can i tune the Kc from 0.1411 to another value like 0.7?
Thankyou very much.

Last edited: Dec 6, 2011
2. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
784

In any event it looks like your simulation time step is too coarse. Try making your time step an order of magnitude smaller.

I did a simulation using another application using your values and the response looked fine. My time step was 1msec.

I notice however your PI proportional gain in the block diagram is 0.1441 whereas you have Kc as 0.1411 in the post body text.

YukiWong likes this.
3. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
784
When I say the response looked "fine" I should qualify that description and say that the response was probably overly oscillatory. See my attachment.

Given the overshoot is of the order of 70% I would suggest a reduction in the PI gain would possibly improve matters.

• ###### Time Response of system with transport delay..png
File size:
6.1 KB
Views:
21
YukiWong likes this.
4. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
784
However reducing the gain too much will lead to other problems as the phase margin of the combined PI controller and System decreases.

YukiWong likes this.
5. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
784
Also keep in mind the Ziegler-Nichols method is based on an experimental approach in which one disables the 'I' control in the closed loop and then increases the P gain until the loop goes into quasi-steady-state oscillation.

The observed proportional gain at oscillation onset and the measured period of self oscillation are then used to propose a stable set of PI settings.

I'm not sure how well Ziegler-Nichols predicts the PI parameters for systems with transport delay.

I played around the the P gain and got the loop oscillating at a P gain of ~0.25. The oscillation period was 0.23 sec. Wikipedia suggests the gain should be backed off to 0.25/2.2=0.114. The I gain would be set to 2*0.114/0.22=1.04. Interestingly this produces an even more oscillatory response [~80% overshoot] when I plug the values into my simulation. This then makes me wonder whether Ziegler-Nichols is actually the correct approach.

As a matter of interest I am using a 3/4th order Pade approximation of the 0.06sec transport delay - my simulation application doesn't have a means of emulating a continuous pure delay when working in the 's' domain.

Last edited: Dec 7, 2011
YukiWong likes this.
6. ### YukiWong Thread Starter New Member

Dec 5, 2011
27
1
Thank you very much,thats my fault on block diagram, it suppose 0.1411.

7. ### YukiWong Thread Starter New Member

Dec 5, 2011
27
1
What is the "Sample Time" on the red circle stands for? it was -1 and when i change it to 0.02, it show another oscillation which is more smooth but still 70% overshoot.

That is a different between them, how should i select my Sample Time?

8. ### steveb Senior Member

Jul 3, 2008
2,433
469
The sample time is critically important to get the right answer. The -1 means the sample time is inherited, which just means it will match the sample time of other blocks it is attached to. This is the usual setting. When you set a particular number, like 0.02, you are forcing a discrete time sample time. Since you seem to be modeling a continuous time system, I would think you don't want 0.02, but -1.

Somewhere else, in one of the other blocks, there should be a 0 for the sample time, which results in continuous time modeling. In this case the timestep parameter in the simulation configuration menu will set the sample time. You'll want to make sure that you are using a good numerical method (like Runga Kutta, ODE4) and a sufficiently small sample time (much smaller than the system dynamics and time constants). The coarse plotting is likely a result of the time step being too large. Or, it's possible that the decimation setting on the scope is too high (use decimation of 1).

I think t_n_k is on the right track here. As he says, he is using a Pade approximation because of the limitations of Matlab linear system tools. Simulink has more capability to model delay, and it would be interesting to use Simulink to compare the real transport delay with the Pade approximation.

The Ziegler-Nichols is one approach to use, but you probably would want to tweak the final values. The thing is, you haven't established any other constraints on overshoot and risetime, and you are not looking at the open loop gain and phase margin to make judgements. Obviously stability is an implied constraint, but you have stability. So, one could argue that your solution is acceptable since you used a method and got a result that is nearly an acceptable solution. With further constraints on margins, or on overshoot/risetime, you would tweak the gains further, and have less overshoot and less ringing.

Last edited: Dec 7, 2011
YukiWong likes this.
9. ### YukiWong Thread Starter New Member

Dec 5, 2011
27
1
File name: zabpidtesting2.mdl File size: 26.86 KB

The constraints on overshoot is about 20%. If i wish to get a overshoot of 20% can i just tune to the gain to 0.025 as the picture shown below which get the result of overshoot ~20% ?

Last edited: Dec 7, 2011
10. ### steveb Senior Member

Jul 3, 2008
2,433
469
Your file looks pretty good. You are using a variable step solver with tolerance of 1e-3. I recommend setting the tolerance to 1e-6, for better accuracy.

You may want to consider changing the PI zero location as well as the gain. You can use a higher gain if the zero is moved to lower frequency. But, you are basically on the right track.

YukiWong likes this.
11. ### YukiWong Thread Starter New Member

Dec 5, 2011
27
1
Ok, thank you very much.
Do you mean from the picture below, i m doing right track? Can i just tune the gain from 0.1411 to 0.025? In ziegler nichols rules, is that possible to change the zero to lower frequency?

12. ### steveb Senior Member

Jul 3, 2008
2,433
469
Yes, you are on the right track. Lowering the gain would seem advisable. However, lowering the zero frequency might also help improve the response time while still meeting the overshoot requirement. For example, I've attached a block diagram and plot using a gain of 0.1 and a zero frequency of 5 rad/s.

File size:
32 KB
Views:
24
• ###### Screen shot 2011-12-07 at 3.42.49 PM.png
File size:
8.7 KB
Views:
19
YukiWong likes this.
13. ### steveb Senior Member

Jul 3, 2008
2,433
469
I thought it would be interesting to show the effect of approximating the pure delay with a Pade approximation.

I've attached a block diagram for the simulation and plot of the step and phase response of the Pade approximation.

Then I show two plots that compare the system response with pure delay and the Pade approximation. The overall response is very accurate and the difference can only be seen in the plot that magnifies the beginning of the response.

Overall the approximation is quite good and useful and does not impact predictions of stability, ringing, overshoot, rise time etc.

File size:
32.7 KB
Views:
51
File size:
39.4 KB
Views:
21
File size:
37 KB
Views:
26
• ###### Simulation Comparison Magnify.png
File size:
34.2 KB
Views:
20
YukiWong likes this.
14. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
784
Thanks Steve,

Very interesting what you have done. Your other insights in this thread much appreciated.

I've found the attached document also a good summary of the Pade approximation as it makes particular reference the 's' domain approximation of pure transport delay.

File size:
62 KB
Views:
17
steveb and YukiWong like this.
15. ### YukiWong Thread Starter New Member

Dec 5, 2011
27
1
Thank you again steveb

In Ziegler Nichols rules, it said that we can tune the gain, but is that possible we can tune the zero frequency or did Ziegler Nichols said that we can tune the zero frequency? Because i need to write a report of this, so i have to follow the rules of Ziegler Nichols.
Thank you very much in helping me searching for the answer. Appreciate it very much.

16. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
784
YukiWong likes this.
17. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
784
My understanding at this point of time is that Ziegler-Nichols settings were initially proposed to produce a good response for a first order system with dead time - supposedly something commonly encountered in practical industrial control situations. So I've learned something useful.

In essence the Ziegler-Nichols method simply leads to settings for the PI or PID parameters using an experimentally based approach - with observations made on the actual plant + control system in question.

Ultimately one normally has complete freedom as to the setting of both the proportional gain and the integral gain / zero frequency etc. Whether the chosen settings are optimal is another matter. Hence the requirement for a final tweaking is not unexpected.

As an additional observation it might be worth considering what benefit there may be in adding the D control element to the mix - to make it PID rather than just PI control.

YukiWong likes this.
18. ### YukiWong Thread Starter New Member

Dec 5, 2011
27
1
Thankyou very much T_N_K.
This might help me in writing report.

19. ### YukiWong Thread Starter New Member

Dec 5, 2011
27
1
You means that we can tune everything freedomly? Actually from my calculation and block diagram, do i did anything wrong that cause me had 70% overshoot by using Z-N method?

20. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
784
No - not as far as I can see.

If the plant is of the form

$G(s)=\frac{Ke^{-Ls}}{1+Ts}$

Then, based on the literature on PI control one would apparently set

$K_p=\frac{0.9}{a}$

and

$T_i=3L$

Where

$a=\frac{KL}{T}$

and the PI control block is defined by

$PI(s)=K_p(1+\frac{1}{T_i s})$

For your plant values this would give Kp=0.14 and Ti=0.18

And these settings certainly give ~70% overshoot.

I hate to labor the point but the Ziegler-Nichols approach evolved out of a 'trial-and-error' methodology developed in the early 1940's. It's not my intention to devalue the contribution of Ziegler in any way, but it's surprising we still place so much emphasis on the method given the advances in our understanding since then.

Clearly in this situation the Z-N method gives an overly oscillatory response. Perhaps one should go back to the original 1940's publication and review the exact reasons as to why Z-N chose this methodology.

YukiWong likes this.