Control Systems, Matlab, Electrical Engeering

ECE 415 Control Systems, Fall 2021

Computer Project -1

Due: Saturday, Oct 16, 2021

Objective: To learn some of the useful control design tools provided by MATLAB and

to put into practice the concepts seen in class.

Deliverable: A written report containing:

a) For each step, the corresponding block diagrams and any other analytic

design tools used, including derivation of transfer functions for open and

closed loop designs (in other words, provide an explanation for the MATLAB

code given in Part I, and for your own control design in Part II). b) Plots obtained at each step.

c) In Part II only, the MATLAB code used at each step to solve the given


The report should be typewritten, well presented (presentation counts

towards the grade), and in good English. No hand-written report will be

accepted (except, perhaps, for diagrams). Submit it in PDF format via


It is imperative that you strictly adhere to the honor code. This Laboratory will account for 35% of the Projects category.

Part I

In this first part, a motor speed problem is presented, and its solution is given step

by step, together with the corresponding MATLAB instructions. Please follow the

derivation and implement the given code, and, where asked to, provide a

justification for what the code does using block diagrams or mathematical analysis.

0) Consider the DC motor described by the simplified first order differential equation

dy + 60 y = 600u − 1500w


where y is the motor speed, u is the input armature voltage, and w is a load (a

disturbance, from the control design point of view).

Assume the initial conditions are zero, and take the Laplace transform:

Y (s) (s + 60) = 600U (s) − 1500W (s)

Y (s) = 600

s + 60 U (s) −

1500 W (s)

s + 60

We will design open and closed loop proportional (P) controllers for this plant. The

control objective is to minimize steady-state error and provide good disturbance

rejection capabilities.

Open-loop proportional control

The controller is designed by assuming that w = 0 (that is, no external load is applied on the motor). From the final value theorem, we set the controller gain to

K = 60


(justify this choice!).

1) Find the impulse response of the open-loop control system.

% Define the plant: DC motor

num_motor = 600;

den_motor = [1 60];

motor = tf(num_motor, den_motor)

% Open-loop controller

K = 60/600;

ol_cont = tf(K,1)

% Compute the transfer function from reference to output, without


undist_plant = series(ol_cont, motor)

% Plot impulse response


title(‘Open-loop control’)

2) Plot the undisturbed step response, for a step of magnitude 100.

% Plot response to a step of size 100


title(‘Open-loop response to a step of size 100’)

3) Plot the response to a unit step disturbance, setting the reference to zero. Give the block diagram of what you are doing here and in the previous item.

% Compute transfer function from disturbance to output, without


dist_plant = (-1500/600)*motor

% Plot response to a unit step disturbance


title(‘Open-loop response to a unit step disturbance’)

4) Plot the open-loop response when both reference and disturbance are present.

% Compute response to both reference and disturbance

t = [0:0.001:0.1]; % time vector

y_ref = step(100*undist_plant,t); % response due to reference

y_dist = step(dist_plant,t); % response due to disturbance

y = y_ref+y_dist; % total response (applying




ylabel(‘Motor speed’)

title(‘Open-loop response to a step reference of magnitude 100 and a

unit step disturbance’);

% Put undisturbed and disturbed responses in one plot

hold on;


legend(‘With disturbance’,’Without disturbance’)

% try moving the legend with the mouse

grid; % add a grid

hold off;

Closed-loop proportional control

We will first find the transfer function from reference to output:


(s) = 600K

s + (60 + 600K )

(derive it, and provide a block diagram).

Therefore, when W (s) = 0 the output is given by Y (s) = TRY (s)R(s).

Also, the transfer function from disturbance to output is


(s) = − 1500

(derive it, and provide a block diagram).

s + (60 + 600K )

Compute the sensitivity of the closed-loop transfer function 𝑇𝑅𝑌 (𝑠) with respect to changes in changes in controller gain 𝐾. How does it compare with 𝑇𝑊𝑌 (𝑠)?

When R(s) = 0, the output due to the disturbance is given by Y (s) = TWY (s)W (s).

Combining, if both reference and disturbance are present, the total output is

Y (s) = TRY (s)R(s) + TWY (s)W (s).

Considering these results, how would you want to pick the control constant 𝐾? (Explain your rationale!)

We will consider two design choices, and compare their performance:

K1 = 10

K2 = 50

1) Plot the step responses for both controllers in one plot.

% verify motor transfer function


% the two controller gains

K1 = 10;

K2 = 50;

% find the transfer function from R(s) to Y(s) for each controller gain

T1_ry = feedback(K1*motor,1) % the 1 indicates unity feedback

T2_ry = feedback(K2*motor,1)

% find the transfer function from disturbance W(s) to output Y(s)

T1_wy = feedback(motor,K1)*(-1500/600)

T2_wy = feedback(motor,K2)*(-1500/600)

% Plot the response to a step of magnitude 100 without disturbance

clf; % clear figure

step(100*T1_ry); % for controller K1

title(‘Closed-loop response to a step of magnitude 100’)

hold on;

step(100*T2_ry); % for controller K2

legend(‘Using K_1′,’Using K_2’);

hold off;


2) Find an approximation to the steady-state error for both designs from the plot.

zoom on;

% click on the plot with the mouse to find the approximate error value

zoom off;

3) Plot the response to a unit step disturbance for both designs.

% Consider a disturbance step input, with R(s) = 0


hold on;


title(‘Closed-loop response to a step disturbance’);

legend(‘Using K_1′,’Using K_2′);

hold off;


4) Plot the closed-loop response when both reference and disturbance are present.

% Compute the overall response, when R(s)=100/s and W(s)=1/s

t = [0:1e-6:1e-3];

y1_ref = step(100*T1_ry,t);

y2_ref = step(100*T2_ry,t);

y1_dist = step(T1_wy,t);

y2_dist = step(T2_wy,t);

y1 = y1_ref + y1_dist;

y2 = y2_ref + y2_dist;

plot(t,y1,’r’) % plot response using K1 in red

hold on;

plot(t,y2,’b’) % plot response using K2 in blue

legend(‘Using K_1′,’Using K_2’)



ylabel(‘Motor speed’)

title(‘Closed-loop response to a step reference of magnitude 100 and a

unit step disturbance’);

hold off;

Part II

Consider the plant

𝑃(𝑠) = 1

(𝑠 + 1)(𝑠 + 5)

1) What is the plant’s type?

2) Let C(s) = K (a proportional controller). Find the closed-loop transfer function

from reference to output using unity feedback.

3) Choose different gains for K within the range 1 to 100. Plot the unit step response for the different gains. What happens with the transient response of the

closed-loop as K increases?

4) For 𝐾 = 20 find the maximum value attained by the output y(t) and the settling

time Ts for a unit step input (the time it takes the output to settle within a band

of  2% around its final value). Also find what is the steady-state value of y(t)?

What is the steady-state error equal to?

5) Design a controller that will increase the system’s type by 1 and that will yield

the smallest settling time you can obtain for a step input. What is the settling

time? What is the steady-state error?

6) Plot the response of the closed-loop system to a unit ramp using the controller

you designed in part (5).

There are several ways to do this. One is to use the sawtooth command together

with the lsim command to obtain the time response of the system. Another way

is to implement the whole thing in Simulink, using a signal generator block to

produce the ramp input. And a third way still is to use the step command yet

again, noting that the Laplace transform of a unit step is 1

𝑠 , and the Laplace

transform of a unit ramp is 1

𝑠2 = (


𝑠 ) (


𝑠 ).

Record your observations. Is there a steady-state error? If so, what is its


What would happen with the steady-state error if the input were, instead, a train

of steps? You do not need to give a plot for this question, just answer based on

the type number of the plant together with your controller design.

7) Comment on the performance limitations you found in part (5). Do this by

observing what happens if you make 𝐾 very small, or very large.

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
The price is based on these factors:
Academic level
Number of pages
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our Guarantees

Money-back Guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism Guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision Policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy Policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation Guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more