ee 4343 lab#1 – part 1 - university of texas at arlington spring.docx · web viewmass moment of...

13
TORSION SPRING K MOTOR τ DISK 1 J1 DISK 2 J2 ENCODER 1 ENCODER 2 MASS M1 MASS M2 MASS M1 MASS M2 DAMPING C1 DAMPING C2 d1 d2 l1 l2 EE 4314 Lab 3 Modeling and Identification of the Torsion Disk System ECP 205 The block diagram of the torsion disk system that will be used in this lab is shown in Figure 1. The combination of masses, springs and dampers can be found everywhere in industry and in our everyday life. Some common examples are the vehicle suspension or the anti-vibration systems in CD-ROM drives. The following are the parameters of the system: Additional Masses M 1 , M 2 Damping constants for the viscous friction at revolute joints C 1 , C 2 Elasticity coefficient (stiffness) of the torsion spring K Mass moment of inertia of the disks with load masses J 1 , J 2 Torque generated by the motor T Among the above parameters K, C 1 , and C 2 are unknowns. The goal of this lab is to present a simple method for identification of systems that can be split into a set of second-order subsystems with complex-conjugate poles. Starting from the first principles and differential equations, a set of second-order transfer functions will be isolated. The response with zero input and nonzero initial conditions of these transfer functions will be used to determine values for the rate of decay α and for the natural frequency ω n , which will finally be used to determine the values of K, C 1 , and C 2 . 1 08/31/22 Figure 1 Torsion disk system diagram with system parameters

Upload: phamliem

Post on 07-Apr-2018

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: EE 4343 Lab#1 – Part 1 - University of Texas at Arlington Spring.docx · Web viewMass moment of inertia of the disks with load massesJ 1, J 2 Torque generated by the motorT Among

TORSION SPRING K

MOTORτ DISK 1

J1

DISK 2J2

ENCODER 1 ENCODER 2

MASS M1 MASSM2

MASSM1

MASSM2

DAMPINGC1

DAMPINGC2

d1

d2l1

l2

EE 4314 Lab 3Modeling and Identification of the Torsion Disk System

ECP 205

The block diagram of the torsion disk system that will be used in this lab is shown in Figure 1. The combination of masses, springs and dampers can be found everywhere in industry and in our everyday life. Some common examples are the vehicle suspension or the anti-vibration systems in CD-ROM drives.

The following are the parameters of the system:

Additional Masses M1, M2

Damping constants for the viscous friction at revolute joints C1, C2

Elasticity coefficient (stiffness) of the torsion spring K Mass moment of inertia of the disks with load masses J1, J2

Torque generated by the motor T

Among the above parameters K, C1, and C2 are unknowns. The goal of this lab is to present a simple method for identification of systems that can be split into a set of second-order subsystems with complex-conjugate poles. Starting from the first principles and differential equations, a set of second-order transfer functions will be isolated. The response with zero input and nonzero initial conditions of these transfer functions will be

used to determine values for the rate of decay α and for the natural frequencyωn , which will finally be used to determine the values of K, C1, and C2.

Using the differential equations and the identified parameters, a state-space model for the system will be built. This model will be used in the fourth lab to design a state-feedback controller. The validation of the model will be done in this lab by providing the same input to the real system and to the model and by comparing their outputs.

105/07/23

Figure 1 Torsion disk system diagram with system parameters

Page 2: EE 4343 Lab#1 – Part 1 - University of Texas at Arlington Spring.docx · Web viewMass moment of inertia of the disks with load massesJ 1, J 2 Torque generated by the motorT Among

Simulink Model

Commands to the motor

Amplifiedcommands to

the motorInput/Output Electronic Unit

Readings from the positions of the disks

Readings from the positions of the disks

Setting up and performing the identification experiment:

1. System description and setup

a. System setup (This part is done by the TA)Figure 2 shows the elements of the control system. The computer runs a Simulink model in real-time. The information from the encoders is sent to the computer and is processed by the model. The command to the motor is a voltage that is amplified by the Input/Output Electronic Unit and sent to the plant.

b. SensorsThere are two incremental rotary shaft encoders coupled to the disks. Each has a resolution of 4000 pulses per revolution. The encoders are all optical type whose principle of operation is depicted in Figure 3. A low power light source is used to generate two 90 degrees out of phase sinusoidal signals on the detectors as the moving plate rotates with respect to the stationary plate. These signals are then squared up and amplified in order to generate quadrate logic level signals suitable for input to the programmable gate array on the real-time Controller. The gate array uses the A and B channel phasing to decode direction and detects the rising and falling edge of each to generate 4×resolution – see Figure 4. As the encoders are coupled to the disks with 1:1 ratio, the Simulink model will receive 16000 counts per revolution from the encoders.

205/07/23

Figure 2 The elements of the control system

Page 3: EE 4343 Lab#1 – Part 1 - University of Texas at Arlington Spring.docx · Web viewMass moment of inertia of the disks with load massesJ 1, J 2 Torque generated by the motorT Among

c. ActuatorThe motor receives an analog voltage from the I/O Electronic Unit and transforms it into motion. For a certain interval of input voltages, it can be considered with relatively good approximation that the torque generated by the motor is proportional to the input voltage.

d. Matlab/simulink fileClick on the Simulink file "TorsionSpring.mdl" in the “Lab3” folder. The following block diagram opens up.

The green block represents the physical torsion spring system. It has one input and a vector output. The input is the voltage that the motor receives. The output is a vector that contains the two encoder readings. These readings represent counts or the number of pulses since the simulation has started. When you connect to the target, the readings are reset to zero. The number of counts is translated to the corresponding angular displacement of the disks through the pi/16000 rad/count gain. The vector signal is demultiplexed to individual signals x1 (Disk 1 angle) and x2 (Disk 2 angle) and these are displayed on the oscilloscopes and sent to the Matlab workspace for further processing if needed. The Saturation block makes sure that the motor is not driven with a high voltage that could damage the plant. Do not change the parameters of the Saturation block!

305/07/23

Figure 3 The Operation Principle of Optical Incremental Encoders

Channel A Output

Channel B Output

a) Clockwise Rotation, A leads B

Channel A Output

Channel B Output

b) Counterclockwise Rotation, B leads A

Figure 4 The optical encoder output

Figure 5 Simulink diagram for system identification

Page 4: EE 4343 Lab#1 – Part 1 - University of Texas at Arlington Spring.docx · Web viewMass moment of inertia of the disks with load massesJ 1, J 2 Torque generated by the motorT Among

If you double-click the step block on the diagram, you can see its parameters. This is the input signal to the motor. The following window should be seen:

Click on the Tools menu in the Simulink diagram and, in the Real-Time Workshop submenu, select Build Model. You will see the Matlab command window pop up and the build process will be displayed. Once the build is successfully completed click the “Connect to target” button and after the connection is realized click on the arrow that appears in the Simulink diagram. This will start running the Simulink code for a number of seconds equal to the simulation time specified in the Simulink diagram.

Note: For real-time applications, Simulink compiles the model into a fast executable code that handles the data acquisition and processing. Anytime a change is made in the Simulink file, except changing the value of the step input or the Slider Gain, the file must be rebuilt.

Check the scopes to save the signal data to the Matlab Workspace. By clicking on the “parameters” button in the Scope window a new window containing the scope parameters will open up. In this window in the “Data history” tab you will see that the data will be saved to workspace under the following names: disk1angle and disk2angle.

Note: The data is saved in the “Array” format. In this case the data will be saved in the workspace as a two column matrix. The first column is the time column and specifies the moments in time at which the signal values were collected. The second column is the data collected.

Note: If you return to the Matlab workspace you will see the variables disk1angle and disk2angle saved as matrices.

To plot the data in disk1angle and disk2angle, you can plot the second column of the data array versus the first column.Example: The following command plots the angular position of Disk 1

>> plot(disk1angle(:,1), disk1angle(:,2))

You can save the experiment results to your “results” folder by selecting and right clicking on the matrices in the workspace and saving them as a new .mat file.

405/07/23

Figure 6 Step input parameters

Page 5: EE 4343 Lab#1 – Part 1 - University of Texas at Arlington Spring.docx · Web viewMass moment of inertia of the disks with load massesJ 1, J 2 Torque generated by the motorT Among

J1 J2

K

X2(t)X1(t)T(t)

C1 C2

2. System modeling

The differential equations that model the system in Figure 7 are as follows:

J1 x1+C1 x1+ K ( x1−x2 )=τ=L⋅uJ2 x2+C2 x2=K (x1−x2 )

(1)

Variables of timex1 : angular position of Disk 1 (rad)x2 : angular position of Disk 2 (rad)τ : motor torque (kg.m2/s2)u: voltage input applied to the motor (V)

ConstantsJ1: mass moment of inertia on Disk 1 (kg.m2)J2: mass moment of inertia on Disk 2 (kg.m2)C1: viscous friction of Disk 1 (kg.m2/s)C2: viscous friction of Disk 2 (kg.m2/s)K: Torsion spring constant (kg.m2/s2)L: motor constant (A.s)

Since J1 and J2 are the total mass moment of inertia on Disk 1 and Disk 2, J1=J D 1+J M 1 J 2=J D2+J M 2

where JM1 and JM2 are the mass moment of inertia of the load masses attached to the respective disks and are known values. On the other hand, JD1 and JD2 are the mass moment of inertia of the disks and are experimentally calculated and provided in the handout. JM1 and JM2 are found as follows:

J M 1=2(M 1 d12

8+M 1 l1

2)=0 .0083 kg⋅m2

J M 2=4 (M 2 d22

8+M 2 l2

2)=0 .0013 kg⋅m2

M1: mass of the load cylinder attached to Disk 1 = 0.503 kgM2: mass of the load cylinder attached to Disk 2 = 0.212 kgd1: diameter of the load cylinder attached to Disk 1 = 0.049 md2: diameter of the load cylinder attached to Disk 2 = 0.032 ml1: distance between the load cylinder attached to Disk 1 and the axis of rotation = 0.089 ml2: distance between the load cylinder attached to Disk 21 and the axis of rotation = 0.037 m(See also Figure 1)

Based on preliminary experiments not covered in this lab, JD1 and JD2 are found to be 0.0025 kg·m2 and 0.0021 kg·m2, respectively. Therefore, the total inertias of the two disks are found as follows:

J1=0 . 0108 kg⋅m2 J 2=0 .0034 kg⋅m2

505/07/23

Figure 7 Physical system model

Page 6: EE 4343 Lab#1 – Part 1 - University of Texas at Arlington Spring.docx · Web viewMass moment of inertia of the disks with load massesJ 1, J 2 Torque generated by the motorT Among

G1(s) G2(s)

G3(s)

+

+

U(s) X2(s)X1(s)

In this experiment, you will estimate the values of K, C1, C2 and L parameters.

a) Apply the Laplace transform on the first two differential equations given in (1). You will obtain the results in the following form:

X1 (s )=G1(s )⋅U (s )+G3 (s )⋅X2( s )X2 (s )=G2(s )⋅X1( s ) (2)

where G1 and G2 are second order transfer functions. The above equations can also be represented with the following block diagram.

The G1 and G2 transfer functions that you obtain should be of second order with complex-conjugate poles. b) Rewrite each of G1 and G2 in the following manner, by making sure that s2 on the denominator has a

coefficient of 1:

Gi( s )=g0i⋅ωni

2

s2+2α i s+ωni2 , i=1 , 2 (3)

where g0 i is the DC gain, ωni is the natural frequency and α is the rate of decay as will be made more clear in the following parts of the handout.

c) By identifying the coefficients of the different powers of the s variable on the denominator with your calculated coefficients, write K, C1 and C2 as functions ofωn1 , ωn2 , α 1 and α 2 .

3. Identification of parameters

The identification procedure requires you to analyze the response of the G1 and G2 transfer functions with nonzero initial conditions and zero input. This means that you have to measure the output of the transfer function after you force its input to zero and force a nonzero value on at least one of the states. From the diagram in Figure 8, you can see that the output of the G1 transfer function is not available for measurement. Still, it is possible to measure it through X1 if X2 is forced to be zero. This means that if you block Disk 2 and do not allow it to move, the G3 transfer function will not have any effect on X1 and you will see the output of G1 on the X1 measurements. The exact formula for the response can be calculated using the Laplace transforms and considering nonzero initial conditions (x1(0) = initial angle of the disk). To obtain the response, follow the next steps:

a) Let Disk 1 free to rotate while Disk 2 is blocked by screwing to the frame of the plant. Connect to the target and run the model with the slider gain set to zero initially. Slowly increase the slider gain value and note on the first scope window that Disk 1 starts turning only when the input exceeds a small value such as 0.05V. You can call this input level as the deadband voltage udb. Then apply a test voltage utest such as 0.75 V. You will see a displacement of Disk 1 that stabilizes after some time to a steady-state value x 1,test. As a result, the DC gain of G1 can be calculated as

g01=x1, test

u test(4)

b) While you keep Disk 2 blocked, connect to the target again and run the model with the slider gain set to zero. Slowly turn Disk 1 with your hand in counter-clock-wise direction until the signal reaches 0.15 (about 10 degrees) in the first scope window. Then, suddenly release the disk. After the disk oscillations cease, stop the simulink model. Observe the response if it looks like the one in Figure 9.

605/07/23

Figure 8 Block diagram representation of the S-domain dynamical equations of the system

Page 7: EE 4343 Lab#1 – Part 1 - University of Texas at Arlington Spring.docx · Web viewMass moment of inertia of the disks with load massesJ 1, J 2 Torque generated by the motorT Among

c) Choose n consecutive cycles (e.g. n = 5) in the higher amplitude range of the response such that they are not affected too much by the nonlinear friction effects. Divide the number of cycles by the time taken to complete them (tn−t0 ) being sure to take beginning and end times from the same phase of the respective cycles (it is best to look at the peaks). You may need to zoom into the graph or see the data in a table in the Matlab workspace. The following calculation gives you the period of oscillations T and the associated frequencies f and β in Hz and radians, respectively.

T 1=t n−t0

n, f 1=

1T

, β1=2 πf (5)

d) Measure the initial cycle amplitude x1 (t 0) and the last cycle amplitude x1 (tn) for the n cycles

measured in the previous step. Use the relationships associated with the logarithmic decay to obtainα 1 :

x1 ( t0 )x1 ( tn )

= e−α1 t0

e−α1 tn

⇒ α 1=

ln ( x1 (t 0 )x1 (t n ) )

t n−t0=

β1 ln( x1 (t0 )x1 (t n) )

2πn=

ln ( x1 (t 0 )x1 (t n ) )nT 1

(6)

f) Calculate ωn1 with the following formula:

ωn1=√α12+β1

2

g) Using the formulas you derived in part 2(c), calculate the values for K and C1.

h) Repeat steps (b) – (g) for Disk 2. In this case, block Disk 1 by screwing it to the frame of the plant.

Calculate the values K and C2. Note that g02=1 for the G2 transfer function.

4. Validation of the model

In this part, you are going to validate the identified model of the system. You will use the state-space representation. Consider the following assignment of states for a state realization of the system:

x1= x1 (angular position of Disk 1)x2= x1 ( angular velocity of Disk 1)x3=x2 (angular position of Disk 2)x4= x2 ( angular velocity of Disk 2)

a) Find the state-space representation of the system (i.e. find A and B):

705/07/23

e−αt envelope

sin βt frequency

Small amplitude: unreliable for identification due to friction

Initial anglex1 (rad)

t0 , t1 ,

t5 ,

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1515-0.025

-0.02

-0.015

-0.01

-0.005

0

0.005

0.01

0.015

0.02

0.025

time (sec)

x 1 (m)

Figure 9 Zero input, nonzero initial state response used for identification

Page 8: EE 4343 Lab#1 – Part 1 - University of Texas at Arlington Spring.docx · Web viewMass moment of inertia of the disks with load massesJ 1, J 2 Torque generated by the motorT Among

x=[x1

x2

x3x4

]=Ax+Bu

Considering the output of the system to be made of the angular positions of the two disks,

y=[1 0 0 00 0 1 0 ] x+[00 ]u

b) Open the Simulink block diagram named “simulation.mdl” (Figure 10). Configure the State-Space block with the values of the A, B, C and D matrices above.

Copy the blocks before the State-Space block in Figure 10 to the experiment model as shown below and rebuilt the model. Make sure that the two Simulink diagrams are functionally the same except you have a simulation model in Figure 10 and a real system in Figure 11. Then, run both models. If the responses are similar it means that the model that you just identified for the torsion spring system is fairly good. If the two responses are not similar then you have to go back and find out where you might have made a mistake.

805/07/23

Figure 10 Simulation model of the torsion spring system in Simulink

Figure 11 Simulink diagram of the experiment with pulse input

Page 9: EE 4343 Lab#1 – Part 1 - University of Texas at Arlington Spring.docx · Web viewMass moment of inertia of the disks with load massesJ 1, J 2 Torque generated by the motorT Among

Lab Report:

You are responsible for performing everything listed in all lab procedures. The lab report should include results from every section in the lab instruction. Provide graphs if available. The lab report should also include the answers to the following points.

What are the parameters K, C1, C2 and L that you found from the experiment? The estimated model of the system. Can you get a time response of the estimated model to perfectly match a time response of the actual

system? (Please also explain the reason to support your answer)

Note that you will need to use the results presented in these lab reports for the experiments in future lab sessions.

905/07/23