0% found this document useful (0 votes)
72 views

DC Motor Modeling Using MATLAB

1. The document discusses modeling a DC motor system using mathematical equations. It derives differential equations to describe the motor's behavior based on physical laws. 2. It represents the motor system using different models, including transfer functions, state space models, and block diagrams. The state variables are current and angular velocity, with applied voltage as the input and angular velocity as the output. 3. It discusses modeling the system in MATLAB and LabVIEW, including using transfer functions and state space models to simulate and analyze the motor's dynamic response.

Uploaded by

muhmad almtrabie
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views

DC Motor Modeling Using MATLAB

1. The document discusses modeling a DC motor system using mathematical equations. It derives differential equations to describe the motor's behavior based on physical laws. 2. It represents the motor system using different models, including transfer functions, state space models, and block diagrams. The state variables are current and angular velocity, with applied voltage as the input and angular velocity as the output. 3. It discusses modeling the system in MATLAB and LabVIEW, including using transfer functions and state space models to simulate and analyze the motor's dynamic response.

Uploaded by

muhmad almtrabie
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Control Systems Lab

Experiment # 4
System Modeling by MATLAB & Labview

What is a system …?
In general, the system is a collection of some elements and components that
can be organized to take an input and give an output according to it. An example of a
system is the DC motor that consists of coils and magnets and takes voltage as input
and gives a specific motion as output, so it is a system that transforms the electric
energy to a mechanical energy.

What is a plant …?
Typically, control engineers begin by developing a mathematical description
of the dynamic system that they want to control. The system to be controlled is called
a plant. As an example of a plant, this section uses the DC motor and develops the
differential equations that describe the electromechanical properties of a DC motor
with an inertial load and I want to design a controller to its speed so the motor is
called a plant.

What is modeling …?
When we go to the real practical work we only see physical devices and our
job here is to deal with these physical devices and we know that all our dealing in the
university was with mathematical equations, so here we want a translator of the
physical devices to a mathematical presentation. Modeling is the translator that
represents a physical device by its equivalent equations.
In modeling we need some standard physical laws that relate our variables. For
example we know that relation between the voltage and current across a resistor is
directly proportional and related by Ohm's law V= K I . K : is constant (resistor).

Model Representation:

The plant of a system can be represented by:


1. Transfer Function H(s) ,for example

2. State Space Model (SS): is a mathematical model that consist of simultaneous,


first order differential equations and an output equation ,for example

Where A, B, C, and D are matrices of appropriate dimensions, x is the state vector,


and u and y are the input and output vectors.

3. Zero-Pole-Gain Model (ZPK) ,for example

1
Control Systems Lab

4. Frequency Response Model


5. Block Diagram Model
6. Differential Equations

System Modeling: DC Motor


A simple model of a DC motor driving an inertial load shows the angular rate
of the load, , as the output and applied voltage, , as the input. The
ultimate goal of this example is to control the angular rate (speed) by varying the
applied voltage. This picture shows a simple model of the DC motor.

In this model, the dynamics of the motor itself are idealized; for instance, the
magnetic field is assumed to be constant. The resistance of the circuit is denoted by R
and the self-inductance of the armature by L. If you are unfamiliar with the basics of
DC motor modeling, consult any basic text on physical modeling. The important thing
here is that with this simple model and basic laws of physics, it is possible to develop
differential equations that describe the behavior of this electromechanical system. In
this example, the relationships between electric potential and mechanical force are
Faraday's law of induction and Ampere's law for the force on a conductor moving
through a magnetic field.

Mathematical Derivation
The torque τ seen at the shaft of the motor is proportional to the current i induced by
the applied voltage,
EQ.1.1
where Km, the armature constant, is related to physical properties of the motor, such
as magnetic field strength, the number of turns of wire around the conductor coil, and
so on. The back (induced) electromotive force, , is a voltage proportional to the
angular rate seen at the shaft,
EQ.1.2
where Kb, the emf constant, also depends on certain physical properties of the motor.
So R ,L, Km and Kb are parameters which be given by the datasheet of the motor.

2
Control Systems Lab
The mechanical part of the motor equations is derived using Newton's law, which
states that the inertial load J times the derivative of angular rate equals the sum of all
the torques about the motor shaft . The result is this equation,

EQ.1.3

where is a linear approximation for viscous friction (Kf from datasheet).


Finally, the electrical part of the motor equations can be described by

EQ.1.4
or, solving for the applied voltage and substituting for the back emf,

EQ.1.5
This sequence of equations leads to a set of two differential equations that describe
the behavior of the motor, the first for the induced current,

EQ.1.6
and the second for the resulting angular rate,

EQ.1.7

Now EQ 1.6 and 1.7 are differential equations and together describe my DC Motor
system.

Transfer Function Modeling for DC motor


By Laplace transform and substituting the value of I(s) of EQ.1.7 in EQ1.6 ,
we will get one differential equation with input Vapp(s) and the output is the speed of
the motor W(s)
W ( s) Km

V ( s) ( LS  R)( JS  K f )  K m Kb

This T.F. describes the relation between the input voltage and the speed and by
plotting the step response of it we will see how the speed will be changed and show
the behavior of the motor.
L
Some experts said that for many motors the armature time constant is
R
negligible and therefore:

W ( s) Km Km kM
   .
V ( s) JRS  ( K b K m  K f R) JR 1  S m
[1  S ( )]( K b K m  K f R)
Kb Km  K f R
In time domain
d
m   (t )  k M Va (t ).
dt

3
Control Systems Lab
Km
Where kM = is the DC Gain
RK f  K m K b
RJ
τm = is the motor time constant
RK f  K m K b
Also others make Kb = Km = K

But if you don't want the speed as output, instead of it you want the angle of rotation
to be the output then we think about what is the relation between the angular
displacement(angle θ) and the state variable (i or w) and we found that
 (t )
 w(t )  S θ (s) = W(s)
t
then the transfer function that relates the voltage (input) with angle (position) is

 ( s) Km kM
 
V ( s) S (( LS  R)( JS  K f )  K m K b ) S (1  S m )

State-Space Equations for the DC Motor


Given the two differential equations derived in the last section, you can now
develop a state-space representation of the DC motor as a dynamic system. The
current i and the angular rate ω are the two states of the system. The applied
voltage, , is the input to the system, and the angular velocity ω is the output.

The previous state space model represent the output as angular speed and if you want
the angle (position) as output we make some understood changes.

 R Kb 
 0 1
i   L L
  i  L
   K m Kf  
w  0  w   0 Vapp (t )
t    J J   
   0 1 0    0 
   
 
i
y (t )  0 0 1 w  0Vapp (t )
 

4
Control Systems Lab
More Details about state space:

The state space model is one of the representation ways that define a system
and as well as the transfer function defines a system by its numerator and denominator
the state space defines the system by its four matrices A,B,C,D and take the form:

At first, the variable x is called the state variable , u is called the input of the
system.
The state space can be derived from the differential equations directly. If we note that
the two equations 1.6 & 1.7 represent a system (DC Motor) and the state variables are
i & w and the input is Vapp . Matrix A is the coefficient of the state variables (i, w) ,
Matrix B is the coefficient of the input Vapp. The output y is the output of the system
and here we can choose between i or w to be the output or both and we chose the
speed of the motor w to be our output and represent it as y=w by matrix C and D.

Matlab Commands & Labview Structure:

By Matlab:

 tf :This command is used to enter transfer functions or represent the


system by T.F.. For example, to enter the transfer
s2
function, H ( s)  2 ,you would type “H=tf([1 2],[1 0 5])”. The first
s 5
parameter is a row vector of the numerator coefficients. Similarly, the
second parameter is a row vector of the denominator coefficients.

By labview:
 by using construct transfer function model from control design and
simulation library as shown in the figure.

5
Control Systems Lab

 conv: This command is used to convolve two polynomials. It is


particularly useful for determining the expanded coefficients for factored
polynomials. For example, this command can be used to enter the transfer
s2
function H ( s)  by typing “H=tf([1 2],conv([1 1],[1 -3]))”.
( s  1)( s  3)
 Series or * : This command is used to combine two transfer functions that
are in series. For example, if H(s) and G(s) are in series, they could be
combined with the command “T=G*H” or “T=series(G,H)”.

By Labview:

 By using series function from interconnected model in control design and


simulation library.

6
Control Systems Lab

 Parallel : This command is used to combine two transfer functions that are
in parallel. For example, if G(s) is in the forward path and H(s) is in the
feedback path, they could be combined with the command
“T=parallel(G,H)”.

By Labview:

 By using parallel function from interconnected model in control design


and simulation library.

7
Control Systems Lab

 Feedback: This command is used to combine two transfer functions that


are in feedback. For example, if G(s) is in the forward path and H(s) is in
the feedback path, they could be combined with the command
“T=feedback(G,H)”.

By Labview:

 By using feedback function from interconnected model in control design


and simulation library.

8
Control Systems Lab

 ss : This command used to represent a system by state space model and it


takes the four parameter matrices A,B,C,D. For example :
sys = ss(A,B,C,D); So it convert the matrices and define them as a system.

By Labview:

 by using construct state space model from control design and simulation
library as shown in the figure

 tf2ss : converts the parameters of a transfer function representation of a


given system to those of an equivalent state-space representation.
[A,B,C,D] = tf2ss (num,den) returns the A, B, C, and D matrices of a state
space representation for the single-input transfer function.

By Labview:

 By using convert to state space model from model conversion in control


design and simulation library as shown in the figure

 ss2tf : converts a state-space representation of a given system to an


equivalent transfer function representation.
[num,den] = ss2tf(A,B,C,D) returns the transfer function.

9
Control Systems Lab
By Labview:

 By using convert to transfer function model from model conversion in


control design and simulation library as shown in the figure

11

You might also like