Вы находитесь на странице: 1из 32

The differential equations that describes the above system can be written as follow:

V =Ra i+ La

di
+ka
dt

T =J +
B+TL

di 1
Ra
Ka
= V
i

dt La
La
La

d Ka B
1
=
i TL
dt
J
J
J

The above eq.s can be rewritten in state space as follow :

( )( ) (

Ra Ka
10

d i
i +
V
= La La
J 1
dx
Ka B
TL
0J
J
J

()

)(

10
i
= 10 i + J 1 V

01
TL
0J

( ) ( )( ) ( )( )
From the list of parameter values we get:
d i
V
= 100 333 i + 98 0
dx
8.5 1.7
0 2.5 TL

()(

)( ) (

)( )

(i )=(10 01)( i )+(00 00)(TLV )


u= V , x= i
TL

( ) ()

For

then we can rewrite the above matrices eq.s in the following way:

x = 100 333 x + 98 0 u(3)


8.5 1.7
0 2.5

) (

v = 1 0 x+ 0 0 u (4)
01
00

( ) ( )

From the 1,2 equations we can get:

i s+

Ra
1
Ka
= V

La La
La

1
(V Ka)
98( V Ka)
La
i=
=
(5)
Ra
s +100
( s+ )
La

The same can be done to the second equation

( BJ )= KaJ i 1J TL

s+

1
(KaiTL)
2.5(KaiTL)
J
=
=
(6)
B
s+1.7
(s+ )
J

From (5)(6) equations we can draw the block diagram that represent the DC machine as
follow:

Fig(1)

When TL=0 ,and step input the diagram becomes as in fig(2) below:

Fig(2)
And also we can check the unit step response of the system and zero disturbance (TL=0) as
in the fig(3 ) below:

Response of motor system for unit step input


For TL=0 the above block diagram of the motor system can be reduced into a single TF
relating V,
Just as shown the fig.(4)

Reduced form of motor dc fig.(4)

We continue reduce the BD till we get the following shape:

Fig(5) TFBD of motor DC


from the above block diagram we can write it mathematically like so:

833
= 2
(7)
V s +101.7 s +3002.2

Referring to the state space equations (3),(4) ,entering the system into simulink for further
study of the system and to facilitate the process of finding the poles and eigen values ,we
will establish the system in simulink right away,
The system can be drawn in many form as follow:

Block diagram for DC motor fig(6)

It can be seen that the block diagram in the fig(6) has to two input ports connected to
multiplexer whose function basically collecting the inputs lines into one line ,in contrast can
be said about the demultiplexer whose function is to partition the output port line into many
ports, the middle block is reduced shape of the state space which can be drawn in more
details to show the state variables just as in the following ,fig(7)

Fig(*)The block diagram of motor system in more details

The above fig shows clearly what is going on underneath ,where we can see obviously how
the input signal is being integrated and fedback ,and from where the output signal is taken.
After building up the system in simulink now we can go to matlab and insert the matrices of
the system (A,B,C,D)

And then we check the eigen values of the A matix in order to know the poles of the
system ,using eig(A) command as follow:

The system has a pair of complex poles they have negative values which means that the
system is stable ,but we notice that these poles are not as those of the block diagram poles
of fig.(1) which are
s1=-100,s2=-1.7 , this is actually not weird since we didnt take in
consideration the negative feedback gain k=-3.4 , so we have first to samplifiy the block
diagram of fig (1 ) until we reach the form shown in fig(5) now if we solve the characterstic
equation in the denominator of fig(5) to find the roots we will get the same pole values of
eig(A) command.

Current loop design :


For the current control we wish the current to respond to a step change in reference within
about 20ms (e.g. 2% settling in about 20ms ) . we also want the current to follow the
reference with zero state error . we need integral control (ref integral control in lecture
notes). From the note we see that we need to augment the system so that the integral of
current is an extra state .
But before we start design the current loop we will check the controllability of the system by
using the following commands

As you see we first constructed a system called motorsys then we proceeded checking the
controllability and the observability of the system by first building up the controllability and
observability matrices then using the rank command to see whether these matrices
singular or not.

As shown above the matrices are nonsingular with a rank of 2 ,so that the system is
completely controllable and C.O

Now , we start design the current controller as mentioned before since we want the current
to follow the reference input with zero steady state error ,we have to add and an integral to
the state space so the new augmented state space becomes
100 333 0
98 0
0
x ' = 8.5 1.7 0 x ' + 0 2.5 u+ 0 r
1
00
0 0
1

) ( )( )

We while assume that we can reach to all the state variables of the system ,
100
00
v= 010 x'+ 00 u
0 01
00

( ) ()

Where the

x ' , x '

is the dynamics and state variables of the augmented state space,

the scalar current reference

r is

So what we do now is to insert the new system matrices into the matlab and check the eigen
values,

As expected :
A pole with a zero value representing the integral added and the previous pair of complex
poles, then we get the transfer functions of the system using the following
commandsss2tf:

As it is obvious the num matrix is of three rows each one express one of the outputs
We can plot the root locus for unit step for each output as follow in the figures(8,9,10)

Fig(8) shows the root locus for the X1 output


locus for X2 output

Fig(10
)
shows
the
root
locus
for
the
X3
outpu
t

fig(9) shows the root

What we care about is the third root locus which is the output of current integral which is to
be fedback . From the root locus we can see that there are a Zero at -1.7 and the three last
checked poles ,so when we come to select the poles which make the system stable and
satisfy the required settling time we will select the value
-1.7 for the third pole and the
first two ones will be placed in to achieve the required settling time .
Since the settling time is given by the following relation:
t s=

for 2% settling time

20 103=

for

=200

rad
s

200
rad
=0.7 n= =
=285.7
0.7
s

d=n (1 )=285.7 (10.7 )=204


2

rad
s

So the selected poles which meet our requirements are (-1.7,-200 204 j ) as a first trial!!!
By inserting these poles values into matlab and using the command place(A,B,p) where p=(1.7,-200 204 j ) we get the gains

What we do now is that we take these values of the first row and substitute them in simulink
block diagram to get the closed loop of current controller but we should take care of the
order of gains when implementing them into simulink their order is like k=(K1,K2,K3)
respectively.

Fig(11)block diagram of current closed loop with gains implemented


In the above diagram the system is subjected to constant unit step input in order to check
the response of the system and to verify whether that controller design successfully matches
the requirements of 20ms settling time for 2% ,so the following plot shows the response of
the system
For unit input

Fig(12a)

fig(12b)

The two above plots shows the same response for different scales as can be seen from
fig(12a) the system reaches to the settling time around 20ms but for a zoomed out plot in
the fig(12b) to the right we can notice that the response still out of the band of 2% of the
settling time which means that our system gains still dont match the required
specifications ,to solve this problem we may refer to selecting the poles point to modify the
values ,since we need the system to respond faster we just can increase the real part values

of the poles to speed up the decaying to the required reference input and also decrease the
imaginary part values of the poles to reduce the overshot of the response signal after that
we get the gains values using command place and then implement these gains in the
simulink to check the response this process can be repeated many times till we get perfect
response ,another way to get that response is directly by tuning the gains and see the
response of it quickly ,but if we look again to the gains we obtained (3.0612,-3.398,832.32)
we can tell the similarity between this values and the ones of the block diagram in fig(1) so
why dont we just tune these gain values to match that of block diagram which are( 3.4,3.4,833) ,implementing these values we get a response that satisfy the required
specifications as, follow

Fig(13) perfectly tuned gains

And now we check the response signal

fig(14) perfect response of the tuned gains


as you can see that response reaches 2% settling time within 20ms ,but the problem here is
that how are we going to know poles values which give these gain values hence this
response !?
No problem what we do is to substitute these gains in matlab and use

An=( ABk ) as follow:

So,now we know the poles values which give the required response specifications we
proceed design using these poles values(-216.6 186.32i,-1.7),and were done , we have
designed a controller for the current successfully.
To know the shape of the matrices of the new closed loop system we can do it the hard way
by mathematics just as we get the An matrix above or we just can get it from the simulink
block diagram after determining the inputs& outputs of system and save it with a
motorsim name , as follow in the fig.(15)

Fig(15)
Using the command [A,B,C,D]=linmod(motorsim) in matlab we can fetch the new closed
loop system to

matlab in a form of matrices:


x ' =( ABK ) x ' + Gr

Our new system has two inputs which are the current i* and the TL and output X1,X2,X3 for
each state variable
and its matrices as shown above .so , matrix G would be the input matrix in the new
augmented system :

x ' =

433.2 0.281634
0
x '+ 0 ur
8.5
1.7 0
1
00
1

) ()

The system block diagram can be viewed in different form in simulink one of them is shown
below

Fig(17)

As illustrated in fig(17) the subsystem motor is the state space equation and the subsystem
c is the output c
matrix and to be more accurate we have taken the feedback from the output Y1=X1 .
What really inside the motor subsystem is that block diagram of fig(*)
I wanted to show the above block diagram because it will show up more frequently later.

Speed loop design


We are now going to add speed loop

Fig(18)
The specifications for the CL speed response are 2% settling time in 0.5sec and zero steady
state error to an input step.
To control the speed with zero steady state error we need to add integral which means that
we have to augment the state space to have the new integral of speed loop just as follow:
433.2 0.2 81634 0
0
0 x '+
x ' = 8.5 1.7
1
0
0
0
0
1
0
0

0
0 u+
1 r
0

0
0 r
0
1

)()()

Then we check the eigen values of the augmented state space

As expected the poles have the previously selected values plus the new pole of integrator
We now find the transfer function for the forth output and draw the root locus of it .

Fig(19) root locus for the speed integral output

Selecting the poles :


Choosing the poles values is the main target of controlling . to get the required
characteristics we will select the poles depending on the principle of second order dominant
poles in which two poles dominate the behavior of the system while other poles have less
effect ,so we choose a pair of complex which represents requirements of 2% ,0.5sec settling
time but also we should take in consideration that non-dominant poles have an effect even if
it is small it can change the system behavior if we didnt pick them carefully,another thing to
mention is that we should not just depend on the previous approach in selecting the poles
rather we have to be more flexible and inspected till we get right ones.
So ,our strategy to get the poles is first by designing then we use our instinct and inspection
method to reach the perfect poles values which satisfy the specifications.
I have selected

p1,2,3,4 =200 400 j,8 40 j

by inserting these values into matlab and using

command place to get the gains ,as follow:

We take gain values and use them to build the speed closed loop as shown the simulink
block diagram of the system.

Fig(20) block diagram of current and speed controllers for DC motor

Now we apply a unit step to the controller in order to exam the response as shown in the
fig(21)
We also can introduce unit step load torque to see the effect of the TL on speed response

Fig(21) response of speed unit step input


From the above plot we can say that we just has designed a speed controller successfully,its
clear that load torque unit step has affected the speed response by causing steady state
erroe hence prevent it from achieving the reference input value
we can also check the current demand response as illustrated in fig(22)

Fig(22)
As shown above the current reduces as speed increases untill it reach a certain level where
the speed has settled ,In the plot above two current demand responses for current with zero

load torque and another with unit step load torque input, as you can see the influence of
applying TL has increased the current demand ,this in practical is dangerous because the
increased current lead to a damage of the converter hence we need a limiter to avoid
reaching high current values .
Here ,we will introduce the integrator anti-windup whose function is to set the input of the
current integrator to zero as the controller output hits its limit value or saturate .

Fig(23) shows an integrator anti-windup


Now , we will try to implement the integrator anti-windup in the block diagram of fig(20)
Since the rated current of the motor is 42A we take it as the maximum current limit so well
set lookup table with the following values
0
0
1
1
1
1
0
0
-100
-41.9
-41.8
0
10
42
42.1
100
We also set the upper and lower saturation block diagram as (-42.5,+42,5) so that we can
see the effect of implementing both of them, we apply this point in the exercise 4 later .

To start design the controller for the motor with shaft we have first to model the system in
terms of mathematical equations .From the schematic above we can obtain the differential
equations that represents the system as follow :

m
+k (
L )(8)
m + Bm m
T =J m

k ( m L )+T L (9)
L+ B L L
0=J L

=
m L (10)

m=

L=

Bm
k
k
m + a i (11)
Jm
Jm
Jm

BL
T
k
L + L (12)
JL
JL
JL

Now we can rewrite the equations (11,12,10) in state space matrices form
91
0.582 0,2
0
91
0.2
1 0.2
0
3.4 0

0.1
0 m + 0.2 1
i
0.2 1 L
T
0 0.2
L

0
0

L =

( )(

)( )

()

To design a speed controller of the load

if we assume that the current loop is very fast

we can assume that i=i*, i.e. the transfer function between current and its demand is unity ,
then we can model the above system with

x=( m , L , )t and

u=(i , T L )t

and V=x

Now we insert the matrices of the system into matlab to check their poles and controllability

The system is completely controllable ,so we can implement a controller to set the speed of
the load to a reference value.

Fig(24) the block diagram of motor with flexible shaft


In order to control load speed with zero steady state error we have to augment the system
with integral of speed load ,so the new augmented system becomes as follow
0.5 0 455 0
x ' = 0 2.9 455 0 x ' +
1 1 0 0
0
1
0 0

17 0
0
0 5 u+ 0 r
0 0
0
0 0
1

) ( )()

Using matlab to check the eigen values of the new augmented system matrix

Selecting the poles :


The specifications of controlled load speed is that 2% ,0.5:1sec settling time ,here is the
tricky part of the control system design when we come to pick the values of the new
augmented state space.
And again we will approach a blended way of designing using dominants second order poles
principle which
allow us to get the required behavior of system through these two poles and pick real big
values for the rest of
the poles in order to make their effect less significant ,the other way is the inspection
method .
I have selected the following poles ( 3.37 22.8 j ,40.4,7.2 )
Inserting these values of poles into matlab and using the place command we get the
following
K=(k1=3 ,k2=0.3,k3=5,k4=20)
Note:the command place does not always give the gains which will place the poles at the
chosen ones it rather
has approximated gain values to verify the design we insert the k matrix in the state space
equation to get the
picked poles values as follow:

since x = A x + B u ,u=k x x =( ABk ) x


Checking the eigen values of (**)equation would give us the selected poles.

Now ,we use the gain values to design the closed loop controller to be as shown the
fig(25)below:

Fig(25) the closed loop


The response of

controller with gains implemented on

for unit step input is as shown below:

Fig(26)response of

From the figure above we notice that the

for unit step speed load

respond to the unit step

within around

0.8sec which satisfy the specifications required ,we also check the response to see how the

transient i during the process.

Fig(27)shows the transient of

i during load speed transient response

We notice speed and huge overshot current at the beginning then settle to reduced level
,this great overshot could cause damage for the converter delivering the current so we may
have to add a current limiter.As follow;

Fig(28)shows the implementation of anti-windup integrator

Using the previously introduced lookup table and limiter values ,we can now see the function

L
of the anti-windup integrator through checking the responses of
, i
for unit step load
and unit step load speed of 200 in the following plots below:

Fig(28)shows load speed in the presence of anti-windup integrator

Fig(29)shows the function of anti-windup integrator on current demand

From fig(28) we see that after implementing the anti-windup integrator ,the settling time has
increased ,so it
leads to sluggish respond where in the fig(29),the current is limited to specified value
Where the anti-windup eliminates the input currents when its output reach determined value
(42.5A as in the
plot above) in order to avoid more current drawing hence blowing up the electronic converter
Note: the overshot of current is caused by the friction and load at the beginning of rotation
but after a while
when speed starts to build up the current decreases down to a certain level.
Until now ,we have managed to design a controller with current limiter for motor with flexible
shaft succeccfully.

Вам также может понравиться