rlocus and rlocfind for closed-loop

I have to create a matlab code on these plots and get a printout, but whatever code I tried, it always gave an error. I could not get a graphic. I need code to run this closed loop system

6 Comments

Paul
Paul on 27 Jan 2021
Edited: Paul on 27 Jan 2021
What code have you tried so far? What is the error?
Numan Gürkan
Numan Gürkan on 27 Jan 2021
Edited: Numan Gürkan on 27 Jan 2021
First I wanted to start in the command window, but I got this error
clc;
clear all;
num = [55.5556];
den =[1 227.7778];
sys = tf (num, den)
rlocus(sys)
then i wanted to use this code
but i am getting this error;
Check for missing argument or incorrect argument
data type in call to function 'tf'.
Error in Untitled (line 7)
sys = tf (num, den)
@Paul I don't know where I went wrong, actually I don't know much about this. i don't know where and how to start
Paul
Paul on 27 Jan 2021
Edited: Paul on 27 Jan 2021
It looks like there is a fucntion tf() on the path that is shadowing the tf() function in the Control System Toolbox. What are the results of
>> which tf -all
The first line of the result should be:
C:\Program Files\MATLAB\R2019a\toolbox\control\ctrlmodels\@tf\tf.m % tf constructor
Once past this issue, then it looks like you're on the right path (except for the typo in den as compared to the diagram). But the transfer function for the Mechanical Ball needs to be defined too, and then look at the rlocus for the product of the transfer functions for the RL Coil Circuit and the Mechanical Ball.
@Paul This is the result. It looks like a controller at your end, but it seems parametric to me. How can i fix this.
I don't know how to define for the mechanical ball I wanted to make an RL coil circuit at the beginning and then I was thinking of writing the same code again for the mechanical ball
It looks like the Control System Toolbox is not installed, which will make this problem much more difficult than it would be otherwise. Recommend you check with whoever is respoosible for your installation and make sure you have all of the toolboxes you need installed and licensed. It should look like this if you have all toolboxes installed:
>> which tf -all
C:\Program Files\MATLAB\R2019a\toolbox\control\ctrlmodels\@tf\tf.m % tf constructor
C:\Program Files\MATLAB\R2019a\toolbox\control\ctrlmodels\@DynamicSystem\tf.m % DynamicSystem method
C:\Program Files\MATLAB\R2019a\toolbox\ident\ident\@idParametric\tf.m % idParametric method
C:\Program Files\MATLAB\R2019a\toolbox\mpc\mpc\@mpc\tf.m % mpc method
C:\Program Files\MATLAB\R2019a\toolbox\shared\controllib\engine\@StaticModel\tf.m % StaticModel method
For thiis problem you won't need the Model Predictive Toolbox, but you should have the Control System Toolbox.
If you had the Control System Toolbox you would define the transfer function for the ball the same way you've tried to do it for the circuit using the numerator and denominator coefficients as shown in the block diagram.
Yes the toolbox is missing, I installed it and it was fixed. Thank you. Now I just have to set the code. thank you again for your help

Sign in to comment.

Answers (0)

Asked:

on 26 Jan 2021

Commented:

on 28 Jan 2021

Community Treasure Hunt

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

Start Hunting!