How can I adjust a controller?
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
I am trying to adjust a controller according to the method above.
I can't understand the how to apply this method, this is what I've tried to do so far.
Output1 = initial signal
Output2 = Kp reaches ultimate gain Ku at which the output of the control loop has stable and consistent oscillations.
Output3 = I set the parameters.

채택된 답변
Hi
Your basic procedure is correct, but you mixed up the parameters a bit. I admit that this is a bit confusing, but the structure that the Ziegler-Nichols table is written for is
C(s) = Kp*(1+1/(s*Ti)+s*Td)
I.e. you get Ti and Td, and not Ki and Kd.
Your measured values seem a bit off btw, did you read them from the plot?
You can check the exact values with e.g. the margin command, which gives you the gain margin and the corresponding frequency (i.e. your Ku and Tu). Note that the frequency will be given in rad/s and not Hz, so you need to convert that.
You should also be aware that ZN is a heuristic method, and will not work or return meaningful results for arbitrary plants.
Here a small script to compute the Ziegler Nichols Parameters for a system (programmatically, not with simulink):
% Ziegler nychols example
clear all
close all
clc
% spring damper system with eigenfrequency at 10 rad/s and additional
% rolloff --> Ziegler Nichols returns huge overshoot
M = 1;
D = 8;
K = 100;
% P = tf(90,[M D K])*tf(1,[0.015 1]);
% Better behaved:
s = tf('s');
P = 1/(s+1)^5;
% get gain margin
[ Ku, ~, WKu, ~ ] = margin(P);
fKu = WKu/(2*pi);
Tu = 1/fKu;
fprintf('Limit Kp: %g, Period: %g [s]\n',Ku,Tu)
%%Generate a few PID controllers for comparison
Kn = 0.01; % selecting "real" PID like in your simulation
% select some slow gains
Kp0 = 0.4;
Ki0 = 0.1;
Kd0 = 0.1;
C_PID_0 = pid(Kp0,Ki0,Kd0,Kn);
% set Kp gain limit
Kplim = 0.9*Ku;
Kilim = 0;
Kdlim = 0;
C_PID_lim = pid(Kplim,Kilim,Kdlim,Kn);
% set Ziegler Nichols gains
KpZN = 0.6*Ku;
TiZN = 0.5*Tu;
KiZN = KpZN/TiZN;
TdZN = 0.125*Tu;
KdZN = KpZN*TdZN;
C_PID_ZN = pid(KpZN,KiZN,KdZN,Kn);
fprintf('Ziegler Nichols Parameters:\n')
fprintf('Kp: %g, Ki: %g [s], Kd: %g [s]\n',KpZN,KiZN,KdZN);
%%Close the loop
G0 = feedback(P*C_PID_0,1);
G1 = feedback(P*Kplim,1);
G2 = feedback(P*C_PID_ZN,1);
%%Check Nyquist plot
figure(1)
nyquist(P*C_PID_0,P*C_PID_lim,P*C_PID_ZN)
grid on
axis([ -2.8419 3.6822 -4.7619 4.3024 ])
legend('low gains','limit','Ziegler Nichols')
%%Plot
figure(2)
step(G0,G2)
ylim([- 2 2 ])
legend('Low Gains','Ziegler Nichols','Location','SouthEast')
Cheers
EDIT: typo in ZN gain calculation, fixed
댓글 수: 5
Ced
2016년 3월 29일
I just had a look at my code from last night, there was a typo in the gain calculations, please update them in your code!
The procedure itself should work, however the two zeros at s = 0 are bound to give you problems. Just give it a try! If it doesn't work, ZN also have rules for e.g. PI controllers, you could try this instead.
I have tried to apply, according to your example, to system of 2 DOF but I get errors.
I can attach the code if you want to.

Results
Displacement of Mass 1, X1:
Ku = 14.2481
WKu = 23.3366
fKu = 3.71413
Tu = 0.269242
Kp = 8.54883
Ki = 63.5029
Kd = 0.287713

Dispalcement of Mass2 2, X2:
I have got error
Ku = Inf
WKu = NaN
fKu = NaN
Tu = NaN
Kp = Inf
Ki = NaN
Kd = NaN
Deflection, X1-X2:
Warning: The closed-loop system is unstable.
> In ctrlMsgUtils.warning (line 25)
In DynamicSystem/margin (line 65)
In Untitled (line 35)
Ku = 0.892531
WKu = 16.5515
fKu = 2.63426
Tu = 0.379613
Kp = 0.535519
Ki = 2.82139
Kd = 0.0254113

Hi
Sorry, totally swamped at the moment. As a general rule, ZN should be applicable to 4th order systems, but it depends a bit on the shape of your dynamics. From what you show me, you have an infinite gain margin in X2, meaning that you can increase Kp as much as you want, it will (in theory) never destabilize the system, and the basic idea of ZN does not work anymore.
There is quite a lot of information out there though if you google a bit:
Have you tried using X1 and the deflection as states?
For the record, suspensions are quite a tricky business, that's why there are thousands of publications on it. There are also a lot of control suggestions. Unless you are forced (assignment or so) to use ZN, I would suggest picking one of them for starters. The first link above could be interesting for you.
Thank you for your answer.
It's not compulsory to use ZN method, I have read some papers about suspensions system and they used this method and I thought it is the most appropriate. I just need to use a controller to improve the suspension through a method and not by myself (manually). I will read the links you gave me. The first one seems very good.
I don't understand what you mean here "Have you tried using X1 and the deflection as states?" You refer to state space? If you mean state space, no I haven't tried that. My knowledge is limited. I know a few things about transfer function and simulink.
Thanks again for your help. Can I contact to you via email if I have any question?
Ced
2016년 4월 6일
Yes, I meant using x = [ X1 dX1 E dE ] as your state, where E is the deflection.
Sure, but feel free to continue posting here so others can tune in. I will see it.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Programmatic Tuning에 대해 자세히 알아보기
참고 항목
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
