
Unable to use Control System Designer
11 views (last 30 days)
Show older comments
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);
0 Comments
Answers (1)
Sam Chak
on 26 Oct 2023
Hi @Oz Etkin
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])
% Output-feedback loop around the plant
Gop = feedback(Gp, 1)
% Lead Compensator
Gcom = tf([1 0.154576728846433], [1.22 0.4514])
% PID Controller
kp =-0.2373603269352;
ki = 3.33027773665483;
kd = 1.20979357225304;
Tf = 0.292291195404121;
Gpid = pid(kp, ki, kd, Tf)
% Closed-loop system
Gcl = feedback(Gpid*series(Gcom, feedback(Gp, 1)), 1)
% 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')
0 Comments
See Also
Categories
Find more on Classical Control Design in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!