How to put the parameter of a controller as an increasing variable, so that after each simulation it increases itself and simulates automatically. I do not want to enter a value each single time manually and wait for the simulation.
이전 댓글 표시
I have a PI2DOF Controller. I want to check the results(scope) with different I- Parameters of the Controller. For example from (0.1 to 3.0). How can I put this Parameter as an increasing variable, which increases by 0.1 after each Simulation? I cannot enter each value manually after each Simulation. I want to see the difference in the behaviour with all These 0.1 to 3.0 I- Parameters of the Controller. Please help!
답변 (1개)
Naty S
2016년 2월 3일
1 개 추천
The parameter you want to test should be taken from the workspace, then you could run the simulation in a for loop in a matlab code using the sim command http://www.mathworks.com/help/simulink/ug/using-the-sim-command.html
after that you could just plot the data you need with the hold all command.
Besides that simulink has some good tolls using the PID Tune controller to examine the gain, you main want to test those.
댓글 수: 6
Matina Baradaran
2016년 2월 3일
Naty S
2016년 2월 3일
Hi Matina,
I am uncertain if what you suggested works. I think it might be simplier using the following block to change value: http://www.mathworks.com/help/simulink/slref/fromworkspace.html
Naty
Matina Baradaran
2016년 2월 3일
Naty S
2016년 2월 3일
Hey, This is for the case if you PID control parameters are external, you can also make them internal and just write in the Integral place some variable name and change it between each run in the workspace.
e.g for internal case
Int_vec=[0.1:0.1:0.9];
for i=1:1:length(Int_vec)
I=Int_vec(i)
Data=sim('model')
figure;
plot(Data.something)
end
where "I" is the variable in the PID Integral parameters.
Matina Baradaran
2016년 2월 3일
Matina Baradaran
2016년 2월 3일
카테고리
도움말 센터 및 File Exchange에서 Real-Time PID Autotuning에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!