Unable to use Control System Designer

11 views (last 30 days)
Oz Etkin
Oz Etkin on 25 Oct 2023
Answered: Sam Chak on 26 Oct 2023
I have been trying to open the root locus editor using the code below. Every time, I get this error:
"Error using rltool
Invalid or deleted object.
Error in hw3 (line 22)
rltool(sys3);"
If I copy and paste the code to the command window or try to open the control system designer from the apps toolbar, I get this error:
"Error using rltool
Operands to the logical AND (&&) and OR (||) operators must be convertible to logical scalar values. Use the ANY or ALL functions to reduce operands to
logical scalar values."
Does anyone know how I can fix this?
sys3=tf(1.22*[1 0.37],[1 .80 1.8 0]);
rltool(sys3);
Error using rltool
This functionality is not available on remote platforms.

Answers (1)

Sam Chak
Sam Chak on 26 Oct 2023
Please post the full code because the error message appears to have something to do with logical operations involving things (aka "operands" in computing terms) like numbers, objects, or strings that cannot be converted to logical scalar values.
However, I'm able to call out the Control System Designer app and make the plant respond 10 times faster using a combination of a Lead Compensator and a PID Controller, as shown below.
% The open-loop unstable plant
Gp = tf(1.22*[1 0.37], [1.0 0.8 1.8 0.0])
Gp = 1.22 s + 0.4514 --------------------- s^3 + 0.8 s^2 + 1.8 s Continuous-time transfer function.
% Output-feedback loop around the plant
Gop = feedback(Gp, 1)
Gop = 1.22 s + 0.4514 ------------------------------- s^3 + 0.8 s^2 + 3.02 s + 0.4514 Continuous-time transfer function.
% Lead Compensator
Gcom = tf([1 0.154576728846433], [1.22 0.4514])
Gcom = s + 0.1546 --------------- 1.22 s + 0.4514 Continuous-time transfer function.
% PID Controller
kp =-0.2373603269352;
ki = 3.33027773665483;
kd = 1.20979357225304;
Tf = 0.292291195404121;
Gpid = pid(kp, ki, kd, Tf)
Gpid = 1 s Kp + Ki * --- + Kd * -------- s Tf*s+1 with Kp = -0.237, Ki = 3.33, Kd = 1.21, Tf = 0.292 Continuous-time PIDF controller in parallel form.
% Closed-loop system
Gcl = feedback(Gpid*series(Gcom, feedback(Gp, 1)), 1)
Gcl = 4.76 s^4 + 5.569 s^3 + 15.78 s^2 + 7.467 s + 0.795 -------------------------------------------------------------------------- 1.22 s^6 + 5.601 s^5 + 13.69 s^4 + 21.32 s^3 + 22.54 s^2 + 8.165 s + 0.795 Continuous-time transfer function.
% Comparison of Step responses
subplot(211)
S1 = stepinfo(Gop);
step(Gop), hold on, grid on
xline(S1.SettlingTime, '--', sprintf('Ts: %.3f s', S1.SettlingTime), 'color', '#7F7F7F', 'LabelVerticalAlignment', 'bottom')
subplot(212)
S2 = stepinfo(Gcl);
step(Gcl, 6), grid on
xline(S2.SettlingTime, '--', sprintf('Ts: %.3f s', S2.SettlingTime), 'color', '#7F7F7F', 'LabelVerticalAlignment', 'bottom')

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!