0% found this document useful (0 votes)
12 views20 pages

Adem Control Project

The document outlines a control project focused on the speed control of a DC motor, detailing the physical setup, system equations, design requirements, and MATLAB representation. It includes specifications for the motor's parameters, transfer functions, and design criteria for achieving desired performance metrics such as settling time and overshoot. The document also discusses the implementation of PID control strategies to meet these design requirements and provides MATLAB code for simulation and analysis.

Uploaded by

johnasefa702
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views20 pages

Adem Control Project

The document outlines a control project focused on the speed control of a DC motor, detailing the physical setup, system equations, design requirements, and MATLAB representation. It includes specifications for the motor's parameters, transfer functions, and design criteria for achieving desired performance metrics such as settling time and overshoot. The document also discusses the implementation of PID control strategies to meet these design requirements and provides MATLAB code for simulation and analysis.

Uploaded by

johnasefa702
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

College of engineering and technology

Department of electro mechanical eng.


Course ;control project

Tittle speed control of dc motor

Name id

Adem asfaw…………….1402397

Wubetu getaneh……………….

Semahegn yasab………………

Girma Sali………………………..1305539

Mikias gebru……………….
Contents

Physical setup

System equations

Design requirements

MATLAB representation

Physical setup

A common actuator in control systems is the DC motor. It directly provides rotary motion and,
coupled with wheels or drums and cables, can provide translational motion. The electric equivalent
circuit of the armature and the free-body diagram of the rotor are shown in the following figure.

For this example, we will assume that the input of the system is the voltage source ($V$) applied to
the motor's armature, while the output is the rotational speed of the shaft $\dot{\theta}$. The rotor
and shaft are assumed to be rigid. We further assume a viscous friction model, that is, the friction
torque is proportional to shaft angular velocity.

The physical parameters for our example are:

(J) moment of inertia of the rotor 0.01 kg.m^2

(b) motor viscous friction constant 0.1 N.m.s

(Ke) electromotive force constant 0.01 V/rad/sec

(Kt) motor torque constant 0.01 N.m/Amp

(R) electric resistance 1 Ohm


System equations

In general, the torque generated by a DC motor is proportional to the armature current and the
strength of the magnetic field. In this example we will assume that the magnetic field is constant
and, therefore, that the motor torque is proportional to only the armature current $i$ by a constant
factor $K_t $$ T = K_{t} i$$

The back emf, $e$, is proportional to the angular velocity of the shaft by a constant factor $K_e$.

(2)$$ e = K_{e} \dot{\theta}$$

In SI units, the motor torque and back emf constants are equal, that is, $K_t = K_e$; therefore, we
will use $K$ to represent both the motor torque constant and the back emf constant.

From the figure above, we can derive the following governing equations based on Newton's 2nd law
and Kirchhoff's voltage law.

(3)$$ J\dd ot{\theta} + b \dot{\theta} = K i $$

(4)$$ L \frac{di}{dt} + Ri = V - K\dot{\theta}$$

1. Transfer Function

Applying the Laplace transform, the above modeling equations can be expressed in terms of the
Laplace variable s.

(5)$$ s(Js + b)\Theta(s) = KI(s) $$

(6)$$ (Ls + R)I(s) = V(s) - Ks\Theta(s) $$

We arrive at the following open-loop transfer function by eliminating $I(s)$ between the two above
equations, where the rotational speed is considered the output and the armature voltage is
considered the input.
(7)$$ P(s) = \frac {\dot{\Theta}(s)}{V(s)} = \frac{K}{(Js + b)(Ls + R) + K^2} \qquad [ \frac{rad/sec}{V}] $
$

2. Stat Design requirements

First consider that our uncompensated motor rotates at 0.1 rad/sec in steady state for an input
voltage of 1 Volt (this is demonstrated in the DC Motor Speed: System Analysis page where the
system's open-loop response is simulated). Since the most basic requirement of a motor is that it
should rotate at the desired speed, we will require that the steady-state error of the motor speed be
less than 1%. Another performance requirement for our motor is that it must accelerate to its
steady-state speed as soon as it turns on. In this case, we want it to have a settling time less than 2
seconds. Also, since a speed faster than the reference may damage the equipment, we want to have
a step response with overshoot of less than 5%.

In summary, for a unit step command in motor speed, the control system's output should meet the
following requirements.

Settling time less than 2 seconds

Overshoot less than 5%

Steady-state error less MATLAB representation

1. Transfer Function

Model creation
We can represent the above open-loop transfer function of the motor in MATLAB by defining the
parameters and transfer function as follows. Running this code in the command window produces
the output shown below.

J = 0.01;

b = 0.1;

K = 0.01;

R = 1;

L = 0.5;
s = tf('s');

P_motor = K/((J*s+b)*(L*s+R)+K^2)

P_motor =

0.01 P_motor =

0.01

---------------------------

0.005 s^2 + 0.06 s + 0.1001

Continuous-time tr ansfer function

Block diagram representation of dc motor

Block diagram of dc motor

Open-loop response

First create a new m-file and type in the following commands (refer to the main problem for the
details of getting these commands).

J = 0.01;

b = 0.1;
K = 0.01;

R = 1;

L = 0.5;

s = tf('s');

P_motor = K/((J*s+b)*(L*s+R)+K^2);

linearSystemAnalyzer('step', P_motor, 0:0.1:5);

Now let's see how the original open-loop system performs. Add the
following linearSystemAnalyzer command onto the end of the m-file and run it in the MATLAB
command window. You can access the Linear System Analyzer also by going to the APPS tab of the
MATLAB toolstrip and clicking on the app icon under Control System Design and Analysis. In the
command below, the string 'step' passed to the function specifies to generate a unit step response
plot for the system P_motor. The range of numbers 0:0.1:5 specify that the step response plot
should include data points for times from 0 to 5 seconds in steps of 0.1 seconds. The resulting plot is
shown in the figure below, where you can view some of the system's characteristics by right-clicking
on the figure and choosing from the C

harac
LTI model characteristics

Since our open-loop transfer function has the form of a canonical second-order system, we should
be able to accurately predict the step response characteristics observed above based on the transfer
function's pole locations. You can graphically see the location of the poles (and zeros) of the
P_motor system from within the Linear System Analyzer by right-clicking on the plot area and
selecting Plot Types > Pole/Zero from the resulting menu. Performing this action will change the
Linear System Analy

zer to
We can then import this new model into the Linear System Analyzer. This is accomplished by
selecting Import from the File menu at the top of the Linear System Analyzer window. From the
resulting window choose rP_motor from the Systems in Workspace area and then click the OK
button. The Linear System Analyzer will now show plots of both the original and the reduced transfer
functions. You can then switch back to step response plots by again choosing Plot Types using the
Characteristics submenu. You can also add a legend by clicking the legend icon on the toolbar. Now
the Linear System Analyzer should appear as shown below. the following map where the blue x's
identify the locations of poles.

Within this window set the End time (sec) to "5" and the Interval (sec) to "0.1". Then under the
System inputs section of the window, you can import an input signal, or design one from a select set
of choices. In this instance, click the Design signal button and choose a Signal type of Sine wave from
within the window that appears. Then change the Frequency (Hz) to "0.2" and leave the Amplitude
and Duration (secs) as their default values. Then click the Insert button at the bottom of the Signal
Designer window and the Simulate button at the bottom of the Linear Simulation Tool window. The
responses of our two currently identified systems to the sine wave input are then produced in the
Linear System Analyzer window. If you double-click on the y-axis of the plot, you can then change
the limits to match the figure shown below.
Drawing the open-loop root locus

The main idea of root locus design is to predict the closed-loop response from the root locus plot
which depicts possible closed-loop pole locations and is drawn from the open-loop transfer function.
Then by adding zeros and/or poles via the controller, the root locus can be modified in order to
achieve a desired closed-loop response.

We will use for our design the Control System Designer graphical user interface. This tool allows you
to graphically tune the controller via the root locus plot. Let's first view the root locus for the
uncompenstated plant. This is accomplished by adding the command
controlSystemDesigner('rlocus', P_motor) to the end of your m-file and running the file at the
command line or by going to the APPS tab of the MATLAB toolstrip and clicking on the app icon
under Control System Analysis and Design.

One window titled Control System Designer will open initially having the form shown in the figure
below. In the window, you will be able to see both the root locus plot and the closed-loop step
response of the transfer function passed via the controlSystemDesigner function. If the string 'rlocus'
is omitted from the function call, the default initial window includes the Bode plot, in addition to the
root locus plot and closed-loop

DESIGN OF CONTROLER OF DC MOTOR


For the original problem setup and the derivation of the above equations, please refer to the DC
Motor Position: System Modeling page.

For a 1-radian step reference, the design criteria are the following.

Settling time less than 0.040 seconds

Overshoot less than 16%

No steady-state error, even in the presence of a step disturbance input

Now let's design a PID controller and add it into the system. First create a new m-file and type in the
following commands (refer to main problem for the details of getting these Comannds.

J = 3.2284E-6;

b = 3.5077E-6;

K = 0.0274;

R = 4;

L = 2.75E-6;

s = tf('s');

P_motor = K/(s*((J*s+b)*(L*s+R)+K^2));

Proportional control

Kp = 1;

for i = 1:3

C(:,:,i) = pid(Kp);

Kp = Kp + 10;

end

sys _cl = feedback(C*P_motor,1);

let's see what the step responses look like. Add the following code to the end of your m-file and
again run it in the command window. You should generate the plot shown in the figure below.

t = 0:0.001:0.2;

step(sys _cl(:,:,1), sys _cl(:,:,2), sys_ cl(:,:,3), t)

yl abe l ('Position, \theta (radians)')


title('Response to a Step Reference with Different Values of K_ p')

legend('K p = 1', 'K p = 11', 'K p = 21')

window. You should generate the plot shown in the figure below.

back to the block diagram at the top of this page to see the structure of
dist _cl = feedback(P_motor,C);

step(dist_ cl(:,:,1), d ist _cl(:,:,2), dist_cl(:,:,3), t)

ylabel('Position, \theta (radians)')

title('Response to a Step Disturbance with Different Values of K_p')

legend('K p = 1', 'K p = 11','Kp = 21')

ow.
PI control
Let's first try a PI controller to get rid of the steady-state error due to the disturbance. We will set
$K_p$ = 21 and test integral gains $K_i$ ranging from 100 to 500. Change your m-file to the
following and run in the command window. You should generate a figure like the one shown below.

Kp = 21;

Ki = 100;

for i = 1:5

C(:,:,i) = pid(Kp,Ki);

Ki = Ki + 200;

end

sys_cl = feedback(C*P_motor,1);

t = 0:0.001:0.4;

step(sys_cl(:,:,1), sys_cl(:,:,2), sys_cl(:,:,3), t)

ylabel('Position, \theta (radians)')

title('Response to a Step Reference with K_p = 21 and Different Values of K_i') Let's first try a PI
controller to get rid of the steady-state error due to the disturbance. We will set $K_p$ = 21 and test
integral gains $K_i$ ranging from 100 to 500. Change your m-file to the following and run in the
command window. You should generate a figure like the one shown below.

Kp = 21;

Ki = 100;

for i = 1:5

C(:,:,i) = pid(Kp,Ki);

Ki = Ki + 200;

end

sys_cl = feedback(C*P_motor,1);
t = 0:0.001:0.4;

step(sys_cl(:,:,1), sys_cl(:,:,2), sys_cl(:,:,3), t)

ylabel('Position, \theta (radians)')

title('Response to a Step Reference with K_p = 21 and Different Values of K_i')


Now let's see what happened to the step disturbance response. Change the following commands in
your m-file and re-run in the command window. You should generate a plot like the one shown in
the figure below.

dist_cl = feedback(P_motor,C);

step(dist_cl(:,:,1), dist_cl(:,:,2), dist_cl(:,:,3), t)

ylabel('Position, \theta (radians)')

title('Response to a Step Disturbance with K_p = 21 and Different Values of K_i')

legend('Ki = 100', 'Ki = 3 00', 'Ki = 500);


The integral control has reduced the steady-state error to zero, even when a step disturbance is
present; that was the goal for adding the integral term. For the response to the step reference, all of
the reponses look similar with the amount of oscillation increasing slightly as $K_i$ is made larger.
However, the response due to the disturbance changes significantly as the integral gain $K_i$ is
changed. Specifically, the larger the value of $K_i$ employed, the faster the error decays to zero. We
will choose $K_i$ = 500 because the error due to the disturbance decays to zero quickly, even
though the response to the reference has a longer settling time and more overshoot. We will
attempt to reduce the

PID control
Adding a derivative term to the controller means that we now have all three terms of the PID
controller. We will investigate derivative gains $K_d$ ranging from 0.05 to 0.25. Go back to the m-
file and make the following changes. Running the altered m-file will generate a graph like the one
shown below.

Kp = 21;

Ki = 500;

Kd = 0.05;

for i = 1:3

C(:,:,i) = pid(Kp,Ki,Kd);

Kd = Kd + 0.1;

end

sys_cl = feedback(C*P_motor,1);

t = 0:0.001:0.1;

step(sys_cl(:,:,1), sys_cl(:,:,2), sys_cl(:,:,3), t)

ylabel('Position, \theta (radians)')

title('Step Response with K_p = 21, K_i = 500 and Different Values of K_d')

legend('Kd = 0.05', 'Kd = 0.15', 'Kd = 0.25')


looks like when $K_d$ = 0.15, we can meet our design requirements. To determine the precise
characteristics of the step response you can use the right-click menu of the step response plot, or
you can use the MATLAB command stepinfo as shown below.

stepinfo(sys_cl(:,:,2))

ans =

struct with fields:

RiseTime: 0.0046

SettlingTime: 0.0338

SettlingMin: 0.9103

SettlingMax: 1.1212

Overshoot: 12.1175

Undershoot: 0

Peak: 1.1212

PeakTime: 0.0122

From the above, we see that the response to a step reference has a settling time of roughly 34ms (<
40 ms), overshoot of 12% (< 16%), and no steady-state error. Additionally, the step disturbance
response also has no steady-state error. So now we know that if we use a PID controller with

$K_p$ = 21, $K_i$ = 500, and $K_d$ = 0.15,

all of our design requirements will be satisfied.

You might also like