Control Solution Robotics

26
MENG 476 - Spring 2013 Assignment three solutions Question 1 For the translational mechanical system with a nonlinear spring shown below, find the transfer function,() () () , for small excursionsaround ()=1.The spring is defined by () () , where ()is the spring displacementand () is the spring force. Hint:In the system’s differential equation, replace () with (() ) and replace ()with ( ), where is the equilibrium point of the system when () . Then linearise any nonlinear term. The free body force diagram is: So, ̈ () ̇ () The force of the spring depends on extension. Under steady state conditions, the inertia and damping terms will cancel as they are derivative terms. Further if the Steady State position is assumed to be X o , then the spring equation can be used to work out the steady state displacement at f(t)=1. () () () () () () So we will linearize the system about x=0.632 when f(t) is 1. Now, () () () ()

description

Control Systems solution.

Transcript of Control Solution Robotics

Page 1: Control Solution Robotics

MENG 476 - Spring 2013

Assignment three solutions

Question 1

For the translational mechanical system with a nonlinear spring shown below, find the

transfer function, ( ) ( )

( ), for small excursionsaround ( )=1.The spring is

defined by ( ) ( ), where ( )is the spring displacementand ( ) is the

spring force.

Hint:In the system’s differential equation, replace ( ) with ( ( ) ) and replace

( )with ( ), where is the equilibrium point of the system when ( ) .

Then linearise any nonlinear term.

The free body force diagram is:

So,

( ) ( )

The force of the spring depends on extension. Under steady state conditions, the

inertia and damping terms will cancel as they are derivative terms. Further if the

Steady State position is assumed to be Xo, then the spring equation can be used to

work out the steady state displacement at f(t)=1.

( )

( ) ( )

( ) ( ) ( )

So we will linearize the system about x=0.632 when f(t) is 1.

Now,

( ) ( )

( ) ( )

Page 2: Control Solution Robotics

( ( )) ( )

The linearization around equilibrium point using Taylor series is:

( ) ( )

( ( )) ( )

( ) ( )

It was shown previously that:

So,

( ) ( ) (

)

So the linearized equation is:

( )

The dynamic equation of the system is:

( ) ( ( ) )

Substituting:

( ) ( ( ) )

( ( ) )

C=1 m=1

( )

( )

Therefore,

( )

( )

Question 2 For the system shown below:

a. Use Matlab command “roots” to find the closed loop poles. Mention how

many are in the LHP, RHP and on the jw-axis.

b. Use Routh criterion to verify your findings in part “a”.

Part (a):

Page 3: Control Solution Robotics

G(s)

The system shown in figure 1 below is a non-unity feedback system. The roots of the

closed loop polynomial are to be found using the MATLAB command roots.

Figure 1: system under consideration for question 2.

First we need to find the closed loop transfer function. Using CLTF equation,

( )

( ) ( )

( )

By looking at the denominator of the closed loop function, we see the polynomial:

Therefore, the coefficients of this polynomial were fed into MATLAB and stored in

variable a. The command “roots” was then used and the result stored in r.

MATLAB commands:

1- G=tf([507],[1 3 10 30 169])

2- H=tf([1],[1 0])

3- T=feedback(G,H)

4-a=[1 3 10 30 169 507]%this polynomial is characteristic

equation

5-r= roots(a)

In the Matlab command Window the following results appeared.

The results obtained were (in command window):

H(s)

Page 4: Control Solution Robotics

So this CLTF transfer function has got 2 imaginary poles on the right hand plane, two

imaginary poles in the left hand plane, and one real pole on the X-axis. The system is

unstable.

Question 2; Part (b):

To construct the Routh array consider the denominator of the CLTF.

An array is constructed starting with s5 to s0 as a column in the table. The first row is

filled by writing the coefficient of s5 and then skipping one power of s and so on. The

second row is filled in exactly the same manner but starting with the coefficient of s4.

For the remaining rows they are filled by finding the determinant of matrix made by

above rows and divided by the first entity in the above row. Therefore, applying

these rules to the Routh array will yield the following result:

S5 1 10 169 0

S4 3 30 507

S3 0 0 0

S2

S1

S0

As can be seen, there is an entire row of zeroes with which the array cannot be

continued. To overcome this, an auxiliary equation is formed by reading the

coefficients in the row above the row of zeroes. In this case it starts with s4 and has

coefficients of 3, 30, and 507. So,

This equation is differentiated with respect to s to yield:

The coefficients of the differentiated equation are substituted in the Routh array at

the row of S3 instead of the zeroes and the table is filled as normal.

S5 1 10 169 0

S4 3 30 507

S3 12 60 0

Page 5: Control Solution Robotics

S2 15 507

S1 -345.6 0

S0 507

The number of sign changes is equal to the number of poles in the right hand plane.

Further, the auxiliary polynomial is an even polynomial and hence must be

symmetrical about the X-axis. From s5 to s4 is the case of other polynomial and there

is no sign change indicating that there is no pole in the right hand plane. From s4 to

s0 is the case of the auxiliary polynomial two sign changes can be noticed from s2 to

s1, and from s1 to s0. This means that the auxiliary polynomial has got two roots in

the right hand plane. From symmetry, this means that the other two roots of the

polynomial lie in the left hand plane. Since the auxiliary polynomial has 4 roots two

in the LHP and 2 in the RHP, we conclude that there are no roots on the Y-axis (j

omega axis).

To summarise,

Location of poles Even poly (fourth-order)

Other (first order) Total (Fifth order)

Right half-plane 2 0 2 Left half-plane 2 (symmetry) 1 3

Jω 0 0 0

Question 3:

For the network shown below, find:

a. A state space representation for the network where the output is the

voltage ( ).

b. Use the state space model obtained to get the transfer function ( ) ( ) ( ).

Part (a):

A state space model is not unique for a particular system as more than one representation can be used. However, it is common to use differentiated quantities as states of the system. First draw arrows for the currents on the circuit. As follows:

Page 6: Control Solution Robotics

Now write the voltage current relation for all components. For resistors this is straight forward. For inductors one and two these are:

We can see that the currents one and two through the inductors are differentiated. We choose these as our states. Therefore, we need to express Vl1 and Vl2 in terms of our states i.e. iL1, iL2, and V (t).

By looking at the circuit, we conclude that the voltage across the third branch is the same as that across the second branch with resistor 1 (parallel) i.e.

( )

Investigating currents at a node we get the following relations for the three currents:

Therefore, the voltage across resistor one is:

(

)

Therefore, VL1 can be expressed in terms of V (t) and iL as:

( ) ( )

It was said previously that the second branch and third branch (last on the right) are parallel so we can relate R1 voltage to R1 and L2 as:

But earlier we have shown that:

( )

Page 7: Control Solution Robotics

So:

( )

And VL1 was found to be:

( )

So,

( )

( )

And:

Our state space is expressed by the state equation:

Our states are the two currents through the two inductors i.e.:

[

]

So the derivative is:

[

]

Hence:

[

] [

]

To find these matrices, rearrange the equations for the two states i.e. eq1 and eq2:

( )

So,

( )

Page 8: Control Solution Robotics

In matrix form this is:

[

]

[

]

[

] [

] ( )

The desired state to measure is the voltage across inductor two. This has to be expressed in terms of the two states i.e. iL1 and iL2.

[ ] ( ) [

]

Question 3 Part (b):

Here the state space representation is to be converted to transfer function form. The equation for converting is given by:

( ) ( )

( ) ( )

In our case D=0. So to work out the TF we have to substitute our state space matrices in this equation:

[

]

[

]

[

] [

] ( )

[ ] ( ) [

]

( ) ( )

( ) ( ) ( )

(

[

]

[

]

)

[

]

A matrix B matrix/vector

C vector

Page 9: Control Solution Robotics

This equation can be solved by hand, or we could use symbolic operations in MATLAB to solve it fast. Let the following variables represent our symbols:

Our (SI-A) matrix in symbols is:

[

]

MATLAB code is as follows but we first declare the symbols:

syms s % Declare symbol s

syms a % Declare symbol a

syms b % Declare symbol b

syms c % Declare symbol c

syms R1 % Declare symbol R1

syms R2 % Declare symbol R2

syms L1 % Declare symbol L1

A=[s+a -a; -b s+b+c]% SI-A matrix

C=[R1 -(R1+R2)]% C matrix

B=[1/L1 ;0]% B matrix

Z=C*inv(A)*B %workout TF

simplify(Z)%simplify it for convenience

MATLAB produces the following TF:

( )

Substituting for the values that represent these symbols we get:

( (

)

)

Substituting the values for components (1, 1, 1, 1) we get the TF:

Question 4:

The following plant is to be remodelled to have an overshoot of 15% and a settling

time of 0.75 seconds. It is assumed that this is the closed loop i.e. T.

Page 10: Control Solution Robotics

( )( )( )

The percent overshoot is given by the relation:

Therefore, for an overshoot of 15% the damping ratio is given by:

The damping ratio is graphically related to a line with an angle, θ, with respect to the

negative real axis of X:

Therefore:

The settling time is given by:

Where is the distance on the real axis. Therefore,

So the desired point lies on the intersection of the previous two lines. For stability,

its X-axis value is -5.33 while the y-axis is conveniently calculated from the angle as:

This point exists in the complex plane and so to create two dominant poles that

approximate second order, a conjugate pole is needed. Therefore, the two poles are:

An alternative way of finding the second order poles is to work out the natural

frequency given the damping ratio. It was shown earlier:

Therefore:

So the second order TF is:

Page 11: Control Solution Robotics

So the roots are:

A third pole is needed as the system is a third order. However, the calculations are

based on the assumption of second order behaviour. To minimise the error, a third

real pole is chosen to be 10 times as far as the dominant pair i.e. at -53.3. The

denominator of the desired system is:

( ( ))( ( ))( )

Expanding this yields the desired characteristic equation:

( )( )

And the desired system’s equation is:

Which can be expressed in phase variable form as:

[

] [

] [

] [ ]

[

]

The original system had a transfer function that can also be expressed in state space

form after expanding:

( )( )( )

So:

[

] [

] [

] [ ]

[

]

Page 12: Control Solution Robotics

To design a controller to transform the plant behaviour as desired, the plant must be

fully controllable. This is ensured by fulfilling controllability test. The following

controllability matrix is to be found:

From the state space representation:

[

]

[ ]

Multiplication of matrices A and B yields AB. As for A2B,

( )

So to find AB, multiply first row of A by first column of B and so on.

[

] [

] [

]

( ) [

] [

] [

]

Therefore, the controllability matrix is:

[

]

The rank of this matrix must be full (highest) for the system to be controllable. To

find the rank of matrix, the following MATLAB commands were used:

A=[0 1 0; 0 0 1; -64 -56 -14]%A matrix of actual system

B=[0; 0; 1]%B matrix of actual system

c=[B A*B A*A*B]% Controllability matrix

rank(c)%determining rank of c

And the output from MATLAB was:

A =0 1 0

0 0 1

-64 -56 -14

Page 13: Control Solution Robotics

B =0

0

1

c =0 0 1

0 1 -14

1 -14 140

ans =3

Therefore, from MATLAB we know that rank of the matrix is 3. Since the matrix is a

3X3 matrix, then the highest number of independent rows/columns is 3 so a rank of

3 is a full rank. Therefore this system is controllable.

Proceeding with controller design, the A matrices are of interest since modification

of the characteristic equation yields the desired response. The old system and new

systems’ A matrices are:

[

]

[

]

In other words, a set of gains is needed to convert the system’s transient behaviour.

So the desired matrix can be written in terms of the old matrix as:

[

( ) ( ) ( )]

By comparing these values we get:

Rearranging gives:

Page 14: Control Solution Robotics

To confirm these results, the following MATLAB commands were used:

A=[0 1 0; 0 0 1; -64 -56 -14]%A matrix of actual system B=[0; 0; 1]%B matrix of actual system I=sqrt(-1)%C full rank sl let i=sqrt(-1) P=[-5.33+(I*8.83); -5.33-(I*8.83); -53.333]%Desired eigen values (roots) place(A,B,P)%command to work out the gains to get desired system

The output from MATLAB was:

A =0 1 0

0 0 1

-64 -56 -14

B =0

0

1

I =0 + 1.0000i

P =-5.3300 + 8.8300i

-5.3300 - 8.8300i

-53.3330

ans =1.0e+003 *(5.6094 0.6189 0.0500)

N.B. the outputs are multiplied by 1000 i.e. the vector of output values is:

(5609.4 618.9 500)

These values are very close to the values produced theoretically (MATLAB uses

numerical methods) and these are the gains needed to adjust the system

performance as desired.

The following MATLAB commands were used to visualise the system’s response

(after modification).

G=tf([20],[1 64 675 5673]) %characteristic equation of

new system step(G)%plot step response of new system The output from MATLAB was this plot:

Page 15: Control Solution Robotics

Step response of system with settling time, peak value, and steady state value marked.

Notice that the desired performance was met with little error despite the

assumption of second order. This is due to the flexibility (DOF) offered by state space

methods compared to other methods.

Question 5:

For the following open-loop plant, design a state feedback controller to yield a 15%

overshoot with a settling time of 0.5 seconds for the following cases:

Part a (Direct design) (see next part for controllability test)

The node before an integrator is a derivative of the state following the integrator. In the figure below, the derivatives are marked in red.

Page 16: Control Solution Robotics

This system is straight forward and made up of two states only. It is easy to write the state space equations by inspection so,

[

] [

] [

] [

]

[

]

The percent overshoot is given by the relation:

Therefore, for an overshoot of 15% the damping ratio is given by:

The settling time is given by:

Therefore,

Now

Therefore:

So the second order TF is:

Page 17: Control Solution Robotics

State feedback means we are feeding all the states back to U i.e. it looks like this diagram:

This is essentially a block diagram. For a while ignore the states and simplify the system as a normal block diagram simplification problem. The following TF results:

( ) ( )

The desired TF was earlier shown to be:

So comparing these values we get:

And

Question 5:

Part B (in direct):

The original system is given by:

The system can be simplified using block diagram techniques to yield the following transfer function:

Page 18: Control Solution Robotics

( )( )

This can be expressed in phase variable form:

[

] [

] [

] [

]

[

]

To design a controller to transform the plant behaviour as desired, the plant must be

fully controllable. This is ensured by using the controllability test. The following

controllability matrix is to be found:

From the state space representation:

[

]

[ ]

So to find AB, multiply first row of A by first column of B and so on.

[

] [

] [

]

Therefore, the controllability matrix is:

[

]

The rank of this matrix must be full (highest) for the system to be controllable. To

find the rank of matrix, the following MATLAB commands were used:

A=[0 1 ; -2 3]%A matrix of actual system

B=[0; 1]%B matrix of actual system

c=[B A*B]% Controllability matrix

rank(c)%determining rank of c

And the output from MATLAB was:

ans =2

Page 19: Control Solution Robotics

Therefore, from MATLAB we know that rank of the matrix is 2 since the matrix is a

2X3 matrix, then the highest number of independent rows/columns is 2 so a rank of

2 is a full rank. Therefore this system is controllable.

Proceeding with controller design, the A matrices are of interest since modification

of the characteristic equation yields the desired response. The old system and new

systems’ A matrices are:

[

]

[

]

In other words, a set of gains is needed to convert the system’s transient behaviour.

So the desired matrix can be written in terms of the old matrix as:

[

( ) ( )]

By comparing these values we get:

Rearranging gives:

To confirm these results, the following MATLAB commands were used:

A=[0 1; -239.4 -16]%A matrix of actual system B=[0; 1]%B matrix of actual system I=sqrt(-1) %let i=sqrt(-1) P=roots([1 3 2])%Desired eigen values (roots) place(A,B,P)%command to work out the gains to get desired system

The output from MATLAB was:

A = 0 1.0000

-239.4000 -16.0000

B =

0

1

Page 20: Control Solution Robotics

I =

0 + 1.0000i

P =

-2

-1

ans = -237.4000 -13.0000

The vector of output values is:

(-237.4 -13)

Calculating the controllability matrix for the modified system we get:

[

]

The gains of the modified system are related to those of the actual one by the P

matrix given by:

[

]

The gains are given by:

[

]

Question 6:

Part a:

The following system is to be tested for controllability.

Page 21: Control Solution Robotics

All nodes followed by integrators (1/S) are derivatives of the following nodes.

Therefore, the derivatives have been marked in red.

State space equations have the form:

[

] [

] [

] [

]

[

]

By looking at node Y, one can see the connections from nodes leading to Y and the

TF on these connections. Therefore, from figure Y is:

Similarly, , , and are equal to:

Now these can be put in matrix form:

[

] [

] [

] [ ]

Page 22: Control Solution Robotics

[

]

The A matrix is not diagonal (modal/decoupled) therefore, controllability cannot be

found by inspection. However, the controllability matrix can be derived.

From the state space representation:

[

]

[ ]

Multiplication of matrices A and B yields AB. While A2B is:

( )

So to find AB, multiply first row of A by first column of B and so on.

[

] [ ] [

]

( ) [

] [

] [

]

Therefore, the controllability matrix is:

[

]

The rank of this matrix must be full (highest) for the system to be controllable. To

find the rank of matrix, the following MATLAB commands were used:

A=[-2 0 1; 0 -2 0; 0 0 -3]% A matrix B=[0; 1; 1]% B matrix C=[B A*B A*A*B] %controllability matrix rank(C)%find rank of C

The output from MATLAB was:

A =-2 0 1

Page 23: Control Solution Robotics

0 -2 0

0 0 -3

B =0

1

1

C =0 1 -5

1 -2 4

1 -3 9

ans =2

The output from MATLAB is that the controllability matrix has a rank of 2. Since this

is a 3X3 matrix, a rank of 2 is not full rank. Hence, the system is not controllable.

However, it cannot be told which states are controllable and which are not.

However, since rank is 3-2 = 1 rank less than maximum, it means that one state is not

controllable.

Question 6:

Part b:

The following system is to be tested for controllability.

All nodes followed by integrators (1/S) are derivatives of the following nodes.

Therefore, the derivatives have been marked in red.

Page 24: Control Solution Robotics

State space equations have the form:

[

] [

] [

] [

]

[

]

By looking at node Y, one can see the connections from nodes leading to Y and the

TF on these connections. Therefore, from figure Y is:

Similarly, , , and are equal to:

Now these can be put in matrix form:

[

] [

] [

] [ ]

[

]

Page 25: Control Solution Robotics

The A matrix is not diagonal (modal/decoupled) therefore, controllability cannot be

found by inspection. However, the controllability matrix can be derived.

From the state space representation:

[

]

[ ]

Multiplication of matrices A and B yields AB. While A2B is:

( )

So to find AB, multiply first row of A by first column of B and so on.

[

] [ ] [

]

( ) [

] [

] [

]

Therefore, the controllability matrix is:

[

]

The rank of this matrix must be full (highest) for the system to be controllable. To

find the rank of matrix, the following MATLAB commands were used:

A=[-2 1 0; 0 -2 0; 0 0 -3]% A matrix B=[0; 1; 1]% B matrix C=[B A*B A*A*B]%controllability matrix rank(C)%find rank of C

The output from MATLAB was:

A =-2 1 0

0 -2 0

Page 26: Control Solution Robotics

0 0 -3

B =0

1

1

C =0 1 -4

1 -2 4

1 -3 9

ans =3

The output from MATLAB is that the controllability matrix has a rank of 3. Since this

is a 3X3 matrix, a rank of 3 is full rank. Hence, the system is fully controllable.