Dynamic System Modeling and Control - Hugh Jack
Dynamic System Modeling and Control - Hugh Jack
Dynamic System Modeling and Control - Hugh Jack
by
Hugh Jack
page 1
PREFACE
How to use the book. read the chapters and do drill problems as you read examine the case studies - these pull together concepts from previous chapters problems at the ends of chapters are provided for further practice Tools that should be used include, graphing calculator that can solve differential equations, such as a TI-85 computer algebra software that can solve differential equations, such as Scilab Supplemental materials at the end of this book include, a writing guide a summary of math topics important for engineers a table of generally useful engineering units properties of common materials Acknowledgement to, Dr. Hal Larson for reviewing the calculus and numerical methods chapters Dr. Wendy Reffeor for reviewing the translation chapter Student background a basic circuits course a basic statics and mechanics of materials course math up to differential equations a general knowledge of physics computer programming, preferably in C
Special notes - despite all common wisdom, inertia is presented as a force, this makes it easier for students attempting to learn, and keep sign conventions correct
TO BE DONE small italicize variables and important terms fix equation numbering (auto-numbering?) fix subscripts and superscripts fix problem forms to include therefores, mark FBDs, etc. check C programs for ANSI compliance big verify the phase angle relationships cos vs/ sin.
page 2
chapter rotation replace the rotational case with IC motor chapter non-linear systems develop chapter chapter magnetic consider adding/writing this chapter chapter fluids consider adding/writing this chapter chapter thermal consider adding/writing this chapter chapter c programming review section add problems
Buzzword topics: - Distributed systems - Intelligent manufacturing systems - Adaptive control - Architectures for signal processing and control algorithms - Discrete event systems - Hybrid systems - Predictive control - Robust control
introduction - 1.1
1. INTRODUCTION
Topics:
Objectives:
introduction - 1.2
linearity and superposition reversibility through and across variables Analog vs. Digital process vs. controllers Basic system categories below,
Distributed Lumped
Figure 1.1
Model Classifications
introduction - 1.3
control system types: servo vs. regulating/process control open loop vs. closed loop disturbances component variations system error analysis vs. design mechatronics embedded systems real-time systems
1.3 SUMMARY
translation - 2.1
2. TRANSLATION
Topics: Basic laws of motion Gravity, inertia, springs, dampers, cables and pulleys, drag, friction, FBDs System analysis techniques Design case Objectives: To be able to develop differential equations that describe translating systems.
2.1 INTRODUCTION
If the velocity and acceleration of a body are both zero then the body will be static. If the applied forces are balanced, and cancel each other out, the body will not accelerate. If the forces are unbalanced then the body will accelerate. If all of the forces act through the center of mass then the body will only translate. Forces that do not act through the center of mass will also cause rotation to occur. This chapter will focus only on translational systems. The equations of motion for translating bodies are shown in Figure 2.1. These state simply that velocity is the first derivative of position, and velocity is the first derivative of acceleration. Conversely the acceleration can be integrated to find velocity, and the velocity can be integrated to find position. Therefore, if we know the acceleration of a body, we can determine the velocity and position. Finally, when a force is applied to a mass, an acceleration can be found by dividing the net force by the mass.
translation - 2.2
x,v,a
equations of motion d-$ v ( t ) = # ---x(t) ! dt" d-$ 2 d-$ # ------a(t) = # x ( t ) = ! dt" ! dt" v ( t ) OR x ( t ) = % v ( t ) dt = % % a ( t ) dt v(t) =
% a ( t ) dt
(t) (5) a(t) = F --------M where, x, v, a = position, velocity and acceleration M = mass of the body F = an applied force
Figure 2.1
An example application of these fundamental laws is shown in Figure 2.2. The initial conditions of the system are supplied (and are normally required to solve this type of problem). These are then used to find the state of the system after a period of time. The solution begins by integrating the acceleration, and using the initial velocity value for the integration constant. So at t=0 the velocity will be equal to the initial velocity. This is then integrated once more to provide the position of the object. As before, the initial position is used for the integration constant. This equation is then used to calculate the position after a period of time. Notice that the units are used throughout the calculations, this is a good practice for any engineer.
translation - 2.3
Given an initial (t=0) state of x=5m, v=2m/s, a=3ms-2, find the system state 5 seconds later assuming constant acceleration. The initial conditions for the system at time t=0 are, x 0 = 5m Note: units are very important and should nor1 v 0 = 2ms mally be carried through all calculations. 2 a 0 = 3ms The constant acceleration can be integrated to find the velocity as a function of time. Note: v ( t ) = % a 0 dt = a 0 t + C = a 0 t + v 0 (6) v ( t ) = a0 t + C v0 = a0 ( 0 ) + C v0 = C
Next, the velocity can be integrated to find the position as a function of time. a0 2 (7) x ( t ) = % v ( t ) dt = % ( a 0 t + v 0 ) dt = ----- t + v0 t + x0 2 This can then be used to calculate the position of the mass after 5 seconds. a0 2 x ( 5 ) = ----- t + v0 t + x0 2 2 2 1 3ms = ---------------- ( 5s ) + 2ms ( 5s ) + 5m 2 = 37.5m + 10m + 5m = 52.5m
Figure 2.2
2.2 MODELING
When modeling translational systems it is common to break the system into parts. These parts are then described with Free Body Diagrams (FBDs). Common components that must be considered when constructing FBDs are listed below, and are discussed in following sections. gravity and other fields - apply non-contact forces inertia - opposes acceleration and deceleration springs - resist deflection dampers and drag - resist motion friction - opposes relative motion between bodies in contact
translation - 2.4
cables and pulleys - redirect forces contact points/joints - transmit forces through up to 3 degrees of freedom
M = 10 kg K = 20 N/m
FBD Mass:
FBD Spring:
FR1 FR1
Mg FR2
Figure 2.3
translation - 2.5
forces, which will equal zero. The second method is known as DAlemberts equation where all of the forces are summed and set equal to the inertial force, as shown in Figure 2.4. The acceleration is proportional to the inertial force and inversely proportional to the mass.
& F = Ma & F Ma =
Figure 2.4
(Newtons) 0 (DAlemberts)
(11) (12)
An application of Newtons equation to FBDs can be seen in Figure 2.5. In the first case an inertial force is added to the FBD. This force should be in an opposite direction (left here) to the positive direction of the mass (right). When the sum of forces equation is used then the force is added in as a normal force component. In the second case Newtons equation is used so the force is left off the FBD, but added to the final equation. In this case the sign of the inertial force is positive if the assumed positive direction of the mass matches the positive direction for the summation.
translation - 2.6
Note: If using an inertial force then the direction of the force should be opposite to the positive motion direction for the mass. Newtons form: x d-$ 2 # ---F = F = M + & x ! dt" x or + d-$ 2 # ---F = F = M & x ! dt" x
Note: If using Newtons form the sign of the inertial force should be positive if the positive direction for the summation and the mass are the same, otherwise if they are opposite then the sign should be negative.
Figure 2.5
An example of the application of Newtons equation is shown in Figure 2.6. In this example there are two unbalanced forces applied to a mass. These forces are summed and set equal to the inertial force. Solving the resulting equation results in acceleration values in the x and y directions. In this example the forces and calculations are done in vector form for convenience and brevity.
translation - 2.7
5 F 1 = 4 N 0 If both forces shown act through the center of mass, what is the acceleration of the ball?
7 F2 = 3 N 0
M=10kg
&F
= F 1 + F 2 = Ma
5 7 N + 4 3 N = ( 10Kg ) a 0 0 2 0.2 0.2 1 -$ Kgm 1m # # $ --------------------------a = ! N = 0.7 ! 2 " = 0.7 ---2 10Kg" 7 Kg s s 0 0 0
Figure 2.6
// A program to sum forces and calculate the acceleration // define the given forces and mass F1 = [5, -4, 0]; F2 = [-7, -3, 0]; M = 10; function foo=Sum() // The sum of the applied forces foo = F1 + F2; endfunction A = Sum() / M; printf("The acceleration is ( %f, %f, %f) m/s^2 \n", A(1), A(2), A(3)); printf("The magnitude is |A| = %f m/s^2 \n", norm(A));
Figure 2.7
translation - 2.8
translation - 2.9
Assume we have a mass that is acted upon by gravity and a second constant force vector. To find the position of the mass as a function of time we first define the gravity vector and position components for the system.
M = 5Kg Fg g
m ---2 s
x(t) X( t) = y(t) z( t)
fx F = f y fz F g = Mg
Next, sum the forces and set them equal to inertial resistance. d-$ 2 # ---F = Mg + F = M & ! dt" X ( t ) fx 0 x(t) d-$ 2 m # ---5Kg 0 ---- + f = 5Kg ! dt" y ( t ) y 2 s 9.81 z(t) fz fx 0 x( t) 1 d-$ 2 m # ------+ 0.2Kg = fy 0 ! dt" y ( t ) 2 s z(t) 9.81 fz Integrate twice to find the position components. Note: When an engineer solves a problem they vx fx 0 will always be looking 0 x(t) 1 d m at the equations and # $ - y(t) - + 0.2Kg f y t + v y = ! ---0 ---" dt 2 unknowns. In this case 0 9.81 s z ( t ) there are three equafz vz tions, and there are 9 0 vx constants/givens fx, fy, fx x0 0 0 x ( t ) fz, vx0, vy0, xz0, x0, y0 1 2 1 m ----- + 0.2Kg fy t + vy t + y0 = y ( t ) 0 and z0. There are 4 2 2 0 s variables/unknowns x, 9.81 z(t) fz z0 vz y, z and t. Therefore 2 0.1f x t + v x t + x 0 0 with 3 equations and 4 0 unknowns only one x(t) 2 value (4-3) is required m 0.1f y t + v y t + y 0 y(t) = to find all of the 0 z(t ) unknown values. 9.81 # $ t2 + v t + z -----------+ 0.1f z" z0 0 ! 2 Figure 2.8 Gravity vector calculations
translation - 2.10
Like gravity, magnetic and electrostatic fields can also apply forces to objects. Magnetic forces are commonly found in motors and other electrical actuators. Electrostatic forces are less common, but may need to be considered for highly charged systems.
FBD: M
F1
Figure 2.9
2.2.4 Springs
Springs are typically constructed with elastic materials such as metals and plastics, that will provide an opposing force when deformed. The properties of the spring are determined by the Youngs modulus (E) of the material and the geometry of the spring. A primitive spring is shown in Figure 2.10. In this case the spring is a solid member. The relationship between force and displacement is determined by the basic mechanics of materials relationship. In practice springs are more complex, but the parameters (E, A and L) are combined into a more convenient form. This form is known as Hookes Law.
translation - 2.11
(Hookes law)
Figure 2.10
Hookes law does have some limitations that engineers must consider. The basic equation is linear, but as a spring is deformed the material approaches plastic deformation, and the modulus of elasticity will change. In addition the geometry of the object changes, also changing the effective stiffness. Springs are normally assumed to be massless. This allows the inertial effects to be ignored, such as a force propagation delay. In applications with fast rates of change the spring mass may become significant, and they will no longer act as an ideal device. The cases for tension and compression are shown in Figure 2.11. In the case of compression the spring length has been made shorter than its normal length. This requires that a compression force be applied. For tension, both the displacement from neutral and the required force reverse direction. It is advisable when solving problems to assume a spring is either in tension or compression, and then select the displacement and force directions accordingly.
translation - 2.12
x = deformed length
ASIDE: a spring has a natural or undeformed length. When at this length it is neither in tension or compression Fc
compression as positive:
x
Ks Fc = Ks x F c = K s x
Fc
x
Ks
Fc
x
Ks F c = K s x
tension as positive:
Ft
Ks
x
Ft Ks
Ft = Ks x
x
Ft Ks
Ft = Ks x
Ft = Ks x
NOTE: the symbols for springs, resistors and inductors are quite often the same or similar. You will need to remember this when dealing with complex systems - and especially in this book where we deal with both types of components.
Figure 2.11
Previous examples have shown springs with displacements at one end only. In Figure 2.12, springs are shown that have movement at both ends. In these cases the sign of the force applied to the spring is selected with reference to the assumed compression or tension. The primary difference is that care is required to correctly construct the expressions for the tension or compression forces. In all cases the forces on the springs must be assumed and drawn as either tensile or compressive. In the first example the displacement and forces are tensile. The displacement at the left is tensile, so it will be positive, but on the right hand side the displacement is compressive so it is negative. In the second exam-
translation - 2.13
ple the force and both displacements are shown as tensile, so the terms are both positive. In the third example the force is shown as compressive, while the displacements are both shown as tensile, so both terms are negative.
x1
Ks
x2
F = Ks ( x1 x 2 )
x1
Ks
x2
F = Ks ( x 1 + x 2 )
x1
Ks
x2
F = Ks ( x1 x2 )
Aside: it is useful to assume that the spring is either in tension or compression, and then make all decisions based on that assumption.
Figure 2.12
The example in Figure 2.13 shows two masses separated by a spring. In the first example the spring is assumed to be in tension. When x1 becomes positive it will put the spring in compression, so it is made negative, however a positive x2 will put the spring in tension, so it remains positive. In the second case the spring is assumed to be in compression and this time x2 will put it in tension so it is made negative.
translation - 2.14
The system can be reduced to free body diagrams assuming the spring is tension.
M1 x1
Ks ( x1 + x2 )
M2 x2
Note: In this example the spring is assumed to be in tension and the signs of the magnitude are made negative for terms that result in compression for positive changes. The system can be reduced to free body diagrams assuming the spring is in compression.
M1 x1
Ks ( x1 x2 )
M2 x2
Figure 2.13
Sometimes the true length of a spring is important, and the deformation alone is insufficient. In these cases the deformation can be defined as a deformed and undeformed length, as shown in Figure 2.14.
translation - 2.15
x = l1 l 0
where,
x = deformation
l 0 = the length when undeformed l 1 = the length when deformed
Figure 2.14
In addition to providing forces, springs may be used as energy storage devices. Figure 2.15 shows the equation for energy stored in a spring.
K( x) E P = ----------------2
Figure 2.15
translation - 2.16
Given, N K s = 10 --m Ks Ks F
x = 0.1m x
Find F assuming the springs are normally 4m long when unloaded Aside: it can help to draw a FBD of the pin. 10m
ans. F=2N
Figure 2.16
translation - 2.17
Draw the FBDs and the equations of motion for the masses F Ks M1 x1 M2 x2
ans. x1 ( M1 ) + x1 ( Ks ) + x2 ( Ks ) = F x 1 ( K s ) + x2 ( M2 ) + x2 ( K s ) = F
Figure 2.17
translation - 2.18
Figure 2.18
A physical damper
The basic equation for an ideal damper in compression is shown in Figure 2.19. In this case the force and displacement are both compressive. The force is calculated by multiplying the damping coefficient by the velocity, or first derivative of position. Aside from the use of the first derivative of position, the analysis of dampers in systems is similar to that of springs.
translation - 2.19
Aside: The symbol shown is typically used for dampers. It is based on an old damper design called a dashpot. It was constructed using a small piston inside a larger pot filled with oil.
Figure 2.19
An ideal damper
Damping can also occur when there is relative motion between two objects. If the objects are lubricated with a viscous fluid (e.g., oil) then there will be a damping effect. In the example in Figure 2.20 two objects are shown with viscous friction (damping) between them. When the system is broken into free body diagrams the forces are shown to be a function of the relative velocities between the blocks.
x1
Fd = Kd ( x1 x2 ) Kd Fd = Kd ( x1 x2 )
x2
Aside: Fluids, such as oils, have a significant viscosity. When these materials are put in shear they resist the motion. The higher the shear rate, the greater the resistance to flow. Normally these forces are small, except at high velocities.
Figure 2.20
A damping force is proportional to the first derivative of position (velocity). Aerodynamic drag is proportional to the velocity squared. The equation for drag is shown in
translation - 2.20
Figure 2.21 in vector and scalar forms. The drag force increases as the square of velocity. Normally, the magnitude of the drag force coefficient D is approximated theoretically and/or measured experimentally. The drag coefficient is a function of material type, surface properties, object size and object geometry.
v F F = D v v
Figure 2.21
Aerodynamic drag
The force is acting on the cylinder, resulting in the velocities given below. What is the applied force? d- x = 0.1 m -----dt 1 s d- x = 0.3 m -----dt 2 s
k d = 0.1 Ns ----m
ans. F = 0.02 N
Figure 2.22
translation - 2.21
Figure 2.23
If we have a pulley that is fixed and cannot rotate, the cable must slide over the surface of the pulley. In this case we can use the coefficient of friction to determine the relative ratio of forces between the sides of the pulley, as shown in Figure 2.24.
T1 T2 ( ) ---- = e k T1
T2
Figure 2.24
translation - 2.22
Given,
s = 0.35
M = 1Kg
k = 0.2
Find F to start the mass moving up and down, and then the force required to maintain a low velocity motion.
M F
ans. F up = 9.81 e
$ -0.2 # ! 2"
Figure 2.25
Although the discussion in this section has focused on cables and pulleys, the theory also applies to belts over drums.
translation - 2.23
2.2.7 Friction
Viscous friction was discussed before, where a lubricant would provide a damping effect between two moving objects. In cases where there is no lubricant, and the touching surfaces are dry, dry coulomb friction may result. In this case the surfaces will stick in place until a maximum force is overcome. After that the object will begin to slide and a constant friction force will result. Figure 2.26 shows the classic model for (dry Coulomb) friction. The force on the horizontal axis is the force applied to the friction surfaces while the vertical axis is the resulting friction force. Beneath the slip force the object will stay in place. When the slip force is exceeded the object will begin to move, and the resulting kinetic friction force will be relatively constant. (Note: If the object begins to travel much faster then the kinetic friction force will decrease.) It is common to forget that friction forces are bidirectional, but it always opposes the applied force or motion. The friction force is a function of the coefficient of friction and the normal force across the contact surfaces. The coefficient of friction is a function of the materials, surface texture and surface shape.
F result Fs Fk
Block begins to slip and the applied force exceeds the resultant and acceleration begins.
Fs
Fapplied
Fg N
F F k, F s
Fk = k N Fs s N
Note: When solving problems with friction remember that the friction force will always equal the applied force (not the maximum force) until slip occurs. After that the friction is approximately constant. In addition, the friction forces direction opposes applied forces, and motion.
Figure 2.26
Dry friction
translation - 2.24
Many systems use kinetic friction to dissipate energy from a system as heat, sound and vibration.
s = 0.3 k = 0.2
10 kg
2 = 35
1 = 5
ans.
Figure 2.27
translation - 2.25
F Ay A M1 B M1 g M2 F Bx F By F Ax
F By F Bx
M2 g
Note: Dont forget that forces on connected FBDs should have equal magnitudes, but opposite directions.
Figure 2.28
translation - 2.26
1. Assign letters/numbers to designate force components (if not already done) this will allow you to refer to components in your calculations. 2. Define positions and directions for any moving masses. This should include the selection of reference points. 3. Draw free body diagrams for each component, and add forces (inertia is optional). 4. Write equations for each component by summing forces. 5.(next chapter) Combine the equations by eliminating unwanted variables. 6.(next chapter) Develop a final equation that relates input (forcing functions) to outputs (results).
Note: When deriving differential equations, the final value can be checked for errors using unit analysis. This method involves replacing variables with their unit equivalents. All the units should match. e.g., x 2 ( M 2 ) + x 2 ( B ) + x 2 ( K s 2 ) + x 1 ( K s 2 ) = F m m N N # --# --- # Ns -----$ -$ -$ ---( Kg ) + --2 ! m " + m ! m" + m ! m" = N s s N + ( N ) + ( N ) + ( N ) = N The units match, so there are no obvious problems.
coefficient F Ks Kd M
Consider the cart in Figure 2.29. On the left is a force, it is opposed by a spring and damper on the right. The basic problem definition already contains all of the needed definitions, so no others are required. The FBD for the mass shows the applied force and the reaction forces from the spring and damper. When the forces are summed the inertia is on the right side of the equation in Newtons form. This equation is then rearranged to a second-order non-homogeneous differential equation.
translation - 2.27
x Kd Ks
Kd x Ksx
The forces for the cart are in a single direction and can be summed as, K x = M x + & Fx = F Kd x s 1 This equation can be rearranged to a second-order non-homogeneous diff. eqn. Kd Ks F + ------ + ------x -x - x = ------M1 M1 M1 Aside: later on we will solve the differential equations, or use other methods to determine how the system will behave. It is useful to have all of the output variables for the system on the left hand side, and everything else on the other.
Figure 2.29
translation - 2.28
Develop the equation relating the input force to the motion (in terms of x) of the lefthand cart for the problem below. x1 x2 K d1 F M1 K s1 M2 K s2 K d2
Figure 2.30
A simplified model of an elevator (M1) and a passenger (M2) are shown in Figure 2.31. In this example many of the required variables need to be defined. These are added to the FBDs. Care is also taken to ensure that all forces between bodies are equal in magnitude, but opposite in direction. The wall forces are ignored because they are statically indeterminate, and x-axis force components are irrelevant to the forces in the y-axis.
translation - 2.29
M1
M2 Kd K S2
K S1
y1
F S1 = K s1 y 1
Figure 2.31
The forces on the FBDs are summed and the equations are expanded in Figure 2.32.
translation - 2.30
& FM & FM
= FS1 + FS2 + M1 g + F D = M1 a1 = FS 2 + M2 g FD = M2 a2
At this point the equations are expanded dK S 1 ( y 1 ) + K S 2 ( y 2 y 1 ) + M 1 ( 9.81 ) + K d ---( y y ) = M1 ay dt 2 1 d( y y ) = M2 ay K S 2 ( y 2 y 1 ) + M 2 ( 9.81 ) K d ---dt 2 1 Figure 2.32 Equations for the elevator
translation - 2.31
Write the differential equations for the system below. Assume it is in motion
k1
M1 K S1
M2
k2
ans.
Figure 2.33
Consider the springs shown in Figure 2.34. When two springs are combined in this manner they can be replaced with a single equivalent spring. In the parallel spring combination the overall stiffness of the spring would increase. In the series spring combination the overall stiffness would decrease.
translation - 2.32
Parallel K S1 K S2
Series
K S1
K S2
Figure 2.34
Figure 2.35 shows the calculations required to find a spring coefficient equivalent to the two springs in series. The first step is to draw a FBD for the mass at the bottom, and for a point between the two springs, P. The forces for both of these are then summed. The next process is to combine the two equations to eliminate the height variable created for point P. After this, the equation is rearranged into Hookes law, and the equivalent spring coefficient is found.
translation - 2.33
First, draw FBDs for P and M and sum the forces assuming the system is static. + & F y = K S1 y 2 K S2 ( y 1 y 2 ) = 0 (1) K S2 ( y 1 y 2 ) K S2 ( y 1 y 2 ) M + Fg Next, rearrange the equations to eliminate y2 and simplify. (1) becomes K S2 ( y 1 y 2 ) Fg = 0 Fg y 1 y 2 = --------K S2 Fg y 2 = y 1 --------K S2 (2) becomes K S1 y 2 K S2 ( y 1 y 2 ) = 0 y1 K S1 y 2 K S1 P K S2 y2
& Fy
= K S2 ( y 1 y 2 ) F g = 0 (2) M
(3)
(4) y 2 ( K S1 + K S2 ) = y 1 K S2 Fg $ # sub (3) into (4) ' y ---------( ( K + K ) = y K S2 1 S2 ! 1 K S2" S1 Fg K S2 - = y --------------------------y 1 --------1K + K K S2 S1 S2 K S2 $ # -( K F g = y 1 ' 1 --------------------------K S1 + K S2" S2 ! # K S1 + K S2 K S2$ F g = y 1 ' --------------------------------------------( K S2 ! K S1 + K S2 " # K S1 K S2 $ -( F g = y 1 ' --------------------------! K S1 + K S2" Finally, consider the basic spring equation to find the equivalent spring coefficient. K S1 K S2 = --------------------------K equiv K S1 + K S2 Figure 2.35 Calculation of an equivalent spring coefficient for springs in series
translation - 2.34
KS 1
KS 2
ans.
Figure 2.36
Consider the drill problem. When an object has no mass, the force applied to one side of the spring will also be applied to the other. The only factor that changes is displacement.
translation - 2.35
Show that a force applied to one side of a massless spring is the reaction force at the other side.
ans.
Figure 2.37
translation - 2.36
Figure 2.38
2.5 SUMMARY
FBDs are useful for reducing complex systems to simpler parts. Equations for translation and rotation can be written for FBDs. The equations can be integrated for dynamic cases, or solved algebraically for static cases.
translation - 2.37
2. Derive the effective damping coefficients for the pairs below from basic principles, a) Kd1
Kd2
b)
Kd1
Kd2
M B
translation - 2.38
8. Write the differential equations for the system below. x1 Kd1 Ks 1 M1 Ks 2 Kd 2 M2 F x2 Kd 3 Ks3
translation - 2.39
Ks 1
Kd 1
M2
x2
Ks 2
Kd 2
translation - 2.40
12. Write the differential equations for the system below. Assume that the pulley is massless and frictionless and that the system begins undeflected. x Ks1 M B R
Ks2
13. Write the differential equations for the system below. In this system the upper mass, M1, is between a spring and a cable and there is viscous damping between the mass and the floor. The suspended mass, M2, is between the cable and a damper. The cable runs over a massless, frictionless pulley. x1 Ks M1 B R
M2
x2
Kd
translation - 2.41
M2
x2
Ks2
3. B F ----$ = ---x + x# ! M" M 4. Ks $ K s$ F# -----------------x1 + x1 # ! M 1" + x 2 ! M 1 " = M 1 Ks $ K s$ # -------x 2 + x 2 # -----! M 2" + x 1 ! M 2 " = 0
translation - 2.42
5. K s 1 + K s 2$ K s 2$ K d 1$ -------- + x 1 # ---------------------- + x 2 # ---------x1 + x1 # ! M1 " ! M1 " ! M1 " = 0 K s 2$ -----B-$ Fs 2$ #K ------- + x 1 # --------------x2 + x2 # + x 2 ! M 2" ! M2 " ! M2 " = M2 6. Ks $ K s$ Kd + B1 -$ + x 1 # ------ + x 2 # -------x 1 + x 1 # -----------------! M1 " ! M 1" ! M1 " = 0 B2 $ Ks $ K s$ -----F - + x 2 # ------ + x 1 # ------------x2 + x2 # ! M 2" ! M 2" ! M2 " = M2 7. K s 1$ K s 2$ Kd 1 -$ + x 1 # ------- + x 2 # ---------- = 0 x 1 + x 1 # -------! M1 " ! M1 " ! M1 " Ks $ B $ B$ F ----- # -----# ----------x1 + x1 # ! M 2" + x 2 + x 2 ! M 2" + x 2 ! M 2" = M 2
translation - 2.43
Kd2 ( x1 x2 ) Ks2 ( x1 x2 ) M2
Kd 3 x2 Ks 3 x2 M2 x2
F & F = K d 1 x1 Ks 1 x1 K d 2 ( x1 x2 ) K s2 ( x1 x 2 ) = M1 x1
x1 ( M1 ) + x1 ( Kd 1 + K d2 ) + x1 ( Ks 1 + K s2 ) + x2 ( K d 2 ) + x2 ( K s2 ) = 0 K s 1 + K s 2$ # K d 2$ K s 2$ Kd 1 + K d2 -$ + x 1 # ---------------------- + x 2 ----------- + x 2 # ---------x 1 + x 1 # ----------------------! ! M1 " ! M1 " ! M1 " = 0 M1 " For M2: +
&F
= Kd2 ( x1 x2 ) + Ks2 ( x1 x2 ) + F Kd3 x2 Ks3 x2 = M2 x2 x2 ( M2 ) + x2 ( Kd 2 + K d3 ) + x2 ( Ks 2 + K s3 ) + x1 ( K d 2 ) + x1 ( K s2 ) = F K s 2 + K s 3$ # K d 2$ K s 2$ K d 2 + K d 3$ ----------------------- + x 2 # ---------------------- + x 1 ----------- + x 1 # ---------x2 + x2 # ! ! M2 " ! M2 " ! M2 " = F M2 "
9. x1 ( M1 ) + x1 ( K d1 + B ) + x1 ( Ks 1 ) + x2 ( B ) = 0 K s 1$ # B $ Kd 1 + B -$ + x 1 # ------- + x 2 ------ = 0 x 1 + x 1 # -----------------! M1 " ! M1 " ! M 1" x2 ( M2 ) + x2 ( B ) + x2 ( Ks 2 ) + x1 ( B ) = F K s 2$ # B $ B-$ F- + x 1 ------ = -----+ x 2 # ------x 2 + x 2 # -----! M 2" ! M2 " ! M 2" M2
translation - 2.44
10. x1 ( M1 ) + x1 ( Kd 1 ) + x 1 ( K s 1 ) = FF K s 1$ FF Kd 1 -$ + x 1 # ------- = -----x 1 + x 1 # -------! M1 " ! M1 " M1 x2 ( M2 ) + x2 ( Ks 2 ) = F FF K s 2$ F FF ------- = --------------x2 + x2 # ! M2 " M2 where, FF s M2 g # x1 x2 $ F F = k M 2 g ' ----------------- -( ! x1 x2 " if if
x1 = x2 x1 x2
11. (assuming no gravity x1 ( M1 ) + x1 ( Kd 1 ) + x 1 ( K s1 ) + x2 ( K d 1 ) + x2 ( K s1 ) = F K s 1$ # K d 1$ K s 1$ Kd 1 F-$ + x 1 # ------- + x 2 ----------- + x 2 # ---------- = -----x 1 + x 1 # -------! M1 " ! M1 " ! M1 " ! M1 " M1 x2 ( M2 ) + x2 ( Kd 1 + K d2 ) + x2 ( Ks 1 + K s2 ) + x1 ( K d 1 ) + x1 ( K s1 ) = 0 K d 1 + K d 2$ K s 1 + K s 2$ # K d 1$ K s 1$ ----------------------- + x 2 # ---------------------- + x 1 ----------- + x 1 # ---------x2 + x2 # ! ! M2 " ! M2 " ! M2 " = 0 M2 " 12. if ( x 0 ) if ( x < 0 ) T = 0 T = K s 2 x
translation - 2.45
13. FBDs: Ks x 1 Bx 1 + M1 T M1 x1 M2 M2 g T M2 x2 Kd x2
For M1:
&F
For M2: +
&F
For T:
Topics: First and second-order homogeneous differential equations Non-homogeneous differential equations First and second-order responses Non-linear system elements Design case Objectives: To develop explicit equations that describe a system response. To recognize first and second-order equation forms.
3.1 INTRODUCTION
In the previous chapter we derived differential equations of motion for translating systems. These equations can be used to analyze the behavior of the system and make design decisions. The most basic method is to select a standard input type (a forcing function) and initial conditions, and then solve the differential equation. It is also possible to estimate the system response without solving the differential equation as will be discussed later. Figure 3.1 shows an abstract description of a system. The basic concept is that the system changes the inputs to outputs. Say, for example, that the system to be analyzed is an elevator. Inputs to the system would be the mass of human riders and desired elevator height. The output response of the system would be the actual height of the elevator. For analysis, the system model could be developed using differential equations for the motor, elastic lift cable, mass of the car, etc. A basic test would involve assuming that the elevator starts at the ground floor and must travel to the top floor. Using assumed initial values and input functions the differential equation could be solved to get an explicit equation for elevator height. This output response can then be used as a guide to modify design choices (parameters). In practice, many of the assumptions and tests are mandated by law or by groups such as Underwriters Laboratories (UL), Canadian Standards Association (CSA) and the European Commission (CE).
Note: By convention inputs are on the left, and outputs are on the right.
Figure 3.1
There are several standard input types used to test a system. These are listed below in order of relative popularity with brief explanations. step - a sudden change of input, such as very rapidly changing a desired speed from 0Hz to 50Hz. ramp - a continuously increasing input, such as a motor speed that increases constantly at 10Hz per minute. sinusoidal - a cyclic input that varies continuously, such as wave height that is continually oscillating at 1Hz. parabolic - an exponentially increasing input, such as a motor speed that is 2Hz at 1 second, 4rad/s at 2 seconds, 8rad/s at 3 seconds, etc. After the system has been modeled, an input type has been chosen, and the initial conditions have been selected, the system can be analyzed to determine its behavior. The most fundamental technique is to integrate the differential equation(s) for the system.
Ax + Bx = 0 Ax + Bx = Cf ( t ) Ax + Bx + Cx = 0 Ax + Bx + Cx = Df ( t )
Figure 3.2
A general solution for a first-order homogeneous differential equation is given in Figure 3.3. The solution begins with the solution of the homogeneous equation where a general form is guessed. Substitution leads to finding the value of the coefficient Y. Following this, the initial conditions for the equation are used to find the value of the coefficient X. Notice that the final equation will begin at the initial displacement, but approach zero as time goes to infinity. The e-to-the-x behavior is characteristic for a firstorder response.
Given the general form of a first-order homogeneous equation, x ( 0 ) = x0 and + Bx = 0 Ax Guess a solution form and solve. Yt = YX e Yt x = Xe x A ( YX e Yt ) + B ( Xe Yt ) = 0 initial condition
Note: The general form below is useful for finding almost all homogeneous equations x h ( t ) = Xe Yt
Next, use the initial conditions to find the remaining unknowns. B --t A x h = Xe B --0 A x 0 = Xe x0 = X Therefore the final equation is, x ( t ) = x0 e
B -t -A
Figure 3.3
Solve the following differential equation given the initial condition. x(0) = 3 + 2x = 0 x
ans.
x( t) = 3e
2 t
Figure 3.4
The general solution to a second-order homogeneous equation is shown in Figure 3.5. The solution begins with a guess of the homogeneous solution, and the solution of a quadratic equation. There are three possible cases that result from the solution of the quadratic equation: different but real roots; two identical real roots; or two complex roots. The three cases result in three different forms of solutions, as shown. The complex result is the most notable because it results in sinusoidal oscillations. It is not shown, but after the homogeneous solution has been found, the initial conditions need to be used to find the remaining coefficient values.
Guess a general equation form and substitute it into the differential equation, Yt = YXe Yt = Y 2 Xe Yt x x h = Xe x h h 2 Yt Yt Yt A ( Y Xe ) + B ( YXe ) + C ( Xe ) = 0 2 A(Y ) + B( Y) + C = 0 2 2 B ( B ) 4 ( AC ) = B B 4AC Y = -------------------------------------------------------------------------------------------2A 2A Note: There are three possible outcomes of finding the roots of the equations: two different real roots, two identical real roots, or two complex roots. Therefore there are three fundamentally different results. If the values for Y are both real, but different, the general form is, Y = R 1, R 2 xh = X1 e + X2 e Note: The initial conditions are then used to find the values for X1 and X2. R1 t R2 t
If the values for Y are both real, and identical, the general form is, Y = R 1, R 1 R1t R1 t xh = X1 e + X 2 te The initial conditions are then used to find the values for X1 and X2.
t x h = X 3 e cos ( t + X 4 ) The initial conditions are then used to find the values of X3 and X4.
Solution of a second-order homogeneous equation
Figure 3.5
As mentioned above, a complex solution when solving the homogeneous equation results in a sinusoidal oscillation, as proven in Figure 3.6. The most notable part of the solution is that there is both a frequency of oscillation and a phase shift. This form is very useful for analyzing the frequency response of a system, as will be seen in a later chapter.
Consider the situation where the results of a homogeneous solution are the complex conjugate pair. Y = R Cj This gives the general result, as shown below: (R + Cj )t ( R Cj ) t x = X1 e + X2e Rt Cjt Rt Cjt x = X1 e e + X2 e e Rt Cjt Cjt$ x = e # X1 e + X2 e ! " Rt x = e ( X 1 ( cos ( Ct ) + j sin ( Ct ) ) + X 2 ( cos ( C t ) + j sin ( C t ) ) ) Rt x = e ( X 1 ( cos ( Ct ) + j sin ( Ct ) ) + X 2 ( cos ( ( Ct ) j sin ( Ct ) ) ) ) Rt x = e ( ( X1 + X 2 ) cos ( Ct ) + j ( X 1 X 2 ) sin ( Ct ) ) Rt x = e ( ( X1 + X 2 ) cos ( Ct ) + j ( X 1 X 2 ) sin ( Ct ) ) 2 2 2 Rt ( X 1 + X 2 ) + j ( X 1 X 2 ) x = e ------------------------------------------------------------------------ ( ( X 1 + X 2 ) cos ( Ct ) + j ( X 1 X2 ) sin ( Ct ) ) 2 2 2 ( X1 + X2 ) + j ( X1 X2 ) 2 2 2 2 X 1 + 2X 1 X 2 + X 2 # X 1 + 2 X 1 X 2 + X 2$ ! " Rt x = e ------------------------------------------------------------------------------------------------------------ ( ( X 1 + X 2 ) cos ( Ct ) + j ( X 1 X 2 ) sin ( C 2 2 # 2 2$ X 1 + 2X 1 X 2 + X 2 ! X 1 + 2 X 1 X 2 + X 2" Rt 4X 1 X 2 -------------------- ( ( X 1 + X 2 ) cos ( Ct ) + j ( X 1 X 2 ) sin ( Ct ) ) 4X 1 X 2 ( X1 X2 ) # ( X1 + X2 ) $ Rt x = e 4X 1 X2 % ------------------------ cos ( Ct ) + j ----------------------- sin ( Ct )& ! 4X X " 4X 1 X 2 1 2 # # ( X1 X2 ) $ $ Rt -& & x = e 4X 1 X 2 cos % Ct + atan % -----------------------! ! ( X1 + X 2 )" " x = e x = e Rt X3 cos ( Ct + X 4 ) phase shift where, X = 3 4X 1 X 2 # ( X1 X2 ) $ -& X 4 = atan % -----------------------! ( X 1 + X 2 )"
frequency
Figure 3.6
Note: Occasionally a problem solution might consist of both a sine and cosine term with the same frequency. These should normally be combined to a single term with a phase shift as shown below. Recall the double angle formula, sin ( t + ) = sin t cos + sin cos t This can be written in a more common form, A ( sin t cos + sin cos t ) = A sin ( t + ) A cos sin t + A sin cos t = A sin ( t + ) B sin t + C cos t = A sin ( t + ) where, BCA = ----------= ---------cos sin sin ----------- = C --cos B
2 2
B = A cos C = A sin
A =
B +C
Figure 3.7
Solve the following differential equation given the initial condition. (0) = 2 x( 0) = 1 x + 2 x x +x = 0
ans.
x ( t ) = e + 3 te
Figure 3.8
The methods for solving non-homogeneous differential equations builds upon the methods used for the solution of homogeneous equations. This process adds a step to find the particular solution of the equation. An example of the solution of a first-order nonhomogeneous equation is shown in Figure 3.9. To find the homogeneous solution the nonhomogeneous part of the equation is set to zero. To find the particular solution the final
form must be guessed. This is then substituted into the equation, and the values of the coefficients are found. Finally the homogeneous and particular solutions are added to get the final equation. The overall response of the system can be obtained by adding the homogeneous and particular parts. This is acceptable because the equations are linear, and the principle of superposition applies. The homogeneous equation deals with the response to initial conditions, and the particular solution deals with the response to forced inputs.
Generally, + Bx = Cf ( t ) Ax x ( 0 ) = x0 First, find the homogeneous solution as before, in Figure 3.3. B --t A xh = x0 e Next, guess the particular solution by looking at the form of f(t). This step is highly subjective, and if an incorrect guess is made, it will be unsolvable. When this happens, just make another guess and repeat the process. An example is given below. In the case below the guess should be similar to the exponential forcing function. For example, if we are given + 2x = 5e 4t 6x A reasonable guess for the particular solution is, 4t = 4C e 4t xp = C1 e \x p 1 Substitute these into the differential equation and solve for A. 4t$ 4t$ 4t # 6# ! 4C 1 e " + 2 ! C 1 e " = 5e 524C 1 + 2C 1 = 5 C 1 = ----26 Combine the particular and homogeneous solutions. 6 --t 4t 2 5 x = x p + x h = ----- e + x0 e 26 Figure 3.9 Solution of a first-order non-homogeneous equation
The method for finding a particular solution for a second-order non-homogeneous differential equation is shown in Figure 3.10. In this example the forcing function is sinusoidal, so the particular result should also be sinusoidal. The final result is converted into a phase shift form.
(0) = v x( 0 ) = x0 and x 0 1. Find the homogeneous solution as before. t x h = X 3 e cos ( t + X4 ) or t t x h = X 1 e + X 2 te or 1 t 2 t + X2 e xh = X1 e 2. Guess the particular solution by looking at the form of f(t). This step is highly subjective, and if an incorrect guess is made it will be unsolvable. When this happens, just make another guess and repeat the process. For the purpose of illustration an example is given below. In the case below it should be similar to the sine function. For example, if we are given + 6x + 2x = 2 sin ( 3t + 4 ) 2x A reasonable guess is, x p = A sin ( 3t ) + B cos ( 3t ) = 3 A cos ( 3t ) 3 B sin ( 3t ) x p = 9 A sin ( 3t ) 9 B cos ( 3t ) x p Substitute these into the differential equation ans solve for A and B. 2 ( 9 A sin ( 3 t ) 9 B cos ( 3 t ) ) + 6 ( 3 A cos ( 3 t ) 3 B sin ( 3 t ) ) + 2 ( A sin ( 3 t ) + B cos ( 3 t ) ) = 2 sin ( 3 t + 4 ) ( 18 A 18 B + 2A ) sin ( 3t ) + ( 18 B + 18 A + 2B ) cos ( 3t ) = 2 sin ( 3t + 4 ) ( 16 A 18 B ) sin ( 3t ) + ( 18 A 16 B ) cos ( 3t ) = 2 ( sin 3t cos 4 + cos 3t sin 4 ) ( 16 A 18 B ) sin ( 3t ) + ( 18 A 16 B ) cos ( 3t ) = ( 2 cos 4 ) sin ( 3t ) + ( 2 sin 4 ) cos ( 3t ) 18 A 16 B = 2 sin 4 16 A 18 B = 2 cos 4 16 18 A = 2 cos 4 A = 16 18 18 16 B 2 sin 4 B 18 16 Next, rearrange the equation to phase shift form. 0.0823-$ 2 2 # -------------------$ 0.0109 + 0.0823 sin # ! 3 t + atan ! 0.0109" + 2" 3. Use the initial conditions to determine the coefficients in the homogeneous solution. xp = x p = 0.0109 sin ( 3t ) + 0.0823 cos ( 3t )
1
Generally, + Bx + Cx = Df ( t ) Ax
Figure 3.10
When guessing particular solutions, the forms in Figure 3.11 can be helpful.
Figure 3.11
Solve the following differential equation given the initial condition. (0) = 0 x x( 0) = 0 + 2x +x = 1 x
ans.
x ( t ) = e te + 1
Figure 3.12
An example of a second-order system is shown in Figure 3.13. As expected, it begins with a FBD and summation of forces. This is followed with the general solution of
the homogeneous equation. Real roots are assumed thus allowing the problem solution to continue in Figure 3.14.
M Assume the system illustrated to the right starts from rest at a height h. At time t=0 the system is released and allowed to move. Ks Mg My + Ksy Kd y
Fg Kd
' Fy
= M y = Mg + K s y + K d y
+ K y My d + K s y = Mg
Find the homogeneous solution. At At = Ae At = A 2 e yh = e y y h h + K y My d + Ks y = 0 2 At$ At At M# A ! e " + K d ( Ae ) + K s ( e ) = 0 2 MA + K d A + K s = 0 2 K d K d 4MK s A = ------------------------------------------------2M Let us assume that the values of M, Kd and Ks lead to the case of two different positive roots. This would occur if the damper value was much larger than the spring and mass values. Thus, A = R 1, R 2 R1 t R2 t y h = C1 e + C2 e Figure 3.13 Second-order system example
The solution continues by assuming a particular solution and calculating values for the coefficients using the initial conditions in Figure 3.14. The final result is a secondorder system that is overdamped, with no oscillation.
yh = 0
M ( 0 ) + K d ( 0 ) + K s ( C ) = Mg Mg C = ------Ks Now, add the homogeneous and particular solutions and solve for the unknowns using the initial conditions. R t R t Mg - + C 1 e 1 + C2 e 2 y ( t ) = y p + y h = ------Ks y(0) = h y' ( 0 ) = 0 Mg - + C1 e0 + C 2 e0 h = ------Ks Mg C 1 + C 2 = h ------Ks y' ( t ) = R 1 C 1 e
0 R1t
+ R2 C2 e
0
R2 t
0 = R1 C1 e + R2 C2 e 0 = R1 C 1 + R2 C2
R2 -C C 1 = -------R1 2
R2 - C + C 2 = h Mg ------ ----R1 2 Ks K s h Mg$ # R 1 $ - ----------------C 2 = # ---------------------! K s " ! R 1 R 2" R2 # K s h Mg$ # R 1 $ - ---------------------- ----------------C 1 = -------R1 ! K s " ! R 1 R 2"
Now, combine the solutions and solve for the unknowns using the initial conditions. K s h Mg$ # R 1 $ R1 t R2 # K s h Mg$ # R1 $ R2 t Mg - + # ---------------------- ----------------- e + -------- ---------------------- ----------------- e y ( t ) = ------K s " ! R 1 R 2" R1 ! K s " ! R1 R 2" Ks ! K s h Mg$ # R 1 $ R1 t # K s h Mg$ # R 2 $ R2 t Mg - e + ---------------------- e - + # ---------------------- ----------------- ----------------y ( t ) = ------! K s " ! R 1 R 2" K s " ! R1 R 2" Ks !
Figure 3.14
Given,
A sin ( t + ) A ( cos t sin + sin t cos ) ( A sin ) cos t + ( A cos ) sin t B cos t + C sin t where, B = A sin C = A cos
To find theta, B A sin --- = --------------- = tan C A cos ---$ = atan # ! C" B To find A, (method #1) B CA = ---------- = ----------sin cos To find A, (method #2) 2 2 A = B +C For example, 3 cos 5t + 4 sin 5t 2 2 4 3 + 4 sin # -$ ! 5t + atan -3" 5 sin ( 5t + 0.9273 )
Figure 3.15
3.3 RESPONSES
Solving differential equations tends to yield one of two basic equation forms. The e-to-the-negative-t forms are the first-order responses and slowly decay over time. They never naturally oscillate, and only oscillate if forced to do so. The second-order forms may
3.3.1 First-order
A first-order system is described with a first-order differential equation. The response function for these systems is natural decay or growth as shown in Figure 3.16. The time constant for the system can be found directly from the differential equation. It is a measure of how quickly the system responds to a change. When an input to a system has changed, the system output will be approximately 63% of the way to its final value when the elapsed time equals the time constant. The initial and final values of the function can be determined algebraically to find the first-order response with little effort. If we have experimental results for a system, we can calculate the time constant, initial and final values. The time constant can be found two ways, one by extending the slope of the first part of the curve until it intersects the final value line. That time at the intersection is the time constant. The other method is to look for the time when the output value has shifted 63.2% of the way from the initial to final values for the system. Assuming the change started at t=0, the time at this point corresponds to the time constant.
y y0 t y ( t ) = y1 + ( y0 y1 ) e
1 + -y - y = f(t)
y1
time constant
OR y y1
Note: The time will be equal to the time constant when the value is 63.2% of the way to the final value, as shown below. t y ( ) = y1 + ( y0 y1 ) e y ( ) = y1 + ( y0 y1 ) e 1
y0
Figure 3.16
The example in Figure 3.17 calculates the coefficients for a first-order differential equation given a graphical output response to an input. The differential equation is for a permanent magnet DC motor, and will be examined in a later chapter. If we consider the steady state when the speed is steady at 1400RPM, the first derivative will be zero. This simplifies the equation and allows us to calculate a value for the parameter K in the differential equation. The time constant can be found by drawing a line asymptotic to the start of the motor curve, and finding the point where it intercepts the steady-state value. This gives an approximate time constant of 0.8 s. This can then be used to calculate the remaining coefficient. Some additional numerical calculation leads to the final differential equation as shown.
For the motor, use the differential equation and the speed curve when Vs=10V is applied: 1400 RPM # K 2$ d-$ K-$ # ----& = # ---- + % -----! dt" ! " Vs JR JR ! " 1s 2s 3s
For steady-state 1 d-$ # --- = 1400RPM = 146.6rads ! dt" = 0 # K 2$ K-$ -& 146.6 = # ----0 + % -----! " 10 JR JR ! " K = 0.0682 1400 RPM
0.8s
1s # K 2$ 1-& = --------% -----JR 0.8s ! " K-$ 10.0682 # ----= --------! JR" 0.8s K- = 18.328 ----JR 1 + ----- = 18.328Vs 0.8
Figure 3.17
Find the differential equation when a step input of Vs=12V is applied: 1800 RPM d-$ K $ K-$ # ---# ----# ----! dt" + ! JR" = ! JR" V s 0.2s 0.4s 0.6s
2
ans.
Figure 3.18
A simple mechanical example is given in Figure 3.19. The modeling starts with a FBD and a sum of forces. After this, the homogenous solution is found by setting the nonhomogeneous part to zero and solving. Next, the particular solution is found, and the two solutions are combined. The initial conditions are used to find the remaining unknown coefficients.
Find the response to the applied force if the force is applied at t=0s. Assume the system is initially deflected a height of h. F y d-$ K d # ---y ! dt" Find the homogeneous solution. Bt = ABe Bt y h = Ae y h Bt Bt K d ( ABe ) + K s ( Ae ) = 0 Kd B + K s = 0 Ks y Ks B = --------Kd Next, find the particular solution. yp = C Kd ( 0 ) + K s ( C ) = F = 0 y p + ' Fy d-$ = F + K s y + K d # ---y = 0 ! dt" +K y = F Kd y s Ks
Kd
FC = ----Ks Combine the solutions, and find the remaining unknown. Ks ---------t Kd Fy ( t ) = y p + y h = Ae + ----Ks y(0) = h 0 F Fh = Ae + ----A = h ----Ks Ks The final solution is, F$ ----y(t) = # ! h K s" e
Ks --------t Kd
F + ----Ks
Figure 3.19
Use the general form given below to solve the problem in Figure 3.19 without solving the differential equation. Assume the system starts at y=-20. y + 10 y = 5 y ( t ) = y1 + ( y0 y1 ) e
t
ans.
y ( t ) = 0.5 19.5 e
10 t
Figure 3.20
Drill problem: Developing the final equation using the first-order model form
A first-order system tends to be passive, meaning it doesnt deliver energy or power. A first-order system will not oscillate unless the input forcing function is also oscillating. The output response lags the input and the delay is determined by the systems time constant.
3.3.2 Second-order
A second-order system response typically contains two first-order responses, or a first-order response and a sinusoidal component. A typical sinusoidal second-order response is shown in Figure 3.21. Notice that the coefficients of the differential equation include a damping coefficient and a natural frequency. These can be used to develop the final response, given the initial conditions and forcing function. Notice that the damped frequency of oscillation is the actual frequency of oscillation. The damped frequency will be lower than the natural frequency when the damping coefficient is between 0 and 1. If the damping coefficient is greater than one the damped frequency becomes negative, and the system will not oscillate because it is overdamped.
= n
t
d = n 1
cos ( d t )
y ( t ) = y ss + ( y 0 y ss ) e y ss
y0
Natural frequency of system - Approximate frequency of control system oscillations. Damping factor of system - If < 1 underdamped, and system will oscillate. If =1 critically damped. If > 1 overdamped, and never any oscillation (more like a first-order system). As damping factor approaches 0, the first peak becomes infinite in height. The actual frequency of oscillation - It is below the natural frequency because of the damping.
Figure 3.21
When only the damping coefficient is increased, the frequency of oscillation, and overall response time will slow, as seen in Figure 3.22. When the damping coefficient is 0 the system will oscillate indefinitely. Critical damping occurs when the damping coeffi-
cient is 1. At this point both roots of the differential equation are equal. The system will not oscillate if the damping coefficient is greater than or equal to 1.
= 0
= 0.5
(underdamped)
1- = 0.707 = -----2
= 1 (critical)
(overdamped)
Figure 3.22
When observing second-order systems it is more common to use more direct measurements of the response. Some of these measures are shown in Figure 3.23. The rise
time is the time it takes to go from 10% to 90% of the total displacement, and is comparable to a first order time constant. The settling time indicates how long it takes for the system to pass within a tolerance band around the final value. The permissible zone shown is 2%, but if it were larger the system would have a shorter settling time. The period of oscillation can be measured directly as the time between peaks of the oscillation, the inverse is the damping frequency. (Note: dont forget to convert to radians.) The damped frequency can also be found using the time to the first peak, as half the period. The overshoot is the height of the first peak. Using the time to the first peak, and the overshoot the damping coefficient can be found.
tp
Note: This figure is not to scale to make details near the steady-state value easier to see. 1 f d = -T T e ss
ts
x
0.5 x
where, t r = rise time (from 10% to 90%) t s = settling time (to within 2-5% typ.) x = total displacement T, f d = period and frequency - damped b = overshoot t p = time to first peak e ss = steady state error
0.1 x t
x = xe
cos ( d t )
d ---tp
b- = e ----x 1 = ---------------------------- -$ 2 # ------! t p " + 1 Figure 3.23 Characterizing a second-order response (not to scale)
= n tp
Note: We can calculate these relationships using the complex homogenous form, and the generic second order equation form.
n = ----
(1)
n 1 = d
(2)
(3)
The time to the first peak can be used to find the approximate decay constant x ( t ) = C1e d = --tp b xe (1) b-$ ln # ----! x" = ----------------tp
tp t
(4)
(5)
Figure 3.24
t 0 5.0 4.0 Write a function of time for the graph. (Note: measure, using a ruler, to get values.) Find the natural frequency and damping coefficient to develop the differential equation. Using the dashed lines determine the settling time.
ans. t<4 t4
y(t) = 0 y(t) =
Figure 3.25
Figure 3.26
The basic techniques used for solving first and second-order differential equations can be applied to higher order differential equations, although the solutions will start to become complicated for systems with much higher orders. The example in Figure 3.27 shows a fourth order differential equation. In this case the resulting homogeneous solution yields four roots. The result in this case are two real roots, and a complex pair. The two real roots result in e-to-the-t terms, while the complex pair results in a damped sinusoid. The particular solution is relatively simple to find in this example because the non-homogeneous term is a constant.
Given the homogeneous differential equation d-$ 4 d-$ 3 d-$ 2 d-$ # ---x + 13 # ---x + 34 # ---x + 42 # ---x + 20x = 5 ! dt" ! dt" ! dt" ! dt" Guess a solution for the homogeneous equation, At xh = e 3 At d-$ 3 2 At # ---d-$ 2 d- x = Ae At # ---x = A e ---x = A e ! dt" h ! dt" h dt h
Substitute the values into the differential equation and find a value for the unknown. 4 At 3 At 2 At At At A e + 13A e + 34A e + 42Ae + 20e = 0 4 3 2 A + 13A + 34A + 42A + 20 = 0 A = 1, 10, 1 j, 1 + j xh = C1 e t + C2 e 10t t + C 3 e cos ( t + C 4 ) d-$ 4 # ---! dt" x p = 0
Guess a particular solution, and the solve for the coefficient. d-$ 2 d-$ 3 d- x = 0 # ---# ---xp = A ---x = 0 ! dt" p ! dt" x p = 0 dt p 0 + 13 ( 0 ) + 34 ( 0 ) + 42 ( 0 ) + 20A = 5 A = 0.25
Figure 3.27
The example is continued in Figure 3.28 and Figure 3.29 where the initial conditions are used to find values for the coefficients in the homogeneous solution.
Solve for the unknowns, assuming the system starts at rest and undeflected. t 10t t x ( t ) = C1 e + C 2 e + C 3 e cos ( t + C 4 ) + 0.25 0 = C 1 + C 2 + C 3 cos ( C 4 ) + 0.25
(1)
(2) C 3 cos ( C 4 ) = C 1 C 2 0.25 d- x ( t ) = C e t 10C e 10t C e t cos ( t + C ) C e t sin ( t + C ) ---1 2 3 4 3 4 dt h (3) 0 = C 1 10C 2 C 3 cos ( C 4 ) C 3 sin ( C 4 ) Equations (1) and (3) can be added to get the simplified equation below. 0 = 9C 2 C 3 sin ( C 4 ) + 0.25 C 3 sin ( C 4 ) = 9C 2 + 0.25 (4)
t 10t t t d-$ 2 # ---x ( t ) = C e + 100C e + C e cos ( t + C ) + C e 1 2 3 4 3 sin ( t + C 4 ) + ! dt" h t t C 3 e sin ( t + C 4 ) C 3 e cos ( t + C 4 ) 0 = C1 + 100C 2 + C 3 cos ( C 4 ) + C 3 sin ( C 4 ) + C 3 sin ( C 4 ) C 3 cos ( C 4 ) (5) 0 = C 1 + 100C 2 + 2C 3 sin ( C 4 ) Equations (4) and (5) can be combined. 0 = C 1 + 100C 2 + 2 ( 9C 2 + 0.25 ) 0 = 17C 1 + 100C 2 + 0.5 (6)
t 10t t t d-$ 3 # ---x ( t ) = C 1 e + ( 1000 ) C 2 e 2C 3 e sin ( t + C 4 ) + 2C 3 e cos ( t + C 4 ) ! dt" h (7) 0 = C 1 + ( 1000 ) C 2 2 C 3 sin ( C 4 ) + 2 C 3 cos ( C 4 )
Figure 3.28
Equations (2 and (4) are substituted into equation (7). 0 = C 1 + ( 1000 ) C 2 2 ( 9C 2 + 0.25 ) + 2 ( C 1 C 2 0.25 ) 0 = 3C 1 + ( 984 ) C 2 1 984 1 --------$ -C1 = # ! 3 " C2 3 Equations (6) and (8) can be combined. # 984 --------$ C 1 --$ 0 = 17 # ! ! 3 " 2 3" + 100C 2 + 0.5 0 = 5676C2 + 6.1666667 (8)
C 2 = 0.00109
984 -$ ( 0.00109 ) 1 -C 1 = # -------C 1 = 0.0242 ! 3 " 3 Equations (2) and (4) can be combined. C 3 sin ( C 4 ) 9C 2 + 0.25 --------------------------- = --------------------------------------C 3 cos ( C 4 ) C 1 C 2 0.25 9 ( 0.00109 ) + 0.25 C 4 = 0.760 tan ( C 4 ) = -------------------------------------------------------------------------- ( 0.0242 ) ( 0.00109 ) 0.25 Equation (4) can be used the find the remaining unknown. C 3 sin ( 0.760 ) = 9 ( 0.00109 ) + 0.25 C 3 = 0.377
The final response function is, t 10t t x ( t ) = 0.0242e + ( 0.00109 ) e + ( 0.377 ) e cos ( t 0.760 ) + 0.25
Figure 3.29
In some cases we will have systems with multiple differential equations, or nonlinear terms. In these cases explicit analysis of the equations may not be feasible. In these cases we may use other techniques, such as numerical integration, which will be covered in later chapters.
cases an unstable system may be the objective, such as an explosive device. Simple methods for determining the stability of a system are listed below: 1. If a step input causes the system to go to infinity, it will be inherently unstable. 2. A ramp input might cause the system to go to infinity; if this is the case, the system might not respond well to constant change. 3. If the response to a sinusoidal input grows with each cycle, the system is probably resonating, and will become unstable. Beyond establishing the stability of a system, we must also consider general performance. This includes the time constant for a first-order system, or damping coefficient and natural frequency for a second-order system. For example, assume we have designed an elevator that is a second-order system. If it is under damped the elevator will oscillate, possibly leading to motion sickness, or worse. If the elevator is over damped it will take longer to get to floors. If it is critically damped it will reach the floors quickly, without overshoot. Engineers distinguish between initial setting effects (transient) and long term effects (steady-state). The transient effects are closely related to the homogeneous solution to the differential equations and the initial conditions. The steady-state effects occur after some period of time when the system is acting in a repeatable or non-changing form. Figure 3.30 shows a system response. The transient effects at the beginning include a quick rise time and an overshoot. The steady-state response settles down to a constant amplitude sine wave.
Steady-state Transient
Note: the transient response is predicted with the homogeneous solution. The steady state response in mainly predicted with the particular solution, although in some cases the homogeneous solution might have steady state effects, such as a non-decaying oscillation.
Figure 3.30
2 x+x = 5
2 x +x = 5 x + log ( x ) = 5 x + ( 5t ) x = 5
Figure 3.31
Examples of system conditions that lead to non-linear solutions are, aerodynamic drag forces that are a squared function of distance devices with non-linear responses Explicitly solving non-linear differential equations can be difficult, and will typically involve complex solutions for simple problems.
Consider the differential equation for a 100kg human ejected from an airplane. The aerodynamic drag will introduce a squared variable, therefore making the equation non-linear. 2 2 ) 2 Mg = My 0.8 Ns --------- ( y' ) F y = 0.8 ( y ' 2 m 2 2 N + 0.8 Ns ) = 100kg9.81 ----100kgy --------- ( y 2 kg m 2 2 + 0.8 Ns ) = 981N 100kgy --------- ( y y 2 Mg m 2 m s -(y m + 0.8kg --- ) 2 = 981kg ---100kgy - -----2 2 2 m s s 2 + 0.8m 1 ( y ) = 981ms 2 100y + 8 10 3 m 1 ( y ) 2 = 9.81 ms 2 y The terminal velocity can be found be setting the acceleration to zero. 2 3 1 2 ( 0 ) + 8 10 m ( y ) = 9.81 ms 2 9.81 ms 9.81 - m 2 s 2 = 35.0 m - = ------------------y = -------------------------------- = 126 km ----- 3 s h 3 1 8 10 8 10 m
Figure 3.32
The equation can also be solved using explicit integration, as shown in Figure 3.33. In this case the equation is separated and rearranged to isolate the v terms on the left, and time on the right. The term is then integrated in Figure 3.34 and Figure 3.35. The final form of the equation is non-trivial, but contains e-to-t terms, as we would expect.
An explicit solution can begin by replacing the position variable with a velocity variable and rewriting the equation as a separable differential equation.
1 2 2 100y + 0.8m ( y ) = 981ms 1 2 2 100v + 0.8m v = 981ms
dv - + 0.8m 1 v 2 = 981ms 2 100 ----dt dv - = 981ms 2 0.8m 1 v 2 100 ----dt 100 ------------------------------------------------dv = dt 2 1 2 981ms 0.8m v 100 ------------------1 0.8m - dv = ( dt ( -------------------------------------------981 2 2 ------------------- ms + v 1 0.8m 125m - dv = t + C1 ( -------------------------------------------2 2 2 v 1226.25m s ----------------------------------------------------------------- dv (# m$ # m$ ! - v 35.02 --v + 35.02 --s" s"! 125m = t + C1
Figure 3.33
Developing an integral
This can be reduced with a partial fraction expansion. A B -------------------------------- + ------------------------------- dv = t + C 1 m # v + 35.02 m $ # $ --v 35.02 --! s" ! s" m Av A # -$ + Bv + B # 35.02 m ---$ = 125m ! 35.02 --" ! s s" v ( A + B ) + 35.02 m --- ( A + B ) = 125m s A = B A+B = 0
B = 1.785s A = 1.785s
The integral can then be solved using an identity from the integral table. In this case the integration constants can be left off because they are redundant with the one on the right hand side. 1.785s ln v + 35.02 m --- 1.785s ln v 35.02 m --- = t + C1 s s v + 35.02 m --s- = t + C 1 ln a + bx- + C 1.785s ln --------------------------( a + bx ) dx = ----------------------1 ( m b v 35.02 --s t -+C --------------v + 35.02 m --1 s- = e 1.785s --------------------------v 35.02 m --s t --------------m 1.785s C v + 35.02 --s- = e 1 e --------------------------v 35.02 m --s
Figure 3.34
m t --------------v + 35.02 --s = C e 1.785s --------------------------2 m v 35.02 --s An initial velocity of zero can be assumed to find the value of the integration constant m 0 --------------0 + 35.02 --1.785s s --------------------------- = C2 e m 0 35.02 --s 1 = C2
This can then be simplified, and the absolute value sign eliminated. m t v + 35.02 ----------------s 1.785s --------------------------- = e m v 35.02 --s
t ---------------
t ---------------
Figure 3.35
As evident from the example, non-linear equations are involved and dont utilize routine methods. Typically the numerical methods discussed in the next chapter are preferred.
nique to solve the equation, we will need to linearize the model before we can proceed. A non-linear system can be approximated with a linear equation using the following method. 1. Pick an operating point or range for the component. 2. Find a constant value that relates a change in the input to a change in the output. 3. Develop a linear equation. 4. Use the linear equation for the analysis. A linearized differential equation can be approximately solved using known techniques as long as the system doesnt travel too far from the linearized point. The example in Figure 3.36 shows the linearization of a non-linear equation about a given operating point. This equation will be approximately correct as long as the first derivative doesnt move too far from 100. When this value does, the new velocity can be calculated.
Assume we have the non-linear differential equation below. It can be solved by linearizing the value about the operating point Given,
2 + 4y = 200 y
y ( 0 ) = 10
We can make the equation linear by replacing the velocity squared term with the velocity times the actual velocity. As long as the system doesnt vary too much from the given velocity the model should be reasonably accurate. = 200 4y y ( 0 ) = 200 4 ( 10 ) = 12.65 y + 4y = 20 12.65y This system may now be solved as a linear differential equation. If the velocity (first derivative of y) changes significantly, then the differential equation should be changed to reflect this. Homogeneous: + 4y = 0 12.65y 12.65A + 4 = 0 0.316t y h = Ce Particular: yp = A 12.65 ( 0 ) + 4A = 200 Initial conditions: 0.316t y ( t ) = Ce + 50 0 10 = Ce + 50 0.316t y ( t ) = 40e + 50
A = 0.316
A = 50
C = 40
Figure 3.36
If the velocity (first derivative of y) changes significantly, then the differential equation should be changed to reflect this. For example we could decide to recalculate the equation value after 0.1s. y ( 0.1 ) = 40e 0.316 ( 0.1 ) + 50 = 11.24 Note: a small change
d- y ( 0.1 ) = 40 ( 0.316 ) e 0.316 ( 0.1 ) = 12.25 ---dt 12.25y' + 4y = 20 Now recalculate the solution to the differential equation. Homogeneous: + 4y = 0 12.25y 12.25A + 4 = 0 0.327t y h = Ce Particular: yp = A
A = 0.327
A = 50
C = 35.070575
Notice that the values have shifted slightly, and as the analysis progresses the equations will adjust slowly. Higher accuracy can be obtained using smaller steps in time.
Figure 3.37
right hand side of the cable is being pulled at a constant rate, while the block is free to move, only restricted by friction forces and inertia. At the beginning all components are at rest and undeflected.
x2
k = 0.1 s = 0.3
x 1 = 0.1 m ---t s
An FBD and equation can be developed for the system. The friction force will be left as a variable at this point.
For the cable/spring in tension x 1 x 2 0 FF Ks ( x1 x2 ) F x = F F + K s ( x 1 x 2 ) = Mx 2 M = 100kg ' Mx 2 N F F + 1000 --- # 0.1 m --- t x 2$ = 100kgx2 ! " m s N N 100kgx 2 + 1000 --- x = 1000 --- 0.1 m --- t FF m 2 m s FF N -x = 1 ------N -t -------------x 2 + 10 --------kgm 2 kgs 100kg FF 2 m x 2 + 10s x 2 = 1 ---- t -------------3 100kg s For the cable/spring in compression x1 x2 < 0 FF M = 100kg ' Fx = FF = Mx2 Mx 2 F F = 100kgx 2 100kgx 2 = F F FF x 2 = -------------100kg
Figure 3.38
x2
k = 0.1 s = 0.3
x 1 = 0.1 m ---t s
An FBD and equation can be developed for the system. The friction force will be left as a variable at this point. N- = 981N N = 100kg9.81 ----kg static friction d- x 0 m -----dt 2 s
The analysis of the system begins by assuming the system starts at rest and undeflected. In this case the cable/spring will be undeflected with no force, and the mass will be experiencing static friction. Therefore the block will stay in place until the cable stretches enough to overcome the static friction. x2 = 0 x2 = 0 F F = 294.3N FF 2 m - t -------------x 2 + 10s x 2 = 1 ---3 100kg s 2 294.3N m 0 + 10s 0 = 1 ----t ----------------100kg 3 s m ----------------------1 ---- t = 294.3kgm 3 2 s 100kgs t = 2.943s Therefore the system is static from 0 to 2.943s Figure 3.40 Analysis of the object before motion begins
After motion begins the object will only experience kinetic friction, and continue to accelerate until the cable/spring becomes loose in compression. This stage of motion requires the solution of a differential equation. 2 98.1N m x 2 + 10s x 2 = 1 ---- t -------------3 100kg s For the homogeneous, 2 x 2 + 10s x 2 = 0 2 A + 10s = 0 x h = C 1 sin ( 3.16t + C 2 ) For the particular, x p = At + B 0 + 10s 2 xp = A xp = 0
A = 3.16js
98.1N m ( At + B ) = 1 ---- t -------------3 100kg s 2 m 10s A = 1 ---3 s 2 98.1N 10s B = -------------100kg Analysis of the object after motion begins
Figure 3.41
x ( t ) = C 1 sin ( 3.16t + C 2 ) + 0.1 m --- t 0.0981m s 0 = C 1 sin ( 3.16 ( 2.943s ) + C 2 ) + 0.1 m --- ( 2.943s ) 0.0981m s C 1 sin ( 9.29988 + C2 ) = 0.1962 d- x ( t ) = 3.16C cos ( 3.16t + C ) + 0.1 m -----1 2 dt s 0 = 3.16C 1 cos ( 3.16 ( 2.943 ) + C 2 ) + 0.1 m --s C 1 cos ( 9.29988 + C 2 ) = 0.0316 C 1 sin ( 9.29988 + C 2 ) 0.1962 ------------------------------------------------------ = -----------------C 1 cos ( 9.29988 + C 2 ) 0.0316 tan ( 9.29988 + C 2 ) = 6.209
C 2 = ( 7.889 + n ) rad
nI
0.1962 C 1 = --------------------------------------------------= 0.199m sin ( 9.29988 7.889 ) x ( t ) = 0.199 m sin ( 3.16t 7.889rad ) + 0.1 m --- t 0.0981m s dm ---x ( t ) = 0.199 ( 3.16 ) m cos ( 3.16t 7.889rad ) + 0.1 --dt s Figure 3.42 Analysis of the object after motion begins
The equation of motion changes after the cable becomes slack. This point in time can be determined when the displacement of the block equals the displacement of the cable/spring end. m - t = 0.199 m sin ( 3.16t 7.889rad ) + 0.1 m --- t 0.0981m 0.1 --s s 0.199 m sin ( 3.16t 7.889rad ) = 0.0981m t = 3.328s 3.16t 7.889 + n = 0.51549413 x ( 3.328 ) = 0.137m dm ---x ( 2.333 ) = 0.648 --dt s
After this the differential equation without the cable/spring is used. m 98.1N - = 0.981 --x 2'' = -------------2 100kg s m$ ---x2 = # ! 0.981 2" t + C 1 s m m$ - = # 0.981 ---0.648 --( 3.328s ) + C 1 2" ! s s m C 1 = 3.913 --s 0.981 m$ 2 m - ---- t + C2 t + 3.913 --x 2 = # -----------! 2 s 2" s 0.981 m$ m 2 - ----0.137m = # -----------! 2 2" ( 3.328s ) + 3.913 s ( 3.328s ) + C 2 s C 2 = 7.453m 0.981 m$ 2 m - ---- t 7.453m t + 3.913 --x 2 ( t ) = # -----------2 ! " 2 s s This motion continues until the block stops moving. m$ m 0 = # 0.981 ---t + 3.913 --2" ! s s t = 3.989s The solution can continue, considering when to switch the analysis conditions.
Figure 3.43
The model to the left describes a piece of reciprocating industrial equipment. The mass of the equipment is 10000kg. The equipment operates such that a force of 1000N with a frequency of 2Hz is exerted on the mass. We have been asked to design a vibration isolation mounting system. The criteria we are given is that the mounts should be 30cm high when unloaded, and 25cm when loaded with the mass. In addition, the oscillations while the machine is running cannot be more than 2cm total. In total there will be four mounts mounted around the machine. Each isolator will be composed of a spring and a damper.
Figure 3.44
There are a number of elements to the design and analysis of this system, but as usual the best place to begin is by developing a free body diagram, and a differential equation. This is done in Figure 3.45.
F y
4K y 4K d y s = ---F y + ------------ + ------------+g 4K s y 4K d y M M M 4K d y 4K s y 1000N - sin ( 2 ( 2 ) t ) + 9.81ms 2 y + --------------------- + --------------------- = --------------------10000Kg 10000Kg 10000Kg
Mg
Figure 3.45
Using the differential equation, the spring values can be found by assuming the machine is at rest. This is done in Figure 3.46.
When the system is at rest the equation is simplified; the acceleration and velocity terms both become zero. In addition, we will assume that the cyclic force is not applied for the unloaded/loaded case. This simplifies the differential equation by eliminating several terms. 0.0004Kg K s y = 9.81ms
1 2
Now we can consider that when unloaded the spring is 0.30m long, and after loading the spring is 0.25m long. This will result in a downward compression of 0.05m, in the positive y direction. 0.0004Kg K s ( 0.05m ) = 9.81ms 9.81 2 1 Kgms m K s = ------------------------------0.0004 ( 0.05 )
1 2
K s = 491KNm
Figure 3.46
The remaining unknown is the damping coefficient. At this point we have determined the range of motion of the mass. This can be done by developing the particular
solution of the differential equation, as it will contain the steady-state oscillations caused by the forces as shown in Figure 3.47.
1 1 1 2 2 y + 0.0004Kg K d y + 0.0004Kg ( 491KNm ) y = 0.1ms sin ( 4 t ) + 9.81ms 1 2 2 2 y + 0.0004Kg K d y + 196s y = 0.1ms sin ( 4 t ) + 9.81ms
The particular solution can now be found by guessing a value, and solving for the coefficients. (Note: The units in the expression are uniform (i.e., the same in each term) and will be omitted for brevity.) y = A sin ( 4 t ) + B cos ( 4 t ) + C y' = 4 A cos ( 4 t ) 4 B sin ( 4 t ) y'' = 16 A sin ( 4 t ) 16 B cos ( 4 t )
2 2
( 16 A sin ( 4 t ) 16 B cos ( 4 t ) ) + 0.0004K d ( 4 A cos ( 4 t ) 4 B sin ( 4 t ) ) + 196 ( A sin ( 4 t ) + B cos ( 4 t ) + C ) = 0.1 sin ( 4 t ) + 9.81
16 B + 0.0004K d 4 A + 196A = 0 6 B = A ( 31.8 10 K d + 1.24 ) 2 16 A + 0.0004K d ( 4 B ) + 196A = 0.1 A ( 16 + 196 ) + B ( 5.0 10 K d ) = 0.1 A ( 16 + 196 ) + A ( 31.8 10 K d + 1.24 ) ( 5.0 10 K d ) = 0.1 0.1 A = -------------------------------------------------------------------------------------------------------------------------------------2 6 3 16 + 196 + ( 31.8 10 K d + 1.24 ) ( 5.0 10 K d ) 0.1 A = -------------------------------------------------------------------------------------------------------2 9 3 K d ( 159 10 ) + K d ( 6.2 10 ) + 38.1 3.18 10 K d 0.124 B = -------------------------------------------------------------------------------------------------------2 9 3 K d ( 159 10 ) + K d ( 6.2 10 ) + 38.1 C = 9.81ms
2 6 2 6 3 2 3 2
Figure 3.47
The particular solution can be used to find a damping coefficient that will give an overall oscillation of 0.02m, as shown in Figure 3.48. In this case Mathcad was used to find the solution, although it could have also been found by factoring out the algebra, and finding the roots of the resulting polynomial.
In the previous particular solution the values were split into cosine and sine components. The magnitude of oscillation can be calculated with the Pythagorean formula. 2 2 A +B 2 2 6 $ ( 0.1 ) + # ( 3.18 10 ) K 0.124 d ! " magnitude = -------------------------------------------------------------------------------------------------------------2 9 3 K d ( 159 10 ) + K d ( ( 6.2 10 ) ) + 38.1 The design requirements call for a maximum oscillation of 0.02m, or a magnitude of 0.01m. 2 2 6 ( 0.1 ) + # ( 3.18 10 ) K d 0.124$ ! " 0.01 = -------------------------------------------------------------------------------------------------------------2 9 3 K d ( 159 10 ) + K d ( ( 6.2 10 ) ) + 38.1 A given-find block was used in Mathcad to obtain a damper value of, magnitude = sK d = 3411N --m Aside: the Mathcad solution
Figure 3.48
The values of the spring and damping coefficients can be used to select actual components. Some companies will design and build their own components. Components can also be acquired by searching catalogs, or requesting custom designs from other companies.
3.7 SUMMARY
First and second-order differential equations were analyzed explicitly. First and second-order responses were examined. The topic of analysis was discussed. A case study looked at a second-order system. Non-linear systems can be analyzed by making them linear.
M B
2. The following differential equation was derived for a mass suspended with a spring. At time 0s the system is released and allowed to drop. It then oscillates. Solve the differential equation to find the motion as a function of time. + N K s = 100 --m M = 1 Kg y
' Fy
= K s y Mg = My
N N-$ # 100 ---$ y ( 1 Kg ) # 9.81 -----= ( 1 Kg ) y ! ! m" Kg" N$ # # 1 Nm -------$ y - y = 9.81 N + 100 --! 2" ! " m s Kgm -$ y = 9.81 Kgm ----------( 1 Kg ) y + # 100 ----------2" 2 ! s ms 2 2 y + ( 100 s ) y = 9.81 ms 1 y 0 = 0 ms y = 0m
0
FBD: M
Ks y
Mg
3. Solve the following differential equation with the three given cases. All of the systems have a
initial conditions
= 0.5 = 1 = 2
n = 10 n = 10 n = 10
x = 0 x = 0 y = 1
4. Solve the following differential equation with the given initial conditions and draw a sketch of the first 5 seconds. The input is a step function that turns on at t=0. 0.5 V o + 0.6 V o + 2.1 V o = 3 V i + 2 initial conditions V i = 5 Vo = 0 Vo = 0 5. Solve the following differential equation with the given initial conditions and draw a sketch of the first 5 seconds. The input is a step function that turns on at t=0. 0.5 V o + 0.6 V o + 2.1 V o = 3 V i + 2 initial conditions V i = 5 Vo = 0 Vo = 1 6. a) Write the differential equations for the system below. Solve the equations for x assuming that
the system is at rest and undeflected before t=0. Also assume that gravity is present.
M = 1 kg
x2 F=1N
Ks = 1 N/m
b) State whether each system is first or second-order. If the system if first-order find the time constant. If it is second-order find the natural frequency and damping ratio. 7. Solve the following differential equation with the three given cases. All of the systems have a sinusoidal input y and start undeflected and at rest. 2 initial conditions x = 0 x + 2 n x + n x = y x = 0 y = sin ( t ) = 0.5 n = 10 case 1: case 2: case 3: = 1 = 2 n = 10 n = 10
8. A spring damper system supports a mass of 34N. If it has a spring constant of 20.6N/cm, what is the systems natural frequency? 9. Using a standard lumped parameter model the weight is 36N, stiffness is 2.06*103 N/m and damping is 100Ns/m. What are the natural frequency (Hz) and damping ratio?
10. What is the differential equation for a second-order system that responds to a step input with an overshoot of 20%, with a delay of 0.4 seconds to the first peak? 11. A system is to be approximated with a mass-spring-damper model using the following parameters: weight 28N, viscous damping 6Ns/m, and stiffness 36N/m. Calculate the undamped natural frequency (Hz) of the system, the damping ratio and describe the type of response you would expect if the mass were displaced and released. What additional damping would be required to make the system critically damped? Mx + K d x + K s x = F 12. Solve the differential equation below using homogeneous and particular solutions. Assume the system starts undeflected and at rest. + 40 + 20 + 2 = 4 13. What would the displacement amplitude after 100ms for a system having a natural frequency of 13 rads/sec and a damping ratio of 0.20. Assume an initial displacement of 50mm, and a steady state displacement of 0mm. (Hint: Find the response as a function of time.) 14. Determine the first order differential equation given the graphical response shown below. Assume the input is a step function. x 4
t(s) 0 1 2 3 4
15. Explain with graphs how to develop first and second-order equations using experimental data. 16. The second order response below was obtained experimentally. Determine the parameters of
the differential equation that resulted in the response assuming the input was a step function. 0.5 s 1s
10
t(s)
17. Develop equations (function of time) for the first and second order responses shown below. x (m) 5m
0m 0.1s x (m) 5m 0m 1s 3s t (s) 0.2s 0.3s 0.4s 0.5s 0.6s 0.7s 0.8s t (s)
-10m
2. homogeneous: guess yh = e
2 At At 2
At y h = Ae
At
2 At yh = A e
A e + ( 100 s ) e
2 2
= 0
1
yp = 0
2
yp = 0
( 0 ) + ( 100 s ) A = 9.81 ms 2 2 ( 100 s ) A = 9.81 ms 2 9.81 ms = 0.0981 m A = --------------------2 100 s y p = 0.0981 m initial conditions: y' = 10 C 1 sin ( 10 t + C 2 ) for d/dt y0 = 0m:
y = y h + y p = C 1 cos ( 10 t + C 2 ) + 0.0981 m
C2 = 0
10 t
+ 0.010
2.679 t
x ( t ) = 775 10 e
6 37.32 t
0.0108 e
+ 0.010
4. V o ( t ) = 8.465 e or V o ( t ) = 8.465 e
0.6 t
0.6 t
b) x ( t ) = 12.485 e = 0.5
0.5 t
n = 1
x ( t ) = ( 1.96 10 ) e x ( t ) = ( 3.5 10 ) e
3
+ ( 9.9 10 ) te ( 18 10 ) e
6
10 t
2.679 t
37.32 t
10. x + 8.048 x + 77.88 x = F ( t ) 11. 28 N M = ---------------= 2.85 kg N 9.81 ----kg The typical transfer function for a mass-spring-damper systems is, K s$ F K d -$ + x # -------x + x # ----! M" ! M" = M The second order parameters can be calculated from this. 2 x + x ( 2 n ) + x ( n ) = y ( t ) N 36 --m ---------------- = 2.85 kg kgm 36 --------2 ms ---------------- = 2.85 kg Given sK d = 6 N --m N K s = 36 --m
n =
Ks ----- = M
12.63 s
K d$ s# ----6 N --! M" m - = -------------------------------------------- = 0.296 = ----------2 n rad -------2 ( 3.55 ) 2.85 kg s 2 rad d = n 1 = 3.39 -------s If pulled and released the system would have a decaying oscillation about 0.52Hz A critically damped system would require a damping coefficient of....
d$ #K ----Kd ! M" - = -------------------------------------------- = 1.00 = ----------2 n rad - 2.85 kg 2 ( 3.55 ) -------s
Ns K d = 20.2 ----m
12. ( t ) = 66 10 e
6 39.50 t
3.216 e
0.1383 t
+ 1.216 e
0.3368 t
+ 2.00
2.6 t
t(s) 1 2 = 1 Given the equation form, 1 -x = A x + - The values at steady state will be x = 0 x = 4 So the unknown A can be calculated. 1 A = 4 -4 = A 0 + -1 1 -x = 4 x + -1 x+x = 4 15. Key points: First-order: find initial final values find time constant with 63% or by slope use these in standard equation Second-order: find damped frequency from graph find time to first peak use these in cosine equation 0 3 4
16. For the first peak: t b----= e p x 2 0.5 ----= e 10 2-$ ln # ----= 0.5 ! 10" 2-$ = 2 ln # ----= 3.219 ! 10" For the damped frequency: 2 - = 2 d = ----1s 3.219 n = -----------
2
d --tp
These values can be used to find the damping coefficient and natural frequency = n
d = n 1
3.219 - 1 2 2 = ----------- 2 2 2 -$ 1 # -----------= ------------2 ! 3.219" 2 -$ 2 1# -----------+ 1 = ---2 ! 3.219" = 1 ------------------------------ = 0.4560 2 -$ 2 # -----------! 3.219" + 1
3.219 3.219- = -------------- n = -----------= 7.059 0.4560 This leads to the final equation using the steady state value of 10
2 x + 2 n x + n x = F 2 x + 2 ( 0.4560 ) ( 7.059 ) x + ( 7.059 ) x = F x + 6.438 x + 49.83 x = F ( 0 ) + 6.438 ( 0 ) + 49.83 ( 10 ) = F x + 6.438 x + 49.83 x = 498.3
F = 498.3
17.
--------# 0.18$ x(t) = 5%1 e & ! " t
x ( t ) = 10 e
0.693 t
cos ( t )
4. NUMERICAL ANALYSIS
Topics: State variable form for differential equations Numerical integration with software and calculators Numerical integration theory: first-order, Taylor series and Runge-Kutta Using tabular data A design case Objectives: To be able to solve systems of differential equations using numerical methods.
4.1 INTRODUCTION
For engineering analysis it is always preferable to develop explicit equations that include symbols, but this is not always practical. In cases where the equations are too costly to develop, numerical methods can be used. As their name suggests, numerical methods use numerical calculations (i.e., numbers not symbols) to develop a unique solution to a differential equation. The solution is often in the form of a set of numbers, or a graph. This can then be used to analyze a particular design case. The solution is often returned quickly so that trial and error design techniques may be used. But, without a symbolic equation the system can be harder to understand and manipulate. This chapter focuses on techniques that can be used for numerically integrating systems of differential equations.
where, x = state/output vector (variables such as position) u = input vector (variables such as input forces) A = transition matrix relating outputs/states B = matrix relating inputs to outputs/states y = non-state value that can be found directly (i.e. no integration) C = transition matrix relating outputs/states D = matrix relating inputs to outputs/states
Figure 4.1
An example of a state variable equation is shown in Figure 4.2. As always, the FBD is used to develop the differential equation. The resulting differential equation is second-order, but this must be reduced to first-order. Using the velocity variable, v the second-order differential equation can be reduced to a first-order equation. An equation is also required to define the velocity as the first derivative of the position, x. In the example the two state equations are manipulated into a matrix form. This form can be useful, and may be required for determining a solution. For example, HP calculators require the matrix form, while TI calculators use the equation forms. Software such as Mathcad can use either form. The main disadvantage of the matrix form is that it will only work for lin-
Given the FBD shown below, the differential equation for the system is, F x Mx M Kd x Ksx +
% Fx
K x = Mx = F Kd x s
K x = Mx F Kd x s
The equation is second-order, so two state variables will be needed. One obvious choice for a state variable in this equation is x. The other choice can be the velocity, v. Equation (1) defines the velocity variable. The velocity variable can then be substituted into the differential equation for the system to reduce it to first-order. = v x (1) = F K x Mx d Ks x = FK vK x Mv d s Ks Kd F$ # -------- = x # --------$ -$ # -----v ! M " + v! M " + ! M "
(2)
Equations (1) and (2) can also be put into a matrix form similar to that given in Figure 4.1. 0 1 0 d x = K K x + F ---d s dt v ------ v -------- --------M M M Note: To have a set of differential equations that is solvable, there must be the same number of state equations as variables. If there are too few equations, then an additional equation must be developed using an unexploited relationship. If there are too many equations, a redundancy or over constraint must be eliminated.
Figure 4.2
ans. x = v
F v = ---M
0 d- x ---= 0 1 x + F dt v ---0 0 v M
Figure 4.3
Consider the two cart problem in Figure 4.4. The carts are separated from each other and the wall by springs, and a force is applied to the left hand side. Free body diagrams are developed for each of the carts, and differential equations developed. For each cart a velocity state variable is created. The equations are then manipulated to convert the second-order differential equations to first-order state equations. The four resulting equations are then put into the state variable matrix form.
x1 F M1 K s1
x2 K s2 M2
F M1
K s1 ( x 1 x 2 ) M1 x1
% Fx
= F K s1 ( x 1 x 2 ) = M 1 x 1 (1)
M 1 x 1 + K s1 x 1 K s1 x 2 = F x1 = v1 M 1 v 1 + K s1 x 1 K s1 x 2 = F F- K s1 + K s1 v 1 = ---------------x ---------x 1 M1 M1 M1 2 +
(2)
K s1 ( x 1 x 2 )
M2
K s2 ( x 2 ) M2 x2
% Fx
= K s1 ( x 1 x 2 ) K s2 ( x 2 ) = M 2 x 2
The state equations can now be combined in a matrix form. 0 1 0 0 x1 x1 0 K s1 K s1 ------------ 0 --------0 Fv1 v1 M1 M1 ------d = + M1 ---dt x x 0 0 0 1 2 2 0 K K K v2 v2 s1 s1 s2 0 --------- 0 ---------------------------- 0 M2 M2
Figure 4.4
x Kd M Ks
Figure 4.5
x1 K d1 M1 K s1
x2
K s2 M2
ans. x = v 1 1 x2 = v2 K d 1$ K s 1$ K d 1$ K s 1$ F ----------- + x 1 # ---------- + v 2 # -------- + x 2 # -----------v1 = v1 # ! M1 " ! M1 " ! M1 " ! M1 " + M1 K d 1$ K s 1 K s 2$ K d 1$ K s 1$ - + x 2 # -------------------------- + v 1 # -------- + x 1 # ------v 2 = v 2 # ----------! M2 " ! " ! M2 " ! M2 " M2
Figure 4.6
In some cases we will develop differential equations that cannot be directly reduced because they have more than one term at the highest order. For example, if a second-order differential equation has two second derivatives it cannot be converted to a state equation in the normal manner. In this case the two high order derivatives can be replaced with a dummy variable. In mechanical systems this often happens when masses are neglected. Consider the example problem in Figure 4.7, both y and u are first derivatives. To solve this problem, the highest order terms (y and u) are moved to the left of the equation. A dummy variable, q, is then created to replace these two variables with a single variable. This also creates an output equation as shown in Figure 4.1.
Given the equation, + 2y = 5u 3y Step 1: put both the first-order derivatives on the left hand side, 5u = 2y 3y Step 2: replace the left hand side with a dummy variable, q = 3y 5u = 2y q
Step 3: solve the equation using the dummy variable, then solve for y as an output eqn. q + 5u = 2y q y = -------------3
Figure 4.7
At other times it is possible to eliminate redundant terms through algebraic manipulation, as shown in Figure 4.8. In this case the force on both sides of the damper is the same, so it is substituted into the equation for the cart. But, the effects on the damper must also be integrated, so a dummy variable is created for the integration. An output equation was created to calculate the value for x1.
x1 F Kd
x2 M
% Fx
= F Kd ( x1 x2 ) = 0 (1)
Kd ( x 1 x 2 ) = F q = x1 x2 Kd ( q ) = F F = -----q Kd x1 = x2 + q M + = K d ( x 1 x 2 ) = Mx2 F = Mx 2 x2 = v2
(2) (3)
Kd ( x1 x2 ) Mx 2
% Fx
(4) (5)
F v 2 = ---M
The state equations (2, 4, 5) can be put in matrix form. The output equation (2) can also be put in matrix form. F-----q q K 0 0 0 d d- x = x2 + ---2 0 0 1 0 dt v2 0 0 0 v2 F ---M
q x1 = 1 1 0 x2 + 0 v2
Figure 4.8
Step 1: Develop equations KS Kd y M F Step 2: We need to identify state variables. In this case the height is clearly a defining variable. We will also need to use the vertical velocity, because the acceleration is a second derivative (we can only have first derivatives). Using the height, y, and velocity, v, as state variables we may now proceed to rewriting the equations. (Note: this is just an algebraic trick, but essential when setting up these matrices.) Step 3: d-$ # ---y = v ! dt" F Kd v K s y d-$ # ---v = --------------------------------------! dt" M Step 4: We put the equations into a state variable matrix form. d-$ # ---! dt" y 0 1 F = K K y + 0 ---S d M v 1 ----------------d # ----$ v M M ! dt" My F Ks y M Kd y
d-$ d-$ 2 # ---# ---F = F K y K y = M % y d ! dt" s ! dt" y d-$ d-$ 2 F + K d # ---y + K s y + M # ---y = 0 ! dt" ! dt"
Figure 4.9
Figure 4.10 shows the method for solving state equations on a TI-86 graphing calculator. (Note: this also works on other TI-8x calculators with minor modifications.) In the example a sinusoidal input force, F, is used to make the solution more interesting. The next step is to put the equation in the form expected by the calculator. When solving with the TI calculator the state variables must be replaced with the predefined names Q1, Q2, etc. The steps that follow describe the button sequences required to enter and analyze the equations. The result is a graph that shows the solution of the equation. Points can then be taken from the graph using the cursors. (Note: large solutions can sometimes take a few minutes to solve.)
First, we select some parameter values for the equations of Figure 4.9. The input force will be a decaying sine wave. d-$ # ---y = vy ! dt" F Kd vy Ks y d-$ 0.5t # ---v y = ---------------------------------------- = 4e sin ( t ) 2v y 5y ! dt" M Next, the calculator requires that the state variables be Q1, Q2, ..., Q9, so we replace y with Q1 and v with Q2. Q1' = Q2 Q2' = 4e
0.5t
Now, we enter the equations into the calculator and solve. To do this roughly follow the steps below. Look at the calculator manual for additional details. 1. Put the calculator in differential equation mode [2nd][MODE][DifEq][ENTER] 2. Go to graph mode and enter the equations above [GRAPH][F1] 3. Set up the axis for the graph [GRAPH][F2] so that time and the xaxis is from 0 to 10 with a time step of 0.5, and the y height is from +3 to -3. 4. Enter the initial conditions for the system [GRAPH][F3] as Q1=0, Q2=0 5. Set the axis [GRAPH][F4] as x=t and y=Q 6. (TI-86 only) Set up the format [GRAPH][MORE][F1][FldOff][ENTER] 7. Draw the graph [GRAPH][F5] 8. Find points on the graph [GRAPH][MORE][F4]. Move the left/right cursor to move along the trace, use the up/down cursor to move between traces. Figure 4.10 Solving state equations with a TI-85 calculator
First, we select some parameter values for the equations of Figure 4.9. The input force will be a decaying sine wave. d-$ # ---y = vy ! dt" F Kd vy Ks y 0.5t d-$ # ---v y = -----------------------------------------= 4e sin ( t ) 2v y 5y ! dt" M Next, the calculator requires that the state variables be Q1, Q2, ..., Q9, so we replace y with Q1 and v with Q2. Q1' = Q2 Q2' = 4e 0.5t sin ( t ) 2Q2 5Q1
Now, we enter the equations into the calculator and solve. To do this roughly follow the steps below. Look at the calculator manual for additional details. 1. Put the calculator in differential equation mode [2nd][MODE][DifEq][ENTER] 2. Go to graph mode and enter the equations above [GRAPH][F1] 3. Set up the axis for the graph [GRAPH][F2] so that time and the xaxis is from 0 to 10 with a time step of 0.5, and the y height is from +3 to -3. 4. Enter the initial conditions for the system [GRAPH][F3] as Q1=0, Q2=0 5. Set the axis [GRAPH][F4] as x=t and y=Q 6. (TI-86 only) Set up the format [GRAPH][MORE][F1][FldOff][ENTER] 7. Draw the graph [GRAPH][F5] 8. Find points on the graph [GRAPH][MORE][F4]. Move the left/right cursor to move along the trace, use the up/down cursor to move between traces.
Figure 4.11
State equations can also be solved in Mathcad using built-in functions, as shown in Figure 4.12. The first step is to enter the state equations as a function, D(t, Q), where t is the time and Q is the state variable vector. (Note: the equations are in a vector, but it is not the matrix form.) The state variables in the vector Q replace the original state variables in the equations. The rkfixed function is then used to obtain a solution. The arguments for the function, in sequence are; the state vector, the start time, the end time, the number of steps, and the state equation function. In this case the 10 second time interval is divided into 100 parts each 0.1s in duration. This time is chosen because of the general
response time for the system. If the time step is too large the solution may become unstable and go to infinity. A time step that is too small will increase the computation time marginally. When in doubt, run the calculator again using a smaller time step.
Figure 4.12
Note: Notice that for the TI calculators the variables start at Q1, while in Mathcad the arrays start at Q0. Many students encounter problems because they forget this.
y(t + h) y(t)
d---y( t) dt
dy ( t + h ) y ( t ) + h ---y( t) dt Note: here the h value is the time step between integrations points. A smaller time step will increase the accuracy.
t Figure 4.13
t+h
The example in Figure 4.14 shows the solution of Newtons equation using Eulers method. In this example we are determining velocity by integrating the acceleration caused by a force. The acceleration is put directly into Eulers equation. This is then used to calculate values iteratively in the table. Notice that the values start before zero so that initial conditions can be used. If the system was second-order we would need two previous values for the calculations.
Given the differential equation, d-$ ---F = M# ! dt" v we can create difference equations using simple methods. d-$ F # ---! dt" v = ---M d-$ v ( t + h ) = v ( t ) + h # ---v(t) ! dt" F(t)$ v ( t + h ) = v ( t ) + h # --------! M " first rearrange equation put this in the Euler equation finally substitute in known terms
We can now use the equation to estimate the system response. We will assume that the system is initially at rest and that a force of 1N will be applied to the 1kg mass for 4 seconds. After this time the force will rise to 2N. A time step of 2 seconds will be used. i -1 0 1 2 3 4 5 6 7 8 t (sec) -2 0 2 4 6 8 10 12 14 16 F (N) d/dt vi 0 1 1 2 2 2 2 2 2 2 0 1 1 2 2 2 2 2 etc vi 0 0 2 4 8 12 16 20 etc
Figure 4.14
Use first-order integration to solve the differential equation from 0 to 10 seconds with time steps of 1 second.
x + 0.1 x = 5
ans. x ( t + h ) = x ( t ) + h ( 0.1 x ( t ) + 5 ) x ( 10 ) =
Figure 4.15
An example of solving the previous example with a traditional programming language is shown in Figure 4.16. In this example the results will be written to a text file out.txt. The solution iteratively integrates from 0 to 10 seconds with time steps of 0.1s. The force value is varied over the time period with if statements. The integration is done with a separate function.
h = 0.1, M = 1.0, F;
FILE *fp; double v, t; if( ( fp = fopen("out.txt", "w")) != NULL){ v = 0.0; for( t = 0.0; t < 10.0; t += h ){ if((t >= 0.0) && (t < 4.0)) F = 1.0; if(t > 4.0) F = 2.0; v = step(v, h, F/M); fprintf(fp, "%f, %f, %f\n", t, v, F, M); } } fclose(fp); } double step(double v, double h, double slope){ double v_new; v_new = v + h * slope; return v_new; }
Figure 4.16
double step(double, double, double); public class Integrate extends Object public void main() { double h = 0.1, M = 1.0, F; FileOut fp = new FileOut("out.txt"); if(fp.writeStatus != fp.IO_EXCEPTION){ double v = 0.0; for( double t = 0.0; t < 10.0; t += h ){ if((t >= 0.0) && (t < 4.0)) F = 1.0; if(t > 4.0) F = 2.0; v = step(v, h, F/M); fp.printf(fp, "%f, %f, %f\n", t, v, F, M); } fp.close(); } fclose(fp); } public double step(double v, double h, double slope){ double v_new; v_new = v + h * slope; return v_new; } }
Figure 4.17
The program below is for Scilab (a Matlab clone). The state variable function is defined first. This is followed by a definition of the parameters to be used for the numerical integration. Finally the function is integrated with rectangular, trapezoidal and Simpsons rule forms.
// // // // // // // // //
first_order.sce A first order integration of an accelerating mass To run this in Scilab use 'File' then 'Exec'. by: H. Jack Sept., 16, 2002
// System component values mass = 10; force = 100; x0 = 8; v0 = 12; X=[x0, v0]; // initial conditions
// define the state matrix function // the values returned are [x, v] function foo=f(state,t) foo = [ state($, 2), force/mass]; // d/dt x = v, d/dt v = F/M endfunction
// Set the time length and step size for the integration steps = 100; t_start = 1; t_end = 100; h = (t_end - t_start) / steps;
Figure 4.18
// // Loop for integration // for i=1:steps, X = [X ; X($,:) + h*f(X, i*h)]; end printf("The value at the end of first order integration is (x, v) = (%f, %f)\n", ... X($,1), ... X($,2));
// // Explicit equation // function x=position(x0, v0, a0, t) x = (0.5 * a0 * t^2) + (v0 * t) + x0; endfunction function v=velocity(v0, a0, t) v = (a0 * t) + v0; endfunction printf("The value with integration is (x, v) = (%f, %f)\n", ... position(x0, v0, force/mass, t_end), ... velocity(v0, force/mass, t_end));
// // // // // // // // // //
The results should be first order integration = (49710, 1002) explicit = (51208, 1012) The difference is 1498 for position and 10 for velocity. This is relatively small, but shows a clear case of the innacuracy of the numerical solutions. Note: increasing the number of steps increases the accuracy
Figure 4.19
d-$ 1- 2 # ---d-$ 2 1- 3 # ---d-$ 3 1- 4 # ---d-$ 4 ------------x( t + h) = x(t) + h# x ( t ) + h x ( t ) + h x ( t ) + h x(t) + ! dt" 2! ! dt" 3! ! dt" 4! ! dt" Figure 4.20 The Taylor series
An example of the application of the Taylor series is shown in Figure 4.21. Given the differential equation, we must first determine the derivatives and substitute these into Taylors equation. The resulting equation is then used to iteratively calculate values.
Given
x = 1 + e 20t + t 3 x
20t 3 d-$ ---+t +x We can write, # ! dt" x = 1 + e 20t 2 d-$ 2 # ---x = e + 3t ! dt" 20t d-$ 3 # ---x = e + 6t ! dt" In the Taylor series this becomes, x(t + h) = x( t) + h(1 + e Thus x0 = 0 h = 0.1 t (s) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 20t 3 1- h 2 ( e t + 3t 2 ) + ---1- h 3 ( e t + 6t + t + x ) + ---2! 3!
x(t) 0 0
Figure 4.21
Recall that the state variable equations are first-order equations. But, to obtain accuracy the Taylor method also requires higher order derivatives, thus making is unsuitable for use with state variable equations.
F 1 = hf ( t, x ) F1 h F 2 = hf # t + -, x + ------$ ! 2 2" F2 h F 3 = hf # t + -, x + ------$ ! 2 2" F 4 = hf ( t + h, x + F 3 ) x( t + h) = x(t ) + 1 -- ( F + 2F 2 + 2F 3 + F 4 ) 6 1 where, x = the state variables f = the differential function or (d/dt) x t = current point in time h = the time step to the next integration point Note: in this case the state equation function f(t, x) includes the state variables, x, and time, t. However, in simpler systems the state equations may not include time and it could be replaced with f(x).
Figure 4.22
An example of a Runge-Kutta integration calculation is shown in Figure 4.23. The solution begins by putting the state equations in matrix form and defining initial conditions. After this, the four integrating factors are calculated. Finally, these are combined to get the final value after one time step. The number of calculations for a single time step should make obvious the necessity of computers and calculators.
# $ # $ F 1 = 0.1 & 0 1 3 + 0 0 2 ' = 0.1 & 1 + 0 ' = 0.1 ! 0 4 1 ! 4 5 3 1" 13 " 1.7 # $ & ' 3 + 0.1 -----2 + 0 0 2 ' = 0.185 F 2 = 0.1 & 0 1 & ' 5 3 1' 2.04 & 0 4 1 + 1.7 -----! " 2 # $ & ' 3 + 0.185 -----------0 1 2 0 0 2 ' = 0.202 F 3 = 0.1 & + & ' 5 3 1' 2.108 & 0 4 1 + 2.04 --------! " 2 # $ F 4 = 0.1 & 0 1 3 + 0.202 + 0 0 2 ' = 0.3108 ! 0 4 1 + 2.108 5 3 1" 2.5432 xi + 1 vi + 1 xi + 1 = xi +1 -- ( F + 2F 2 + 2F 3 + F 4 ) 6 1 vi
# $ = 3 +1 -- & 0.1 + 2 0.185 + 2 0.202 + 0.3108 ' = 3.1974667 6 ! 1.7 vi + 1 1 2.04 2.108 2.5432 " 3.0898667
Figure 4.23
use,
Figure 4.24
Kd
Leave the solution in variable form, and then change values to see how the system response changes. 1 K d = 10Nsm 1 K s = 10Nm M = 1kg
Ks
y 0 = 1m
y 0 = 0m
Figure 4.25
The program in Figure 4.26 and Figure 4.28 is used to perform a Runge-Kutta integration of a mass-spring-damper system. The main program loops through the time steps and writes the value to a file. The step function performs one timestep integration for a
second order Runge-Kutta integration. It uses the functions add and multiply to manipulate the state matrix. The derivative function updates the state matrix with the new derivative values.
/* A program to do Runge Kutta integration of a mass spring damper system */ #include <stdio.h> void void void void #define #define #define #define #define multiply(double, double[], double[]); add(double[], double[], double[]); step(double, double, double[]); derivative(double, double[], double[]); SIZE Ks Kd Mass Force 2 /* the length of the state vector */ 1000 /* the spring coefficient */ 10000 /* the damping coefficient */ 10 /* the mass coefficient */ 100 /* the applied force */
*fp;
double h = 0.001; double t; int j = 0; double X[SIZE];// create state variable list X[0] = 0;// set initial condition for x X[1] = 0;// set initial condition for v if( ( fp = fopen("out.txt", "w")) != NULL){ fprintf(fp, " t(s) x v \n\n"); for( t = 0.0; t < 50.0; t += h ){ step(t, h, X); if(j == 0) fprintf(fp, "%9.5f %9.5f %9.5f\n", t, X[0], X[1]); j++; if(j >= 10) j = 0; } } fclose(fp); }
Figure 4.26
/* First order integration done here (could be replaced with runge kutta)*/ void step(double t, double h, double X[]){ double tmp[SIZE], dX[SIZE], F1[SIZE], F2[SIZE], F3[SIZE], F4[SIZE]; /* Calculate F1 */ derivative(t, X, dX); multiply(h, dX, F1); /* Calculate F2 */ multiply(0.5, F1, tmp); add(X, tmp, tmp); derivative(t+h/2.0, tmp, dX); multiply(h, dX, F2); /* Calculate F3 */ multiply(0.5, F2, tmp); add(X, tmp, tmp); derivative(t+h/2.0, tmp, dX); multiply(h, dX, F3); /* Calculate F4 */ add(X, F3, tmp); derivative(t+h, tmp, dX); multiply(h, dX, F4); /* Calculate the weighted sum */ add(F2, F3, tmp); multiply(2.0, tmp, tmp); add(F1, tmp, tmp); add(F4, tmp, tmp); multiply(1.0/6.0, tmp, tmp); add(tmp, X, X); } /* State Equations Calculated Here */ void derivative(double t, double X[], double dX[]){ dX[0] = X[1]; dX[1] = (-Ks/Mass)*X[0] + (-Kd/Mass)*X[1] + (Force/Mass); } /* A subroutine to add vectors to simplify other equations */ void add(double X1[], double X2[], double R[]){ for(int i = 0; i < SIZE; i++) R[i] = X1[i] + X2[i]; } /* A subroutine to multiply a vector by a scalar to simplify other equations*/ void multiply(double X, double V[], double R[]){ for(int i = 0; i < SIZE; i++) R[i] = X*V[i]; }
Figure 4.27
// // // //
runge_kutta.sce A first order integration of an accelerating mass To run this in Scilab use 'File' then 'Exec'. by: H. Jack Sept., 15, 2003
// System component values mass = 10; force = 100; x0 = 8; v0 = 12; X=[x0, v0]; // initial conditions
// define the state matrix function // the values returned are [x, v] function foo=f(state,t) foo = [ state($, 2), force/mass]; // d/dt x = v, d/dt v = F/M endfunction // Set the time length and step size for the integration steps = 1000; t_start = 0; t_end = 100; h = (t_end - t_start) / steps; t = [t_start]; // Loop for integration for i=1:steps, t = [t ; t($,:) + h]; F1 = h * f(X($,:), t($,:)); F2 = h * f(X($,:) + F1/2.0, t($,:) + h/2.0); F3 = h * f(X($,:) + F2/2.0, t($,:) + h/2.0); F4 = h * f(X($,:) + F3, t($,:) + h); X = [X ; X($,:) + (F1 + 2.0*F2 + 2.0*F3 + F4)/6.0]; end // print some results to compare printf("The value at the end of first order integration is (x, v) = (%f, %f)\n", ... X($,1), ... X($,2)); printf("The position (using an equation) should be %f\n", 0.5*force/mass*(t_endt_start)^2.0 + v0*(t_end - t_start) + x0); // Graph the values plot2d(t, X, [-2, -5], leg="position@velocity"); // leg - the legend titles // style - draw lines with marks // nax - grid lines for the graph xtitle('Time (s)');
Figure 4.28
details such as time constants and damped frequencies can be obtained by the same methods used for experimental analysis. In addition to these methods there is a technique that can determine the steady-state response of the system.
0 1 0 d- x x + ---= Ks K d F dt v ---- ------ v ----M M M 0 1 0 0 = x + Ks Kd F ---0 - ------ v ----M M M 0 1 0 x = Ks Kd F ---- ------ v ----M M M
1 Kd F F # ---- ------$ ---! M" M M Fx = ------------------------------ = ----------- = -----Ks KS 0 1 # -----$ ! M" Ks Kd - ----- ----M M
Figure 4.29
y(t) yi + 1 yi yi 1
ti 1 ti
ti
ti + 1
yi + yi 1 T # ------------------------$ ( t t - ( yi + yi 1 ) y ( t ) d t (t i ! " i i 1 ) = -2 2 i1 # y i y i 1$ # y i + 1 y i$ d1 1 ----' = & ------------------------' = -y ( t i ) & ----------------------- ( y i y i 1 ) = --(y y ) dt T T i+1 i ! ti t i 1 " ! ti + 1 ti " 1 1 -- ( y i + 1 y i ) -- ( yi yi 1 ) 2 yi + yi 1 + yi + 1 2 d T T # ---$ - y ( t ) ------------------------------------------------------------------------ = ---------------------------------------------------i ! dt" T 2 T Figure 4.30 Integration and differentiation using data points
An example of numerical integration using Scilab is given in Figure 4.31 and Figure 4.32.
// // // // // // // // // integrate.sce A simple program to integrate a function To run this in Scilab use 'File' then 'Exec'. by: H. Jack Sept., 9, 2002
// define the function function foo=f(x) foo = 5 * x + 2 * log(sin(x) / x + 2); endfunction // Set the time length and step size steps = 10; x_start = 1; x_end = 10; x_delta = (x_end - x_start) / steps;
// // Loop for rectangular integration // total = 0; // set the initial sum to zero for i=0:steps, x = x_start + i * x_delta; total = total + f(x); end total = total * x_delta; printf("Rectangular integration value %f\n", total);
Figure 4.31
// Loop for trapezoidal integration // total = 0; // set the initial sum to zero for i=0:steps, x = x_start + i * x_delta; if i == 0 then total = total + f(x); elseif i == steps then total = total + f(x); else total = total + 2 * f(x); end end total = total * x_delta / 2; printf("Trapezoidal integration value %f\n", total);
// // Loop for Simpson's rule integration // total = 0; // set the initial sum to zero even = 0; for i=0:steps, x = x_start + i * x_delta; if i == 0 then total = total + f(x); elseif i == steps then total = total + f(x); else even = even + 1; if even > 1 then total = total + 4 * f(x); even = 0; else total = total + 2 * f(x); end end end total = total * x_delta / 3; printf("Simpsons rule integration value %f\n", total);
Figure 4.32
ments are greater than or equal to zero, or off (a value of 0) when the argument is negative. Examples of the use of switching functions are shown in Figure 4.33. By changing the values of the arguments we can change when a function turns on or off.
These switching functions can be multiplied with other functions to create a complex function by turning parts of the function on or off. An example of a curve created with switching functions is shown in Figure 4.34.
f(t) 5
The unit step switching function is available in Mathcad and makes creation of complex functions relatively trivial. Step functions are also easy to implement when writing computer programs, as shown in Figure 4.35.
return f; }
Figure 4.35
flow rate (gpm) 0 0.1 0.4 1.2 2.0 2.3 2.4 2.4 2.4 2.4 Given a valve angle of 46 degrees the flow rate is, 46 40 -----------------$ Q = 2.0 + ( 2.3 2.0 ) # ! 50 40" = 2.18 Given a valve angle of 23 degrees the flow rate is, 23 20$ ----------------Q = 0.4 + ( 1.2 0.4 ) # ! 30 20" = 0.64
Figure 4.36
Using tables of values to interpolate numerical values using the lever law
The subroutine in Figure 4.37 was written to return the numerical value for the data table in Figure 4.36. In the subroutine the tabular data is examined to find the interval that the flow rate value falls inside. Once this is found the valve angle is calculated as the ratio between the two known values.
#define double
SIZE 10; data[SIZE][2] = {{0.0, {10.0, {20.0, {30.0, {40.0, {50.0, {60.0, {70.0, {80.0, {90.0,
0.0}, 0.1}, 0.4}, 1.2}, 2.0}, 2.3}, 2.4}, 2.4}, 2.4}, 2.4}};
double angle(double rate){ int i; for(i = 0; i < SIZE-1; i++){ if((rate >= data[i][0]) && (rate <= data[i+1][0]){ return (data[i+1][1] - data[i][1]) * (rate - data[i][0]) / (data[i+1][0] - data[i][0]) + data[i][1]; } } printf("ERROR: rate out of range\n"); exit(1); }
Figure 4.37
The datapoints below might have been measured for the horsepower of an internal combustion engine on a dynamometer. S (RPM) 1000 4000 6000 P (HP) 105 205 110
In this case there are three datapoints, so we can fit the curve with a second (3-1) order polynomial. The major task is to calculate the coefficients so that the curve passes through all of the given points. 2 P ( S ) = AS + BS + C Data values can be substituted into the equation, 2 P ( 1000 ) = A1000 + B1000 + C = 105 2 P ( 4000 ) = A4000 + B4000 + C = 205 2 P ( 6000 ) = A6000 + B6000 + C = 110 This can then be put in matrix form to find the coefficients, 2 1000 1000 1 A 105 = 2 205 4000 4000 1 B 110 C 2 6000 6000 1 1 A 1000000 1000 1 105 = B 16000000 4000 1 205 C 36000000 6000 1 110 Note: in this example the inverse matrix is used, but other methods for solving systems of equations are equally valid. If the equations were simpler, substitution might have been a better approach.
8 7 7 A 6.667x10 1.667x10 1.000x10 105 = B 4 3 4 205 6.667x10 1.167x10 5.000x10 C 110 1.600 1.000 0.400 5 A 1.617x10 B = 0.114 C 7.000 5 2 P ( S ) = ( 1.617x10 ) S + 0.114S + 7.000
Figure 4.38
The order of the polynomial should match the number of points. Although, as the number of points increases, the shape of the curve will become less smooth. A common way for dealing with this problem is to fit the spline to a smaller number of points and then verify that it matches the remaining points, or use a least squares method to find the best approximation.
x F M
2 20x
% Fx
= v x 2 F 20 = v -------- v + ---M M
Figure 4.39
Mc
yc
K s1
Kd
Mt
yt
K s2 yr
Figure 4.40
For our purposes we will focus only on the translation of the tire, and ignore its rotational motion. The differential equations describing the system are developed in Figure 4.41.
Mc yc
Mc
yc
K s1 ( y t y c ) K d ( y t y c ) = K s1 ( y t y c ) + K d ( y t y c ) M c g = M c y c M c y c = ( K s1 ) y t + ( K s1 ) y c + ( K d ) y t + ( K d ) y c M c g d- y = v ---c dt c d ---- y = vt dt t # K s1$ # K s1$ # Kd$ # K d$ -' y + & -------' v + ( g ) v c = & ---------' y t + & -----------v + ' & --------! Mc " ! M c " c ! M c" t ! M c " c
%F
K s1 ( y t y c )
Kd ( yt yc )
Mt
Mt yt
K s2 ( y r y t ) = K s2 ( y r y t ) K s1 ( y t y c ) K d ( y t y c ) M t g = M t y t M t y t = ( K s2 ) y r + ( K s2 K s1 ) y t + ( K s1 ) y c + ( K d ) y t + ( K d ) y c M t g
%F
# K s2$ # K s2 K s1$ # K s1$ # K d$ # K d$ -' y + & -----------------' v + & ------' v + ( g ) v t = & ---------' y r + & ---------------------------y + ' & Mt ! Mt " ! " t ! M t " c ! M t " t ! M t" c
(4)
Figure 4.41
The damping force must be converted from a tabular form to equation form. This is done in Figure 4.42.
The four data points can now be written in equation form, and then put into matrix form. 1000 = A ( 0.3 ) + B ( 0.3 ) + C ( 0.3 ) + D 3 2 1600 = A ( 0 ) + B ( 0 ) + C ( 0 ) + D 2000 = A ( 0.2 ) + B ( 0.2 ) + C ( 0.2 ) + D 3 2 2250 = A ( 0.3 ) + B ( 0.3 ) + C ( 0.3 ) + D 0.027 0.09 0.3 0 0 0 0.008 0.04 0.2 0.027 0.09 0.3 1 1 1 1 A 1000 B = 1600 C 2000 D 2250
3 2 3 2
The matrix can be solved to find the coefficients, and the final equation written. A 2778 B = 277.8 C 1833 D 1600 K d ( L ) = ( 2778 ) L + ( 277.8 ) L + ( 1833 ) L + 1600 Figure 4.42 Fitting a spline to the damping values
3 2
The system is to be tested for overall deflection when exposed to obstacles on the road. For the initial conditions we need to find the resting heights for the tire and car body. This can be done by setting the accelerations and velocities to zero, and finding the resulting heights.
The initial accelerations and velocities are set to zero, assuming the car has settled to a steady state height. This then yields equations that can be used to calculate the initial deflections. Assume the road height is also zero to begin with. K s 1$ K s 1$ Kd$ K d$ ------- y t + # ---------- y c + # ------ 0 + # -------0 = # ! Mc " ! Mc " ! M c" ! Mc " 0 + ( g ) Mc y c = y t g ------Ks 1 K s 2$ K s 2 K s 1$ K s 1$ K d$ K d$ ------- 0 + # ------------------------- y t + # ------- y c + # -------- 0 + # ----0 = # ! Mt " ! " ! Mt " ! Mt " ! M t" 0 + ( g ) Mt gM t = ( K s 2 K s 1 ) y t + ( K s 1 ) y c Mc $ ------ gM t = ( K s 2 K s 1 ) y t + ( K s 1 ) # y g ! t K s 1" Mc + Mt Mc - g ------y c = g ------------------Ks 2 Ks1 Mc + Mt y t = g ------------------Ks 2 Mc + Mt Mc $ - + ------y c = g # ------------------! Ks2 K s 1"
Figure 4.43
The resulting calculations can then be written in a computer program for analysis, as shown in Figure 4.44.
#include <stdio.h> #include <math.h> #define #define #define #define #define SIZE y_c y_t v_c v_t 4 0 1 2 3 /* define state variables */
#define N_step 10000 #define h_step 0.001 #define #define #define #define #define Ks1 Ks2 Mc Mt grav
void integration_step(double h, double state[], double derivative[]){ int i; for(i = 0; i < SIZE; i++) state[i] += h * derivative[i]; } double damper(double L){ return (-2778*L*L*L + 277.8*L*L - 1833*L + 1600); } double y_r(double t){ /* return 0.0; /* a zero input to test the initial conditions */ /* return 0.2 * sin(t);/* a sinusoidal oscillation */ return 0.2; */ /* a step function */ /* return 0.2 * t; */ /* a ramp function */ }
Figure 4.44
void d_dt(double t, double state[], double derivative[]){ double Kd; Kd = damper(state[y_c] - state[y_t]); derivative[y_c] = state[v_c]; derivative[y_t] = state[v_t]; derivative[v_c] = (Ks1/Mc)*state[y_t] - (Ks1/Mc)*state[y_c] + (Kd/Mc)*state[v_t] - (Kd/Mc)*state[v_c] - grav; derivative[v_t] = (Ks2/Mt)*y_r(t) - ((Ks2+Ks1)/Mt)*state[y_t] + (Ks1/Mt)*state[y_c] - (Kd/Mt)*state[v_t] + (Kd/Mt)*state[v_c] - grav; } main(){ double state[SIZE]; double derivative[SIZE]; FILE *fp_out; double t; int i; state[y_c] state[y_t] state[v_c] state[v_t] = = = = - grav * ( (Mc/Ks1) + (Mt + Mc)/Ks2 ); /* initial values */ - grav * (Mt + Mc) / Ks2; 0.0; 0.0;
if((fp_out = fopen("out.txt", "w")) != NULL){ /* open the file */ fprintf(fp_out, " t Yc Yt Vc Vt \n"); for(t = 0.0, i = 0; i < N_step; i++, t += h_step){ if((i % 100) == 0) fprintf(fp_out, "%f %f %f %f t, state[y_c], state[y_t], state[v_c], state[v_t]); d_dt(t, state, derivative); integration_step(h_step, state, derivative); } } else { printf("ERROR: Could not open file \n"); } fclose(fp_out); }
%f \n",
Figure 4.45
This program was then used to test various design cases by selecting input types for changes in the road height, and then calculating how the tire and vehicle heights would change as a result. Some of these results are seen in Figure 4.46. These results were obtained by running the program, and then graphing the results in a spreadsheet program. The input of zero for the road height was used to test the program. As shown the height of the vehicle changes, indicating that the initial height calculations are correct, and the model is stable. The step function shows some oscillations that settle out to a stable final value. The oscillation is relatively slow, and is fully transmitted to the automobile. The ramp function shows that the car follows the rise of the slope with small transient effects at the start.
y r ( t ) = 0.0
0 1 -0.02 8 15 22 29 36 43 50 57 64 71 78 85 92 99
y r ( t ) = 0.2 m
0.3 0.25 0.2
-0.04
-0.06
Series1 Series2
Series Series
-0.08
y r ( t ) = 0.2 m sin ( t )
0.3 0.2
y r ( t ) = ( 0.2 m ) t
2.5
0.1
1.5
0 1 -0.1
0.5
15
22
29
36
43
50
57
64
71
78
85
92
99
S eries1 S eries2
1
Series Series
-0.2
-0.3
0 1 -0.5 8 15 22 29 36 43 50 57 64 71 78 85 92 99
-0.4
Figure 4.46
4.8 SUMMARY
State variable equations are used to reduced to first order differential equations. First order equations can be integrated numerically. Higher order integration, such as Runge-Kutta increase the accuracy. Switching functions allow functions terms to be turned on and off to provide more complex function. Tabular data can be used to get numerical values.
4. The system below is comprised of two masses. There is viscous damping between the masses and between the bottom mass and the floor. The masses are also connected with a cable that is run over a massless and frictionless pulley. Write the differential equations for the system, and put them in state variable form. x1 M1 B1 M2 B2 x2 F Ks
5. Do a first order numerical integration of the derivative below from 0 to 10 seconds in one second steps. Assume the system starts undeflected. Write the equation for each time step. d2 ---x ( t ) = 5( t 4 ) dt 6. Given the differential equation below integrate the values numerically for the first ten seconds with 1 second steps. Assume the initial value of x is 1. You may use first order or Runge Kutta integration. x + 0.25 x = 3 7. Write a Scilab program to calculate the area under the function below using a numerical method, such as Simpsons rule. Test it by using the range from x=1 to x=1.2. Assume the sine function is in radians sin x ---------$ f ( x ) = 5 x + 2 ln # ! x " 8. Write a computer program in a language of your choice (C/C++, Java, Scilab script, etc.) that will numerically integrate the differential equation below. + 3 + 9 = 10 9. Given the following differential equation and initial conditions, draw a sketch of the first 5 seconds of the output response. The input is a step function that turns on at t=0. Use at least two different methods, and compare the results. initial conditions V i ( t 0 ) = 5 V 0.5 V o + 0.6 V o + 2.1 V o = 3 V i + 2 Vo ( 0 ) = 0 V Vo ( 0 ) = 1 V 10. a) For the mass-spring-damper system below solve the differential equation as a function of time. Assume the system starts at rest and undeflected. b) Also solve the problem using your calculator (and state equations) to verify your solution. Sketch the results. x Kd K s = 10 K d = 10 F M = 10 M Ks F = 10
11. The mechanical system below is a mass-spring-damper system. A force F of 100N is applied to the 10Kg cart at time t=0s. The motion is resisted by the spring and damper. The spring
coefficient is 1000N/m, and the damping coefficient is to be determined. Follow the steps below to develop a solution to the problem. Assume the system always starts undeflected and at rest. a) Develop the differential equation for the system. b) Solve the differential equation using damping coefficients of 100Ns/m and 10000Ns/m. Draw a graph of the results. c) Develop the state equations for the system. d) Solve the system with a first order numerical analysis using Scilab for damping coefficients of 100Ns/m and 10000Ns/m. Draw a graph of the results. e) Solve the system with a Runge Kutta numerical analysis using Scilab for damping coefficients of 100Ns/m and 10000Ns/m. Draw a graph of the results. f) Write a computer program (in C, Java or Fortran) to do the Runge Kutta numerical integration in step e). Draw a graph of the results. g) Compare all of the solutions found in the previous steps. h) Select a damper value to give an overall system damping coefficient of 1. Verify the results by numerically integrating. x Kd F M Ks
12. For the mechanism illustrated in the figure below the values are Ks1=Ks2=100N/m, M1=M2=1kg, F=1N. Assume that the system starts at rest, and the springs are undeformed initially. x1 x2
F M1
Ks 1 M2
Ks 2
a. Derive the differential equations for the system. b. Put the equations in state variable form. c. Put the equations in state variable matrices. d. Use a calculator to find values for x1 and x2 over the first 10 seconds. Provide the results in a table in 1 second intervals. e. Use Scilab to plot the values for the first 10 seconds. f. Use a Scilab program and the Runge-Kutta method to produce a graph of the first 10 seconds.
g. Repeat step g. using the first-order approximation method. h. Use a C program to produce a graph of points for the first 10 seconds.
x 0 d- y ---= 0 dt v 3 u 9
2. y1 y2 y3 v1 v2 v3 = v1 = v2 = v3 = 2 v1 3 y1 4 v2 5 y2 6 v3 t F v 1 13 - -----v = ------12 12 3 v1 7 8911 5- y 3 ----- ----- y 1 ----= ------v 2 ----y 2 ----cos ( 5 t ) 10 10 10 10 10 10 y1 y2 d- y 3 ---= dt v 1 v2 v3 0 0 0 0 0 0 3 5 0 0 0 0 0 0 0 1 0 0 2 1 ----12 1 ----10 0 0 1 0 0 1 4 6 13 0 ----12 8 ----0 10 y1 y2 y3 v1 v2 v3 0 0 0 + tF 0 5 ----cos t 10
F M
Kd x Ks x
4. +y +x T M1 B1 ( x1 x2 ) Ks x 1
%F
B1 ( x1 x2 ) T M2 F B2 x2
%F
= T + B 1 ( x1 x2 ) + F B2 x2 = M2 x2
5. h = 1 x( t + h ) = x ( t ) + h5( t 4 )
2
t 0 1 2 3 4 5 6 7 8 9 10
6. x' = 3 0.25 x dx ( t + h ) = x ( t ) + h # ---x ( t )$ ! dt " x ( t + h ) = x ( t ) + 1 ( 3 0.25 x ( t ) ) x ( t + h ) = 0.75 x ( t ) + 3 t 0 1 2 3 4 5 6 7 8 9 10 x 1 3.75 5.81 7.36 8.52 9.39 10.0 10.5 10.9 11.2 11.4 x 2.75 2.06 1.55 1.16 0.870 0.652 0.489 0.367 0.275 0.206
7.
// integrate.sce - A simple program to integrate a function // To run this in Scilab use 'File' then 'Exec'. // by: H. Jack Sept., 9, 2002 // define the function function foo=f(x) foo = 5 * x + 2 * log(sin(x) / x); endfunction // Set the time length and step size steps = 10; x_start = 1; x_end = 1.2; x_delta = (x_end - x_start) / steps; // Loop for rectangular integration total = 0; // set the initial sum to zero for i=0:steps, x = x_start + i * x_delta; total = total + f(x); end total = total * x_delta; printf("Rectangular integration value %f\n", total); // Loop for trapezoidal integration total = 0; // set the initial sum to zero for i=0:steps, x = x_start + i * x_delta; if i == 0 then total = total + f(x); elseif i == steps then total = total + f(x); else total = total + 2 * f(x); end end total = total * x_delta / 2; printf("Trapezoidal integration value %f\n", total); // Loop for Simpson's rule integration total = 0; // set the initial sum to zero even = 0; for i=0:steps, x = x_start + i * x_delta; if i == 0 then total = total + f(x); elseif i == steps then total = total + f(x); else even = even + 1; if even > 1 then total = total + 4 * f(x); even = 0; else total = total + 2 * f(x); end end end total = total * x_delta / 3; printf("Simpsons rule integration value %f\n", total);
8.
#include <stdio.h> int main(){ int
steps = 100, i; double theta, omega, step_t, theta_last, omega_last; theta = 0.0; omega = 0.0; step_t = 1.0; for(i = 0; i < steps; i++){ theta_last = theta; omega_last = omega; theta = theta_last + step_t * omega_last; omega = omega_last + step_t*(-3 * omega_last - 9 * theta_last + 10); printf("%f %f %f \n", i+step_t, theta, omega); }
9. a) b) V o ( t ) = 8.331 e Vo = Yo
0.6 t
Y o = 1.2 Y o 4.2 V o + 34
// assign4_1.sce // by: H. Jack Sept., 23, 2003 v0 = 0; y0 = 1; X=[v0, y0]; // initial conditions
// define the state matrix function // the values returned are [x, v] function foo=f(state,t) foo = [ state($, 2), -1.2*state($,2) - 4.2*state($,1) + 34]; endfunction
// Set the time length and step size for the integration steps = 1000; t_start = 0; t_end = 10; h = (t_end - t_start) / steps; t = [t_start];
// // Loop for integration // for i=1:steps, t = [t ; t($,:) + h]; F1 = h * f(X($,:), t($,:)); F2 = h * f(X($,:) + F1/2.0, t($,:) + h/2.0); F3 = h * f(X($,:) + F2/2.0, t($,:) + h/2.0); F4 = h * f(X($,:) + F3, t($,:) + h); X = [X ; X($,:) + (F1 + 2.0*F2 + 2.0*F3 + F4)/6.0]; end // // Graph the values // plot2d(t, X, [-2, -5], leg="position@velocity"); xtitle('Time (s)'); // // Generate points from the given function // XX = [v0]; for i=1:steps, tt = i * h; XX = [XX ; -8.331 * exp(-0.6 * tt) * cos( 1.960 * tt - 0.238) + 8.095]; end plot2d(t, XX, [-4], leg="explicit");
c) The two curves produced by the scilab program overlap, so the results agree.
10. F M Kd x Ks x x homogeneous: x+x+x = 0 A +A+1 = 0 1 1 4( 1 )( 1 ) 3 - = 0.5 j -----A = --------------------------------------------2(1) 2 3 0.5 t ------t C $ xh = C1 e cos # ! 2 + 2" particular: xp = B 0+0+B = 1 xp = 1 initial conditions: x = xh + xp = C1e
0.5 t 2
= F K d x K s x = Mx Mx + K d x + K s x = F 10 x + 10 x + 10 x = 10 x+x+x = 1
%F
3 3 3 0.5 t -t C $ ------t C $ - C e 0.5 t sin # -----x' = -----cos # ! 2 + 2" 0.5 C 1 e ! 2 + 2" 2 1 3 - C sin ( C 2 ) 0.5 C 1 cos ( C 2 ) = 0 x' ( 0 ) = -----2 1 3 - sin ( C 2 ) = 0.5 cos ( C 2 ) -----2 1 tan ( C 2 ) = -----3 1 ------$ C 2 = atan # ! 3" = 0.5236
3 $ -----sin # ! 2 t + 1.047" + 1
11. a) b) K d$ # K s$ F ----- x + ----- x = ---x+# ! M" ! M" M 5t N x 1 ( t ) = 0.115 e cos ( 5 3 t 0.524 ) + 0.10 K d = 100 --m 0.1 t 5 999.9 t N x 1 ( t ) = 0.1 e + 10 e + 0.10 K d = 10000 --m 0 d- X 0 ---= K s dt X -------1 M 1 0 X0 + F Kd ----------- X1 M M
c)
g)
For 100N/m: all solutions are underdamped and overshoot at; b) 0.1163 at t = 0.363s d) 0.1166 at t = 0.361s e) 0.1163 at t = 0.363s f) 0.1163 at t = 0.360s For 10000N/m: all solutions are overdamped. The time to reach the time constant (at 0.06321) is, b) 0.06321 at t = 10.001s d) 0.06321 at t = 10.000s e) 0.06321 at t = 10.000s f) 0.06321 at t = 10.0s
h)
Ns K d = 200 ----m
12. b) x1 = v1 K s 1$ K s 1$ # F $ ---------- + x 2 # -----------x1 = x1 # ! M1 " ! M 1 " + ! M 1" x2 = v2 K s 1$ K s 1 K s 2$ ------- + x 2 # -------------------------x1 = x1 # ! M2 " ! " M2 c) x1 d- v 1 ---= dt x 2 v2 0 1 Ks 1 ---------- 0 M1 0 Ks1 ------M1 0 0 x1 v1 0 F -----+ M1 0 0
0 0 0 1 x2 Ks 1 Ks 1 K s2 ------- 0 -------------------------- 0 v2 M2 M2
e), f), g)
// System component values Ks1 = 100; Ks2 = 100; M1 = 1; M2 = 1; F = 1; x0 = 0; // initial conditions v0 = 0; x1 = 0; v1 = 0; X=[x0, v0, x1, v1]; // define the state matrix function the values returned are [x, v] function foo=f(state,t) foo = [ state($,2), -Ks1/M1*state($,1)+Ks1/M1*state($,3)+F/M1, state($,4), Ks1/M2*state($,1)-(Ks1+Ks2)/M2*state($,3)]; endfunction // Set the time length and step size for the integration steps = 10000; t_start = 0; t_end = 10; h = (t_end - t_start) / steps; t = [t_start]; // Loop for integration for i=1:steps, t = [t ; t($,:) + h]; F1 = h * f(X($,:), t($,:)); F2 = h * f(X($,:) + F1/2.0, t($,:) + h/2.0); F3 = h * f(X($,:) + F2/2.0, t($,:) + h/2.0); F4 = h * f(X($,:) + F3, t($,:) + h); X = [X ; X($,:) + (F1 + 2.0*F2 + 2.0*F3 + F4)/6.0]; end // Graph the values for part e) plot2d(t, X, [-2, -5, -7, -9], leg="position1@velocity1@position2@velocity2"); xtitle('Time (s)'); // printf the values for part f) printf("\n\nPart e output\n\n"); for time_count=0:20, i = (time_count/2) / h + 1; printf("Point at t=%f x1=%f, v1=%f, x2=%f, v2=%f \n", time_count/2, X(i, 1), X(i, 2), X(i, 3), X(i, 4)); end // First order integration for part h) X=[x0, v0, x1, v1]; t = [t_start]; for i=1:steps, t = [t ; t($,:) + h]; F1 = h * f(X($,:), t($,:)); X = [X ; X($,:) + F1 ]; end printf("\n\nPart g output \n\n"); for time_count=0:20, i = (time_count/2) / h + 1; printf("Point at t=%f x1=%f, v1=%f, x2=%f, v2=%f \n", time_count/2, X(i, 1), X(i, 2), X(i, 3), X(i, 4)); end
h)
The following subroutine is used in place of the subroutine in the program shown in Figure 4.26 and Figure 4.27.
// // State Equations Calculated Here // void derivative(double t, double X[], double dX[]){ dX[0] = X[1]; dX[1] = -Ks1 / M1 * X[0] + Ks1 / M1 * X[2] + Force / M1; dX[2] = X[3]; dX[3] = Ks1 / M2 * X[0] - (Ks1 + Ks2) / M2 * X[2]; }
x =
%
i=0
5 iu ( i 20 )
2. Write a Scilab program to implement the following equation to calculate the value of x.
10
v =
- dt ( --------M
0
F( t)
M = 10
3. Write a Scilab program to implement the following equation to calculate the value of x.
10
x =
( f ( t ) dt
0
f ( t ) = 5 ln ( t )
4. Write a Scilab program to integrate the area under the function below using a numerical method, such as Simpsons rule. Find the area from 1 to 2. sin x ---------$ f ( x ) = 5 x + 2 ln # ! x "
5. Numerically integrate one time step of the differential equation below using a) first order integration and b) Runge Kutta integration. + 3 + 9 = 10 6. Convert the third order differential equation below to state equation form. With a numerical method of your choice, find the state of the system 1 second later. Show all calculations. x + 4 x + 2 x + 5 x = 10
7. The differential equation below describes a first order system that starts with an initial value of k=20. Find the state at two milliseconds using a) explicit integration, b) first order numerical integration and c) Runge-Kutta integration. For the numerical methods use a timestep of h=0.001s. ----> The final results must be put in a table for easy comparison. k + 10 k = 5 k ( 0 ) = 20
8. For the mechanism shown in the figure below the values are Ks1=Ks2=100N/m, Kd1=10Nm/s, M1=M2=1kg, F=1N. Assume that the system starts at rest, and the springs are undeformed ini-
tially. x1 Kd 1 M1 Ks 1 M2 x2
Ks 2
a. Derive the differential equations for the system. b. Put the equations in state variable form. c. Put the equations in state variable matrices. d. Use a calculator or Scilab using first order integration to find values for x1 and x2 over the first 10 seconds. Provide the results in a table in 1 second intervals. e. Use Scilab to plot the values for the first 10 seconds using the values obtained in part d. f. Use a Scilab program and the Runge-Kutta method to produce a graph of the first 10 seconds. g. Use a C program to produce a list of points for the first 10 seconds. h. Compare the results found in steps d, f and g in a table. 9. Explicitly solve the following differential equation. Verify the result numerically.
2 v + 20 v = 200
rotation - 5.1
5. ROTATION
Topics: Basic laws of motion Inertia, springs, dampers, levers, gears and belts Design cases Objectives: To be able to develop and analyze differential equations for rotational systems.
5.1 INTRODUCTION
The equations of motion for a rotating mass are shown in Figure 5.1. Given the angular position, the angular velocity can be found by differentiating once, the angular acceleration can be found by differentiating again. The angular acceleration can be integrated to find the angular velocity, the angular velocity can be integrated to find the angular position. The angular acceleration is proportional to an applied torque, but inversely proportional to the mass moment of inertia.
equations of motion
T OR
( t ) = % ( t ) dt = ( t ) = % ( t ) dt
% % ( t ) dt dt
(t) ( t) = T --------where, JM
, , = position, velocity and acceleration J M = second mass moment of inertia of the body T = torque applied to body
Figure 5.1
rotation - 5.2
Note: A torque and moment are equivalent in terms of calculations. The main difference is that torque normally refers to a rotating moment.
Given the initial state of a rotating mass, find the state 5 seconds later.
0 = 1rad
0 = 2 --------
rad s
= 3 -------2 s
rad
ans.
Figure 5.2
5.2 MODELING
Free Body Diagrams (FBDs) are required when analyzing rotational systems, as they were for translating systems. The force components normally considered in a rotational system include, inertia - opposes acceleration and deceleration springs - resist deflection dampers - oppose velocity levers - rotate small angles gears and belts - change rotational speeds and torques
rotation - 5.3
5.2.1 Inertia
When unbalanced torques are applied to a mass it will begin to accelerate, in rotation. The sum of applied torques is equal to the inertia forces shown in Figure 5.3.
, ,
&T
= JM
J T
J M = I xx + I yy 2 I xx = % y dM 2 I yy = % x dM
Note: The mass moment of inertia will be used when dealing with acceleration of a mass. Later we will use the area moment of inertia for torsional springs.
Figure 5.3
The mass moment of inertia determines the resistance to acceleration. This can be calculated using integration, or found in tables. When dealing with rotational acceleration it is important to use the mass moment of inertia, not the area moment of inertia. The center of rotation for free body rotation will be the centroid. Moment of inertia values are typically calculated about the centroid. If the object is constrained to rotate about some point, other than the centroid, the moment of inertia value must be recalculated. The parallel axis theorem provides the method to shift a moment of inertia from a centroid to an arbitrary center of rotation, as shown in Figure 5.4.
rotation - 5.4
2 J M = J M + Mr
where, J M = mass moment about the new point = mass moment about the center of mass JM M = mass of the object r = distance from the centroid to the new point
Figure 5.4
2 J A = JA + Ar
where, J A = area moment about the new point J A = area moment about the centroid A = mass of the object r = distance from the centroid to the new point
Figure 5.5
Aside: If forces do not pass through the center of an object, it will rotate. If the object is made of a homogeneous material, the area and volume centroids can be used as the center. If the object is made of different materials then the center of mass should be used for the center. If the gravity varies over the length of the (very long) object then the center of gravity should be used.
An example of calculating a mass moment of inertia is shown in Figure 5.6. In this problem the density of the material is calculated for use in the integrals. The integrals are then developed using slices for the integration element dM. The integrals for the moments about the x and y axes, are then added to give the polar moment of inertia. This is then shifted from the centroid to the new axis using the parallel axis theorem.
rotation - 5.5
The rectangular shape to the right is constrained to rotate about point A. The total mass of the object is 10kg. The given dimensions are in meters. Find the mass moment of inertia. First find the density and calculate the moments of inertia about the centroid. 10 Kg 2 = ------------------------------= 0.125 Kgm 2(5m)2(4m ) I xx =
4 -5 -2.5 -1 -4 5
%4 y
dM =
%4 y
1 y
3 4 4
%5 x
dM =
%5 x
3
2 ( 4 m ) dx = 1 Kgm ---3
3
1 x
5 m ) -$ 1 ( 5 m ) 2 -------------- ( ---------------- = 1 Kgm # = 83.33 Kgm ! 3 3 " J M = I xx + I yy = 53.33 Kgm + 83.33 Kgm = 136.67 Kgm
2 2 2
The centroid can now be shifted to the center of rotation using the parallel axis theorem.
2 2 2 2 2 J M = J M + Mr = 136.67 Kgm + ( 10 Kg ) ( ( 2.5 m ) + ( 1 m ) ) = 209.2 Kgm
Figure 5.6
rotation - 5.6
The rectangular shape to the right is constrained to rotate about point A. The total mass of the object is 10kg. The given dimensions are in meters. Find the mass moment of inertia WITHOUT using the parallel axis theorem. -5
4 -2.5 -1 -4 5
ans.
Figure 5.7
rotation - 5.7
The 20cm diameter 10 kg cylinder to the left is sitting in a depression that is effectively frictionless. If a torque of 10 Nm is applied for 5 seconds, what will the angular velocity be?
ans. ( 5 s ) = 312.5 rad rad ( 5 s ) = 125 -------s Figure 5.8 Drill problem: Find the velocity of the rotating shaft
5.2.2 Springs
Twisting a rotational spring will produce an opposing torque. This torque increases as the deformation increases. A simple example of a solid rod torsional spring is shown in Figure 5.9. The angle of rotation is determined by the applied torque, T, the shear modulus, G, the area moment of inertia, JA, and the length, L, of the rod. The constant parameters can be lumped into a single spring coefficient similar to that used for translational springs.
rotation - 5.8
L J A G$ T = # --------! L " T = K S ( ) T Note: Remember to use radians for these calculations. In fact you are advised to use radians for all calculations. Dont forget to set your calculator to radians also. Note: This calculation uses the area moment of inertia. (8)
(9)
Figure 5.9
The spring constant for a torsional spring will be relatively constant, unless the material is deformed outside the linear elastic range, or the geometry of the spring changes significantly. When dealing with strength of material properties the area moment of inertia is required. The calculation for the area moment of inertia is similar to that for the mass moment of inertia. An example of calculating the area moment of inertia is shown in Figure 5.10, and based on the previous example in Figure 5.6. The calculations are similar to those for the mass moments of inertia, except for the formulation of the integration elements. Note the difference between the mass moment of inertia and area moment of inertia for the part. The area moment of inertia can be converted to a mass moment of inertia simply by multiplying by the density. Also note the units.
rotation - 5.9
4 -5 First, the area moment of inertia is calculated about the centroid by integration. All dimensions are in m. 3 4m 2 4m 2 y = y 2 ( 5m ) d y = 10m ----y d A %4m %4m 3 4m -2.5 -1 -4 5
# 4m ) 3 ( 4m ) 3$ -( = 426.7 = 10m ' ( -------------- -----------------3 " 3 ! 4m 5m 3 # 5m ) 3 ( 5m ) 3$ 4 5m 2 5m 2 -( = 666.7m x 2 ( 4m ) dx = 8m x ----= 8m ' ( -------------- -----------------I yy = % x dA = % 5m 5m 3 " 3 ! 3 5m 4 4 J = I + I = ( 426.7 + 666.7 ) m = 1093.4m A xx yy I xx = Next, shift the area moment of inertia from the centroid to the other point of rotation. 2 J A = J + Ar A 4 2 2 = 1093.4m + ( ( 4m ( 4m ) ) ( 5m ( 5m ) ) ) ( ( 1m ) + ( 2.5m ) ) = 1673m 4
Note: The basic definitions for the area moment of inertia are shown to the right.
I xx = I yy =
% y dA 2 % x dA
J A = I xx + I yy 2 J A = J A + Ar
Note: You may notice that when the area moment of inertia is multiplied by the density of the material, the mass moment of inertia is the result. Therefore if you have a table of area moments of inertia, multiplying by density will yield the mass moment of inertia. Keep track of units when doing this.
Figure 5.10
rotation - 5.10
For a 1/2" 1020 steel rod that is 1 yard long, find the torsional spring coefficient.
ans.
Nm K s = 215 -------rad
Figure 5.11
An example problem with torsional springs is shown in Figure 5.12. There are three torsional springs between two rotating masses. The right hand spring is anchored solidly in a wall, and will not move. A torque is applied to the left hand spring. Because the torsional spring is considered massless the torque will be the same at the other end of the spring, at mass J1. FBDs are drawn for both of the masses, and forces are summed. (Note: the similarity in the methods used for torsional, and for translational springs.) These equations are then rearranged into state variable equations, and finally put in matrix form.
rotation - 5.11
Ks 1
J M1
Ks2
J M2
Ks3
Model the system above assuming that the center shaft is a torsional spring, and that a torque is applied to the leftmost disk. Leave the results in state variable form. 1 Ks 2 ( 1 2 )
&M
= K s 2 ( 1 2 ) = J M1 1
J M1 2
(1) (2)
&M
= K s 2 ( 2 1 ) K s 3 2 = J M2 2
(3) (4)
1 d- 1 ---= dt
2
0 0 0 1 2 K s3 Ks 2 Ks 2 ------- 0 -------------------------- 0 2 J M2 J M2
0 + 0 0
Figure 5.12
rotation - 5.12
5.2.3 Damping
Rotational damping is normally caused by viscous fluids, such as oils, used for lubrication. It opposes angular velocity with the relationships shown in Figure 5.13. The first equation is used for a system with one rotating and one stationary part. The second equation is used for damping between two rotating parts.
T = Kd T = Kd ( 1 2 )
Figure 5.13
If a wheel (JM=5kg m2) is turning at 150 rpm and the damping coefficient is 1Nms/rad, what is the deceleration?
Figure 5.14
The example in Figure 5.12 is extended to include damping in Figure 5.15. The primary addition from the previous example is the addition of the damping forces to the FBDs. In this case the damping coefficients are indicated with B, but Kd could have also been used. The state equations were developed in matrix form. Visual comparison of the final matrices in this and the previous example reveal that the damping terms are the
rotation - 5.13
only addition.
Ks 1 B1
J M1
Ks2
J M2 B2
Ks3
Model the system above assuming that the center shaft is a torsional spring, and that a torque is applied to the leftmost disk. Leave the results in state variable form. 1 Ks 2 ( 1 2 )
&M
= K s 2 ( 1 2 ) B 1 1 = J M1 1
J M1 B1 1 Ks 2 ( 2 1 )
J M1 1 = B 1 1 K s 2 1 + K s 2 2 + (1) 1 = 1 B 1$ K s 2$ K s 2$ - 1 + # ---------- 1 + # ------- + ------ 1 = # -------! JM " ! JM " ! J M " 2 J M (2) 1 1 1 1 + & M = Ks 2 ( 2 1 ) B 2 2 K s 3 2 = JM2 2 K s 2$ B 2$ # K s 3 K s 2$ - 2 + -------------------------- 2 + # ------ 2 = # -------! JM " ! " ! JM " 1 J M 2 2 2 (3) 2 = 2
(4)
1 d- 1 ---= dt 2 2
1 1
0 K s3 Ks 2 0 -------------------------J M2
1 2 B2 2 -------J M2
0 ------+ J M1 0 0
Figure 5.15
A System Example
rotation - 5.14
5.2.4 Levers
The lever shown in Figure 5.16 can be used to amplify forces or motion. Although theoretically a lever arm could rotate fully, it typically has a limited range of motion. The amplification is determined by the ratio of arm lengths to the left and right of the center.
Note: As the lever rotates the length ratio will be maintained because of similar triangles. This allows the lever to work over a range of angles. The lever above would become ineffective if it was vertical.
Note: The tip deflection can be related to the angle of 1 2 - = ---rotation of the lever if the angle of rotation is small. = ---d1 d2
Figure 5.16
Given a lever set to lift a 1000 kg rock - if the lever is 2m long and the distance from the fulcrum to the rock is 10cm, how much force is required to lift it?
ans. F = 516.3 N
Figure 5.17
rotation - 5.15
T 1 = Fc r1
T2 = Fc r2
n1 n2 ---- = ---r1 r2
Vc = 1 r1 = 2 r2 where,
n = number of teeth on respective gears r = radii of respective gears Fc = force of contact between gear teeth Vc = tangential velocity of gear teeth T = torques on gears
Figure 5.18
For lower gear ratios a simple gear box with two gears can be constructed. For higher gear ratios more gears can be added. To do this, compound gear sets are required. In a compound gear set two or more gears are connected on a single shaft, as shown in Figure 5.19. In this example the gear ratio on the left is 4:1, and the ratio for the set on the right is 4:1. Together they give a gear ratio of 16:1.
rotation - 5.16
N 2 = 60 N 5 = 15 N2 N4 - = 16 e = -----------N3 N5 In this case the output shaft turns 16 times faster than the input shaft. If we reversed directions the output (former input) would now turn 1/16 of the input (former output) shaft speed.
Output shaft
N 3 = 15 N 4 = 60
Figure 5.19
A manual transmission is shown in Figure 5.20. In the transmission the gear ratio is changed by sliding (left-right) some of the gears to change the sequence of gears transmitting the force. Notice that when in reverse an additional compound gear set is added to reverse the direction of rotation.
rotation - 5.17
10
11
6 5
In this manual transmission the gear shifter will move the gears in and out of contact. At this point all of the needed gears will be meshed and turning. The final step is to engage the last gear in the gear train with the clutch (plate) and this couples the gears to the wheels.
Figure 5.20
A manual transmission
Rack and pinion gear sets are used for converting rotation to translation. A rack is a long straight gear that is driven by a small mating gear called a pinion. The basic relationships are shown in Figure 5.21.
rotation - 5.18
T = Fr where,
Vc = r
l = r
r = radius of pinion F = force of contact between gear teeth Vc = tangential velocity of gear teeth and velocity of rack T = torque on pinion
Figure 5.21
Belt based systems can be analyzed with methods similar to gears (with the exception of teeth). A belt wound around a drum will act like a rack and pinion gear pair. A belt around two or more pulleys will act like gears.
A gear train has an input gear with 20 teeth, a center gear that has 100 teeth, and an output gear that has 40 teeth. If the input shaft is rotating at 5 rad/sec what is the rotation speed of the output shaft?
What if the center gear is removed? ans. rad case 1: 3 = 2.5 -------s rad case 2: 3 = 2.5 -------s
Figure 5.22
rotation - 5.19
5.2.6 Friction
Friction between rotating components is a major source of inefficiency in machines. It is the result of contact surface materials and geometries. Calculating friction values in rotating systems is more difficult than translating systems. Normally rotational friction will be given as static and kinetic friction torques. An example problem with rotational friction is shown in Figure 5.23. Basically these problems require that the model be analyzed as if the friction surface is fixed. If the friction force exceeds the maximum static friction the mechanism is then analyzed using the dynamic friction torque. There is friction between the shaft and the hole in the wall. The friction force is left as a variable for the derivation of the state equations. The friction value must be calculated using the appropriate state equation. The result of this calculation and the previous static or dynamic condition is then used to determine the new friction value.
rotation - 5.20
Model the system and consider the static and kinetic friction forces on the shaft on the right hand side.
JM
Ks
T s 10 Nm T k = 6 Nm
Ks JM FF
&M
Next, the torque force must be calculated, and then used to determine the new torque force. J M = K s T test T test = K s J M cases: Not slipping previously T test 10Nm T test > 10Nm Slipping previously T test < 6Nm T test 6Nm Figure 5.23 A friction system example
(4)
The friction example in Figure 5.23 can be analyzed using the C program in Figure 5.24. For the purposes of the example some component values are selected and the system is assumed to be at rest initially. The program loops to integrate the state equations. Each loop the friction conditions are checked and then used for a first-order solution to the state equations.
rotation - 5.21
int FILE
h = 0.1, /* time step */ theta, w, /* the state variables */ acceleration, /* the acceleration */ TF, /* friction force */ Ttest, /* the friction test force */ J = 10, /* the moment of inertia (I picked the value) */ tau = 5, /* the applied torque (I picked the value) */ Ks = 10; /* the spring constant (I picked the value) */ slip = 0; /* the system starts with no slip */ *fp;
theta = 0; w = 0;/* the initial conditions - starting at rest here */ TF = 0.0; /* set the initial friction to 0.0; */ acceleration = 0.0;/* set the initial acceleration to zero also */ if( ( fp = fopen("out.txt", "w")) != NULL){/* open a file to write the results */ for( t = 0.0; t < 10.0; t += h ){/* loop */ Ttest = tau - Ks*theta - J*acceleration; if(slip == 0){ /* not slipping */ if(Ttest >= 10){ TF = 6; slip = 1; } else { TF = Ttest; } } else { /* slipping */ if(Ttest < 6){ TF = Ttest; slip = 0; } else {TF = 6;} } acceleration = (tau - TF + Ks*theta) / J; w = w + h * acceleration; theta = theta + h * w; fprintf(fp, "%f, %f, %f\n", t, theta, w); } } fclose(fp); }
Figure 5.24
rotation - 5.22
2 d-$ K -$ K-$ T load # # ------- + = V s # ---- ----------! JR" ! dt" ! JR" JM where,
The speed response of a permanent magnet DC motor is first-order. The steadystate velocity will be a straight line function of the torque applied to the motor, as shown in Figure 5.26. In addition the line shifts outwards as the voltage applied to the motor increases.
voltage/current increases
rotation - 5.23
E = E K + EP EK = JM EP = T P = T
2
Figure 5.27
Note: The units for various rotational quantities are listed to the right. They may be used to check equations by doing a unit balance. The unit rad should be ignored as it appears/disappears sporadically.
rotation - 5.24
To begin the analysis the velocity curve in Figure 5.28 was obtained experimentally by applying a voltage of 15V to the motor with no load attached. In addition the resistance of the motor coils was measured and found to be 40 ohms. The steady-state speed and time constant were used to determine the constants for the motor.
rpm 2400
R = 40
0.5s # K2 $ d-$ K $ T load # ------------( = V s # --------- ---------- + ' m m ! dt" ! " JM R JM ! J M R" The steady-state velocity can be used to find the value of K. # K2 $ rot K -$ # $ - ' ---------( = 15 V # --------( 0 ) + ! 2400 ------- (0) " ! min ! J M R" J M R" rot- 1 min rad # 2400 -------------------2 ---------------$ ( K ) = 15 V ! min 60 s 1 rot " 15 V 3 Vs K = ---------------------------= 39.8 10 -------1 rad 120 rads The time constant can be used to find the remaining parameters. K 11 --------= --------= 2s JM R 0.5 s Vs-$ # 39.8 10 3 -------! rad" - = 0.198005 10-4 = 19.8 10 6 Kgm 2 J = -------------------------------------------1 ( 40 ) ( 2 s ) T load d-$ 1 1 2 # --- m + m 2 s = V s ( 50.3 V s rad ) ----------------------------------------6 2 ! dt" 19.8 10 Kgm m' = m m' = V s 50.3 V s rad m 2 s
1 2 1 2 2
(2)
rotation - 5.25
Figure 5.28
The remaining equations describing the system are developed in Figure 5.29. These calculations are done with the assumption that the inertial effects of the gears and other components are insignificant.
rotation - 5.26
The long shaft must now be analyzed. This will require that angles at both ends be defined, and the shaft be considered as a spring.
gear, gear = angular position and velocity of the shaft at the gear box pinion, pinion = angular position and velocity of the shaft at the pinion
1 gear = ---- 20 m 1 gear = ---- 20 m
T shaft = K s ( gear pinion ) The rotation of the pinion is related to the displacement of the rack through the circumferential travel. This ratio can also be used to find the force applied to the mass. x mass = pinion 6 in 6 in -------$ T shaft = F mass # ! 2 " 6 in -$ K s ( gear pinion ) = F mass # ------! 2 " & Fmass = Fmass = Mmass xmass K s ( gear pinion ) --------------------------------------------- = M mass pinion 6 in in #6 $ ------! 2 " 6 2 1 pinion = ( gear pinion ) 1.768 10 in Kg K s 1in$ 2 $ 1.768 10 6 in 2 Kg 1 K s # 0.0254 ------------------------ pinion = # pinion" ! 20 m ! 1.0 m " 19 2 1 $ ---- pinion = # ! 20 m pinion" ( 1.141 10 ) m Kg K s pinion = pinion 12 2 1 9 2 1 pinion = 57.1 10 m Kg K s m 1.141 10 m Kg K s pinion Figure 5.29 Additional equations to model the machine (3) (4)
If the gear box is assumed to have relatively small moment of inertia, then we can say that the torque load on the motor is equal to the torque in the shaft. This then allows
rotation - 5.27
the equation for the motor shaft to be put into a useful form, as shown in Figure 5.30. Having this differential equation now allows the numerical analysis to proceed. The analysis involves iteratively solving the equations and determining the point at which the system begins to overshoot, indicating critical damping.
The Tload term is eliminated from equation (2) 1 2 1 1 2 m = V s 50.3 V s rad m 2 s 50505 Kg m K s ( gear pinion ) 1 1 2 1 1 2 m = V s 50.3 V s rad m 2 s 50505 Kg m K s # ---- pinion$ ! 20 m " 1 2 1 2 m = ( V s 50.3 V s rad ) + pinion ( 50505 Kg m K s ) + m ( 2 s ) + m ( 2525 Kg m K s ) The state equations can then be put in matrix form for clarity. The units will be eliminated for brevity, but acknowledging that they are consistent. m d- m ---= dt pinion pinion 0 2525 K s 0 57.1 10
12 1 1 2
1 2 0
0 50505 K s 0
9
0 0
m m +
0 Vs 50.3 0 0
1 pinion
K s 0 1.141 10 K s 0 pinion
The state equations for the system are then analyzed using a computer for the parameters below to find the Ks value that gives a response that approximates critical damping for a step input from 0 to 10V. Ks (rad/Nm) 100 Overshoot (rad)
Figure 5.30
These results indicate that a spring value of XXX is required to have the system
rotation - 5.28
behave as if it is critically damped. (Note: Clearly this system is not second order, but in the absence of another characteristics we approximate it as second order.)
5.5 SUMMARY
The basic equations of motion were discussed. Mass and area moment of inertia are used for inertia and springs. Rotational dampers and springs. A design case was presented.
JM1 Ks1 B
JM2 Ks2
rotation - 5.29
2. For the system pictured below a) write the differential equations (assume small angular deflections) and b) put the equations in state variable form. A lever arm has a force on one side, and a spring damper combination on the other side with a suspended mass. x2 F M1 Ks1
R1
R2 J1
Kd1
x1
3. Draw the FBDs and write the differential equations for the mechanism below. 2 R1 JM1 1 R2 JM2 Ks Kd x1 x2 M1
4. The system below consists of two masses hanging by a cable over mass J. There is a spring in the cable near M2. The cable doesnt slip on J. a) Derive the differential equations for the following system.
rotation - 5.30
JM
R Ks1
Ks2 x1 F M2 x2 M1
5. Write the state equations for the system to relate the applied force F to the displacement x. Note that the rotating mass also experiences a rotational damping force indicated with Kd1 Kd 1 F x JM r M Ks 1 Ks 2 Ks3 Kd 2
6. For the system pictured below a) write the differential equations (assume small angular deflec-
rotation - 5.31
tions) and b) put the equations in state variable form. A round drum with a slot. The slot drives a lever arm with a suspended mass. A force is applied to a belt over the drum.
R1 J1
R2
R3
R4
F1
Kd1
Ks1
M1
x1
7. For the system pictured below a) write the differential equations (assume small angular deflections) and b) put the equations in state variable form. R1 x2 F1 J M1, N 1 J M2, N 2 Kd1 M3 R2 x3 Ks1 Two gears with fixed centers of rotation and lever arms.
x1
8. For the system pictured below a) write the differential equations (assume small angular deflec-
rotation - 5.32
A mass slides on a plane with dry kinetic friction (0.3). It is connected to a round mass that rolls and does not slip.
x2 2 F2
9. For the system pictured below a) write the differential equations (assume small angular deflections) and b) put the equations in state variable form.
A pulley system has the bottom pulley anchored. A mass is hung in the middle of the arrangement with springs and dampers on either side. Assume that the cable is always tight.
Kd3
Ks3
M3 Ks2 R2,J2,M2 x2
x3 F1
1 R1,J1
10. For the system pictured below a) write the differential equations (assume small angular
rotation - 5.33
deflections) and b) put the equations in state variable form. M1 x1 Kd1 R1 Ks1 R2 x2 A mass is suspended over a lever arm. Forces are applied to the lower side of the moment arm through a spring damper pair. Kd2 Ks2
F1
x3
11. For the system pictured below a) write the differential equations (assume small angular deflections) and b) put the equations in state variable form. R2 R1 Two gears have a force on one side, and a mass Kd1 N on the other, both sus2 N1 pended from moment arms. There is a rotaJ1 J2 tional damping on one F1 Ks1 1 of the gears. 2 M1 x1
12. Find the polar moments of inertia of area and mass for a round cross section with known radius and mass per unit area. How are they related? 13. The rotational spring is connected between a mass J, and the wall where it is rigidly held. The mass has an applied torque T, and also experiences damping B. a) Derive the differential equation for the rotational system shown. b) Put the equation in state variable form (using variables) and then plot the position (not velocity) as a function of time for the first 5 seconds with your calcula-
rotation - 5.34
tor using the parameters below. Assume the system starts at rest. Nm K s = 10 -------rad J M = 1 Kgm
2
Nms B = 1 ---------rad T T = 10 Nm
Ks
B c) A differential equation for the rotating mass with a spring and damper is given below. Solve the differential equation to get a function of time. Assume the system starts at rest. 1 2 2 '' + ( 1 s )' + ( 10 s ) = 10 s
14. Find the response as a function of time (i.e. solve the differential equation to get a function of time.). Assume the system starts undeflected and at rest. = 10 Nm JM Ks J M = 1 Kgm Ns K d = 3 ----m N K s = 9 --m
2
Kd
rotation - 5.35
& M1 & M2
2. x1 = v1 K s 1$ K s 1$ ---------- + x 2 # ------x1 = x1 # ! M1 " ! M1 " + g x2 = v2 # R 2 K d 1$ # R 2 K s 1$ # R 2 K s 1$ FR 1 -( + x 1 ' -----------------( + x 2 ' --------------( + -----------v 2 = v 1 ' ----------------J1 ! J1 " ! J1 " ! J1 "
2 2 2
rotation - 5.36
3. T1 T2 M1 J M1 gM 1
if T1,T2,Kdx1 > 0
J M2 T2
Kd x1
T1 x 1 1 = ------R2
x1 2 = ----R1
T1 = Ks ( x2 x1 )
= T 1 gM 1 = M 1 x 2 T1 x 2 = g -----M1 = T 1 R 1 + T 2 R 1 = J M1 2 T1 R1 T2 R1 2 = ----------------------------J M1
6 equations, 6 unknowns
rotation - 5.37
& FM1
= T M1 g F = M 1 x 1
2 2 R ( M 1 g + F ) ( K s 1 + R K s 2 ) + ( RK s 2 ) x 2 = ( J M + R M 1 )
& FM2
R ( M1 g + F ) # K s 1 + R K s 2$ # R K s2 $ -( = ------------------------------- + ' ----------------------------( + x 2 ' -------------------------2 2 2 ! JM + R M1 " ! J M + R M 1" JM + R M1 = K s2 ( x2 R ) M2 g = M2 x2 K s 2$ R K s 2$ ------- + # -------------x2 + x2 # ! M2 " ! M2 " = g
(1)
(2)
b)
= # K s 1 R K s 2$ # RK s 2 $ # RM 1 g RF$ -( + x 2 ' --------------------------( + ' --------------------------------( = ' --------------------------------! JM + R2 M1 " ! J M + R 2 M 1" ! J M + R 2 M 1 " x2 = v2 RK s 2$ K s 2$ # -------------------v2 = # ! M2 " + x2 ! M2 " + g
2
rotation - 5.38
5. = K d 1$ K s 2 r$ Fr # K s 1 r K s 2$ -( + # ----------- + x # ------------- = ' ------------------------------! JM " ! JM " + JM JM ! " x = v K s 2 r$ K d 2$ K s 2 K s 3$ - + v # ----------- + x # -------------------------v = # ---------! M " ! M " ! " M 6. x1 = v1 K d 1$ K s 1$ K d 1 R 2 R 4$ K s 1 R2 R 4$ - + x 1 # ---------- + 1 # --------------------- + 1 # -------------------- +g v 1 = v 1 # ----------! M1 " ! M1 " ! M1 R3 " ! M1 R3 " 1 = 1 K d 1 R 2 R 4$ K s 1 R 2 R 4$ # K d 1 R 2 R 4$ # K s 1 R2 R 4$ F 1 R 1 --------------------- + x 1 # -------------------- + 1 ' ------------------------( + 1 ' -----------------------( + --------------1 = v1 # ! J1 R3 " ! J1 R3 " J1 ! J R2 " ! J R2 "
1 3 1 3 2 2 2 2 2
rotation - 5.39
7. 1 F1 R1 JM1 J M1 1 1 N 1 = 2 N2 x1 = v1 R2 Ks1 K d 1$ K s 1$ R2 K d 1$ - + x 1 # ---------- + 2 # -------------- + 1 # --------------$ v 1 = v 1 # ----------! M3 " ! M3 " ! M3 " ! M3 " g 2 = 2 N2 $ 2 2 --------R v1 ( R2 Kd 1 ) + x1 ( R 2 K s 1 ) + 2 ( R 2 Kd 1 ) + 1 ( R2 Ks 1 ) + F # ! N 1 1" 2 = ----------------------------------------------------------------------------------------------------------------------------------------------------------------2 N2 - + JM2 J M 1 ----2 N1 N2 ----N1 x3 2 = ----R2 JM2 2 R2 Kd 1 ( x1 x3 ) JM2 2 M3 R2 Ks1 ( x1 x3 ) M3 x1 M3g Kd1 ( x1 x3 ) Ks1 ( x1 x3 )
rotation - 5.40
9. x2 = v2 R1 R2 ( 2 F1 + M2 g ) R1 R2 Ks 2 # R1 R2 ( K s2 Ks 3 ) $ # $ --------------------------------------------------------------------------------------------------------------------+ x + v 2 = x 3 ' ----------------------------------------------------------( ' ( 2 2 2 2 2 2 2 2 2 2 ! 4J 1 R 2 " ! 4J1 R2 " 4J1 R2 2 + J2 R1 + R1 R2 M2 2 + J2 R1 + R1 R2 M2 2 + J2 R1 + R1 R2 M2 x3 = v3 K d 3$ K s 2 K s 3$ K s 2$ ----------- + x 3 # -------------------------- + x 2 # ------- +g v3 = v3 # ! M3 " ! " ! M3 " M3
2 2 2 2 2 2
rotation - 5.41
10. state equations x1 = v1 R1 + R 2$ v 1 = F 1 # ----------------! R1 M1 " K s 2$ Ks2$ F1 ---------- + x 3 # --------------q = x2 # ! Kd 2 " ! K d 2" + K d 1 K s 1$ R1 Ks1 $ 1 + R 2$ #R ---------- + x 2 # -----------------------------------------------F p = x1 # + 1 ! R K -" ! K d 1 ( R 1 + R 2 )" ! Kd 1 " 1 d1 output equations R1 + R 2$ x 2 = ( x 1 p ) # ----------------! R1 " x3 = q + x2 11. x1 = v1 K s 1$ R 2 K s 1 N 1$ ---------- + 1 # --------------------v1 = x1 # ! M1 " ! M1 N2 " + g 1 = 1 F1 R1 N2 # R2 K s1 N1 N 2 $ # Kd 1 N1 $ # R2 Ks 1 N 1 $ -( + 1 ' -----------------------------( + 1 ' -----------------------------( + ---------------------------- 1 = x 1 ' ----------------------------2 2 2 2 2 2 2 ! J1 N2 " ! " ! " J + J N J N + J N N + J N J N + J N 2 2 1 1 2 2 1 1 2 2 1 1 2 2 1 12.
R R 2 2 R 3 R 2 2 2 2
r = % r dA = % r ( 2 r dr ) = 2 % r dr = 2 ---4
0 0 0
R = --------2
J mass
r= % r dM = % r ( 2 r dr ) = 2 % r dr = 2 --4
0 0 0
The mass moment can be found by multiplying the area moment by the area density.
rotation - 5.42
&M
= T Ks B = JM
b)
2 1 0 5s
Ks BT- ---- = ---- - ---- JM JM JM Nm Nms 10 -------1 ---------10 Nm rad rad = ---------------- ---------------- ---------------- 2 2 2 1 Kgm 1 Kgm 1 Kgm Nm - # 10 s- $ - ------- = ------------10 -------" 2! rad rad Kgm Kgm$ # ----------! 2 "m s s- $ - # 10 10 -------- ------- = -------------------- 2 ! rad rad " Kgm 10 s- $ 2 - ------- = s # 10 ------- ! rad rad "
rotation - 5.43
(c
homogeneous: 1 2 + ( 1 s ) + ( 10 s ) = 0 At guess: = e At h = Ae h A e + ( 1 s ) Ae + ( 10 s ) e A + ( 1 s ) A + 10 s
1 2 1 2 2 At 1 At 2
2 At h = A e
At
= 0 1 s ( 1 s ) 4 ( 1 ) ( 10 s ) A = -----------------------------------------------------------------------------2( 1)
1 1 2 2
= 0
2
cos ( 3.123 s t + C 2 )
p = 0
2
10 s = 1 A = -----------2 10 s
( 0 ) = C1 e
1
0.5 s 0
sin ( 3.123 s t + C 2 )
' ( 0 ) = 0.5 s C 1 ( 1 ) cos ( C 2 ) 3.123 s C 1 ( 1 ) sin ( C 2 ) = 0 0.5 cos ( C 2 ) 3.123 sin ( C 2 ) = 0 sin ( C 2 ) 0.5------------------- = -----------= tan ( C 2 ) cos ( C 2 ) 3.123 C 1 cos ( 0.159 ) + 1 = 0 ( t ) = 1.013 e 14. 10 27 - + ( 1.283 ) e 1.5 t cos # --------- t 0.524$ ( t ) = ----! " 9 2
0.5 s t
1
rotation - 5.44
2. Draw FBDs for the following mechanical system containing two gears.
Ks1 J 1, R 1 J 2, R 2
y M Ks2 Kd2
rotation - 5.45
3. Draw FBDs for the following mechanical system. Consider both friction cases. Ks1 J,R x Ks1 M s, k
4. Draw FBDs for the following mechanical system. J,R Ks1 J,R y
Ks2
Kd2
5. Develop a differential equation of motion for the system below assuming that the cable always
rotation - 5.46
Ks2
Kd2
6. Analyze the system pictured below assuming the rope remains tight. F J,R F = 10 N M1 Kd1 k=0.2 =45 Ks2 M2 Kd2 M 1 = 1 kg y M 2 = 1 kg R = 0.1 m J = 10 Kgm
2
Ks1
a) Draw FBDs and write the differential equations for the individual masses. b) Combine the equations in input-output form with y as the output and F as the input. d) Write the equations in state variable matrix form. c) Use Runge-Kutta to find the system state after 1 second.
rotation - 5.47
7. Analyze the system pictured below assuming the rope remains tight. J,R F = 10 N M 1 = 1 kg M 2 = 1 kg R = 0.1 m J = 10 Kgm
2
J,R
J,R F y
M1 Ks1 Kd1
M2 Ks2 Kd2
a) Draw FBDs and write the differential equations for the individual masses. b) Combine the equations in input-output form with y as the output and F as the input. c) Write the equations in state variable matrix form. d) Use Runge-Kutta to find the system state after 1 second.
6. INPUT-OUTPUT EQUATIONS
Topics: The differential operator, input-output equations Design case - vibration isolation Objectives: To be able to develop input-output equations for mechanical systems.
6.1 INTRODUCTION
To solve a set of differential equations we have two choices, solve them numerically or symbolically. For a symbolic solution the system of differential equations must be manipulated into a single differential equation. In this chapter we will look at methods for manipulating differential equations into useful forms.
basic definition
d- x = Dx ---dt
n n d ------- = D n dt
1 ---x = D
! x dt
first-order axiom
Figure 6.1
Note:
x + Ax = y ( t ) xD + Ax = y ( t ) e xD + e Ax = e y ( t ) e xD = e y ( t ) e xD = e y ( t ) e x = x = e
At At At At At At At At
xD + Ax = y ( t ) x( D + A) = y( t) y( t) x = ------------D+A
!e
At
y ( t ) dt + C
At
d- at at d - x + ae at x ---( e x ) = e ---dt dt De x = e Dx + ae x
at at at
A t $
% " ! e y ( t ) dt + C#
Figure 6.2
Figure 6.3 contains an example of the manipulation of a differential equation using the D operator. The solution begins by replacing the d/dt terms with the D operator. After this the equation is rearranged to simplify the expression. Notice that the manipulation follows the normal rules of algebra.
Figure 6.3
An example of the solution of a first-order differential equation is given in Figure 6.4. This begins by replacing the differential operator and rearranging the equation. The first-order axiom is then used to obtain the solution. The initial conditions are then used to calculate the coefficient values.
Given,
d---x + 5x = 3t dt Dx + 5 x = 3 t 3t x = -----------D+5 x = e
5 t $ 5t % " ! e 3 tdt + C#
x ( 0 ) = 10 d- 5 t 5 t ---( te e ) dt = 5 te + e e = 5 te
5t 5t 5t 5t
guess,
x = e
5 t $
te e % - + C% 3 $ -------------------" " # # 5
5t
5t
d- 5 t 5 t 5t ---( te e ) = 5 e t dt e te -------------------= 5
5t 5t
!e
5t
t dt
5t
5t
Figure 6.4
e.g.,
2 y1 + y1 + y1 + 4 y 1 = u 1 + u 1 + 3 u 2 + u 3 + u3 y 2 + 6 y 2 + y 2 = u 1 + 3 u 2 + u 2 + 0.5 u 2 + u 3
Figure 6.5
A sample derivation of an input-output equation from a system of differential equations is given in Figure 6.6. This begins by replacing the differential operator and combining the equations to eliminate one of the output variables. The solution ends by rearranging the equation to input-output form.
Given the differential equations, y1 = 3 y1 + 2 y2 + u1 + 2 u 2 y2 = 2 y1 + y2 + u1 Find the input-output equations. (1) Dy 1 = 3 y 1 + 2 y 2 + u 1 + 2 Du 2 y 1 ( D + 3 ) = 2 y 2 + u 1 + 2 Du 2 D +3 ------------% y 2 = y 1 $ " 2 # 0.5 u 1 Du 2 (2) Dy 2 = 2 y 1 + y 2 + Du 1 y 2 ( D 1 ) = 2 y 1 + Du 1
(1) (2)
+3 % $D ------------% $ " y 1 " 2 # 0.5 u 1 Du2# ( D 1 ) = 2 y 1 + Du 1 D + 2D 3 % 2 ---------------------------- 2# 0.5 Du 1 + 0.5 u 1 D u 2 + Du2 = Du 1 y 1 $ " 2 0.5 D y 1 + Dy 1 3.5 y 1 = Du 1 + 0.5 Du 1 0.5 u 1 + D u 2 Du 2 0.5 y 1'' + y 1' 3.5 y 1 = u 1' + 0.5 u1' 0.5 u 1 + u 2' u 2'
2 2 2
Figure 6.6
Find the second equation for the example in Figure 6.6 for the output y2.
Figure 6.7
x1 F M1 Ks M2
x2
& Fx & Fx
= F + Ks ( x2 x1 ) = M1 D x1
2
x1 ( M1 D + K s ) = F + Ks x2 Ks ( x2 x 1 ) M2 = Ks ( x2 x1 ) = M2 D x2
2 2
Ks x1 = x 2 ( M2 D + Ks ) The equations can be combined to eliminate x2. $ Ks x 1 % 2 -( x 1 ( M 1 D + K s ) = F + K s ' -------------------------" M 2 D 2 + K s# x1 ( ( M1 D + K s ) ( M2 D + Ks ) Ks ) = F ( M2 D + Ks ) x1 ( D M1 M2 + D Ks ( M1 + M2 ) + Ks Ks ) = F ( M 2 D + Ks ) x1 ( D M1 M2 + D Ks ( M1 + M2 ) ) = F ( M2 D + Ks ) d-% 2 d-% 4 d-% 2 $ ---x 1 M 1 M 2 + $ ---x 1 K s ( M 1 + M 2 ) = $ ---FM + FK s " dt# " dt# " dt# 2
4 2 2 4 2 2 2 2 2 2 2 2
Figure 6.8
The equation is then converted to state variable form, including a step to calculate a second derivative of the input, as shown in Figure 6.9.
This can then be written in state variable form by creating dummy variables for integrating the function F. d-% $ ---" dt# x 1 = v 1 d-% $ ---v = a1 " dt# 1 d-% $ ---" dt# a 1 = d 1 d-% $ ---" dt# d 1 M 1 M 2 + a 1 K s ( M 1 + M 2 ) = a F M 2 + FK s K s ( M 1 + M 2 )% Ks % 1 -% d% $ -------------$ ---- + aF $ ------ d 1 = a 1 $ ---------------------------------+ F " # " M 1# " M 1 M 2# " dt# M1 M2 The approximate value of the second derivative of a unit time step can be calculated using the time step. 1 a F0 = ----2 T 1a F 1 = ---2 T (when the timestep, step, it is turned on) (after the first timestep) (to verify)
T T T 1 % T $ ----1 1 -+1 -- = 1 - aF = ----- $ ----+ ----- 2% = -x F = ----- a F + ---2 2 2 2 2 2 "T # 2 "T # These equations can then be written in matrix form. x1 d- v 1 ---dt a 1 d1 0 1 0 0 = 0 0 0 1 0 Ks ( M1 + M2 ) 0 0 ---------------------------------M1 M2 0 x 0 0 1 0 0 0 v1 aF + 0 1 0 a1 F Ks 1 ------ -------------0 d 1 M1 M1 M2
Figure 6.9
The solution begins by evaluating the homogeneous equation. x + 3x + 2x = 4F + 5F The solution begins by evaluating the homogeneous equation as normal. x + 3x + 2x = 0 A + 3A + 2 = 0 3 3 4 ( 2 ) = 1, 2 A = -----------------------------------2 t 2t xh = C1 e + C 2 e The particular solution can also be found as normal, assuming F is unit step function. Guess, x = A x = 0 x = 0
2 2
5 A = -2 The derivative in the non-homogeneous solution must now be used to find the initial conditions. However the initial position and velocity are known to be zero. d-% d- % d-% 2 $ ---$ ------x0 + 3 $ x + 2 x = 4 0 0 " dt# " dt F 1# + 5 F 0 " dt# d-% d- % $ ---$ ---x + 3 ( 0 ) + 2 ( 0 ) = 4 0 " dt# " dt 1# + 5 ( 0 ) d-% d- % $ ---$ ---x = 4 0 " dt# " dt 1# d---x = 4 dt 0 Note: This will be used as an initial condition
2 2
0 + 3( 0 ) + 2A = 2 ( 0 ) + 5( 1)
Figure 6.10
The initial conditions can then be used to find the values of the coefficients. It will be assumed that the system starts undeflected and at rest. x ( t ) = C 1 e + C2 e x ( 0 ) = C1e
0 t 2 t
5 + -2 5 - = 0 + -2 5 C 1 = C 2 -2
+ C2e
t 2 t x ( t ) = C1 e 2 C2 e
Figure 6.11
The example in Figure 6.10 is reconsidered with a sinusoidal input in Figure 6.12. In this case the initial acceleration is found to be non-zero. In practical terms, this can be ignored because only the initial position and velocity will be used to find the coefficients.
Assume a sinusoidal input, with the system initially at rest. F ( t ) = sin ( t ) F(0) = 0 F ( t ) = cos ( t ) F(0) = 1
d-% d-% 2 $ ------x + 3$ " dt# x 0 + 2 x 0 = 4 ( F ( 0 ) ) + 5 F ( 0 ) " dt# 0 d-% $ ---" dt# x 0 + 3 ( 0 ) + 2 ( 0 ) = 4 ( 1 ) + 5 ( 0 ) d-% $ ---" dt# x 0 = 4
2 2
This indicates that the acceleration will have an initial value, but it will not affect the initial position or velocity.
Figure 6.12
Kd M
Ks
Aside: An important concept that is ubiquitous yet largely unrecognized is the use of functional design. We look at parts of systems as self contained modules that use inputs to produce outputs. Some systems (such a mechanisms) are reversible, others are not (consider a internal combustion engine, turning the crank does not produce gasoline). An input is typically something we can change, an output is the resulting change in a system. For the example above F over x implies that we are changing the input x, and there is some change in F. We know this could easily be reversed mathematically and practically.
Figure 6.13
Aside: Keep in mind that the mathematical expression F/x is a ratio between input (displacement action) and output (reaction force). When shown with differentials it is obvious that the ratio is not simple, and is a function of time. Also keep in mind that if we were given a force applied to the system it would become the input (action force) and the output would be the displacement (resulting motion). To do this all we need to do is flip the numerators and denominators in the transfer function.
Mass-spring-damper systems are often used when doing vibration analysis and design work. The first stage of such analysis involves finding the actual displacement for a given displacement or force. A system experiencing a sinusoidal oscillating force is given in Figure 6.14. Numerical values are substituted and the homogeneous solution to the equation is found.
Given the component values input force, M = 1 Kg N K s = 2 --m Ns K d = 0.5 ----m F = 5 sin ( 6 t ) N
The differential equation for the mass-spring damper system can be written. 2 N d x - + $ 0.5 Ns -----% dx ----- $ ---% 1 Kg ------2 " # dt + " 2 m# x = 5 sin ( 6 t ) N m dt The homogeneous solution can be determined. 2 d x $ Ns% dx $ N% ------- + 0.5 ----- ------1 Kg 2 " # dt + " 2 m# x = 0 m dt
2 Ns N - $ 0.5 Ns -----% 4 ( 1 Kg ) $ 2 ---% 0.5 ----" " m# m m# A = -----------------------------------------------------------------------------------------2 ( 1 Kg )
cos ( 1.392 t + C2 )
The solution continues in Figure 6.15 where the particular solution is found and put in phase shift form.
The particular solution can now be found with a guess. 2 N d x - + $ 0.5 Ns -----% dx ----- + $ 2 ---% 1 Kg ------2 " # dt " m# x = 5 sin ( 6 t ) N m dt x p = A sin 6 t + B cos 6 t x p' = 6 A cos 6 t 6 B sin 6 t x p'' = 36 A sin 6 t 36 B cos 6 t 36 A sin 6 t 36 B cos 6 t + 0.5 ( 6 A cos 6 t 6 B sin 6 t ) + 2 ( A sin 6 t + B cos 6 t ) = 5 sin ( 6 t ) 34 -B 36 B + 3 A + 2 B = 0 A = ----3 36 A 3 B + 2 A = 5 34 ----- % 34 $ " 3 B# 3 B = 5 34 5 - ( 0.01288 ) = 0.1460 - = 0.01288 A = ----B = ---------------------------3 34 ( 34 ) -------------------3 3 x p = ( 0.1460 ) sin 6 t + ( 0.01288 ) cos 6 t ( 0.1460 ) + ( 0.01288 ) x p = -----------------------------------------------------------------( ( 0.1460 ) sin 6 t + ( 0.01288 ) cos 6 t ) 2 2 ( 0.1460 ) + ( 0.01288 ) x p = 0.1466 ( 0.9961 sin 6 t 0.08788 cos 6 t ) 0.9961-% % $ --------------------x p = 0.1466 sin $ 6 t + atan " " 0.08788# # x p = 0.1466 sin ( 6 t + 1.483 )
2 2
Figure 6.15
The system is assumed to be at rest initially, and this is used to find the constants in the homogeneous solution in Figure 6.16. Finally the displacement of the mass is used to find the force exerted through the spring on the ground. In this case there are two force frequency components at 1.392rad/s and 6rad/s. The steady-state force at 6rad/s will have a magnitude of .2932N. The transient effects have a time constant of 4 seconds (1/0.25), and should be negligible within a few seconds of starting the machine.
The particular and homogeneous solutions can now be combined. x = xh + xp = C1 e x' = 0.25 C 1 e
0.25 t
0.25 t
The initial conditions can be used to find the unknown constants. 0 = C 1 e cos ( 0 + C 2 ) + 0.1466 sin ( 0 + 1.483 ) C 1 cos ( C 2 ) = 0.1460 0.1460 C 1 = ------------------cos ( C 2 ) 0 = 0.25 C 1 e cos ( 0 + C 2 ) 1.392 ( C 1 e sin ( 0 + C 2 ) ) + 6 ( 0.1466 cos ( 0 + 1.483 ) ) 0 = 0.25 C 1 cos ( C 2 ) 1.392 ( C 1 sin ( C 2 ) ) + 0.07713 0.1460 0.1460 % ------------------- cos ( C 2 )% 1.392 $ ------------------0 = 0.25 $ " cos ( C 2 ) # " cos ( C 2 ) sin ( C 2 )# + 0.07713 0 = 0.0365 + ( 0.2032 ) tan ( C 2 ) + 0.07713 0.0365 + 0.07713 -----------------------------------------% = 0.5099 C 2 = atan $ " # 0.2032 0.1460 - = 0.1673 C 1 = -------------------------------cos ( 0.5099 ) x = ( 0.1673 e
0.25 t 0 0 0
The displacement can then be used to calculate the force transmitted to the ground, assuming the spring is massless. F = Ks x N 0.25 t ---% F = $ cos ( 1.392 t 0.5099 ) + 0.1466 sin ( 6 t + 1.483 ) ) m " 2 m# ( 0.1673 e F = ( 0.3346 e
0.25 t
Figure 6.16
A decision has been made to reduce the vibration magnitude transmitted to the ground to 0.1N. This can be done by adding a mass-spring isolator, as shown in Figure 6.17. In the figure the bottom mass-spring-damper combination is the original system. The
mass and spring above have been added to reduce the vibration that will reach the ground. Values must be selected for the mass and spring. The design begins by developing the differential equations for both masses.
Ks2
M2
x2
Kd
Ks1
M1 F Ks2 x2 M2 Kd ( x2 x1 ) Ks 1 ( x2 x1 )
x1
&F
= K s2 x2 K d ( x2 x1 ) K s1 ( x2 x 1 ) = M2 x2
2
K s 2 x 2 K d ( x 2 D x1 D ) K s 1 ( x 2 x 1 ) = M 2 x 2 D
2
(1)
Kd ( x2 x1 ) M1 F
Ks 1 ( x2 x1 )
&F
= Kd ( x2 x1 ) + Ks 1 ( x2 x1 ) F = M1 x1
2
K d ( x2 D x1 D ) + Ks 1 ( x 2 x1 ) F = M1 x1 D
2
x 1 ( K d D K s1 M1 D ) + x2 ( K d D + Ks1 ) = F
(2)
Figure 6.17
For the design we are only interested in the upper spring, as it determines the force on the ground. An input-output equation for that spring is developed in Figure 6.18. The
given values for the mass-spring-damper system are used. In addition a value for the upper mass is selected. This is arbitrarily chosen to be the same as the lower mass. This choice may need to be changed later if the resulting spring constant is not practical.
The solution begins by combining equations (1) and (2) and inserting the.numerical values for the lower mass, spring and damper. We can also limit the problem by selecting a mass value for the upper mass. $ Ks 2 + Kd D + Ks1 + M2 D % 2 x 2 ' ------------------------------------------------------------( ( Kd D Ks1 M1 D ) + x2 ( Kd D + Ks 1 ) = F Kd D + K s1 " # N Ns K s 1 = 2 --K d = 0.5 ----M 1 = 1 Kg M 2 = 1 Kg m m $ K s 2 + 0.5 D + 2 + D % -( ( 0.5 D 2 D 2 ) + x 2 ( 0.5 D + 2 ) = F x 2 ' -----------------------------------------------0.5 D + 2 " # x 2 ( D + 0.5 D + 2 + K s 2 ) ( D 0.5 D 2 ) + x 2 ( 0.5 D + 2 ) = F ( 0.5 D + 2 ) x 2 ( D ( 1 ) + D ( K s 2 ) + D ( 0.5 K s 2 ) + ( 2 K s 2 ) ) = F ( 0.5 D + 2 ) This can now be converted back to a differential equation and combined with the force. d-% 4 d-% 2 d-% d-% $ ---$ ---$ ------$ x + K s 2 " dt# 2 " dt# x 2 0.5 K s 2 " dt# x 2 2 K s 2 x 2 = 0.5 " dt# F + 2 F d-% 4 d-% 2 d-% d-% $ ---x 2 K s 2 x 2 = 0.5 $ ---x + K s 2 $ ---x 0.5 K s 2 $ ---5 sin ( 6 t ) + 2 ( 5 ) sin ( 6 t ) " dt# 2 " dt# 2 " dt# 2 " dt# d-% 2 d-% d-% 4 x 2 K s 2 x 2 = 15 cos ( 6 t ) + 10 sin ( 6 t ) $ ---x + K s 2 $ ---x 0.5 K s 2 $ ---" dt# 2 " dt# 2 " dt# 2 Figure 6.18 Developing an input output equation
4 2 1 2 2 2 2 2
This particular solution of the differential equation will yield the steady-state displacement of the upper mass. This can then be used to find the needed spring coefficient.
The particular solution begins with a guess. d-% 4 d-% 2 $ ---$ d-% x 2 K x = 15 cos ( 6 t ) + 10 sin ( 6 t ) ---$ x + K s 2 " dt# x 2 0.5 K s 2 " ---s2 2 " dt# 2 dt# 2 x p = A sin 6 t + B cos 6 t d-% $ ---" dt# x p = 6 A cos 6 t 6 B sin 6 t d-% 2 $ ---x = 36 A sin 6 t 36 B cos 6 t " dt# p d-% 3 $ ---x = 216 A cos 6 t + 216 B sin 6 t " dt# p d-% 4 $ ---" dt# x p = 1296 A sin 6 t + 1296 B cos 6 t sin ( 6 t ) ( 1296 A 36 AK s 2 + 0.5 K s 2 6 B 2 K s 2 A ) = 10 sin ( 6 t ) A ( 1296 38 K s 2 ) + B ( 3 K s 2 ) = 10 10 + A ( 1296 + 38 K s 2 ) B = ----------------------------------------------------3 Ks2 cos ( 6 t ) ( 1296 B 36 BK s 2 + ( 0.5 ) K s 2 6 A 2 K s 2 B ) = 15 cos ( 6 t ) A ( 3 K s 2 ) + B ( 1296 38 K s 2 ) = 15 10 + A ( 1296 + 38 K s 2 ) - ( 1296 38 K s 2 ) = 15 A ( 3 K s 2 ) + ----------------------------------------------------3 Ks2 A ( 9 K s 2 ) + ( 10 + A ( 1296 + 38 K s 2 ) ) ( 1296 38 K s 2 ) = 45 K s 2 45 K s 2 9 Ks 2 $ % -( + A ( 1296 + 38 K s 2 ) = ----------------------------------------- 10 A ' ----------------------------------------( 1296 38 K s 2 ) " ( 1296 38 K s 2 )# 45 K s 2 ----------------------------------------- 10 ( 1296 38 K s 2 ) A = -------------------------------------------------------------------------------------2 9 Ks 2 ----------------------------------------- + ( 1296 + 38 K s 2 ) ( 1296 38 K s 2 ) 45 K s 2 + 10 ( 1296 + 38 K s 2 ) A = -----------------------------------------------------------------------------------------------------2 9 K s 2 + ( 1296 + 38 K s 2 ) ( 1296 38 K s 2 ) 425 K 2 s + 12960 A = --------------------------------------------------------------------------------2 1453 K 2 s 98496 K 2 s 1679616
2 2
Figure 6.19
The value for B can then be found. 425 K 2 s + 12960 $ % -( ( 1296 + 38 K s 2 ) 10 + ' --------------------------------------------------------------------------------" 1453 K 2 # 2 s 98496 K 2 s 1679616 B = -----------------------------------------------------------------------------------------------------------------------------------------3 Ks 2 10 ( 1453 K 2 s 98496 K 2 s 1679616 ) + ( 425 K 2 s + 12960 ) ( 1296 + 38 K s 2 ) B = ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------2 3 K s 2 ( 1453 K 2 s 98496 K 2 s 1679616 ) 1620 K 2 s + 2.097563 10 K 2 s B = -------------------------------------------------------------------------------------------------2 3 K s 2 ( 1453 K 2 s 98496 K 2 s 1679616 ) 540 K 2 s + 69918768 B = --------------------------------------------------------------------------------2 1453 K 2 s 98496 K 2 s 1679616
2 8 2
Figure 6.20
Finally the magnitude of the particular solution is calculated and set to the desired amplitude of 0.1N. This is then used to calculate the spring coefficient.
amplitude = 0.1 =
A +B
425 K 2 s + 12960 540 K 2 s + 69918768 $ %2 $ %2 ----------------------------------------------------------------------------------------------------------------------------------------------------------------' ( +' ( 2 " 1453 K 2 # " # 98496 K 1679616 98496 K 1679616 1453 K 2s 2s 2s 2s
A value for the spring coefficient was then found using Mathcad to get a value of 662N/m.
Figure 6.21
6.5 SUMMARY
The differential operator can be manipulated algebraically Equations can be manipulated into input-output forms and solved as normal differential equations
2. Find the input-output form for the following equations. y+y+x = 3 x+x+y = 0 3. Find the input-output form for the following equations. x1 + x1 + 2 x1 x2 x2 = 0 x1 x1 + x2 + x2 + x2 = F 4. The following differential equations were converted to the matrix form shown. Use Cramers rule to find an input-output equation for y. F y + 2 x = ----10 7y + 4y + 9x + 3x = 0 Fy = ----10 2 x (7D + 4 ) (9D + 3) 0 (D )
2
(2)
5. Find the input output equation for y2. Ignore the effects of gravity.
Ks1 M1 y1
Ks 2 M2 F y2
6. Find the input-output equations for the systems below. Here the input is the torque on the left hand side. 1 2
Ks 1 B1
J1
Ks2
J2
B2
7. Write the input-output equations for the mechanical system below. The input is force F, and the output is y or the angle theta (give both equations). Include the inertia of both masses, and
M F
8. The applied force F is the input to the system, and the output is the displacement x. K1 = 500 N/m K2 = 1000 N/m M = 10kg
a) Find x(t), given F(t) = 10N for t >= 0 seconds. b) Using numerical methods, find the steady-state response for an applied force of F(t) = 10cos(t + 1) N ? a) Solve the differential equation to find the explicit response for an applied force of F(t) = 10cos(t + 1) N ? d) Set the acceleration to zero and find an approximate solution for an applied force of F(t) = 10cos(t + 1) N. Compare the solution to the previous solutions.
F B -% = ---x + x $ ---" M# M 2. x + 2 x = 3 y + 2y = 3
3. d-% 3 d-% 2 d-% d-% d-% 4 $ ---$ ---$ ---$ ------x + 2$ x + 3 x + + x = x 1 " dt# 1 " dt# 1 " dt# 1 " dt# F + F " dt# 1 d-% 4 d-% 3 d-% 2 d-% d-% 2 d-% $ ---$ ---$ ---$ ---$ ---$ ---x + 2 x + 3 x + x + x = F + 2 " dt# 2 " dt# 2 " dt# 2 " dt# 2 " dt# " dt# F + 2 F 4. F----10 (2)
F2 2 ----(9D + 3) 2 0 ( 9D + 3 ) 10 F ( 0.9 D + 0.3 ) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------y = = 2 = 2 4 2 9 D + 3 D 14 D 8 D (9D + 3) 2(7D + 4) 2 (D ) (2) (7D + 4) (9D + 3) y ( 9 D + 3 D 14 D 8 ) = F ( 0.9 D + 0.3 ) d-% 4 d-% 2 d-% 1 d-% 2 $ ---$ ---$ ---$ ---y ( 9 ) + y ( 3 ) + y ( 14 ) + y ( 8 ) = " dt# " dt# " dt# " dt# F ( 0.9 ) + F ( 0.3 ) d%2 $ 1 % d-% 2 $ 1 d-% 1 $ 14 8 d-% 4 $1 $ --------% + $ -----------% + y $ -----% = $ ---------% y+$ y y " dt# " 3# " dt# " 9 # " 9# " dt# F " 10# + F " 3# " dt# 5. K s 1 K s 2% d-% 4 d-% 2 $ K s 1 M 2 + K s 2 M 2 + K s 2 M 1% $ ---- + y 2 $ ---------------- = y 2 + $ ---y 2 -----------------------------------------------------------" dt# " dt# " # " M1 M2 # M1 M2 M1 % K s 1 + K s 2% d-% 2 $ -------------$ ---- + F $ ---------------------F " dt# " M 1 M 2# " M1 M2 #
4 2 2 2
6. d-% 4 d-% 3 $ J d-% 2 $ J 1 B 2 + J 2 B 1% 1 K s 2 + J 2 K s 2 + B 1 B 2% $ ---$ ---$ ------------------------------- + 2 ---------------------------------------------------+ + " dt# 2 " dt# 2 " # " # " # J1 J2 dt J1 J2 Ks 2 d % $ B 1 K s 2 + B 2 K s 2% $ ---- = --------- 2 ----------------------------------" dt# " # J1 J2 J1 J2 d-% 4 d-% 3 $ J d-% 2 $ J 1 B 2 + J 2 B 1% 1 K s 2 + J 2 K s 2 + B 1 B 2% $ ---- + $ ---- + 1 + $ --- 1 --------------------------- 1 ---------------------------------------------------" dt# " dt# " # " dt# " # J1 J2 J1 J2 B2 % Ks 2 % 1 d-% $ B d-% 2 $ ---d-% $ --------1 K s 2 + B 2 K s 2% $ ---$ -------------------------------------- + $ -------- -% + $ --- = 1 " dt# " # " dt# " J 1# " dt# " J 1 J 2# " J 1 J 2# J1 J2
7. JM R( K( y R )) y
&M
= R( K ( R ) ) + R( K ( y R ) ) = JM
2 2 R K + RKy + R K = J M
R(K(R) )
K( y R ) M F+Mg
&F
= K ( y R ) F Mg = My K ( y + R ) + F + Mg = M yD
2 2
( KR ) + F + Mg = y ( MD K ) ( KR ) + y ( MD + K ) = F Mg
2 2 2
for the theta output equation; $ 2 R K + JM D % -( ( MD 2 + K ) = F Mg ( KR ) + ' -------------------------------- RK " # 2 2 2 2 2 ( K R ) + ( 2 R K + J M D ) ( MD + K ) = FKR + MgKR ( K R + 2 R MKD + 2 R K + J M MD + J M KD ) = FKR + MgKR d-% 4 $ J d-% 4 2 2 2 M M% $ ---- + $ --- ---------- ( 2 R M + J M ) + ( K R ) = FKR + MgKR " dt# " KR # " dt# 3 2 2 2 2 $ K 3 R 3% % K R MgK R d-% 4 d-% 4 $ 2 R K KR $ ---$ --------------------------------------------------------------+ + + ( + ' ( = F " dt# " dt# ' M# JMM JMM " JM " JM M # for the y output equation; $ % RK -( ( KR ) + y ( MD 2 + K ) = F Mg y ' --------------------------------" 2 R2 K + J M D 2# JM D $ 2 2 JM D M 2 % - + K 2 R 2 + ------------ R K( = y ' 2 R MD + -----------------K K " # 2 2 $ 2 JM D % $ 2 JMD % -( Mg ' 2 R + -------------( F ' 2 R + -----------K # K # " " 4 J M 2 J d d M % M% $ ----% y $ ----------- + $ ----% y $ 2 R 2 M + ----- + y ( R2 K ) = " dt# " K # " dt# " K# J M% d-% 2 $ 2 2 $ ---F --------+ F ( 2 R ) + ( 2 MgR ) " dt# " K # 2 $ R 2 K 2% d-% 4 d-% 2 $ 2 KR 1-% $ ------------------+ $ ---+ y y + y ' ------------( = ( " dt# " dt# ' M# " JM M # " JM $ 2 KR 2% $ 2 gKR2% d-% 2 $ 1% $ ----( + ' ------------------- + F ' ----------------( F ----" dt# " M # " JM M # " JM #
4 2 2 2 2 2 2 2 4 2
8. K1 K 2 K2 K2 % ----------------------------% = F $ ----------------------------% + g $ -----------------x + x$ " M ( K 1 + K 2 )# " M ( K 1 + K 2 )# " K 1 + K 2# a) b) c) x ( t ) = 0.2168 cos ( 5.774 t ) + 0.2162 x ( t ) = 0.2168 cos ( 5.774 t ) + 0.02 cos ( t + 1 ) + 0.1962 x ( t ) = 0.02 cos ( t + 1 ) + 0.1962
2. For the system pictured below find the output response as a function of time for y1 and y2 using a) integration to find an explicit function, b) numerical analysis using Scilab or C.
Ks1 M1 y1
Ks 2 M2 F
6.9 REFERENCES
Irwin, J.D., and Graf, E.R., Industrial Noise and Vibration Control, Prentice Hall Publishers, 1979. Close, C.M. and Frederick, D.K., Modeling and Analysis of Dynamic Systems, second edition, John Wiley and Sons, Inc., 1995.
circuits - 7.1
7. ELECTRICAL SYSTEMS
Topics: Basic components; resistors, power sources, capacitors, inductors and op-amps Device impedance Example circuits Objectives: To apply analysis techniques to circuits
7.1 INTRODUCTION
A voltage is a pull or push acting on electrons. The voltage will produce a current when the electrons can flow through a conductor. The more freely the electrons can flow, the lower the resistance of a material. Most electrical components are used to control this flow.
7.2 MODELING
Kirchoffs voltage and current laws are shown in Figure 7.1. The node current law holds true because the current flow in and out of a node must total zero. If the sum of currents was not zero then electrons would be appearing and disappearing at that node, thus violating the law of conservation of matter. The loop voltage law states that the sum of all rises and drops around a loop must total zero.
! Inode = 0 ! Vloop = 0
Figure 7.1
Kirchoffs laws
The simplest form of circuit analysis is for DC circuits, typically only requiring algebraic manipulation. In AC circuit analysis we consider the steady-state response to a
circuits - 7.2
sinusoidal input. Finally the most complex is transient analysis, often requiring integration, or similar techniques. DC (Direct Current) - find the response for a constant input. AC (Alternating Current) - find the steady-state response to an AC input. Transient - find the initial response to changes. There is a wide range of components used in circuits. The simplest components are passive, such as resistors, capacitors and inductors. Active components are capable of changing their behaviors, such as op-amps and transistors. A list of components that will be discussed in this chapter are listed below. resistors - reduce current flow as described with ohms law voltage/current sources - deliver power to a circuit capacitors - pass current based on current flow, these block DC currents inductors - resist changes in current flow, these block high frequencies op-amps - very high gain amplifiers useful in many forms
7.2.1 Resistors
Resistance is a natural phenomenon found in all materials except superconductors. A resistor will oppose current flow as described by ohms law in Figure 7.2. The resistance value is assumed to be linear, but in actuality it varies with conductor temperature.
I + V R V I = -R V = IR
Figure 7.2
Ohms law
The voltage divider example in Figure 7.3 illustrates the methods for analysis of circuits using resistors. In this circuit an input voltage is supplied on the left hand side. The output voltage on the right hand side will be some fraction of the input voltage. If the output resistance is very large, no current will flow, and the ratio of output to input voltages is determined by the ratio of the resistance between R1 and R2. To prove this the cur-
circuits - 7.3
rents into the center node are summed and set equal to zero. The equations are then manipulated to produce the final relationship.
I1 + I2 + I3 = 0 + R1 Vi I2 R2 I3 + Vo I1 V i V o% 0 V o% ---------------- + I 2 + $ -------------$ " R1 # " R2 # = 0 Assume the output resistance is large, so I2 is negligible. Vi V o% $ Vo% ----------------------$ " R1 # + " R2 # = 0 1- ----1-% 1-% $ --------V o $ " R 1 + R 2# = V i " R 1# R 1 + R 2% 1-% - = V i $ ----V o $ ----------------" R 1 R2 # " R 1# Vo R2 - = --------------------Vi R 1 + R2
Figure 7.3
If two resistors are in parallel or series they can be replaced with a single equivalent resistance, as shown in Figure 7.4.
circuits - 7.4
R1 series resistors R eq = R 1 + R 2
R2
parallel resistors R1 R2
Figure 7.4
circuits - 7.5
+ V -
+ V -
V+ -
Figure 7.5
A circuit containing a voltage source and resistors is shown in Figure 7.6. The circuit is analyzed using the node voltage method.
R1 +
Vi
+ -
R2
R3
Vo -
Examining the circuit there are two loops, but only one node, so the node current methods is the most suitable for calculations. The currents into the upper right node, Vo, will be solved.
!I
1 1 1% 1% - + ----- + ----- = V i $ -----V o $ ----" R 1 R 2 R 3# " R 1# R2 R 3 + R1 R 3 + R 1 R2% 1-% - = V i $ -----V o $ ------------------------------------------------" # " R 1# R 1 R2 R 3 R2 R 3 -------------------------------------------------% V o = Vi $ " R 2 R 3 + R1 R 3 + R 1 R2# Figure 7.6 A circuit calculation
Aside: when doing node-current methods, select currents out of a node as positive, and in as negative. This will reduce the chances of careless mistakes.
circuits - 7.6
Evaluate the circuit in Figure 7.6 using the loop voltage method.
R2 R3 -------------------------------------------------% Vo = Vi $ " R 1 R 2 + R 1 R 3 + R 2 R 3#
Figure 7.7
circuits - 7.7
Evaluate the voltage divider in Figure 7.3 using the loop current method. Hint: Put a voltage supply on the left, and an output resistor on the right. Remember that the output resistance should be infinite.
Figure 7.8
Dependant (variable) current and voltage sources are shown in Figure 7.9. The voltage and current values of these supplies are determined by their relationship to some other circuit voltage or current. The dependant voltage source will be accompanied by a + and - symbol, while the current source has an arrow inside.
V = f( ) + -
I = f( )
Figure 7.9
circuits - 7.8
Ii
2ohm
+ V1 -
+ - V =f(V ) 2 1
3ohm
Io
f(V1) = 3V1
Figure 7.10
7.2.3 Capacitors
Capacitors are composed of two isolated metal plates very close together. When a voltage is applied across the capacitor, electrons will be forced into one plate, and forced out of the other plate. Temporarily this creates a small current flow until the plates reach equilibrium. So, any voltage change will result in some current flow. In practical terms this means that the capacitor will block any DC voltages, except for transient effects. But, high frequency AC currents will pass through the device. The equation for a capacitor and schematic symbols are given in Figure 7.11.
circuits - 7.9
Figure 7.11
Capacitors
The symbol on the left is for an electrolytic capacitor. These contain a special fluid that increases the effective capacitance of the device but requires that the positive and negative sides must be observed in the circuit. (Warning: reversing the polarity on an electrolytic capacitor can make them leak, fail and possibly explode.) The other capacitor symbol is for a regular capacitor, normally with values under a microfarad.
Figure 7.12
circuits - 7.10
7.2.4 Inductors
While a capacitor will block a DC current, an inductor will pass it. Inductors are basically coils of wire. When a current flows through the coils, a magnetic field is generated. If the current through the inductor changes then the magnetic field must change, otherwise the field is maintained without effort (i.e., no voltage). Therefore the inductor resists changes in the current. The schematic symbol and relationship for an inductor are shown in Figure 7.13.
+ L V
Figure 7.13
An inductor
An inductor is normally constructed by wrapping wire in loops about a core. The core can be hollow, or be made of ferrite to increase the inductance. Inductors usually cost more than capacitors. In addition, inductors are susceptible to interference when metals or other objects disturb their magnetic fields. When possible, designers normally try to avoid using inductors in circuits.
circuits - 7.11
Figure 7.14
7.2.5 Op-Amps
The ideal model of an op-amp is shown in Figure 7.15. On the left hand side are the inverting and non-inverting inputs. Both of these inputs are assumed to have infinite impedance, and so no current will flow. Op-amp application circuits are designed so that the inverting and non-inverting inputs are driven to the same voltage level. The output of the op-amp is shown on the right. In circuits op-amps are used with feedback to perform standard operations such as those listed below. adders, subtractors, multipliers, and dividers - simple analog math operations amplifiers - increase the amplitude of a signal impedance isolators - hide the resistance of a circuit while passing a voltage
circuits - 7.12
II+
V+ V+ Vo
Figure 7.15
An ideal op-amp
A simple op-amp example is given in Figure 7.16. As expected both of the op-amp input voltages are the same. This is a function of the circuit design. (Note: most op-amp circuits are designed to force both inputs to have the same voltage, so it is normally reasonable to assume they are the same.) The non-inverting input is connected directly to ground, so it will force both of the inputs to 0V. When the currents are summed at the inverting input, an equation including the input and output voltages is obtained. The final equation shows the system is a simple multiplier, or amplifier. The gain of the amplifier is determined by the ratio of the input and feedback resistors.
circuits - 7.13
R2 R1 + Vi + + Vo -
The voltage at the non-inverting input will be 0V, by design the voltage at the inverting input will be the same. V+ = 0 V V- = V+ = 0V The currents at the inverting input can be summed.
! IV-
V- Vi V- Vo - + ---------------- = 0 = --------------R1 R2
Figure 7.16
circuits - 7.14
Figure 7.17
Op-amp example
For ideal op-amp problems the node voltage method is normally the best choice. The equations for the circuit in Figure 7.17 and derived in Figure 7.18. The general approach to this solution is to sum the currents into the inverting and non-inverting input nodes. Notice that the current into the op-amp is assumed to be zero. Both the inverting and non-inverting input voltages are then set to be equal. After that, algebraic manipulation results in a final expression for the op-amp. Notice that if all of the resistor values are the same then the circuit becomes a simple subtractor.
circuits - 7.15
Note: normally node voltage methods work best with op-amp circuits, although others can be used if the non-ideal op-amp model is used. First sum the currents at the inverting and non-inverting op-amp terminals.
! IV+
V+ Vi V + V o - + ----------------- = 0 = ---------------R1 R2 1- ----1 1-% 1-% V + $ ----+ -% = V i $ ----+ V o $ ----" R 1 R 2# " R 1# " R 2# R 1 + R 2% 1-% 1-% $ ----$ --------------------V+ $ " R 1 R 2 # = V i " R 1# + V o " R 2# R2 % R1 % ----------------- + V o $ ----------------V+ = Vi $ " R 1 + R 2# " R 1 + R2# (1)
V - V ref V------------------- + ----- = 0 I = V! R5 R4 1- ----1-% 1-% $ --------V- $ " R 4 + R 5# = V ref " R 5# R4 % ----------------V - = V ref $ " R 4 + R 5# Now the equations can be combined. V- = V+ R4 % R2 % R1 % - = V i $ ----------------- + V o $ ----------------V ref $ ----------------" R 4 + R 5# " R 1 + R 2# " R1 + R 2# R1 % R2 % R4 % - = Vi $ ----------------- V ref $ ----------------V o $ ----------------" R 1 + R 2# " R 1 + R 2# " R 4 + R 5# R 2% R 4 ( R 1 + R 2 )% - V ref $ ----------------------------V o = Vi $ ----" R 1 ( R 4 + R 5 )# " R 1# (3) (2)
Figure 7.18
An op-amp (operational amplifier) has an extremely high gain, typically 100,000 times. The gain is multiplied by the difference between the inverting and non-inverting terminals to form an output. A typical op-amp will work for signals from DC up to about
circuits - 7.16
100KHz. When the op-amp is being used for high frequencies or large gains, the model of the op-amp in Figure 7.19 should be used. This model includes a large resistance between the inverting and non-inverting inputs. The voltage difference drives a dependent voltage source with a large gain. The output resistance will limit the maximum current that the device can produce, normally less than 100mA.
Figure 7.19
7.3 IMPEDANCE
Circuit components can be represented in impedance form as shown in Figure 7.20. When represented this way the circuit solutions can focus on impedances, Z, instead of resistances, R. Notice that the primary difference is that the differential operator has been replaced. In this form we can use impedances as if they are resistances.
Device Resistor
Impedance Z = R 1 Z = ------DC Z = LD
Note: Impedance is like resistance, except that it includes time variant features also. V = ZI
Capacitor Inductor
Figure 7.20
circuits - 7.17
When representing component values with impedances the circuit solution is done as if all circuit components are resistors. An example of this is shown in Figure 7.21. Notice that the two impedances at the right (resistor and capacitor) are equivalent to two resistors in parallel, and the overall circuit is a voltage divider. The impedances are written beside the circuit elements.
50VDC
+ -
Treat the circuit as a voltage divider, R -% $ --------------------" 1 + DCR# R - = 50 V $ ------------------------------------------% Vo = 50 V ----------------------------------------2 " # R D RLC + DL + R ---------------------% DL + $ " 1 + DCR# Figure 7.21 A impedance example for a circuit
circuits - 7.18
Note: The units for various electrical quantities are listed to the right. They may be used to check equations by doing a unit balance.
The circuit in Figure 7.22 could be solved with two loops, or two nodes. An arbitrary decision is made to use the current loop method. The voltages around each loop are summed to provide equations for each loop.
circuits - 7.19
R1
+ V -
L I1
I2 + Vo -
R2
Note: when summing voltages in a loop remember to deal with sources that increase the voltage by flipping the sign. First, sum the voltages around the loops and then eliminate I1.
! VL1
= V + R 1 I 1 + L ( DI 1 DI 2 ) = 0 (1) (2)
! VL2
(3)
(4)
Figure 7.22
Example problem
The equations in Figure 7.22 are manipulated further in Figure 7.23 to develop an input-output equation for the second current loop. This current can be used to find the current through the output resistor R2. The output voltage can then be found by multiplying the R2 and I2.
circuits - 7.20
First, sum the voltages around the loops and then eliminate I1. R2 % $ V - $ ------------------LD -% 1 --------------------( I I 1 = ------------------+" I = 1 + + ' 2 2 R 1 + LD R 1 + LD# LD# 2 " CLD R2 $ V 1 LD -% ------------------- ------------------= ' 1 + -------------+ ------(I 2 R 1 + LD LD R 1 + LD# 2 " CLD
2
Figure 7.23
The equations can also be manipulated into state equations, as shown in Figure 7.24. In this case a dummy variable is required to replace the two first derivatives in the first equation. The dummy variable is used in place of I1, which now becomes an output variable. In the remaining state equations I1 is replaced by q1. In the final matrix form the state equations are in one matrix, and the output variable must be calculated separately.
circuits - 7.21
State equations can also be developed using equations (1) and (3). R 1 I 1 + LI 1 = V + LI 2 (1) becomes LI 1 LI 2 = V R 1 I 1 R1 V - -----I I 1 I 2 = -L L 1 q1 = I1 I2 R1 V - -----I q 1 = -L L 1 I1 = q1 + I2 R1 V - -----(q + I ) q 1 = -L L 1 2 R 1% R 1% V ----- + I 2 $ ----- q1 = q1 $ " L# " L# + L I 2 - + R2 I2 = 0 LI 2 LI 1 + --C I2 - + R2 I2 = 0 V R1 I 1 + --C I2 - = R 2 I2 V R 1 ( q1 + I 2 ) + --C (12) (11)
(10)
(3) becomes
1 ---% I2 = I2 $ " R 1 + C# + q 1 ( R 1 ) + V These can be put in matrix form, R1 R1 ----- ----V q1 q -d- 1 L L ---= + L dt I I 1 2 V - 2 R 1 R1 + --C
(13)
I1 = 1 1
q1 I2
Figure 7.24
circuits - 7.22
Evaluate the circuit in Figure 7.22 using the node voltage method.
Figure 7.25
circuits - 7.23
Vin
Ri + Vout
Figure 7.26
circuits - 7.24
The circuit in Figure 7.27 can be evaluated as a voltage divider when the capacitor is represented as an impedance. In this case the result is a first-order differential equation.
t=0 V s = 3 cos t + -
C R + Vo -
As normal we relate the source voltage to the output voltage. The we find the values for the various terms in the frequency domain. ZR % V o = Vs $ -----------------" Z R + Z C# $ % R ( ' -----------------V o = Vs ' 1 -( " R + ------# DC CRD -% V o = Vs $ --------------------" CRD + 1# V o ( CRD + 1 ) = V s ( CRD ) V o ( CR ) + V o = Vs ( CR ) 1 -% ------= V V o + Vo $ s " CR# where, ZR = R 1Z C = ------DC
Figure 7.27
The first-order differential equation in Figure 7.27 is continued in Figure 7.28 where the equation is integrated. The solution is left in variable form, except for the supply voltage.
circuits - 7.25
1 -% d-% $ ---------V o + Vo $ " CR# = " dt# ( 3 cos t ) = 3 sin t V p = A sin t + B cos t V p' = A cos t B sin t 1 -% ------( A cos t B sin t ) + ( A sin t + B cos t ) $ " CR# = 3 sin t 1 -% = 0 A + B $ ------" CR# 1-% A = B $ ------" CR# 1 -% ------ B + A$ " CR# = 3 1-% $ ------1 -% B + B $ ------= 3 " CR# " CR# 1 % B $ -----------" 2 2 + 1# = 3 C R 2 2 $ 3 C2 R2 % $ 1 % 3 C R 3 CR B = ---------------------( ------- = --------------------A = ' --------------------2 2 2 2 " CR# 2 2 1+C R "1 + C R # 1+C R B 2 2 -% % A + B sin $ t + atan $ -" " A# # The homogeneous and particular solutions can now be combined. The system will be assumed to be at rest initially. Vp = V 0 = Vh + V p = C1 e B 2 2 -% % + A + B sin $ t + atan $ -" " A# # 0 2 2 $B --% % 0 = C 1 e + A + B sin $ " 0 + atan " A# #
t ------CR
Figure 7.28
circuits - 7.26
voltage/current increases
Figure 7.29
The basic equivalent circuit model is shown in Figure 7.30, includes the rotational inertia of the rotor and any attached loads. On the left hand side is the resistance of the motor and the back emf dependent voltage source. On the right hand side the inertia components are shown. The rotational inertia J1 is the motor rotor, and the second inertia is an attached disk.
circuits - 7.27
I Voltage Supply + Vs -
R T, Vm + -
J1
J2
Because a motor is basically wires in a magnetic field, the electron flow (current) in the wire will push against the magnetic field. And, the torque (force) generated will be proportional to the current. Tm T m = KI I = -----K Next, consider the power in the motor, P = V m I = T = KI V m = K Consider the dynamics of the rotating masses by summing moments.
!M
Figure 7.30
These basic equations can be manipulated into the first-order differential equation in Figure 7.31.
The current-voltage relationship for the left hand side of the equation can be written and manipulated to relate voltage and angular velocity. Vs V m I = ----------------R Tm Vs K - = ----------------------R K d% - + T load J $ ---" dt# Vs K ------------------------------------ = ------------------R K d-% K % K-% T load $ -------- = Vs $ -------------- $ + " dt# " JR# J " JR#
2
Figure 7.31
circuits - 7.28
Ls
Rs
Lr
Rr
Lm
IL
RL
1 f R L = --------R f r
Figure 7.32
The torque relationship for AC motors is given in Figure 7.33. These can be combined with the equivalent circuit model to determine the response of the motor to a load.
circuits - 7.29
!M
Vc
Figure 7.33
circuits - 7.30
The basic relationships for brushless DC motors are given in Figure 7.34.
d- % V t = $ R m + ---L I +E " dt # m E = Ke T = Kt Im where, V t = terminal voltage across motor windings R m = resistance of a motor winding L = phase to phase inductance I m = current in winding E = back e.m.f. of motor K e = motor speed constant
= motor speed
Figure 7.34
circuits - 7.31
d- % ---T---R + Vt = $ " m + dt L# K t K e d ! M = T Tload = J ---dt dT = J --- + T load dt where, J = combined moments of inertia for the rotor and external loads T load = the applied torque in the system dJ --- + T load d- % -----------------------------dt - + Ke R m + ---Vt = $ L " Kt dt # JR m d Rm d-% 2 L- ---d- ---- + LJ ----- $ ---- T load + ---V t = -------- + -----T + Ke " # K t dt K t dt Kt K t dt load d-% 2 dd---------( LJ ) $ " dt# + ( JR m ) dt + K e K t = K t V t L dt T load R m T load Kt Vt 1 d Rm d Ke Kt Rm T load d-% 2 $ ---- ---- + ----------- = ---------- ---- T load ------------------ + ----- -" dt# L dt LJ LJ J dt LJ
Figure 7.35
To rotate the motor at a constant velocity the waveform in Figure 7.36 would be applied to each phase. Although each phase would be 120 degrees apart for a three pole motor. A more sophisticated motor controller design would smooth the waves more to approach a sinusoidal shape.
Vt
t(ms)
circuits - 7.32
Figure 7.36
7.6 FILTERS
Filters are useful when processing data signals. Low pass often used to eliminate noise, high pass filters eliminate static signals and leave dynamic signals. Band pass filters reject all frequencies outside a desired frequency band. A low pass filter is shown in Figure 7.37. At high frequencies the capacitor, C, has a very low impedance, and grounds the input signal. At low frequencies the capacitor impedance is high, increasing the gain of the op-amp circuit. This is easier to conceptualize if the R1-C pair are viewed as a voltage divider.
Rf
Ri + R1 + Vi C + Vo -
Figure 7.37
Low-Pass Filter
A high pass filter is shown in Figure 7.38. In this case the voltage divider in the previous circuit is reversed. In this circuit the gain will increase for signals with higher frequencies.
circuits - 7.33
Rf
Ri + C + Vi R + Vo -
Figure 7.38
High-Pass Filter
V2 P = IV = I R = ----R
E = Pt
Figure 7.39
7.8 SUMMARY
Basic circuit components are resistors, capacitors, inductors op-amps. node and loop methods can be used to analyze circuits.
circuits - 7.34
Vi
4. Consider the following circuit. L Vi + C R a) Develop a differential equation for the circuit. b) Put the equation in state variable matrix form. + Vo
circuits - 7.35
5. Develop differential equations and the input-output equation for the electrical system below. R1 Vi + L C R2 -
+ Vo
6. Consider the following circuit. Develop a differential equation for the circuit. L Vi + R1 + R3 Vo
C R2
7. Find the input-output equation for the circuit below, and then find the natural frequency and damping coefficient.
R1 Vi + L R2 C
+ Vo -
8. a) Find the differential equation for the circuit below where the input is Vi, and the output is Vo. L Vi + + C R Vo
circuits - 7.36
c) Solve the differential equation found in part b) using the numerical values given below. Assume at time t=0, the circuit has the voltage Vo and the first derivative shown below. L = 10 mH C = 1F R = 1K V i = 10 V V at t=0s Vo = 2 V V o = 3 -s 9. a) Write the differential equations for the system pictured below. b) Put the equations in input-output form. R2 R1
Vi C
Vo
10. Given the circuit below, find the ratio of the output over the input (this is also known as a transfer function). Simplify the results. R2 Vi R1 +
Vo
circuits - 7.37
11. Examine the following circuit and then derive the differential equation. L R1 + Vi + + Vo R2
12. Examine the following circuit and then derive the differential equation.
L R2 R1 + Vi + + Vo -
13. a) Find the differential equation for the circuit below. 1000 1F 0.001 H 1000 + Vi + 10 + Vo -
circuits - 7.38
b) Put the differential equation in state variable form and a numerical method to produce a detailed sketch of the output voltage Vo. Assume the system starts at rest, and the input is Vi=5V. 14. a) Write the differential equations for the system pictured below. b) Put the equations in state variable form. c) Use numerical methods to find the ratio between input and output voltages for a range of frequencies. The general method is put in a voltage such as Vi=1sin(___t), and see what the magnitude of the output is. Divide the magnitude of the output sine wave by the input magnitude. Note: This should act as a high pass or low pass filter. d) Plot a graph of gain against the frequency of the input. R2 R1
Vo
C parallel = C 1 + C 2
L series = L 1 + L 2
circuits - 7.39
2. Vo ----- = 1 -5 Vi 3. R 1 -% 1 -% $ -----$ -------% Vo + Vo $ " L# + V o " LC# = V i " LC# 4. a) b) ------1 -% 1 -% 1 -% $ -----$ -----V o + Vo $ " RC# + V o " LC# = V i " LC# V o = Xo 1-% 1 1 -% $ -----$ ------------% X o = Xo $ " RC# + V o " LC# + V i " LC# 5. 1 - --------1 -% 1 -% $ --------1 -% $ -----V o + V o $ --------" CR 1 + CR 2# + V o " LC# = V i " CR 1# 6. R2 R2 R 3 % R2 R3 C + L % $ ------------------------------------------------------- + V o $ ------------------------------% = V V o + Vo $ i " LC ( R 2 + R 3 )# " LC ( R2 + R 3 )# " L ( R 2 + R 3 )# 7. a) b) --------1 - --------1 -% 1 -% $ --------1 -% $ -----+ + V = V V o + Vo $ o i " CR 1 CR2# " LC# " CR 1# n = 1-----LC L ( R1 + R2 ) = -----------------------------2 CR 1 R 2
circuits - 7.40
8. (a. Sum currents at node Vo ( Vo Vi ) ( Vo ) - + ( V o ) DC + ---------- = 0 ! IVo = --------------------DL R V o DL 2 - = 0 V o V i + V o D LC + ------------R 1 -% 1 -% 1 -% -----------+ $ -----= Vi $ V o'' + Vo' $ " LC# " CR# V o " LC#
(b.
circuits - 7.41
(c.
L -% + V o = V i V o ( LC ) + V o $ -" R#
particular; Vp = A
guess ( 0 ) + ( 0 ) ( 10 ) + ( A ) ( 10 ) = ( 10 )
3 8 9
A = 10
500 t 500 t V o = 500 C 1 e cos ( 9987 t + C 2 ) 9987 C 1 e sin ( 9987 t + C 2 ) for t=0, d/dt Vo=3V 3 = 500 C 1 cos ( C 2 ) 9987 C 1 sin ( C 2 ) 3 = 500 C 1 cos ( C 2 ) 9987 C 1 sin ( C 2 ) 8 -% 3 = 4000 9987 $ ------------------sin ( C 2 ) " cos ( C 2 )# sin ( C 2 ) 3997 - = tan ( C 2 ) ------------------- = ------------------C 2 = 0.050 cos ( C 2 ) 8 ( 9987 ) 8 C 1 = ------------------= 8.01 cos ( C 2 ) V o = 8.01 e
500 t
circuits - 7.42
9. a) b) R 1% - = 0 V i + V i ( R 1 C ) + Vo $ ----" R 2# R 2% Vo = V i ( CR 2 ) + Vi $ -------" R1 #
10. Vo R2 ----- = --------------------------------Vi R 1 + DR 1 R 2 C 11. R 2% L -% + V i $ -------V o = Vi $ ----" R 1# " R1 # 12. R 2% R 2% $ - = V -------V o + Vo $ ----i " R -# " L# 1 13. (a. Create a node between the inductor and resistor Va, and use the node voltage method ( VA Vi ) ( VA V ) - + ------------------------- = 0 I = ! VA --------------------0.001 D 1000 1000000 ( V A V i ) + V A D = 0 1000000 -% -----------------------------VA = Vi $ " 1000000 + D# V = V
+
= 0V
XXXXADD UNITSXXXXX
! IV
( V VA ) ( V Vo ) - + ------------------------ + ( V V o ) ( 0.000001 D ) = 0 = ------------------------1000 1000 Vo ) ( 1 ) 1000000 -% ( ----------- V i $ ------------------------------------------ + ( V o ) ( 0.000001 D ) = 0 + 1000 " 1000000 + D# 1000 1000000 -% V o ( 1 0.001 D ) = V i $ -----------------------------" 1000000 + D#
circuits - 7.43
(b.
d ---V = Vo dt o
14. a) b) c) R 2% V o = Vi ( CR 2 ) + V i $ -------" R1 # Not a state equation assume Vi=1sin(wt) Vo = d) 1 -% % 2 2 $ --------------1 + ( 1000 ) sin $ " t + atan " 1000 # #
circuits - 7.44
R1 + Vi -
4. Develop the differential equation(s) for the system below, and use them to find the response to the following inputs. Assume that the circuit is off initially. R3 + Vi R1=R2=R3=R4=1Kohm C=1uF a) V i = 5 sin ( 100 t ) b) c) V i = 5 sin ( 1000000 t ) Vi = 5 + R4 C Vo
R1 R2
circuits - 7.45
C2
Vo
6. Study the circuit below. Assume that for t<0s the circuit is discharged and off. Starting at t=0s an input of Vi=5sin(100,000t) is applied.
1K Vi + 1uF + Vo a) Write a differential equation and then a transfer function describing the circuit. b) Find the output of the circuit using explicit integration (i.e., homogeneous and particular solutions).
Topics: Transfer functions, block diagrams and simplification Feedback controllers Control system design
Objectives: To be able to represent a control system with block diagrams. To be able to select controller parameters to meet design objectives.
8.1 INTRODUCTION
Every engineered component has some function. A function can be described as a transformation of inputs to outputs. For example it could be an amplifier that accepts a signal from a sensor and amplifies it. Or, consider a mechanical gear box with an input and output shaft. A manual transmission has an input shaft from the motor and from the shifter. When analyzing systems we will often use transfer functions that describe a system as a ratio of output to input.
Figure 8.1
If both sides of the example were inverted then the output would become F, and the input x. This ability to invert a transfer function is called reversibility. In reality many systems are not reversible. There is a direct relationship between transfer functions and differential equations. This is shown for the second-order differential equation in Figure 8.2. The homogeneous equation (the left hand side) ends up as the denominator of the transfer function. The nonhomogeneous solution ends up as the numerator of the expression.
particular homogeneous
Natural frequency of system - Approximate frequency of control system oscillations. Damping factor of system - If < 1 then underdamped, and the system will oscillate. If =1 critically damped. If < 1 overdamped, and never any oscillation (more like a first-order system). As damping factor approaches 0, the first peak becomes infinite in height.
Figure 8.2
The relationship between transfer functions and differential equations for a mass-spring-damper example
The transfer function for a first-order differential equation is shown in Figure 8.3. As before the homogeneous and non-homogeneous parts of the equation becomes the denominator and the numerator of the transfer function.
Figure 8.3
Control variable INPUT (e.g. gas) SYSTEM (e.g. a car) OUTPUT (e.g. velocity)
vdesired + _
verror
control function
gas
car
vactual
Note: The arrows in the diagram indicate directions so that outputs and inputs are unambiguous. Each block in the diagram represents a transfer function.
Figure 8.4
There are two main types of feedback control systems: negative feedback and positive feedback. In a positive feedback control system the setpoint and output values are added. In a negative feedback control the setpoint and output values are subtracted. As a rule negative feedback systems are more stable than positive feedback systems. Negative feedback also makes systems more immune to random variations in component values and inputs. The control function in Figure 8.4 can be defined many ways. A possible set of rules for controlling the system is given in Figure 8.5. Recall that the system error is the difference between the setpoint and actual output. When the system output matches the setpoint the error is zero. Larger differences between the setpoint and output will result in larger errors. For example if the desired velocity is 50mph and the actual velocity 60mph, the error is -10mph, and the car should be slowed down. The rules in the figure give a general idea of how a control function might work for a cruise control system.
Human rules to control car (also like expert system/fuzzy logic): 1. If verror is not zero, and has been positive/negative for a while, increase/decrease gas 2. If verror is very big/small increase/decrease gas 3. If verror is near zero, keep gas the same 4. If verror suddenly becomes bigger/smaller, then increase/decrease gas. 5. etc. Figure 8.5 Example control rules
In following sections we will examine mathematical control functions that are easy to implement in actual control systems.
Figure 8.7 shows a basic PID controller in block diagram form. In this case the potentiometer on the left is used as a voltage divider, providing a setpoint voltage. At the output the motor shaft drives a potentiometer, also used as a voltage divider. The voltages from the setpoint and output are subtracted at the summation block to calculate the feedback error. The resulting error is used in the PID function. In the proportional branch the error is multiplied by a constant, to provide a longterm output for the motor (a ballpark guess). If an error is largely positive or negative for a while the integral branch value will become large and push the system towards zero. When there is a sudden change occurs in the error value the differential branch will give a quick response. The results of all three branches are added together in the second summation block. This result is then amplified to drive the motor. The overall performance of the system can be changed by adjusting the gains in the three branches of the PID function.
Figure 8.7
There are other variations on the basic PID controller shown in Figure 8.8. A PI controller results when the derivative gain is set to zero. (Recall the second order response.) This controller is generally good for eliminating long term errors, but it is prone to overshoot. In a P controller only the proportional gain in non-zero. This controller will generally work, but often cannot eliminate errors. The PD controller does not deal with longterm errors, but is very responsive to system changes.
For a PI Controller gas = K p v error + K i % v error dt For a P Controller gas = K p v error For a PD Controller dv error$ gas = K p v error + K d # --------------! dt "
Figure 8.8
Aside: The manual process for tuning a PID controlled is to set all gains to zero. The proportional gain is then adjusted until the system is responding to input changes without excessive overshoot. After that the integral gain is increased until the longterm errors disappear. The differential gain will be increased last to make the system respond faster.
c + -
G( D)
r is equal to
H( D)
Figure 8.9
Other block diagram equivalencies are shown in Figure 8.10 to Figure 8.16. In all cases these operations are reversible. Proofs are provided, except for the cases where the equivalence is obvious.
c + +
G( D)
r is equal to
H( D)
Figure 8.10
G( D)
1 ------------G( D)
Figure 8.11
G( D)
r is equal to
G( D) G( D)
Figure 8.12
G( D)
H( D)
is equal to
G(D )H(D)
Figure 8.13
G( D)
G( D) 1 ------------G( D) c
is equal to c
Figure 8.14
G( D)
c is equal to
G( D)
1 ------------G( D)
Figure 8.15
G( D)
r is equal to
G(D)
r = G ( D ) ( c d ) r = cG ( D ) dG ( D )
G( D)
Figure 8.16
Recall the example of a cruise control system for an automobile presented in Figure 8.4. This example is extended in Figure 8.17 to include mathematical models for each of the function blocks. This block diagram is first simplified by multiplying the blocks in sequence. The feedback loop is then reduced to a single block. Notice that the feedback line doesnt have a function block on it, so by default the function is 1 - everything that goes in, comes out.
e.g. The block diagram of the car speed control system vdesired + verror
Ki - + Kd D K p + ---D
gas
10
1-------MD
vactual
vdesired + -
verror
Ki - + Kd D K p + ---D
gas
10-------MD
vactual
vdesired
10-$ i #K + K $ # ----------! p D + K d D" ! MD" -------------------------------------------------------------------------Ki 10-$ ---- + K d D$ # -------+ 1+# K p ! " ! MD" ( 1 ) D
vactual
Figure 8.17
The function block is further simplified in Figure 8.18 to a final transfer function for the whole system.
vdesired
i # #K + K $ $ ---& ! p D + K d D" ' & -------------------------------------------------------' Ki & Ms # ' ------ + K d D$ " + K + ! 10 ! p ---" D
vactual
vdesired
vactual
# $ 2 v actual & D ( K d ) + D ( Kp ) + ( Ki ) ' ---------------- = & ----------------------------------------------------------------------' v desired M & D 2 # ----- + K $ + D ( K p ) + ( K i )' ! ! 10 " d"
Figure 8.18
2.2K Computer Running Labview PCI-1200 data acquisition card from National Instruments gain Kp 1K + LM675 op-amp shafts are coupled 12Vdc motor
-5V
Figure 8.19
The feedback controller can be represented with the block diagram in Figure 8.20.
gain Kp
op-amp
motor
shaft
potentiometer
Figure 8.20
The transfer functions for each of the blocks are developed in Figure 8.21. Two of the values must be provided by the system user. The op-amp is basically an inverting amplifier with a fixed gain of -2.2 times. The potentiometer is connected as a voltage divider and the equation relates angle to voltage. Finally the velocity of the shaft is integrated to give position.
Given or selected values: - desired potentiometer voltage Vd - gain K For the op-amp: V+ Vi V + V o - + ----------------- = 0 I = ( V+ ---------------1K 2.2 K V+ = V- = 0 V
Vi V o ------- + ----------- = 0 1 K 2.2 K Vo ----- = 2.2 Vi For the potentiometer assume that the potentiometer has a range of 10 turns and 0 degrees is in the center of motion. So there are 5 turns in the negative and positive direction. $ -------------Vo = 5 V # ! 5 ( 2 )" Vo ----- = 0.159 Vrad 1 For the shaft, it integrates the angular velocity into position: d = --- dt 1 --- = -- D
Figure 8.21
Transfer functions for the power amplifier, potentiometer and motor shaft
The basic equation for the motor is derived in Figure 8.22 using experimental data. In this case the motor was tested with the full inertia on the shaft, so there is no need to calculate J.
For the motor use the differential equation and the speed curve when Vs=10V is applied: 1400 RPM d-$ K $ K-$ # ---- = # ---- + # ----V ! dt" ! JR" ! JR" s 1s 2s 3s
2
For steady-state d-$ 1 # --- = 0 = 1400 RPM = 146.6 rads ! dt" 2 K -$ K-$ 0 + # ----146.6 = # ----10 ! JR" ! JR" K = 0.0682
0.8 s 1s 1 K -$ # ----= -! JR" 1K-$ ------------0.0682 # ! JR" = 0.8 s K----= 18.328 JR 1D + ----- = 18.33 V s 0.8 18.33 ---- = -------------------Vs D + 1.25
2
Figure 8.22
The individual transfer functions for the system are put into the system block diagram in Figure 8.23. The block diagram is then simplified for the entire system to a single transfer function relating the desired voltage (setpoint) to the angular position (output). The transfer function contains the unknown gain value Kp.
Vd
+ -
Kp
-2.2
1 --D
0.159
Vd
+ -
0.159 Vd 40.33 Kp ----------------------------( D + 1.25 ) D --------------------------------------------------------- 40.33 Kp 1 + ( 0.159 ) ----------------------------( D + 1.25 ) D 40.33 Kp --------------------------------------------------------( D + 1.25 ) D 6.412 Kp 40.33 Kp -----------------------------------------------------2 D + 1.25 D 6.412 Kp
Vd
Vd
Figure 8.23
The value of Kp can be selected to tune the system performance. In Figure 8.24 the gain value is calculated to give the system an overall damping factor of 1.0, or critically damped. This is done by recognizing that the bottom (homogeneous) part of the transfer function is second-order and then extracting the damping factor and natural frequency. The final result of Kp is negative, but this makes sense when the negative gain on the op-amp is considered.
We have specified, or been given the damping coefficient as a design objective. = 1.0 The denominator of the system transfer function can be compared to the standard second-order response. D + 1.25 D 6.412 K p = x'' + 2 n x' + n x 1.25 = 2 n 1.25 = 2 ( 1.0 ) n n = 0.625 6.412 K p = n 6.412 K p = 0.625 K p = 0.0609
2 2 2 2
Figure 8.24
Calculating a gain Kp
c + b
e G
r System error, S = cr
Feedback error, H
e = cb
Figure 8.25
Controller errors
An example of calculating these errors is shown in Figure 8.26. The system is a simple integrator, with a unity feedback loop. The overall transfer function for the system is calculated and then used to find the system response. The response is then compared to the input to find the system error. In this case the error will go to zero as time approaches infinity.
Given,
Kp G ( D ) = ----D
H( D) = 1
C2 = A
The solutions can be combined and the remaining unknown found for the system at rest initially. r = rh + r p = C 1 e 0 = C1e + A C1 = A r = A e
Kp t 0 Kp t
+A
+A
+ A ) = Ae
Kp t
c = At
Figure 8.27
Find the system error e for the given ramp input, R. 1 G ( D ) = ----------------------------2 D + 4D + 5 H(D) = 5 c = 4t
Figure 8.28
Type
Transfer Function
Gc = K 1 -$ -----Gc = K # 1 + ! D" Gc = K ( 1 + D ) 1$ -----Gc = K # ! 1 + D + D" 1 + D$ -------------------Gc = K # ! 1 + D " 1 + D $ -------------------Gc = K # ! 1 + D" >1 >1 >1 1 > 2
Figure 8.29
process
Figure 8.30
d---X = AX + BU dt Y = CX + D + B + d---X dt X C + + Y
1 --D
Figure 8.31
An example is shown in Figure 8.32 that implements a second order state equation. The system uses two integrators to integrate the angular acceleration, then the angular velocity, to get the position.
d--- = dt
+ C +
d--- dt +
1 --D A
d--- dt
1 --D
d--- = A + B + C dt
Figure 8.32
The previous block diagrams are useful for simulating systems. These can then be used in feedforward control systems to estimate system performance and then predict a useful output value.
The model, 2 K K-$ # -$ = V s # ---- + ! ----" ! JR JR" JR -$ + ( K ) V s = # ----! K" A d--- dt + + K State Based Controller JR ----K
+ -
Ki - + DK d K P + ---D Feedback
Plant
Figure 8.33
Gc1
Gc2
Gp1
Gp2
Figure 8.34
A cascade controller
8.4 SUMMARY
Transfer functions can be used to model the ratio of input to output. Block diagrams can be used to describe and simplify systems. Controllers can be designed to meet criteria, such as damping ratio and natural frequency. System errors can be used to determine the long term stability and accuracy of a controlled system. Other control types are possible for more advanced systems.
F M B
2. Develop a transfer function for the system below. The input is the force F and the output is the voltage Vo. The mass is suspended by a spring and a damper. When the spring is undeflected y=0. The height is measured with an ultrasonic proximity sensor. When y = 0, the output Vo=0V. If y=20cm then Vo=2V and if y=-20cm then Vo=-2V. Neglect gravity. N K s = 10 --m sK d = 5 N --m M = 0.5 Kg
Ks
Kd
3. Find the transfer functions for the systems below. Here the input is a torque, and the output is the angle of the second mass. 1 2
Ks 1 B1
J1
Ks2
J2
B2
4. Find the transfer functions for the system below where Vi is the input and Vo is the output. C + Vi R1 R2 L + Vo -
5. Given the transfer function, G(s), determine the time response output Y(t) to a step input X(t). 4 Y G = -----------= -X ( t ) = 20 When t >= 0 D+2 X 6. Given the transfer function below, develop a mechanical system that it could represent. (Hint: Differential Equations). x(D) 1 ------------ = ---------------------F(D ) 10 + 20 D where: x = displacement F = force
7. Given a mass supported by a spring and damper, find the displacement of the supported mass over time if it is released from neutral at t=0sec, and gravity pulls it downward. a) develop a transfer function for y/F. b) find the input function F. c) solve the input output equation to find an explicit equation of the position as a function of time for Ks = 10N/m, Kd = 5Ns/m, M=10kg. d) solve part c) numerically. 8. a) What is a Setpoint, and what is it used for? b) What does feedback do in control systems? 9. The block diagram below is for a servo motor position control system. The system uses a proportional controller. a) Draw a sketch of what the actual system might look like. Identify components. d Vd V 2 -------rad + Va V2 -------rad Ve K Vm 10 - rad ------------------D + 1 sV 1 --D a
A x + B + C + + y
11. Simplify the block diagram below. (Note: Vn is an input and cannot be combined in a transfer function.) + Vi Vn A + + C Vo
12. a) Develop an equation for the system below relating the two inputs to the output. Put it in block diagram format. (Hint: think of a summation block.)
R Vf R Vd R + -
R Ve
b) Develop an equation for the system below relating the input to the output. Put
1K 1K Ve RP +
1K Vs
c) The equation below can be used to model a permanent magnet DC motor with an applied torque. An equivalent block diagram is given. Prove that the block diagram is equivalent to the equation. K m $ T load # Km $ d-$ # ----' = V s # ------------ ---------- + & -----------! dt" ! J R R M" JR ! J R R M" Vs Km -----RM + e RM --------------------------------2 JR RM D + Km T load d) Write the transfer function for the system below relating the input torque to the output angle theta2. Then write the transfer function for the angular velocity of mass 2. 1 2
2
Ks 1
J1
Ks2 B
J2
for velocity feedback. Simplify the block diagram. Vd + 2 RP -------------------3 R P + 10 Km -----RM + RM ---------------------------------2 JM RM D + Km
Ks 2 ----------------------------------------------------------------------------------------------------------------------3 2 D ( J 1 J 2 ) + D ( BJ 1 ) + D ( Ks 2 ( J 1 + J 2 ) ) + ( BK s 2 ) KT
13. Find the system output, feedback error and system error when the input is a ramp with the function c(t) = 0.5t. Sketch the system errors as a function of time. C(D) + 5 ---------------------D( D + 1) R( D)
1 + 0.2 D
14. Given the block diagram below, select a system gain K that will give the overall system a damping ratio of 0.7 (for a step input). What is the resulting damped frequency of the system? + K 2 ----------------------------2 D + 3D + 2
15. The following system is a feedback controller for an elevator. It uses a desired height d provided by a user, and the actual height of the elevator h. The difference between these two is called the error e. The PID controller will examine the value e and then control the speed of the lift motor with a control voltage c. The elevator and controller are described with transfer functions, as shown below. all of these equations can be combined into a single system transfer
h 10 -- = ---------------2 r D +D
elevator
10 10 ( D + 1 ) r h 2 D + 1 + D - ---------------10 ( D + 1 ) - ---------------------#-$ # h --$ -----------------------------= -------------------= -----------------------2 2 ! e" ! r " = e = D D ( D + 1 ) D D D +D h 10 ( D + 1 ) eliminate e ----------= -----------------------2 dh D 10 ( D + 1 )$ h = # -----------------------(d h) 2 ! " D 10 ( D + 1 )$ 10 ( D + 1 )$ = # -----------------------(d) h # 1 + -----------------------2 2 ! " ! " D D 10 ( D + 1 ) $ # -----------------------& ' 2 h D 10 D + 10 & system transfer function -- = ---------------------------------' = ----------------------------------2 & ' 10 ( D + 1 ) d D + 10 D + 10 -----------------------&1 + ' 2 ! " D a) Find the response of the final equation to a step input. The system starts at rest on the ground floor, and the input (desired height) changes to 20 as a step input. b) Calculate the damping coefficient and natural frequency of the results in part a). 16. Study the circuit below. Assume that for t<0s the circuit is discharged and off. Starting at t=0s an input of Vi=5sin(100,000t) is applied.
1K Vi + 1uF + Vo a) Write a differential equation and then a transfer function describing the circuit. b) Find the output of the circuit using explicit integration (i.e., homogeneous and particular solutions). 17. Write a C subroutine to implement the control system that is shown inside the dashed line. The subroutine arguments are the setpoint, C, and the feedback value, F. the subroutine returns the
5D + C + 5 F e Kp + U 1-----5D R
2. V V -$ -$ 10 # --10 # --! " ! Vo y Vo m m" ----- = ----- -- = --------------------------------------------- = -------------------------------------------------------------2 F yF 2 Ns N MD K d D K s - D 10 -- 0.5 kgD 5 ----m m 3. 2 Ks 2 ---- = -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------4 3 2 D ( J1 J2 ) + D ( B 1 J2 + B 2 J 1 ) + D ( Ks 2 ( J1 + J2 ) + B1 B 2 ) + D ( K s 2 ( B 1 + B 2 ) ) 4. Vo D ( R 1 R2 C ) ----- = -------------------------------------------------------------------------------------------------2 Vi D ( R 1 LC ) + D ( L + CR 1 R 2 ) + ( R 1 + R2 )
5. y ( t ) = 40 e 6.
2 t
+ 40
N K s = 10 --m F Ns K d = 20 ----m
7. a) b) c) d) y 1 -- = ----------------------------------------2 F D M + DK d + K s F = Mg y ( t ) = 10.13 e
0.25 t
8. a) A setpoint is a system input that correlates to a desired output for a system with negative feedback control. b) Feedback in a control system allows an out to be compared to an input. The difference, the error, is used to adjust the control variable and increase the accuracy.
9. a) 20 K --------------------------------2 D + D + 20 K
b)
11.
Vn
1 -A + + Vo CA -----------1+A
Vi
b)
V- 0 V- V s - + ---------------- = 0 I = V ( - ------------3 3 10 10 V - = 0.5 V s V + V e V+ 0 - + -------------- = 0 = I V ( + ----------------3 R P 10 Ve 1 1-$ # - + ----------V+ ------= 3 ! 3 R P" 10 10 substitute in (1) Ve # R P + 1 K$ -' = ------0.5 V s & ------------------3 ! R P ( 103 )" 10 Vs 2 RP ----= -------------------3 Ve R P + 10 (1)
Ve
2 RP -------------------3 R P + 10
Vs
c)
K m $ T load # Km $ d-$ # ----' = V s # ------------ ---------- + & -----------! J R R M" ! dt" JR ! J R R M" Km $ K m $ T load # -' = V s # ------------ ---------- & D + -----------! J R R M" J R R M" JR ! JR M K m $ T load$ # $ - -----------' # V s # ----------- = & --------------------------------JR " ! J R R M D + K m 2" ! ! J R R M" K m$ RM # $ -' # V s # ------ T load$ = & --------------------------------2 ! !R " " ! JR RM D + Km " M
2
d) J1 Ks 2 ( 1 2 ) +
(M
= Ks2 ( 1 2 ) = J1 1 D
2
K s 2 ( 1 2 ) = J1 1 D
2
1 ( J1 D + K s2 ) + 2 ( Ks 2 ) = Ks 2 ( 1 2 ) + J2 B 2 D
(1)
2
(M
= Ks 2 ( 1 2 ) B 2 D = J2 2 D
2
Ks 2 ( 1 2 ) B 2 D = J 2 2 D
2
(2)
# J 2 D + BD + K s 2$ 2 2 & ----------------------------------------' ( J1 D + K s2 ) + 2 ( Ks 2 ) = Ks2 ! " # D ( J 1 J 2 ) + D ( BJ 1 ) + D ( K s 2 ( J 1 + J 2 ) ) + D ( BK s 2 )$ -' = 2 & -----------------------------------------------------------------------------------------------------------------------------Ks 2 ! " 2 Ks 2 ---- = -----------------------------------------------------------------------------------------------------------------------------4 3 2 D ( J 1 J 2 ) + D ( BJ 1 ) + D ( K s 2 ( J 1 + J 2 ) ) + D ( BK s 2 ) 2 = D 2 Ks 2 2 ----- = ----------------------------------------------------------------------------------------------------------------------3 2 D ( J 1 J 2 ) + D ( BJ 1 ) + D ( K s 2 ( J 1 + J 2 ) ) + ( BK s 2 )
4 3 2
e)
D ( ) + D ( ) + D( ) + ( ) ----= -----------------------------------------------------------------------------------------4 3 2 Vd D ( ) + D ( ) + D ( ) + D( ) + ( )
13. 15 1t $ 1 ---------- ---R ( t ) = 0.224 e cos # ! 2 t 0.464" 5 + 2 t 15 t $ 1 ---------S ( t ) = 0.224 e cos # ! 2 t 0.464" 5 15 1t $ ------------e ( t ) = 0.112 e cos # ! 2 t 0.464" + 10 14. rad d = 1.530 -------s 15. a) b) h ( t ) = 2.91 e = 1.58
8.873 t
K = 1.30
22.91 e
1.127 t
+ 20
b)
17.
int controller(){ }
Vo
2. Given the transfer functions and input functions, F, use a numerical method to calculate the output of the system as a function of time for 0 to 0.5 seconds in 0.05 second intervals. Record the values in a table. x D -- = ----------------------------2 F ( D + 200 ) x D ( D + 2 )-- = ----------------------------2 F ( D + 200 ) x D (D + 2 ) -- = ----------------------------2 F ( D + 200 ) 3. Simplify the following block diagram. + 1 -----------D+2 1 -----------D+1
2 2
8. Simplify the following block diagram for a crane gantry position control system. The system also includes a negative feedback loop to control the sway of an attached load encoder Cp K enc C pc K pp + + C Lc K sp CL K AD K pwm Vs G motor VL L p
Cd
C pe
K pot
G load
9. Write a C subroutine to implement the control system that is shown inside the dashed line. The subroutine arguments are the setpoint, C, and the feedback value, F. the subroutine returns the new controller output value, U. C + Ki ---D 5 F e Kp + KdD U 1 -------------------2 (D + 1) R
10. Write a C subroutine to implement the control system that is shown inside the dashed line. The subroutine arguments are the setpoint, C, and the feedback value, F. the subroutine returns the
9. PHASOR ANALYSIS
Topics: Phasor forms for steady state analysis Complex and polar calculation of steady state system responses Vibration analysis Objectives: To be able to analyze steady state responses using the phasor transform
9.1 INTRODUCTION
When a system is stimulated by an input it will respond. Initially there is a substantial transient response, that is eventually replaced by a steady state response. Techniques for finding the combined steady state and transient responses were covered in earlier chapters. These include the integration of differential equations, and numerical solutions. Phasor analysis can be used to find the steady state response only. These techniques involve using the phasor transform on the system transfer function, input and output.
D = + j
Figure 9.1
An example of the phasor transform is given in Figure 9.2. We start with a transfer function for a mass-spring-damper system. In this example numerical values are assumed to put the equation in a numerical form. The differential operator is replaced with j, and the equation is simplified to a complex number in the denominator. This equation then described the overall response of the system to an input based upon the frequency of the input. A generic form of sinusoidal input for the system is defined, and also converted to phasor (complex) form. (Note: the frequency of the input does not show up in the complex form of the input, but it will be used later.) The steady state response of the system is then obtained by multiplying the transfer function by the input, to obtain the output.
A phasor transform can be applied to a transfer function for a mass-spring-damper system. Some component values are assumed. N Ns K s = 2000 --K d = 3000 ----M = 1000 kg m m 1 x(D ) 1 - = ---------------------------------------------------------------------- = ----------------------------------------2 2 F( D) 1000 D + 3000 D + 2000 MD + K d D + K s x( ) 1 1 ------------ = ---------------------------------------------------------------------= ----------------------------------------------------------------2 2 2 F( ) 1000 j + 3000 j + 2000 ( 2000 1000 ) + j ( 3000 ) A given input function can also be converted to phasor form. F ( t ) = A sin ( input t + input ) F ( ) = A ( cos input + j sin input ) F ( ) = A cos input + jA sin input Note: the frequency is not used when converting an oscillating signal to complex form. But it is needed for the transfer function.
The response of the steady state output x can now be found for the given input. x( ) 1 - ( A cos input + jA sin input ) x ( ) = ------------ F ( ) = ---------------------------------------------------------------------2 F( ) ( 2000 1000 ) + j ( 3000 )
Figure 9.2
To continue the example in Figure 9.2 values for the sinusoidal input force are assumed. After this the method only requires the simplification of the complex expression. In particular having a complex denominator makes analysis difficult and is undesirable. To simplify this expression it is multiplied by the complex conjugate. After this, the expression is quickly reduced to a simple complex number. The complex number is then converted to polar form, and then finally back into a function of time.
These can be applied to find the steady state output response, 1 - ( 10 cos 0.5 + j 10 sin 0.5 ) x ( ) = -----------------------------------------------------------------------------------------2 ( 2000 1000 ( 100 ) ) + j ( 3000 ( 100 ) ) 1 - ( 8.776 + j 4.794 ) x ( ) = ----------------------------------------------------------( 9998000 ) + j ( 300000 ) 8.776 + j 4.794 ( 9998000 j 300000 ) x ( ) = --------------------------------------------------- ------------------------------------------------------ 9998000 + j 300000 ( 9998000 j 300000 ) Note: This is known as the complex conjugate; 1. The value is equivalent to 1 so it does not change the value of the expression 2. The complex component is now negative 3. Only the denominator is used top and bottom ( 86304248 ) + j ( 50563212 ) x ( ) = ----------------------------------------------------------------------14 1.0005 10 x ( ) = ( 0.863 10 ) + j ( 0.505 10 ) x( ) = % 0.505 10-6& -6 2 -6 2 -$ + ( 0.863 10 ) + ( 0.505 10 ) atan # ----------------------------! 0.863 10-6"
-6 -6
Note: the signs of the components indicate that the angle is in the bottom left quadrant of the complex plane, so the angle should be between 180 and 270 degrees. To correct for this pi radians are added to the result of the calculation. x ( ) = 0.9999 10 3.671 This can then be converted to a function of time. x ( t ) = 0.9999 10 sin ( 100 t + 3.671 ) m
-6 -6
Figure 9.3
Note: when dividing and multiplying complex numbers in polar form the magnitudes can be multiplied or divided, and the angles added or subtracted. Unfortunately when the numbers are only added or subtracted they need to be converted back to cartesian form to perform the operations. This method eliminates the need to multiply by the complex conjugate. B 2 2 -& A + B atan % -2 2 ! A" A + jB A +B % B --------------- = ------------------------------------------------- = ------------------------& atan % D ---& & ! atan % ! " ! "" C + jD A C 2 2 D& 2 2 C +D --C + D atan % ! C" A 1 ------------- = A -- ( 1 2 ) B 2 B ( A 1 ) ( B 2 ) = AB ( 1 + 2 ) For example, 2 + j-& ------------(1 + j)% ! 3 + 4 j" = 5 0.46362 0.7854 -----------------------------25 0.9273
Figure 9.4
The cartesian form of complex numbers seen in the last section are well suited to operations where complex numbers are added and subtracted. But, when complex numbers are to be multiplied and divided these become tedious and bulky. The polar form for complex numbers simplifies many calculations. The previous example started in Figure 9.2 is redone using polar notation in Figure 9.5. In this example the input is directly converted to polar form, without the need for calculation. The input frequency is substituted into the transfer function and it is then converted to polar form. After this the output is found by multiplying the transfer function by the input. The calculations for magnitudes involve simple multiplications. The angles are simply added. After this the polar form of the result is converted directly back to a function of time.
Consider the input function from the previous example in polar form it becomes, F ( t ) = 10 sin ( 100 t + 0.5 ) N F ( ) = 10 0.5 The transfer function can also be put in polar form. x() 1 1 ------------ = --------------------------------------------------= -----------------------------------------------------------------------------------------2 F() 9998000 + j 300000 ( 2000 1000 ( 100 ) ) + j ( 3000 ( 100 ) ) x() 1 0 -----------= ------------------------------------------------------------------------------------------------------------------------------F() 300000 2 2 % % & & - + ( 9998000 ) + ( 300000 ) atan ----------------------! ! 9998000" " x ( ) 1 0 1 ------------ = ----------------------------------------- = ----------------------- ( 0 3.112 ) = 0.9998 10-7 3.112 F() 10002500 3.112 10002500 The output can now be calculated. x( ) -7 x ( ) = ------------ F ( ) = ( 0.9998 10 3.112 ) ( 10 0.5 ) F() x ( ) = 0.9998 10 ( 10 ) ( 3.112 + 0.5 ) = 0.9998 10 2.612 The output function can be written from this result. x ( ) = 0.9998 10 sin ( 100 t 2.612 )
-6 -7 -6
Re - but the atan function in Note: recall that tan = ----Im calculators and software only returns values between 90 to 90 degrees. To compensate for this the sign of the real and imaginary components must be considered to determine where the angle lies. If it lies beyond the -90 to 90 degree range the correct angle can be obtained by adding or subtracting 180 degrees.
imaginary +/+/+
real
-/-
-/+
Figure 9.5
Consider the circuit analysis example in Figure 9.6. In this example the component values are converted to their impedances, and the input voltage is converted to phasor form. (Note: this is a useful point to convert all magnitudes to powers of 10.) After this the three output impedances are combined to a single impedance. In this case the calculations were simpler in the cartesian form.
+ Vo -
6 V i = 5 sin ( 10 t + 0.3 ) The impedances and input voltage can be written in phasor form. 10 5 0.3 + 4 10 3 6 10 j 1 ----------------------7 6 10 10 j 10 4
+ Vo -
Z eq
+ Vo -
Figure 9.6
The analysis continues in Figure 9.7 as the output is found using a voltage divider. In this case a combination of cartesian and polar forms are used to simplify the calculations. The final result is then converted back from phasor form to a function of time.
The output can be found using the voltage divider form. % Z eq & V o ( ) = ( 5 0.3 ) # ---------------------$ ! 10 4 + Z eq" 1 % % -----------------------------------------& & # ! 4 " $ ( 10 ) + j ( 0.099 ) -$ # -------------------------------------------------------------V o ( ) = ( 5 0.3 ) # $ 4 1 -----------------------------------------& $ # 10 + % 4 ! " ! ( 10 ) + j ( 0.099 ) " 1 -& V o ( ) = ( 5 0.3 ) % --------------------------------------------------------------------4 4 ! " ( 10 ) ( ( 10 ) + j ( 0.099 ) ) + 1 1 -& 5 0.3 5 0.3 --------------------------------------------------------------------- = -------------------------------------V o ( ) = ( 5 0.3 ) % ! 2 + j 990" = 990 1.5687761 990 2 2 -------2 + 990 atan 2 5 3 - ( 0.3 1.5687761 ) = 5.05 10 1.269 V o ( ) = -------990 Finally, the output voltage can be written. V o ( t ) = 5.05 sin ( 10 t 1.269 ) mV
6
Figure 9.7
Phasor analysis is applicable to systems that are linear. This means that the principle of superposition applies. Therefore, if an input signal has more than one frequency component then the system can be analyzed for each component, and then the results simply added. The example considered in Figure 9.2 is extended in Figure 9.8. In this example the input has a static component, as well as frequencies at 0.5 and 20 rad/s. The transfer function is analyzed for each of these frequencies components. The output components are found by multiplying the inputs by the response at the corresponding frequency. The results are then converted back to functions of time, and added together.
Given the transfer function for the system, x() 1 -----------= ---------------------------------------------------------------------2 F() ( 2000 1000 ) + j ( 3000 ) and an input with multiple frequency components, F ( t ) = 1000 + 20 sin ( 20 t ) + 10 sin ( ( 0.5 t ) ( N ) )
Note: these are gains and phase shifts that will be used heavily in Bode plots later.
the transfer function for each frequency can be calculated, x(0) 1 1 ----------- = ----------= -----------------------------------------------------------------------------= 0.0005 0 2 F(0) 2000 ( 2000 1000 ( 0 ) ) + j ( 3000 ( 0 ) ) 1 1 0 x ( 20 ) 1 - = ---------------------------------------------------------= -----------------------------------------------------------------------------------= ----------------------------------2 F ( 20 ) 398000 + j 60000 402497 2.992 ( 2000 1000 ( 20 ) ) + j ( 3000 ( 20 ) ) x ( 0.5 ) 1 1 1 0 --------------- = --------------------------------------------------------------------------------------- = ------------------------------- = ----------------------------2 F ( 0.5 ) 1750 + j 1500 2305 0.709 ( 2000 1000 ( 0.5 ) ) + j ( 3000 ( 0.5 ) ) These can then be multiplied by the input components to find output components. x ( 0 ) = ( 0.0005 0 ) 1000 0 = 0.5 0 1 0 -4 -----------------------------------& x ( 20 ) = % ! 402497 2.992" 20 0 = 0.497 10 2.992 1 0 -& 3 ----------------------------x ( 0.5 ) = % ! 2305 0.709" 10 0 = 4.34 10 0.709 Therefore the output is, x ( t ) = 0.5 + 49.7 10 sin ( 20 t 2.992 ) + 4.34 10 sin ( 0.5 t 0.709 )
6 3
Figure 9.8
A example for a signal with multiple frequency components (based on the example in Figure 9.2)
9.3 VIBRATIONS
Oscillating displacements and forces in mechanical systems will cause vibrations. In some cases these become a nuisance, or possibly lead to premature wear and failure in mechanisms. A common approach to dealing with these problems is to design vibration isolators. The equations for transmissibility and isolation is shown in Figure 9.9. These equations can compare the ratio of forces or displacements through an isolator. The calculation is easy to perform with a transfer function or Bode plot.
Given a vibration force in, to a force out, x out ( ) F out ( ) - = ----------------T = -----------------F in ( ) x in ( ) % I = ( 1 T ) 100% The gain of a transfer function gives transmissibility
Figure 9.9
Transmissibility
Given the transfer function for a vibration isolator below, find a value of K that will give 50% isolation for a 10Hz vibration. x out 5 D + 10 -------- = ---------------------------------------2 x in 4 D + 20 KD + 4
Figure 9.10
9.4 SUMMARY
Phasor transforms and phasor representations can be used to find the steady state response of a system to a given input. Vibration analysis determines frequency components in mechanical systems.
2. A single d.o.f. model with a weight of 1.2 kN and a stiffness of 340 N/m has a steady-state harmonic excitation force applied at 95 rpm (revolutions per minute). What damper value will give a vibration isolation of 92%? 3. Four helical compression springs are used, one at each corner of a piece of equipment. The spring rate is 240 N/m for each spring and the vertical static deflection of the equipment is 10mm. Calculate the mass of the equipment and determine the amount of isolation the springs would afford if the equipment operating frequency is twice the natural frequency of the system. 4. a) For the circuit below find the transfer function and the steady state response for an input of
Va 1 mH + 1K Vo
Vi
+ -
1K
Va V a Vo Va Vi Va - + ----------- + ----------------- + ----------- = 0 = ---------------1 K 1 K 0.001 D 1K 3 - ----------------1 -& 1 -& 1 -& % ----------% --------------------------Va % ! 1 K + 0.001 D" + Vi ! 1 K " = Vo ! 0.001 D" Vo Va Vo - + ----------- = 0 = ----------------0.001 D 1 K 1 - ----------1 -& 1 -& % --------------------------------Vo % ! 0.001 D + 1 K " = V a ! 0.001 D" 0.001 D + 1 K & -----------------------------------Vo % ! " = Va 1K
(1)
(2)
substitute (2) into (1) 0.001 D + 1 K 3 - ----------------1 -& 1 -& 1 -& + + Vi % ----------= Vo % ----------------V o % ------------------------------------& % ----------! " ! 1 K 0.001 D" ! 1 K " ! 0.001 D" 1K 1 ----------Vo 1K ----- = -----------------------------------------------------------------------------------------------------------------Vi 0.001 D + 1 K 3 1 1 % ------------------------------------& % ----------- + -----------------& % -----------------& ! " ! 1 K 0.001 D" ! 0.001 D" 1K
for the given input of Vi(t) = 10sin(1,000,000 t). 1 ----------Vo 1 K ---------------- = ----------------------------------------------------------------------------------------------------------------------------------------------6 10 + 0 j 1 j 10 + 1 K 3 - ---------------------------1 % 0.001 -& % ----------------------------& ------------------------------------------& % ----------+ 6 6 " ! " ! ! " 1K 1 K 0.001 ( j 10 ) 0.001 ( j 10 ) 3 Vo 10 ---------------- = ---------------------------------------------------------------------------------- 3 3 3 10 + 0 j ( j + 1 ) ( 3 10 j 10 ) + j ( 10 ) Vo 1 ---------------- = --------------------------------------10 + 0 j ( j + 1)(3 j) + j Vo 1 -& % 4 3j& ---------------- = % ------------------------! 4 + 3 j" ! 4 3 j" 10 + 0 j 4 3j& V o = 10 % ------------= 2 0.644 ! 25 " V o ( t ) = 2.00 sin ( 10 t 0.644 ) V 2. F y M
6
' Fy
= K s y K d yD F = MyD
y 1 -- = ----------------------------------------2 F D M + DK d + K s Ks Kd F floor = K s y + K d yD F floor ------------ = Ks + K d D y F floor F floor& % y & ( Ks + Kd D ) ------------ = % ------------ -- = ----------------------------------------2 ! y " ! F" F D M + DK d + K s F floor ( Ks + Kd j ) ------------ = ---------------------------------------------2 F M + jK d + K s Ks + ( K d ) F floor ------------ = ----------------------------------------------------------2 F 2 2 ( Ks M ) + ( K d )
2 2
(contd For 92% isolation, there is 100-92 = 8% transmission, at 95rpm. N K s = 340 --m 1200 N - = 122 kg M = ---------------N----9.81 kg
rev 1 min rad -& % -------------& % 2 ---------------& = 9.95 rad ------- = % 95 -------! min" ! 60sec" ! rev " s
2 2 N % 340 ---& + % K d 9.95 rad --------& ! ! m" s " 0.08 = -------------------------------------------------------------------------------------------------------------------2 2 2 N % 340 --- % 9.95 rad --------& 122 kg& + % 9.95 rad --------K & ! " ! m ! s " s d" 2 2 2 N % 340 --- % 9.95 rad --------& 122 kg& + % 9.95 rad -------- K d& ! " ! " m ! s " s 2 2 2 2 N % 340 ---& + % K d 9.95 rad --------& ! ! m" s " = -------------------------------------------------------------2 0.08 2 2
rad - 2 115600 N 2 99.0025 rad 8 N - + 99.0025 ---------- ------ ---------( 1.377878 10 ) ----K d = ----------------+ K d -----------------2 2 2 0.0064 0.0064 s 2 m s m 10 -& ----------------N s 2 % 1.197253 --------------------------------= Kd 2 ! 15370.138 " 2 m rad 3. a) b) 4. a) b) V o ( t ) = 3536 sin ( 1000 t + 0.785 ) V o ( t ) = 5000 + 2500 e
1000 t 8 2 2
Ns K d = 88.3 ----m
M = 0.979 kg I = 67%
a) Draw the Bode plot on the attached semi-log graph paper. b) Given an input of F=5sin(62.82t), find the output, x, using the Bode plot. c) Given an input of F=5sin(62.82t), find the output, x, using phasors. x D -- = ----------------------------2 F ( D + 200 ) 2. For the following transfer function, a) Draw the Bode plot on the attached semi-log graph paper. b) Given an input of F=5sin(62.82t), find the output, x, using the Bode plot. c) Given an input of F=5sin(62.82t), find the output, x, using phasors. x D ( D + 2 )-- = ----------------------------2 F ( D + 200 )
2
3. For the following transfer function, a) Draw the Bode plot on the attached semi-log graph paper. b) Given an input of F=5sin(62.82t), find the output, x, using the Bode plot. c) Given an input of F=5sin(62.82t), find the output, x, using phasors. x D (D + 2) -- = ----------------------------2 F ( D + 200 )
2
Topics: Bode plots Objectives: To be able to describe the response of a system using Bode plots
10.1 INTRODUCTION
When a phasor transform is applied to a transfer function the result can be expressed as a magnitude and angle that are functions of frequency. The magnitude is the gain, and the angle is the phase shift. In the previous chapter these values were calculated for a single frequency and then multiplied by the input values to get an output value. At different frequencies the transfer function value will change. The transfer function gain and phase angle can be plotted as a function of frequency to give an overall picture of system response.
Aside: Consider a graphic equalizer commonly found on home stereo equipment. The spectrum can be adjusted so that high or low tones are emphasized or muted. The position of the sliders adjusts the envelope that the audio signal is filtered through. The sliders trace out a Bode gain plot. In theoretical terms the equalizer can be described with a transfer function. As the slides are moved the transfer function is changed, and the bode plot shifts. In the example below the slides are positioned to pass more of the lower frequencies. The high frequencies would not be passed clearly, and might sound somewhat muffled. 40-120 120-360 360-1K 1K-3.2K 3.2K-9.7K 9.7K-20K
gain
The mass-spring-damper transfer function from the previous chapter is expanded in Figure 10.2. In this example the transfer function is multiplied by the complex conjugate to eliminate the complex number in the denominator. The magnitude of the resulting transfer function is the gain, and the phase shift is the angle. Note that to correct for the quadrant of the phase shift angles pi radians is subtracted for certain frequency values.
x( ) 1 -----------= ---------------------------------------------------------------------2 F( ) j ( 3000 ) + ( 2000 1000 ) x( ) 1 -----------= ---------------------------------------------------------------------2 F( ) j ( 3000 ) + ( 2000 1000 ) x( ) ( 2000 1000 ) j ( 3000 )-----------= ------------------------------------------------------------------------2 2 2 F( ) ( 2000 1000 ) + ( 3000 ) ( 2000 1000 ) + ( 3000 ) 1 x ( ) = ----------------------------------------------------------------------------= ---------------------------------------------------------------------------------------2 2 2 F( ) 2 2 2 ( 2000 1000 ) + ( 3000 ) ( 2000 1000 ) + ( 3000 ) 3 -$ 3000 $ = atan # ----------- = atan # ----------------------------------------2 2" ! " ! 1000 + 2000 2 3 -$ # ----------- $ = atan # 2" !! " 2 Figure 10.2 A phasor transform example for ( 2 ) for ( > 2 )
2 2 2 2
The results in Figure 10.2 are normally left in variable form so that they may be analyzed for a range of frequencies. An example of this type of analysis is done in Figure 10.3. A set of frequencies is used for calculations. These need to be converted from Hz to rad/s before use. For each one of these the gain and phase angle is calculated. The gain gives a ratio between the input sine wave and output sine wave of the system. The magnitude of the output wave can be calculated by multiplying the input wave magnitude by the gain. (Note: recall this example was used in the previous chapter) The phase angle can be added to the input wave to get the phase of the output wave. Gain is normally converted to dB so that it may cover a larger range of values while still remaining similar numerically. Also note that the frequencies are changed in multiples of tens, or magnitudes.
Gain
Gain (dB)
(rad.)
(deg.)
Note: the gain values will cover many magnitudes of values. To help keep the graphs rational we will "compress" the values by converting them to dB (decibels) using the following formula. gain db = 20 log ( gain )
Note: negative phase angles mean that the mass motion lags the force.
Note: The frequencies chosen should be chosen to cover the points with the greatest amount of change.
Figure 10.3
In this example gain is defined as x/F. Therefore F is the input to the system, and x is the resulting output. The gain means that for each unit of F input to the system, there will be gain*F=x output. If the input and output are sinusoidal, there is a difference in phase between the input and output wave of (the phase angle). This is shown in Figure 10.4, where an input waveform is supplied with three sinusoidal components. For each of the frequencies a gain and phase shift are calculated. These are then used to calculate the resulting output wave, relative to the input wave. The resulting output represents the steady-state response to the sinusoidal output.
Assuming there is excitation from two sinusoidal sources in addition to the static load, as defined by the equation, F ( t ) = 1000 + 20 sin ( 20 t ) + 10 sin ( 0.5 t ) ( N )
The result for each component can be evaluated separately 2 -$ $ # -------x ( t ) = 1000 ( _________ ) sin # ! 0 t + ______ ! 360" " 2 $ $ + 20 ( _________ ) sin # 20 t + _______ # -------! ! 360" " 2 -$ $ # -------+ 10 ( __________ ) sin # ! 0.5 t ________ ! 360" " gain from calculations or Bode plot phase angle from calculations or Bode plot
Figure 10.4
5 6 789 1
5 6 789 1
5 6 789 1
5 6 789
Figure 10.5
Plot the points from Figure 10.3 in the semi-log graph paper in Figure 10.5. The general layout is pictured below. gain (dB) -40dB/dec
phase (deg)
0.1
10 f(Hz)
100
1000
Figure 10.6
Drill problem: Plot the points from Figure 10.3 on graph paper
steps_per_dec = 6; decades = 6; start_freq = 0.1; // the transfer function function foo=G(w) D = %i * w; foo = (D + 5) / (D^2 + 100*D + 10000); endfunction // this section writes the values to a datafile that may be graphed in a spreadsheet fd = mopen("data.txt", "w"); for step = 0:(steps_per_dec * decades), f = start_freq * 10 ^ (step / steps_per_dec); // calculate the next frequency w = f * 2 * %pi); // convert the frequency to radians [gain, phase] = polar(G(w));// find the gain and convert it to mag and angle gaindb = 20 * log10(gain);// convert magnitude to dB phasedeg = 180 * phase / %pi;// convert to degrees mfprint(fd, "%f, %f, %f \n", f, gaindb, phasedeg); end mclose(fd); // to graph it directly the following is used D = poly(0, D); h = syslin(c, (D + 5) / (D^2 + 100*D + 10000) ) ; bode(h, 0.1, 1000, Sample Transfer Function);
Figure 10.7
Use computer software, such as Mathcad or a spreadsheet, to calculate the points in Figure 10.2, and then draw Bode plots. Most software will offer options for making one axis use a log10 scale.
Figure 10.8
Drill problem: Plot the points from Figure 10.2 with a computer
Draw the Bode plot for the transfer function by hand or with computer.
Figure 10.9
Drill problem: Draw the Bode plot for gain and phase
An approximate technique for constructing a gain Bode plot is shown in Figure 10.10. This method involves looking at the transfer function and reducing it to roots in the numerator and denominator. Once in that form, a straight line approximation for each term can be drawn on the graph. An initial gain is also calculated to shift the results up or down. When done, the straight line segments are added to produce a more complex straight line curve. A smooth curve is then drawn over top of this curve.
Bode plots for transfer functions can be approximated with the following steps. 1. Plot the straight line pieces. a) The gain at 0rad/sec is calculated and used to find an initial offset. For example this transfer function starts at 10(D+1)/ (D+1000)=10(0+1)/(0+1000)=0.01=-40dB. b) Put the transfer function in root form to identify corner frequencies. For example (D+1)/(D+1000) will have corner frequencies at 1 and 1000 rad/sec. c) Curves that turn up or down are drawn for each corner frequency. At each corner frequency a numerator term causes the graph to turn up, each term in the dominator causes the graph to turn down. The slope up or down is generally +/- 20dB/decade for each term. Also note that squared (second-order) terms would have a slope of +/-40dB/decade. 2. The effect of each term is added up to give the resulting straight line approximation. 3. When the smooth curve is drawn, there should commonly be a 3dB difference at the corner frequencies. In second-order systems the damping coefficient make may the corner flatter or peaked.
Figure 10.10 The method for Bode graph straight line gain approximation
Note: Some of the straight line approximation issues are discussed below. Why is there 3dB between a first order corner and the smooth plot, and the phase angle is 45 degrees of the way to +/- 90 degrees. 1 G ( j ) = -----------------c + j the initial gain is 1 - = G ( 0 ) = ---------------c + j 0 at the corner frequency 1 G ( j ) = -------------------c + j c Therefore the difference is G(j) 1 1$ - = ------ -- = 20 log # ------ -- = 3.01 dB -diff = -------------! " G(0) 4 4 2 4 2 Why does a first order pole go down at 20dB/dec? 1 G ( j ) = -----------------c + j before the corner frequency, c > j 1- = 20 log ( 1 ) = 20 log ( ) G ( j ) = ----c c c after the corner frequency, c < j 1- = 20 log ( 1 ) = 20 log ( ) G ( j ) = ----j each time the frequency increases by a multiple of 10, the log value becomes 1 larger, thus resulting in a gain change of -20 dB.
Why does a pole make the phase angle move by -90deg after the corner frequency? 1 1 0 1 -$ - = -------------------------G ( j ) = ------------------ = ------------------------------------------------- atan # ! c" c + j 2 2 2 -$ 2 c + c + atan # ----! c" before the corner frequency, 0-$ -$ # --------angle ( G ( j ) ) = atan # ! c" = atan ! c" = 0 after the corner frequency, c < j $ -angle ( G ( j ) ) = atan # ----! c" = atan ( ) = 2 c > j
Show that the second order transfer function below would result in a slope of +/- 40 dB/decade. 1 G ( j ) = ------------------------2 ( c + j )
Figure 10.13 Drill problem: Slope of second order transfer functions. An example of the straight line plotting technique is shown in Figure 10.14. In this example the transfer function is first put into a root form. In total there are three roots, 1, 10 and 100 rad/sec. The single root in the numerator will cause the curve to start upward with a slope of 20dB/dec after 1rad/sec. The two roots will cause two curves downwards at -20dB/dec starting at 10 and 100 rad/sec. The initial gain of the transfer function is also calculated, and converted to decibels. The frequency axis is rad/sec by default, but if Hz are used then it is necessary to convert the values.
Step 1: Draw lines for each of the terms in the transfer function, Gain (dB) D+1 10 ( 1 ) GAIN 0 = -----------------------= 10 = 20 dB ( 10 ) ( 100 )
4
20dB/dec. 0dB 1 10 100 freq.(rad/sec) (could be Hz also) -20dB/dec. -20dB/dec. 1 --------------D + 10 1 -----------------D + 100
Figure 10.14 An approximate gain plot example The example is continued in Figure 10.15 where the straight line segments are added to produce a combined straight line curve.
Step 2: Sum the individual lines, and get the straight line approximation, Gain (dB) 40dB
20dB
0dB
10
100 freq.(rad/sec)
Figure 10.15 An approximate gain plot example (continued) Finally a smooth curve is fitted to the straight line approximation. When drawing the curve imagine that there are rubber bands at the corners that pull slightly and smooth out. For a simple first-order term there is a 3dB gap between the sharp corner and the function. Higher order functions will be discussed later.
Step 3: Draw the smooth curve (leaving 3dB at the corners), Gain (dB)
40dB
3dB
20dB
0dB
10
100 freq.(rad/sec)
The process for constructing phase plots is similar to that of gain plots, as seen in Figure 10.18. The transfer function is put into root form, and then straight line phase shifts are drawn for each of the terms. Each term in the numerator will cause a positive shift of 90 degrees, while terms in the denominator cause negative shifts of 90 degrees. The phase shift occurs over two decades, meaning that for a center frequency of 100, the shift would start at 10 and end at 1000. If there are any lone D terms on the top or bottom, they will each shift the initial value by 90 degrees, otherwise the phase should start at 0degrees.
Gain plots for transfer functions can be approximated with the following steps. 1. Plot the straight line segments. a) Put the transfer function in root form to identify center frequencies. For example (D+1)/(D+1000) will have center frequencies at 1 and 1000 rad/sec. This should have already been done for the gain plot. b) The phase at 0rad/sec is determined by looking for any individual D terms. Effectively they have a root of 0rad/sec. Each of these in the numerator will shift the starting phase angle up by 90deg. Each in the denominator will shift the start down by 90 deg. For example the transfer function 10(D+1)/(D+1000) would start at 0 deg while 10D(D+1)/(D+1000) would start at +90deg. c) Curves that turn up or down are drawn around each center frequency. Again terms in the numerator cause the curve to go up 90 deg, terms in the denominator cause the curves to go down 90 deg. Curves begin to shift one decade before the center frequency, and finish one decade after. 2. The effect of each term is added up to give the resulting straight line approximation. 3. The smooth curve is drawn.
Figure 10.17 The method for Bode graph straight line gain approximation The previous example started in Figure 10.14 is continued in Figure 10.18 to develop a phase plot using the approximate technique. There are three roots for the transfer function. None of these are zero, so the phase plot starts at zero degrees. The root in the numerator causes a shift of positive 90 deg, starting one decade before 1rad/sec and ending one decade later. The two roots in the denominator cause a shift downward.
10 ( D + 1 ) G ( D ) = --------------------------------------------( D + 10 ) ( D + 100 ) Step 1: Draw lines for each of the terms in the transfer function Phase angle (deg.) D+1 +90 +45 0 -45 -90 0.1 1 10 100 1000 freq.(rad/sec) 1 -----------------D + 100
1 --------------D + 10
Figure 10.18 An approximate phase plot example The straight line segments for the phase plot are added in Figure 10.19 to produce a straight line approximation of the final plot. A smooth line approximation is drawn using the straight line as a guide. Again, the concept of an rubber band will smooth the curve.
Phase angle (deg.) +90 +45 0 -45 -90 Phase angle (deg.) +90 +45 0 -45 -90 0.1 1 10 100 1000 freq.(rad/sec) 0.1 1 10 100 1000 freq.(rad/sec)
Figure 10.19 An approximate phase plot example (continued) The previous example used a transfer function with real roots. In a second-order system with double real roots (overdamped) the curve can be drawn with two overlapping straight line approximations. If the roots for the transfer function are complex (underdamped the corner frequencies will become peaked. This can be handled by determining the damping coefficient and natural frequency as shown in Figure 10.20. The peak will occur at the damped frequency. The peaking effect will become more pronounced as the damping coefficient goes from 0.707 to 0 where the peak will be infinite.
dB = A
Note: If is less than 1 the roots become complex, and the Bode plots get a peak. This can be seen mathematically because the roots of the transfer function become complex.
Figure 10.20 Resonant peaks The approximate techniques do decrease the accuracy of the final solution, but they can be calculated quickly. In addition these curves provide an understanding of the system that makes design easier. For example, a designer will often describe a system with a Bode plot, and then convert this to a desired transfer function.
x(t) displacement A
2 - $ 2 - $ 2 - $ # -----------# ----------------------x ( t ) = A sin # ! 0.01 t" + 0.3 A sin ! 0.005 t" + 0.01 A sin ! 0.0005 t"
t (ms)
Figure 10.22 A vibration signal as a function of time A signal spectrum displays signal magnitude as a function of frequency, instead of time. The time based signal in Figure 10.22 is shown in the spectrum in Figure 10.23. The three frequency components are clearly identifiable spikes. The height of the peaks indicates the relative signal magnitude.
Amplitude A
10.4 SUMMARY
Bode plots show gain and phase angle as a function of frequency. Bode plots can be constructed by calculating point or with straight line approximations. A signal spectrum shows the relative strengths of components at different frequencies.
2. Given the transfer function below, y (D) ( D + 10 ) ( D + 5 ) ----------- = --------------------------------------2 x(D ) (D + 5) a) draw the straight line approximation of the Bode (gain and phase shift) plots. b) determine the steady-state output if the input is x(t) = 20 sin(9t+0.3) using the
Bode plot. 3. Use the straightline approximation techniques to draw the Bode plot for the transfer function below. F D + 1000 - = ----------------------------------G = -2 x D + 5 D + 100 4. Given the transfer function below, Vo 1000 ----- = --------------------Vi D + 1000 a) Find the steady state response of the circuit using phasors (i.e., phasor transforms) if the input is Vi=5sin(100,000t). b) Draw an approximate Bode plot for the circuit. 5. For the transfer function, D( D + 2) --------------------------------------------------------2 2 D + 300 D + 62500 a) Use the straight line method and the attached log paper to draw an approximate Bode plot. b) Verify the Bode plot by calculating values at a few points. c) Use the Bode plot to find the response to an input of 5sin(624t) + 1sin(6.2t). 6. The applied force F is the input to the system, and the output is the displacement x. Neglect the effects of gravity. a) find the transfer function. K1 = 500 N/m K2 = 1000 N/m M = 10kg
b) What is the steady-state response for an applied force F(t) = 10cos(t + 1) N ? c) Give the transfer function if x is the input. d) Draw the bode plots for the transfer function found in a). e) Find x(t), given F(t) = 10N for t >= 0 seconds.
f) Find x(t), given F(t) = 10N for t >= 0 seconds considering the effects of gravity. 7. The following differential equation is supplied, with initial conditions. y + y + 7y = F y( 0) = 1 y(0) = 0 F ( t ) = 10 t>0
a) Write the equation in state variable form. b) Solve the differential equation numerically. c) Solve the differential equation using calculus techniques. d) Find the frequency response (gain and phase) for the transfer function using the phasor transform. Sketch the bode plots. 8. You are given the following differential equation for a spring damper pair. d-$ F ( t ) = 10 sin ( 100 t ) 5 x + # ---x = F ! dt" a) Write the transfer function for the differential equation if the input is F. b) Apply the phasor transform to the transfer function to find magnitude and phase as functions of frequency. c) Draw a Bode plot for the system using either approximate or exact techniques. d) Use the Bode plot to find the response to; F ( t ) = 10 sin ( 100 t ) e) Put the differential equation in state variable form and use a calculator to find values in time for the given input. F = 10 sin ( 100 t ) t x
0.0 0.002 0.004 0.006 0.008 0.010 f) Give the expected x response of this first-order system to a step function input for force F = 1N for t > 0 if the system starts at rest. Hint: Use the canonical form.
5 -----2
-45deg
-180deg
2. y (D) D + 10 ) ( D + 5 ) ( D + 10 ) ----------- = ( --------------------------------------= -------------------2 x(D ) (D + 5) (D + 5) 6dB 0dB 0.8 90 0.8 1.6 1.6
-90 x ( t ) = 20 cos ( 9 t + 0.3 ) Aside: the numbers should be obtained from the graphs, but I have calculated them y D + 10 ) 9 j + 10 9j$ 50 + 81 45j - = ( --------------------$ # 5 ------------= # ---------------= ------------------------------= 1.236 0.425 j ! 9 j + 5 " ! 5 9 j" x (D + 5) 25 + 81 y - = x 0.425 2 2 ---------------$ 1.236 + 0.425 atan # ! 1.236 " = 1.307 0.3312 rad
y - = 2.33 dB 9.49 x y ( t ) = 20 ( 1.307 ) sin ( 9 t + 0.3 + ( 0.3312 ) ) y ( t ) = 26.1 sin ( 9 t 0.031 ) Aside: This can also be done entirely with phasors in cartesian notation y D + 10 ) 9 j + 10 9j$ 50 + 81 45j - = ( --------------------$ # 5 ------------= # ---------------= ------------------------------= 1.236 0.425 j ! 9 j + 5 " ! 5 9 j" x (D + 5) 25 + 81 x = 20 ( cos ( 0.3 rad ) + j sin ( 0.3 rad ) ) = 19.1 + 5.91 j y ---------------------------- = ( 1.236 0.425 j ) ( 19.1 + 5.91 j ) = 26.1 0.813 j = 26.1 0.031 19.1 + 5.91 j y ( t ) = 26.11 sin ( 9 t 0.031 )
(contd Aside: This can also be done entirely with phasors in polar notation y D + 10 ) 9 j + 10 13.45 0.733 13.45 - = ( -----------------------------------$ -----------------------------------------= # ! 9 j + 5 " = 10.30 1.064 = 10.30 0.733 1.064 = 1.31 0.331 x (D + 5) x = 20 0.3 y ----------------= 1.31 0.331 20 0.3 y = 1.31 ( 20 ) ( 0.331 + 0.3 ) = 26.2 0.031 y ( t ) = 26.2 sin ( 9 t 0.031 )
3. for the numerator, (zero) for the denominator, (poles) rad - = 159 Hz 1000 -------s D + 2 n D + n = D + 5 D + 100 n = 100 rad n = 10 -------f n = 1.59 Hz s 2 n = 5 5 = ------------= 0.25 (underdamped) 2 ( 10 ) f d = f n 1 = 1.54 Hz for the initial gain Gain (dB) 20 0 0.1 1 1.54 10 100 -40dB/dec -60 -80 phase (deg) 0 0.1 -90 0.154 1 1.54 10 15.4,15.9 100 159 1000 1590 f(Hz) 159 1000 f(Hz) 0 + 1000 G ( 0 ) = ------------------------------------= 10 = 20 dB 2 0 + 5 ( 0 ) + 100
2 2 2 2 2
-20dB/dec
-180
6. x 0.0667 - m -- = -----------------------2 F D + 33.3 N b) = 1 D = 1 j a) m x 0.0667 3 -- = ---------------------------= 2.07 10 0 rad --2 N F ( 1 j ) + 33.3 F ( t ) = 10 cos ( t + 1 ) N F ( ) = ( 10 1 rad ) N x ------------------------------- = 2.07 10 3 0 rad m --( 10 1 rad ) N N m 3 - ( 10 1 rad ) N x ( ) = 2.07 10 0 rad --N 3 x ( ) = ( 10 ) 2.07 10 ( 0 rad + 1 rad ) m x ( ) = 0.0207 1 radm x ( t ) = 0.0207 cos ( t + 1 ) m c) F + 33.3 N -- = D ---------------------- --x 0.0667 m
2
d)
(undamped)
2
f d = f n 1 = 0.918 Hz for the initial gain Gain (dB) -54 0 0.1 -94 1 10 -40dB/dec f(Hz) 100 0.0667 - = 2 = 54 dB G ( 0 ) = --------------33.3
-20dB/dec
f(Hz) 100
b) = +h 0 1 yi + 0 7 1 v i F
= 1 0
F = 10
d)
y 1 1 1 -- = -------------------------- = ------------------------------------= ---------------------------------2 2 2 F D +D+7 (j) + j + 7 (7 ) + j() 1 y -- = --------------------------------------F 2 2 2 (7 ) + 0 - = ( 0 angle ( , 7 2 ) ) = angle ( , 7 2 ) = ---------------------------------------------2 angle ( , 7 )
-180deg
8. a) b) x 1 -- = -----------F 5+D x 1 1 1 0 1 ---$ -- = ------------ = --------------------= -------------= ---------------------------------------------- atan # ! " 5 F 5+D 5 + j 2 2 2 2 5 + ---$ 5 + atan # ! 5" gain(dB) -14dB 1 -$ ----------initial gain = 20 log # ! 5 + 0" = 14 dB 5corner freq. = ----= 0.8 Hz 2 -20dB/dec
c)
phase(deg) 0 45 90 0.08Hz 0.8Hz 100 - = 16 Hz f = -------2 From the Bode plot, 8Hz
d)
Aside: verified by calculations, x 1 ------------- atan # 100 --------$ = 0.00999 1.521 = -------------------------! 5 " 10 0 2 2 5 + 100 x = ( 10 0 ) ( 0.00999 1.521 ) = 0.0999 1.521 x ( t ) = 0.0999 sin ( 100 t 1.521 )
e)
0.186
0.2
t 0.0
Xi
0.002 0.004
0.099 0.2
0 0
0.5 i h
1 0.999
0.006 0.008
f)
1 -e -------x = -5 5
5 t
0.010
2. Draw Bode plots for the following functions using straight line approximations. 1 -----------D+1 1 --------------2 D +1 1 -------------------2 (D + 1) 1 ----------------------------2 D + 2D + 2
3. Given the transfer function below, y (D) D + 10 ) ( D + 5 ) ----------- = ( --------------------------------------2 x(D ) (D + 5) a) draw the straight line approximation of the bode and phase shift plots. b) determine the steady state output if the input is x(s) = 20 cos(9t+.3) using the striaght line plots. c) use an exact method to verify part b). 4. a) Convert the following differential equation to a transfer function. 5x + 2x = 3F
b) Apply a phasor (Fourier) transform to the differential equation and develop equations for the system gain and phase shift as a function of input frequency. c) Draw a Bode plot using the equations found in part b) on the attached log paper. d) Draw a straight line approximation of the system transfer function on the attached log paper.
7 8 9 1
7 8 9
5 6 789 1
5 6 789 1
5 6 789 1
5 6 789
Topics: Root-locus plots Objectives: To be able to predict and control system stability.
11.1 INTRODUCTION
The system can also be checked for general stability when controller parameters are varied using root-locus plots.
R = A, B jw x(t) x0 -A -B sigma t
Figure 11.1
R = Aj jw A x(t)
sigma -A t
Figure 11.2
R = A Bj jw B -A sigma -B t x(t)
Figure 11.3
R = A Bj jw B -A sigma -B t x(t)
Figure 11.4
More negative real and complex roots cause a faster decaying oscillation
R = A, A jw x(t)
-A,-A sigma t
Figure 11.5
R = A, A jw x(t)
A,A sigma t
Figure 11.6
R = A Bj jw B A sigma x(t)
-B
Figure 11.7
Complex roots with positive real parts have growing oscillations and are unstable
Next, recall that the denominator of a transfer function is the homogeneous equation. By analyzing the function in the denominator of a transfer function the general system response can be found. An example of root-locus analysis for a mass-spring-damper system is given in Figure 11.8. In this example the transfer function is found and the roots of the equation are written with the quadratic equation. At this point there are three unspecified values that can be manipulated to change the roots. The mass and damper values are fixed, and the spring value will be varied. The range of values for the spring coefficient should be determined by practical and design limitations. For example, the spring coefficient should not be zero or negative.
x( D) 1 ------------ = ----------------------------------------2 F(D) MD + K d D + K s Note: We want the form below A -------------------------------------(D + B)(D + C) 1---x(D) M ------------ = -----------------------------------F(D) Ks 2 Kd - D + ----D + ----M M Kd Kd Ks -------- ------ 4 ----2 M M M B, C = -----------------------------------------2 M 0 100 100 100 Kd 0 100 100 100 Ks 0 100 1000 10000 B 0
2
Ks
Kd
Aside: ax + bx + c = ( x + A ) ( x + B ) b b 4 ac A, B = -------------------------------------2a C 0
2 2
Figure 11.8
The roots of the equation can then be plotted to provide a root locus diagram. These will show how the values of the roots change as the design parameter is varied. If any of these roots pass into the right hand plane we will know that the system is unstable. In addition complex roots will indicate oscillation.
Imaginary
Real
Figure 11.9
A feedback controller with a variable control function gain is shown in Figure 11.10. The variable gain K necessitates the evaluation of controller stability over the range of operating values. This analysis begins by developing a transfer function for the overall system. The root of the denominator is then calculated and plotted for a range of K values. In this case all of the roots are on the left side of the plane, so the system is stable and doesnt oscillate. Keep in mind that gain values near zero put the control system close to the right hand plane. In real terms this will mean that the controller becomes unresponsive, and the system can go where it pleases. It would be advisable to keep the system gain greater than zero to avoid this region.
Note: This controller has adjustable gain. After this design is built we must anticipate that all values of K will be used. It is our responsibility to make sure that none of the possible K values will lead to instability. + K 1 K G ( D ) = --D H(D ) = 1 1 --D
First, we must develop a transfer function for the entire control system. K # ---$ ! " D G( D) K - = -------------------------- = ------------G S ( D ) = -----------------------------------1 + G( D)H(D ) D+K K ---$ 1+# ! D" ( 1 ) Next, we use the characteristic equation of the denominator to find the roots as the value of K varies. These can then be plotted on a complex plane. Note: the value of gain K is normally found from 0 to +infinity. D+K = 0 K 0 1 2 3 etc... root -0 -1 -2 -3 j K K = 0
Note: This system will always be stable because all of the roots for all values of K are negative real, and it will always have a damped response. Also, larger values of K, make the system more stable.
Aside: Scilab can be used to draw root locus plots for systems of the form below, where there is a simple gain, K, multiplying the openloop gain, G(s). + K 1 1 G ( D ) = --D First, we must multiply G and H 1 1 -$ ( 1 ) = --G ( s ) H ( s ) = # --! D" D The numerator and denominator of this equation are then defined and plotted using the evans function. D = poly(0, D); // define the differential operator n = real(1.0); // define the numerator of GH d = real(D); // define the denominator of GH evans(n, d, 100); // plot for gains from K=0 to 100 H(D ) = 1 1 --D
Given the system elements (assume a negative feedback controller), K H(D) = 1 G ( D ) = ----------------------------2 D + 3D + 2 First, find the characteristic equation,. and an equation for the roots, K -----------------------------$ ( 1 ) = 0 1+# ! 2 " D + 3D + 2 D + 3D + 2 + K = 0
2
3 9 4(2 + K) 1 4K roots = ----------------------------------------------= 1.5 ------------------2 2 Next, find values for the roots and plot the values, K 0 1 2 3 roots j
11.3 SUMMARY
Root-locus plots show the roots of a transfer function denominator to determine stability
KdD
2. The block diagram below is for a motor position control system. The system has a proportional controller with a variable gain K. d Vd + Ve Vs a
100 -----------D+2
1 --D
Va 2
a) Simplify the block diagram to a single transfer function. b) Draw the Root-Locus diagram for the system (as K varies). Use either the approximate or exact techniques. c) Select a K value that will result in an overall damping coefficient of 1. State if the Root-Locus diagram shows that the system is stable for the chosen K. 3. Given the system transfer function below. o 20 K ---- = --------------------------------2 d D + D + 20 K a) Draw the root locus diagram and state what values of K are acceptable. b) Select a gain value for K that has either a damping factor of 0.707 or a natural frequency of 3 rad/sec. c) Given a gain of K=10 find the steady-state response to an input step of 1 rad. d) Given a gain of K=0.01 find the response of the system to an input step of 0.1rad.
4. A feedback control system is shown below. The system incorporates a PID controller. The closed loop transfer function is given. Y X + 3 Ki ------------ + KdD K p + ---D+9 D 4 D ( 3 Kd ) + D ( 3 Kp ) + ( 3 Ki ) Y -- = ---------------------------------------------------------------------------------------------2 X D ( 12 K d + 1 ) + D ( 9 + 12 K p ) + ( 12 K i )
2
a) Verify the close loop controller function given. b) Draw a root locus plot for the controller if Kp=1 and Ki=1. Identify any values of Kd that would leave the system unstable. c) Draw a Bode plot for the feedback system if Kd=Kp=Ki=1. d) Select controller values that will result in a natural frequency of 2 rad/sec and damping coefficient of 0.5. Verify that the controller will be stable. e) For the parameters found in the last step can the initial values be found? f) If the values of Kd=1 and Ki=Kp=0, find the response to a unit ramp input as a function of time. 5. Draw a root locus plot for the control system below and determine acceptable values of K, including critical points. X + 1 --- + D$ K# 5 + ! " D + 10 ----D 0.01 0.1 -------------------------------------2 D + 10 D + 100 Y
6. The feedback loop below is for controlling a DC motor with a PID controller.
Vd
+ -
D + PD + 1 -----------------------------D Va
Vs
1 --D
a) Find the transfer function for the system. b) Draw a root locus diagram for the variable parameter P. c) Find the response of the system in to a unit step input using explicit integration.
+ -
3.0 ------------------------------------2 ( D + 1 ) + Kd D
3.0 --------------------------------------------------2 D + D ( K d + 2 ) + 4.0 D + D ( K d + 2 ) + 4.0 = 0 Kd 0 1 2 5 10 100 1000 roots -1 +/- 1.732j -1.5 +/- 1.323j -2.000, -2.000 -0.628, -6.372 -0.343, -11.657 -0.039, -102.0 -0.004, -1000
2
K d 2 ( K d + 2 ) 4 ( 4.0 ) D = -------------------------------------------------------------------------2 K d 2 K d + 4 K d 12 D = ---------------------------------------------------------------2 Critical points: (this is simple for a quadratic) The roots becomes positive when 0 > K d 2 K d + 4 K d 12 2 + K d > K d + 4 K d 12 16 > 0 0 > Kd 2 Kd > 2 The roots becomes complex when 0 > K d + 4 K d 12 4 16 4 ( 12 ) K d = ---------------------------------------------2 K d = 6, 2
2 2 2 2
Gains larger than -2 will result in a stable system. Any gains between -4 and -2 will result in oscillations.
b)
2 4 4 ( 200 K ) - = 1 1 200 K roots = ----------------------------------------------2 Im K roots 0 0.001 0.005 0.1 1 5 10 0,-2 -0.1,-1.9 -1,-1 etc. K=0.005 Re -2 -1
c)
D + 2 D + 200 K = D + 2 n D + n
n = 1
K = 0.005
3. a) D + D + 20 K = 0 1 1 4 ( 20 K ) D = -------------------------------------------2 K 0 1/80 1 10 1000 roots 0.000, -1.000 -0.500, -0.500 -0.5 +/- 4.444j -0.5 +/- 14.13j -0.5 +/- 141.4j For complex roots 1 80 K < 0 For negative real roots (stable) 1 1 80 K ------------------------------------<0 2 1 80 K < 1 K>0 1K > ----80
2
b)
The gain can only be used for the natural frequency 20 20 - = ----- = 2.22 K = ----2 2 n 3
c)
o 20 ( 10 ) ---- = ---------------------------------------2 d D + D + 20 ( 10 ) o + d + d 200 = 200 d Homogeneous: A + A + 200 = 0 1 1 4 ( 200 ) A = ------------------------------------------2 o ( t ) = C1 e Particular: = A 0 + 0 + A 200 = 200 ( 1 rad ) o ( t ) = 1 rad Initial Conditions (assume at rest): o ( t ) = C1 e
0.5 t 0.5 t 2
A = 0.5 14.1 j
sin ( 14.1 t + C 2 )
A = 1 rad
0.5 t
0 = 0.5 C 1 sin ( C 2 ) 14.1 C 1 cos ( C 2 ) 14.1 cos ( C 2 ) = 0.5 sin ( C 2 ) 14.1 --------- = tan ( C 2 ) 0.5 1 rad 1 rad C 1 = -----------------= ------------------------= 1.000 rad sin ( C 2 ) sin ( 1.54 ) o ( t ) = ( e
0.5 t
C 2 = 1.54
d)
o 20 ( 0.01 ) ---- = -------------------------------------------2 d D + D + 20 ( 0.01 ) o + d + d 0.2 = 0.2 d Homogeneous: A + A + 0.2 = 0 1 1 4 ( 0.2 ) A = ----------------------------------------2 o ( t ) = C1 e Particular: = A 0 + 0 + A 0.2 = 0.2 ( 1 rad ) o ( t ) = 1 rad Initial Conditions (assume at rest): o ( t ) = C1 e
0.724 t 0.724 t 0.276 t 0.276 t 0.724 t 2
A = 0.7236068, 0.2763932
0.276 t
+ C2 e
A = 1 rad
+ C2e
o ( 0 ) = C1 e
+ C2 e
) 0.276 ( C 2 e
0.276 t
+ ( 1.616 ) e
0.276 t
+ 1 rad
3 -----------D+9
b)
D ( 12 K d + 1 ) + D ( 9 + 12 K p ) + ( 12 K i ) = 0 9 12 K p ( 9 + 12 K p ) 4 ( 12 K d + 1 ) 12 K i D = -----------------------------------------------------------------------------------------------------------------2 ( 12 K d + 1 ) Kd -100 -10 -1 -0.1 0 1 10 100 Stable for, roots -0.092, 0.109 -0.241, 0.418 -0.46, 2.369 -0.57, 105.6 -0.588, -20.41 -0.808 +/- 0.52j -0.087 +/- 0.303j -0.0087 +/- 0.1j 9 12 K p ( 9 + 12 K p ) 4 ( 12 K d + 1 ) 12 K i < 0 ( 9 + 12 K p ) 4 ( 12 K d + 1 ) 12 K i < 9 + 12 K p ( 9 + 12 K p ) 4 ( 12 K d + 1 ) 12 K i < ( 9 + 12 K p ) 4 ( 12 K d + 1 ) 12 K i < 0 1 K d > ----12 Becomes complex at, 0 > ( 9 + 12 K p ) 4 ( 12 K d + 1 ) 12 K i 576 K d K i > ( 9 + 12 K p ) 48 K i ( 9 + 12 K p ) 48 K i K d > ---------------------------------------------576 K d K i
2 2 2 2 2 2 2 2
K d > 0.682
c)
Kp = 1
Ki = 1
Kd = 1
2
3 Kp D + 3 K i + 3 Kd D Y -- = ---------------------------------------------------------------------------------------------2 X D ( 12 K d + 1 ) + D ( 9 + 12 K p ) + ( 12 K i )
2 2 $ Y 3D + 3D + 3 3-$ # -------------------------------------------------D +D+1 # ------ = -----------------------------------------& = % 2 ! 13" ! 2 X D 13 + D 21 + 12 D + D 1.615 + 0.923"
3-$ final gain = 20 log # ----= 12.7 ! 13" 3-$ initial gain = 20 log # ----= 12.0 ! 12" for the numerator, n = 1 = 1
2
0.923 = 0.961
2
-12dB
3 Kp D + 3 Ki + 3 K d D Y -- = ---------------------------------------------------------------------------------------------2 X D ( 12 K d + 1 ) + D ( 9 + 12 K p ) + ( 12 K i ) n = 12 K i --------------------- = 2 12 K d + 1 12 K i = 48 K d + 4 24 K d = 7 + 12 K p
9 + 12 K p - = 20.5 ( 2 ) 2 n = --------------------12 K d + 1
At this point there are two equations and two unknowns, one value must be selected to continue, therefore, K p = 10 24 K d = 7 + 12 K p = 7 + 12 ( 10 ) = 127 12 K i = 48 K d + 4 = 48 ( 5.292 ) + 4 = 258.0 Now to check for stability D ( 12 ( 5.292 ) + 1 ) + D ( 9 + 12 ( 10 ) ) + ( 12 ( 21.5 ) ) = 0 64.504 D + 129 D + 258 = 0 129 129 4 ( 64.5 ) 258 - = 1 1.73 j D = -------------------------------------------------------------------2 ( 64.5 )
2 2 2
K d = 5.292 K i = 21.5
e) Cannot be found without an assumed input and initial conditions f) Y 3( 0 )D + 3( 0 ) + 3( 1 )D -- = --------------------------------------------------------------------------------------------------2 X D ( 12 ( 1 ) + 1 ) + D ( 9 + 12 ( 0 ) ) + ( 12 ( 0 ) ) Y 3D -- = -------------------------2 X 13 D + 9 D Y ( 13 D + 9 D ) = X ( 3 D ) Y 13 + Y 9 = X 3 9 - = 0 Y + Y ----13 It is a first order system, Y ( t ) = C1 e Y( 0) = 0 0 = C11 + C2
t 913 Y' ( t ) = ----C e 13 1 9 ----9 ----t 13 2 2 2 2
X = t
X = 1
X = 0
90 = ----C 1 13 1
C1 = 0 C2 = 0 no response
5. X + 1 - + D$ K # 5 + --! " D + 10 ----D 0.01 X + 0.01 X + 0.01 X K ( 0.5 D + 0.1 + 0.1 D ) ------------------------------------------------------------------------------------------------------------------------------------3 2 2 D + 10 D + 100 D + 1 + 0.01 ( K ( 0.5 D + 0.1 + 0.1 D ) ) K ( 0.5 D + 0.1 + 0.1 D ) ---------------------------------------------------------------------------------------------------------------------------------------------3 2 D + D ( 10 + 0.001 K ) + D ( 100 + 0.005 K ) + ( 1 + 0.001 K )
2 2
5 D + 1 + D -$ K # ----------------------------! " D
Given the homogeneous equation for the system, D + D ( 10 + 0.001 K ) + D ( 100 + 0.005 K ) + ( 1 + 0.001 K ) = 0 The roots can be found with a calculator, Mathcad, or equivalent. K roots notes -100,000 -1000 -10 0 10 1000 17165.12 100,000 6. a) b) c) D ( 100 ) + D ( 100 P ) + ( 100 ) ----- = ---------------------------------------------------------------------------------3 2 Vd D + D ( 300 ) + D ( 200 P ) + ( 200 )
2 3 2
94.3, -3.992, -0.263 0, -4.5+/-8.65j -0.0099, -4.99+/-8.66j -0.01, -4.995+/-8.657j -0.01, -5+/-8.66j -0.019, -5.49+/-8.64j -0.099, -13.52, -13.546 -0.0174, -104.3, -5.572
Kd = 1 Ns/m
M = 1 kg M = 1kg y F F Ks y
b) If the input force is a step function of magnitude 1N, calculate the time response for y by solving a differential equation for a Ks value of 10N/m. c) Draw the poles for the transfer function on a real-complex plane. d) Draw a Bode plot for Ks = 1N/m. 2. Draw a root locus diagram for the feedback system below given the variable parameter P.
Vd
+ -
e Va
Vs
1 --D
3. For the transfer functions below, draw the root locus plots assuming there is unity feedback, i.e., H(D) = 1. Draw an approximate time response for each for a step input. G(s) = 1 -----------D+1 1 --------------2 D +1 1 -------------------2 (D + 1) 1 ----------------------------2 D + 2D + 2
4. Draw a root-locus plot for the following feedback control systems. C + K 2 -----2 D 1 -------------------2 (D + 1) R
+ K 2D
2
1 -------------------2 (D + 1)
+ K 2 -----2 D
(D + 1)
Topics:
Objectives:
12.1 INTRODUCTION
how they are different from linear - no transfer functions - new elements needed in block diagrams
In this case the relationship between pressure drop and flow are non-linear. We need to develop an equation that approximates the local operating point. q p R( q q) (p) R --------------q q R = 2 ----2 K q p (p) q
Figure 12.1
12.3.2 Switching
- system components turned on/off - cables in tension/compression - show an example where input conditions change
y + 4y = f(t)
- give PWM (Pulse Width Modulation) example with ripple showing equivalent voltage. PWM is used to generate analog voltage equivalents. Show for a system with first
order response with tau = 0.1s for a frequency of 1KHz, 10Hz and 1Hz. Point out the ripple and effective voltage. - important to consider when doing system analysis
12.3.3 Deadband
- Friction in all components - costs money to reduce friction, so it is better to compensate in software - small actuation signals not large enough to overcome friction - This effect is normally known as stiction, a combination of the words static and friction. - Friction is common in less expensive motors, and when a motor is driving a mechanical system. - In systems there are two type of friction that must be considered. - The static friction, stiction, will prevent initial motion. If the systems breaks free and starts turning, the kinetic friction will provide a roughly constant friction resistance. - relationship in figure below. - the region where the applied voltage has no effect is called the deadband.
Figure 12.2
-Vstick
Figure 12.3
Cadjusted C max = 255 Cstick C min = 255 -Cstick C min = 255 Cwanted C max = 255 if(Cwanted > 0) C wanted& - ( C adjusted = C stick + % ---------------- C stick ) ! C max " C max
C wanted& ----------------- ( C stick ) C adjusted = C stick + % ! C min " C min if(Cwanted = 0) C adjusted = 0 Figure 12.4 Deadband approximation for a bidirectional motor
if(Cwanted < 0)
- c-code below
100 -110 /* make the value positive */ 255 -255 /* make the value positive */
int deadband(int c_wanted){ /* call this routine when updating */ int c_adjusted; if(c_wanted == 0){ /* turn off the output */ c_adjusted = 0; } else if(c_wanted > 0){ /* a positive output */ c_adjusted = c_stick_pos + (c_max - c_stick_pos) * c_wanted / c_max; if(c_adjusted > c_max) c_adjusted = c_max; } else { /* the output must be negative */ c_adjusted = -c_stick_neg (c_min - c_stick_neg) * c_wanted / c_min; if(c_adjusted < -c_min) c_adjusted = c_min; } return c_adjusted; }
Figure 12.5
- correct by tracking the previous motion direction and taking extra steps when reversing direction
Time delays are common in systems In the simplest form this is a period of time between when an event occurs and when the effect occurs. If an output delay is larger than the control system step time it may be necessary to predict future states and initiate outputs ahead of those. If an input delay is larger than the control system it might be necessary to slow the control action, or build it into the control law.
12.4 SUMMARY
analog IO - 13.1
13.1 INTRODUCTION
An analog value is continuous, not discrete, as shown in Figure 13.1. In the previous chapters, techniques were discussed for designing continuos control systems. In this chapter we will examine analog inputs and outputs so that we may design continuous control systems that use computers.
Typical analog inputs and outputs for computers are listed below. Actuators and sensors that can be used with analog inputs and outputs will be discussed in later chapters. Inputs: oven temperature fluid pressure fluid flow rate Outputs:
analog IO - 13.2
fluid valve position motor position motor velocity A basic analog input is shown in Figure 13.2. In this type of system a physical value is converted to a voltage, current or other value by a transducer. A signal conditioner converts the signal from the transducer to a voltage or current that is read by the analog input.
physical phenomenon
signal conditioning
analog input
integer
Figure 13.2
Analog inputs
Analog to digital and digital to analog conversion uses integers within the computer. Integers limit the resolution of the numbers to a discrete, or quantized range. The effect of using integers is shown in Figure 13.3 where the desired or actual analog value is continuous, but the possible integer values are quantified with a staircase set of values. Consider when a continuous analog voltage is being read, it must be quantized into an available integer value. Likewise, a desired analog output value is limited to available quantized values. In general the difference between the analog and quantized integer value is an error based upon the resolution of the analog I/O.
analog
continuous quantized
integer
analog IO - 13.3
Figure 13.3
Quantization error
voltage
Figure 13.4
A more realistic drawing of sampled data is shown in Figure 13.5. This data is noisier, and even between the start and end of the data sample there is a significant change in the voltage value. The data value sampled will be somewhere between the voltage at the start and end of the sample. The maximum (Vmax) and minimum (Vmin) voltages are a function of the control hardware. These are often specified when purchasing hardware, but reasonable ranges are;
analog IO - 13.4
0V to 5V 0V to 10V -5V to 5V -10V to 10V The number of bits of the A/D converter is the number of bits in the result word. If the A/D converter is 8 bit then the result can read up to 256 different voltage levels. Most A/D converters have 12 bits, 16 bit converters are used for precision measurements.
V(t) V max
V ( t2 )
V ( t1 )
V ( t 1 ), V ( t 2 ) = voltage at start, end of sample V min, V max = input voltage range of A/D converter N = number of bits in the A/D converter
Figure 13.5
The parameters defined in Figure 13.5 can be used to calculate values for A/D converters. These equations are summarized in Figure 13.6. Equation 1 relates the number of
analog IO - 13.5
bits of an A/D converter to the resolution. Equation 2 gives the error that can be expected with an A/D converter given the range between the minimum and maximum voltages, and the resolution (this is commonly called the quantization error). Equation 3 relates the voltage range and resolution to the voltage input to estimate the integer that the A/D converter will record. Finally, equation 4 allows a conversion between the integer value from the A/ D converter, and a voltage in the computer.
R = 2
(1) (2)
V max Vmin$ ---------------------------V ERROR = # ! " 2R V in V min $ - (R 1) V I = INT # ---------------------------! V max V min" VI $ ----------VC = # ! R 1" ( V max V min ) + Vmin where, R = resolution of A/D converter
(3)
(4)
V I = the integer value representing the input voltage V C = the voltage calculated from the integer value V ERROR = the maximum quantization error
Figure 13.6
Consider a simple example, a 10 bit A/D converter can read voltages between 10V and 10V. This gives a resolution of 1024, where 0 is -10V and 1023 is +10V. Because there are only 1024 steps there is a maximum error of 9.8mV. If a voltage of 4.564V is input into the PLC, the A/D converter converts the voltage to an integer value of 746. When we convert this back to a voltage the result is 4.570V. The resulting quantization error is 4.570V-4.564V=+0.006V. This error can be reduced by selecting an A/D converter with more bits. Each bit halves the quantization error.
analog IO - 13.6
= 1024
V max V min$ - = 0.0098 V V ERROR = # ---------------------------! " 2R V in V min $ - R = 746 V I = INT # ---------------------------! V max V min" VI$ - (V V C = # --- Vmin ) + V min = 4.570 V ! R " max Figure 13.7 Sample Calculation of A/D Values
If the voltage being sampled is changing too fast we may get false readings, as shown in Figure 13.8. In the upper graph the waveform completes seven cycles, and 9 samples are taken. The bottom graph plots out the values read. The sampling frequency was too low, so the signal read appears to be different that it actually is, this is called aliasing.
analog IO - 13.7
Figure 13.8
Figure 13.9
The Nyquist criterion specifies that sampling frequencies should be at least twice the frequency of the signal being measured, otherwise aliasing will occur. The example in
analog IO - 13.8
Figure 13.8 violated this principle, so the signal was aliased. If this happens in real applications the process will appear to operate erratically. In practice the sample frequency should be 4 or more times faster than the system frequency.
f AD > 2 f signal
where,
There are other practical details that should be considered when designing applications with analog inputs; Noise - Since the sampling window for a signal is short, noise will have added effect on the signal read. For example, a momentary voltage spike might result in a higher than normal reading. Shielded data cables are commonly used to reduce the noise levels. Delay - When the sample is requested, a short period of time passes before the final sample value is obtained. Multiplexing - Most analog input cards allow multiple inputs. These may share the A/D converter using a technique called multiplexing. If there are 4 channels using an A/D converter with a maximum sampling rate of 100Hz, the maximum sampling rate per channel is 25Hz. Signal Conditioners - Signal conditioners are used to amplify, or filter signals coming from transducers, before they are read by the A/D converter. Resistance - A/D converters normally have high input impedance (resistance), so they affect circuits they are measuring. Single Ended Inputs - Voltage inputs to a PLC can use a single common for multiple inputs, these types of inputs are called single ended inputs. These tend to be more prone to noise. Double Ended Inputs - Each double ended input has its own common. This reduces problems with electrical noise, but also tends to reduce the number of inputs by half. Sampling Rates - The maximum number of samples that can be read each second. If reading multiple channels with a multiplexer, this may be reduced. Quantization Error - Analog IO is limited by the binary resolution of the converter. This means that the output is at discrete levels, instead of continuous values. Triggers - often external digital signals are used to signal the start of data collection. Range - the typical voltages that the card can read. Typical voltage ranges are 10V to 10V, 0V to 10V, 0V to 5V, 1V to 5V, -5V to 5V, 4mA to 20mA. DMA - a method to write large blocks of memory directly to computer memory. This is normally used for high speed data captures.
analog IO - 13.9
Filters - some A/D input cards will provide built in functions to filter the incoming data to remove high frequency noise components. Input impedance - most analog inputs have very high input resistances, in the range of Mohms.
ASIDE: This device is an 8 bit A/D converter. The main concept behind this is the successive approximation logic. Once the reset is toggled the converter will start by setting the most significant bit of the 8 bit number. This will be converted to a voltage Ve that is a function of the +/-Vref values. The value of Ve is compared to Vin and a simple logic check determines which is larger. If the value of Ve is larger the bit is turned off. The logic then repeats similar steps from the most to least significant bits. Once the last bit has been set on/off and checked the conversion will be complete, and a done bit can be set to indicate a valid conversion value. Vin above (+ve) or below (-ve) Ve Vin +Vref successive approximation logic 8 D to A converter
+ -
clock reset
Ve done
-Vref
data out
Quite often an A/D converter will multiplex between various inputs. As it switches the voltage will be sampled by a sample and hold circuit. This will then be converted to a digital value. The sample and hold circuits can be used before the multiplexer to collect data values at the same instant in time.
analog IO - 13.10
R = 2
(5) (6)
V max Vmin$ ---------------------------V ERROR = # ! " 2R V desired V min$ VI = INT # ----------------------------------R ! Vmax V min " V I$ ---V output = # ! R " ( V max V min ) + V min
(7)
(8)
where, R = resolution of A/D converter V ERROR = the maximum quantization error V I = the integer value representing the desired voltage V output = the voltage output using the integer value V desired = the desired output voltage
Figure 13.11 Analog Output Relationships Assume we are using an 8 bit D/A converter that outputs values between 0V and 10V. We have a resolution of 256, where 0 results in an output of 0V and 255 results in 10V. The quantization error will be 20mV. If we want to output a voltage of 6.234V, we would specify an output integer of 160, this would result in an output voltage of 6.250V. The quantization error would be 6.250V-6.234V=0.016V.
analog IO - 13.11
= 256
V max V min$ - = 0.020 V V ERROR = # ---------------------------! " 2R V in V min $ - R = 160 V I = INT # ---------------------------! V max V min" VI$ - (V V C = # --- Vmin ) + V min = 6.250 V ! R " max The current output from a D/A converter is normally limited to a small value, typically less than 20mA. This is enough for instrumentation, but for high current loads, such as motors, a current amplifier is needed. This type of interface will be discussed later. If the current limit is exceeded for 5V output, the voltage will decrease (so dont exceed the rated voltage). If the current limit is exceeded for long periods of time the D/A output may be damaged.
analog IO - 13.12
= 0 = V
Next, sum the currents into the inverting input as a function of the output voltage and the input voltages from the computer, Vb3 V b2 Vb1 V b0 Vo -------------- + -------------- + -------------- + -------------- = ----------10 K 20 K 40 K 80 K 5K V o = 0.5 V b3 + 0.25 V b2 + 0.125 V b1 + 0.0625 Vb 0 Consider an example where the binary output is 1110, with 5V for on, V o = 0.5 ( 5 V ) + 0.25 ( 5 V ) + 0.125 ( 5 V ) + 0.625 ( 0 V ) = 4.375 V
13.4.1 Shielding
When a changing magnetic field cuts across a conductor, it will induce a current flow. The resistance in the circuits will convert this to a voltage. These unwanted voltages
analog IO - 13.13
result in erroneous readings from sensors, and signal to outputs. Shielding will reduce the effects of the interference. When shielding and grounding are done properly, the effects of electrical noise will be negligible. Shielding is normally used for; all logical signals in noisy environments, high speed counters or high speed circuitry, and all analog signals. There are two major approaches to reducing noise; shielding and twisted pairs. Shielding involves encasing conductors and electrical equipment with metal. As a result electrical equipment is normally housed in metal cases. Wires are normally put in cables with a metal sheath surrounding both wires. The metal sheath may be a thin film, or a woven metal mesh. Shielded wires are connected at one end to "drain" the unwanted signals into the cases of the instruments. Figure 13.13 shows a thermocouple connected with a thermocouple. The cross section of the wire contains two insulated conductors. Both of the wires are covered with a metal foil, and final covering of insulation finishes the cable. The wires are connected to the thermocouple as expected, but the shield is only connected on the amplifier end to the case. The case is then connected to the shielding ground, shown here as three diagonal lines.
Figure 13.13 Shielding for a Thermocouple A twisted pair is shown in Figure 13.14. The two wires are twisted at regular intervals, effectively forming small loops. In this case the small loops reverse every twist, so any induced currents are cancel out for every two twists.
analog IO - 13.14
Figure 13.14 A Twisted Pair When designing shielding, the following design points will reduce the effects of electromagnetic interference. Avoid noisy equipment when possible. Choose a metal cabinet that will shield the control electronics. Use shielded cables and twisted pair wires. Separate high current, and AC/DC wires from each other when possible. Use current oriented methods such as sourcing and sinking for logical I/O. Use high frequency filters to eliminate high frequency noise. Use power line filters to eliminate noise from the power supply.
13.4.2 Grounding
- ground voltages are based upon the natural voltage level in the physical ground (the earth under your feet). This will vary over a distance. Most buildings and electrical systems use a ground reference for the building. Between different points on the same building ground voltage levels may vary as much as a few hundred millivolts. This can lead to significant problems with voltage readings and system safety. - A signal can be floating, or connected to a ground - if floating a system normally has a self contained power source, or self reference such as a battery, strain gauge or thermocouple. These are usually read with double ended outputs. The potential for floating voltage levels can be minimized by connecting larger resistors (up to 100K) from the input to ground. - a grounded system uses a single common (ground) for all signals. These are normally connected to a single ended inputs. - the analog common can also be connected to the ground with a large resistor to drain off induced voltages.
analog IO - 13.15
- cable shields or grounds are normally only connected at one side to prevent ground loops.
13.6 SUMMARY
A/D conversion will convert a continuous value to an integer value. D/A conversion is easier and faster and will convert a digital value to an analog value. Resolution limits the accuracy of A/D and D/A converters. Sampling too slowly will alias the real signal. Analog inputs are sensitive to noise. Analog shielding should be used to improve the quality of electrical signals.
analog IO - 13.16
2. 10 V ( 10 V ) R = --------------------------------= 200 0.1 V 7 bits, R = 128 8 bits, R = 256 The minimum number of bits is 8.
V in V min $ - ( R 1 ) = 2607 V I = INT # ---------------------------! V max V min" VI $ ----------VC = # ! R 1" ( V max V min ) + Vmin = 2.733 V error = V c V in = ( 0.002 ) V
14.1 INTRODUCTION
Continuous sensors convert physical phenomena to measurable signals, typically voltages or currents. Consider a simple temperature measuring device, there will be an increase in output voltage proportional to a temperature rise. A computer could measure the voltage, and convert it to a temperature. The basic physical phenomena typically measured with sensors include; - angular or linear position - acceleration - temperature - pressure or flow rates - stress, strain or force - light intensity - sound Most of these sensors are based on subtle electrical properties of materials and devices. As a result the signals often require signal conditioners. These are often amplifiers that boost currents and voltages to larger voltages. Sensors are also called transducers. This is because they convert an input phenomena to an output in a different form. This transformation relies upon a manufactured device with limitations and imperfection. As a result sensor limitations are often charac-
terized with; Accuracy - This is the maximum difference between the indicated and actual reading. For example, if a sensor reads a force of 100N with a 1% accuracy, then the force could be anywhere from 99N to 101N. Resolution - Used for systems that step through readings. This is the smallest increment that the sensor can detect, this may also be incorporated into the accuracy value. For example if a sensor measures up to 10 inches of linear displacements, and it outputs a number between 0 and 100, then the resolution of the device is 0.1 inches. Repeatability - When a single sensor condition is made and repeated, there will be a small variation for that particular reading. If we take a statistical range for repeated readings (e.g., 3 standard deviations) this will be the repeatability. For example, if a flow rate sensor has a repeatability of 0.5cfm, readings for an actual flow of 100cfm should rarely be outside 99.5cfm to 100.5cfm. Linearity - In a linear sensor the input phenomenon has a linear relationship with the output signal. In most sensors this is a desirable feature. When the relationship is not linear, the conversion from the sensor output (e.g., voltage) to a calculated quantity (e.g., force) becomes more complex. Precision - This considers accuracy, resolution and repeatability or one device relative to another. Range - Natural limits for the sensor. For example, a sensor for reading angular rotation may only rotate 200 degrees. Dynamic Response - The frequency range for regular operation of the sensor. Typically sensors will have an upper operation frequency, occasionally there will be lower frequency limits. For example, our ears hear best between 10Hz and 16KHz. Environmental - Sensors all have some limitations over factors such as temperature, humidity, dirt/oil, corrosives and pressures. For example many sensors will work in relative humidities (RH) from 10% to 80%. Calibration - When manufactured or installed, many sensors will need some calibration to determine or set the relationship between the input phenomena, and output. For example, a temperature reading sensor may need to be zeroed or adjusted so that the measured temperature matches the actual temperature. This may require special equipment, and need to be performed frequently. Cost - Generally more precision costs more. Some sensors are very inexpensive, but the signal conditioning equipment costs are significant.
Figure 14.1
A Potentiometer
The potentiometer in Figure 14.2 is being used as a voltage divider. As the wiper rotates the output voltage will be proportional to the angle of rotation.
V1 max w
V out
V2
Figure 14.2
Potentiometers are popular because they are inexpensive, and dont require special signal conditioners. But, they have limited accuracy, normally in the range of 1% and they are subject to mechanical wear. Potentiometers measure absolute position, and they are calibrated by rotating them in their mounting brackets, and then tightening them in place. The range of rotation is normally limited to less than 360 degrees or multiples of 360 degrees. Some potentiometers can rotate without limits, and the wiper will jump from one end of the resistor to the other. Faults in potentiometers can be detected by designing the potentiometer to never reach the ends of the range of motion. If an output voltage from the potentiometer ever reaches either end of the range, then a problem has occurred, and the machine can be shut down. Two examples of problems that might cause this are wires that fall off, or the potentiometer rotates in its mounting.
14.2.2 Encoders
Encoders use rotating disks with optical windows, as shown in Figure 14.3. The encoder contains an optical disk with fine windows etched into it. Light from emitters passes through the openings in the disk to detectors. As the encoder shaft is rotated, the light beams are broken. The encoder shown here is a quadrature encode, and it will be discussed later.
light emitters
light detectors
Shaft rotates
Note: this type of encoder is commonly used in computer mice with a roller ball.
Figure 14.3
An Encoder Disk
There are two fundamental types of encoders; absolute and incremental. An absolute encoder will measure the position of the shaft for a single rotation. The same shaft angle will always produce the same reading. The output is normally a binary or grey code number. An incremental (or relative) encoder will output two pulses that can be used to determine displacement. Logic circuits or software is used to determine the direction of rotation, and count pulses to determine the displacement. The velocity can be determined by measuring the time between pulses. Encoder disks are shown in Figure 14.4. The absolute encoder has two rings, the outer ring is the most significant digit of the encoder, the inner ring is the least significant digit. The relative encoder has two rings, with one ring rotated a few degrees ahead of the other, but otherwise the same. Both rings detect position to a quarter of the disk. To add accuracy to the absolute encoder more rings must be added to the disk, and more emitters and detectors. To add accuracy to the relative encoder we only need to add more windows to the existing two rings. Typical encoders will have from 2 to thousands of windows per ring.
absolute encoder
Figure 14.4
Encoder Disks
When using absolute encoders, the position during a single rotation is measured directly. If the encoder rotates multiple times then the total number of rotations must be counted separately. When using a relative encoder, the distance of rotation is determined by counting the pulses from one of the rings. If the encoder only rotates in one direction then a simple count of pulses from one ring will determine the total distance. If the encoder can rotate both directions a second ring must be used to determine when to subtract pulses. The quadrature scheme, using two rings, is shown in Figure 14.5. The signals are set up so that one is out of phase with the other. Notice that for different directions of rotation, input B either leads or lags A.
total displacement can be determined by adding/subtracting pulse counts (direction determines add/subtract)
Note: To determine direction we can do a simple check. If both are off or on, the first to change state determines direction. Consider a point in the graphs above where both A and B are off. If A is the first input to turn on the encoder is rotating clockwise. If B is the first to turn on the rotation is counterclockwise. Aside: A circuit (or program) can be built for this circuit using an up/down counter. If the positive edge of input A is used to trigger the clock, and input B is used to drive the up/down count, the counter will keep track of the encoder position.
Figure 14.5
Quadrature Encoders
Interfaces for encoders are commonly available for PLCs and as purchased units. Newer PLCs will also allow two normal inputs to be used to decode encoder inputs.
Normally absolute and relative encoders require a calibration phase when a controller is turned on. This normally involves moving an axis until it reaches a logical sensor that marks the end of the range. The end of range is then used as the zero position. Machines using encoders, and other relative sensors, are noticeable in that they normally move to some extreme position before use.
14.2.2.1 - Tachometers Tachometers measure the velocity of a rotating shaft. A common technique is to mount a magnet to a rotating shaft. When the magnetic moves past a stationary pick-up coil, current is induced. For each rotation of the shaft there is a pulse in the coil, as shown in Figure 14.6. When the time between the pulses is measured the period for one rotation can be found, and the frequency calculated. This technique often requires some signal conditioning circuitry.
rotating shaft
Vout
t magnet 1/f
Figure 14.6
A Magnetic Tachometer
Another common technique uses a simple permanent magnet DC generator (note: you can also use a small DC motor). The generator is hooked to the rotating shaft. The rotation of a shaft will induce a voltage proportional to the angular velocity. This technique will introduce some drag into the system, and is used where efficiency is not an issue. Both of these techniques are common, and inexpensive.
Rotational potentiometers were discussed before, but potentiometers are also available in linear/sliding form. These are capable of measuring linear displacement over long distances. Figure 14.7 shows the output voltage when using the potentiometer as a voltage divider.
Figure 14.7
Linear Potentiometer
Linear/sliding potentiometers have the same general advantages and disadvantages of rotating potentiometers.
14.2.3.2 - Linear Variable Differential Transformers (LVDT) Linear Variable Differential Transformers (LVDTs) measure linear displacements over a limited range. The basic device is shown in Figure 14.8. It consists of outer coils with an inner moving magnetic core. High frequency alternating current (AC) is applied to the center coil. This generates a magnetic field that induces a current in the two outside coils. The core will pull the magnetic field towards it, so in the figure more current will be induced in the left hand coil. The outside coils are wound in opposite directions so that when the core is in the center the induced currents cancel, and the signal out is zero (0Vac). The magnitude of the signal out voltage on either line indicates the position of the core. Near the center of motion the change in voltage is proportional to the displacement. But, further from the center the relationship becomes nonlinear.
x V = Kx
where, AC input
V = output voltage
K = constant for device
x = core displacement
signal out
Figure 14.8
An LVDT
Aside: The circuit below can be used to produce a voltage that is proportional to position. The two diodes convert the AC wave to a half wave DC wave. The capacitor and resistor values can be selected to act as a low pass filter. The final capacitor should be large enough to smooth out the voltage ripple on the output.
Vdc out
Figure 14.9
These devices are more accurate than linear potentiometers, and have less friction. Typical applications for these devices include measuring dimensions on parts for quality
control. They are often used for pressure measurements with Bourdon tubes and bellows/ diaphragms. A major disadvantage of these sensors is the high cost, often in the thousands.
14.2.3.3 - Moire Fringes High precision linear displacement measurements can be made with Moire Fringes, as shown in Figure 14.10. Both of the strips are transparent (or reflective), with black lines at measured intervals. The spacing of the lines determines the accuracy of the position measurements. The stationary strip is offset at an angle so that the strips interfere to give irregular patterns. As the moving strip travels by a stationary strip the patterns will move up, or down, depending upon the speed and direction of motion.
Moving
Stationary
Note: you can recreate this effect with the strips below. Photocopy the pattern twice, overlay the sheets and hold them up to the light. You will notice that shifting one sheet will cause the stripes to move up or down.
Figure 14.10 The Moire Fringe Effect A device to measure the motion of the moire fringes is shown in Figure 14.11. A light source is collimated by passing it through a narrow slit to make it one slit width. This is then passed through the fringes to be detected by light sensors. At least two light sensors are needed to detect the bright and dark locations. Two sensors, close enough, can act as a quadrature pair, and the same method used for quadrature encoders can be used to determine direction and distance of motion.
on off on off
Figure 14.11 Measuring Motion with Moire Fringes These are used in high precision applications over long distances, often meters. They can be purchased from a number of suppliers, but the cost will be high. Typical applications include Coordinate Measuring Machines (CMMs).
14.2.3.4 - Accelerometers Accelerometers measure acceleration using a mass suspended on a force sensor, as shown in Figure 14.12. When the sensor accelerates, the inertial resistance of the mass will cause the force sensor to deflect. By measuring the deflection the acceleration can be determined. In this case the mass is cantilevered on the force sensor. A base and housing enclose the sensor. A small mounting stud (a threaded shaft) is used to mount the accelerometer.
Figure 14.12 A Cross Section of an Accelerometer Accelerometers are dynamic sensors, typically used for measuring vibrations
between 10Hz to 10KHz. Temperature variations will affect the accuracy of the sensors. Standard accelerometers can be linear up to 100,000 m/s**2: high shock designs can be used up to 1,000,000 m/s**2. There is often a trade-off between a wide frequency range and device sensitivity (note: higher sensitivity requires a larger mass). Figure 14.13 shows the sensitivity of two accelerometers with different resonant frequencies. A smaller resonant frequency limits the maximum frequency for the reading. The smaller frequency results in a smaller sensitivity. The units for sensitivity is charge per m/s**2.
Figure 14.13 Piezoelectric Accelerometer Sensitivities The force sensor is often a small piece of piezoelectric material (discussed later in this chapter). The piezoelectic material can be used to measure the force in shear or compression. Piezoelectric based accelerometers typically have parameters such as, -100 to 250C operating range 1mV/g to 30V/g sensitivity operate well below one forth of the natural frequency The accelerometer is mounted on the vibration source as shown in Figure 14.14. The accelerometer is electrically isolated from the vibration source so that the sensor may be grounded at the amplifier (to reduce electrical noise). Cables are fixed to the surface of the vibration source, close to the accelerometer, and are fixed to the surface as often as possible to prevent noise from the cable striking the surface. Background vibrations can be detected by attaching control electrodes to non-vibrating surfaces. Each accelerometer is different, but some general application guidelines are; The control vibrations should be less than 1/3 of the signal for the error to be less than 12%). Mass of the accelerometers should be less than a tenth of the measurement mass. These devices can be calibrated with shakers, for example a 1g shaker will hit a peak velocity of 9.81 m/s**2.
isolated stud
Figure 14.14 Mounting an Accelerometer Equipment normally used when doing vibration testing is shown in Figure 14.15. The sensor needs to be mounted on the equipment to be tested. A pre-amplifier normally converts the charge generated by the accelerometer to a voltage. The voltage can then be analyzed to determine the vibration frequencies.
Sensor preamp
control system
Figure 14.15 Typical Connection for Accelerometers Accelerometers are commonly used for control systems that adjust speeds to reduce vibration and noise. Computer Controlled Milling machines now use these sensors to actively eliminate chatter, and detect tool failure. The signal from accelerometers can be
integrated to find velocity and acceleration. Currently accelerometers cost hundreds or thousands per channel. But, advances in micromachining are already beginning to provide integrated circuit accelerometers at a low cost. Their current use is for airbag deployment systems in automobiles.
L V + I
V L L- = -- = ----R = -I A wt where, R = resistance of wire V, I = voltage and current L = length of wire w, t = width and thickness A = cross sectional area of conductor = resistivity of material
After the wire in Figure 14.16 has been deformed it will take on the new dimensions and resistance shown in Figure 14.17. If a force is applied as shown, the wire will become longer, as predicted by Youngs modulus. But, the cross sectional area will decrease, as predicted by Poisons ratio. The new length and cross sectional area can then be used to find a new resistance.
F F- = ---- = -= E A wt
F = --------Ewt
L'L(1 + ) ---------------------------------------------$ R' = ------= # ! w' t' w ( 1 ) t ( 1 )" (1 + ) -1 R = R' R = R --------------------------------------( 1 ) ( 1 ) where,
Aside: Changes in strain gauge resistance are typically small (large values would require strains that would cause the gauges to plastically deform). As a result, Wheatstone bridges are used to amplify the small change. In this circuit the variable resistor R2 would be tuned until Vo = 0V. Then the resistance of the strain gage can be calculated using the given equation. V+ R2 R1 R strain = ------------- when Vo = 0V R3 R1 R4
R2
+ R3 R5 Vo
Rstrain
Figure 14.18 Measuring Strain with a Wheatstone Bridge A strain gage must be small for accurate readings, so the wire is actually wound in a uniaxial or rosette pattern, as shown in Figure 14.19. When using uniaxial gages the direction is important, it must be placed in the direction of the normal stress. (Note: the gages cannot read shear stress.) Rosette gages are less sensitive to direction, and if a shear force is present the gage will measure the resulting normal force at 45 degrees. These gauges are sold on thin films that are glued to the surface of a part. The process of mounting strain gages involves surface cleaning. application of adhesives, and soldering leads to the strain gages.
stress direction uniaxial Figure 14.19 Wire Arrangements in Strain Gages A design techniques using strain gages is to design a part with a narrowed neck to mount the strain gage on, as shown in Figure 14.20. In the narrow neck the strain is proportional to the load on the member, so it may be used to measure force. These parts are often called load cells.
rosette
Figure 14.20 Using a Narrow to Increase Strain Strain gauges are inexpensive, and can be used to measure a wide range of stresses with accuracies under 1%. Gages require calibration before each use. This often involves making a reading with no load, or a known load applied. An example application includes using strain gages to measure die forces during stamping to estimate when maintenance is needed.
14.2.4.2 - Piezoelectric When a crystal undergoes strain it displaces a small amount of charge. In other words, when the distance between atoms in the crystal lattice changes some electrons are forced out or drawn in. This also changes the capacitance of the crystal. This is known as
the Piezoelectric effect. Figure 14.21 shows the relationships for a crystal undergoing a linear deformation. The charge generated is a function of the force applied, the strain in the material, and a constant specific to the material. The change in capacitance is proportional to the change in the thickness.
+ q a
F ab dC = -------i = g ---F c dt where, C = capacitance change a, b, c = geometry of material = dielectric constant (quartz typ. 4.06*10**-11 F/m) i = current generated F = force applied g = constant for material (quartz typ. 50*10**-3 Vm/N) E = Youngs modulus (quartz typ. 8.6*10**10 N/m**2)
Figure 14.21 The Piezoelectric Effect These crystals are used for force sensors, but they are also used for applications such as microphones and pressure sensors. Applying an electrical charge can induce strain, allowing them to be used as actuators, such as audio speakers. When using piezoelectric sensors charge amplifiers are needed to convert the small amount of charge to a larger voltage. These sensors are best suited to dynamic measurements, when used for static measurements they tend to drift or slowly lose charge, and the signal value will change.
PV = nRT where, P = the gas pressure V = the volume of the gas n = the number of moles of the gas R = the ideal gas constant = T = the gas temperature
When flowing, the flow may be smooth, or laminar. In case of high flow rates or unrestricted flow, turbulence may result. The Reynolds number is used to determine the transition to turbulence. The equation below is for calculation the Reynolds number for fluid flow in a pipe. A value below 2000 will result in laminar flow. At a value of about 3000 the fluid flow will become uneven. At a value between 7000 and 8000 the flow will become turbulent.
VD R = ----------u where, R = Reynolds number V = velocity D = pipe diameter = fluid density u = viscosity
14.2.5.1 - Pressure Figure 14.22 shows different two mechanisms for pressure measurement. The Bourdon tube uses a circular pressure tube. When the pressure inside is higher than the surrounding air pressure (14.7psi approx.) the tube will straighten. A position sensor, connected to the end of the tube, will be elongated when the pressure increases.
pressure
pressure
b) Baffle
These sensors are very common and have typical accuracies of 0.5%.
14.2.5.2 - Venturi Valves When a flowing fluid or gas passes through a narrow pipe section (neck) the pressure drops. If there is no flow the pressure before and after the neck will be the same. The faster the fluid flow, the greater the pressure difference before and after the neck. This is known as a Venturi valve. Figure 14.23 shows a Venturi valve being used to measure a fluid flow rate. The fluid flow rate will be proportional to the pressure difference before and at the neck (or after the neck) of the valve.
fluid flow
Aside: Bernoullis equation can be used to relate the pressure drop in a venturi valve. p v-- + ---+ gz = C 2 where, p = pressure
2
= density
v = velocity g = gravitational constant z = height above a reference C = constant Consider the centerline of the fluid flow through the valve. Assume the fluid is incompressible, so the density does not change. And, assume that the center line of the valve does not change. This gives us a simpler equation, as shown below, that relates the velocity and pressure before and after it is compressed. 2 2 p before v before p after v after --------------- + ----------------- + gz = C = ----------- + -------------- + gz 2 2 p before v before p after v after --------------- + ----------------- = ----------- + ------------- 2 2
2 2 2
p before p after
The flow velocity v in the valve will be larger than the velocity in the larger pipe section before. So, the right hand side of the expression will be positive. This will mean that the pressure before will always be higher than the pressure after, and the difference will be proportional to the velocity squared.
Figure 14.24 The Pressure Relationship for a Venturi Valve Venturi valves allow pressures to be read without moving parts, which makes them very reliable and durable. They work well for both fluids and gases. It is also common to use Venturi valves to generate vacuums for actuators, such as suction cups.
14.2.5.3 - Coriolis Flow Meter Fluid passes through thin tubes, causing them to vibrate. As the fluid approaches the point of maximum vibration it accelerates. When leaving the point it decelerates. The
result is a distributed force that causes a bending moment, and hence twisting of the pipe. The amount of bending is proportional to the velocity of the fluid flow. These devices typically have a large constriction on the flow, and result is significant loses. Some of the devices also use bent tubes to increase the sensitivity, but this also increases the flow resistance. The typical accuracy for a Coriolis flowmeter is 0.1%.
14.2.5.4 - Magnetic Flow Meter A magnetic sensor applies a magnetic field perpendicular to the flow of a conductive fluid. As the fluid moves, the electrons in the fluid experience an electromotive force. The result is that a potential (voltage) can be measured perpendicular to the direction of the flow and the magnetic field. The higher the flow rate, the greater the voltage. The typical accuracy for these sensors is 0.5%. These flowmeters dont oppose fluid flow, and so they dont result in pressure drops.
14.2.5.5 - Ultrasonic Flow Meter A transmitter emits a high frequency sound at point on a tube. The signal must then pass through the fluid to a detector where it is picked up. If the fluid is flowing in the same direction as the sound it will arrive sooner. If the sound is against the flow it will take longer to arrive. In a transit time flow meter two sounds are used, one traveling forward, and the other in the opposite direction. The difference in travel time for the sounds is used to determine the flow velocity. A doppler flowmeter bounces a soundwave off particle in a flow. If the particle is moving away from the emitter and detector pair, then the detected frequency will be lowered, if it is moving towards them the frequency will be higher. The transmitter and receiver have a minimal impact on the fluid flow, and therefore dont result in pressure drops.
14.2.5.6 - Vortex Flow Meter Fluid flowing past a large (typically flat) obstacle will shed vortices. The frequency of the vortices will be proportional to the flow rate. Measuring the frequency allows an estimate of the flow rate. These sensors tend be low cost and are popular for low accuracy applications.
14.2.5.7 - Positive Displacement Meters In some cases more precise readings of flow rates and volumes may be required. These can be obtained by using a positive displacement meter. In effect these meters are like pumps run in reverse. As the fluid is pushed through the meter it produces a measurable output, normally on a rotating shaft.
14.2.5.8 - Pitot Tubes Gas flow rates can be measured using Pitot tubes, as shown in Figure 14.25. These are small tubes that project into a flow. The diameter of the tube is small (typically less than 1/8") so that it doesnt affect the flow.
gas flow
14.2.6 Temperature
Temperature measurements are very common with control systems. The temperature ranges are normally described with the following classifications. very low temperatures <-60 deg C - e.g. superconductors in MRI units low temperature measurement -60 to 0 deg C - e.g. freezer controls fine temperature measurements 0 to 100 deg C - e.g. environmental controls high temperature measurements <3000 deg F - e.g. metal refining/processing
14.2.6.1 - Resistive Temperature Detectors (RTDs) When a metal wire is heated the resistance increases. So, a temperature can be measured using the resistance of a wire. Resistive Temperature Detectors (RTDs) normally use a wire or film of platinum, nickel, copper or nickel-iron alloys. The metals are wound or wrapped over an insulator, and covered for protection. The resistances of these alloys are shown in Figure 14.26.
Material
Platinum -200 - 850 (-328 - 1562) Nickel -80 - 300 (-112 - 572) Copper -200 - 260 (-328 - 500) Figure 14.26 RTD Properties
These devices have positive temperature coefficients that cause resistance to increase linearly with temperature. A platinum RTD might have a resistance of 100 ohms at 0C, that will increase by 0.4 ohms/C. The total resistance of an RTD might double over the temperature range. A current must be passed through the RTD to measure the resistance. (Note: a voltage divider can be used to convert the resistance to a voltage.) The current through the RTD should be kept to a minimum to prevent self heating. These devices are more linear than thermocouples, and can have accuracies of 0.05%. But, they can be expensive
14.2.6.2 - Thermocouples Each metal has a natural potential level, and when two different metals touch there is a small potential difference, a voltage. (Note: when designing assemblies, dissimilar metals should not touch, this will lead to corrosion.) Thermocouples use a junction of dissimilar metals to generate a voltage proportional to temperature. This principle was discovered by T.J. Seebeck. The basic calculations for thermocouples are shown in Figure 14.27. This calculation provides the measured voltage using a reference temperature and a constant specific
to the device. The equation can also be rearranged to provide a temperature given a voltage.
measuring device
+ - V out
V out = ( T T ref ) V out - + T ref T = -------- where, V 50 ------ (typical) C T, T ref = current and reference temperatures
= constant (V/C)
Figure 14.27 Thermocouple Calculations The list in Table 1 shows different junction types, and the normal temperature ranges. Both thermocouples, and signal conditioners are commonly available, and relatively inexpensive. For example, most PLC vendors sell thermocouple input cards that will allow multiple inputs into the PLC.
Table 1: Thermocouple Types ANSI Type T J E K R S C Materials copper/constantan iron/constantan chromel/constantan chromel/aluminum platinum-13%rhodium/platinum platinum-10%rhodium/platinum tungsten-5%rhenium/tungsten-26%rhenium Temperature Range (F) -200 to 400 0 to 870 -200 to 900 -200 to 1250 0 to 1450 0 to 1450 0 to 2760 Voltage Range (mV) -5.60 to 17.82 0 to 42.28 -8.82 to 68.78 -5.97 to 50.63 0 to 16.74 0 to 14.97 0 to 37.07
mV 80 E
60 J 40
K C
20
Figure 14.28 Thermocouple Temperature Voltage Relationships (Approximate) The junction where the thermocouple is connected to the measurement instrument is normally cooled to reduce the thermocouple effects at those junctions. When using a thermocouple for precision measurement, a second thermocouple can be kept at a known temperature for reference. A series of thermocouples connected together in series produces a higher voltage and is called a thermopile. Readings can approach an accuracy of 0.5%.
14.2.6.3 - Thermistors Thermistors are non-linear devices, their resistance will decrease with an increase in temperature. (Note: this is because the extra heat reduces electron mobility in the semiconductor.) The resistance can change by more than 1000 times. The basic calculation is shown in Figure 14.29. often metal oxide semiconductors The calculation uses a reference temperature and resistance, with a constant for the device, to predict the resistance at another temperature. The expression can be rearranged to calculate the temperature given the resistance.
Rt = Ro e
To T = -------------------------------Rt $ # T o ln ----! R o" + where, Ro, R t = resistances at reference and measured temps. T o, T = reference and actual temperatures
Aside: The circuit below can be used to convert the resistance of the thermistor to a voltage using a Wheatstone bridge and an inverting amplifier. +V R1 R3 R5
+ R2 R4 Vout
Thermistors are small, inexpensive devices that are often made as beads, or metallized surfaces. The devices respond quickly to temperature changes, and they have a higher resistance, so junction effects are not an issue. Typical accuracies are 1%, but the devices are not linear, have a limited temperature/resistance range and can be self heating.
14.2.6.4 - Other Sensors IC sensors are becoming more popular. They output a digital reading and can have accuracies better than 0.01%. But, they have limited temperature ranges, and require some knowledge of interfacing methods for serial or parallel data. Pyrometers are non-contact temperature measuring devices that use radiated heat. These are normally used for high temperature applications, or for production lines where it is not possible to mount other sensors to the material.
14.2.7 Light
14.2.7.1 - Light Dependant Resistors (LDR) Light dependant resistors (LDRs) change from high resistance (>Mohms) in bright light to low resistance (<Kohms) in the dark. The change in resistance is non-linear, and is also relatively slow (ms).
Aside: an LDR can be used in a voltage divider to convert the change in resistance to a measurable voltage.
V low
14.2.8 Chemical
14.2.8.1 - pH The pH of an ionic fluid can be measured over the range from a strong base (alkaline) with pH=14, to a neutral value, pH=7, to a strong acid, pH=0. These measurements are normally made with electrodes that are in direct contact with the fluids.
14.2.8.2 - Conductivity Conductivity of a material, often a liquid is often used to detect impurities. This can be measured directly be applying a voltage across two plates submerged in the liquid and measuring the current. High frequency inductive fields is another alternative.
14.2.9 Others
A number of other detectors/sensors are listed below, Combustion - gases such as CO2 can be an indicator of combustion Humidity - normally in gases Dew Point - to determine when condensation will form
A Shield is a metal sheath that surrounds the wires Analog voltage source + -
Analog Input
Figure 14.32 Cable Shielding When connecting analog voltage sources to a controller the common, or reference voltage can be connected different ways, as shown in Figure 14.33. The least expensive method uses one shared common for all analog signals, this is called single ended. The more accurate method is to use separate commons for each signal, this is called double ended. Most analog input cards allow a choice between one or the other. But, when double ended inputs are used the number of available inputs is halved. Most analog output cards are double ended.
device + #1 device + #1 -
device + #1 device + #1 -
Single ended - with this arrangement the signal quality can be poorer, but more inputs are available.
Double ended - with this arrangement the signal quality can be better, but fewer inputs are available.
Figure 14.33 Single and Double Ended Inputs Signals from transducers are typically too small to be read by a normal analog input card. Amplifiers are used to increase the magnitude of these signals. An example of a single ended signal amplifier is shown in Figure 14.34. The amplifier is in an inverting configuration, so the output will have an opposite sign from the input. Adjustments are provided for gain and offset adjustments.
Note: op-amps are used in this section to implement the amplifiers because they are inexpensive, common, and well suited to simple design and construction projects. When purchasing a commercial signal conditioner, the circuitry will be more complex, and include other circuitry for other factors such as temperature compensation.
Vin
Ri
R f + R g$ V out = # ---------------! R i " V in + offset Figure 14.34 A Single Ended Signal Amplifier A differential amplifier with a current input is shown in Figure 14.35. Note that Rc converts a current to a voltage. The voltage is then amplified to a larger voltage.
R1 Iin Rc R2
Rf
Vout R3
R4
The circuit in Figure 14.36 will convert a differential (double ended) signal to a single ended signal. The two input op-amps are used as unity gain followers, to create a high input impedance. The following amplifier amplifies the voltage difference.
Vin
Figure 14.36 A Differential Input to Single Ended Output Amplifier The Wheatstone bridge can be used to convert a resistance to a voltage output, as shown in Figure 14.37. If the resistor values are all made the same (and close to the value of R3) then the equation can be simplified.
+V R1 R3 R5
+ R2 R4 Vout
R2 $ # 1 1- ----1-$ ----1-$ # ----------------- ----- ----V out = V ( R 5 ) # ! ! R 1 + R 2" ! R 3 + R 4 + R 5" R 3" or if R = R 1 = R 2 = R 4 = R 5 R -$ -------V out = V # ! 2 R 3" Figure 14.37 A Resistance to Voltage Amplifier
put is pulse train. Interferometers - These use the interference of light waves 180 degrees out of phase to determine distances. Typical sources of the monochromatic light required are lasers. Linear-Variable-Differential transformer (LVDT) electromechanical transducer used to measure angular or linear displacement. Output is Voltage Manometer - liquid column gage used widely in industry to measure pressure. Ohmmeter - meter to indicate electrical resistance Optical Pyrometer - device to measure temperature of an object at high temperatures by sensing the brightness of an objects surface. Orifice Plate - widely used flowmeter to indicate fluid flow rates Photometric Transducers - a class of transducers used to sense light, including phototubes, photodiodes, phototransistors, and photoconductors. Piezoelectric Accelerometer - Transducer used to measure vibration. Output is emf. Pitot Tube - Laboratory device used to measure flow. Positive displacement Flowmeter - Variety of transducers used to measure flow. Typical output is pulse train. Potentiometer - instrument used to measure voltage Pressure Transducers - A class of transducers used to measure pressure. Typical output is voltage. Operation of the transducer can be based on strain gages or other devices. Radiation pyrometer - device to measure temperature by sensing the thermal radiation emitted from the object. Resolver - this device is similar to an incremental encoder, except that it uses coils to generate magnetic fields. This is like a rotary transformer. Strain Gage - Widely used to indicate torque, force, pressure, and other variables. Output is change in resistance due to strain, which can be converted into voltage. Thermistor - Also called a resistance thermometer; an instrument used to measure temperature. Operation is based on change in resistance as a function of temperature. Thermocouple - widely used temperature transducer based on the Seebeck effect, in which a junction of two dissimilar metals emits emf related to temperature. Turbine Flowmeter - transducer to measure flow rate. Output is pulse train. Venturi Tube - device used to measure flow rates.
14.5 SUMMARY
Selection of continuous sensors must include issues such as accuracy and resolution. Angular positions can be measured with potentiometers and encoders (more accurate). Tachometers are useful for measuring angular velocity.
Linear positions can be measured with potentiometers (limited accuracy), LVDTs (limited range), moire fringes (high accuracy). Accelerometers measure acceleration of masses. Strain gauges and piezoelectric elements measure force. Pressure can be measured indirectly with bellows and Bourdon tubes. Flow rates can be measured with Venturi valves and pitot tubes. Temperatures can be measured with RTDs, thermocouples, and thermistors. Input signals can be single ended for more inputs or double ended for more accuracy.
14.6 REFERENCES
Bryan, L.A. and Bryan, E.A., Programmable Controllers; Theory and Implementation, Industrial Text Co., 1988. Swainston, F., A Systems Approach to Programmable Controllers, Delmar Publishers Inc., 1992.
ratio. If the position of the geared down shaft needs to be positioned to 0.1 degrees, what is the minimum resolution of the incremental encoder? 8. What is the difference between a strain gauge and an accelerometer? How do they work? 9. Use the equations for a permanent magnet DC motor to explain how it can be used as a tachometer. 10. What are the trade-offs between encoders and potentiometers? 11. A potentiometer is connected to a PLC analog input card. The potentiometer can rotate 300 degrees, and the voltage supply for the potentiometer is +/-10V. Write a ladder logic program to read the voltage from the potentiometer and convert it to an angle in radians stored in F8:0.
1000 T ref 800 T ref 1 - = ---------------------------= ----------------------0.030 0.040 800 T ref = 750 0.75 T ref 50 = 0.25 T ref T ref = 200 F V out = 0.00005 ( 1200 200 ) = 0.050 V 0.040 50 V = -------------------------= ------------1000 200 F
6. a) b)
w $ 42 deg-$ -------------------------- + = (5V 0V)# V out = ( V2 V 1 ) # ! 300 deg" + 0 V = 0.7 V ! max" V 1 w $ ----------------2.765 V = ( 5 V 0 V ) # ! 300 deg" + 0 V w $ ----------------2.765 V = ( 5 V 0 V ) # ! 300 deg" + 0 V w = 165.9 deg
7. deg output = 0.1 ------------count input --------------- = 50 ----1 output deg -$ deg input = 50 # 0.1 ------------= 5 ------------! count" count
deg 360 -------rot count R = ------------------ = 72 ------------deg rot ------------5 count 8. strain gauge measures strain in a material using a stretching wire that increases resistance - accelerometers measure acceleration with a cantilevered mass on a piezoelectric element. 9. R V = Ks + When the motor shaft is turned by another torque source a voltage is generated that is proportional to the angular velocity. This is the reverse emf. A dmm, or other high impedance instrument can be used to measure this, thus minizing the loses in resistor R.
DMM
10. encoders cost more but can have higher resolutions. Potentiometers have limited ranges of motion 11. FS BTW Rack: 0 Group: 0 Module: 0 BT Array: BT9:0 Data File: N7:0 Length: 37 Continuous: no BT9:1/EN BTR Rack: 0 Group: 0 Module: 0 BT Array: BT9:1 Data File: N7:37 Length: 20 Continuous: no CPT Dest F8:0 Expression "20.0 * N7:41 / 4095.0 - 10" CPT Dest F8:0 Expression "300.0 * (F8:0 + 10) / 20" RAD Source F8:0 Dest F8:1
BT9:0/EN
BT9:1/DN
2. A high precision potentiometer has an accuracy of +/- 0.1% and can rotate 300degrees and is used as a voltage divider with a of 0V and 5V. The output voltage is being read by an A/D converter with a 0V to 10V input range. How many bits does the A/D converter need to accommodate the accuracy of the potentiometer? 3. The table of position and voltage values below were measured for an inexpensive potentiometer. Write a C subroutine that will accept a voltage value and interpolate the position value. theta (deg) V 0 67 145 195 213 296 315 0.1 0.6 1.6 2.4 3.4 4.2 5.0
Topics: Servo Motors; AC and DC Stepper motors Single axis motion control Hydraulic actuators
Objectives: To understand the main differences between continuous actuators Be able to select a continuous actuator To be able to plan a motion for a single servo actuator
15.1 INTRODUCTION
Continuous actuators allow a system to position or adjust outputs over a wide range of values. Even in their simplest form, continuous actuators tend to be mechanically complex devices. For example, a linear slide system might be composed of a motor with an electronic controller driving a mechanical slide with a ball screw. The cost for such actuators can easily be higher than for the control system itself. These actuators also require sophisticated control techniques that will be discussed in later chapters. In general, when there is a choice, it is better to use discrete actuators to reduce costs and complexity.
Motor Categories AC motors - rotate with relatively constant speeds proportional to the frequency of the supply power induction motors - squirrel cage, wound rotor - inexpensive, efficient. synchronous - fixed speed, efficient DC motors - have large torque and speed ranges permanent magnet - variable speed wound rotor and stator - series, shunt and compound (universal) Hybrid brushless permanent magnet stepper motors Contactors are used to switch motor power on/off Drives can be used to vary motor speeds electrically. This can also be done with mechanical or hydraulic machines. Popular drive categories Variable Frequency Drives (VFD) - vary the frequency of the power delivered to the motor to vary speed. DC motor controllers - variable voltage or current to vary the motor speed Eddy Current Clutches for AC motors - low efficiency, uses a moving iron drum and windings Wound rotor AC motor controllers - low efficiency, uses variable resistors to adjust the winding currents
A control system is required when a motor is used for an application that requires continuous position or velocity. A typical controller is shown in Figure 15.1. In any controlled system a command generator is required to specify a desired position. The controller will compare the feedback from the encoder to the desired position or velocity to determine the system error. The controller with then generate an output, based on the system error. The output is then passed through a power amplifier, which in turn drives the motor. The encoder is connected directly to the motor shaft to provide feedback of position.
encoder motor
Figure 15.1
I I magnetic field
axis of rotation
Figure 15.2
A Simplified Rotor
The power is delivered to the rotor using a commutator and brushes, as shown in Figure 15.3. In the figure the power is supplied to the rotor through graphite brushes rubbing against the commutator. The commutator is split so that every half revolution the polarity of the voltage on the rotor, and the induced magnetic field reverses to push against the permanent magnets.
motor shaft
brushes
Top Front
motor shaft
Figure 15.3
The direction of rotation will be determined by the polarity of the applied voltage, and the speed is proportional to the voltage. A feedback controller is used with these motors to provide motor positioning and velocity control. These motors are losing popularity to brushless motors. The brushes are subject to
wear, which increases maintenance costs. In addition, the use of brushes increases resistance, and lowers the motors efficiency.
ASIDE: The controller to drive a servo motor normally uses a Pulse Width Modulated (PWM) signal. As shown below the signal produces an effective voltage that is relative to the time that the signal is on. The percentage of time that the signal is on is called the duty cycle. When the voltage is on all the time the effective voltage delivered is the maximum voltage. So, if the voltage is only on half the time, the effective voltage is half the maximum voltage. This method is popular because it can produce a variable effective voltage efficiently. The frequency of these waves is normally above 20KHz, above the range of human hearing.
V max 0
V max 0
V max 0
V max 0
Figure 15.4
ASIDE: A PWM signal can be used to drive a motor with the circuit shown below. The PWM signal switches the NPN transistor, thus switching power to the motor. In this case the voltage polarity on the motor will always be the same direction, so the motor may only turn in one direction.
V+ V-
power supply
Figure 15.5
ASIDE: When a motor is to be controlled with PWM in two directions the H-bridge circuit (shown below) is a popular choice. These can be built with individual components, or purchased as integrated circuits for smaller motors. To turn the motor in one direction the PWM signal is applied to the Va inputs, while the Vb inputs are held low. In this arrangement the positive voltage is at the left side of the motor. To reverse the direction the PWM signal is applied to the Vb inputs, while the Va inputs are held low. This applies the positive voltage to the right side of the motor.
+Vs
Va
Vb
Vb
Va
-Vs
Figure 15.6
15.2.2 AC Motors
Power is normally generated as 3-phase AC, so using this increases the efficiency of electrical drives. In AC motors the AC current is used to create changing fields in the motor. Typically AC motors have windings on the stator with multiple poles. Each pole is a pair of windings. As the AC current reverses, the magnetic field in the rotor appears to rotate.
L1
stator windings
rotor
Neut.
Figure 15.7
L2 L1
L3
Neut.
Neut. Neut.
Figure 15.8
The number of windings (poles) can be an integer multiple of the number of phases of power. More poles results in a lower rotation of the motor. Rotor types for induction motors are listed below. Their function is to intersect changing magnetic fields from the stator. The changing field induces currents in the rotor. These currents in turn set up magnetic fields that oppose fields from the stator, generating a torque. Squirrel cage - has the shape of a wheel with end caps and bars Wound Rotor - the rotor has coils wound. These may be connected to external contacts via commutator Induction motors require slip. If the motor turns at the precise speed of the stator field, it will not see a changing magnetic field. The result would be a collapse of the rotor magnetic field. As a result an induction motor always turns slightly slower than the stator field. The difference is called the slip. This is typically a few percent. As the motor is loaded the slip will increase until the motor stalls.
An induction motor has the windings on the stator. The rotor is normally a squirrel cage design. The squirrel cage is a cast aluminum core that when exposed to a changing magnetic field will set up an opposing field. When an AC voltage is applied to the stator coils an AC magnetic field is created, the squirrel cage sets up an opposing magnetic field and the resulting torque causes the motor to turn. The motor will turn at a frequency close to that of the applied voltage, but there is always some slip. It is possible to control the speed of the motor by controlling the frequency of the AC voltage. Synchronous motor drives control the speed of the motors by synthesizing a variable frequency AC waveform, as shown in Figure 15.9.
Controller
Figure 15.9
These drives should be used for applications that only require a single rotational direction. The torque speed curve for a typical induction motor is shown in Figure 15.10. When the motor is used with a fixed frequency AC source the synchronous speed of the motor will be the frequency of AC voltage divided by the number of poles in the motor. The motor actually has the maximum torque below the synchronous speed. For example a motor 2 pole motor might have a synchronous speed of (2*60*60/2) 3600 RPM, but be rated for 3520 RPM. When a feedback controller is used the issue of slip becomes insignificant.
torque
operating range
Class A
torque
speed torque Class B speed torque Class C speed torque Class D speed
Wound rotor induction motors use external resistors. varying the resistance allows the motors torque speed curve to vary. As the resistance value is increased the motor torque speed curve shifts from the Class A to Class D shapes. The figure below shows the relationship between the motor speed and applied power, slip, and number of poles. An ideal motor with no load would have a slip of 0%.
f 120 S -$ - # 1 ------------RPM = ---------p ! 100%" where, f = power frequency (60Hz typ.) p = number of poles (2, 4, 6, etc...) RPM = motor speed in rotations per minute S = motor slip
Single phase AC motors can run in either direction. To compensate for this a shading pole is used on the stator windings. It basically acts as an inductor to one side of the field which slows the filed buildup and collapse. The result is that the field strength seems to naturally rotate. Thermal protection is normally used in motors to prevent overheating. Universal motors were presented earlier for DC applications, but they can also be used for AC power sources. This is because the field polarity in the rotor and stator both reverse as the AC current reverses. Synchronous motors are different from induction motors in that they are designed to rotate at the frequency of the fields, in other words there is no slip. Synchronous motors use generated fields in the rotor to oppose the stators field. Starting AC motors can be hard because of the low torque at low speeds. To deal with this a switching arrangement is often used. At low speeds other coils or capacitors are connected into the circuits. At higher speeds centrifugal switches disconnect these and the motor behavior switches.
Single phase induction motors are typically used for loads under 1HP. Various types (based upon their starting and running modes) are, - split phase - there are two windings on the motor. A starting winding is used to provide torque at lower speeds. - capacitor run - capacitor start - capacitor start and run - shaded pole - these motors use a small offset coil (such as a single copper winding) to encourage the field buildup to occur asymmetrically. These motors are for low torque applications much less than 1HP. - universal motors (also used with DC) have a wound rotor and stator that are connected in series.
Vin
running winding
Vin
running winding
Vin
running winding
running capacitor Capacitor Start and Capacitor Run Motor starting capacitor
Vin
running winding
V1
V2
V3
Figure 15.14 A Brushless DC Motor To continuously rotate these motors the current in the stator coils must alternate continuously. If the power supplied to the coils was a 3-phase AC sinusoidal waveform, the motor will rotate continuously. The applied voltage can also be trapezoidal, which will give a similar effect. The changing waveforms are controller using position feedback from the motor to select switching times. The speed of the motor is proportional to the frequency of the signal. A typical torque speed curve for a brushless motor is shown in Figure 15.15.
torque
speed
1 a b 1a 1b
2a
2b
unipolar
bipolar
Figure 15.16 Unipolar and Bipolar Stepper Motor Windings The motors are turned by applying different voltages at the motor terminals. The voltage change patterns for a unipolar motor are shown in Figure 15.17. For example, when the motor is turned on we might apply the voltages as shown in line 1. To rotate the motor we would then output the voltages on line 2, then 3, then 4, then 1, etc. Reversing the sequence causes the motor to turn in the opposite direction. The dynamics of the motor and load limit the maximum speed of switching, this is normally a few thousand steps per second. When not turning the output voltages are held to keep the motor in position.
Step 1 2 3 4
1a 1 0 0 1
2a 0 1 1 0
1b 1 1 0 0
2b 0 0 1 1
To turn the motor the phases are stepped through 1, 2, 3, 4, and then back to 1. To reverse the direction of the motor the sequence of steps can be reversed, eg. 4, 3, 2, 1, 4, ..... If a set of outputs is kept on constantly the motor will be held in position.
Figure 15.17 Stepper Motor Control Sequence for a Unipolar Motor Stepper motors do not require feedback except when used in high reliability applications and when the dynamic conditions could lead to slip. A stepper motor slips when the holding torque is overcome, or it is accelerated too fast. When the motor slips it will move a number of degrees from the current position. The slip cannot be detected without position feedback. Stepper motors are relatively weak compared to other motor types. The torque speed curve for the motors is shown in Figure 15.18. In addition they have different static and dynamic holding torques. These motors are also prone to resonant conditions because of the stepped motion control.
torque
speed
Figure 15.18 Stepper Motor Torque Speed Curve The motors are used with controllers that perform many of the basic control functions. At the minimum a translator controller will take care of switching the coil voltages. A more sophisticated indexing controller will accept motion parameters, such as distance, and convert them to individual steps. Other types of controllers also provide finer step resolutions with a process known as microstepping. This effectively divides the logical steps described in Figure 15.17 and converts them to sinusoidal steps. translators - the user indicates maximum velocity and acceleration and a distance to move indexer - the user indicates direction and number of steps to take microstepping - each step is subdivided into smaller steps to give more resolution
Va I a = ----Ra T = Kt Ia where, I a, V a, R a = Armature current, voltage and resistance T = Torque on motor shaft K t = Motor speed constant
operating range
Series motors\ - have the rotor and stator coils connected in series. - as the motor speed increases the current increases, the motor can theoreti-
cally accelerate to infinite speeds if unloaded. This makes the dangerous when used in applications where they are potentially unloaded. - these motors typically have greater starting torques that shunt motors
Va I a = ---------------Ra + Rf T = Kt Ia = Kt Ia where, I a, V a = Armature current, voltage R a, R f = Armature and field coil resistance T = Torque on motor shaft K t = Motor speed constant
2
stall torque
The XXXXXXX
e f = r a i a + Dla i a + e m em = Ke D T = KT ia ea = ( ra + la D ) i a + K e D T$ - + Ke D e a = ( r a + l a D ) # ----! K T" Figure 15.19 Equations for an armature controlled DC motor Compound motors\ - have the rotor and stator coils connected in series. - differential compound motors have the shunt and series winding field aligned so that they oppose each other. - cumulative compound motors have the shunt and series winding fields aligned so that they add
cumulative differential
ef = rf if + l f if D T = KT if T -- = JD 2 + BD 1 -- = ----------------------2 T JD + BD KT -- = --T -- = ----------------------2 if T if JD + BD KT $ # 1 $ # if --- = -- --- = % -----------------------& ----------------ef if ef ! JD 2 + BD" ! r f + l f D" if T 1 -$ --- = T -- --- = K T # ----------------! ef if ef r f + l f D"
15.3 HYDRAULICS
Hydraulic systems are used in applications requiring a large amount of force and slow speeds. When used for continuous actuation they are mainly used with position feedback. An example system is shown in Figure 15.21. The controller examines the position of the hydraulic system, and drivers a servo valve. This controls the flow of fluid to the actuator. The remainder of the provides the hydraulic power to drive the system.
controller
valve
position sensor
sump
Figure 15.21 Hydraulic Servo System The valve used in a hydraulic system is typically a solenoid controlled valve that is simply opened or closed. Newer, more expensive, valve designs use a scheme like pulse with modulation (PWM) which open/close the valve quickly to adjust the flow rate.
15.5 SUMMARY
AC motors work at higher speeds DC motors work over a range of speeds Motion control introduces velocity and acceleration limits to servo control Hydraulics make positioning easy
in 0.025 --------R steprot-------------------------- = = = 0.2 --------P step in-$ -----0.125 # ! rot" b) c) rotdeg = 0.2 --------= 72 --------step step in 3 ---s steps PPS = ------------------------ = 120 -----------in s 0.025 --------step
2. a) step -$ = 15 steps pulses = ( 3 rot ) # 5 --------! rot " pulses rot-$ # step min --------------- = # 25 --------$ = 125 steps ------------ = 125 # 1 ------------$ steps ------------ = 2.08 step --------5 --------! min" ! rot " ! 60 s " min s min s
b)
3. speed very low speeds limited speed range wide range torque low torque good at rated speed decreases at higher speeds
How many pulses are required to rotate the motor through three complete revolutions? If it is desired to rotate the motor at a speed of 25 rev/min, what pulse rate must be generated by the robot controller? 2. Describe the voltage ripple that would occur when using a permanent magnet DC motor as a tachometer. Hint: consider the use of the commutator to switch the polarity of the coil. 3. Compare the advantages/disadvantages of DC permanent magnet motors and AC induction motors.
Topics: Motion controllers Motion profiles, trapezoidal and smooth Gain schedulers Objectives: To understand single and multi axis motion control systems.
16.1 INTRODUCTION
A system with a feedback controller will attempt to drive the system to a state described by the desired input, such as a velocity. In earlier chapters we simply chose step inputs, ramp inputs and other simple inputs to determine the system response. In practical applications this setpoint needs to be generated automatically. A simple motion control system is used to generate setpoints over time. An example of a motion control system is shown in Figure 16.1. The motion controller will accept commands or other inputs to generate a motion profile using parameters such as distance to move, maximum acceleration and maximum velocity. The motion profile is then used to generate a set of setpoints, and times they should be output. The setpoint scheduler will then use a real-time clock to output these setpoints to the motor drive.
motion controller motion commands Motor Setpoint Generator Setpoint Scheduler Servo Drive
setpoint schedule motion profile t (s) 0 0.1 0.2 0.3 0.4 ..... setpoint 0.0 0.2 0.4 0.4 0.4 ....
Figure 16.1
A motion controller
The combination of a motion controller, drive and actuator is called an axis. When there is more than one drive and actuator the system is said to have multiple axes. Complex motion control systems such as computer controlled milling machines (CNC) and robots have 3 to 6 axes which must be moved in coordination.
( deg ) 100
20
t (s)
Figure 16.2
A trapezoidal velocity profile is shown in Figure 16.3. The area under the curve is the total distance moved. The slope of the initial and final ramp are the maximum acceleration and deceleration. The top level of the trapezoid is the maximum velocity. Some controllers allow the user to use the acceleration and deceleration times instead of the maximum acceleration and deceleration. This profile gives a continuous acceleration, but there will be a jerk (third order derivative) at the four sharp corners.
( deg ) max max 0 0 where, t acc t max t dec t total max t (s)
The basic relationships for these variables are shown in Figure 16.4. The equations can be used to find the acceleration and deceleration times. These equations can also be used to find the time at the maximum velocity. If this time is negative it indicates that the axis will not reach the maximum velocity, and the acceleration and deceleration times must be decreased. The resulting velocity profile will be a triangle.
max t acc = t dec = ---------- max t total = t acc + t max + t dec t acc t dec$ 1 - t acc max + t max max + 1 -- t dec max = max # ------- + t max + ------ = -! 2 2 2 2 " t dec - t acc - ---------t max = ---------- --------- max 2 2
Note: if the time calculated in equation 4 is negative then the axis never reaches maximum velocity, and the velocity profile becomes a triangle.
Figure 16.4
For the example in Figure 16.5 the move starts at 100deg and ends at 20 deg. The acceleration and decelerations are completed in half a second. The system moves for 7.5 seconds at the maximum velocity.
Given,
The times can be calculated as, t acc = t dec deg 10 ------- max s ------------------------= = = 0.5 s max deg 20 -------2 s
= end start = 20 deg 100 deg = 80 deg t t dec - ---------80 deg 0.5 s s - = --------------- 0.5 --------- = 7.5 s t max = ---------- acc- --------- -------- max 2 2 deg 2 2 10 -------s t total = t acc + t max + t dec = 0.5 s + 7.5 s + 0.5 s = 8.5 s
Figure 16.5
The motion example in Figure 16.6 is so short the axis never reaches the maximum velocity. This is made obvious by the negative time at maximum velocity. In place of this the acceleration and deceleration times can be calculated by using the basic acceleration position relationship. The result in this example is a motion that accelerates for 0.316s and then decelerates for the same time.
Given,
The times can be calculated as, deg 10 ------- max s ------------------------t acc = t dec = = = 0.5 s max deg 20 -------2 s = end start = 22 deg 20 deg = 2 deg t acc t dec - ---------2 deg 0.5 s s - ---------- = --------------- 0.5 --------- = 0.3 s t max = ---------- -------- max 2 2 deg 2 2 10 -------s The time was negative so the acceleration and deceleration times become, -- = 1 -- t2 2 2 max acc t acc = - = ----------max 2 deg = --------------deg 20 -------2 s 0.1 s = 0.316 s
2
t max = 0 s
Figure 16.6
Given the parameters calculated for the motion, the setpoints for motion can be calculated with the equations in Figure 16.7.
Assuming the motion starts at 0s, 0 s t < t acc 1 - max t 2 + start ( t ) = -2 t acc t < t acc + t max 1 - t 2 + max ( t t acc ) + start ( t ) = -2 max acc t acc + t max t < t acc + t max + t dec 1 - max t acc 2 + max t max + 1 -- max ( t t max t acc ) 2 + start ( t ) = -2 2 t acc + t max + t dec t ( t ) = end
Figure 16.7
A subroutine that implements these is shown in Figure 16.8. In this subroutine the time is looped with fixed time steps. The position setpoint values are put into the setpoint array, which will then be used elsewhere to guide the mechanism.
void generate_setpoint_table( double t_acc, double t_max, double t_step, double vel_max, double acc_max, double theta_start, double theta_end, double setpoint[], int *count){ double t, t_1, t_2, t_total; t_1 = t_acc; t_2 = t_acc + t_max; t_total = t_acc + t_max + t_acc; *count = 0; for(t = 0.0; t <= t_total; t += t_step){ if( t < t_1){ setpoint[*count] = 0.5*acc_max*t*t + theta_start; } else if ( (t >= t_1) && (t < t_2)){ setpoint[*count] = 0.5*acc_max*t_acc*t_acc + vel_max*(t - t_1) + theta_start; } else if ( (t >= t_2) && (t < t_total)){ setpoint[*count] = 0.5*acc_max*t_acc*t_acc + vel_max*(t_max) + 0.5*acc_max*(t-t_2)*(t-t_2) + theta_start; } else { setpoint[*count] = theta_end; } *count++; } setpoint[*count] = theta_end; *count++; }
Figure 16.8
In some cases the jerk should be minimized. This can be achieved by replacing the acceleration ramps with a smooth polynomial, as shown in Figure 16.9. In this case two quadratic polynomials will be used for the acceleration, and another two for the deceleration.
( t ) = At + Bt + C
An example of calculating the polynomial coefficients is given in Figure 16.10. The curve found is for the first half of the acceleration. It can then be used for the three other required curves.
Given,
start
end
max
max
The constraints for the polynomial are, t acc$ max - = ----------( 0) = 0 # ------! 2 " 2 d d- # t acc$ ----(0) = 0 ---- = max ------dt dt ! 2 " These can be used to calculate the polynomial coefficients, 0 = A0 + B0 + C 0 = 2A0 + B max = At acc
2 2
max max max - = ----------------------- = -------------A = ----------2 max$ 2 t acc 4 max # 2 -------------! max " The equation for the first segment is, max 2 -t ( t ) = -------------4 max max - ( t acc t ) 2 ( t ) = max -------------4 max max 2 2 - ( t 2 t acc t + t acc ) ( t ) = max -------------4 max
2 2 2
The equation for the second segment can be found using the first segment,
The distance covered during acceleration, the area under the curves, is, acc =
%0
t acc ------2
t acc # max 2 max 2 $ -------------- t dt + % & max -------------- ( t 2 t acc t + t 2 ) ' dt acc tacc 4 max 4 max " -------! t acc ------2 2
2 max
2 max
t acc
acc
max t acc max # t acc 3 t acc t acc$ $ - ------- + max t acc -------------- & ------- t acc + t 3 - + -------------- & ------- ------- + -------' = ----------------' max ------acc 12 max 8 4 max ! 3 2 4 max ! 24 4 2 " " acc acc 7 max 3 max 3 max t acc max 3 - t acc + -------------------- ----------------- t acc -----------------t = ----------------96 max 2 12 max 96 max acc 14 max 3 max t acc - t acc + -------------------= -------------------96 max 2
2 2 2 2
so the time required at the maximum velocity is, ( 2 acc ) t max = ------------------------- max
and end point, with arbitrary start and end times. t t start $ ------------------------ ( t ) = start + ( end start ) p # ! t end t start" where, start, end = start and end positions of motion t start, t end = start and end times for the motion p ( u ) = Au + Bu + Cu + D The constraints for the polynomial are, p(0 ) = 0 d---p(0) = 0 dt p(1 ) = 1 d---p(1 ) = 0 dt
3 2
(1)
(2)
These can be used to calculate the polynomial coefficients, 0 = A0 + B0 + C0 + D 0 = 3 A0 + 2B0 + C 0 = 3 A1 + 2B1 1 = A1 + B1 + (0)0 + 0
3 2 2 2 3 2
D = 0 C = 0 3 --$ B = # ! 2" A A = 2 B = 3
p ( u ) = 2 u + 3 u
(3)
Figure 16.12 Generating smooth motion paths The example in Figure 16.13 shows the use of a trigonometric function, instead of a polynomial. This function was used to generate the points in the following sample program in Figure 16.14.
where, p ( u ) = A sin ( Bt + C ) + D The coefficients can be calculated using the conditions used previously, d---p ( 0 ) = AB cos ( B ( 0 ) + C ) = 0 dt C = - cos ( C ) = 0 2 d---p ( 1 ) = AB cos ( B ( 1 ) + C ) = 0 dt cos ( B + C ) = 0 B + C = -2 -$ + D = 0 p ( 0 ) = A sin # B ( 0 ) -! 2" $ - +D = 1 p ( 1 ) = A sin # ( 1 ) -! 2" A ( 1 ) + A = 1 The final relationship is, 1 - sin # t --$ + 1 -p ( u ) = -2 ! 2" 2 B = A = D
1 A = -2
Figure 16.13 Generating smooth motion paths The program in Figure 16.14 generates a motion table that can then be used to update setpoints. The function table_init() must be called once when the program starts to set up global time and table values. When a new target position has been specified the table_generate() function is called to generate the setpoint table. The table_update() function is called once every interrupt scan to check the setpoint table, and update the global setpoint variable, point_current at scheduled times. This function also includes a simple clock to keep track of the system time.
TABLE_SIZE 11 point_master[TABLE_SIZE] = {0, 24, 95, 206, 345, 500, 655, 794, 905, 976, 1000}; point_position[TABLE_SIZE]; point_time[TABLE_SIZE]; point_start_time; point_index; ticks; /* variables to keep a system clock count */ point_current; /* a global variable to track position */
int table_init(){ /* initialize the setpoint table */ ticks = 0; /* set the clock to zero */ point_current = 0; /* start the system at zero */ point_index = TABLE_SIZE; /* mark the table as empty */ }
void table_generate(int start, int end, int duration_sec){ unsigned i; point_time[0] = ticks + 10; /* delay the start slightly */ point_position[0] = start; for(i = 1; i < TABLE_SIZE; i++){ point_time[i] = point_time[0] + (unsigned long)i * duration_sec * 250 / (TABLE_SIZE - 1); point_position[i] = start + (long int)(end - start) * point_master[i] / 1000; } point_index = 0; } int table_update(){/* interrupt driven encoder update */ ticks++; /* update the clock */ if(point_index < TABLE_SIZE){ if(point_time[point_index] == ticks){ point_current = point_position[point_index++]; outint16(point_current); putch("\n"); } } return point_current; }
Joint angle (degrees) 180 90 time(sec) 3 -90 Joint velocity (degrees/sec) max max 2
t acc
t max
t dec
Figure 16.15 Multi-axis slew motion The calculations for the motion parameters are shown in Figure 16.16. These are done in vector format for simplicity. All of the joints reach the maximum acceleration. The fastest motion is complete in 1.13s, while the longest motion takes 4.4s.
The area under the velocity curve is the distance (angle in this case) travelled. First we can determine the distance covered during acceleration, and deceleration and the time during acceleration, and deceleration. max 40- -------50-$ - = # 20 ----- -------t acc = t dec = ----------! 50, 100, 150" = ( 0.4, 0.4, 0.333 ) sec. max t acc max.vel. ( 20 ) ( 40 ) ( 50 )$ - = # 0.4 -----------------, 0.4 -----------------, 0.333 ----------------------= ( 4, 8, 8.33 ) deg. acc. = dec. = --------------------------! " 2 2 2 2 The next step is to examine the moves specified, move = end start = ( 120 40, 0 80, 0 ( 40 ) ) = ( 80, 80, 40 ) deg. Remove the angles covered during accel./deccel., and find the travel time at maximum velocity. move 2 acc 2(4) 80 2( 8) 2 ( 8.333 )$ - = # 80 ----------------------, 40 -------------------------------t max = ---------------------------------, ---------------------! " max 20 40 50 t max = ( 3.6, 1.6, 0.46668 ) sec. t total = t acc + t max + t dec = ( 4.4, 2.4, 1.13 ) s
The longest motion time is 4.4s for joint 1, and this can be used to prolong the other motions. The calculation begins by rewriting the velocity/position relationship using a new maximum velocity. max' max'$ max' 1 1 - ------------ ------------ max' + # t total 2 ------------ max' + -- ' = -! 2 max max " 2 max max max'$ = max' # t total -----------! max " ( max' ) + max' ( t total max ) + max = 0 t total max t total max 4 max max' = ------------------------------------------------------------------------------------2 max' t acc' = t acc' = ----------- max A new maximum velocity can be calculated for joint 2 using this equation. 4.4 ( 100 ) ( 4.4 ) ( 100 ) 4 ( 80 ) ( 100 ) max' = ------------------------------------------------------------------------------------------------2 440 401.99502 max' = ---------------------------------------- = 421, 19.0 2 19.0 - = 0.19 s t acc' = t acc' = --------100 A new maximum velocity can be calculated for joint 3 using this equation. 4.4 ( 150 ) ( 4.4 ) ( 150 ) 4 ( 40 ) ( 150 ) max' = ------------------------------------------------------------------------------------------------2 max' = 651, 9.22 9.22 - = 0.092 s t acc' = t acc' = --------100
2 2 2 2 2 2 2
should be updated. A diagram of a scheduler is shown in Figure 16.18. In this system the setpoint scheduler is an interrupt driven subroutine that compares the system clock to the total motion time. When enough time has elapsed the routine will move to the next value in the setpoint table. The frequency of the interrupt clock should be smaller than or equal to the time steps used to calculate the setpoints. The servo drive is implemented with an algorithm such a PID control.
Time based interrupt routine Setpoint table Choose new point from trajectory table
Read desired
desired
Interrupt Clock
Compute error
Figure 16.18 A setpoint scheduler The output from the scheduler updates every time step. This then leads to a situation where the axis is always chasing the target value. This leads to small errors, as shown in Figure 16.19.
time
For complex surfaces we want to contour appropriately. These surfaces will almost always be represented with spline patches.
(u=0,v=1)
(u=1,v=1) xp p ( u, v ) = y p zp
(u=0,v=0)
(u=1,v=0)
dirn_flag = 1; a direction flag n=10 ; number of passes to cut the surface step=1.0/n ; step sizes for u and v directions start=step/2 ; the start offset in the u and v directions [xp,yp,zp] = p(start,start) ; calculate the start position print(G00 X,xp, Y,yp, Z,zp+0.2) ; move the tool to above the start position for i=0 to (n-1) ; will increment in the u direction for j=0 to (n-1) ; will increment in the v direction ; calculate next point if dirn_flag=-1 then [xp,yp,zp]=p(start+i*step,start+j*step) if dirn_flag=1 then [xp,yp,zp]=p(start+i*step,start+(n-j)*step) print(G01 X,xp, Y,yp, Z,zp) ; instruction to cut to next point next j ; make next step in v direction until done dirn_flag = -dirn_flag ; reverse direction to cut in opposite direction next i ; move to next cut line in the u direction print(G00 Z,zp+0.2) ; move the tool to above the end position
Figure 16.20 Motion position control equation - the controller that uses the desired position and velocity is shown in figure xxxx
JRD + K ----------------------K
physical system
+ -
+ P + K ----------------------2 JRD + K
1---------K enc
K enc
16.6 SUMMARY
Axis limits can be used to calculate motion profiles. Trapezoidal and smooth motion profiles were presented. Motion profiles can be used to generate setpoint tables. Values from the setpoints can then be output by a scheduler to drive an axis.
t max t total t (s) 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5 11.0
deg - 0.2 s 200 deg 20 ------- max t acc s ---------------------------------------------------------------------------------- = 9.8 s = = max deg 20 -------s = t acc + t max + t dec = 0.2 s + 9.8 s + 0.2 s = 10.2 s angle (deg) -100 -92 -82 -72 -62 -52 -42 -32 -22 -12 -2 8 18 28 38 48 58 68 78 88 98 100 100
1 - 100 deg -------- ( 0.2 s ) 2 + 20 deg -------- ( 0.5 s 0.2 s ) 100 deg 0.5 s = -2 2 s s 0.5 s = 92 deg deg - ( 0.5 s ) = 92 deg + 10 deg 1.0 s = 0.5 s + 20 -------s
2. t (s) 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 counts 100 283 483 683 883 1083 1283 1483 1683 1883 2083 2283 2483 2683 2883 3000
moves to -1000 inches. The maximum velocity is 100 in/s and the maximum acceleration is 50in/s/s.
Topics: Laplace transforms Using tables to do Laplace transforms Using the s-domain to find outputs Solving Partial Fractions Objectives: To be able to find time responses of linear systems using Laplace transforms.
17.1 INTRODUCTION
Laplace transforms provide a method for representing and analyzing linear systems using algebraic methods. In systems that begin undeflected and at rest the Laplace s can directly replace the d/dt operator in differential equations. It is a superset of the phasor representation in that it has both a complex part, for the steady state response, but also a real part, representing the transient part. As with the other representations the Laplace s is related to the rate of change in the system.
D = s s = + j
Figure 17.1
The Laplace s
The basic definition of the Laplace transform is shown in Figure 17.2. The normal convention is to show the function of time with a lower case letter, while the same function in the s-domain is shown in upper case. Another useful observation is that the transform starts at t=0s. Examples of the application of the transform are shown in Figure 17.3 for a step function and in Figure 17.4 for a first order derivative.
F(s) = where,
!0 f ( t ) e
st
dt
f ( t ) = the function in terms of time t F ( s ) = the function in terms of the Laplace s Figure 17.2 The Laplace transform
!0
f(t)e
st
dt =
!0
5e
st
5 - e st dt = -s
5 5 e - e s 5 -----------= -= -s s s
Figure 17.3
Aside: Proof of the first order derivative transform Given the derivative of a function g(t)=df(t)/dt,
d st G ( s ) = L [ g ( t ) ] = L ---f ( t ) = ! (d/dt) f ( t ) e dt dt 0 we can use integration by parts to go backwards,
!a
u dv = uv a ! v du
b a
!0 (d/dt) f ( t ) e
therefore, du = df ( t ) u = f(t) ! f ( t ) ( s ) e
0 0 st
st
dt
v = e
st
dv = se dt = f ( t ) e
st 0
st
dt
0 st
! (d/dt) f ( t ) e f( t)e
0 s
dt
st
! (d/dt) f ( t ) e
st
dt = [ f ( t ) e
] + s! f(t)e
0
dt
dL ---f ( t ) = f ( 0 ) + sL [ f ( t ) ] dt
Figure 17.4
The previous proofs were presented to establish the theoretical basis for this method, however tables of values will be presented in a later section for the most popular transforms.
1. Convert the system transfer function, or differential equation, to the s-domain by replacing D with s. (Note: If any of the initial conditions are non-zero these must be also be added.) 2. Convert the input function(s) to the s-domain using the transform tables. 3. Algebraically combine the input and transfer function to find an output function. 4. Use partial fractions to reduce the output function to simpler components. 5. Convert the output equation back to the time-domain using the tables.
f(0 ) s
n 2 df ( 0
n1
!0 f ( t ) dt
f ( t a ) u ( t a ), a > 0 e
at
L[ f( t )]
f(t)
! f ( u ) du
s
Figure 17.5
L[x + 7x + 8x = 9] =
where,
Figure 17.6
The Laplace transform tables shown in Figure 17.7 and Figure 17.8 are normally used for converting to/from the time/s-domain.
TIME DOMAIN
FREQUENCY DOMAIN
(t) A t t
2
1 A -s 1 ---s 2 ---2
t ,n>0 e
at
sin ( t ) cos ( t ) te
at
1 -----------------2 (s + a) 2! -----------------3 (s + a)
t e
2 at
Figure 17.7
TIME DOMAIN e e
at
at
at
at
2Ae
cos ( t + ) cos ( t + )
at
2t A e
Figure 17.8
f ( t ) = 5 sin ( 5 t + 8 ) f(s ) = L[ f( t) ] =
Figure 17.9
Figure 17.10 Drill Problem: Converting from the s-domain to time domain
shown in the mass-spring-damper example in Figure 17.11. In this case we assume the system starts undeflected and at rest, so the D operator may be directly replaced with the Laplace s. If the system did not start at rest and undeflected, the D operator would be replaced with a more complex expression that includes the initial conditions.
ASIDE: Here D is simply replaced with s. Although this is very convenient, it is only valid if the initial conditions are zero, otherwise the more complex form, shown below, must be used. d f(t) d f(0 ) n n1 n 2 df ( 0 ) ----------------- ------------------L ------------= s L[f(t )] s f(0 ) s n n dt dt dt
n n
Figure 17.11 A mass-spring-damper example Impedances in the s-domain are shown in Figure 17.12. As before these assume that the system starts undeflected and at rest.
Impedance Z = R 1 Z = ----sC Z = Ls
Figure 17.13 shows an example of circuit analysis using Laplace transforms. The circuit is analyzed as a voltage divider, using the impedances of the devices. The switch that closes at t=0s ensures that the circuit starts at rest. The calculation result is a transfer function.
L t=0sec Vi + R + Vo -
Treat the circuit as a voltage divider, $ % 1 & Vi ------------------' & ' R -% 1 V i $ ---------------------# " DC + -" 1 + DCR# R R - = --------------------------------------------- = V i $ -------------------------------------------------% V o = -------------------------------------2 2 " # $ % R -% D R LC + DLR + R --------------------DLR + $ 1 & ' " 1 + DCR# DL + & ------------------' 1 -# " DC + -R Vo R % ----- = $ --------------------------------------------2 2 " # Vi s R LC + sLR + R
Figure 17.13 A circuit example At this point two transfer functions have been derived. To state the obvious, these relate an output and an input. To find an output response, an input is needed.
Apply a constant force of A, starting at time t=0 sec. (*Note: a force applied instantly is impossible but assumed) F(t) = 0 for t < 0 = A for t >= 0 Perform Laplace transform using tables
A F ( s ) = L [ F ( t ) ] = -s Figure 17.14 An input function In the previous section we converted differential equations, for systems, to transfer functions in the s-domain. These transfer functions are a ratio of output divided by input. If the transfer function is multiplied by the input function, both in the s-domain, the result is the system output in the s-domain.
Given,
x(s) 1 ---------- = ------------------------------------2 F( s) Ms + K d s + K s A F ( s ) = -s $ % x( s) 1 -% F ( s ) = & -------------------------------------' A -x ( s ) = $ ---------" F ( s )# " Ms 2 + K d s + Ks# s Ns K d = 3000 ----m N K s = 2000 --m M = 1000 kg A = 1000 N
Therefore,
Assume,
1 x ( s ) = --------------------------------2 (s + 3s + 2 )s
Figure 17.15 A transfer function multiplied by the input function Output functions normally have complex forms that are not found directly in transform tables. It is often necessary to simplify the output function before it can be converted back to the time domain. Partial fraction methods allow the functions to be broken into
smaller, simpler components. The previous example in Figure 17.15 is continued in Figure 17.16 using a partial fraction expansion. In this example the roots of the third order denominator polynomial, are calculated. These provide three partial fraction terms. The residues (numerators) of the partial fraction terms must still be calculated. The example shows a method for finding resides by multiplying the output function by a root term, and then finding the limit as s approaches the root.
1 B - ---------C1 - = A -- + ---------= ----------------------------------+ x ( s ) = --------------------------------2 (s + 1 )(s + 2 )s s s+1 s+2 (s + 3s + 2)s 1 -----------------------------------% A = lim s $ " # ( s + 1 ) ( s + 2 ) s s0 1 = -2 = 1 1 = -2
Aside: the short cut above can reduce time for simple partial fraction expansions. A simple proof for finding B above is given in this box. 1 B - ---------C----------------------------------- = A -- + ---------+ (s + 1 )(s + 2 )s s s+1 s+2 C1 B- = (s + 1) A -- + ( s + 1 ) ---------+ ( s + 1 ) ---------( s + 1 ) ----------------------------------( s + 1 )( s + 2 )s s s+1 s+2 1 A C------------------ + B + ( s + 1 ) ---------= ( s + 1 ) -(s + 2 )s s s+2 A 1 lim -----------------= lim ( s + 1 ) -s s 1 ( s + 2 ) s s 1 1 lim -----------------= lim B = B ( s + 2)s s 1 s 1 1 0.5 1 - ---------0.5- + ---------= -----+ x ( s ) = --------------------------------2 s s+1 s+2 ( s + 3s + 2 )s C+ lim B + lim ( s + 1 ) ---------s+2 s 1 s 1
Figure 17.16 Partial fractions to reduce an output function After simplification with partial fraction expansion, the output function is easily
Start with a function of s. NOTE: This does not apply for transfer functions.
yes
yes
Match the function(s) to the form in the table and convert to a time function Done
Figure 17.18 The methodology for doing an inverse transform of an output function Figure 17.19 shows the basic procedure for partial fraction expansion. In cases where the numerator is greater than the denominator, the overall order of the expression can be reduced by long division. After this the denominator can be reduced from a polynomial to multiplied roots. Calculators or computers are normally used when the order of the polynomial is greater than second order. This results in a number of terms with unknown resides that can be found using a limit or algebra based technique.
yes
Find roots of the denominator and break the equation into partial fraction form with unknown values OR use limits technique. If there are higher order roots (repeated terms) then derivatives will be required to find solutions use algebra technique
Done
Figure 17.19 The methodology for solving partial fractions Figure 17.20 shows an example where the order of the numerator is greater than the denominator. Long division of the numerator is used to reduce the order of the term until it is low enough to apply partial fraction techniques. This method is used infrequently because this type of output function normally occurs in systems with extremely fast response rates that are infeasible in practice.
5s + 3s + 8s + 6 x ( s ) = ------------------------------------------2 s +4 This cannot be solved using partial fractions because the numerator is 3rd order and the denominator is only 2nd order. Therefore long division can be used to reduce the order of the equation. 5s + 3 s +4
2
5s + 3s + 8s + 6 3 5 s + 20 s 3 s 12 s + 6 2 3 s + 12
2
12 s 6 This can now be used to write a new function that has a reduced portion that can be solved with partial fractions.
12 s 6 x ( s ) = 5 s + 3 + --------------------2 s +4
solve
Figure 17.20 Partial fractions when the numerator is larger than the denominator Partial fraction expansion of a third order polynomial is shown in Figure 17.21. The s-squared term requires special treatment. Here it produces partial two partial fraction terms divided by s and s-squared. This pattern is used whenever there is a root to an exponent.
Figure 17.21 A partial fraction example Figure 17.22 shows another example with a root to an exponent. In this case each of the repeated roots is given with the highest order exponent, down to the lowest order exponent. The reader will note that the order of the denominator is fifth order, so the resulting partial fraction expansion has five first order terms.
Figure 17.22 Partial fractions with repeated roots Algebra techniques are a reasonable alternative for finding partial fraction residues. The example in Figure 17.23 extends the example begun in Figure 17.22. The equivalent forms are simplified algebraically, until the point where an inverse matrix solution is used to find the residues.
s ( B + E ) + s ( A + 3B + D + 2E ) + s ( 3A + 3B + C + D + E ) + s( 3A + B ) + ( A ) = -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------3 2 s (s + 1) 0 1 3 3 1 1 3 3 1 0 0 0 1 0 0 0 1 1 0 0 1 2 1 0 0 A 0 B 0 C = 0 D 0 E 5 A 0 1 B 1 3 C = 3 3 D 3 1 E 1 0 0 0 1 0 0 0 1 1 0 0 1 2 1 0 0
1
0 5 0 15 0 = 5 0 10 5 15
Figure 17.23 Solving partial fractions algebraically For contrast, the example in Figure 17.23 is redone in Figure 17.24 using the limit techniques. In this case the use of repeated roots required the differentiation of the output function. In these cases the algebra techniques become more attractive, despite the need to solve simultaneous equations.
A C - -----------------D - --------------E 5 -----------------------+B -- + -----------------= --+ + 3 2 3 2 (s + 1) 2 s s (s + 1) (s + 1) s (s + 1) 5 5 -% 2 - = 5 A = lim $ ----------------------s = lim -----------------3 " # 2 s0 s 0 ( s + 1 )3 s (s + 1) d- $ ----------------------5 -% 2 d- $ -----------------5 -% ---B = lim ---s = lim 3# s 0 ds " 2 s 0 ds " ( s + 1 ) 3# s (s + 1) 5 -% 5 3 ----------------------C = lim $ ( s + 1 ) = lim ---= 5 3 " # 2 s 1 s 1 s 2 s (s + 1) 5 5 1- ---d- $ ----------------------1- ---d- --1- ------------2 ( 5 ) -% ( s + 1 ) 3 = lim ---- = lim ---D = lim ---= 10 3 2 3 " # s 1 1! ds 2 s 1 1! ds s s 1 1! s s (s + 1) 1 d 2$ 5 1 d25 1 30 - ---- ----------------------- ---- ---- = lim ---- -----% ( s + 1 ) 3 = lim ---- = 15 E = lim ---3# s 1 2! ds " 2 s 1 2! ds s 2 s 1 2! s 4 s (s + 1) 5 5- 15 5 - -----------------10 - --------------15 ----------------------- + -----------------= --+ -------+ + 3 2 3 2 2 s (s + 1) s (s + 1) (s + 1) s (s + 1) 5( 3 ) = lim -----------------= 15 s 0 ( s + 1 )4
Figure 17.24 Solving partial fractions with limits An inductive proof for the limit method of solving partial fractions is shown in Figure 17.25.
5 A C - -----------------D - --------------E -----------------------+B -- + -----------------= --+ + 3 2 3 2 (s + 1) 2 s s (s + 1) (s + 1) s (s + 1) 5 - --A C - -----------------D - --------------E -+B -- + -----------------= 2 + + lim ----------------------3 3 2 s (s + 1) (s + 1) s 1 2 s (s + 1) s (s + 1) 5 - --A C - -----------------D - --------------E -% 3 -+B -- + -----------------lim ( s + 1 ) $ ----------------------= 2 + + 3 3 2 " 2 s (s + 1) ( s + 1 )# s 1 s (s + 1) s (s + 1) 5 A(s + 1) (s + 1)2 - = ----------------------+B ---------------------lim --+ C + D(s + 1) + E(s + 1) 2 2 s s 1 s s
3 3
For C, evaluate now, 5 A ( 1 + 1 ) - --------------------------B( 1 + 1 ) 2 ------------ = --------------------------+ + C + D( 1 + 1) + E( 1 + 1 ) 2 2 1 ( 1 ) ( 1 ) 5 A ( 0 ) - ------------B( 0) 2 ------------ = ------------+ + + + C D ( 0 ) E ( 0 ) 2 2 1 ( 1 ) ( 1 ) For D, differentiate once, then evaluate d- $ ---5 A( s + 1) - B (s + 1)2% ---------------------lim ---+ + C + D ( s + 1 ) + E ( s + 1 ) & 2 = ---------------------' 2 s s 1 dt " s # s
3 3 3 3 3 3
C = 5
$ 2 ( s + 1 ) 3 3 ( s + 1 ) 2% $ s + 1 ) 3 3 ( s + 1 ) 2% 2 ( 5 ) - = A & --------------------- + ---------------------' + B & ( ------------------ + ---------------------' + D + 2 E ( s + 1 ) lim ------------3 3 2 2 s s 1 " # " # s s s s 2(5) ------------- = D = 10 3 ( 1 ) For E, differentiate twice, then evaluate (the terms for A and B will be ignored to save space, but these will drop out anyway).
3 3 d-% 2 $ ---5 A (s + 1)- B (s + 1)2% $ ---------------------------------------------lim " # & 2 = + + C + D ( s + 1 ) + E ( s + 1 ) ' 2 s s 1 dt " s # s d-% $ 2(5) ------------= A ( ) + B ( ) + D + 2 E ( s + 1 )% lim $ ---3 " # " # s 1 dt s
s 1
E = 15
Figure 17.25 A proof of the need for differentiation for repeated roots
17.6 EXAMPLES
Given,
1---x(s) M - = ----------------------------------------F( s) K Ks 2 d - s + ----s + ----M M Component values are, M = 1 kg N K s = 2 --m Ns K d = 0.5 ----m
The sinusoidal input is converted to the s-domain, F ( t ) = 5 cos ( 6 t ) N 5s F ( s ) = --------------2 2 s +6 This can be combined with the transfer function to obtain the output function, 1 -$ % x ( s ) 5 s 1 $ % $ % & - = --------------- -----------------------------' x ( s ) = F ( s ) ---------2# & 2 " F ( s )# " 2 ' s + 6 " s + 0.5 s + 2# 5s x ( s ) = --------------------------------------------------------2 2 ( s + 36 ) ( s + 0.5 s + 2 ) A - -----------B - -----------------------------------C D - + -----------------------------------x ( s ) = -----------+ + s + 6 j s 6 j s 0.25 + 1.39 j s 0.25 1.39 j
Figure 17.26 A mass-spring-damper example The residues for the partial fraction in Figure 17.26 are calculated and converted to a function of time in Figure 17.27. In this case the roots of the denominator are complex, so the result has a sinusoidal component.
A =
s 6 j
lim
A = 73.2 10 3.05 B = A = 73.2 10 3.05 Continue on to find C, D same way 10 3.05 73.2 10 3.05 - + 73.2 ---------------------------------------------+ x ( s ) = -----------------------------------------s + 6j s 6j Do inverse Laplace transform x ( t ) = 2 ( 73.2 10 ) e
3 0 t 3 3
cos ( 6 t 3.05 ) +
17.6.2 Circuits
It is not necessary to develop a transfer functions for a system. The equation for the voltage divider is shown in Figure 17.28. Impedance values and the input voltage are converted to the s-domain and written in the equation. The resulting output function is manipulated into partial fraction form and the residues calculated. An inverse Laplace transform is used to convert the equation into a function of time using the tables.
R = 10 t=0 V s = 3 cos t + + Vo -
C = 10 F
As normal, relate the source voltage to the output voltage using component values in the s-domain. 13s Z C = ----ZR = R V s ( s ) = ------------sC 2 s +1 Next, equations are combined. The numerator of resulting output function must be reduced by long division. 1- % $ ----& 3 s - ---------------sC ' 3s 3s - = ------------------------------------------------------V o = ------------& ' = ------------------------------------------2 2 2 3 3 1 & ' s + 1 R + ----( s + 1 ) ( 1 + sRC ) ( s + 1 ) ( s 10 10 + 1 ) " sC# The output function can be converted to a partial fraction form and the residues calculated. 2 2 3s As + B CAs + As + Bs + B + Cs + C -----------------------------------------------------------------------------------------------------------------------------= 2 + = Vo = 2 2 s + 1 (s + 1 )(s + 1) s +1 (s + 1)( s + 1) 3s s (A + C) + s(A + B) + (B + C) V o = ----------------------------------= ---------------------------------------------------------------------------2 2 (s + 1)(s + 1) (s + 1)(s + 1) B+C = 0 A+C = 0 A+B = 3 B = C A = C C C = 3
2
ZC % -----------------V o = Vs $ " Z R + Z C#
C = 1.5
A = 1.5
B = 1.5
The output function can be converted to a function of time using the transform tables, as shown below. Vo ( t ) = L [ V o ( s ) ] = L V o ( t ) = 1.5 L
1 1
1.5 s + 1.5 1.5 s + 1.5 1.5 ----------------------- + ---------- = L 1 1.5 ----------------------- + L 1 ---------2 2 s +1 s + 1 s +1 s +1 s 1 1 t ------------+ 1.5 L ------------ 1.5 e 2 2 s +1 s +1
1 t
1.5 2 2 -% % 1.5 e t 1.5 + 1.5 sin $ t + atan $ -----" " 1.5# # % t -V o ( t ) = 2.121 sin $ " t + 4# 1.5 e
f(t) 5
t seconds 0 1 3 4 f ( t ) = 5 tu ( t ) 5 ( t 1 ) u ( t 1 ) 5 ( t 3 ) u ( t 3 ) + 5 ( t 4 ) u ( t 4 ) 5- --------5e 5e 5e 2 - -----------+ -----------f ( s ) = --2 2 2 s s s s Figure 17.30 Switching on and off function parts
s 3 s 4 s
x ( t ) = lim [ sx ( s ) ]
s0
1(s) 1 1 - = --- = 0 x ( t 0 ) = lim --------------------------------= ------------------------------------------2 2 s ( s + 3s + 2 )s ( ( ) + 3( ) + 2 ) Figure 17.31 Final and initial values theorems
We can figure out from plots Experiments Root-Locus for stability Substitute
Output Function (Laplace form) Bode and Phase Plots - Straight line - Exact plot Phasor Transform Output Function (Laplace terms) Partial Fraction Inverse Laplace
Equations for gain and phase at different frequencies Approximate equations for steady state vibrations Steady state frequency response
17.9 SUMMARY
Transfer and input functions can be converted to the s-domain Output functions can be calculated using input and transfer functions Output functions can be converted back to the time domain using partial fractions.
o) ] ] ] p) q) r) s) t) u)
( t + 1)
L[5e
3 t
L [ 5 te L[5t ]
3 t
!0 y dt
3 5t
L[ 3t ( t 1 ) + e
u( t 2) ] u( t 1) ]
v) w) x) y) z) aa)
( t 3 ) 3 t
cos ( 5 t ) ] cos ( 5 t + 1 ) ]
L[ 5e
L [ cos ( 7 t + 2 ) + e L [ cos ( 5 t + 1 ) ] L[ 6e
2.7 t
cos ( 9.2 t + 3 ) ]
2. Convert the following functions below from the laplace to time domains using the tables. a) b) c) d) e) f) L L L L L L
1
g) h) i) j) k)
L L L L L
3. Convert the following functions below from the laplace to time domains using partial fractions and the tables. a) b) c) d) e) f) L
1
g) h) i) j) k) l)
L L L L L L
L [ ] L [ ] L [ ] L L
1 1 1
6 ---------------2 s + 5s 2 9s + 6s + 3 ---------------------------------------s + 5s + 4s + 6
3 2
4. Convert the output function below Y(s) to the time domain Y(t) using the tables. 5 12 - --------------------3 - ---------------------3 - + ------------Y ( s ) = -+ + 2 s s + 4 s + 2 3j s + 2 + 3j
5. Convert the following differential equations to transfer functions. 5x + 6x + 2x = 5F a) y + 8y = 3x b) y y + 5x = 0 c) 6. Given the transfer function, G(s), determine the time response output Y(t) to a step input X(t). 4Y( s) G ( s ) = ---------= ---------X ( t ) = 20 When t >= 0 s+2 X(s) 7. Given the following input functions and transfer functions, find the response in time. Transfer Function Input a) b) x(s) s + 2 -$m ---------- = ----------------------------------% F(s) ( s + 3 ) ( s + 4 ) " N# x(s) s + 2 -$m ---------- = ----------------------------------% F(s) ( s + 3 ) ( s + 4 ) " N# F(t) = 5N x(t) = 5m
d) e)
9. Convert the output function to functions of time. 3 2 a) s + 4s + 4s + 4 ---------------------------------------3 s + 4s 2 b) s +4 -----------------------------------------------------------------s + 10 s + 35 s + 50 s + 24 10. Solve the differential equation using Laplace transforms. Assume the system starts undeflected and at rest. + 40 + 20 + 2 = 4
4 3 2
0.5- ---------0.5--------- s3 s+3 4 16 s 12 s 16 -------------------- + -------------------= ---------------------2 3 3 2 2 2 (s + 4) (s + 4) (s + 4) 2s -----------------3 (s + 3) ( s x 7 s 8 ) + 5 ( sx 7 ) + 3 x 6s ---------------2 s + 36 2 y s 72 1 ----- 18 ----- + ---------5 4 s+5 s s e ------e -------s s e ------------s+2 e ---------s+1 5 - e -e ----------------+ -----s s s+3
3 3 s 2 s 2s 4 2s s 2 s 2 2 2
b) c) d) e) f) g) h) i) j)
k)
3 e ---- 3 -- + ---------2 s s+1 s 5(s + 3) -----------------------------2 2 (s + 3) + 5 2.5 1 - ---------------------2.5 1 --------------------+ s + 3 5j s + 3 + 5j s( ) + = ---------------------------2 s + 6 s + 34 5 ---------------s + 25 x) y)
2
s) t) u) v) w)
0.416 s 6.37 e cos ( 2 ) s sin ( 2 ) 7 e - = ------------------------------------------------------------------------------ + ---------- + ---------2 2 s1 s1 s + 49 s + 49 s cos 1 5 sin 1 ---------------------------------s + 25 3 3 - ------------------------------3 3 s( ) + -----------------------------+ = ---------------------------------------2 s + 2.7 9.2 j s + 2.7 + 9.2 j s + 5.4 s + 91.93
2
z)
2. a) e
t t
g) h)
5 5 u ( t 4.5 ) 2(5)e
3 ( 1 ) t
b) 5 e c) 6 t d) 3 t
i) j)
4t
t + 2 sin ( 3 t ) 6e
2 t
e) e f) 3. a) b) c) d) e) f) e
3 t
3 t
6e
3 t 3 t
+ 2e
k)
1.5 e
2 t
1.5 e
6 sin ( 6 t )
+ 2e
4t
g) h) i) j) (t) e
2t
5 t 0.3 t
+ 2 ( 0.99 ) e
cos ( 3 t 0 )
6. y ( t ) = 40 40 e 7. a) b) 8. a) L[ 5e
4 t 2 t
)N
cos ( 3 t + 2 ) ] = L [ 2 A e
cos ( t + ) ]
= 4 A = 2.5
= 3 = 2
A = 2.5 cos 2 + 2.5 j sin 2 = 1.040 + 2.273 j A A 1.040 + 2.273 j 1.040 2.273j ----------------------- = --------------------------------------+ ------------------------------------+ -------------------------------------s + j s + + j s + 4 3j s + 4 + 3j
complex conjugate
b)
L[e
2 t
2t
] + L [ 5 tu ( t 2 ) ] L [ 5 tu ( t ) ]
15 15 = ---------+ 5 L [ tu ( t 2 ) ] ---= ---------+ 5 L [ ( t 2 ) u ( t 2 ) + 2 u ( t 2 ) ] ---2 2 s+2 s + 2 s s 5 1= ---------+ 5 L [ ( t 2 ) u ( t 2 ) ] + 10 L [ u ( t 2 ) ] --2 s+2 s 2 s 2 s 5 1= ---------+ 5 e L [ t ] + 10 e L [ 1 ] ---2 s+2 s 2 s 2 s 5 1 - -----------5e 10 e = ---------+ 2 + --------------- ---2 s s+2 s s
c)
d% 3 2 1 0 $ ---- y = s y + 1s + 2s + 3s " dt# d-% 1 0 $ ---= s y+s 1 " dt# y d%3 d% 3 2 $ ------L $ " dt# y + 2 " dt# y + y = ( s y + 1 s + 2 s + 3 ) + ( sy + 1 ) + ( y ) = y(s + s + 1 ) + (s + 2s + 4)
3 2
d) L
complex conjugate
A =
= 3
= 4
= 2Ae
cos ( t + ) = 2.282 e
% -cos $ 4 t " 4#
e)
13 1 - ---------------------------3 - = L [ s ] + L ---------+ + L ---------------------------s + ---------2 s + 2 s 2 + 4 s + 40 s+2 s + 4 s + 40 d2 t 3 d2 t 6 - = ---= --- ( t ) + e + L ----------------------------- ( t ) + e + 0.5 L -----------------------------2 2 dt dt ( s + 2 ) + 36 ( s + 2 ) + 36
1
s + 4s
1 3 2 s + 4s + 4s + 4 3 ( s + 4 s ) 4s + 4
2 2
A = 1 C = 0 B = 3
= ( t ) + 1 + 3 cos ( 2 t )
b)
A - ---------B - ---------C - ---------Ds +4 ------------------------------------------------------------------ = ---------+ + + 4 3 2 s+1 s+2 s+3 s+4 s + 10 s + 35 s + 50 s + 24 s +4 -------------------------------------------------% = 5 -A = lim $ " 6 s 1 ( s + 2 ) ( s + 3 ) ( s + 4 )# s +4 8-------------------------------------------------% = ----B = lim $ " # 2 s 2 ( s + 1 ) ( s + 3 ) ( s + 4 ) s +4 -------------------------------------------------% = 13 ----C = lim $ " 2 s 3 ( s + 1 ) ( s + 2 ) ( s + 4 )# s +4 20 -------------------------------------------------% = ----D = lim $ " # 6 s 4 ( s + 1 ) ( s + 2 ) ( s + 3 ) 10 5 - e4t -- e t 4 e 2 t + 13 ----- e 3 t ----3 6 2
2 2 2 2
10. ( t ) = 66 10 e
6 39.50 t
3.216 e
0.1383 t
+ 1.216 e
0.3368 t
+ 2.00
lim f ( t ) = lim sF ( s )
s0
1 s - F $ --% L [ f ( at ) ] = -" a a# L[ e
at
lim f ( t ) = lim sF ( s )
s0
f(t )] = F(s + a)
dL [ tf ( t ) ] = ---F(s) dt
2. The applied force F is the input to the system, and the output is the displacement x. a) find the transfer function. K1 = 500 N/m K2 = 1000 N/m M = 10kg
F b) What is the steady state response for an applied force F(t) = 10cos(t + 1) N ? c) Give the transfer function if x is the input. d) Find x(t), given F(t) = 10N for t >= 0 seconds using Laplace methods. 3. The following differential equation is supplied, with initial conditions. y + y + 7y = F y( 0) = 1 y(0) = 0 F ( t ) = 10 t>0
a) Solve the differential equation using calculus techniques. b) Write the equation in state variable form and solve it numerically. c) Find the frequency response (gain and phase) for the transfer function using the phasor transform. Roughly sketch the bode plots. d) Convert the differential equation to the Laplace domain, including initial conditions. Solve to find the time response. 4. Given the transfer functions and input functions, F, use Laplace transforms to find the output of the system as a function of time. Indicate the transient and steady state parts of the solution. x D -- = ----------------------------2 F ( D + 200 )
2
F = 5 sin ( 62.82 t )
D ( D + 2 )x -- = ----------------------------2 F ( D + 200 )
F = 5 sin ( 62.82 t )
x D (D + 2) -- = ----------------------------2 F ( D + 200 )
F = 5 sin ( 62.82 t )
17.13 REFERENCES
Irwin, J.D., and Graf, E.R., Industrial Noise and Vibration Control, Prentice Hall Publishers, 1979. Close, C.M. and Frederick, D.K., Modeling and Analysis of Dynamic Systems, second edition, John Wiley and Sons, Inc., 1995.
Topics:
Objectives:
18.1 INTRODUCTION
vdesired + _
verror
gas
car
vactual
The control system is in the box and could be a driver or a cruise control (this type is known as a feedback control system)
Figure 18.1
Human rules to control car (also like expert system/fuzzy logic): 1. If verror is not zero, and has been positive/negative for a while, increase/decrease gas 2. If verror is very big/small increase/decrease gas 3. If verror is near zero, keep gas the same 4. If verror suddenly becomes bigger/smaller, then increase/decrease gas. 5. etc.
Figure 18.2
Some of the things we do naturally (like the rules above) can be done with mathematics
de -% u = K c e + K i ! edt + K d $ ----" dt #
Figure 18.3
The figure below shows a basic PID controller in block diagram form.
Figure 18.4
e.g. dv error gas = K c v error + K i ! v error dt + K d $ ----------------% " dt # Rules 2 & 3 (general difference) Rule 4 (Immediate error) Rule 1 (Long term error)
Kc Ki Kd
For a PI Controller gas = K c v error + K i ! v error dt For a P Controller gas = K c v error For a PD Controller dv error% gas = K c v error + K d $ --------------" dt #
1. We can rewrite the control equation as a ratio of output to input. dv error gas = K c v error + K i ! v error dt + K d $ ----------------% " dt # gas d-% ------------ = K c + K i ! dt + K d $ ---" v error dt# Then do a Laplace transform d---s dt dx ----- sx dt
! dt
1 = -s
! xdt
x = s
2. We can also develop a transfer function for the car. F = A gas = 10 gas F--------= 10 gas Transfer function for engine and transmission. (Laplace transform would be the same as initial value.)
2
d x - = M dv ----F = Ma = M ------2 dt dt F d-- = M ---v dt v 1- = -----L -F Ms Transfer function for acceleration of car mass
gas
10
1-----Ms
vactual
The system model is shown above. If gas is specified directly, this is called open loop control. This is not desirable, but much simpler. The two blocks above can be replaced with a single one.
gas
10-----Ms
vactual
4. If we have an objective speed, and an actual speed, the difference is the system error v error = v desired v actual set-point - desired system operating point
5. Finally, knowing the error is verror, and we can control gas (the control variable), we can select a control system. verror Controller gas
*The coefficients can be calculated using classical techniques, but they are more commonly approximated by trial and error.
vdesired + -
verror
Ki - + Kds K c + ---s
gas
10
1-----Ms
vactual
A negative feedback loop that is the fundamental part of this closed loop control system
vdesired 100
step vdesired(t) = 100 for t >= 0 sec ramp vdesired(t) = 50t for t >= 0 sec t(sec) 0
RAMP
Therefore to continue the car example, lets assume the input below, v desired ( t ) = 100 t 0 sec
100 v desired ( s ) = L [ v desired ( t ) ] = -------s Next, lets use the input, and transfer function to find the output of the system. v actual % ---------------v actual = $ " v desired# v desired $ % 2 & s ( K d ) + s ( K c ) + K i ' $ 100% -' -------= & -----------------------------------------------------------" s # M & s 2 $ ----' - + K % + s ( K c ) + K i# " " 10 d#
v actual
To go further, some numbers will be selected for the values. Kd = 10000 Kc = 10000 Ki = 1000 M = 1000 $ s 2 ( 10000 ) + s ( 10000 ) + 1000% $ 100% -' -------v actual = & ----------------------------------------------------------------------" s 2 ( 10100 ) + s ( 10000 ) + 1000# " s #
At this point we have the output function, but not in terms of time yet. To do this we break up the function into partial fractions, and then find inverse Laplace transforms for each. % s + s + 0.1 -' = 10 & ------------------------------------------------" s ( s2 ( 1.01 ) + s + 0.1 )#
2 2$
v actual
Aside: We must find the roots of the equation, before we can continue with the partial fraction expansion. recall the quadratic formula, ax + bx + c = 0
2
b b 4 ac x = -------------------------------------2a
10 - $ --------------------------------------------------s + s + 0.1 -% v actual = --------1.01 " s ( s + 0.113 ) s + 0.877# A B - --------------------C - + --------------------+ v actual = -s s + 0.114 s + 0.795
10 - $ -------------------------------------------------------s + s + 0.1 ---------% % A = lim s $ " " 1.01 s ( s + 0.113 ) ( s + 0.877 )# # s0 A = 99.9
B =
s 0.113 2
lim
10 - $ ( 0.113 ) + ( 0.113 ) + 0.1% % ------------------------------------------------------------------------B = $ " 1.01 " ( 0.113 ) ( 0.113 + 0.877 ) # # = 0.264 10 $ s + s + 0.1 $ --------- --------------------------------------------------------% % ( s + 0.877 ) " 1.01 " s ( s + 0.113 ) ( s + 0.877 )# #
2 2 2
C =
s 0.877 2
lim
0.877 ) + ( 0.877 ) + 0.1% % 10 - $ ( ------------------------------------------------------------------------C = $ " 1.01 " ( 0.877 ) ( 0.877 + 0.113 ) # # = 1.16 99.9 0.264 - --------------------1.16 - + -------------------- v actual = --------s s + 0.113 s + 0.877
Next we use a list of forward/inverse transforms to replace the terms in the partial fraction expansion. f(t ) A f(s ) A -s A --2 s A ----------s+ A ---------------2 2 s +
2
At
t
Ae
A sin ( t )
n t
sin ( n t 1 )
n 1 --------------------------------------2 2 s + 2 n s + n etc.
for ( < 1 )
To finish the problem, we simply convert each term of the partial fraction back to the time domain. 99.9 0.264 - --------------------1.16 - + -------------------- v actual = --------s s + 0.113 s + 0.877
0.113 t
1.16 e
0.877 t
Type
Transfer Function
Gc = K 1-% G c = K $ 1 + ---" s# Gc = K ( 1 + s ) 1G c = K $ 1 + ---+ s% " # s 1 + s% -----------------Gc = K $ " 1 + s # 1 + s % -----------------Gc = K $ " 1 + s# >1 >1 >1 1 > 2
Note: this procedure can take some time to do, but the results are very important when designing a control system. Consider the example below,
Note: This controller has adjustable gain. After this design is built we must anticipate that all values of K will be used. It is our responsibility to make sure that none of the possible K values will lead to instability. + K 1 K G ( s ) = --s H(s) = 1 1 -s
First, we must develop a transfer function for the entire control system. $K ---% " # s G(s) K- = ----------G S ( s ) = -------------------------------= -------------------------1 + G( s)H(s) s+K K ---% 1+$ " s # (1) Next, we use the characteristic equation of the denominator to find the roots as the value of K varies. These can then be plotted on a complex plane. Note: the value of gain K is normally found from 0 to +infinity. s+K = 0 K 0 1 2 3 etc.. root j K K = 0
Note: because all of the roots for all values of K are real negative this system will always be stable, and it will always tend to have a damped response. The large the value of K, the more stable the system becomes.
Consider the previous example, the transfer function for the whole system was found, but then only the denominator was used to determine stability. So in general we do not need to find the transfer function for the whole system.
Consider the general form for a negative feedback system. G(s) G S ( s ) = -------------------------------1 + G( s )H( s ) Note: two assumptions that are not often clearly stated are that we are assuming that the control system is a negative feedback controller, and that when not given the feedback gain is 1.
The system response is a function of the denominator, and its roots. 1 + G( s)H(s) = 0 It is typical, (especially in textbook problems) to be given only G(s) or G(s)H(s). The transfer function values will often be supplied in a pole zero form. K ( s + z0 ) ( s + z1 ) ( s + z m ) G ( s ) H ( s ) = -----------------------------------------------------------------( s + p 0 ) ( s + p 1 ) ( s + p n )
Given the system elements (you should assume negative feedback), K G ( s ) = ------------------------2 s + 3s + 2 H(s) = 1
First, find the characteristic equation,. and an equation for the roots, K -------------------------% ( 1 ) = 0 1+$ " 2 # s + 3s + 2 s + 3s + 2 + K = 0 3 9 4(2 + K) 1 4K - = 1.5 ------------------roots = ----------------------------------------------2 2 Next, find values for the roots and plot the values, K 0 1 2 3 root 0 -1 -2 -3 j
2
equation. ( s + z 1 ) ( s + z 2 ) ( s + z m ) - = 0 1 + G ( s ) H ( s ) = 1 + K --------------------------------------------------------------( s + p1 ) ( s + p 2 ) ( s + pn ) 2. count the number of poles and zeros. The difference (n-m) will indicate how many root loci lines end at infinity (used later). 3. plot the root loci that lie on the real axis. Points will be on a root locus line if they have an odd number of poles and zeros to the right. Draw these lines in. 4. determine the asymptotes for the loci that go to infinity using the formula below. Next, determine where the asymptotes intersect the real axis using the second formula. Finally, draw the asymptotes on the graph. 180 ( 2 k + 1 ) ( k ) = ----------------------------------nm
k [ 0, n m 1 ]
( p1 + p2 + + pn ) ( z 1 + z2 + + z m ) = ------------------------------------------------------------------------------------------nm 5. the breakaway and breakin points are found next. Breakaway points exist between two poles on the real axis. Breakin points exist between zeros. to calculate these the following polynomial must be solved. The resulting roots are the breakin/breakout points. A = ( s + p 1 ) ( s + p 2 ) ( s + p n ) d- % d- % $ ---A B A $ ---B = 0 " ds # " ds # 6. Find the points where the loci lines intersect the imaginary axis. To do this substitute the phasor for the laplace variable, and solve for the frequencies. Plot the asymptotic curves to pass through the imaginary axis at this point. ( j + z 1 ) ( j + z 2 ) ( j + z m ) - = 0 1 + K -------------------------------------------------------------------------( j + p 1 ) ( j + p2 ) ( j + p n ) Consider the example in the previous section, B = ( s + z 1 ) ( s + z 2 ) ( s + z m )
Given the system elements (you should assume negative feedback), K G ( s ) = ------------------------2 s + 3s + 2 H(s) = 1
Step 1: (put equation in standard form) 1 K -------------------------% ( 1 ) = 1 + K -------------------------------1 + G( s)H(s) = 1 + $ 2 " # (s + 1)(s + 2) s + 3s + 2 Step 2: (find loci ending at infinity) m = 0 nm = 2 Step 3: (plot roots) j n = 2 (from the poles and zeros of the previous step) (loci end at infinity)
-2 -1
Step 4: (find asymptotes angles and real axis intersection) 180 ( 2 k + 1 ) ( k ) = ------------------------------2 k I [ 0, 1 ] j
Step 5: (find the breakout points for the roots) A = 1 d---A = 0 ds B = s + 3s + 2 d---B = 2s + 3 ds -2 -1.5 -1
2
Note: because the loci do not intersect the imaginary axis, we know the system will be stable, so step 6 is not necessary, but we it will be done for illustrative purposes.
Step 6: (find the imaginary intercepts) 1 + G( s)H(s) = 0 1 - = 0 1 + K ------------------------2 s + 3s + 2 s + 3s + 2 + K = 0 (j) + 3(j) + 2 + K = 0 + 3 j + 2 + K = 0 + ( 3 j ) + ( 2 K ) = 0 3j ( 3 j ) 4 ( 2 K ) 3j 9 + 8 + 4K j 4K 1 - = 3 ------------------------------ = -------------------------------------------------------------- = --------------------------------------------2 2 2 In this case the frequency has an imaginary value. This means that there will be no frequency that will intercept the imaginary axis.
2 2 2 2 2
K( s + 5 ) G ( s ) H ( s ) = --------------------------------2 s( s + 4s + 8 )
18.5 SUMMARY
8. Draw a detailed root locus diagram for the transfer function below. Be careful to specify angles of departure, ranges for breakout/breakin points, and gains and frequency at stability limits. 2 K ( s + 0.5 ) ( s + 2 s + 2 ) G ( s ) = ----------------------------------------------------------3 s (s + 1)(s + 2) 10. Draw the root locus diagram for the transfer function below, K(s + 4)G ( s ) = ---------------------2 s (s + 1)
2 2
11. Draw the root locus diagram for the transfer function below, K(s + 1)(s + 2) G ( s ) = ------------------------------------3 s 12. The block diagram below is for a motor position control system. The system has a proportional controller with a variable gain K. d Vd + Ve Vs a
100---------s+2
1 -s
Va 2
ans.
200 K ----------------------------------2 s + 2 s + 200 K b) Draw the Root-Locus diagram for the system (as K varies). Use either the approximate or exact techniques.
ans.
Re
c) Select a K value that will result in an overall damping coefficient of 1. State if the Root-Locus diagram shows that the system is stable for the chosen K.
(ans.
s + 2 s + 200 K = s + 2 n s + n
n = 1
K = 0.005
From the root locus graph this value is critically stable. 13. Draw a Bode Plot for either one of the two transfer functions below. ( s + 1 ) ( s + 1000 ) ----------------------------------------2 ( s + 100 ) OR 5--2 s
15. Given the system transfer function below. o 20 K ---- = ----------------------------2 d s + s + 20 K a) Draw the root locus diagram and state what values of K are acceptable. b) Select a gain value for K that has either a damping factor of 0.707 or a natural frequency of 3 rad/sec. c) Given a gain of K=10 find the steady state response to an input step of 1 rad. d) Given a gain of K=10 find the response of the system as 17. The equation below describes a dynamic system. The input is F and the output is V. It has the initial values specified. The following questions ask you to find the system response to a
V' ( 0 ) = 2
a) Find the response using Laplace transforms. b) Find the response using the homogenous and particular solutions. c) Put the equation is state variable form, and solve it using your calculator. Sketch the result accurately below. 18. A feedback control system is shown below. The system incorporates a PID controller. The closed loop transfer function is given. Y X + 3Ki ---------- + Kd s K p + ---s+9 s 4 s ( 3 K d ) + s ( 3 Kp ) + ( 3 Ki ) Y -- = -----------------------------------------------------------------------------------2 X s ( 4 + 3 K d ) + s ( 36 + 3 K p ) + ( 3 K i )
2
a) Verify the close loop controller function given. b) Draw a root locus plot for the controller if Kp=1 and Ki=1. Identify any values of Kd that would leave the system unstable. c) Draw a Bode plot for the feedback system if Kd=Kp=Ki=1. d) Select controller values that will result in a natural frequency of 2 rad/sec and damping coefficient of 0.5. Verify that the controller will be stable. e) For the parameters found in the last step find the initial and final values. f) If the values of Kd=1 and Ki=Kd=0, find the response to a ramp input as a function of time. 19. The following system is a feedback controller for an elevator. It uses a desired heigh d provided by a user, and the actual height of the elevator h. The difference between these two is called the error e. The PID controller will examine the value e and then control the speed of the lift motor with a control voltage c. The elevator and controller are described with transfer functions, as shown below. all of these equations can be combined into a single system transfer
PID controller
h 10 -- = -----------2 c s +s
elevator
10 10 ( s + 1 ) h 2 s + 1 + s - -----------10 ( s + 1 ) - -----------------$c -% $ h --% -------------------------= -----------------= ---------------------2 2 " e# " c# = e = s s ( s + 1 ) s s s +s h 10 ( s + 1 ) eliminate e ----------= ---------------------2 dh s 10 ( s + 1 )% h = $ ---------------------(d h) 2 " # s 10 ( s + 1 )% 10 ( s + 1 )% = $ ---------------------(d) h $ 1 + ---------------------2 2 " # " # s s 10 ( s + 1 ) % $ ---------------------& ' 2 h s 10 s + 10 & system transfer function -- = -------------------------------' = ------------------------------2 & ' 10 ( s + 1 ) d s + 10 s + 10 ---------------------&1 + ' 2 " # s a) Find the response of the final equation to a step input. The system starts at rest on the ground floor, and the input (desired height) changes to 20 as a step input. b) Write find the damping coefficient and natural frequency of the results in part a). c) verify the solution using the initial and final value theorems.
(ans. a) h 10 s + 10 -- = ------------------------------2 d s + 10 s + 10
d ( t ) = 20 u ( t )
20 d ( s ) = ----s
B C 10 s + 10 -% 20 ----- = A -- + -------------------------------- + -------------------------------h = $ ------------------------------" 2 # s s s + 5 3.873 j s + 5 + 3.873 j s + 10 s + 10 200 s + 200 -% ------------------------------A = lim $ = 20 2 " s 0 s + 10 s + 10# B = 200 s + 200 -% $ ---------------------------------------= 2.5 22.6 j " s ( s + 5 + 3.873 j )# s 5 + 3.873 j lim A = 2.5 + 22.6 = 22.73
2 2
C = 2.5 + 22.6 j h ( t ) = 20 + L
1
= 4.602 = 5 = 3.873
h ( t ) = 20 + 2 ( 22.73 ) e b) 5 = n 3.873 =
5 t
1 n =
25 - 1 ----2 n n n = 35 = 5.916
5 = --------= 0.845 35
c)
10 s + 10 -% 20 s ----- = lim $ 10 -------% 20 = 0 h ( 0 ) = lim s $ ------------------------------2 2 " # " # s s s s s + 10 s + 10 10 s + 10 -% 20 10 ) 20 ----- = ( ---------------- = 20 h ( ) = lim s $ ------------------------------10 s 0 " s 2 + 10 s + 10# s
b) Given the transfer function below, select values for Kp, Ki and Kd that will result in a second order response that has a damping coefficient of 0.125 and a natural frequency of 10rad/s. (Hint: eliminate Ki). s ( 400 K d ) + s ( 400 K p ) + ( 400 K i ) a ---- = ---------------------------------------------------------------------------------------------------------3 2 d s + s ( 0.1 + 400 K d ) + s ( 400 K p ) + ( 400 K i )
2
c) The function below has a step input of magnitude 1.0. Find the output as a function of time using numerical methods. Give the results in a table OR graph. a s ( 0.9 ) + ( 4 ) ---- = ----------------------------------2 d s + 2.5 s + 100 d) The function below has a step input of magnitude 1. Find the output as a function of time by integrating the differential equation (i.e., using the homogeneous and particular solutions). a s ( 0.9 ) + ( 4 ) ---- = ----------------------------------2 d s + 2.5 s + 100
e) The function below has a step input of magnitude 1. Find the output as a function of time using Laplace transforms. a s ( 0.9 ) + ( 4 ) ---- = ----------------------------------2 d s + 2.5 s + 100 f) Given the transfer function below; a) apply a phasor/Fourier transform and express the gain and phase angle as a function of frequency, b) calculate a set of values and present them in a table, c) use the values calculated in step b) to develop a frequency response plot on semi-log paper, d) draw a straight line approximation of the Bode plot on semi-log paper. a ( 0.9 ) + ( 4 ) ------------------------------- = s 2 d s +s+4
2. Select a controller transfer function, Gc, that will reduce the system to a first order system with a time constant of 0.5s, as shown below. Controller d 1--------0.25 Vd + Potentiometer Va 1--------0.25 a 1 ---- = ---------d s+2 e Gc Vs Motor 100 --------------s + 0.1 1 -s a
convolution - 19.1
19. CONVOLUTION
Topics:
Objectives:
19.1 INTRODUCTION
Can be used to find normal input reponses for linear systems It is most useful for finding an output response for a system given an arbitrary input function It is also the basis for other methods that come later for system analysis.
convolution - 19.2
P(t) 1 -
Area =
% ( t ) dt
= 1
This function is theoretically undefined, it goes to infinity for an instant, but it does have an area of 1. t 0
If we look at an input signal (force here) we can break it into very small segments in time. As the time becomes small we can approximate it with a set of impulses.
convolution - 19.3
F(t)
t 0
An impulse t
Figure 19.1
F(t)
x( t)
% g ( t ) F ( t ) dt
t t
Figure 19.2
If we add all of the impulse responses together we will get a total system response. This operation is called convolution.
convolution - 19.4
F( t)
t
% g ( t ) F ( ) d
0
c(t) =
% g ( t ) r ( ) d
0
Figure 19.3
A set of pulses for a system gives summed responses to give the output
Consider the unit impulse of a system with the given differential equation. Note: This method is only valid for trivial differential equations with only one homogeneous term. The preferred method is shown later.
convolution - 19.5
The following first order differential equation has an input F. The input can be replaced with a unit impulse function. x + 0.5 x = 2 F X + 0.5 X = 2 ( t ) The homogeneous solution can be found. X + 0.5 X = 0 A + 0.5 = 0 X h = Ce
0.5 t
guess,
Xh = e
At
At X h = Ae
The particular solution is found. X + 0.5 X = 2 ( t ) 0 + 0.5 A = 2 ( 0 ) Xp = A = 0 The initial condition caused by the impulse function found, assuming a zero initial condition. 1-$ 1-$ # ---# ---! dt" X0 + 0.5 ( 0 ) = 2 ! dt" X0 = 2 The initial condition caused by the impulse function found, assuming a zero initial condition. X ( t ) = Ce
0.5 t 0
guess,
Xp = A
Xp = 0
X ( 0 ) = 2 = Ce X(t) = 2e
0.5 t
Note that the derivation of the unit impulse function assumed zero initial conditions, so the process of convolution must also assume systems start at rest and undeflected.
19.4 CONVOLUTION
The following example shows the use of the convolution integral to find a num-
convolution - 19.6
ber of responses.
The unit impulse response to a step input can be calculated using the convolution integral.
t t t 0.5 ( t )
x(t) =
% X ( t ) F ( ) d
0 0.5 t # e 0.5 t
% (2e
) ( 1 ) d = 2 e
0.5 t
%e
0
0.5
d = 2 e
0.5 t e
0.5
--------0.5
x(t) = 2e
0 0.5 ( 0 )
The unit impulse response to a unit ramp input can be calculated using the convolution integral.
t t t 0.5 ( t )
x(t) = x(t) =
% X ( t ) F ( ) d
0
% 2e
0
d = 2 e
0.5 t
%e
0
0.5
The unit impulse response to a sinusoidal input can be calculated using the convolution integral.
t t t 0.5 ( t )
x(t) = x(t) =
% X ( t ) F ( ) d
0
% 2e
0
sin ( ) d = 2 e
0.5 t
%e
0
0.5
sin ( ) d
convolution - 19.7
n1
where,
t - = number of steps n = -h h = step size (s) X ( t ) = the unit impulse response function F ( t ) = the input function
This can be applied to the previous example for a unit step input to find the system position at 10 seconds, with a 2 second time step.
convolution - 19.8
n1
x(t) = h & 2e
i=0
0.5 ( t ( i + 0.5 ) h )
F ( ( i + 0.5 ) h )
10 - = 5 n = ----2
51 0.5 ( 10 2 ( i + 0.5 ) )
x ( 10 ) = 2 & 2 e
i=0 4
(1)
x ( 10 ) = 4 & e
i=0
4.5 + i
x ( 10 ) = 4 ( e x ( 10 ) = 4 ( e
4.5 + 0
+e
4.5 + 1
+e
4.5 + 2
+e
4.5 + 3
+e
4.5 + 4
4.5
+e
3.5
+e
2.5
+e
1.5
+e
0.5
x ( 10 ) = 4 ( 0.01111 + 0.03020 + 0.08208 + 0.22313 + 0.6065 ) x ( 10 ) = 3.81208 This value can be compared to the exact value calculated below. The accuracy of the numerical value would increase substantially if the step size were decreased. x ( 10 ) = 4 ( 1 e
0.5 ( 10 )
) = 4 ( 1 0.006738 ) = 3.973048
convolution - 19.9
// A numerical convolution example function foo=X(t) // The impulse response function foo = 2 * exp(-0.5*t); endfunction function foo=F(t) // The input function foo = 1; // a step function endfunction // define the variables function foo = convolution(t, h) // The integration function n = t / h; foo = 0; for i=0:n-1 foo = foo + h * X(t - (i+0.5)*h) * F((i+0.5)*h); end endfunction h = 1; // the time step for the integration t = 10; // the time point to calculate printf("The estimated value x(%fs) = %f \n", t, convolution(t, h)); x_calc = 4*(1-exp(-0.5*t)); printf("The actual value is x(%fs) = %f \n", t, x_calc);
convolution - 19.10
c(t) =
% g ( t ) r ( ) d
0
C(s) = G(s)R( s)
Figure 19.4
19.7 SUMMARY
Topics:
Objectives:
20.1 INTRODUCTION
- state equations can be converted to transfer functions. The derivation follows.
State equations as functions of time x = Ax + Bu y = Cx + Du In the s-domain sX X 0 = AX + BU X ( sI A ) = BU + X 0 X = ( sI A ) BU + ( sI A ) X 0 Y = CX + DU Y = C ( ( sI A ) BU + ( sI A ) X 0 ) + DU Y = ( C ( sI A ) B + D ) U + C ( sI A ) X 0 Assuming the system starts at rest, Y = ( C ( sI A ) B + D ) U Y --- = ( C ( sI A ) 1 B + D ) U (the transfer function)
1 1 1 1 1 1 1
- state equation coefficient matrices can be transformed to another equivalent for, if the state vector is rearranged.
State equations as functions of time x = Ax + Bu y = Cx + Du Map one state vector to another one x = Tz This can be used to calculate new coefficient matrices 1 z = T ( Ax + Bu )
1 z = T ( ATz + Bu ) 1 1 z = T ATz + T Bu 1 1 z = T ATz + T Bu
A = T AT
B = T B
z = Az + Bu The output equation becomes y = Cx + Du y = CTz + Du y = CTz + Du y = Cz + Du The equivalent set of state equations is, z = Az + Bu y = Cz + Du A = T AT C = CT
1
C = CT
D = D
B = T B D = D
The two following transfer functions are equivalents G = C ( sI A ) B + D G = C ( sI A ) B + D This can be shown by applying the transformation matrix G = CTT ( sI A ) TT B + TT D G = ( CT ) ( T ( sI A ) T ) ( T B ) + D G = ( CT ) ( ( sI A ) ) ( T B ) + D G = C ( ( sI A ) ) B + D = G
1 1 1 1 1 1 1 1 1 1 1 1
The transfer function form can be put into a matrix form. In this case the denominator is the characteristic equation.
The transfer function can be said to be equivalant to the determinants of the matrix form. ( sI A ) B C D sI A ) D ( B ) C ----------------------------------- = ( --------------------------------------------- = ( sI A ) D + BC ( sI A ) sI A sI A ( sI A ) B C D 1 ------------- = poles G = C ( sI A ) B + D = ----------------------------------sI A zeros sI A = characteristic equation = homogeneous
The free (homogeneous) response of a system can be used to find the state transition matrix.
The homogeneous equation can be written in the s-domain, and then converted to time. X h = sI A X0 x h ( t ) = L [ sI A X 0 ] xh ( t ) = L
1 1
xh ( t ) = e x0
At
= transition matrix
The forced response (particular) response of the system can be found using convolution,
The homogeneous equation can be written in the s-domain, and then converted to time. x = Ax + Bu x(t) = e x( 0) + % e
At 0 t A(t )
Bu ( ) d
y = Cx + Du
At
y ( t ) = Ce x ( 0 ) + % Ce
0
A(t )
Bu ( ) d + Du ( t )
initial response
impulse response
Given a second order differential equation, the state matrix can be found, F = Mx x = v 0 d- x 0 1 x ---= + 1 F A = 0 1 F dt ---v 0 0 v 0 0 v = ---M M This can be used to find the inverse matrix, s 1 1s --1 1 ----- --2 2 2 # $ 0 s s 1 s 1 0 0 1 s 1 s s ( sI A ) = & s = ------------= = ' = 2 ! 0 1 0 s 0 0" 0 s s 0 1 ---- --0 -2 2 s s s The function of time can be found assuming an initial position of 10 and velocity of 5.
1 1
At
1 1 = L [ ( sI A ) ] = 1 t 0 1
At x h ( t ) = x = e 10 = 1 t 10 = 10 + 5 t v 5 0 1 5 5
Given a second order differential equation, the state matrix can be found, F = Mx
If a matrix is diagonizable, the diagonal matrix can be found with the following technique. This can be used for more advanced analysis techniques to create diagonal (and
Given a matrix A, a purely diagonal matrix may be found, T AT = This may also be written as, e
At 1
A = TT
= n
= Te T
t 1
e 1 = e
n t
Eigenvalues can be found using the following relationship. If any of the Eigenvalues are repeated the Jordan normal form is required. I A = 0 Note: the Eigenvalues are the values found in the characteristic/homogeneous equation solution.
The Eigenvectors are then combined into a single matrix, this is the transition matrix.
example,
= ( + 1 )( 4 ) ( 6 ) = 3 + 2 = ( 2 ) ( 1 ) Therefore the Eigenvalues are, An eigenvector can be calculated using the Eigenvalue 2. 1 2 u 11 = u 11 = 2 u 11 1 3 4 u 21 u 21 u 21 u 11 + 2 u 21 = 2 u 11 2 u 21 = 3 u 11 v1 = u 11 u 21 = 2 3 1 = 2 2 = 1
1 2 2 , 1 2 1 = 4 , 1 3 4 3 3 4 1 6 1 4, 1 = 4, 1 6 1 6 1 verified
If there are repeated Eigenvalues in the system the Jordan Form can be used.
1 1 0 0 2 1 J = 0 0 3
0 0 0
0 0 0 Jordan block
0 0 0 n 1 1 0 0 0 0 n
A =
I A =
2 1 1 1 2 1 1 1 2
= ( + 3) ( 0)
FIX
4 T 13 = 2 T 13 + T 23 + T 33 4 T 23 = T 13 + 2 T 23 + T 33 4 T 33 = T 13 + T 23 + 2 T 33
Given the following Eigen values and vectors the free response is, 1 = 2
n
2 = 1
v1 = 2 3
2t
v2 = 1 1
t
xh ( t ) =
(
i=1
vi e
i t
2t 1t = 2 e + 1 e = 2e + e 2t t 3 1 3e + e
zeros of state space functions can be found using the state matrices.
This can be put into the matrix form, # 1 0 $ 0 1 ' 5 & s0 ! 0 1 3 4 " 5 1 0 s0 1 5 0
= 0
3 s0 + 4 5 = 0 1 0 0 s 0 ( 0 ) ( 1 ) ( 4.5 ) + 5 ( ( s 0 + 4 ) ) = 0 24.5 = 5 s 0 s 0 = 4.9 There is one zero at -4.9 rad/sec. The order of the polynomial determines the number of zeros. If the polynomial has no s terms, then there are no zeros.
20.2 OBSERVABILITY
- a system is observable iff the system state x(t) can be found by observing the input u and output y over a period of time from x(t) to x(t+h). - If an input is to be observable it must be detectable in the output. For example consider the following state equations.
d- x ---= a b x + e u dt v c d v f y = g h x + j u v k if the parameters c, d or f were not in the final expression for y, the second state equation would be said to be not observable. This will happen when an output parameter is zero in the C matrix and an equation is decoupled in the A matrix, i.e. the same variable column is zero. For example, d- x ---= 1 0 x + 3 u dt v 0 a v b y = 5 0 x + 6 u v # $ G = C ( sI A ) B + D = 5 0 & s 0 1 0 ' ! 0 s 0 a "
1 1
3 + 6 b
G = 5 0
3 1- b ---------s+a
# s+a 0 $ & 0 s1 ' 3 + & -' 3 + 6 6 = 5 0 & -------------------------------( s 1 ) ( s + a )' b b & ' ! " 3 ---------15 + 6 = 5 0 s 1 + 6 = ---------+6 s 1 b ---------s+a
Note: the variables a and b both dissapeared because this system is not observable.
This often happens when a system has elements that are decoupled, or when a pole and zero cancel each other. Observability can be verified formally for an LTI system with the following relationship.
The system is unobservable if the equation below is true for any state, Ce x = 0
At *
t0
1 0 * x = 0 , 1 , 0 0
0 0 1
One example, A = 1 2 3 4
At *
C = 5 6 e e e
3t t 2t 4t
Ce x = 5 6
- 1 0 . - 1 0 . + , , = ( 5 et + 6 e3t ) ( 5 e 2t + 6 e 4t ) + , , ) 0 1 * ) 0 1 *
. At * Ce x = + ( 5 e t + 6 e 3 t ) ( 5 e 2 t + 6 e 4 t ) 1 , ( 5 e t + 6 e 3 t ) ( 5 e 2 t + 6 e 4 t ) 0 , 0 1 * ) Ce x = { ( 5 e + 6 e ), ( 5 e + 6 e ) } Both values are non-zero, so both states are observable. One example, A = 1 0 0 2 C = 3 0
At * t 3t 2t 4t
t . . At * t Ce x = 3 0 e 0 + 1 , 0 , = 3 e t 0 + 1 , 0 , = { 3 e , 0 } 2t ) 0 1 * 0 e ) 0 1 *
Another theorem for testing observability is given below. If any of the states satisfies the equation it is unobservable.
C CA CA
n1
x = 0
rank ( M o ) = rank
C CA CA
n1
= n
If a system in unobservable, it is possible to make it observable by changing the model. A pole-zero cancellation is often the cause of the loss of observability. If all unstable modes are observable, the system is detectable.
20.3 CONTROLLABILITY
- a system is controllable iff there is an input u(t) that will cause the system to go from any initial state to any final state in a finite time. - stabilizable if it is controllable or if the uncontrollable nodes are stable. - If an input is to be observable it must be detectable in the output. For example consider the following state equations.
d- x ---= a b x + e u dt v c d v f y = g h x + j u v k if the parameters c, d or f were not in the final expression for y, the second state equation would be said to be not uncontrollable. This will happen when an output parameter is zero in the C matrix and an equation is decoupled in the A matrix, i.e. the same variable column is zero. For example, d- x ---= 1 0 x + 2 u dt v a b v 0 y = 3 4 x + 5 u v # $ G = C ( sI A ) B + D = 3 4 & s 0 1 0 ' ! 0 s a b "
1 1 1
2 + 5 0
G = 3 4 s1 0 0 s+b 1---------s1 0 0
G = 3 4
Note: the variables a and b both dissapeared because this system is not controllable.
t0
B = 5 6 . e 1t e 2t 5 5 = + 1 0, 0 1 , 6 ) * e 3t e 4t 6
. 5 e1t + 6 e2t 1t 2t 3t 4t , = { 5e + 6e , 5e + 6e } + 1 0 0 1 , ) * 5 e3t + 6 e4t The results are both non-zero, so both states are controllable. An example is, A = 1 0 0 2 - 1 0 . + , , e ) 0 1 *
T 1 0t 0 2
B = 0 3 . e1t 0 0 0 = + 1 0, 0 1 , 3 ) * 0 e 2t 3
( x ) B AB A n 1 B
* T
rank ( M c ) = rank B AB A n 1 B = n
For a system to be controllable, all of the states must be controllable. If a system in uncontrollable, it is possible to make it observable by changing the model. A pole-zero cancellation is often the cause of the loss of observability. if all unstable modes are controllable, the systems is said to be stabilizable. The principle of Duality requires that a system be completely observable to be controllable.
20.4 OBSERVERS
Observers estimate system state variables when not all of the variables are directly observable. Observers use a limited set of system states that are available to identify other system states that are not observable. The separation principle ensures that the observer cannot effect the stability of the system it is observing.
20.5 SUMMARY
20.9 BIBLIOGRAPHY
How, J, "16.31 Feedback Control Course Notes", MIT Opencourseware website.
Topics:
Objectives:
21.1 INTRODUCTION
There are a few terms to be defined, identification - the process of determining a state space (or other) model of a process. parameter identification - used to estimate model parameter values. estimatior - this tries to determine state variable values given available data. observer - a special type of estimator that uses available input and output data to estimate a system state given unknown initial conditions. This is simalar to running a system simulation in parallel with the real system. compensator - a feedback control system designed to drive a system to an arbitrary input. regulator - a feedback control system designed to drive a system to a given operating point. A special case of a compensator with a zero input.
The system state equations, with D=0, x = Ax + Bu y = Cx + 0 u The Eigenvalues of A give the system poles u = r Kx r = setpoint u = control output/plant input K = proportional gain values x = Ax + B ( r Kx ) x = ( A BK ) x + Br x = A c x + Br y = Cx
x =
0 1 x+ 0 u 2 3 4
y = 1 x 0
The rank is 2, and the order of the matrix A is 2, so the system is controllable. Check for the stability of the system without a controller, sI A = s 0 0 1 0 s 2 3
2
s 1 2 s 3
sI A = s ( s 3 ) 2 = s 3 s 2 = ( s ) ( s ) Therefore, the uncompensated system is....... Select an input vector with variables, u = Kx = k 1 k 2 x Ac = 0 1 0 1 0 0 1 0 0 = k1 k2 = 4 k1 4 k2 ( 2 4k1 ) ( 3 4 k2 ) 2 3 4 2 3 0 1 s 0 ( 2 4 k1 ) ( 3 4 k2 ) 0 s =
2
sI A c =
s 1 s + 2 + 4 k1 s + 3 + 4 k2
sI A c = s ( s + 3 + 4 k 2 ) + ( s + 2 + 4 k 1 ) = s + s ( 4 + 4 k 2 ) + ( 2 + 4 k 1 ) The system is clearly second order, so the second order methods may be used to select parameters. However for variety, why dont we select a system that has poles at, p = 1 + 2 j, 1 2 j s + s ( 4 + 4 k2 ) + ( 2 + 4 k1 ) = ( s + 1 + 2 j ) ( s + 1 2 j ) s + s ( 4 + 4 k2 ) + ( 2 + 4 k1 ) = s + s ( 1 + 2 j + 1 2 j ) + ( ( 1 + 2 j ) ( 1 2 j ) ) s + s ( 4 + 4 k2 ) + ( 2 + 4 k1 ) = s + s ( 2 ) + ( 5 ) 4 + 4 k2 = 2 2 + 4 k1 = 5 k 2 = 0.5 k 1 = 0.75
2 2 2 2 2
r + -
u B + +
x 1 -s A K
x C
Figure 21.1
The value of K in the previous example could also be picked using Ackermanns formula.
The state equations and the desired response of the system are,
x =
0 1 x+ 0 u 2 3 4
2
y = 1 x 0
Mc =
0 4
0 1 0 2 3 4
1
= 0 4 4 12
2
K = 0 1 0 4 4 12
% 0 1 # ! 2 3
& + 0 1 ( 2 ) + ( 5 ) I$ " 2 3
12 4 & 4 0 % 2 3 -# K = 0 1 --------------------+ 0 2 + 5 0$ 0 16 ! 6 7 4 6 0 5" K = 0 1 0.75 0.25 3 1 = 0.25 0 3 1 = 0.75 0.25 0.25 0 2 6 2 6 NOTE: DOESNT MATCH, TRACK DOWN ALGEBRA PROB
21.3 OBSERVERS
Observers are used to estimate the next system state. They can also be used to predict future state values. As an example, an observer might be used for a targeting system that is tracking a moving object. The estimator can be used to direct a missle to an estimated location so that the missle and target arrive at the same time. An observer is shown in block diagram form
Observer d- ---X = AX + BU + K( Y Y ) dt Y = CX X Y
Figure 21.2
Aside: For an open loop estimator a simulation is run, while the system is running. The simulation values are compared to the actual system responses, and the model is adjusted. It is assumed that the initial value of the state is unknown. If A is stable then the estimation will eventually converge (this can be checked using the Eigenvalues). However, there is no guarantee that it will converge quickly.
The actual system d---x = Ax + Bu dt The state estimator model d- + Bu ---x = Ax dt The estimation error = xx x d ) = A(x x ) ---(x x dt ( t ) = e At x (0) x
y = Cx
CI
d- ---x = Ax dt
A closed loop estimatior is shown below. It uses a learning matrix L to adjust the convergence rate. A larger L value will result in faster convergence, but the exponent must
now be checked to ensure observability. The system and estimator y = Cx The estimator error = Cx = yy y The estimator d- ( t ) + Bu ( t ) + L ( y ( t ) y (t)) ---x = Ax dt ( t ) = Cx (t) y where, L = a gain matrix The convergence rate, d- ---x = ( A LC ) x dt ( t ) = e ( A LC ) t x (0) x = Cx y
If a system is controllable the Eigenvalues of A-BK can be placed anywhere, rank ( A ) = rank B AB A n 1 B = n If a system is observable the Eigenvalues of A-LC can be placed anywhere, rank ( A ) = rank C CA CA
n1
= n
Consider the example below, for a second order system. The learning rate values are selected to determine how quickly the model converges.
sI ( A LC ) =
2
s + a1 + l1 1 a2 + l2 s
= s ( s + a 1 + l 1 ) ( 1 ) ( a 2 + l2 )
= s ( 1 ) + s ( a1 + l 1 ) + ( a2 + l2 )
L = Ke = e ( s ) Mo
Consider the state equations for a mass spring damper system (y is the position). 0 d- x ---= K s dt v -------M 0 A = K s -------M 1 0 x + K d 1- F ----------- v M M 0 B = 1 ---M y = 1 0 x + 0 F v
1 Kd -------M
C = 1 0
D = 0
First test for observability, (note: it is observable) 1 0 rank C = rank CA 0 1 0 Ks -------M 1 K d -------M = rank 1 0 0 1 = rank 1 0 0 1 = 2
Consider the open loop estimator d- + Bu ---x = Ax dt 0 d- x ---= K s dt -------v M 1 Kd -------M 0 x + 1 F ---v M
= Cx y x = y 1 0 v
The open loop estimator will normally ignore the response to initial conditions and will have long term errors resulting from modeling errors and random disturbances in the system.
Consider the closed loop estimator with a learning rate. d- ( t ) + Bu ( t ) + Ly (t) ---x = Ax dt 0 d x ---= K s dt -------v M 1 Kd -------M 0 l x + 1 F+ 1 y ---l2 v M ( t ) = Cx (t) y x (t) = y 1 0 v
W = KX X = C --K
1
Y- = M 1 ---Y---W W
M = C --K
Y- = MX ---W d- Y d1 Y ---MX = M ( AX + BU ) = MAX + MBU = MAM ------- = ---- + MBU dt dt W W The matrices can be partitioned to isolate the unmeasurable state variables. Note that the Eigenvalues of Hw must be relatively small. MAM
1
Hy Hw
MB =
Bw
d- ---W = H y Y + H w W + Bw U dt
system state. u = Kx = K y
The system state is often difficult to measure directly, so an estimator can be used. . u = Kx = Kx
For a regulator assume the state variables go to zero, so.... u = Kx A closed loop estimator d- + Bu + L ( y y ) ---x = Ax dt = Cx y The state model for the system is, d---x = Ax + Bu dt y = Cx These can be combined to obtain, d- + Bu + L ( y y ) = x ( A BK LC ) + x ( LC ) ---x = Ax dt d ( BK ) ---x = Ax + Bu = x ( A ) + x dt Resulting in the matrix, x d- x BK ---= A dt x LC A BK LC x
The previous matrix can be revised BK I 0 A cl = I 0 A I I LC A BK LC I I BK A cl = I 0 A BK I I A BK A + BK + LC A cl = A BK BK 0 A LC The new poles for this system can be written, sI A cl = ( A BK ) ( A LC ) BK ( 0 ) = A ALC ABK + BKLC
2
The estimators and regulators can be designed separately and then combined. This is the separation principle. The simplified block diagram for the system is,
d- ---x dt + 1 -s A BK LC
x BK
+ +
d---x dt 1 -s A
LC
The compensator,
The previous estimator equations can be combined with a compensator u = Kx d- + Bu + L ( y y ) = Ax BKx + L ( y Cx ) = ( A BK LC ) x + (L)y ---x = Ax dt These can be used to define a new compenator state, = x x c u = Cc xc d---x = Ac xc + Bc y dt c where, A c = A BK LC Bc = L Cc = K
This can be converted to a transfer function for the regulator. These can be used to define a new compenator state, sx c = A c x c + B c y x c ( sI Ac ) = B c y Bc xc ---- = --------------y sI A c u = Cc xc u ---= C c xc C c B c u ux c -- = ------= --------------y xc y sI A c
The system can also be set up for a compensator by assuming the setpoint input is not zero,
First a system error is defined. e = ry The previously defined compensator can be used here, e = ry u = Cc xc u ---= C c xc d---x = Ac xc + Bc e dt c xc Bc ---- = --------------e sI A c C c Bc u u xc -- = ------- = --------------e xc e sI A c The system can also be modelled, y = Cx y - = C x d---x = Ax + Bu dt x B -- = ------------u sI A y x CB -- = y - -- = ------------u xu sI A The feedforward and feedback loop can be simplified, C c B c CB y y - = u -- -- = ---------------------------------------( sI A c ) ( sI A ) e eu C c B c CB --------------------------------------- C c B c CB ( sI A c ) ( sI A ) y - = ------------------------------------------------- = ------------------------------------------------------------------r C c B c CB ( sI A c ) ( sI A ) C c B c CB 1 + ---------------------------------------( sI A c ) ( sI A )
Consider the state equations for a mass-spring-damper system. 0 d x ---= K s dt v -------M 0 A = K s -------M 1 0 x + Kd 1- F ----------- v M M B = 0 1---M y = 1 0 x + 0 F v
1 Kd -------M
C = 1 0
D = 0
The regulator will be designed to have a response time of 0.5s and damped frequency of 2 rad/s. 1s = -----+ j( 2 ) = 2 2j 0.5 i ( A BK ) = 2 2 j % 0 & % 1 0 1 0 # $ # = i # K K 1 k1 k2 $ = i # K k K k s d s 1 d 2 ---# -------------------# -------$ -------- --------------------M M M ! ! M M " = 0 1 s 0 Ks k1 K d k2 0 s -------------------- --------------------M M = & $ $ $ "
K d + k 2& % K s + k 1& K d + k 2& % K s + k 1& - + ---------------- = s % s + ----------------- + ---------------= s % s + ----------------! ! M " ! M " M " ! M " K d + k 2& K s + k 1& K d + k 2& 2 ----------------- % ----------------- 4 % ---------------% ! M " ! M " ! M " s = -----------------------------------------------------------------------------------------------2 Kd + k2 ----------------M k 2 = 4 M Kd -------------------2 = 2 K d + k 2& 2 K s + k 1& % ----------------- 4 % ---------------! M " ! M " 2 = -------------------------------------------------------------2 2 16 M = ( K d + k 2 ) 4 ( K s + k 1 ) 4 ( K s + k 1 ) = ( K d + 4 M K d ) 16 M k1 = 4 M 4 M Ks K = 4 M2 4 M K 4 M K s d
2 2
To select the regulator values, component values must be selected. M = 1 kg N K s = 10 --m Ns K d = 1 ----m
K = 4 M2 4 M K 4 M K s d K = 4 ( 1 ) 2 4 ( 1 ) 10 4 ( 1 ) ( 1 ) K = 10 3 The desired response time for the system will be a time response of approximately 0.2sec. x 1 - = ------------------------------------G ( s ) = -2 F Ms + K d s + K s 0 A cl = A BK = K s -------M e ( s ) = sI Acl = 1 0 1 0 = Kd Ks k1 Kd k2 1- k 1 k 2 ------------------------------ --------------------M M M M 0 1 s 0 Ks k1 Kd k2 0 s -------------------- --------------------M M = s 1 K s + k 1 Kd + k2 ---------------- -----------------+s M M
K d + k 2& % K s k 1& 2 - + ------------------- = ( s + 0.2 ) 2 = s + s % ----------------! M " ! M " Ks k 1 ------------------- = ( 0.2 ) 2 M Kd + k2 ----------------- = 2 ( 0.2 ) M k 1 = 10.04 k 2 = 0.6
0 1
2
1 0 0 1 0 Ks -------M 1 K d -------M 0 1
0 + 2 ( 0.2 ) K s -------M
1 0 1 1
0 1
& $ 0 0.4 $ 0.04 0 + + $ 0.4 K 0.4 K 2 s d K s Kd K s Kd ------------------------------0 0.04 $ - + -----M M ------------ -------$ 2 M M2 " M Kd -------M Ks -------- + 0.04 M Kd -------- + 0.4 M
2 Kd -----2
1 0 1 1
0 1
K s K d 0.4 K s K s 0.4 K d ------------ ------------- --------+ ------------- + 0.04 2 M M M M M Ks -------- + 0.04 M Kd -------- + 0.4 M
2 Kd -----2
1 0 0 1 1 1
0.4 K d K s K d 0.4 K s K s ------------ ------------- --------+ ------------- + 0.04 2 M M M M M Kd -------- + 0.4 M K s 0.4 K d --------+ - + 0.04 ------------M M M
2 Kd -----2
0 1
0.6 9.36
The compensator coefficients may then be calculated. A c = A BK LC 0 0 1 0.6 10 3 1 0 1 --- 10 1 9.36 M 0 1 0 0 0.6 0 = 0.6 1 10 1 10 3 9.36 0 9.36 4 0.6 9.36
Ac =
Ac =
Bc = L =
C c = K = 10 3 The compensator transfer function can then be written, G c ( s ) = C c ( sI A c ) B c % & = 10 3 # s 0 0.6 1 $ ! 0 s 9.36 4 "
1 1
0.6 9.36
s 4 9.36 s 0.6 1 0.6 0.6 10 3 10 3 9.36 s 4 9.36 1 s 0.6 9.36 = ------------------------------------------------------------------------------ = --------------------------------------------------------------------------( s 0.6 ) ( s 4 ) ( 1 ) ( 9.36 ) s 0.6 1 9.36 s 4 s4 1 0.6 0.6 s 6.96 10 3 10 3 9.36 s 0.6 9.36 9.36 s - = ------------------------------------------------------= -----------------------------------------------------------------------2 2 1 s 4.6 s 6.96 1 s 4.6 s 6.96 22.08 s + 69.6 = -----------------------------------2 s 4.6 s 6.96
#define PERIOD 0.001 // period of the interrupt interrupt_loop(){ // this routine is called at a regular interval PERIOD } double analog_in(){ }
d- ---x dt + 1 -s A BK LC
x BK
+ +
d---x dt 1 -s A
LC
21.6 LQR
- Linear Quadratic Regulator (LQR) allows the design of a regulating system that tends to zero, but also considers the control effort. - The basic function for evaluating the controller is defined below. The integral is evaluated to reduce the value. Ideally the state value will go to zero (it is a regulator), and the plant input will be minimized. It is assumed that D=0. Here a new state z is defined. It should reflect the system state values that should be regulated to zero.
J LQR =
' [ (y(t) )
0 T
y ( t ) + r ( u ( t ) ) ] dt
J LQR =
' [ (x(t) )
0
C z C z x ( t ) + r ( u ( t ) ) ] dt
- the design process involves adjusting the r value to obtain the desired result. -
Assume a simple controller form, u ( t ) = K LQR x ( t ) Solve using an Algebraic Riccati Equation Consider a simple system x = Ax + Bu
y = Cx
The equivalent transfer function can be written, where a(s) is the characteristic eqn. b(s) b(s) 1 - = ---------------C ( sI A ) B = --------a(s) sI A This is followed by....... UNKNOWN STUFF The desired charactersitic equation n can be used to find the controller gain values. sI A + BK LQR =
( s pi )
i=1 1
J LQR =
' [ (x(t) )
0
C Cx ( t ) + r ( u ( t ) ) ] dt
J LQR =
' [ (x(t) )
0
C Cx ( t ) + r ( u ( t ) ) ] dt
Z = N+P where, P = poles of G(s)Gc(s) in the right hand plane Z = closed loop poles in the right hand plane N = number of clockwise loops in the Nyquist Diagram about -1 Z = 0, N = P For stability
Note: Larger loops indicate a more stable system. Tight loops are very sensitive to parameter variations.
21.8.1 Stability
The stability function is defined using the Nyquist plot.
Define the points for the Nyquist plot L ( s ) = G ( s ) Gc ( s ) LN ( s ) = GN ( s ) Gc ( s ) LA ( s ) = GA ( s ) Gc ( s ) The distance, d, from the point at -1 to the calculated point is found as a function. d ( j ) = LN( j ) ( 1 + 0 j ) The sensistivity S is defined as the inverse of the distance from the point at -1. 1 1 = -------------------------S ( j ) = ------------d(j) 1 + LN ( j )
In practical terms system gain is limited by real components. As a result it is important to ensure that the design will not exceed the maximum values available.
The boundedness of the system can be tested by ensuring that the sensitivity always remains less than some given value gamma for all frequencies. Note: this requires that D must be smaller than gamma. S( j ) < C(jI A ) B + D < The Hamiltonian matrix is defined below. It does not have purely complex Eigenvalues. A + B( I D D) D C
T 2 T 1 T T 2 T 1 T 1
H =
B( I D D) B
T 2 T
1 T 1 T
C ( I + D ( I D D ) D ) C A C D ( I D D ) B Or, if D=0, A
T
H =
BB --------2
T
C C A
This matrix can then be tested, if there are no purely complex eigenvalues, the system is bounded. 0 0 BB --------2
T T
I H =
A
T
BB A --------2 C C +A
T
C C A
2 T
XBB X - = 0 A X + XA + C C + ----------------2
T T
Parameter Estimation
Regulator Design
Regulator
Plant
Reference Model
Adaptation Algorithm
Controller
Plant
Parallel MRAC
Reference Model
Adaptation Algorithm
Adjustable Plant
Series MRAC
Adaptation Algorithm
Reference Model
Adjustable Plant
The reference model is developed from the fundamentals of the system. It should be controllable and stable. d---X = Am Xm + Bm r dt m Parameters can be adpated using, e = X m Xp d---X = A p X p + Bp r dt p Where, A p, B p = Adjustable parameter matrices A m, B m = Reference model matrices d---X = Ap Xp + Bp ( r + ua ) dt p d---e = Am Xm + Bm r Ap Xp Bp ( r + ua ) = Am ( e + Xp ) + Bm r Ap Xp Bp ( r + ua ) dt d---e = e ( Am ) + Xp ( A m A p ) + r ( B m B p ) + u a ( B p ) dt d---e = e ( Am ) + f dt f = Xp ( Am Ap ) + r ( Bm Bp ) + ua ( Bp )
V = e Qe d- & dd- T& T T T T T ---e = ( e ( A m ) + f ) Qe + e Q ( e ( A m ) + f ) V = % ---e Qe + e Q % ---! " ! " dt dt dt dT T T ---V = e ( A m Q + QA m ) e + 2 e Qf dt dT T ---V = e We + 2 e Qf dt W = ( A m Q + QAm )
T
d---x = Ax + Bu + B w w dt y = Cx + v where, B w = process noise weighting matrix w = process noise matrix v = sensor noise N(s) 1 G yw ( s ) = C ( sI A ) B w = ----------D( s) Rw D ( s ) D ( s ) -----N ( s ) N ( s ) = 0 Rv where, R w, R v = factors related to process/sensors noise
21.11 SUMMARY
Topics:
Objectives:
22.1 INTRODUCTION
A simple example
Given a system model for a force applied to a mass, d---x = v dt dF ---v = ---dt M 0 d- x ---= 0 1 x + F dt v ---0 0 v M
For an unknown second order linear system, d- x ---= a b x + e F dt v c d v f x d- x i ---= a b i + e F dt v c d vi f i The state variables can be replaced with backwards difference equations, xi xi 2 -------------------xi 1 T a b = + e F x x i i2 xi 2 xi 1 + xi 2 c d -------------------f ---------------------------------------T 2 T The equations can then be written for three different set of points to yield six equations. xi xi 2 xi xi 2 -------------------- = ax i 1 + b -------------------- + eF T T x i x i 2$ xi xi 2 - + c ( 0 ) + d ( 0 ) + e ( F ) + f ( 0 ) = -------------------a ( x i 1 ) + b # -------------------! T " T x i 3 x i 5$ xi 3 xi 5 --------------------------- + c ( 0 ) + d ( 0 ) + e ( F ) + f ( 0 ) = --------------------------a ( xi 4 ) + b # ! " T T xi 6 xi 8 xi 6 xi 8 a ( x i 7 ) + b # ---------------------------$ + c ( 0 ) + d ( 0 ) + e ( F ) + f ( 0 ) = --------------------------! " T T xi xi 2 xi 2 xi 1 + xi 2 ---------------------------------------- = cx i 1 + d -------------------- + fF 2 T T x i x i 2$ xi 2 xi 1 + xi 2 -------------------- + e ( 0 ) + f ( F ) = ---------------------------------------a ( 0 ) + b ( 0 ) + c( xi 1 ) + d# 2 ! T " T x i 3 x i 5$ xi 3 2 xi 4 + xi 5 -------------------------- + e ( 0 ) + f ( F ) = ----------------------------------------------a ( 0 ) + b ( 0 ) + c( xi 4 ) + d# 2 ! " T T xi 6 2 xi 7 + xi 8 x i 6 x i 7$ -------------------------- + e ( 0 ) + f ( F ) = ----------------------------------------------a ( 0 ) + b ( 0 ) + c( xi 7 ) + d# 2 ! " T T
The equations can be rewritten in matrix form, xi 1 xi 4 xi 7 0 0 0 xi xi 2 -------------------T xi 3 xi 5 -------------------------T xi 6 xi 8 -------------------------T 0 0 0 0 0 0 xi 1 xi 4 xi 7 xi xi 2 -------------------0 F 0 T xi 3 xi 5 -------------------------0 F 0 T a xi 6 xi 8 b -------------------------0 F 0 T c = xi 2 xi 1 + xi 2 xi xi 2 d ---------------------------------------2 -------------------- 0 F T e T xi 3 2 xi 4 + xi 5 f xi 3 xi 5 ------------------------------------------------------------------------ 0 F 2 T T xi 6 xi 7 xi 6 2 xi 7 + xi 8 -------------------------- 0 F ----------------------------------------------T 2 T
Some sample data points can be calculated for F=1 and M=1, 1 F - at 2 = 1 -- ---- t2 x = -T = 1 F = 1 2 2M x(0) = 0 x ( 1 ) = 0.5 x(2) = 2 x ( 3 ) = 4.5 x(4) = 8 x ( 5 ) = 12.5 x ( 6 ) = 18 x ( 7 ) = 24.5 x ( 8 ) = 32 xi 8 = 0 x i 7 = 0.5 xi 6 = 2 x i 5 = 4.5 xi 4 = 8 x i 3 = 12.5 x i 2 = 18 x i 1 = 24.5 x i = 32
M = 1
The values can be substituted into the matrix, and the matrix solved 32 18 24.5 ----------------1 12.5 4.5 8 ----------------------1 2 0 ----------0.5 1 0 0 0 0 0 0 0 0 0 0 0 0 10 1 1 32 18 ----------------1 12.5 4.5 ----------------------0 a 1 2 0 b ----------0 1 c = 32 2 ( 24.5 ) + 18 -----------------------------------------d 2 1 1 e 12.5 2 ( 8 ) + 4.5 ---------------------------------------1 f 2 1 2 2 ( 0.5 ) + 0 1 --------------------------------2 1 a 0 b 1 c = 0 d 0 e 0 f 1
14 8 2 1 1 1
Substituting these values back into the state equation results in the following expression, which matches the exact state equation. x d- x i ---= a b i + e F dt v c d vi f i xi x = 10 i + 0 0 F 0 0 vi 0 0 1 0
state equation
output equation
This can be incorporated as a realtime algorithm to calculate the data parameters based upon realtime updates.
xi 1 xi 4 a b x c = i7 d 0 e f 0 0
0 0 0
0 0 0
F 0 F 0 F 0
This can then be used as a model to calculate a transfer function as shown below using the previous example.
x = 10 i + 0 0 F C = 1 0 D = 0 0 0 0 vi 0 0 1 0 0 0 0 0 these can be used to calculate a SISO system transfer function, and its inverse. # $ G = C ( sI A ) B + D = 1 0 % s 1 0 a b & 0 0 ! 01 c d"
1 1
e + 0 0 f 0 0
# $ G = 1 0 % s a b & 0 0 ! c s d "
G + xd -
+ + controller F plant
xa
The identified coefficients for the controller are substituted into the inverse transfer func. 0 a b 1 c = 0 0 d 0 e 1 f
The identified coefficients for the controller are substituted into the inverse transfer func. d-$ 2 F # ---- = F -x = ---! dt" M 1 x 1 -- = ---2 F s A state diagram for the system may then be written using a proportional controller, s + xd 1 P
2
+ + F 1--2 s
xa
1 -P +
+ P 1--2 s
xa
+ + P --2 s
xa
+ + P -------------2 s +P P -------------2 s +P
xa
xd
xa
xd
xa
xd
xa
Note: This suggests that the result is an ideal controller, however in practice there are errors, such as sensor noise, imperfect actuators, and changing system conditions such as mass. This also assumes that the force actuator can generate any requested force.
22.2 SUMMARY
page 546
page 547
need to enter your user name and your password (DO NOT SAVE THE PASSWORD - SOMEBODY ELSE CAN GET ACCESS TO YOUR ACCOUNT). You should see a message that indicates files have been uploaded successfully. 7. Use Netscape, not the editor, to see if the changes have occurred. Your changes may not show up on the browser. This is because Netscape does not reload pages every time to look at them. Pages are often stored for up to 1 month on the PCs hard drive, and reused when you look at them. There are two ways to update the screen before this time limit - click on the reload button. 8. Next we will add links to your home page. First, run Mathcad, and create a simple file, and then save it in the same folder/directory you saved. Use a file name that is all lower case such as test.mcd - any upper case letters cause problems in Windows 95. 9. Get your home page back in the Netscape editor. Someplace type the word GVSU. Use the mouse to select what you just typed, and then click on the link button. For the link name enter http://www.gvsu.edu, and apply the change. This will now be a link to the Grand Valley home page. For your Mathcad file type something like Mathcad file, highlight it, and add a link to test.mcd. This link will connect to your Mathcad file. 10. Publish the file, but first add the Mathcad file to the list of files at the bottom of the screen. 11. Test the page. Some tips are, - Windows will not allow multiple applications to open the same file at the same time. If you seem to be having trouble opening a file, make sure it is not open in another application. - As you add other files to your homepage, put them in the temp directory. This will make all of the procedures simpler. - Try to make your web pages small, and link them together. This will decrease download time and make browsers happier. - Avoid using excessive images. Anything over 10K will make it very slow downloading over modem. Anything over 100K makes modem downloading painfully slow. - When putting images on the web page use jpg for photographic images, and gif for line images. jpg images can be compressed more than gif , but lines will become blurred. - To link to other files or web pages there will be a link command. If you want to add a file that is in your temp directory, just put the name of the file in the URL field. - Watch upper/lower case. This is a major cause of web page problems. It is best to keep to lower case for all file names.
page 548
page 549
Submit: 1. A Mathcad file linked to your home page. 2. A Working Model file linked to your home page. 3. An explanation and a link to a company on your home page.
page 550
page 551
page 552
LEGEND: Analog inputs - ACHx Analog input ground - AISENSE/AIGND Analog outputs - DACxOUT Analog output ground - AGND Digital inputs and outputs - PAx, PBx, PCx Digital input/output ground - DGND Control handshaking - EXTTRIG, EXTUPDATE, EXTCONV Counter inputs/outputs - OUTBx, GATBx, CLKBx
NOTE: LABVIEW MANUALS ARE AVAILABLE ON-LINE, AND CAN BE FOUND ON THE COURSE HOME PAGE - LEAVE THE PAPER MANUALS IN THE LAB.
ACH0 ACH2 ACH4 ACH6 AISENSE/AIGND AGND DGND PA1 PA3 PA5 PA7 PB1 PB3 PB5 PB7 PC1 PC3 PC5 PC7 EXTUPDATE OUTB1 OUTB2 CLKB1 GATB2 +5V pin 1 Looking at the connector (on the back of the computer)
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50
ACH1 ACH3 ACH5 ACH7 DAC0OUT DAC1OUT PA0 PA2 PA4 PA6 PB0 PB2 PB4 PB6 PC0 PC2 PC4 PC6 EXTTRIG EXTCONV GATB0 GATB1 OUTB2 CLKB2 DGND
page 553
Learn to use computers equipped for A/D and digital inputs. Theory: The computer reads data at discrete points in time (like a strobe light). We can read the data into the computer and then do calculations with it. To read the data into a computer we write programs, and use "canned" software to help with the task. LabVIEW allows us to write programs for data collection, but instead of typing instructions we draw function blocks and connect them. How we connect them determines how the data (numbers) flow. The functions are things like data reads and calculations. In this lab we will be using Labview to connect to a data acquisition (DAQ) board in the computer. This will allow us to collect data from the world outside the computer, and make changes to the world outside with outputs. When interfacing to the card using a program such as Labview, there must be ways to address or request information for a specific input or output (recall memory addresses in EGR226). The first important piece of information is the board number. There can be multiple DAQ boards installed in the computer. In our case there is only one, and it is designated device 1. There are also many inputs and outputs available on the card. For analog outputs there are two channels so we need to specify which one when using the output with 0 or 1. For analog inputs there are 8 channels, and as before, we must specify which one we plan to read from using 0 to 7. For digital I/O there are a total of 24 pin distributed across 3 ports (1 byte each). Therefore when connecting inputs and output we must specify the port (PA=0, PB=1, PC=2) and the channel from 0 to 7. Note is that we can make the ports inputs or outputs, but not mixed - in other words we must pick whether a port will only be used for inputs or for outputs. The voltage levels for the inputs and outputs are important, and you will need to be aware of these. For the digital outputs they will only ever be 0V or 5V. But the analog inputs and outputs will vary from -5V to 5V. This is build into the board. If we exceed these voltage limits by a few volts on the inputs, the boards have built in protection and should be undamaged. If we exceed the input voltages significantly, there is a potential to permanently damage the board. Equipment: PC with LabVIEW software and PCI-1200 DAQ card Interface cable PLC trainer boards Signal generator Digital multimeter Procedure:
page 554
1. Go through the LabVIEW QuickStart Guide provided in the laboratory. This will also be good review for those who have used LabVIEW in previous courses. 2. Enter the LabVIEW program (layout) schematically shown below and connect a signal generator to the analog input (ACH0). (Note: there is a pin diagram for the connector in the Labview tutorial section.) Start the signal generator with a low frequency sinusoidal wave. Use the DAQ Configure software to test the circuitry and verify that your hardware is operational. Then run your Labview program. Record the observations seen on the screen.
Front Panel
SGL
waveform chart
AIGND
com
2b. Use a stop watch to determine the average number of samples per second. Run additional programs such as browsers, spreadsheets, etc. and see how this affects the data colection speed. 3. Connect the multimeter as shown below. Test the circuit using the DAQ Configure utility. Enter the LabVIEW program schematically illustrated below and then run it. You should be able to control the output voltage from the screen using the mouse. Record your observations.
page 555
User Display
input knob
output meter
4. Connect the digital input and output circuits to the DAQ card and use the test panel to test the circuits. To do this, run the DAQ Configure utility, double click on the PCI-1200, run the test panel window and ensure that the inputs and outputs are working correctly. Create the LabVIEW screen schematically illustrated below. This should allow you to scan an input switch and set an output light. When done, quit the program and run your LabVIEW program.
page 556
Front Panel
Diagram 1 1
toggle
light/led 0 T/F
+5V
2K
LED output
Marking: 1. A laboratory report should be written, including observations, and posted to the web. 2. The programs (VIs) that use the DAQ card should be posted to the web.
page 557
metals Capacitive Proximity Sensors - use capacitance to detect most objects Optical Proximity Sensors - use light to detect presence Contact Switches - require physical contact Continuous sensors output values over a range. Examples of these are, Potentiometers - provide a resistance proportional to an angle or displacement Ultrasonic range sensors - provides a voltage output proportional to distance Strain Gauges - their resistance changes as they are stretched Accelerometers - output a voltage proportional to acceleration Thermocouples - output small voltages proportional to temperature In both cases these sensors will have ranges of operation, maximum/minimum resolutions and sensitivities. Prelab: 1. Prepare a Mathcad sheet to relate sensor outputs to the physical phenomenon they are measuring.
page 558
1. A full laboratory report with graphs and mathematical functions for each sensor.
voltage/current increases
The basic equivalent circuit model for the motor is shown below. We can develop equations for this model. This model must also include the rotational inertia of the rotor and any attached loads. On the left hand side is the resistance of the motor and the back emf dependent voltage source. On the right hand side the inertia components are shown. The rotational inertia J1 is the motor rotor, and the second inertia is an attached disk.
page 559
I Voltage Supply + Vs -
R T, Vm + -
J1
J2
Because a motor is basically wires in a magnetic field, the electron flow (current) in the wire will push against the magnetic field. And the torque (force) generated will be proportional to the current. T = KI Next, consider the power in the motor, P = V m I = T = KI V m = K Consider the dynamics of the rotating masses by summing moments. T I = --K
d- = T = J M --- dt
d- ---T = J M dt
The model can now be considered as a complete system. The current-voltage relationship for the left hand side of the equation can be written and manipulated to relate voltage and angular velocity. Vs Vm I = ----------------R Vs K T - = --------------------K R XXXXXXAdd friction to the model d- ---JM dt Vs K - = --------------------------------------K R K2 d K - + --------- = V s -------- --- dt J M R J M R Looking at this relationship we see a basic first-order differential equation. We can measure motor properties using some basic measurements. Prelab: 1. Integrate the differential equation to find an explicit function of speed as a function of time.
page 560
2. Develop a Mathcad document that will accept values for time constant, supplied voltage and steady-state speed and calculate the coefficients in the differential equation for the motor. 3. In the same Mathcad sheet add a calculation that will accept the motor resistance and calculate values for K and J. 4. Get the data sheets for an LM675 from the web (www.national.com).
motor
feedback signal
Note: The motor being tested is the large motor. The small motor will be driven and act as a generator. In this case we will refer to it as a tachometer.
3. Write a Labview program that will output an analog voltage to drive the motor amplifier. An analog input will be used to measure the motor speed from the tachometer.
page 561
4. Use a strobe light to find the relationship between the tachometer voltage and the angular speed. 5. Obtain velocity curves for the motor with different voltage step functions. 6. Use a fish scale and a lever arm to determine the torque when the motor is stalled with an input voltage. Post-lab: 1. Determine the values of K for the motor. Determine the J for the rotor, and calculate J values for different load masses added. 2. Use the values of R, J and K to compare theoretical to the actual motor response curves found in procedure step #5. 3. Use the values of R, J and K to determine what the stalled torque should be in procedure step #6. Compare this to the actual. 4. Find the time constant of the unloaded motor. Submit: 1. All work and results.
page 562
Vo = P ( Vd Vi ) where, Vo = Voltage to motor amplifier to control speed Vi = Voltage from tachometer to measure speed or position Vd = Desired motor speed voltage (user input) P = Controller gain The basic controller is set up as shown in the figure below. We can use a Labview program to implement the basic control equation described above.
amplifier
motor
feedback signal
tachometer or potentiometer
The system below shows the components in the laboratory. The power supply may need to be constructed using two power supplies connected together. The analog output from the computer must be amplified (the computer can only output about 20mA maximum). The amplifier is constructed with an LM675 high current op-amp. The amplifier drives the large DC motor, which in turn drives a small DC motor being used as a tachometer. The voltage from the tachometer is input into the computer to determine the speed. A Labview program will subtract the tachometer voltage from the desired tachometer voltage, multiply the difference by a gain constant, and output the result to drive the motor.
page 563
power supply
Prelab: 1. Develop a Mathcad document that will model the velocity feedback controller given, motor parameters, desired velocity, an inertial load, and a gain constant. This is to be solved two different ways i) with Runge-Kutta integration, ii) integration of differential equations. 2. Test the controller model using a step function.
page 564
1. Compare the theoretical and actual response curves on the same graphs. 2. Find and compare the time constants for experimental and theoretical results. Submit: 1. All work and results.
F = Ma M = J
If we have a system that is comprised of a spring connected to a mass, it will oscillate. If the system also has a damper, it will tend to return to rest (static) as the damper dissipates energy. Recall that springs ideally follow Hookes law. We can find the value of the spring constant by stretching the spring and measuring the forces at different points or we can apply forces and measure the displacements.
page 565
F = Ks x x = x x0 F = Ks ( x x0 ) F1 F2 - = --------------K s = --------------x1 x0 x2 x0 x1 x0 x2 x0 1 ----- = --------------= --------------F1 F2 Ks F1 F2 - = x 2 ----x 0 = x 1 ----Ks Ks 1 ----( F F1 ) = x2 x1 Ks 2 F2 F1 K s = ----------------x2 x1 OR F = Ks x F = Ks x F K s = -----x F2 F1 K s = ----------------x2 x1 x2 x1 x 0 (undeflected) Ks
In many cases we will get springs and devices that are preloaded. Both of the devices used in this lab have a preloaded spring. This means that when the spring has no force applied and appears to be undeflected, it is already under tension or compression, and we cannot use the unloaded length as the undeflected length. But, we can find the true undeflected length using the relationships from before. F1 F2 - = x 2 ----x 0 = x 1 ----Ks Ks Next, recall that the resistance force of a damper is proportional to velocity. Consider that when velocity is zero, the force is zero. As the speed increases, so does the force. We can measure this using the approximate derivatives as before. dx F = K d ---dt x( t + T ) x(t ) F = K d -------------------------------------- T FT K d = -------------------------------------x x( t + T ) x(t) Now, consider the basic mass-spring combinations. If the applied forces are static, Kd F F
page 566
the mass and spring will remain still, but if some unbalanced force is applied, they will oscillate. d- 2 ---= = F F F M y s g y dt d- 2 K s y Mg = M ---y dt d- 2 M ---y + K s y = Mg dt y Ks t + C 2 y h ( t ) = C 1 cos ---- M yp ( t ) = A d- ---y (t) = 0 dt p d- ---y y (t) = 0 dt p M ( 0 ) + K s ( A ) = Mg Mg A = ---------Ks
2
Ks
M Fg
page 567
Assume we start the mass at rest at the equilibrium height. Ks Mg ( 0 ) + C 2 + ---------y ( 0 ) = 0 = C 1 cos ---- M Ks Mg C 1 = ------------------------K s cos ( C 2 ) K s Ks sin ----- ( 0 ) + C 2 y' ( 0 ) = 0 = C 1 ---- M M C 2 = 0 K s Mg Mg - cos ----+ ---------y ( t ) = ------ M t Ks Ks The natural frequency is found by completing one time period, 2 = Ks ----T = M Ks 1 -----Mf
1- K s ----f = ----2 M
In the lab an ultrasonic sensor will be used to measure the distances to the components as they move. The sensor used is an Allen Bradley 873C Ultrasonic Proximity Sensor. It emits sound pulses at 200KHz and waits for the echo from an object that is 30 to 100cm from it. It outputs an analog voltage that is proportional to distance. This sensor requires a 18-30 VDC supply to operate. The positive supply voltage is connected to the Brown wire, and the common is connected to the blue wire. The analog voltage output (for distance) is the black wire. The black wire and common can be connected to a computer with a DAQ card to read and record voltages. The sound from the sensor travels outwards in an 8 degree cone. A solid target will give the best reflection. Prelab: 1. Review the theory section. 2. Extend the theory by finding the response for a mass-spring, mass-damper, and mass-spring-damper system (assume values). 3. Set up a Mathcad sheet for the laboratory steps.
page 568
page 569
d- = T = J = J --- dt
T = K = K ( 0 ) We can calculate the torsional spring coefficient using the basic mechanics of materials JG T = ---------L Finally, consider the rotating mass on the end of a torsional rod. d1
h1
J 1 G d- 2 ------- ---= = T J L dt
h2
d2 Prelab:
page 570
1. Calculate the equation for the natural frequency for a rotating mass with a torsional spring. 2. Set up a Mathcad sheet that will - accept material properties and a diameter of a round shaft and determine the spring coefficient. - accept geometry for a rectangular mass and calculate the polar moment of inertia. - use the spring coefficient and polar moment of inertia to estimate the natural frequency. - use previous values to estimate the oscillations using Runge-Kutta. - plot the function derived using the homogeneous and particular solutions.
page 571
page 572
gramming practices.
page 573
locate the drive. When done, a 5KDrive should appear under On-line drives. 4. Right click on the %KDrive and select properties. For the Drive Type select the correct version indicated on the Ultra 5000 drive. Use Setup to update the drive parameters, then close the window. 5. Under the 5KDrive select Motor and then select the motor type. Then select Setup to update the motor parameters. Notice the values and units. Close the window. 6. Turn the motor shaft by hand, it should turn easily. Enable the motor with Commands Enabled on the tool bar. The motor should now be controlled, and the shaft hard to turn. 7. For the motor select Motion then Jog. In the window set the values below. After this hold the shaft and hit Jog forward then Jog reverse then Stop. Notice how the values at the bottom of the screen change. Program Velocity 100,000 Program Acceleration 100,000 Program Deceleration 100,000 8. Now select Motion then Move and set the values below. When done, click Start to cause the motion. Change the value in Profile Distance and click Start again. Profile Distance 40,000 Velocity 20,000 Acceleration 20,000 Deceleration 20,000 9. Create a project with Insert then Project. Click on the Project that was created on the tree, then Insert Source File. Type in the following file, and then click Build. If there are any errors fix them before continuing to the next step.
page 574
#include <motion.h> int main(void){ InitMotionLibrary(); // Start the motor control functions AxisEnable(); // Enable control of the motor
MoveSetAcc(2000); // Set the maximum accelerations and velocity MoveSetVel(1000); MoveSetDec(2000); MoveDistance(10000);// Move in the positive direction while(MoveInProgress()){};// Wait until the move is complete Sleep(1000); // Pause for 1 second MoveDistance(-10000);// Move in the negative direction while(MoveInProgress()){}; Sleep(1000); AxisDisable(); return 1; } 10. Drag the new file Project.exe to the Programs under the 5KDrive. Hold the shaft of the motor and right click on the new file just dropped and click Run. The motor shaft should move forward, pause for 1 second, reverse, then stop. 11. Enter the following program and observe the results. It should behave the same as the previous program, but it has more structure. When developing control applications it is important to structure the programs so that they are easier to write and debug. // Release the motor drive control
page 575
#include <motion.h> void setup(){ InitMotionLibrary(); AxisEnable(); MoveSetAcc(2000); MoveSetVel(1000); MoveSetDec(2000); } void shutdown(){ AxisDisable(); } void jog(int distance){ MoveDistance(distance); while(MoveInProgress()){}; } int main(void){ setup(); jog(10000); Sleep(1000); jog(-10000); Sleep(1000); shutdown(); return 1; } 12. Digital inputs and outputs for the drive are located on the upper connector, CN1A. The pin out for this connector is given below. Wires can be connected by pushing a thin slot screwdriver into the slot to release the pressure clamp, and then inserting the wire. The nominal voltages to activate an input are between 12V and 24V - do not exceed the maximum voltage as this may damage the drive.
page 576
Connector CN1A
Pin 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Function INPUT 1 - Digital input 1 INPUT 2 - Digital input 2 INPUT 3 - Digital input 3 INPUT 4 - Digital input 4 INPUT 5 - Digital input 5 INPUT 6 - Digital input 6 INPUT 7 - Digital input 7 INPUT 8 - Digital input 8 OUTPUT 1 - Digital output 1 OUTPUT 2 - Digital output 2 OUTPUT 3 - Digital output 3 OUTPUT 4 - Digital output 4 SHIELD - for shielded cable termination IOPWR - V+ from external supply power for the IO INPUT 9 - Digital input 9 INPUT 10 - Digital input 10 INPUT 11 - Digital input 11 INPUT 12 - Digital input 12 INPUT 13 - Digital input 13 INPUT 14 - Digital input 14 INPUT 16 - Digital input 15 INPUT 16 - Digital input 16 OUTPUT 5 - Digital output 5 OUTPUT 6 - Digital output 6 OUTPUT 7 - Digital output 7 OUTPUT 8+ - Relay output 8 OUTPUT 8- - Relay output 8 IOCOM - common from external IO power supply
13. Connect an external power supply to the digital IO and connect a proximity sensor to input 1, as shown in the diagram below. Verify that the sensor is connected properly using the Ultraware software. Also connect a multimeter to OUTPUT1 to read the output voltage.
page 577
IOPWR
V+
power supply
IOCOM
V-
14. Enter the program below and determine what the program does.
page 578
#include <motion.h> void setup(){ InitMotionLibrary(); AxisEnable(); MoveSetAcc(2000); MoveSetVel(1000); MoveSetDec(2000); } void shutdown(){ AxisDisable(); } void jog(int distance){ MoveDistance(distance); while(MoveInProgress()){}; } int main(void){ int count = 0, state_last = OFF, state_now; setup(); while(count < 10){ state_now = InputGetState(1); // get the state of INPUT1 if( (state_now == ON) && (state_last == OFF) ){ jog(1000); count++; } state_last = state_now; OutputSetState(1, state_now);// set OUTPUT1 to the INPUT1 value } shutdown(); return 1; } 15. Analog outputs (and connections for additional encoders) are available on connector CN1B. Connect a variable power supply to act as an analog input across AIN1 and +5VCOM (WARNING: TURN THE POWER SUPPLY OFF AND SET THE VOLTAGE AT THE MINIMUM BEFORE TURNING THE SUPPLY BACK ON). Connect a multimeter across AOUT1 and +5VCOM to read
page 579
an analog output voltage. Verify the connection using the Ultraware software.
Connector CN1B
Pin 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Function +5V - internal power supply AX+ Encoder input/output A+ AX- Encoder input/output ABX+ Encoder input/output B+ BX- Encoder input/output BIX+ Encoder input/output I+ IX- Encoder input/output I+5VCOM internal power supply common AIN1 - analog input 1 AIN2 - analog input 2 +5VCOM internal power supply common AOUT1 - analog output 1 AOUT2 - analog output 2 SHIELD - termination point for shielded cables
page 580
#include <motion.h> void setup(){ InitMotionLibrary(); AxisEnable(); MoveSetAcc(2000); MoveSetVel(1000); MoveSetDec(2000); } void shutdown(){ AxisDisable(); } void locate(int position){ MovePosition(position); while(MoveInProgress()){}; } int main(void){ float a_in; int new_location; setup(); while(1 == 1){ // loop forever a_in = AnalogInputGetVoltage(1);// Get the voltage in from AIN1 new_location = a_in * 1000; locate(new_location); AnalogOutputSetVoltage(1, a_in/2.0); // output half the input voltage } shutdown(); return 1; }
17. Communications?????????????????????
page 581
R1 +
C1 + + Vo -
Vi R3 -
gain (dB)
freq
page 582
The equations for this filter can be derived with the node voltage method, and the final transfer function is shown below. DC 1 R 1 R 2 Vo 1- ------------------------------------------------------------------------------------------ ----- = ---- 2 R 1 1 + DC R + DC R + D C C R R Vi 2 1 1 1 1 2 1 2 As dictated by the ear, audio signals have frequencies that are between 10Hz and 16KHz as illustrated in the graph below. This graph shows perceived sound level, with the units of phons. For example, we can follow the 100 phons curve (this would be like a loud concert or very noisy factory requiring ear protection). At much lower and higher frequencies there would have to be more sound pressure for us to perceive the same loudness, or phon value. If the sound were at 50Hz and 113 dB it would sound as loud as 100dB sound at 1KHz.
page 583
120 110 100 Sound Pressure Level (dB) 90 80 70 60 50 40 30 20 10 0 50 100 200 500
120 110 100 90 80 70 60 50 40 30 20 10 Phons 1000 2000 freq (Hz.) 5000 10000 20000
You may appreciate that these curves are similar to transfer functions, but they are non-linear. For this lab it is important to know how the ear works because you will be using your ear as one of the experimental devices today. Prelab: 1. Derive the transfer function given in the theory section. 2. Draw the Bode plot for the circuit given R1=R2=1000ohms and C1=C2=0.1uF. You are best advised to use Mathcad to do this.
page 584
page 585
page 586
max
t dec
1. In the textbook review the sections on stepper motors and motion control. Make sure you are familiar with the basic operation of a stepper motor and the structure of a velocity profile. 2. Review the manuals for the stepper motor on the course home page on claymore.
page 587
motor to different positions. Submit: 1. The questions answered during the tutorial. 2. The program developed (with comments).
p/cw
115Vac
Figure 428
3. The indexer communicates with the PC via text transfers across a serial port. Connect a serial cable from the indexer to the COM port on the back of the PC. On the PC, run HyperTerminal (located under Programs->Accessories>Communications) or any other terminal emulation program. Set it to go "Direct to Com 1". Check to make sure the communication parameters are set to 9600 baud, 8 data bits, 1 stop bit, no parity, and no flow control/handshaking. Once connected the prompt 0> will appear on the screen. If nothing appears, press enter several times. Cycling power on the indexer will cause a reset ban-
page 588
ner to appear. To display all of the available indexer commands, type HELP. 4. The indexer commands of interest are the ones used to generate and execute different velocity profiles. The list below highlights the commands used in this lab. Typing HELP2, HELP3, HELP4, etc... will display a more detailed lists of these and other profiling commands Command H<+/-> T<xx.xx> VS<xxxxx> V<xxxxx> D<xxxxx> MC MI R RESET S STOP Description Sets the direction of motion Sets the acceleration/deceleration time in seconds Sets the starting velocity in pulses per second Sets the run velocity in pulses per second Sets the distance in pulses for the MI command Starts continuous motion Starts incremental motion Displays the status of system parameters Resets the system Controlled stop of current motion Immediate stop of current motion
5. To see what the current velocity profile parameters are, type the parameter name followed immediately by a question mark (i.e. T? will display the current acceleration/deceleration time). 6. Type in the following series of commands. Observe how the stepper motor responds and how the response relates to the parameter values entered. VS0 V2000 T0.5 D10000 MI 7. Change the acceleration and decelleration times to be longer and shorter and observe the effects using the values below. As part of your observations, hold the shaft while the motion is in progress. acc/dec 0.01 0.5 0.01 vel 20000 10 2000 distance 50000 100 6000
page 589
8. Generate and execute a velocity profile that will cause the motor to rotate at one revolution/second using the continuous motion command. Based on the run velocity parameter value, determine what angle one pulse (step) corresponds to. Compare your number to the resolution value on the stepper motor label. 9. Set the acceleration/deceleration parameter to several seconds. Using the run velocity parameter and the continuous motion command, make the stepper motor rotate at various velocities. Determine the maximum speed of rotation for the stepper motor (i.e. at what point does the motor lose synchronization with the input pulses). 10. Decrease the run velocity to about one half the maximum speed determined previously. Using the acceleration/deceleration parameter and the continuous motion command, make the stepper motor accelerate at various rates. Determine the maximum acceleration for the stepper motor (i.e. at what point does the motor lose synchronization with the input pulses). Make a note of any strange phenomena that may occur. 11. Determine the parameter values for a velocity profile with an acceleration of 18000 rpm2, maximum velocity of 600 rpm, and a total run time of 10 seconds. Generate, execute, and verify the profile. For this profile you will need to use the incremental motion command. 12. Based on your experiences in lab with motors, discuss some advantages and disadvantages of using a stepper motor compared to a DC motor. Some issues to think about are torque, position control, velocity control, and interface. 13. Enter a program with the following commands. Notice that the editor has commands to alter Ax line x, delete Dx line x or insert Ix a line x. Each program will be assigned a number between 0 and 49. The program can be run with RUN TEST. EDIT TEST PC0 TA0.5 TD0.5 VS2000 D6000 MI Q NOTE: After this point you should use the manual for a source of examples. 14. You can see a list of programs in the memory using LIST. Programs can be deleted with DELETE.
page 590
15. The motion controller has a limited set of variables available for user programs. Unlike normal programming variables, there are a fixed set availabe, as indicated below. The integers values are all 4 bytes and can range in value between +/-2,147,483,647. Write a simple program that sets a general variable value. W, X, Y, Z - general purpose integer V- velocity VS LOOP D - distance INx - input bit x PC - position counter, the current motor position in steps 16. Outputs can be set using the OUTx command, where x is the output bit number. Connect a voltage supply to the inputs and a multimeter to the outputs and create a program to read an input and set an output as shown below. Refer to the manual for pinouts and electrical specifications. 17. Logical operations can be performed using IF and WHILE statements. The operations can include =, !=, <, <=, >, >=. The if statements can include ELSE conditions and should terminate with ENDIF statements. The while loops must end with ENDW statements. The equivalent to a for-loop is the LOOP x statement. It will loop the code x times to the ENDL statement. Write a simple program that will loop until an input becomes true. 18. It is possible to branch within a program using JMP. To jump to another program (subroutine) the JMP_SEQ command can be used, the program can then return using the RET command. Write a program that has a subroutine.
page 591
page 592
page 593
the input values using D05.The bits on the screen should move up for an active input, and down for an inactive input. Input 3 will always be active because it is being used for the emergency stop (a factory default). BRN BLK BLU
drive
P24 1 L
V+ signal V-
sensor
5. Various display parameters are listed below. Try these to see what information they show. D02 - display the motor current (try holding the shaft while turning slowly) D01 - display the frequency of rotation D03 - the direction of rotation D04 - PID parameters (when in use) D05 - input status D06 - output status D16 - total drive run time in 10 hour blocks 6. Function parameters can be set with the F locations. Change the acceleration and decelleration times to 1 second using the F02 and F03 locations. 7. Restore the controller to the factory defaults using the sequence below from page 16 of the manual. button(s) up or down sel up or down sel sel sel+up+down+0 sel+up+down result b-b01 b84 01 b84 b84 00 then 0.0 description move to the B parameter groups enter the move to the reset function select the function, make sure the value is 01 select the value hold down the keys for 3 seconds release the 0 key and continue to hold the others until the display blinks.
page 594
page 595
NOT CONNECT THIS YET. 2. The controller needs to be connected as shown below. In this case it will require that the breakout board be connected to the motor controller by a ribbon cable. Note: the pins on the breakout board dont have the same numbers as on the motor controller. Connect the wires as shown below but do not turn on the devices yet. breakout board Power Supply 18-24V + 24 40 Variable Power Supply -10V to 10V + 2 18 32 Oscilloscope A com B com 50 19 26 20 33 connector on Ultra drive 5 6 22 23 31 28
3. Plug in the power cord for the Ultra 100 drive and look for a light on the front to indicate that it is working. WARNING: The motor might begin to turn after the next step --> Turn on the power supplies and the oscilloscope. 4. Run the Ultramaster software on the PC. When prompted select drive 0. At this point the software should find the drive and automatically load the controller parameters from the controller. When it is done a setup window will appear. 5. In the "drive setup" window ensure the following settings are made. When done close the setup window. Motor Model: Y-1003-2-H - this is needed so that the proper electrical and mechanical properties of the motor will be used in the control of the motor (including rotor inertia). Operation Mode Override: Analog Velocity Input - This will allow the voltage input (C+ and C-) to control motor velocity. 6. Select the IO Configuration window and make the following settings. Analog Output 1: Velocity - Motor Feedback - this will make the analog voltage output from the controller (R+ and R-) indicate the velocity of the motor, as measured by the encoder. Scale: 500 RPM/VOLT - this will set the output voltage so that every
page 596
500RPM will produce an increase of 1V. 7. Open the "Oscilloscope" on the computer screen and make the following settings. When done position the oscilloscope to the side of the window so that it can be seen later. Channel A: Velocity - command Channel B: Velocity - motor feedback Time Base: 12.5ms 8. Open the control panel and change the speed with the slider, or by typing it in. Observe the corresponding changes on the oscilloscope on the screen, and the actual oscilloscope. Notice that the velocity change follows a ramp. The slope of the ramp is a function of the maximum acceleration. 9. Hold the motor shaft while it is turning slowly and notice the response on the oscilloscopes. 10. Open the tuning window and change the I value to 0. Change the motor speed again and notice the final error. It should be larger than in previous trials. 11. Leave the I value at 0 and change the P value to 50 and then change the speed again. This time the error should be larger, and the response to the change should be slower. Hold the shaft again, it should be easier to stop. 12. Try other motor parameters and see how the motor behaves. Note that very small or large values of the parameters may lead to controller faults - if this occurs set more reasonable P or I values and then reset the fault. 13. Notice that the left hand side of the tuning window has an autotune function. Select this to automatically pick the controller values. To perform this function click the stop then start buttons. The motor will move, and then reverse direction to determine the dynamic load. It will then pick parameters to leave the motor controller critically damped. 14. Set the parameters back to P = 200 and I = 66. 15. Stop the Control Panel, this will allow the motor to be controlled by the external voltage supply. Change the voltage supply and notice how the motor responds. Reverse the voltage supply and notice that the motor turns in the other direction - remember to return it to normal when done. 16. Connect proximity sensors to digital inputs 1 and 2. The pins on the controllers are 32 and 33 respectively. The pins on the breakout board are 48 and 15 respectively. The wires for the proximity sensors are standardized as brown for V+, blue for the common and black for the signal. 17. Once the proximity sensors are attached test them with the "Display Digital IO" window. After this change the "IO Configuration window to set input 1 as "forward enable" and input 2 as the reverse enable". Test these to see that they actually stop the motor in both directions when not on. 18. Attach the motor to a ball screw slide and attach the proximity sensors. Change the motor controller to follow a position command. You should be able to control the position of the motor by changing the variable power supply voltage.
page 597
page 598
the emulator\images\1DReader . In Framework run the camera so that these appear on the screen, then pause the camera. On the left hand side of the screen select Readers then Barcode Sensor: Line for 1D codes. Draw the sensor line over the middle of the barcode.
electromagnetics - 23.1
Topics:
Objectives:
23.1 INTRODUCTION
Magnetic fields and forces are extremely useful. The fields can allow energy storage, or transmit forces.
23.2.1 Induction
Magnetic fields pass through space.
electromagnetics - 23.2
I =
! Hdl
where, I = current flowing along a line (A) H = magnetic field intensity (A/m) l = A perpendicular path around the current flow (m) For example, at a fixed radius (r) around a wire, I =
!0
Hr d
I = 2 Hr IH = -------2r
Flux density can be calculated for low H values. As the value climbs the relationship becomes non-linear.
Permeability,
electromagnetics - 23.3
B = --H
7 H 0 = 4 10 --m = r 0
where, A -% H = Magnetic field intensity $ --" m# 0 = permeability of free space r = relative permeability of a material = permeability of a material
Permeability is approximately linear for smaller electric fields, but with larger magnetic fields the materials saturate and the value of B reaches a maximum value.
4000
Figure 23.1
electromagnetics - 23.4
cast steel
1.0
B (T)
electromagnetics - 23.5
IB = -------2r where,
Wb % B = Flux density $ ------" 2 or Tesla# m I = Current in the conductor (A) r = radial distance from the conductor
! B dA
= Flux density ( Wb ) A = Cross section area perpendicular to flux
where,
When a material is used out of the saturation region the permeabilities may be written as reluctances,
LR = -----A where, R = reluctance of a magnetic path L = length of a magnetic path A = cross section area of a magnetic path
electromagnetics - 23.6
Ni F = -----------= -R l -% $ -----" A# R
Example,
I lg
lc
Faradays law,
electromagnetics - 23.7
de = N --- dt where,
For a coil
e = the potential voltage across the coil N = the number of turns in the coil
Field energy,
BB Al W = ------ V = ----2 2
BF = ----A 2
The basic property of induction is that it will (in the presence of a magnetic field) convert a changing current flowing in a conductor to a force or convert a force to a current flow from a change in the current or the path.
electromagnetics - 23.8
F = ( I B)L F = (L B)I
NOTE: As with all cross products we can use the right hand rule here. I, L
I M
Figure 23.3
We will also experience an induced current caused by a conductor moving in a magnetic field. This is also called emf (Electro-Motive Force)
electromagnetics - 23.9
em = ( v B ) L where, e m = electromotive force (V) = magnetic flux (Wb - webers) v = velocity of conductor The FBD/schematic equivalent v e + -
v e
Figure 23.4
Hysteresis
electromagnetics - 23.10
y x z 2 4 b 3 a axis of rotation B 1 5
I I
Figure 23.5
electromagnetics - 23.11
V3 =
em 3 =
!b -2
b -2
em 3 =
!b -2 2
b -2
b -2
By symmetry, the two wires together will act like wire 3. Therefore they both have an emf (voltage) of 0V. em 1 = em5 = 0 V
Figure 23.6
electromagnetics - 23.12
0 B = B 0
em 2 =
!0
em2 =
!0
b - cos ( t ) dl = aB -2
em 4 = em2
For the total loop, em = em1 + em 2 + em3 + em 4 + em5 b - cos ( t ) + 0 + aB b -- cos ( t ) + 0 e m = 0 + aB -2 2 e m = aBb cos ( t )
Figure 23.7
As can be seen in the previous equation, as the loop is rotated a voltage will be generated (a generator), or a given voltage will cause the loop to rotate (motor). In this arrangement we have to change the polarity on the coil every 180 deg of rotation. If we didnt do this the loop the torque on the loop would reverse for half the motion. The result would be that the motor would swing back and forth, but not rotate fully. To make the torque push consistently in the same direction we need to reverse the
electromagnetics - 23.13
applied voltage for half the cycle. The device that does this is called a commutator. It is basically a split ring with brushes.
e m = aBb cos ( t )
Real motors also have more than a single winding (loop of wire). To add this into the equation we only need to multiply by the number of loops in the winding.
e m = NaBb cos ( t )
As with most devices the motor is coupled. This means that one change, say in torque/force will change the velocity and hence the voltage. But a change in voltage will also change the current in the windings, and hence the force, etc. Consider a motor that is braked with a constant friction load of Tf.
&M
= Tw Tf = J
We still need to relate the voltage and current on the motor. The equivalent circuit for a motor shows the related components.
electromagnetics - 23.14
IA
RA +
LA
em eA + -
where, I A, e A = voltage and current applied to the armature (motor supply) R A, L A = equivalent resistance and inductance of windings d= e A I A R A L A ---I e = 0 dt A m
&V
we can now add in the other equations, de A I A RA L A ---I NaBb cos ( t ) = 0 dt A and recall the previous equation, IBab T f = J
Figure 23.9
Practice problem,
electromagnetics - 23.15
N M
Ks
Kd R x I
Figure 23.10 Drill problem: Electromotive force Consider a motor with a separately excited magnetic field (instead of a permanent magnet there is a coil that needs a voltage to create a magnetic field). The model is similar to the previous motor models, but the second coil makes the model highly nonlinear.
electromagnetics - 23.16
23.4 SUMMARY
fluids - 24.1
Topics:
Objectives:
24.1 SUMMARY
Fluids are a popular method for transmitting power (hydraulics). Basically, by applying a pressure at one point, we can induce flow through a pipe/value/orifice.
fluids - 24.2
24.2.1 Resistance
If fluid flows freely, we say it is without resistance. In reality, every fluid flow experiences some resistance. Even a simple pipe has resistance. Of similar interest is the resistance of a value.
w = K p where, w = flow rate through the pipe p = pressure difference across valve/pipe K = a constant specific to the pipe/valve/orifice NOTE: In this case the relationship between pressure drop and flow are non-linear. We have two choices if we want to analyze this system. 1. We can do a non-linear analysis (e.g. integration) 2. We can approximate the equation with a linear equation. This is only good for operation near the chosen valve position. As the flow rate changes significantly the accuracy of the equation will decrease. w p R(w w) (p) R --------------w w R = 2 ----2 K w p (p) w
Figure 24.1
Resistance may also result from valves. Valves usually restrict flow by reducing an area for fluid to flow through. A simple form of valve is a sliding plunger. The valve below is called a two way
fluids - 24.3
Fluid in to cylinder
Fluid out
NOTE: For this type of valve the fluid in is typically under pressure. When the valve slide is up the pressure is applied to the cylinder, and causes it to actuate. The fluid out is typically not under pressure, and just returns fluid to a reservoir tank. When used this way a cylinder needs a spring, or some other force to return it and force the fluid out.
Figure 24.2
Four way valve allow fluid force to be applied in both directions of a cylinder motion.
fluids - 24.4
to reservoir
fluid in
fluid in
to reservoir
advance
no motion
retract
Figure 24.3
24.2.2 Capacitance
Fluids are often stored in reservoirs or tanks. In a tank we have little pressure near the top, but at the bottom the mass of the fluid above creates a hydrostatic pressure. Other factors also affect the pressure, such as the shape of the tank, or whether or not the top of the tank is open. To calculate the pressure we need to integrate over the height of the fluid.
fluids - 24.5
A Fp h F p + Fg Fg Fp + Fg
Figure 24.4
Consider a tank as a capacitor. As fluid is added the height of the fluid rises, and the hydrostatic pressure increases. Hence we can pump fluid into a tank to store energy, and letting fluid out recovers the energy. A very common application of this principle is a municipal water tower. Water is pumped into these tanks. As consumers draw water through the system these tanks provide pressure to the system. When designing these tanks we should be careful to keep the cross section constant (e.g. a cylinder). If the cross section varies then the fluid pressure will not drop at a linear rate and you wont be able to use linear analysis techniques (eg., Laplace). The mathematical equations for a constant cross section tank are,
AC = ----g dw = C ---p dt
fluids - 24.6
Fluid In
In this common form of piston pump, the piston rod is drawn back creating suction that holds the valve closed, and pulls fluid into the chamber. When the cylinder is full of fluid the piston motion is reversed, creating a pressure, and forcing the inlet vale closed, and the outlet valve open, and the fluid is pumped out. The fluid volume can be controlled by using the cylinder size, and piston strokes
Figure 24.5
A geared hydraulic pump is pictured below. Other types use vanes and pistons.
fluids - 24.7
Figure 24.6
Vane based pumps can be used to create fluid flow. As the pump rotates the vanes move to keep a good seal with the outer pump wall. The displacement on the advance and return sides are unequal (aided by the sliding vanes). The relative displacement across the pump determines the fluid flow.
Fluid in
As the center core of the pump rotates, the vanes will slide in and out. Fluid is trapped between vanes. On the inlet side the volume enclosed by the vanes expands, drawing fluid in. On the outlet side the volume between vanes decreases, forcing fluid out.
Fluid out
fluids - 24.8
Figure 24.7
As with the resistance of valves, these are not linear devices. It is essential that we linearize the devices. To do this we look at the pressure flow curves. (Note: most motors and engines have this problem)
(p)
pump
valve
tank
Figure 24.9
fluids - 24.9
For the pump the relationship is shown in the graph, and it will operate at the point marked.
The pipes are all equal length and have the relationships shown below.
fluids - 24.10
24.4 SUMMARY
Topics:
Objectives:
25.1 INTRODUCTION
Energy can be stored and transferred in materials in a number of forms. Thermal energy (heat) is stored and transmitted through all forms of matter.
25.2.1 Resistance
A universal property of energy is that it constantly strives for equilibrium. This means that a concentration of energy will tend to dissipate. When material separates regions of different temperatures it will conduct heat energy at a rate proportional to the difference. Materials have a measurable conductivity or resistance (note: this is different than electrical conductivity and resistance.)
1 - ( i ) q = -R j where,
q = heat flow rate from j to i (J/s or watts) R = thermal resistance = temperature d R = ------A d = length of thermal conductor A = cross section area of thermal conductor = thermal conductivity (W/mK)
Figure 25.1
Thermal resistance
When dealing with thermal resistance there are many parallels to electrical resistance. The flow of heat (current) is proportional to the thermal difference (voltage). If we have thermal systems in parallel or series they add as normal resistors do.
R1
R2
R1 R2
RT = R1 + R2
Figure 25.2
25.2.2 Capacitance
Heat energy is absorbed at different rates in different materials - this rate is referred to as thermal capacitance. And as long as the material has no major changes in structure (i.e., gas-solid or phase transition) this number is relatively constant.
Figure 25.3
Thermal capacitance
One consideration when dealing with heating capacitance is that the heat will not instantly disperse throughout the mass. When we want to increase the rate of heat absorption we can use a mixer (with a gas or fluid). A mixer is shown in the figure below. This mixer is just a rotating propeller that will cause the liquid to circulate.
Figure 25.4
25.2.3 Sources
If we plan to design a thermal system we will need some sort of heat source. One popular heating source is an electrical heating element. heating coils are normally made out of some high resistance metal/alloy such as nichrome (nickel and chrome) or tungsten. If we run a current through the wire the resistance will generate heat. As these metals get hotter the resistance rises, hence the temperature is self regulating. If we control the voltage and current we can control the amount of heat delivered by the coil.
resistance
+ V temp P = IV where, P = power generated as heat I = current into coil V = voltage across coil
Figure 25.5
Consider an insulated sealed chamber with a resistive barrier between sides, and a heating element in one side.
qi
1, C 1
2, C 2
Given q 0 = heat flow into the left chamber from the heating element 1, C 1 = initial temperature and heat capacitance of left side 2, C 2 = initial temperature and heat capacitance of right side Next, q 1 = heat flow through the center barrier 1 - ( 2 ) q 1 = -R 1 1d--- = ----( q q1 ) C1 0 dt 1 1- # 1 - ( 2 )$ s 1 = ----q 0 -! " C1 R 1 Rq o sRC 1 1 = 1 2 1 ( 1 + sRC 1 ) = 2 + Rq o 2 + Rq o 1 = --------------------1 + sRC 1 1d---(q ) = ----C2 1 dt 2 1s 2 = --------( 2 ) RC 2 1 1 = 2 + sRC 2 2
Figure 25.6
2 + Rq o - = 2 + sRC 2 2 1 = --------------------1 + sRC 1 2 + Rq o ------------------------------ = 1 + sRC 1 2 + sRC 2 2 Rq o$ # -------! 2 " 1 --------------------- + --------------------- = 1 + sRC 1 1 + sRC 2 1 + sRC 2 Rq o$ -------- = 1 + s ( RC 1 + RC 2 ) + s 2 R 2 C 1 C 2 1+# ! 2 " Rq o -------- = s ( RC 1 + RC 2 ) + s 2 R 2 C 1 C 2 2 qo ---- = s ( C1 + C 2 ) + s 2 RC 1 C 2 2 qo $ # ---------------! RC 1 C 2" A B - + --------------------------2 = -------------------------------------- = -+ C s C + C C 2 1 2 1 2 -$ + s s # -----------------s + -----------------! RC 1 C 2 " RC 1 C 2 qo $ # # qo $ $ # ---------------% ! ---------------& " ! RC 1 C 2" RC C qo 1 2 - = -----------------A = lim % -------------------------------------- s& = -------------------------------------% & C 1 + C 2$ C1 + C2 s 0 # C 1 + C 2$ 2 # % s ------------------ +s & -----------------! RC 1 C 2 " + ( 0 ) ! ! RC 1 C 2 " " qo $ # # qo $ $ # ------------------------------% ! RC C " ! RC 1 C 2" C 1 + C 2$ & qo 1 2 % # & - = --------------------------- = -----------------lim % -------------------------------------- ! s + -----------------B = RC 1 C 2 " & C1 + C2 C 1 + C 2$ C 1 + C 2 # C 1 + C 2$ 2 # s ------------------% s -----------------& ! -----------------RC 1 C 2 ! RC C " + s RC 1 C 2 " ! " 1 2 qo qo ----------------------------------C1 + C2 C1 + C2 - + -------------------------- 2 = -----------------s C 1 + C2 s + -----------------RC 1 C 2 Figure 25.7 A two chamber thermal system (continued)
Figure 25.8
25.4 SUMMARY
26. OPTIMIZATION
Topics:
Objectives:
26.1 INTRODUCTION
For simple examples use derivatives and find the maxima/minima Consider the example below to find the
L =
$ -"" (2w + 2d) C fence = 20 $ --# m!! where, C fence = cost to construct the fence ($) w = width of the pasture (m) d = depth of the pasture (m) $-" = 0.35 $ ----# 2! m
C land where,
C land = cost for the land $ -" ----------R = 0.05 $ 2 # ! wd m yr $ -" 2 ----------R = 0.01 $ # 2 ! ( wd 300 m ) + 60$ m yr where, R = revenue generated by pasture land V = R C fence C land where, V = total value wd < 300 m wd 300 m
2
Figure 26.1
double cost(double w, double d){ double value; double cfence, cland, R; Cfence = 40*(w + d); Cland = 0.05*w*d; if (w*d < 300){ R = 0.05 * w * d; } else { R = 0.01 * (w * d - 300) + 60; } value = R - Cfence - Cland return value; }
Figure 26.2
Constraints are boundaries that cannot be crossed. Example of constraints, the pasture cannot be larger than one 1600m be 1600m beacuse of the constraints of an existing road system.
w 1600 m d 1600 m
Figure 26.3
double cost(double w, double d){ double value; double cfence, cland, R; Cfence = 40*(w + d); Cland = 0.05*w*d; if (w*d < 300){ R = 0.05 * w * d; } else { R = 0.01 * (w * d - 300) + 60; } value = R - Cfence - Cland if(w > 1600) value = 1000000; if(d > 1600) value = 1000000; return value; }
Figure 26.4
Slack variables allow constraints to be considered as part of the cost function. Helps with a system with many local minimum.
w -" 4 $ --------------d -" 4 + C penaly = $ --------------# 1600 m! # 1600 m! V = R C fence C land C penaly
Figure 26.5
double cost(double w, double d){ double value; double cfence, cland, R; double slack; Cfence = 40*(w + d); Cland = 0.05*w*d; if (w*d < 300){ R = 0.05 * w * d; } else { R = 0.01 * (w * d - 300) + 60; } // slack variable slack = pow((w/1600), 4) + pow((d/1600), 4); value = R - Cfence - Cland - slack; return value; }
Figure 26.6
Search path
Figure 26.7
Local searches
Global Search space. In this case the system becomes stuck in a local mimina.
Local Optima
Global Optima
Figure 26.8
Global searches
Global Search space. In this case the system searches all maxim.
Local Optima
Global Optima
Figure 26.9
A Global Search
26.4.3 Simplex
26.5 SUMMARY
Topics:
Objectives:
27.1 INTRODUCTION
Ks na Ks ni Ks nc Fi Ks
y x
nd
Equations can be written to relate the position of node i to the surrounding nodes
! Fx
= Fix Ks ( xi xa ) + K s ( xc x i ) = 0
xi ( 2 K s ) + x a ( K s ) + x c ( Ks ) = Fix
! Fx
= F iy K s ( y i y d ) + K s ( y b y i ) = 0
yi ( 2 K s ) + y b ( K s ) + y d ( K s ) = Fiy xi yi xa ya
Fix Fiy
2 K s 0 K s 0 0 0 Ks 0 0 0
xb xc yc xd yd
0 2 Ks 0 0 0 K s 0 0 0 Ks y b
y x
Equations can be written to relate the position of node i to the surrounding nodes and the applied force. The x and y values are deflections from the unloaded state. The Ks value is based on the material stiffness and the geometry of the elements. Ks ( xb xa ) +
( F a x, F a y )
! Fx ! Fx
= F ax + K s ( x b x a ) = 0
Ks ( ya y d )
F ax = x a ( K s ) + x b ( K s ) + = F ay K s ( y a y d ) = 0
F ay = y a ( K s ) + y d ( K s )
Ks ( xb xa ) ( Fb x, F by ) Ks ( y b yc )
! Fx ! Fx
= Fbx Ks ( xb xa ) = 0
F bx = x a ( K s ) + x b ( K s ) + = Fby Ks ( yb yc ) = 0
F b y = y b ( K s ) + y c ( K s )
Ks ( yb yc ) Ks ( xc xd ) ( F cx, F cy )
! Fx ! Fx
= F cx Ks ( x c x d ) = 0
F cx = x c ( K s ) + x d ( K s ) + = F cy + Ks ( y b y c ) = 0
F cy = y b ( K s ) + y c ( K s )
Ks ( ya yd ) Ks ( x c xd ) ( F d x, F d y )
! Fx ! Fx
= Fdx + Ks ( xc x d ) = 0
F d x = x c ( K s ) + x d ( K s ) + = F dy + K s ( y a y d ) = 0
F dy = y a ( K s ) + y d ( K s )
Ks 0 0 0 0 0
0 Ks 0 Ks 0 0 0 0 0 Ks 0 0 0 0 0 Ks 0
0 0 0 Ks
0 0 0
0 0
0 0 0 0 0 Ks
xa xb yb xc yc xd yd
0 K s ya
Ks 0
0 Ks 0 Ks 0 0 Ks 0
0 Ks 0
0 Ks 0 0 0
0 Ks 0
0 Ks 0
Ks n7
#3 Ks
Ks n8
#4 Ks
Ks n9
For element #1 Local stiffness matrix F 1x F 1y F 2x F 2y F 4x F 4y F 5x F 5y Global stiffness matrix F1x F1y F2x F2y F3x F3y F4x F4y F5x F5y F6x F6y F7x F7y F8x F8y F9x F9y = Ks 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Ks 0 0 0 0 Ks 0 0 0 0 0 0 0 0 0 0 0 0 0 Ks 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Ks 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x1 y1 x2 y2 x3 = Ks 0 0 0 0 0 0 K s 0 Ks 0 0 0 0 0 Ks 0 0 0 0 0 Ks 0 0 0 0 Ks 0 0 0 0 0 0 0 0 0 0 Ks x1 x2 y2 x4 y4 x5 y5 0 Ks y1
Ks 0
0 K s 0 Ks 0 0 Ks 0
0 Ks 0
0 Ks 0 0 0
0 Ks 0
0 Ks 0
0 Ks 0 0 0 0 0 0
K s 0
Ks 0 0 0 K s 0
0 Ks 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
y3 0 0 0 0 0 0 0 0 0 x 0 0 0 0 0 0 0 0 0 4 0 K s 0 0 0 0 0 0 0 y4 K 0 0 0 0 0 0 0 0 x5
s
0 0 0 Ks 0 0 0 0 0 0 0 0
Ks 0 0 0 0 0 0 0
0 Ks 0
0 0 0 0 0 0 0 y5 K 0 0 0 0 0 0 x6
s
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
y6 x7 y7 x8 y8 x9 y9
Ks 0 0 0 0 0
0 Ks 0 Ks 0 0 0 0 0 Ks 0 0 0 0 0 Ks 0
0 0 0 Ks
0 0 0
0 0
0 0 0 0 0 Ks
x2 x3 y3 x5 y5 x6 y6
0 K s y2
Ks 0
0 Ks 0 Ks 0 0 Ks 0
0 Ks 0
0 Ks 0 0 0
0 K s 0
0 Ks 0
added to global matrix F1x F1y F2x F2y F3x F3y F4x F4y F5x F5y F6x F6y F7x F7y F8x F8y F9x F9y = Ks 0 0 0 0 0 0 0 0 0 0 0 0 0 0 K s 0 Ks 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Ks 0 0 0 0 0 0 0 0 0 x1 0 0 0 0 0 0 y1 0 K s 0 0 0 0 0 0 x2 0 0 0 0 0 0 0 0 y2 0 0 0 0 0 0 0 0 x3 0 0 0 0 0 0 0 0 0 0 0 0 y3 0 0 0 0 0 0 x4 0 0 0 0 0 0 y4 0 0 0 0 0 0 x5
Ks 0 2 Ks 0 K s 0 0 2 Ks 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 K s 0 Ks 0 0 0 0 0 0 0 0 0 0
0 Ks
0 Ks 0 0 Ks 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 Ks 0
0 Ks 0
0 K s 0 2 K s 0
0 Ks 0
0 0 0 0 0 0 y5 0 2 Ks 0 0 0 0 0 0 x6 0 0 Ks 0 0 0 0 0 y6 0 0 0 K 0 0 0 0 x7
s
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
y7 x8 y8 x9 y9
For element #3
Ks 0 0 0 0 0
0 Ks 0 Ks 0 0 0 0 0 Ks 0 0 0 0 0 Ks 0
0 0 0 Ks
0 0 0
0 0
0 0 0 0 0 Ks
x4 x5 y5 x7 y7 x8 y8
0 K s y4
Ks 0
0 Ks 0 Ks 0 0 Ks 0
0 Ks 0
0 Ks 0 0 0
0 Ks 0
0 Ks 0
For element #4
Ks 0 0 0 0 0
0 Ks 0 Ks 0 0 0 0 0 Ks 0 0 0 0 0 Ks 0
0 0 0 Ks
0 0 0
0 0
0 0 0 0 0 Ks
x5 x6 y6 x8 y8 x9 y9
0 K s y5
Ks 0
0 Ks 0 Ks 0 0 Ks 0
0 Ks 0
0 Ks 0 0 0
0 K s 0
0 K s 0
If the input forces are known, then the resulting displacements of the nodes can be calculated by inverting the matrix. Consider the matrix for a single node.
xa ya xb yb xc yc xd yd =
Ks 0 0 0 0 0
0 Ks 0 Ks 0 0 0 0 0 Ks 0 0 0 0 0 Ks 0
0 0 0 Ks
0 0 0
0 0
0 0 0 0 0 Ks
0 Ks
Ks 0
0 Ks 0 Ks 0 0 Ks 0
0 Ks 0
0 Ks 0 0 0
0 Ks 0
0 K s 0
If we assume that node c is fixed in the x and y directions, the matrix can reflect this by setting the appropriate matrix rows to zero. xa ya xb yb xd yd = Ks 0 0 0 0 Ks 0 0 Ks 0 0 0 Ks 0 0 0 Ks 0 0 0 0 0
1
F ax F ay F bx F by F dx F dy
0 0 K s
Ks 0
0 Ks 0 0 0 Ks
0 K s 0
The displacements can then be found by selecting values for the coefficents and solving the matrix. We can select a value of 1000 for the stiffness, and a force of 10 will be
0 10 0 0 0 10
3 3
10 0 10 0 0 0
0 0
0
3
0 10 0
3
0 10
0 0
3
0 10 0 0
0 10
3
10 0 0 0 0 0
This method generates very large matrices, easily into the millions. To reduce the matrix size techniques such as symmetry are commonly used. Strains can be found by calculating the relative displacements of neighboring points. These can then be used to calculate the stresses. More complex elements are commonly used depending upon the stress conditions, part geometry and other factors. There are a variety of finite element element methods and applications Computation Fluid Dynamics Nonlinear deformation
27.4 SUMMARY
27.8 BIBLIOGRAPHY
How, J, "16.31 Feedback Control Course Notes", MIT Opencourseware website.
Topics: Fuzzy logic theory; sets, rules and solving Objectives: To understand fuzzy logic control. Be able to implement a fuzzy logic controller.
28.1 INTRODUCTION
Fuzzy logic is well suited to implementing control rules that can only be expressed verbally, or systems that cannot be modelled with linear differential equations. Rules and membership sets are used to make a decision. A simple verbal rule set is shown in Figure 28.1. These rules concern how fast to fill a bucket, based upon how full it is.
1. If (bucket is full) then (stop filling) 2. If (bucket is half full) then (fill slowly) 3. If (bucket is empty) then (fill quickly)
Figure 28.1
The outstanding question is "What does it mean when the bucket is empty, half full, or full?" And, what is meant by filling the bucket slowly or quickly. We can define sets that indicate when something is true (1), false (0), or a bit of both (0-1), as shown in Figure 28.2. Consider the bucket is full set. When the height is 0, the set membership is 0, so nobody would think the bucket is full. As the height increases more people think the bucket is full until they all think it is full. There is no definite line stating that the bucket is full. The other bucket states have similar functions. Notice that the angle function relates the valve angle to the fill rate. The sets are shifted to the right. In reality this would probably mean that the valve would have to be turned a large angle before flow begins, but after that it increases quickly.
1 0 1 bucket is half full 0 1 bucket is empty 0 height Figure 28.2 Fuzzy Sets bucket is full
Now, if we are given a height we can examine the rules, and find output values, as shown in Figure 28.3. This begins be comparing the bucket height to find the membership for bucket is full at 0.75, bucket is half full at 1.0 and bucket is empty at 0. Rule 3 is ignored because the membership was 0. The result for rule 1 is 0.75, so the 0.75 membership value is found on the stop filling and a value of a1 is found for the valve angle. For rule 2 the result was 1.0, so the fill slowly set is examined to find a value. In this case there is a range where fill slowly is 1.0, so the center point is chosen to get angle a2. These two results can then be combined with a weighted average to get 0.75 ( a1 ) + 1.0 ( a2 ) angle = --------------------------------------------. 0.75 + 1.0
1. If (bucket is full) then (stop filling) 1 bucket is full 0 height 2. If (bucket is half full) then (fill slowly) 1 bucket is half full 0 height 3. If (bucket is empty) then (fill quickly) 1 bucket is empty 0 height
Figure 28.3
An example of a fuzzy logic controller for controlling a servomotor is shown in Figure 28.4 [Lee and Lau, 1988]. This controller rules examines the system error, and the rate of error change to select a motor voltage. In this example the set memberships are defined with straight lines, but this will have a minimal effect on the controller performance.
vdesired + -
verror
The rules for the fuzzy logic controller are; 1. If verror is LP and d/dtverror is any then Vmotor is LP. 2. If verror is SP and d/dtverror is SP or ZE then Vmotor is SP. 3. If verror is ZE and d/dtverror is SP then Vmotor is ZE. 4. If verror is ZE and d/dtverror is SN then Vmotor is SN. 5. If verror is SN and d/dtverror is SN then Vmotor is SN. 6. If verror is LN and d/dtverror is any then Vmotor is LN. The sets for verror, d/dtverror, and Vmotor are; verror
1 1 -100 -50 0 50 100 1 rps 0 -6 1 -100 -50 0 50 100 1 rps 0 -6 1 -100 -50 0 50 100 1 rps 0 -6 1 rps -100 -50 0 50 100 1 1 -100 -50 0 50 100 rps 0 -6 -3 0 3 6 rps/s 0 -6 -3 0 3 6 1 0 0 6 12 18 24 V rps/s -3 0 3 6 rps/s -3 0 3 6 rps/s -3 0 3 6 rps/s d/ dtverror 1 0 0 1 0 0 1 0 0 1 0 0 6 12 18 24 V 6 12 18 24 V 6 12 18 24 V 6 12 18 24 V
Vmotor
LN
SN
ZE
SP
LP
Figure 28.4
Consider the case where verror = 30 rps and d/dt verror = 1 rps/s. Rule 1to 6 are calculated in Figure 28.5.
1 0 -6 -3 0 3 6 rps/s
1 0 0 6 12 18 24 V
30rps
2. If verror is SP and d/dtverror is SP or ZE then Vmotor is SP. the OR means take the highest of the two memberships
1 0 -100-50 0 50 100 rps 1 0 -6 -3 0 3 6 rps/s 1 0 -6 -3 0 3 6
1 rps/s 0 V 0 6 12 18 24
1rps/s 30rps
1rps/s
14V
1 0 -6 -3 0 3 6 rps/s
1 0 0 6 12 18 24 V
30rps
1rps/s
1 0 -6 -3 0 3 6 rps/s
1 0 0 6 12 18 24 V
30rps
1rps/s
1 0 -6 -3 0 3 6 rps/s
1 0 0 6 12 18 24 V
30rps
1rps
1 0 -6 -3 0 3 6 rps/s
1 0 0 6 12 18 24 V
30rps
ANY VALUE
The results from the individual rules can be combined using the calculation in Figure 28.6. In this case only two of the rules matched, so only two terms are used, to give a
! ( Vmotor ) ( membershipi )
i
=1 --------------------------------------------------------------------V motor = i n
! ( membershipi )
i=1
0.6 ( 17 V ) + 0.4 ( 14 V ) V motor = --------------------------------------------------- = 15.8 V 0.6 + 0.4 Figure 28.6 Rule Results Calculation
28.3 REFERENCES
Li, Y.F., and Lau, C.C., Application of Fuzzy Control for Servo Systems, IEEE International Conference on Robotics and Automation, Philadelphia, 1988, pp. 1511-1519.
28.4 SUMMARY
Fuzzy rules can be developed verbally to describe a controller. Fuzzy sets can be developed statistically or by opinion. Solving fuzzy logic involves finding fuzzy set values and then calculating a value for each rule. These values for each rule are combined with a weighted average.
1. If (verror is ZE) and (d/dtverror is ZE) then (Vmotor is ZE). 2. If (verror is SP) or (d/dtverror is SP) then (Vmotor is SP). verror
1 1 -100 -50 0 50 100 1 rps 0 -6 1 -100 -50 0 50 100 1 rps 0 -6 1 rps -100 -50 0 50 100 0 -6 -3 0 3 6 rps/s -3 0 3 6 rps/s -3 0 3 6 rps/s d/ dtverror 1 0 0 1 0 0 1 0 0 6 12 18 24 V 6 12 18 24 V 6 12 18 24 V
Vmotor
SN
ZE
SP
4. Develop a set of fuzzy control rules adjusting the water temperature in a sink. 5. Develop a fuzzy logic control algorithm and implement it in structured text. The fuzzy rule set below is to be used to control the speed of a motor. When the error (difference between desired and actual speeds) is large the system will respond faster. When the difference is smaller the
response will be smaller. Calculate the outputs for the system given errors of 5, 20 and 40. 100% Big Error 0% 10 100% Small Error 0% 10 20 Big Output error 50 30 error 30 error
Small Output 5 error 50 if (big error) then (big output) if (small error) then (small output)
Topics: Basic laws of motion Gravity, inertia, springs, dampers, cables and pulleys, drag, friction, FBDs System analysis techniques Design case Objectives: To be able to develop differential equations that describe translating systems.
I. Introduction
Over the past decade, the artificial intelligence community has undergone a resurgence of interest in the research and development of artificial neural networks. An artificial neural network is an attempt to simulate the manner in which the brain interprets information as determined by the current knowledge of biology, physiology, and psychology [14]. Artificial neural networks behave in much the same manner as biological neural networks, giving many of the same benefits. Artificial neural nets are fault tolerant, exhibit the ability to learn and adapt to new situations, and have the ability to generalize based on a limited set of data. This arises because of the structure which allows neural nets to process information simultaneously, as opposed to the serial nature of traditional digital computers. This parallel nature, inherent in neural networks, achieves the increase in speed by distributing the calculations among many neurons. The network structure provides a level of fault tolerance, which allows the network to withstand component failures without having the entire network fail. This paper focuses on a popular feedforward model of neural networks. In this model a set of inputs are applied to the network, and multiplied by a set of connection weights. All of the weighted inputs to the neuron are then summed and an activation function is applied to the summed value. This activation level becomes the neurons output and can be either an input for other neurons, or an output for the network. Learning in this network is done by adjusting the connection weights based upon training vectors (input and corresponding desired output). When a training vector is presented to a neural net, the connection weights are adjusted to minimize the difference between the desired and actual output. After a network is trained with a set of training vectors, the network should produce a good output match for the inputs. Artificial neural networks are mainly used in two areas --- pattern recognition, and pattern matching. Pattern recognition is performed by classifying an unknown pattern through comparisons with previously learned pat-
translation - 29.2
terns. This ability is termed associative recall. An example of this is the use of neural networks to recognize handwritten digits [4]. In pattern recognition, when a particular pattern is noisy or distorted, the network can generalize and choose the closest match [3][4][10][13]. Pattern matching uses continuous input patterns to evoke continuous output patterns (i.e. one-to-one mappings). An example is the use of a neural network as a basic controller for a plant. The controller would accept the plant conditions as the inputs, and a set of control outputs would drive the current manufacturing process. This approach is discussed in more detail in [11]. This paper uses the pattern matching strategy for the inverse kinematics of a typical three link manipulator. This paper focuses on the kinematic control of a three link manipulator working in three dimensional space, within a quarter of the robot workspace. When manipulators interact with the environment, the position of the end effector must be described. Human users are more suited to working in cartesian coordinates than the joint coordinates of robots; hence, there is a need for conversion between the two coordinate systems. The conversion from world coordinates to robot joint angles is called inverse kinematics. In the past, the problem of solving the inverse kinematics has been done through the application of various methods. These methods take one of two basic forms (i) Closed form equations or, (ii) Iterative. A closed form solution is found by decoupling the joints responsible for position and those responsible for orientation. These solution types are more desirable since explicit equations are available. Iterative techniques, such as, Newton-Raphson, Newton-Gauss and Linearization are available when no closed form solutions can be obtained. Many of these solutions require that the kinematics be performed off-line because of the computational demands of the algorithms. A brief survey of these various algorithms is given in [2] and [15]. Both of the forms are generally rigid and do not account for uncontrollable variables such as manufacture tolerances, calibration error, and wear. A neural network approach could adapt to changes in the robot due to wear from extended use over time. Such algebraic and algorithmic procedures cannot incorporate these situations. Previous research in the application of neural networks to kinematic control was performed for a to a twolink planar manipulator (working in a plane), and a five degree of freedom robot working in three dimensional space. The manipulators were controlled with a high accuracy; however, the training region for the two link robot was a small square in the centre of the workspace, and the five link robot was limited to a small wedge volume within the robot workspace [5][6][7]. This paper explains research extended to investigate the performance throughout the entire work space of the robot. Investigations of a more complete representation of inverse kinematics throughout the entire workspace is provided. The paper begins with a general introduction to the artificial neuron, a brief description of feedforward neural networks, and a description of the backpropagation learning algorithm. The inverse kinematics problem is described, and the application of a two-layer neural network is discussed. The use of compensation networks is explored and the results of the experimental work are presented. The implications of the neural network approach to the kinematic control problem are presented at the conclusion of this paper.
translation - 29.3
used in this paper, the connection weights between neurons are adjusted. The neuron receives inputs opi from neuron ui while the network is exposed to input pattern p. Each input is multiplied by a connection weight wij, where wij is the connection between neurons ui and uj. The connection weights correspond to the strength of the influence of each of the preceding neurons. After the inputs have been multiplied by the connection weights for input pattern p, their values are summed, netpj. Included in the summation is a bias value j to offset the basic level of the input to the activation function, f(netpj), which gives the output opj . Figure 1 shows the structure of the basic neuron.
wij opi
netpj
opj = f(netpj)
netpj
netpj = wijopi + j synaptic weight, or connection weight between neuron ui and neuron uj output of neuron ui (input of neuron uj) bias value of neuron uj output of neuron uj (function of the summation f(netpj)) Figure 1 Basic structure of an artificial neuron.
In order to establish a bias value j, the bias term can appear as an input from a separate neuron with a fixed value (a value of +1 is common). Each neuron requiring a bias value will be connected to the same bias neuron. The bias values are then self-adjusted as the other neurons learn, without the need for extra considerations. In calculating the output of the neuron, the activation function may be in the form of a threshold function, in which the output of the neuron is +1 if a threshold level is reached and 0 otherwise. Squashing functions limit the linear output between a maximum and minimum value. These linear functions, however, do not take advantage of multi-layer networks [14]. Hyperbolic tangents and the sigmoidal functions are similar to real neural responses; however, the hyperbolic tangent is unbounded and hard to implement in hardware. In this paper, the Sigmoidal function is used because of its ability to produce continuous non-linear functions, which can be implemented in hardware in future research areas. Figure 2 shows some commonly used activation functions.
translation - 29.4
linear
sigmoidal logistic
1
hyperbolic tangent
1
Squashing Function
1
linear threshold
1
f(netpj) =
1 - net 1-e
-1 pj
Figure 2 Common activation functions. For more in depth information on neural networks, please refer to introductions to the subject in [3], [8], [14] and [16].
A single neuron can only simulate 14 of the 16 basic boolean logic functions. It cannot emulate the X-OR, or the X-NOR gates [9]. These limitations require that more than a single neuron be used, and thus, the architecture becomes an important consideration. In Feedforward systems, networks propagate the inputs forward through the neural net. Each neuron has inputs that only come from neurons in preceding layers. A one-layer neural net consists of a layer of input neurons and a layer of output neurons. A multi-layer network consists of an input layer of neurons, one or more hidden layers, and an output layer. The circular nodes in figure 3 represent basic neurons, as described in the previous section. The input neurons are shown as squares because they only act as terminal points (i.e. opi = input). The input layer does not process information; thus, it is not considered to be a part of the structure and is numbered layer 0. A simple one-layer network can effectively map many sets of inputs to outputs. In pattern recognition problems, this depends upon the linear separability of the problem domain. In pattern matching problems, this depends upon continuity, and topography of the function. If such a set of connection weights cannot be found using one-layered networks, then multi-layered networks must be considered.
translation - 29.5
input layer
output layer
input layer
output layer
Figure 3
Learning methods may be either supervised, or unsupervised. Supervised learning is required for pattern matching, and backpropagation is the most popular of the supervised learning techniques. In the backpropagation Training Paradigm, the connection weights are adjusted to reduce the output error. In the initial state, the network has a random set of connection weights. When a system starts with all connection weights equal, the network begins at a sort of local optimum, and will not converge to the global solution. In order for the network to learn, a set of inputs are presented to the system and a set of outputs are calculated. A difference between the actual outputs and desired outputs is calculated and the connection weights are modified to reduce this difference [14]. After inputs have been applied and the network output solution has been calculated, the estimated error contribution, , by each neuron must be calculated. The calculations begin at the output layer of the network. The delta value for any output neuron is computed as, pj = (tpj - opj) f (netpj) (1)
where, tpj is the desired output of output neuron uj, and opj is the actual output, and f (netpj) is the first derivative of the activation function with respect to the total input (netpj) for the given input pattern p evaluated at neuron uj. For the output layer, the change in connection weights can easily be calculated since the of the output neurons is easily determined. With the introduction of hidden layers, the desired outputs of these hidden neurons becomes more difficult to estimate. In order to estimate the delta of a hidden neuron, the error signal from the output
translation - 29.6 layer must be propagated backwards to all preceding layers. The delta, pj , for the hidden neurons is calculated as, pj = f (netpj) pkwjk k where, f (netpj) is the first derivative of the activation function with respect to netpj at hidden neuron uj, pk is the delta value for the subsequent neuron uk, and wjk is the connection weight for the link between hidden neuron uj and subsequent neuron uk. This process of calculating the s is performed for all layers until the input layer is reached After all the error terms have been calculated for all the neurons, the weights may be adjusted. The estimated weight change pwij(n+1) is calculated for each input connection to neuron uj from neuron ui by, pwij(n+1) = pj opi + wij(n)
new delta momentum term
(2)
(3)
where is the learning rate, is the smoothing term, pj is the delta of neuron uj, opi is the output of preceding neuron ui, and wij(n) is the weight change in the previous training interval. The estimated errors are used to estimate the weight changes with the least mean squares method. The backpropagation method is essentially a gradient descent approach which minimizes the errors. In order to adjust the connection weights, the gradient descent approach requires that steps be taken in weight space. If the steps are too large, then the weights will overshoot their optimum values. If the steps are too small, it may take longer to converge and may become caught in local minima. The step size is then a function of the learning rate. The learning rate, which varies between 0 and 1, should be large enough to come up with a solution in a reasonable amount of time without having the solution oscillate within weight space. By introducing the momentum term, which varies between 0 and 1, the learning rate can be increased while preventing oscillation. The momentum term is introduced by adding to the weight change some percentage of the last weight change. Common values for range from 0.1 to 0.9, and common values of range from 0.2 to 0.8 The training set is comprised of points which have inputs and desired outputs, which may or may not be in a random order. In this paper, the training points were chosen at random from an ordered table. This allows a weight correction after each point is trained. This method helps avoid local optimum points in weight space, by creating a random walk type of weight optimization, and gives a much faster global convergence. This process is then repeatedly performed for all training examples until a satisfactory output error is achieved. For an in-depth derivation of the back propagation method, the reader is suggested to consult Rumelhart and McClelland [14].
In order for a robotic manipulator to perform tasks within space, a user must specify a location in three dimensional space. The robotic controller must then determine the correct joint coordinates to locate the manipulator. This area of robotics, Inverse Kinematics, has been well researched and many good solutions exist. In all cases the
* note: The subscript notation (i, j, k) means that neuron ui precedes neuron uj, which precedes uk, etc.
translation - 29.7
resultant solutions are highly specific to a particular robot configuration, with exact dimensions. Such explicit solutions do not tolerate changes over time. These changes may be caused by poor tolerances in manufacture, wear over extended periods of operation, damage to the robot, and poor calibration. Computations are often complex, can be quite slow, and require a computer capable of performing complex mathematical functions. An example of a robot which may be used with an artificial neural network control system is the three link manipulator as shown in figure 4. The forward and inverse kinematic equations, used by the authors in testing, are given in the equations (4) and (5).
Z0
1 a2 a3
2 Z1 3 Z2
Denavit-Hartenburg Transformations c1c23 s1c23 s23 0 -c1s23 -s1c23 c23 0 s1 -c1 0 0 c1(a3c23 + a2c2) s1(a3c23 + a2c2) a3s23 + a2s2 1
T3 = A1A2A3
Figure 4 A typical three link manipulator. The sign in 2 indicates the general configuration of the robot arm. The positive sign (+ve) corresponds to an elbow down solution, and the negative sign (-ve) corresponds to an elbow up solution.
translation - 29.8
px = c1(a3c23 + a2c2) py = s1(a3c23 + a2c2) pz = a3s23 + a2s2 1 = tan-1 py px pz forward kinematic equations (4)
2 = tan-1
pz2
tan-1
3 = tan-1
pz - a2s2 - a 2 c2
s1 = sin 1 where
c1 = cos 1
= + and =
px2
+ py 2 2a2
It should be noted that the inverse kinematics is not determinate. The sources of indeterminacy for this manipulator occur: for Elbow up and Elbow Down Configurations, and when the end of the arm is directly over the origin, 1 is undefined. Other examples of indeterminacy occur in PUMA style robots where left and right arm configurations would give indeterminacy. These sources of indeterminacy may all be overcome by constraining the inverse kinematics to a particular case.
Neural Network solutions have the benefit of having faster processing times since information is processed in parallel. The solutions may be adaptive and still be implemented in hardware by using specialized electronics. Neural systems can generalize to approximate solutions from small training sets. Neural systems are fault tolerant and robust. The network will not fail if a few neurons are damaged, and the solutions may still retain accuracy. When implementing a neural network approach, complex computers are not essential and robot controllers need not be spe-
translation - 29.9
cific to any one manipulator. The nature of neural networks require that a set of training points be chosen which represent the nature of the inputs (x, y, z) and the corresponding outputs ( , and ). If the training points chosen tend to be clustered,
1 2 3
then the network will be very accurate when dealing with points near the cluster. In this case, the robot should be familiar with points throughout the entire workspace; thus, points should be evenly distributed. The order in which points are presented to the network also affect the speed and quality of convergence. If the points are not presented in a random order, each training update will tend to train the network for the current section of space which the points are from. The neural network architecture chosen for this problem is a simple network with one hidden layer. The network has three input neurons for the desired position, and three output neurons for the estimated joint angles. A bias neuron (with a value of +1) is attached to all of the neurons in the hidden layer, and to all of the output neurons. The number of neurons in the hidden layer varied from 10, 20, and 40. This network architecture is pictured in figure 5.
input layer
hidden layer
output layer
x y z
1 2 3
+1 bias neuron Figure 5 Neural architecture for solving the inverse kinematic problem. For simplicity, the network is shown with a small amount of arrows; however, the network is actually fully connected.
29.1 SUMMARY
translation - 29.10
29.5 REFERENCES
translation - 29.11
translation - 29.12
analog IO - 30.1
Objectives:
30.1 INTRODUCTION
Elements of embedded systems (with program examples of each) NOTE: emphasize a top-down program structure with subroutines for each one. logical IO - digital inputs and outputs analog outputs - immediate analog inputs - delayed in (show use of nops and loop to wait), use potentiometer timers including PWM to control transisor/h-bridge for motor control, show sound generation also. counters including encoder decoding and tachometer decoding serial IO other peripherals such as displays, sounds, etc. Control system fundamentals a simple PID feedback loop using nops and time calcs to ensure time a multiple step process that waits for an input and does a task with the PID loop. Show an executive subroutine and calls to dealing with events event types; asynchronous, delayed polling interrupts Concurrent processes single thread vs concurrent processing how to implement a single control thread how to create multiple processes real-time the need for multiple processes non-time critical time critical; regular updates and minimum time between runs
analog IO - 30.2
Structured Design General systems design topics show the general structure of a program with an executive routine that calls task routines. show a program that mixes an asynchronous GUI mixed with a realtime routine Modal System design show the use of global mode bits to track the mode of the system show how the mode bits changes the flow of execution in the executive routine. Flowcharts map flowchart structures to program structure using a register value to track the location in the flowchart State Diagrams show the use of state diagrams to model a process and then how the program is written for it. Failure Analysis show basic probability theory show parallel vs serial failures show failure estimation using theory for single and chained failure modes show the methods for categorizing failures as a hazard, danger, etc. Communication Receiving and sending strings String Handling Parsing strings Composing strings Command and response structures Error Checking Non byte oriented data Networked structured, ie destination address header A full feedback control system Other topics Keyboard multiplexing output refreshing, LEDs
analog IO - 30.3
30.3 SUMMARY
31. WRITING
Reports are the most common form of document written by engineering. Report writing is an art that we often overlook, but in many cases can make a dramatic impact on how our work is perceived. Your reports are most likely to find their way to a superiors desk than you are to meet the individual.
get beyond the first paragraph, but they have already lost the interest of the reader. Transitions are not that important - Students are often coached to create clean transitions between sentences and paragraphs. As a result they often add unnecessary sentences and words. Words that are often warning signs are also and then. You dont need to keep the good stuff to the end - Many authors try to write the report so that there is a climax. It can be very frustrating for a reader who reads 90% of a report before they encounter some discussion of the results. (note: a report is not like a mystery novel.) Saying it more than once is acceptable- Over 3/4 of students feel that it is unacceptable to state facts more than once. In truth you want to state fact as many times as necessary to make a technical point. In the case of very important details, this will be in the abstract, introduction discussion and conclusion. A better procedure for writing engineering reports is detailed below. The method leaves writing to one of the last stages, but it becomes much easier when done this way. 1. Plan and do the work as normal. Regardless of what the report requires this will often include drawings, sketches, graphs/charts of collected data, pictures, etc. 2. Do the analysis (preferably on computer) of the data and results. These should be organized into a logical sequence. 3. Review the results to ensure they make sense and follow a logical flow.If necessary add figures to help clarify. 4. Review the materials to verify that they make sense without the text. 5. Put in point form notes to lay out the document. 6. Write the text for the report. 7. Verify that the report conforms to guidelines. 8. Proofread.
should also contain the analysis and conclusions. The completeness of detail allows you (and others) to review these and verify the correctness of what has been done. These have been historically used for hundreds of years and are accepted as a form of scientific and legal evidence. It is completely unacceptable to make incorrect entries or leave out important steps or data. Standard Format: 1. Title, Author, Date - these make it clear what the labs contain, who did the work, and when it was done. If the report is done for a course it should also include the course name/number, the lab instructor and the lab section. 2. Purpose - a brief one line statement that allows a quick overview of what the experiment is about. This is best written in the form of a scientific goal using the scientific methods. 3. Theory - a review of applicable theory and calculations necessary. Any design work is done at this stage 4. Equipment - a list of the required equipment will help anybody trying to replicate the procedure. Specific identifying numbers should be listed when possible. If there are problems in the data, or an instrument is found to be out of calibration, we can track the problems to specific sets of data and equipment. 5. Procedure - these are sequential operations that describe what was done during the experiment. The level of detail should be enough that somebody else could replicate the procedure. We want to use this as a scientific protocol. 6. Results (Note: sometimes procedure and results are mixed) - the results are recorded in tables, graphs, etc. as appropriate. It will also be very helpful to note other events that occur (e.g. power loss, high humidity, etc.) 7. Discussion - At this stage the results are reviewed for trends and other observations. At this point we want to consider the scientific method. 8. Conclusions - To conclude we will summarize the significant results, and make general statements either upholding or rejecting our purpose. Style: These are meant to be written AS the work is done. As a result the work should be past tense Laboratory reports should have one or more hypotheses that are to be tested. If testing designs these are the specifications. Examples might be, - what is the thermal capacity of a material? - what is the bandwidth of an amplifier? - will the counter increment/decrement between 0 to 9? NOTE: These reports are much easier to write if you prepare all of the calculations, graphs, etc. before you start to write. If you sit down and decide to do things as you
write it will take twice as long and get you half the marks...... believe me, I have written many in the past and I mark them now.
31.5.0.1 - An Example First Draft of a Report Grand Valley State University Padnos School of Engineering EGR 345 Dynamics Systems Modeling and Control Laboratory Exercise 7 Title: The Cooling of Coffee Author: I. M. Wyred Date: Dec., 23, 1998 Purpose: To derive a theoretical model of the rate at which coffee cools and experimentally verify the model and find coefficients. Theory: When coffee is heated kinetic energy is added, when coffee is cooled kinetic energy is removed. In a typical use, coffee cools as heat is lost through convection and conduction to the air and solids in contact. The factors involved in this convection/conduction can be difficult to measure directly, but we can approximate them with a simple thermal resistance. Consider the temperature difference between the coffee and the ambient temperature. The greater the temperature difference, the higher the rate of heat flow out of the coffee. This relationship can be seen formally in the equation below. We can also assume that the atmosphere is so large that the heat transfer will not change the temperature.
1 -( q = - air ) R coffee where, q = heat flow rate from coffee to air (J/s) R = thermal resistance between air and coffee = temperatures in the coffee and air We can also consider that coffee has a certain thermal capacity for the heat energy. As the amount of energy rises, there will be a corresponding temperature increase. This is known as the thermal capacitance, and this value is unique for every material. The basic relationships are given below. I will assume that the energy flow rate into the coffee is negligible.
1 1 q coffee = --------------( q in qout ) = --------------C coffee C coffee where, C coffee = thermal capacitance C coffee = M coffee coffee where, M coffee = mass of thermal body coffee = specific heat of material in mass
The temperatures can be found by consider that the energy flowing out of the cup, and into the atmosphere is governed by the resistance. And, the temperature in the coffee and air are governed by the two capacitances. We will make two assumptions, that the thermal capacitance of the atmosphere is infinite, and that there is no energy flowing into the coffee.
d coffee 1 ----------------- = ---------------q dt C coffee d coffee 1 1 - # --( -----------------= ------------------------------- air )$ ! " dt M coffee coffee R coffee d coffee # 1 1 # ------------------------------------ + ------------------------------------$ -$ ----------------! M coffee coffee R" coffee = ! M coffee coffee R" air dt
This differential equation can then be solved to find the temperature as a function of time.
Guess
= A + Be
Ct
Ct
Ct d--- = BCe dt
BCe
1 1 -$ ( A + BeCt ) = # ------------------------------------$ + # -----------------------------------! M coffee coffee R" ! M coffee coffee R" air
B A 1 Ct $ ------------------------------------$ # ------------------------------------ # ------------------------------------$ e # ! BC + M coffee coffee R" + ! M coffee coffee R + ! M coffee coffee R" air" = 0 B - = 0 BC + -----------------------------------M coffee coffee R 1 A ------------------------------------ + # ------------------------------------$ = 0 M coffee coffee R ! M coffee coffee R" air 1 C = -----------------------------------M coffee coffee R A = air
= air + B
t ---------------------------------M coffee coffee R
B = 0 air
The time constant of this problem can be taken from the differential equation
above.
= M coffee coffee R
Equipment: 1 ceramic coffee cup (14 oz.) 2 oz. ground coffee 1 coffee maker - Proctor Silex Model 1234A 1 thermocouple (gvsu #632357) 1 temperature meter (gvsu #234364) 1 thermometer 2 quarts of tap water 1 standard #2 coffee filter 1 clock with second hand 1 small scale (gvsu# 63424) Procedure and Results: 1. The coffee pot was filled with water and this was put into the coffee maker. The coffee filter and grounds were put into the machine, and the machine was turned on. After five minutes approximately the coffee was done, and the pot was full. 2. The mass of the empty coffee cup was measured on the scale and found to be 214g. 3. The air temperature in the room was measured with the thermometer and found to be 24C. The temperature of the coffee in the pot was measured using the thermocouple and temperature meter and found to be 70C. 4. Coffee was poured into the cup and, after allowing 1 minute for the temperature to equalize, the temperature was measured again. The temperature was 65C. Readings of the coffee temperature were taken every 10 minutes for the next 60 minutes. These values were recorded in Table 1 below. During this period the cup was left on a table top and allowed to cool in the ambient air temperature. During this period the mass of the full coffee cup was measured and found to be 478g.
temperature (deg C) 65 53 43 35 30 28 26
Discussion: The difference between the temperature of the coffee in the pot and in the cup was 5C. This indicates that some of the heat energy in the coffee was lost to heating the cup. This change is significant, but I will assume that the heating of the cup was complete within the first minute, and this will have no effect on the data collected afterwards. The readings for temperature over time are graphed in Figure 1 below. These show the first-order response as expected, and from these we can graphically estimate the time constant at approximately 32 minutes.
temp (deg C) 60
40 24 20 0 20 32 min 40 60
t (min)
We can compare the theoretical and experimental models by using plotting both on the same graph. The graph clearly shows that there is good agreement between the two curves, except for the point at 30 minutes, where there is a difference of 3.5 degrees C.
temp (deg C) 60 max. difference of 3.5 deg. C experimental data mathematical model
40
20 0 20 40 60
t (min)
Figure 2 - Comparison of experimental and modelled curves This gives an overall error of 8.5% between these two curves, compared to the total range of the data.
Finally, the results can be used to calculate a thermal resistance. If we know the mass of the coffee and assume that the coffee has the same specific heat as water, and have the time constant, the thermal resistance is found to be 1731sC/J.
Conclusion: In general the models agreed well, except for a single data point. This error was relatively small, only being 8.5% of the entire data range. This error was most likely caused by a single measurement error. The error value is greater than the theoretical value, which suggests that the temperature might have been read at a "hot spot". In the procedure the temperature measuring location was not fixed, which probably resulted in a variation in measurement location.
31.5.0.2 - An Example Final Draft of a Report A final draft of the report is available on the course website in Mathcad format, and it will be distributed in the lab.
31.6 RESEARCH
Purpose: After looking at a technical field we use these reports to condense the important details and differences. After reading a research report another reader should be able to discuss advanced topics in general terms. Strategy A: 1. Clearly define the objectives for the report 2. Outline what you know on a word processor in point form and find the holes 3. Do research to find the missing information 4. Incorporate the new and old information (still in point form) 5. Rearrange the points into a logical structure 6. Convert point form into full text 7. Proof read and edit
XXXXX UPDATE USING PROJECT DESCRIPTION - do exhibits first, then write Basic elements are, Title page - title of project - Department/Company (i.e., unviersity) name - course/name - author list - date of submission Executive Summary/Overview - the purpose is to let people know if they want ro read the report - write it last after all the details are done - briefly describe the purpose of the work - what were the results, be detailed - given numbers - keep it short Nomenclature - list all variables used in the report - put in alphaetical order, with upper case first - list greek and other variables separately Table of contents - list all major sections, and minor sections to a reasonable level - list page numbers - right justify the numbers Introduction - if you must include this section, it should be brief - the introduction is expected to outline details to be discussed in the report. Body............ Title page
Purpose: These reports allow the developer or team to document all of the design decisions made during the course of the project. This report should also mention avenues not taken. Quite often the projects that we start will be handed off to others after a period of time. In many cases they will not have the opportunity to talk to us, or we may not have the time. These reports serve as a well known, central document that gathers all relevant information. Strategy A: 1. Define the goals for the project clearly in point form 2. Examine available options and also add these in point form 3. Start to examine engineering aspects of the options 4. Make engineering decisions, and add point form to the document 5. As work continues on the project add notes and figures 6. When the project is complete, convert the point form to full text. 7. Proof read and edit
31.9.1 Executive
Purpose: These reports condense long topics into a very brief document, typically less than one page in length. Basically these save a manager from having to read a complete report to find the details that interest him/her.
31.9.2 Consulting
Purpose: These reports are typically commissioned by an independent third party to review a difficult problem. The consultant will review the details of the problem, do tests as required, and summarize the results. The report typically ends with conclusions, suggestions or recommendations.
31.9.3 Memo(randum)
Purpose: An internal business letter designed to convey a business policy or infor-
31.9.4 Interim
Purpose: This report is normally a formal report to track the progress of a project. When a project is initially planned, it will be given a timeline to follow. The interim report will indicate progress relative to the initial timeline, as well as major achievements and problems.
31.9.5 Poster
Purpose: A presentation format that conveys the key concept visually so that a spectator would have a concept of the project in a glance, and be able to review the key concepts in under one minute. - use a minmimum of 16pt, or higher font. - abundant usage of figures - put on foan core backing board, or worst, a purchased cardboard backing board. - The format uses bullets (still full sentences) to abreviate the presentation. - the poster should be self-explanatory - be neat - use color in a tasteful way. Typical sections include; purpose/motivation - a brief summary of the purpose of the work. A summary of the major work detials and outcomes. approach - the work that was done conclusions - the results of the work that was assigned acknowledgements - indicate others who played a significant role in the results.
31.9.7 Oral
Purpose: Work may be presented to an audience in a formal presentation. - This can be a very effective method of comminucation when done well, but it can also be very cruel because an audience may be forced to sit through an uncomfortable experience. - use a minmimum of 16pt, or higher font. - abundant usage of figures - The format uses bullets (still full sentences) to abreviate the presentation. - the presentation should be self-explanatory - use color, visuals and sounds in a tasteful way. - present concepts, by introducing, presenting then reviewing.
31.9.8 Patent
Purpose: A document to describe a design for legal purposes. - a patent documents that an individual/company owns the idea. - it gives them the right to sue those who use the idea and infringe - the patent is submitted to the patent office and reviewed. If the reviewers are satisfied, then the patent is granted, and a patent number is assigned. - a patent only gives the holder the right to sue. - Normally a patent lists the inventor (normally an engineer), but is assigned to the employer. If the inventor is an employee, they assign the rights to the employer in exchange for $1. - Patents are publically available after they are granted to encourage innovation. - Patents have a life of 20 years from the date of application. - A patent is only available for ideas that can be patented. - the patent is structured into the follwing sections; Abstract - a brief description of the patent References - A list of other patents, or other publications that are related. These are expected as most patents are built upon previous concepts. Claims - An itemized list of features that make the design unique from previous ideas. Normally the are at least a dozen claims. These are the items that are the legal basis for the patent. Description - A techibcally detailed description of the patentable work.Tihis normally includes sections such as Summary of the Invention, Description of the Drawings, Detailed Description of the Invention. It is common for the description to include drawings and equations.
- figures - tables - equations When these elements are included, there MUST be a mention of them in the written text. These days it is common to cut and paste figures in software. Make sure - the resolution is appropriate - the colors print properly in the final form or print well as black and white - the smallest features are visible - scanned drawings are clean and cropped to size - scanned photographs are clear and cropped to size - digital photographs should be properly lit, and cropped to size - screen captures are clipped to include only relevant data
31.11.1 Figures
Figures include drawings, schematics, graphs, charts, etc. They should be labelled underneath sequentially and given a brief title to distinguish it from other graphs. For example Figure 1 - Voltage and currents for 50 ohm resistor In the body of the report the reference may be shortened to Fig. 1 The figures do not need to immediately follow the reference, but they should be kept in sequence. We will often move figures to make the type setting work out better. If drawing graphs by computer, - if fitting a line/curve to the points indicate the method used (e.g. linear regression) - try not to use more than 5 curves on the same graph - use legends that can be seen in black and white - clearly label units and scales - label axes with descriptive term. For example Hardness (RHC) instead of RHC
- scale the curve to make good use of the graph - avoid overly busy graphs - titles should clearly, and disctinct, indicate why the content of the figure is significant.
31.11.2 Graphs
Units on axes Should have points drawn and connected with straight (or no) lines if experimental. Smooth lines are drawn for functions or fitted curves. If a curve has been fitted the fitting method should be described. if using graphing software dont put a title on the graph. - titles should clearly, and disctinct, indicate why the content of the figure is signif-
icant.
31.11.3 Tables
Tables are often treated as figures. They allow dense information presentation, typically numerical in nature.
Table 1: A Comparison of Toy Vehicle Properties Description car truck motorcycle 3 6 2 Number red blue green Color Shape rectangular long small Material die cast polyprop. wood
Legends can be added to tables to help condense size. table columns should have units as appropriate - titles should clearly, and disctinct, indicate why the content of the figure is significant.
31.11.4 Equations
When presenting equations, use a good equation editor, and watch to make sure subscripts, etc are visible. Number equations that are referred to in the text. Box in equations of great significance. left justify equations
% Fx % Fy
= T 1 sin 60 + F R sin R = 0
= T 1 T 1 cos ( 60 ) + F R cos R = 0
T 1 sin 60 T 1 + T 1 cos 60 F R = ---------------------- = ----------------------------------sin R cos R sin R sin 60 - = tan R -------------------------= -------------1 + cos 60 cos R 0.866 tan R = ---------------1 + 0.5 R = 30 98 sin 60 = F R sin 30 F R = 170 N
After data is presented, it should be discussed. In general a few good strategies are, - Discuss the fit between theory and measured. Explain differences in terms of hard facts and with numbers. - Dont make vague references to human or experimental error. - Try to develop a conclusion about the quality of the experimental data. - Make a recommendation about changes that would improve that data quality.
31.11.7 References
References help provide direction to the sources of information when the information may be questioned, or the reader may want to get additional detail. Reference formats vary between publication sources. But, the best rule is be consistent. One popular method for references is to number them. The numbers are used in the body of the paper (eg, [14]), and the references are listed numerically at the end. Another method is to list the author name and year (eg, [Yackish, 1997]) and then list the references at the end of the report. Footnotes are not commonly used in engineering works. References on the internet should include a working web address, a description of the page (normally the page title), a date viewed and the page author if available.
31.11.8 Acknowledgments
When others have contributed to the work but are not listed as authors we may
choose to recognize them. Acknowledgments are brief statements that indicate who has contributed to a work.
31.11.9 Abstracts
An abstract is a brief summary of the results of the project. It us used by potential readers to determine if they are interested in reading a report. It should repeat a number of key details. An abstract should not omit key findings, as if it were an advertisement for a movie.
31.11.10 Appendices
Reports often include appendices to reduce bulk from the body. When putting material in an appendix it should stand alone and be referred to in the body of the report. It is customary to provide a summary of the results in the appendix, unless it is tutorial in nature. Examples of common appendices are given below. sample calculations - these are redundant numerical calculations, or a prolonged derivation of equations. The body of the report has a summary of key assumptions,sample calculations and results. The calculations are often provided so that the reader may verify the calculations. long tables of data - tables of numerical data are often put in appendices. Typically a sample of the table is included in the body for discussion purposes. These are often provided for the reader who wants to use the data beyond the uses in the report. program listings - long listings of computer programs are often put in appendices. They are referenced in the body on the report near the algorithm/calculation/ method they implement. These listings are provided for readers who want to use the program. multiple data graphs - multiple sets of data graphs are often put in appendices and summarized in a report body. The graphs are often provided so that the reader may use the graphs for verification or further analysis. reviews of basic theory - these are often referenced in the body of the report for readers who may not have seen a topic previously. These are uncommon in student reports.
addition. - holes that form patterns must be dimensioned relative to each other and relative to a major feature - smaller dimensions should be closer to the part - chained dimensions must be aligned - hole sizes and dimensions should be on the profile view - arcs/circles more than 180 degrees are sized by diameter, otherwise radius is used. - redundant dimensions should be eliminated Tolerancing - Tolerances must be reasonable for manufacturing - Tolerances must ensure proper assembly and operation at maximum/minimum material conditions - mating parts should not have identical dimensions, they should be free running or press fits. - Smaller tolerances should be used for mating parts - a general part tolerance should be defined for the part, and smaller tolerances indicated for critical dimensions to reduce clutter
31.11.14 Discussions
- discussions are expected to state all of the details. Sometines these might be obvious when the data is observed, but they must be stated.
31.11.15 Conclusions
- This is the section to restate the key numbers that support the purpose of the lab. - clear, concise recommendations are needed. - You must not make statements such as this lab was a wonderful learning experience or all students should enjoy this lab.
31.11.16 Recomendations
- This is the section to restate the key numbers that support the purpose of the lab. - clear, concise recommendations are needed. -
31.11.17 Appendices
- Some material is too bulky for a report body, these are normally moved to an appendix. - when material is placed in an appendix, it must be summarized in the body of the report. - The report must briefly summarize (ussually a figure or equation or more) and then refer to the appendix. - it is expected that there will be some duplication between the appendix and the summary in the appendix.
31.11.18 Units
- Put a apce between numbers an units - verify that units match the numerical results] - radians are one of the units that may not observe norma; conventions.
developed for efficiency and clarity. Examples include DMM, HTTP, kitted, parted, etc. All acronyms should be defined at their first use. Colloquialisms - Avoid informal language in technical reports. Use of informal language such as show me the beef will look unprofessional, confuse some readers and make material easily dated.
Table 2: Technical Words and Phrases Good calculated measured found, read Bad
Table 2: Technical Words and Phrases Good chose parallax error optimized human error Bad
Table 3: Plain English Good was Bad it became obvious that came in at representing
Generally bad phrases, in order to be needed to be ----> is needed to be used so as to decided to be can be located found to have found through it was found that
implementation of important precise exact perfect noted to be invoved allowed for it was found to be was looked thorough ---> reviewed along with - with also then decided on - selected found - measured, calculated
A = _____ / 10 Communication:
clear and concise good use of figures, graphs and tables use of english professional style passive voice/past tense suitable use of formatting
B = _____ / 10
Overall:
A * B = ______ / 100
Comments:
31.16 PATENTS
United States Patent 6,368,227 Olson April 9, 2002 Method of swinging on a swing Abstract
A method of swing on a swing is disclosed, in which a user positioned on a standard swing suspended by two chains from a substantially horizontal tree branch induces side to side motion by pulling alternately on one chain and then the other. Inventors: Olson; Steven (337 Otis Ave., St. Paul, MN 55104) Appl. No.: 715198 Filed: November 17, 2000 Current U.S. Class: 472/118 Intern'l Class: A63G 009/00 Field of Search: 472/118,119,120,121,122,123,125 References Cited [Referenced By] U.S. Patent Documents 242601Jun., 1881Clement472/118. 5413298May., 1995Perreault248/228. Primary Examiner: Nguyen; Kien T. Attorney, Agent or Firm: Olson; Peter Lowell Claims
I claim: 1. A method of swinging on a swing, the method comprising the steps of: a) suspending a seat for supporting a user between only two chains that are hung from a tree branch; b) positioning a user on the seat so that the user is facing a direction perpendicular to the tree branch; c) having the user pull alternately on one chain to induce movement of the user and the swing toward one side, and then on the other chain to induce movement of the user and the swing toward the other side; and d) repeating step c) to create side-to-side swinging motion, relative to the user, that is parallel to the tree branch. 2. The method of claim 1, wherein the method is practiced independently by the user to create the side-to-side motion from an initial dead stop. 3. The method of claim 1, wherein the method further comprises the step of: e) inducing a component of forward and back motion into the swinging motion, resulting in a swinging path that is generally shaped as an oval.
4. The method of claim 3, wherein the magnitude of the component of forward and back motion is less than the component of side-to-side motion. Description
TECHNICAL FIELD The present invention relates to a method of swinging on a swing. BACKGROUND OF THE INVENTION A few basic types of swings have been around for generations. Perhaps the most common is one that includes a seat suspended between two ropes or chains that are hung from a tree branch or other substantially horizontal support. These swings are often found in side-by-side sets of two or three or more on, for example, a school playground. Young children often need help to climb onto a swing, and may need a push (sometimes even an "underdog" push) to begin swinging. Others may be able to begin the swinging movement on their own by pushing with their feet against the ground, and once moving may coordinate the motion of their legs and body in what may be called "pumping" to sustain the movement of the swing. When swinging in this manner, the user travels along a path as generally shown in the cross-section of FIG. 1. Another method of swinging on a swing involves twisting the seat around repeatedly so that the chains or ropes are wound in a double helix. When allowed to unwind, the swing spins quickly, which can be entertaining for the user. These methods of swinging on a swing, although of considerable interest to some people, can lose their appeal with age and experience. A new method of swinging on a swing would therefore represent an advance of great significance and value. SUMMARY OF THE INVENTION In accordance with one embodiment of the present invention, a method is provided for swinging on a swing. The swing comprises a seat for supporting a user that is suspended between two chains that are hung from a substantially horizontal tree branch. The method comprises the steps of: a) positioning a user on the seat; and b) having the user pull alternately on one chain to induce movement of the user and the swing toward one side, and then on the other chain to induce movement of the user and the swing toward the other side, to create side-to-side motion. In another embodiment of the invention, the swinging method may be practiced independently by the user to create the side-to-side motion from an initial dead stop. These and other features of the invention are described in greater detail below. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a schematic top view of the swinging path of a swing used in accordance with conventional swinging methods.
FIG. 2 is a front view of a swinging path of a swing used in accordance with one embodiment of the swinging method of the present invention. FIG. 3 is a schematic top view of a swinging path of a swing used in accordance with a second embodiment of the swinging method of the present invention. DETAILED DESCRIPTION OF THE INVENTION The present inventor has created, through experimentation on a standard swing, a new and improved method of swinging. The swing is of the type described above, in which a seat is suspended between two chains that are hung from a substantially horizontal tree branch. As is apparent to those of ordinary skill in the area of swinging, the chains could be replaced with ropes, cables, or the like, or the tree branch could be replaced with another substantially horizontal support such as a metal bar or pole. The standard swing should be a single swing that is suspended sufficiently far away from obstructions to make the practice of the inventive swinging method completely safe. That is, the swing should be suspended a sufficient distance away from the trunk of the tree from which it suspended, and from any other swing, building, support, overhead wire, or other obstruction or threat to safety that may be present. The standard method of swinging on a swing is defined by oscillatory motion of the swing and the user along an axis that is substantially perpendicular to the axis of the tree branch from which the swing is suspended. This "forward and back" movement has been known for generations, and is illustrated in FIG. 1. In contrast to the conventional method of swinging, the present inventor has discovered that much greater satisfaction can be obtained by alternately pulling on one chain to move the swing and the user toward that side, and then pulling on the other chain to move the swing and the user toward that side. This side-to-side oscillatory motion of the swing and the user is thus along an axis that is substantially parallel to the axis of the tree branch from which the swing is suspended, and is illustrated in FIG. 2. This side to side swinging method has the added benefit that it can be continued for long periods of time simply by alternately pulling on one chain and then the other. The importance of sufficient clearance between the swing and any obstructions or threats to the user's safety is apparent. The present inventor has discovered certain other improvements in the art of swinging on a swing, either or both of which can be used in conjunction with the swinging method described immediately above. The first is that the inventive swinging method can be initiated from a dead stop without pushing, and without the user having to contact the ground. That is, the user can climb onto the swing, and begin from an initial dead stop to pull first on one chain, and then on the other chain, alternately until the user and the swing have begun to swing side-to-side in accordance with the inventive swinging method described herein. This enables even young users to swing independently and joyously, which is of great benefit to all. Another improvement on the swinging method described above is the induction into the side-toside swinging movement of a component of forward-and-back motion. That is, by skillful manipulation of the body, the present inventor has found it possible to add a relatively minor component
of forward-and-back motion to the side-to-side swinging motion, resulting in a swinging path that is generally shaped like an oval, as is shown in FIG. 3. It is preferred that the magnitude of the forward-and back motion (shown in FIG. 3 as being along the Y axis) be less than the magnitude of the side-to side motion (shown in FIG. 3 as being along the X axis), so that the latter predominates. In this manner, the motion can be more easily continued simply by alternately pulling on one chain and then the other in the manner described. Lastly, it should be noted that because pulling alternately on one chain and then the other resembles in some measure the movements one would use to swing from vines in a dense jungle forest, the swinging method of the present invention may be referred to by the present inventor and his sister as "Tarzan" swinging. The user may even choose to produce a Tarzan-type yell while swinging in the manner described, which more accurately replicates swinging on vines in a dense jungle forest. Actual jungle forestry is not required. Licenses are available from the inventor upon request.
32. PROJECTS
32.1
The project is intended to emphasize proper project management and team skills to produce a complex engineering system from concept to completion.
32.2 OVERVIEW
Cranes are used to move large loads in industrial environments. To do this they normally lift a load and then move it to a new position. At the end of the motion the load is put down. If the load is swaying, the operator may have to pause before putting down the load. This delay is undesirable because it increases the total cycle time for the crane. This design project will endeavor to build a proof-of-concept prototype for an antisway system for a gantry crane as shown in Figure 32.1. The crane will ride on a wooden beam constructed with 2x4 lumber (actually smaller). An electric
motor will drive the cart left or right. The mass will hang below the cart. motor driven cart
pivot point
1Kg mass
Figure 32.1
The equipment
The system will use active compensation to move the cart between positions, and to move the cart to compensate for swaying of the suspended mass. The overall system performance will be evaluated on how quickly the crane can move the load, and then eliminate sway. Additional factors used in assessment of performance will be the mass, cost and overall design quality.
width of the 2x4. None of the cart, except for the arms, should be less than 2cm below the bottom of the 2x4. The objectives for the design are itemized below. The following equation will be used to assess the overall score for the design. - The equipment cost should be minimized. The goal of $150 or less has been specified as very important. - Mass should be minimized, the target value is 0.2Kg. - A clearly justified and supported design process. This will be judged before the competition. - The settling time, ts, to less than a +/- 0.5 inch margin around the commanded position. This time will be determined using the best ts/d for two arbitrary target motions. - The test will start with the mass stationary at one position. The gantry system must move the mass to another position once started. The total movement range will be 2 to 20 inches in 2 inch increments. t s$ - ( 4 ) 200 ( 10 ) B ( 10 ) T ( 2 ) 0.2 score = # -! d" where, t s = the time to settle (s) C = total cost of part ($) d = distance moved in test (m) B = build quality score assigned by judges (0=best, 1=worst) T = theory quality score assigned by judges (0=best, 1 = poor) M = mass of the apparatus (Kg)
2 C -------M ------
32.3 MANAGEMENT
The management details for the project are outlined below. These may evolve as the semester progresses.
Oct 4 - Preliminary design concept submitted with specifications materials list estimate budget estimate Gantt charts Oct 13 - Design concept approved Oct 24 - Proposal submitted detailed drawings (CAD) materials list budget calculations/simulations Oct 29 - Proposals approved, 345/101 building begins Nov 12 - First test Nov 19 - Second test Nov 20 - First draft of report posted to the web used to determine the score for competition Nov 25 - Competition and judging Dec 4 - Final report draft posted to the web
32.3.2 Teams
The teams are composed of up to 4 students from EGR 345 and one student from EGR 101. The EGR 345 teams are grouped using the skills survey attached in the appendices. Teams are expected to divided tasks for members to work in parallel. It is also expected that team members will review the work of others to ensure accuracy and completeness. This is particularly true of calculations, materials lists drawings and budgets. All team members are expected to work in a professional manner. The general rules of conduct in a team are, - treat others as you want to be treated - communicate expectations and problems clearly - be polite and accommodating - when problems arise, help to solve them, even if they are not your fault. Dont lay the blame for problems on others. Personal conflicts must be resolved by team members in a professional manner. The performance of the team will be assessed using peer evaluations on a regular basis and may impact individual grades. In the case of non-participation the penalty may be up to 100% of the project grade. In the event that team members cannot resolve differences with a team member, the team may fire the team member by a vote (it must be unanimous, except
for the member in question). In this case the fired student is responsible for finding another team that will accept (or hire) them. In the event they cannot find another team to join, they will be expected to perform all of the work themself. The firing mechanism is intended to deal with individuals who harm the progress of the team, not for non-participants.
32.4 DELIVERABLES
The following items are to be submitted at various stages of the project.
tion. - a table of contents - three view drawings of each significant part - block diagram of the control system - block diagrams showing the system architecture - circuit schematic - if a motion profile will be used, it should be documented - an assembly drawing of the mechanism, including a BOM - a budget listing each of the parts that must be purchased/acquired. Catalog pages and quotes can be used to validate the budget. In the final report, copies of receipts, or catalog pages will be required. - a weight inventory, itemized by each part of the design - additional calculations for mechanical design issues, such as stress that may result in failure. Normally these result in a factor of safety. - the equations of motion for the system - a Scilab program that verifies the operation of the system using the equations of motion. - a C program that implements the controller as designed.
Calculations - FBDs and differential equations Project budget and BOM Weight inventory Test results - this section should describe Simulation results The tests that were done to describe the overall performance. There should be a comparison of the device with and without sway compensation. The results of formal tests should also be described. A comparison of overall score estimates. Conclusions - A brief description of the overall results indicating what the strengths and weaknesses of the design. Reccomendations - Suggestions for improvement. Appendix - Drawings Appendix - Stress and other similar calculations Appendix - Controller C program Appendix - Simulation program Appendix - Receipts and cost evidence Final reports will be evaluated on numerous factors inculding the clarity for the design documentation (i.e., how clear is what has been done?), theory to backup the design (does the theory match the actual design?), did the theory and actual match?
32.5.2 Drawings
All drawings will observe the standards used in EGR 101 (see the EGR 101 or 345 course pages). This includes dimensions and tolerances that can be produced using the available equipment and materials. Please note that sketch means that it is done by hand, approximately, while drawing means it is done formally in a CAD package. Normally you should create solid models, and then generate multiview drawings. Note: All drawings must have a title block. Shaded views have very little value and should be avoided, wireframe drawings are much more useful. If there is a definite need to include a shaded drawing, change the background to change the quantity of toner used.
32.5.4 Calculations
Calculations are required to justify the design work. These should follow the conventions used in EGR 345. When computer programs are written, they should be commented and included.
32.6 APPENDICES
68HC11
PWM
H-bridge V s Motor
cart
1 --D motor
potentiometer
Figure 32.2
System Architecture
A block diagram for the system is shown in Figure 32.3. A motion generator is used to generate a smooth path for the mass. There are two feedback control loops. The first loop adjusts the motor for general positioning of the system. The inner loop adjusts the output to reduce sway of the cart. The two control signals are added to produce a command signal the drives the load to the final position and then reduces vibrations.
Cp
update setpoints
Cd
where, C p = commanded position C d = desired position setpoint Cp encoder K enc C pc K pp + + C Lc K sp CL A/D VL Cc PWM Vs motor p L
Cd
C pe
where,
C pe = the position error K pp = the proportional gain for position control C p = the position count from the encoder p = the rotational position of the motor C pc = output command for position control C c = the combined motor control output V s = effective voltage to the motor p = position of the motor (cart) L = angle of the load from vertical V L = voltage proportional to angle of load C L = integer value for load angle C Lc = output command for sway control
Figure 32.3
x L Fp
Mp l L
M p g sin L x cos L M p
M c = mass of cart M p = mass of payload F p = force in suspension arm F w = force from wheels L = angle of payload from vertical l = length of suspension arm r w = radius of cart wheel % F = Mp g sin L Mp l L x cos L Mp = 0 l L = g sin L x cos L (1)
%F % Fx
2 = F p M p g cos L L M p l + x sin L M p = 0 2 F p = M p g cos L + L M p l x sin L M p = M c x + F p sin L + F w = 0 M c x + F p sin L + F w = 0 2 M c x + ( M p g cos L + L M p l x sin L M p ) sin L + F w = 0 (2)
Figure 32.4
F w given
x = w rw
2 K -$ # ---J-$ # -------K $ Fw = V s # ------- x& 2 x & 2 -' ' ! r w R" ! r w" ! r w R"
(1) ---> 2 2 K -$ # ---J-$ # -------K -$ M c x + ( M p g cos L + L M p l x sin L M p ) sin L + V s # ------- x x & ' & ' = 0 2 ! r w R" ! " ! r2 " r R w w
2 $ J2 K -$ # -------K -$ 2 # # ------- + + + x x & M c + ---+ ( sin ) M cos sin M g ( M l sin ) V ' & ' = 0 L p L L p L p L s ! r R" 2 ! r2 " ! " w rw R w 2 2 2 2 $ 2 K -$ # -------K -$ # M c r w + J + ( sin L ) M p r w -' = ( cos L sin L ) M p g + L ( M p l sin L ) + V s # -------x & ------------------------------------------------------------- x & 2 ' 2 ! r w R" ! " ! r w R" rw
M p gr w M p l sin L r w # $ $ 2# -' + L & --------------------------------------------------------------' + x = ( cos L sin L ) & -------------------------------------------------------------2 2 2 2 ! Mc r2 " ! Mc r2 " w + J + ( sin L ) M p r w w + J + ( sin L ) M p r w
2 Kr w # $ # $ K -' + x -----------------------------------------------------------------------' V s & ----------------------------------------------------------------------& 2 2 2 2 2 2 ! R ( M c r w + J + ( sin L ) M p r w )" ! R ( M c r w + J + ( sin L ) M p r w )"
Figure 32.5
State Equations: x = v
2 M p gr w # $ # $ K -----------------------------------------------------------------------' + ( cos L sin L ) & --------------------------------------------------------------' v = v& 2 2 2 2 ! R ( M c r2 " ! Mc r2 " w + J + ( sin L ) M p r w ) w + J + ( sin L ) M p r w 2
+ L = L
Figure 32.6
A Scilab program that simulates the given system is given in Figure 32.7.
// contest.sce // System component values l = 0.4; // 40cm Mp = 1.0; // 1kg Mc = 0.2; // 200g g = 9.81; // good old gravity rw = 0.03; // 6cm dia tires K = 0.5; // motor speed constant R = 7; // motor resistance J = 0.005; // rotor inertia // System state x0 = 0; // initial conditions for position v0 = 0; theta0 = 0.0;// the initial position for the load omega0 = 0.0; X=[x0, v0, theta0, omega0]; // The controller definition PI = 3.14159; ppr = 16;// encoder pulses per revolution; Kpot = 1.72;// the angle voltage ratio Vzero = 2.5;// the voltage when the pendulum is vertical Vadmax = 5;// the A/D voltage range Vadmin = 0; Cadmax = 255;// the A/D converter output limits Cadmin = 0; tolerance = 0.5;// the tolerance for the system to settle Kpp = 20;// position feedback gain Ksp = 2;// sway feedback gain Vpwmmax = 12; // PWM output limitations in V Cpwmmax = 255; // PWM input range Cdeadpos = 100;// deadband limits Cdeadneg = 95; function foo=control(Cdesired) Cp = ppr * X($, 1)/(2*PI*rw); Cpe = Cdesired - Cp; Cpc = Kpp * Cpe; VL = Kpot * X($,3) + 2.5; // assume the zero angle is 2.5V CL = ((VL - Vadmin) / (Vadmax - Vadmin)) * (Cadmax - Cadmin); if CL > Cadmax then CL = Cadmax; end// check for voltages over limits if CL < Cadmin then CL = Cadmin; end CLc = Ksp * (CL - (Cadmax + Cadmin) / 2); Cc = Cpc + CLc; Cpwm = 0; if Cc > 0.5 then// deadband compensation Cpwm = Cdeadpos + (Cc/Cpwmmax)*(Cpwmmax - Cdeadpos); end if Cc <= -0.5 then Cpwm = -Cdeadneg + (Cc/Cpwmmax)*(Cpwmmax - Cdeadneg); end foo = Vpwmmax * (Cpwm / Cpwmmax) ; // PWM output if foo > Vpwmmax then foo = Vpwmmax; end // clip voltage if too large if foo < -Vpwmmax then foo = -Vpwmmax; end endfunction
Figure 32.7
// The motion profile generator function foo=motion(t_start, t_end, t_now, C_start, C_end) if t_now < t_start then foo = C_start; elseif t_now > t_end then foo = C_end; else foo = C_start + (C_end - C_start) * (t_now - t_start ) / (t_end - t_start); end endfunction
// define the state matrix function term1 = Mc*rw^2 + J;// Precalculate these terms to save time term2 = R*term1; Xd = 10;// the setpoint 10 turns == 160 pulses Cd = ppr * Xd / (2 * PI * rw) ; function foo=derivative(state,t, h) Vs=control(motion(0, 6, t($, 1), 0, Cd)); // Vs=control(Cd); term3 = cos(state($,3));// precalculate some repeated terms to save time term4 = sin(state($,3)); term5 = term1 + Mp * (term4 * rw)^2; //printf("%f %f \n", Cd, Vs); v_dot = -state($,2)*(K^2) / (term5 * R) ...// d/dt v + term3*term4*Mp*g*rw^2 / term5 ... + state($,4)^2 * Mp*l*term4*rw^2 / term5 ... + Vs*K*rw / term5; foo = [ state($,2), ...// d/dt x = v v_dot, ... state($, 4), ...// d/dt theta -g * term4 / l - state($, 2) * term3 / l ...// d/dt omega ]; endfunction
// Integration Set the time length and step size for the integration steps = 5000;// The number of steps to use t_start = 0;// the start time - normally use zero t_end = 10;// the end time h = (t_end - t_start) / steps;// the step size t = [t_start];// an array to store time values for i=1:steps, t = [t ; t($,:) + h]; X = [X ; X($,:) + h * derivative(X($,:), t($,:), h)];// first order end
Figure 32.8
// Graph the values for part e) plot2d(t, [X(:,1) + l*sin(X(:,3))], [-2], leg="mass position"); //plot2d(t, [X(:,1), 10*X(:, 3)], [-2, -5], leg="position@theta (X 10)"); xtitle('Time (s)');
// printf the values over time intervals = 20; for time_count=1:intervals, i = int((time_count - 1)/intervals * steps + 1); xmass = X(i,1) + l*sin(X(i,3)); printf("Mass location at t=%f x=%f \n", i * h, xmass); // printf("Point at t=%f x=%f, v=%f, theta=%f, omega=%f \n", i * h, X(i, 1), X(i, 2), X(i, 3), X(i, 4)); end
// find the settling time in the results array ts = 0; for i = 1:steps, xmass = X(i,1) + l*sin(X(i,3)); if xmass > (Cd + tolerance) then ts = i*h + t_start; end if xmass < (Cd - tolerance) then ts = i*h + t_start; end end printf("\nTheoretical settling time %f \n", ts);
Figure 32.9
contract Dr. Farris and Dr. Jack will acts as arbiters. If this occurs, one or both of the parties will be penalized. This may involve actions as severe as receiving a failing grade in the project. Exhibits: 1. Schedule of Actions Oct 15-24 - Cart designs are developed by 101 and 345 students resulting in submission of the Formal Proposal Oct 30, 2003 - Cart Build Approval submitted Nov 11 - Initial build completed Nov 12 - First test completed and First List of Deficiencies submitted Nov 15 - Design Report Draft submitted for review Nov 19 - Final test completed and Final List of Deficiencies submitted Nov 25 - Competition Dec 4 - Submit Final Report
proficient 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5
1 1 1 1 1 1 1 1 1
Hands-on Electrical:
Basic wiring skills, soldering, etc.
Writing:
Layout and write complex documents
Teamwork Skills:
The ability to work with others in a team environment.
Leadership Skills:
The ability to act as a role model that teammates will follow.
Design Skills:
Work in unstructured/semistructured problem solving.
Personal/Technical Strengths: Personal/Technical Weaknesses: People you would like to work with: People you would NOT like to work with: Other Commitments (courses, work, etc. - give hours for each) Other Items of Interest:
Person Being Evaluated: good Communicates well: Works in team environment: Meets deadlines: Quality of work: Overall:
Did the teammate return e-mails and other forms of communication promptly? Could the teammate understand, explain and evaluate the technical aspects of the project in a clear concise manner?
poor 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5
1 1 1 1 1
Did your teammate come to meetings on time? Did the teammate participate in all aspects of the project? How much did the teammates efforts contribute to the overall success of the project?
Did you teammate complete individual tasks on time? Did the teammate keep the project progressing forward in a timely manner with a consistent effort throughout the project or was the teammate only available when the team was in trouble?
Was you r teammate willing to accept and carry out individual tasks on time? How well were these individual tasks carried out? Did your teammate do his or her fair share of the work?
Would you be happy working with the person again? Would you give this person a job reference?
Height of Payload:
40cm below the beam
= 40 cm
Mass of Cart:
not including the harness
M =
Kg
Cost:
proof of costs
C =
Build Quality:
assigned by judges. 0 is the best
C =
[ 0, 1 ] [ 0, 1 ]
Technical Analysis:
0 is the best
T =
Test Distance:
the distance specified in the test
d =
Settling Times:
The time required to move within +/- 0.5in. from the target.
ts =
Overall Score:
based upon other values
SCORE =
Comments:
Team Number:
- If answers are provided, solutions should match normally. This means if answers dont match, students should check them.
33.3.1 Graphs
- Label all axis, including units - Provide a legend for surves with multiple traces - Equations are plotted as smooth functions. - Data is plotted as discrete points.
33.4 SCILAB
Basic ruules are, - when solving problems using computational tools, such as C programs, or numerical simulations, provide copies of the programs. - when used to solve problems, include program listings
33.5 TERMINOLOGY
The terminology is significant, graph: a plot, numbers: a value equation: a function, a relationship, an expression, proof: a derivation
34.1 INTRODUCTION
This section has been greatly enhanced, and tailored to meet our engineering requirements. The section outlined here is not intended to teach the elements of mathematics, but it is designed to be a quick reference guide to support the engineer required to use techniques that may not have been used recently. For those planning to write the first ABET Fundamentals of Engineering exam, the following topics are commonly on the exam. - quadratic equation - straight line equations - slop and perpendicular - conics, circles, ellipses, etc. - matrices, determinants, adjoint, inverse, cofactors, multiplication - limits, LHospitals rule, small angle approximation - integration of areas - complex numbers, polar form, conjugate, addition of polar forms - maxima, minima and inflection points - first-order differential equations - guessing and separation - second-order differential equation - linear, homogeneous, non-homogeneous, second-order - triangles, sine, cosine, etc. - integration - by parts and separation - solving equations using inverse matrices, Cramers rule, substitution - eigenvalues, eigenvectors - dot and cross products, areas of parallelograms, angles and triple product - divergence and curl - solenoidal and conservative fields - centroids - integration of volumes
- integration using Laplace transforms - probability - permutations and combinations - mean, standard deviation, mode, etc. - log properties - taylor series - partial fractions - basic coordinate transformations - cartesian, cylindrical, spherical - trig identities - derivative - basics, natural log, small angles approx., chain rule, partial fractions
name lower case upper case alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu nu xi omicron pi rho sigma tau upsilon phi chi psi omega
Figure 34.1
The constants listed are amount some of the main ones, other values can be derived through calculation using modern calculators or computers. The values are typically given with more than 15 places of accuracy so that they can be used for double precision calculations.
Figure 34.2
a+b = b+a a ( b + c ) = ab + ac a ( bc ) = ( ab ) c a + (b + c) = (a + b) + c
Figure 34.3
n! = 1 2 3 4 n 0! = 1
Figure 34.4
(x )( x ) = x (x ) nm ---------= x m (x ) (x )
n m n
n+m
x = 1 , if x is not 0 x
p
x = x
m --n
1 -n
x x
m
1= ---p x
n n n
= x
nm
( xy ) = ( x ) ( y )
n x x - = -----y n y
Figure 34.5
Properties of exponents
The basic base 10 logarithm: log x = y The basic base n logarithm: log n x = y x = n
y
x = 10
The basic natural logarithm (e is a constant with a value found near the start of this section: ln x = log e x = y x = e
y
Figure 34.6
Definitions of logarithms
logn ( xy ) = log n ( x ) + log n ( y ) x -$ logn # ! y" = log n ( x ) logn ( y ) log n ( x ) = y logn ( x ) log m ( x ) log n ( x ) = -----------------logm ( n ) ln ( A ) = ln ( A ) + ( + 2 k ) j kI
y
logn ( n ) = 1 logn ( 1 ) = 0
Figure 34.7
Properties of logarithms
( a + x ) = a + na
n1
n( n 1 ) - an 2 x2 + + xn x + ------------------2!
Figure 34.8
2. Simplify the following expressions. a) b) c) d) e) f) g) x(x + 2) 3x 2 ( x + 3 ) ( x + 1 ) x -------------------------------------(x + 1) x 3 log ( x ) 64 ----16 15 3----- + ----21 28 (x y )
2 2 3 4 4 2 2
h) i)
j) k) l)
4x 8y
3. Simplify the following expressions. +B a) A -----------AB AB b) -----------A+B 4 5 $3 x y ) c) # ( -& % -------------! x2 " d) log ( x 5 ) + log ( x 3 )
= (x y ) = x y
2 5 3
6 15
a)
(ans.
a)
5. Rearrange the following equation so that only y is on the left hand side. y +x ---------- = x+2 y+z
(ans.
6. Find the limits below. a) # t3 + 5 $ lim % ---------------& t 0 ! 5 t 3 + 1" # t3 + 5 $ lim % ----------------& t ! 5 t 3 + 1"
b)
(ans.
a) b)
3 # t3 + 5 $ 0 +5 lim % ---------------= 5 & = ---------------------3 3 t 0 ! 5 t + 1" 5(0) + 1 3 3 # t3 + 5 $ +5 --------------------------------------------------lim % = = 0.2 & = 3 3 t ! 5 t 3 + 1" 5() + 1 5()
34.2 FUNCTIONS
tm
t nt
q = 1p
q, p [ 0, 1 ]
'
>0
Hypergeometric
Normal
Figure 34.9
Distribution functions
ax + bx + c = 0 = a ( x r 1 ) ( x r 2 )
b b 4 ac r 1, r 2 = -------------------------------------2a
Cubic equations also appear on a regular basic, and as a result should also be considered.
9 ab 27 c 2 a R = -------------------------------------54
S =
R+ Q +R
T =
R Q +R
Then the roots, a r 1 = S + T -3 S+T 3 -a --+j --------(S T) r 2 = ----------2 3 2 S+T 3 -a --j --------(S T) r 3 = ----------2 3 2
Figure 34.11 Cubic equations On a few occasions a quartic equation will also have to be solved. This can be done by first reducing the equation to a quadratic,
x + ax + bx + cx + d = 0 = ( x r 1 ) ( x r 2 ) ( x r 3 ) ( x r 4 ) First, solve the equation below to get a real root (call it y), y by + ( ac 4 d ) y + ( 4 bd c a d ) = 0 Next, find the roots of the 2 equations below, # a + a 2 4 b + 4 y$ # y + y2 4 d$ -------------------------------------------& = 0 r 1, r 2 = z + % & z + % ----------------------------2 2 ! " ! "
2 3 2 2 2
yes
no Find roots of the denominator and break the equation into partial fraction form with unknown values OR use limits technique. If there are higher order roots (repeated terms) then derivatives will be required to find solutions use algebra technique
Done
Figure 34.13 The methodolgy for solving partial fractions The partial fraction expansion for,
= 1
Figure 34.14 A partial fraction example Consider the example below where the order of the numerator is larger than the denominator.
5s + 3s + 8s + 6 x ( s ) = ------------------------------------------2 s +4 This cannot be solved using partial fractions because the numerator is 3rd order and the denominator is only 2nd order. Therefore long division can be used to reduce the order of the equation. 5s + 3 s +4
2
5s + 3s + 8s + 6 3 5 s + 20 s 3 s 12 s + 6 2 3 s + 12
2
12 s 6 This can now be used to write a new function that has a reduced portion that can be solved with partial fractions.
12 s 6 x ( s ) = 5 s + 3 + --------------------2 s +4
solve
Figure 34.15 Solving partial fractions when the numerator order is greater than the denominator When the order of the denominator terms is greater than 1 it requires an expanded partial fraction form, as shown below.
s ( B + E ) + s ( A + 3B + D + 2E ) + s ( 3A + 3B + C + D + E ) + s( 3A + B ) + ( A ) = -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------3 2 s (s + 1) 0 1 3 3 1 1 3 3 1 0 0 0 1 0 0 0 1 1 0 0 1 2 1 0 0 A 0 B 0 C = 0 D 0 E 5 A 0 1 B 1 3 C = 3 3 D 3 1 E 1 0 0 0 1 0 0 0 1 1 0 0 1 2 1 0 0
1
0 5 0 15 0 = 5 0 10 5 15
The notation
' xi
i=a
is equivalent to x a + x a + 1 + x a + 2 + + x b assuming a
and b are integers and b a . The index variable i is a placeholder whose name does not matter. Operations on summations:
b a
' xi
i=a
' xi
i=b
' xi
i=a b
= ' xi
i=a b b
' xi + ' yj
i=a b j=a c
' ( xi + yi )
i=a c
' xi + '
i=a i = b+1
xi =
' xi
i=a b d
' ' xi yj
i=a j=c
'i
i=1 N1
1 - N( N + 1) = -2
'
i=0
1 = ----------, < 1 for both real and complex . For 1 , the summation 1
d) e) f)
x + x + 10
(ans.
2 x + 8 x = 8 x + 4x + 4 = 0 2 (x + 2) = 0 x = 2, 2
2
(ans.
x+4 A BAx + 8 A + Bx x + 4---------------- + ----------= ------------------- = -= -------------------------------2 2 x(x + 8) x x+8 x + 8x x + 8x ( 1)x + 4 = (A + B )x + 8A 8A = 4 A = 0.5
34.3.1 Trigonometry
The basic trigonometry functions are,
y 1- = ---------sin = r csc x 1- = ---------cos = r sec y 1sin - = ---------tan = = ----------x cot cos Pythagorean Formula: r = x +y
2 2 2
r y
Sine - sin 1
-270
-180
-90
0 -1
90
180
270
360
450
Cosine - cos 1
-270
-180
-90
0 -1
90
180
270
360
450
Tangent - tan 1
-270
-180
-90
0 -1
90
180
270
360
450
Cosecant - csc
-270
-180
-90
0 -1
90
180
270
360
450
Secant - sec 1
-270
-180
-90
0 -1
90
180
270
360
450
Cotangent - cot
-270
-180
-90
0 -1
90
180
270
360
450
NOTE: Keep in mind when finding these trig values, that any value that does not lie in the right hand quadrants of cartesian space, may need additions of 90 or 180.
Cosine Law: c = a + b 2 ab cos c c Sine Law: b c a ------------= ------------= ------------sin A sin B sin C B C A b
2 2 2
a Now a group of trigonometric relationships will be given. These are often best used when attempting to manipulate equations.
sin ( ) = sin
cos ( ) = cos
tan ( ) = tan
sin = cos ( 90 ) = cos ( 90 ) = etc. sin ( 1 2 ) = sin 1 cos 2 cos 1 sin 2 cos ( 1 2 ) = cos 1 cos 2 + sin 1 sin 2 tan 1 tan 2 tan ( 1 2 ) = -----------------------------------1 + tan 1 tan 2 cot 1 cot 2 +1 cot ( 1 2 ) = -----------------------------------tan 2 tan 1 cos - = 1 -------------------sin -2 2 + cos - = 1 cos --------------------2 2 sin 1 cos - = -------------------tan -= -------------------2 1 + cos sin ( cos ) + ( sin ) = 1
2 2
OR OR
e +e cos = --------------------2
e e sin = --------------------2j
e e = hyperbolic sine of x sinh ( x ) = ----------------2 e +e - = hyperbolic cosine of x cosh ( x ) = ----------------2 sinh ( x ) e e - = ----------------- = hyperbolic tangent of x tanh ( x ) = -----------------x x cosh ( x ) e +e 1 2 = ----------------= hyperbolic cosecant of x csch ( x ) = ----------------x x sinh ( x ) e e 1 2 - = hyperbolic secant of x sech ( x ) = -----------------= ----------------x x cosh ( x ) e +e +e cosh ( x ) ----------------- = hyperbolic cotangent of x - = e coth ( x ) = -----------------x x sinh ( x ) e e
x x x x x x
sinh ( x ) = sinh ( x ) cosh ( x ) = cosh ( x ) tanh ( x ) = tanh ( x ) csch ( x ) = csch ( x ) sech ( x ) = sech ( x ) coth ( x ) = coth ( x )
( cosh x ) ( sinh x ) = ( sech x ) + ( tanh x ) = ( coth x ) ( csch x ) = 1 sinh ( x y ) = sinh ( x ) cosh ( y ) cosh ( x ) sinh ( y ) cosh ( x y ) = cosh ( x ) cosh ( y ) sinh ( x ) sinh ( y ) tanh ( x ) tanh ( y )tanh ( x y ) = ---------------------------------------------1 tanh ( x ) tanh ( y ) Some of the relationships between the hyperbolic, and normal trigonometry functions are,
1. Find all of the missing side lengths and corner angles on the two triangles below.
5 3 10
(ans.
3. Solve the following partial fraction 4 -------------------------= 2 x + 3x + 2 1 Note: there was a typo here, so --------------an acceptable answer is also. x + 0.5
(ans.
A - ----------BAx + 2 A + Bx + B 2A + B ) + ( A + B ) x 4 -------------------------- = ( ------------------------------------------------= ----------+ = -----------------------------------------2 2 2 x+1 x+2 x + 3x + 2 x + 3x + 2 x + 3x + 2 A+B = 0 A = B B = 4 A = 4 4 - ----------4 ----------+ x+1 x+2
2 A + B = 4 = 2 B + B = B
34.3.3 Geometry
A set of the basic 2D and 3D geometric primitives are given, and the notation used is described below,
A = contained area P = perimeter distance V = contained volume S = surface area x, y, z = centre of mass x, y, z = centroid I x, I y, I z = moment of inertia of area (or second moment of inertia)
AREA PROPERTIES: Ix =
(y
A
Iy =
(x
A
I xy =
( xy dA
A
JO =
(r
A
dA =
( (x
A
( x dA
A - = centroid location along the x-axis x = -----------( dA A
( y dA
A - = centroid location along the y-axis y = -----------( dA A
Rectangle/Square: A = ab P = 2a + 2b
Centroid: b x = -2 a y = -2
b a I y = -------12 I xy = 0
Triangle: bh A = ----2 P =
bh - ( a 2 + b 2 ab ) I y = ----36 bh I xy = -------- ( 2 a b ) 72
2
bh - ( a 2 + b 2 ab ) I y = ----12 bh I xy = -------- ( 2 a b ) 24
2
Circle: A = r
2
y r
P = 2r x Moment of Inertia Moment of Inertia (about centroid axes): (about origin axes): r I x = ------4 r I y = ------4 I xy = 0
4
Centroid: x = r y = r
Ix = Iy = I xy =
r x Centroid: x = r 4r y = ----3 Moment of Inertia (about centroid axes): 8-$ 4 -- ----Ix = # ! 8 9 " r r I y = ------8 I xy = 0
4
r x Centroid: 4r x = ----3 4r y = ----3 Moment of Inertia (about centroid axes): I x = 0.05488 r I y = 0.05488 r
4
I xy = 0.01647 r
I xy
r = ---8
r x
Ellipse: A = r1 r2 P = 4 r1 (
-2
r1 r2
r1 + r 2 - ( sin ) 2 d 1 ------------------a
2
r 1 + r2 P 2 --------------2 Centroid: x = r2 y = r1 Moment of Inertia Moment of Inertia (about centroid axes): (about origin axes): r1 r2 I x = -----------4 3 r1 r2 I y = -----------4 I xy =
3
Ix = Iy = I xy =
+ - ( sin ) 2 d + 2 r 2 1 ------------------a
2
2 r1
2 r2
r1 r2 x
I y = 0.05488 r 2 r 1 I xy = 0.01647 r 1 r 2
2 2
P =
+ - ( sin ) 2 d + 2 r 2 1 ------------------a
2
2 r1
2 r2
r1 r2 x
r 1 + r2 - --------------P -- + 2 r2 2 2 Centroid: 4 r2 x = ------3 4 r1 y = ------3 Moment of Inertia (about centroid axes): Ix = Iy = I xy = Moment of Inertia (about origin axes): Ix = r2 r1 Iy = r2 r1 I xy r2 r1 = --------8
2 2 3 3
a x b
Centroid: b x = -2 2a y = ----5
a x b
Moment of Inertia Moment of Inertia (about centroid axes): (about origin axes): 3 3 8 ba 2 ba I x = ----------I x = ----------175 7 19 b a I y = -------------480 I xy b a= ---------60
2 2 3
2b a I y = ----------15 I xy b a= ---------6
2 2
A general class of geometries are conics. This for is shown below, and can be used to represent many of the simple shapes represented by a polynomial.
Ax + 2 Bxy + Cy + 2 Dx + 2 Ey + F = 0 Conditions A = B = C = 0 B = 0, A = C 2 B AC < 0 2 B AC = 0 2 B AC > 0 straight line circle ellipse parabola hyperbola
VOLUME PROPERTIES: Ix =
( rx
V
Iy = Iz =
( ry
V
( rz
V
( x dV
V - = centroid location along the x-axis x = -----------d V ( V
( y dV
V - = centroid location along the y-axis y = -----------( dV V
( z dV
V - = centroid location along the z-axis z = -----------( dV V
y z x a
Centroid: a x = -2 b y = -2 c z = -2
Moment of Inertia (about centroid axes): M(a + b ) I x = -------------------------12 M(a + c ) I y = -------------------------12 M(b + a ) I z = -------------------------12
2 2 2 2 2 2
Sphere: 4 3 -r V = -3 S = 4r
2
Centroid:
x = r y = r z = r
Hemisphere: 2 - r3 V = -3
z S = r x
Centroid:
x = r 3r y = ---8 z = r
Cap of a Sphere: 1 - h2 ( 3 r h ) V = -3 S = 2 rh
y h z r x
Centroid:
x = r y = z = r
Cylinder: V = hr
2
r h
S = 2 rh + 2 r
Centroid:
x = r h y = -2 z = r
M(3r + h ) J z = ----------------------------12
Cone: 1 - r2 h V = -3 S = r r + h
2 2
Centroid: x = r h y = -4 z = r
3 h 3 r -$ -------------Iz = M # + ! 80 20 "
Iz =
Tetrahedron: 1 - Ah V = -3
x = h y = -4 z =
Torus: 1 - 2 ( r 1 + r 2 ) ( r 2 r 1 )2 V = -4
y r2 z r1 x Moment of Inertia (about centroid axes): Ix = Iy = Iz = Moment of Inertia (about origin axes): Ix = Iy = Iz =
S = ( r2 r1 )
Centroid:
x = r2 r 2 r 1$ y = # -------------! 2 " z = r2
Ellipsoid: 4 -r r r V = -3 1 2 3
y r2 z r3 r1 x Moment of Inertia (about centroid axes): Ix = Iy = Iz = Moment of Inertia (about origin axes): Ix = Iy = Iz =
S =
Centroid:
x = r1 y = r2 z = r3
Paraboloid: 1 - r2 h V = -2
y h z r x
S =
Centroid:
x = r y = z = r
defined with a slope and intercept a slope perpendicular to a line the slope using two points as defined by two intercepts
If we assume a line is between two points in space, and that at one end we have a local reference frame, there are some basic relationships that can be derived.
y ( x 1, y 1, z 1 ) d = ( x2 x1 ) + ( y2 y1 ) + ( z2 z1 )
2 2 2
( x 2, y 2, z 2 )
( x 0, y 0, z 0 )
( cos ) + ( cos ) + ( cos ) = 1 The equation of the line is, y y1 z z1 x x1 --------------- = --------------- = -------------x2 x1 y2 y1 z2 z1 ( x, y, z ) = ( x 1, y 1, z 1 ) + t ( ( x 2, y 2, z 2 ) ( x 1, y 1, z 1 ) ) Explicit
Parametric t=[0,1]
y The explicit equation for a plane is, Ax + By + Cz + D = 0 P 1 = ( x 1, y 1, z 1 ) where the coefficients defined by the intercepts are, 1 A = -a 1 B = -b 1 C = -c D = 1 N P 2 = ( x 2, y 2, z 2 ) P 3 = ( x 3, y 3, z 3 ) z The determinant can also be used, x x1 y y1 z z1 det x x 2 y y 2 z z 2 = 0 x x3 y y3 z z3 det y2 y1 z2 z1 y3 y1 z3 z1 ( x x 1 ) + det z2 z1 x2 x1 z3 z1 x3 x1 ( y y1 ) c a x b
+ det
x2 x1 y2 y1 x3 x1 y3 y1
( z z1 ) = 0
2. What is the equation of a line that passes through the points below? a) (0, 0) to (2, 2) b) (1, 0) to (0, 1) c) (3, 4) to (2. 9) 3. Find a line that is perpendicular to the line through the points (2, 1) and (1, 2). The perpendicular line passes through (3, 5). 4. Manipulate the following equations to solve for x. a) x 2 + 3 x = 2 b) sin x = cos x
(ans. a) x 2 + 3 x = 2 x + 3x + 2 = 0 3 3 4( 1)( 2 ) 3 98 31 - = --------------- = 1, 2 x = ------------------------------------------------ = ----------------------------2(1 ) 2 2 b) sin x = cos x sin x ---------- = 1 cos x tan x = 1 x = atan 1 x = , 135 , 45 , 225 , 5. Simplify the following expressions. a) ( cos 2 ) sin 2 # --------------------+ sin 2 $ ! sin 2 "
2 2 2
(ans.
a)
6. A line that passes through the point (1, 2) and has a slope of 2. Find the equation for the line, and for a line perpendicular to it.
(ans.
The Complex Number: j = Complex Numbers: a + bj where, a and b are both real numbers 1 j = 1
2
Complex Conjugates (denoted by adding an asterisk * the variable): N = a + bj Basic Properties: ( a + bj ) + ( c + dj ) = ( a + c ) + ( b + d ) j ( a + bj ) ( c + dj ) = ( a c ) + ( b d ) j ( a + bj ) ( c + dj ) = ( ac bd ) + ( ad + bc ) j N a + bj N * + bj dj + bd # bc ad$ ---- = ------------- = ----#N ------$ = # a -------------$ # c ------------$ = ac ----------------- + ----------------- j 2 2 2" ! c + dj" ! c dj" ! 2 M c + dj M ! N *" c +d c +d We can also show complex numbers graphically. These representations lead to alternative representations. If it in not obvious above, please consider the notation above uses a cartesian notation, but a polar notation can also be very useful when doing large calculations. N * = a bj
CARTESIAN FORM
A =
R +I
R = A cos I = A sin
We can also do calculations using polar notation (this is well suited to multiplication and division, whereas cartesian notation is easier for addition and subtraction),
A = A ( cos + j sin ) = Ae
(DeMoivres theorem)
Note that DeMoivres theorem can be used to find exponents (including roots) of complex numbers
j
Eulers formula: e
= cos + j sin
z ( x, y, z ) ( r, , z )
z z y x x y r = x +y
2 2
x = r cos y = r sin
y -$ = atan # ! x"
z ( x, y, z ) ( r, , )
r z
y x x y
2
r = x +y +z
2 2
(ans. a)
3j + 5 3j + 5 3j + 5 7 24j$ 35 141 j + 72 37 141j b) -------------------- = -----------------------------------------------------------------------------------------= --------------------- # = ---------------------2 ! 7 24 j" = 16 + 24 j + 9 7 + 24 j 49 + 576 625 (4j + 3) c) ( 3 + 5 j ) 4 j = 12 j + 20 j 2 = 12 j 20
2. For the shape defined below, y a) find the area of the shape. b) find the centroid of the shape. c) find the moment of inertia of the shape about the centroid. x 4 y = (x + 2)
2
34.5.1 Vectors
Vectors are often drawn with arrows, as shown below,
head terminus A vector is said to have magnitude (length or strength) and direction. origin tail
y x z becomes y k
j i
A = ( 2, 3, 4 ) B = ( 7, 8, 9 )
A + B = ( 2 + 7, 3 + 8, 4 + 9 ) A B = ( 2 7, 3 8, 4 9 )
Parallelogram Law A B
B A+B
y F1 F2 cos = ----------------F1 F2 # ( 2 ) ( 5 ) + ( 4 )( 3) $ -& = acos % -----------------------------------------! 2 2 + 4 2 5 2 + 3 2" 22 -$ --------------------- = acos # ! ( 4.47 ) ( 6 )" = 32.5
F2 = 5 i + 3 j
F1 = 2 i + 4 j
We can use a dot product to project one vector onto another vector.
z We want to find the component of force F1 that projects onto the vector V. To do this we first convert V to a unit vector, if we do not, the component we find will be multiplied by the magnitude of V. x 1j + 1k V- = 0.707 j + 0.707 k = ----= -------------------V 2 2 1 +1
F1 = ( 3 i + 4 j + 5 k ) N
V = 1j + 1k y
F1
F 1V
We can consider the basic properties of the dot product and units vectors.
Unit vectors are useful when breaking up vector magnitudes and direction. As an example consider the vector, and the displaced x-y axes shown below as x-y.
y y
F = 10 N x
45 60 x We could write out 5 vectors here, relative to the x-y axis, x axis = 2 i y axis = 3 j x axis = 1 i + 1 j y axis = 1 i + 1 j F = 10 N 60 = ( 10 cos 60 ) i + ( 10 sin 60 ) j None of these vectors has a magnitude of 1, and hence they are not unit vectors. But, if we find the equivalent vectors with a magnitude of one we can simplify many tasks. In particular if we want to find the x and y components of F relative to the x-y axis we can use the dot product. x = 1 i + 0 j (unit vector for the x-axis) F x = x F = ( 1 i + 0 j ) [ ( 10 cos 60 ) i + ( 10 sin 60 ) j ] = ( 1 ) ( 10 cos 60 ) + ( 0 ) ( 10 sin 60 ) = 10 N cos 60 This result is obvious, but consider the other obvious case where we want to project a vector onto itself,
Incorrect - Not using a unit vector FF = F F = ( ( 10 cos 60 ) i + ( 10 sin 60 ) j ) ( ( 10 cos 60 ) i + ( 10 sin 60 ) j ) = ( 10 cos 60 ) ( 10 cos 60 ) + ( 10 sin 60 ) ( 10 sin 60 ) = 100 ( ( cos 60 ) + ( sin 60 ) ) = 100 Using a unit vector FF = F F = ( ( 10 cos 60 ) i + ( 10 sin 60 ) j ) ( ( cos 60 ) i + ( sin 60 ) j ) = ( 10 cos 60 ) ( cos 60 ) + ( 10 sin 60 ) ( sin 60 ) Correct Now consider the case where we find the component of F in the x direction. Again, this can be done using the dot product to project F onto a unit vector. u x' = cos 45 i + sin 45 j F x' = F x' = ( ( 10 cos 60 ) i + ( 10 sin 60 ) j ) ( ( cos 45 ) i + ( sin 45 ) j ) = ( 10 cos 60 ) ( cos 45 ) + ( 10 sin 60 ) ( sin 45 ) = 10 ( cos 60 cos 45 + sin 60 sin 45 ) = 10 ( cos ( 60 45 ) ) Here we see a few cases where the dot product has been applied to find the vector projected onto a unit vector. Now finally consider the more general case, = 10 ( ( cos 60 ) + ( sin 60 ) ) = 10
2 2 2 2
V2 V1 2 1 x V 2V 1
First, by inspection, we can see that the component of V2 (projected) in the direction of V1 will be, V 2V 1 = V 2 cos ( 2 1 ) Next, we can manipulate this expression into the dot product form, = V 2 ( cos 1 cos 2 + sin 1 sin 2 ) = V 2 [ ( cos 1 i + sin 1 j ) ( cos 2 i + sin 2 j ) ] V1 V2 V 1 V2 V1 V2 - -------- = V 2 ----------------- = ----------------- = V2 V = V 2 -------1 V1 V2 V1 V2 V1 Or more generally, V1 V 2 V2 V 1 = V 2 cos ( 2 1 ) = V 2 ----------------V1 V2 V1 V2 V 2 cos ( 2 1 ) = V 2 ----------------V1 V2 V1 V2 cos ( 2 1 ) = ----------------V 1 V2 *Note that the dot product also works in 3D, and similar proofs are used.
F = ( 6.43 i + 7.66 j + 0 k ) N d = (2i + 0j + 0k)m i M = dF = j k NOTE: note that the cross product here is for the right hand rule coordinates. If the left handed coordinate system is used F and d should be reversed.
2m 0m 0m 6.43 N 7.66 N 0 N
M = ( 0 m 0 N 0 m ( 7.66 N ) ) i ( 2 m 0 N 0 m ( 6.43 N ) ) j + ( 2 m ( 7.66 N ) 0 m ( 6.43 N ) ) k = 15.3 k ( mN ) NOTE: there are two things to note about the solution. First, it is a vector. Here there is only a z component because this vector points out of the page, and a rotation about this vector would rotate on the plane of the page. Second, this result is positive, because the positive sense is defined by the vector system. In this right handed system find the positive rotation by pointing your right hand thumb towards the positive axis (the k means that the vector is about the z-axis here), and curl your fingers, that is the positive direction.
The cross (or vector) product of two vectors will yield a new vector perpendicular to both vectors, with a magnitude that is a product of the two magnitudes. V1 V2 V1
V1 V2 = ( x 1 i + y1 j + z1 k ) ( x2 i + y 2 j + z 2 k ) i j k V1 V2 = x1 y1 z1 x2 y2 z2 V1 V2 = ( y1 z2 z1 y2 ) i + ( z1 x2 x1 z2 ) j + ( x1 y2 y1 x2 ) k
V2
We can also find a unit vector normal n to the vectors V1 and V2 using a cross product, divided by the magnitude. V1 V2 n = -------------------V1 V2 When using a left/right handed coordinate system,
The positive orientation of angles and moments about an axis can be determined by pointing the thumb of the right hand along the axis of rotation. The fingers curl in the positive direction. y x z
x + z y +
z + x
The cross product is distributive, but not associative. This allows us to collect terms in a cross product operation, but we cannot change the order of the cross product. r 1 F + r 2 F = ( r 1 + r2 ) F rFFr but r F = ( F r ) DISTRIBUTIVE NOT ASSOCIATIVE
When we want to do a cross product, followed by a dot product (called the mixed triple product), we can do both steps in one operation by finding the determinant of the following. An example of a problem that would use this shortcut is when a moment is found about one point on a pipe, and then the moment component twisting the pipe is found using the dot product.
ux uy uz ( d F) u = dx dy dz F x F y Fz
34.5.5 Matrices
Matrices allow simple equations that drive a large number of repetitive calculations - as a result they are found in many computer applications. A matrix has the form seen below,
n columns a 11 a21 a n 1 a 12 a22 a n 2 a 1 m a 2 m a nm m rows If n=m then the matrix is said to be square. Many applications require square matrices. We may also represent a matrix as a 1-by-3 for a vector.
Matrix operations are available for many of the basic algebraic expressions, examples are given below. There are also many restrictions - many of these are indicated.
A = 2
3 4 5 B = 6 7 8 9 10 11
12 13 14 C = 15 16 17 18 19 20
21 D = 22 23
E = 24 25 26
Addition/Subtraction
3+2 4+2 5+2 A+B = 6+2 7+2 8+2 9 + 2 10 + 2 11 + 2 B + D = not valid 32 42 52 BA = 62 72 82 9 2 10 2 11 2 B D = not valid
3 + 12 4 + 13 5 + 14 B + C = 6 + 15 7 + 16 8 + 17 9 + 18 10 + 19 11 + 20
3 12 4 13 5 14 B + C = 6 15 7 16 8 17 9 18 10 19 11 20
( 3 21 + 4 22 + 5 23 ) B D = ( 6 21 + 7 22 + 8 23 ) ( 9 21 + 10 22 + 11 23 )
D E = 21 24 + 22 25 + 23 26
BC =
( 3 12 + 4 15 + 5 18 ) ( 3 13 + 4 16 + 5 19 ) ( 3 14 + 4 17 + 5 20 ) ( 6 12 + 7 15 + 8 18 ) ( 6 13 + 7 16 + 8 19 ) ( 6 14 + 7 17 + 8 20 ) ( 9 12 + 10 15 + 11 18 ) ( 9 13 + 10 16 + 11 19 ) ( 9 14 + 10 17 + 11 20 ) B B ---, ---, D --- , etc = not allowed (see inverse) C D B Note: To multiply matrices, the first matrix must have the same number of columns as the second matrix has rows.
Determinant B = 3 7 8 4 6 8 +5 6 7 10 11 9 11 9 10 = ( 7 11 ) ( 8 10 ) = 3 = 3 ( 3 ) 4 ( 6 ) + 5 ( 3 ) = 0
7 8 10 11 6 8 9 11 6 7 9 10
= ( 6 11 ) ( 8 9 ) = 6
= ( 6 10 ) ( 7 9 ) = 3
Transpose
3 6 9 B = 4 7 10 5 8 11
T
D = 21 22 23
24 E = 25 26
T
Adjoint 7 8 10 11 B = 4 5 10 11 4 5 7 8 6 8 10 11 3 5 9 11 3 5 6 8 6 7 9 10 3 4 9 10 3 4 6 7
The matrix of determinant to the left is made up by getting rid of the row and column of the element, and then finding the determinant of what is left. Note the sign changes on alternating elements.
Inverse x D = B y z
To solve this equation for x,y,z we need to move B to the left hand side. To do this we use the inverse.
B D = B
x B y z
x x B D = I y = y z z
1 1
B= -------B
In this case B is singular, so the inverse is undetermined, and the matrix is indeterminate.
B = I
A I = 0
Given, 2x+4y+3z = 5 9x+6y+8z = 7 11 x + 13 y + 10 z = 12 Write down the matrix, then rearrange, and solve. 2 4 3 x 5 = 9 6 8 y 7 11 13 10 z 12 x 2 4 3 y = 9 6 8 z 11 13 10
1
5 7 = 12
Given, 2x+4y+3z = 5 9x+6y+8z = 7 11 x + 13 y + 10 z = 12 Write down the coefficient and parameter matrices, 2 4 3 9 6 8 11 13 10 5 7 12
A =
B =
Calculate the determinant for A (this will be reused), and calculate the determinants for matrices below. Note: when trying to find the first parameter x we replace the first column in A with B. 5 4 3 7 6 8 12 13 10 - = x = ----------------------------A 2 5 3 9 7 8 11 12 10 - = y = ----------------------------A 2 4 5 9 6 7 11 13 12 - = z = ----------------------------A
1 2 3 4 2 6 7 8 9
= 36
1 2 3 4 2 6 7 8 9
2. Perform the vector operations below, 1 A = 2 3 6 B = 2 1 Cross Product Dot Product AB = AB = ANS. A B = ( 4, 17, 10 ) A B = 13
4. Solve the following equations using any technique, 5 x 2 y + 4 z = 1 6 x + 7 y + 5 z = 2 2 x 3 y + 6 z = 3 ANS. x= 0.273 y= -0.072 z= -0.627
5. Solve the following set of equations using a) Cramers rule and b) an inverse matrix. 2x + 3y = 4 5x + 1y = 0
(ans.
2 3 x = 4 5 1 y 0
a)
4 3 0 1 4- = -------x = -------------- 13 2 3 5 1
T
b) x = 2 3 y 5 1
1
A B C X L + D E F Y M GH I Z N (ans. A B C X L + D E F Y M GH I Z N
T T T
AX + BY + CZ L + DX + EY + FZ M GX + YH + IZ N
AX + BY + CZ + L = DX + EY + FZ + M GX + YH + IZ + N
b)
A B C D E F X Y Z = GH I
8. Find the dot product, and the cross product, of the vectors A and B below. x A = y z p B = q r
(ans.
A B = xp + yq + zr AB = i j k x y z p q r = i ( yr zq ) + j ( zp xr ) + k ( xq yp ) = yr zq zp xr xq yp
d e f g h k mnp
b)
a b c d
c)
a b c d
(ans. a) a b c
T
d e f d e f g h k = a b c g h k = ( ad + bg + cm ) ( ae + bh + cn ) ( af + bk + cp ) mnp mnp = ad bc
b)
a b c d
c) a b c d
1
adj
(ans.
b)
c)
d)
=
1
e)
12. Solve the following set of equations with the specified methods. 3x + 5y = 7 4x 6y = 2 a) Inverse matrix b) Cramers rule c) Gauss-Jordan row reduction d) Substitution
34.6 CALCULUS
NOTE: Calculus is very useful when looking at real systems. Many students are turned off by the topic because they "dont get it". But, the secret to calculus is to remember that there is no single "truth" - it is more a loose collection of tricks and techniques. Each one has to be learned separately, and when needed you must remember it, or know where to look.
Both u, v and w are functions of x, but this is not shown for brevity. Also note that C is used as a constant, and all angles are in radians.
d----(C) = 0 dx dd----( Cu ) = ( C ) ----(u) dx dx ddd----( u + v + ) = ----( u ) + ----(v) + dx dx dx d- n n1 d -----(u) ( u ) = ( nu ) ----dx dx ddd----( uv ) = ( u ) ----( v ) + ( v ) ----(u) dx dx dx d- # u v$ d u-$ ----d------$ = # ---- ----- ( u ) # ---(v) 2 2 ! " ! " ! " dx v v dx v dx dddd----( uvw ) = ( uv ) ----( w ) + ( uw ) ----( v ) + ( vw ) ----(u) dx dx dx dx dd- ----d ----( y ) = ----( y ) - ( u ) = chain rule dx du dx d1 ----( u ) = ------------dx d----( x) du d----(y) d du ----- ( y ) = ------------dx d----(x) du
dd----( sin u ) = ( cos u ) ----(u) dx dx dd----( cos u ) = ( sin u ) ----(u) dx dx d1 $ 2 ----d--------------( tan u ) = # ! cos u" dx ( u ) dx d- u u d -----(u) ( e ) = ( e ) ----dx dx d1 ----( ln x ) = -dx x
d2 d -----(u) ( cot u ) = ( csc u ) ----dx dx dd----( sec u ) = ( tan u sec u ) ----(u) dx dx dd----( csc u ) = ( csc u cot u ) ----(u) dx dx dd----( sinh u ) = ( cosh u ) ----(u) dx dx dd----( cosh u ) = ( sinh u ) ----(u) dx dx d2 d -----(u) ( tanh u ) = ( sech u ) ----dx dx
d-$ d-$ # # ---# # ---f(x) $ f( x) $ ! " ! " % & % & dt dt f ( x ) # $ -& = lim ! ----------" = lim % ---------------------& = lim % ----------------------x a g(x) x a% # d $ x a% # d $ 2 & ---- g ( x )& g ( x ) ! ! dt" " ! ! ---" dt" Some techniques used for finding derivatives are,
Leibnitzs Rule, (notice the form is similar to the binomial equation) can be used for finding the derivatives of multiplied functions. d-$ 0 # ----d-$ n d-$ 1 # ----d-$ n 1 d-$ n # ----# ----# n$ # ----( uv ) = ( u ) ( v ) + ( u ) (v) ! dx" ! dx" ! dx" ! dx" ! 1" ! dx" d n2 d-$ n # ----d-$ 0 d-$ 2 # ----# n$ # ----# n$ # ----( u ) ! -$ ( v ) + + ( u ) ! dx" ( v ) ! n" ! dx" ! 2" ! dx" dx"
In the following expressions, u, v, and w are functions of x. in addition to this, C is a constant. and all angles are radians.
( C dx
= ax + C = C ( f ( x ) dx =
( Cf ( x ) dx ( u dv
( ( u + v + w + ) dx ( f ( Cx ) dx
( u dx + ( v dx + ( w dx +
= uv ( v du = integration by parts
u = f(x)
- dx ( -x
= ln x + C
x
a+C ( a dx = ------ln a
x
( e dx
x
= e +C
= cos x + C = sin x + C sin x cos x + x -+C dx = -----------------------------2 sin x cos x + x -+C dx = -----------------------------2
2
( ( cos x )
( ( cos x )
cos x ( ( sin x ) + 2 ) 3 -+C ( ( sin x ) dx = ------------------------------------------3 sin x ( ( cos x ) + 2 ) -+C ( ( cos x ) dx = ------------------------------------------3
3 2
( x cos ( ax ) dx
x -+C ( x dx = ----------n+1
n
n+1
( ( a + bx ) ( ( a + bx
ln a + bx dx = ----------------------- + C b
2 1
ln ( bx + a ) 2 1 x ( a + bx ) dx = --------------------------+C ( 2b
(x
( ( a + bx ) ( x(x
2
2 a + bx dx = ---------------------- + C b x a +C
2 2
CORRECT??
a ) dx =
2 1
1 -2
( ( a + bx + cx ( ( a + bx + cx
1 ) dx = ------ ln c
2 ba + bx + cx + x c + --------+ C, c > 0 2 c
2 1
22 ( a + bx ) ( ( a + bx ) dx = ----3b 22 ( a + bx ) ( ( a + bx ) dx = ----3b
1 -2
1 -2
3 --
3 --
( x ( a + bx )
1 -2
2 ( 2 a 3 bx ) ( a + bx ) dx = ---------------------------------------------------2 15 b
1
3 -2
3 -2$ 2
((1 a
1 -2 2 2
1 asin ( ax ) - x ( 1 a x ) + -------------------x ) dx = -2 a
1 -2 2 2 3 --
1 -2 2 2
a 1- 2$ 2 # ----x ( 1 a x ) d x = x " ( 3 ! a2
(x
1 -2 2
3 -2 2
1 -2 2
((1 a
1 -2 2 2
1 - asin ( ax ) = 1 -- acos ( ax ) x ) dx = -a a
ax e +C ( e dx = -----a ax e ( ax 1 ) + C ( xe dx = -----2 a ax
ax
y = f ( x, y, z ) We can write this in differential form, but the right hand side must contain partial derivatives. If we separate the operators from the function, we get a simpler form. We can then look at them as the result of a dot product, and divide it into two vectors. # $ f ( x, y, z )$ dx + # # $ f ( x, y, z )$ dy + # # $ f ( x, y, z )$ dz (d)y = # ! ! x" " ! ! y" " ! ! z" " $ # $ dy + # $ dz f ( x, y, z ) (d)y = # dx + ! x" ! y" ! z" $ (d)y = # i + j + ! x y z k" ( dxi + dyj + dzk ) f ( x, y, z ) We then replace these vectors with the operators below. In this form we can manipulate the equation easily (whereas the previous form was very awkward). ( d ) y = [ dX ] f ( x, y, z ) ( d ) y = f ( x, y, z ) dX ( d ) y = f ( x, y, z ) dX cos In summary, = i+ j+ k x y z F = the divergence of function F F = the curl of function F
F = F x i + F y j + Fz k
Gausss or Greens or divergence theorem is given below. Both sides give the flux across a surface, or out of a volume. This is very useful for dealing with magnetic fields.
( ( F ) dV
V
( FdA
A
where, V, A = a volume V enclosed by a surface area A F = a field or vector value over a volume
Stokes theorem is given below. Both sides give the flux across a surface, or out of a volume. This is very useful for dealing with magnetic fields.
( ( F ) dA
A
( FdL
L
where, A, L = A surface area A, with a bounding parimeter of length L F = a field or vector value over a volume
e.g.,
first-order differential equations - have only first-order derivatives, d-$ d-$ # ---# ---! dt" x + ! dt" y = 2
e.g.,
second-order differential equations - have at least on second derivative, d-$ d-$ # ---x + # ---y = 2 ! dt" ! dt"
2
e.g.,
higher order differential equations - have at least one derivative that is higher than second-order. partial differential equations - these equations have partial derivatives Note: when solving these equations it is common to hit blocks. In these cases backtrack and try another approach. linearity of a differential equation is determined by looking at the dependant variables in the equation. The equation is linear if they appear with an exponent other than 1.
eg.
34.6.3.1 - First-order Differential Equations These systems tend to have a relaxed or passive nature in real applications. Examples of these equations are given below,
y' + 2 xy 4 x = 0 y' 2 y = 0
Typical methods for solving these equations include, guessing then testing separation
homogeneous 34.6.3.1.1 - Guessing In this technique we guess at a function that will satisfy the equation, and test it to see if it works.
y' + y = 0 y = Ce
t
y' + y = Ce + Ce
= 0
The previous example showed a general solution (i.e., the value of C was not found). We can also find a particular solution.
y = Ce y = 5e
34.6.3.1.2 - Separable Equations In a separable equation the differential can be split so that it is on both sides of the equation. We then integrate to get the solution. This typically means there is only a single derivative term.
e.g.,
dx ----- + y2 + 2 y + 3 = 0 dy dx = ( y 2 y 3 ) dy y - 2 y 3y + C x = ------3
3 2
e.g.,
34.6.3.1.3 - Homogeneous Equations and Substitution These techniques depend upon finding some combination of the variables in the equation that can be replaced with another variable to simplify the equation. This technique requires a bit of guessing about what to substitute for, and when it is to be applied.
e.g.,
dy ----- = y -1 dx x y u = x
Put the substitution in and solve the differential equation, dy ----- = u1 dx du - = u1 u + x ----dx du 1 - = --------dx x du - = 1 - ----dx x u = ln ( x ) + C Substitute the results back into the original substitution equation to get rid of u, y - = ln ( x ) + C x y = x ln ( x ) Cx
34.6.3.2 - Second-order Differential Equations These equations have at least one second-order derivative. In engineering we will encounter a number of forms, - homogeneous - nonhomogeneous 34.6.3.2.1 - Linear Homogeneous These equations will have a standard form,
e.g.,
d-$ Bt # ---y Be = ! dt" d-$ 2 Bt # ---y = B e ! dt" substitute and solve for B, B e + 6 Be + 3 e B + 6B + 3 = 0 B = 3 + 2.449 j, 3 2.449 j substitute and solve for B, y = e y = e y = e
( 3 + 2.449 j ) t 3 t 2.449 jt 2 2 Bt Bt Bt 2
= 0
3 t
+ C 2 te
Bt
34.6.3.2.2 - Nonhomogeneous Linear Equations These equations have the general form,
to solve these equations we need to find the homogeneous and particular solutions and then add the two solutions.
y = yh + yp to find yh solve, d-$ 2 d$ # ---# ---! dt" y + A ! dt" y + B = 0 to find yp guess at a value of y and then test for validity, A good table of guesses is, Cx form A Ax + B Ax e B sin ( Ax ) or B cos ( Ax ) Guess C Cx + D Ax Ax Ce Cxe C sin ( Ax ) + D cos ( Ax ) or Cx sin ( Ax ) + xD cos ( Ax )
d-$ 2 d-$ 2 x # ---# ---! dt" y + ! dt" y 6 y = e First solve for the homogeneous part, d-$ 2 d-$ # ---# ---! dt" y + ! dt" y 6 y = 0 try y = e
Bx
B e
2
2 Bx
+ Be
Bx
6e
Bx
= 0
B +B6 = 0 B = 3, 2 yh = e
3 x
+e
2x
Next, solve for the particular part. We will guess the function below. y = Ce
2x
+ 2 C e
2 x
6 Ce
2 x
= e
2 x
+e
2x
+ 0.25 e
2x
34.6.3.4 - Partial Differential Equations Partial difference equations become critical with many engineering applications involving flows, etc.
(n 1)
n1
(ans. # d $ # 3 t d-$ d-$ 2 t 2 2 3 2t ---- ----------------- + e 2 t$ = # ---( 3 t ( 2 + t ) ) + # ---(e ) = 3( 2 + t ) 6t( 2 + t ) + 2e 2 ! dt" ! " ! dt" ! dt" (2 + t) 2. Solve the following differential equation, given the initial conditions at t=0s. x'' + 4 x' + 4 x = 5 t x0 = 0 x' 0 = 0
(ans.
x'' + 4 x' + 4 x = 0
At
xh = e
2 At
x h' = Ae
At At
At
x h'' = A e
2
2 At
A e + 4 Ae + 4 e xh = C1 e
2 t
= 0 = A + 4A + 4 = (A + 2 )(A + 2 )
+ C 2 te
2 t
x p' = A
x p'' = 0
( 0 ) + 4 ( A ) + 4 ( At + B ) = 5 t (4A + 4B) + ( 4A)t = (0) + (5)t 5 - = 1.25 A = -4 x p = 1.25 t 1.25 combine and solve for constants: x ( t ) = xh + xp = C1 e for x(0) = 0
2 t
4 ( 1.25 ) + 4 B = 0
B = 1.25
+ C 2 te
2 ( 0 )
2 t
+ 1.25 t 1.25
2 ( 0 )
0 = C1 e
+ C2( 0 ) e
for (d/dt)x(0) = 0
2t
0 = ( 2 ) C1 e
2t
2 ( 0 )
+ ( 2 ) C2 ( 0 ) e
+ C2 e
2 ( 0 )
+ 1.25
2 C 1 + C 2 + 1.25 = 0 = 2 ( 1.25 ) + C 2 + 1.25 x ( t ) = 1.25 e + 1.25 te + 1.25 t 1.25 3. Find the following derivatives. d( sin t + cos t ) a) ---dt d2 ((t + 2) ) b) ---dt d8t ( 5 te ) c) ---dt d( 5 ln t ) d) ---dt
C 2 = 1.25
(ans. ddd( sin t + cos t ) = ---( sin t ) + ---( cos t ) = cos t sin t a) ---dt dt dt d2 3 ( ( t + 2 ) ) = 2 ( t + 2 ) b) ---dt d8t 8t 8t ( 5 te ) = 5 e + 40 te c) ---dt d5 ( 5 ln t ) = -d) ---dt t 4. Find the following integrals
( 6 t dt 7t b) ( 14 e dt c) ( sin ( 0.5 t ) dt
a)
2
d)
- dx ( -x
e 7t 7t -----$ b) ( 14 e dt = 14 # ! 7 " + C = 2e + C c) d)
7t
( sin ( 0.5 t ) dt
- dx ( -x 5
= 5 ln ( x ) + C
b)
(ans. a)
b)
(e
2t
dt
b)
( ( sin + cos 3 ) d
(ans.
a)
(e
2t
2t
b)
( ( sin + cos 3 ) d
(ans.
x( 0) = 1
x' ( 0 ) = 1
+ C2e
+ C2 e + 1 C1 = C2
1 = 4 C1 ( 1 ) C 2 ( 1 ) 4 ( C2 ) + C2 = 1 1 - e4t + 1 -- e t + 1 x = -3 3
1 C 2 = -3 1 C 1 = -3
9. Set up an integral and solve it to find the volume inside the shape below. The shape is basically a cone with the top cut off.
z b
x a c
(ans.
V =
dV =
(0 A dx
2 2
c b ----------$ r = b+# ! a "x cb b b 2 ----------$ x 2 -$ x$ = b 2 + 2 # c ----------$ x + # c A = r = # b + # ---------! ! a " " ! a " ! a " V = b 2 b #c #c ----------$ 2$ ----------$ (0 # ! b + 2 ! a " x + ! a " x " dx
a 2 a 2
b$ 2 3
10. Solve the first order non-homogeneous differential equation below. Assume the system starts at rest. 2 x' + 4 x = 5 sin 4 t 11. Solve the second order non-homogeneous differential equation below. 2 x'' + 4 x' + 2 x = 5 where, x( 0) = 2 x' ( 0 ) = 0
y(t) yi + 1 yi yi 1
ti 1
ti
ti
ti + 1
y i y i 1$ y i + 1 y i$ d1 1 ---- = # -------------------- = -- ( y y ) = --(y y ( t i ) # -------------------y) ! ti ti 1 " ! t i + 1 ti " dt T i i1 T i+1 i 1 1 -(y y ) -- ( y i + 1 y i ) -2 yi + yi 1 + y i + 1 d-$ T i i1 T # -------------------------------------------------------------------------------------------------------------- y ( t ) = i 2 ! dt" T T
2
1- 2 # d $ 2 d-$ 1- 3 # ---d 3 1- 4 # ---d 4 - x ( t ) + ---x ( t + h ) = x ( t ) + h # ---x ( t ) + ---h ---h -$ x ( t ) + ---h -$ x ( t ) + ! dt" 2! ! dt" 3! ! dt" 4! ! dt"
When h=0 this is called a MacLaurin series. We can integrate a function by,
t (s) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
x(t) 0
d/dt x(t) 0
h = 0.1
1 - ( F + 2 F 2 + 2 F 3 + F4 ) x ( t + h ) = x ( t ) + -6 1 F 1 = hf ( t, x ) F 1$ h --, x + ----F 2 = hf # t + ! 2 2" F 2$ h -, x + ----F 3 = hf # t + -! 2 2" F 4 = hf ( t + h, x + F 3 ) where, x = the state variables f = the differential function t = current point in time h = the time step to the next integration point
This method can become divergent if the function has an inflection point near the root. The technique is also sensitive to the initial guess. This calculation should be repeated until the final solution is found.
F(s) = where,
(0 f ( t ) e
st
dt
f(0 ) s
n 2 df ( 0
) f( 0 ) -----------------d ------------------n dt dt
(0 f ( t ) dt
f ( t a ) u ( t a ), a > 0 e
at
f( s)
f(t)
( f ( u ) du
s
TIME DOMAIN
FREQUENCY DOMAIN A -s 1 ---2 s 1---------s+a ----------------2 2 s + s ----------------2 2 s + 1 -----------------2 (s + a) ------------------------------(s + a) + s+a ------------------------------(s + a) +
2 2
A t e
at
sin ( t ) cos ( t ) te e e
at
at
sin ( t ) cos ( t )
at
Ae
at
Ate
at
2Ae
2t A e
34.9 z-TRANSFORMS
For a discrete-time signal x [ n ] , the two-sided z-transform is defined by
X(z) =
'
n =
' x [ n ]z
n=0
. In
both cases, the z-transform is a polynomial in the complex variable z . The inverse z-transform is obtained by contour integration in the complex plane n1 1dz . This is usually avoided by partial fraction inversion techx [ n ] = ------X(z)z ( j2 niques, similar to the Laplace transform. Along with a z-transform we associate its region of convergence (or ROC). These are the values of z for which X ( z ) is bounded (i.e., of finite magnitude).
Some common z-transforms are shown below. Table 1: Common z-transforms Signal x[ n] [n] u[n] z-Transform X(z) 1 1 --------------1 1z z ---------------------1 2 (1 z ) (1 + z ) z ---------------------------1 3 (1 z ) 1 -----------------1 1 az az -------------------------1 2 ( 1 az ) 1 -----------------1 1 az az -------------------------1 2 ( 1 az ) 1 z cos 0 -----------------------------------------------1 2 1 2 z cos 0 + z z sin 0 -----------------------------------------------1 2 1 2 z cos 0 + z 1 az cos 0 --------------------------------------------------------1 2 2 1 2 az cos 0 + a z
1 1 1 1 1 1 1 1
nu [ n ]
z >1
n u[n ]
z >1
a u[n ]
z > a
na u [ n ]
z > a
( a ) u[ n 1 ]
z < a
( na ) u [ n 1 ]
z < a
cos ( 0 n ) u [ n ]
z >1
sin ( 0 n ) u [ n ]
z >1
a cos ( 0 n ) u [ n ]
z > a
ROC
z > a
n! ---------------------u[n] k! ( n k )!
z >1
The z-transform also has various properties that are useful. The table below lists properties for the two-sided z-transform. The one-sided z-transform properties can be derived from the ones below by considering the signal x [ n ] u [ n ] instead of simply x [ n ] . Table 2: Two-sided z-Transform Properties Property Notation Time Domain x[ n] x1 [ n ] x2 [ n ] Linearity x1 [ n ] + x2 [ n ] X(z) X1 ( z ) X2 ( z ) X1 ( z ) + X2 ( z ) z-Domain ROC r2 < z < r 1 ROC 1 ROC 2 At least the intersection of ROC 1 and ROC 2 Time Shifting x[ n k] z X( z)
k
That of X ( z ) , except z = 0 if k > 0 and z = if k < 0 a r2 < z < a r1 1 1 ---< z < ---r2 r1 r2 < z < r 1
a x[ n] x [ n ] nx [ n ]
z-Domain Differentiation
Table 2: Two-sided z-Transform Properties Property Convolution Time Domain x1 [ n ] * x2 [ n ] z-Domain X1 ( z )X2 ( z ) ROC At least the intersection of ROC 1 and ROC 2 Multiplication x1 [ n ] x2 [ n ] x [ n ] causal 1z -------$ v 1 dv X1 ( v ) X2 # ( ! j 2 v" x [ 0 ] = lim X ( z )
z
a0 -+ f ( x ) = ---2
'
n=1
34.12 REFERENCES/BIBLIOGRAPHY
Spiegel, M. R., Mathematical Handbook of Formulas and Tables, Schaums Outline Series, McGraw-Hill Book Company, 1968.
C programming - 35.1
C is commonly used to produce operating systems and commercial software. Some examples of these are UNIX, Lotus-123, dBase, and some C compilers.
Machine Portable, which means that it requires only small changes to run on other computers.
C programming - 35.2
35.2 BACKGROUND
Developed at Bell Laboratories in the Early 70s, and commercial compilers became available in the Late 70s.Recnetly has become more popular because of its ties to UNIX. Over 90% of UNIX is written in C. AT&T originally developed C with the intention of making it an in-house standard.
The main program is treated like a function, and thus it has the name main().
C programming - 35.3
Program to Add two Numbers: /* A simple program to add two numbers and print the results */ main() { int x, y = 2, z; /* define three variables and give one a value */ x = 3; /* give another variable a value */ z = x + y; /* add the two variables */ printf(%d + %d = %d\n, x, y, z); /*print the results */ } Results (output):
A very common function in C is printf(). This function will do a formatted print. The format is the first thing which appears between the brackets. In this case the format says print an integer %d followed by a space then a + then another space, another integer, another space, =, and another space, another integer, then a line feed \n. All variables that follow the format statement are those to be printed. x, y, and z are the three integers to be printed, in their respective orders.
C programming - 35.4
Major Data Types for variables and functions are (for IBM PC): int (2 byte integer), short (1 byte integer), long (4 byte integer), char (1 byte integer), float (4 byte IEEE floating point standard), double (8 byte IEEE floating point standard).
int, short, long, char can be modified by the addition of unsigned, and register. An unsigned integer will not use 1 bit for number sign. A register variable will use a data register in the microprocessor, if possible, and it will speed things up (this is only available for integers).
Example of Defining Different Data Types: main() { unsigned int i; register j; short k; char l; double m; etc
A function consists of a sub-routine or program, which has been assigned a name. This function is capable of accepting an argument list, and returning a single value. The function must be defined before it is called from within the program. (e.g. sin() and read()).
C programming - 35.5
Program to add numbers with a function: /* A simple program to add two numbers and print the results */ int add(); /* Declare a integer function called add */ main() { int x = 3, y = 2, z; /* define three variables and give values */ z = add(x, y); /* pass the two values to add and get the sum*/ printf(%d + %d = %d\n, x, y, z); /*print the results */ } int add(a, b) /* define function and variable list */ int a, b; /* describe types of variable lists */ { int c; /* define a work integer */ c = a + b; /* add the numbers */ return(c); /* Return the number to the calling program */
Every variable has a scope. This determines which functions are able to use that variable. If a variable is global, then it may be used by any function. These can be modified by the addition of static, extern and auto. If a variable is defined in a function, then it will be local to that function, and is not used by any other function. If the variable needs to be initialized every time the subroutine is called, this is an auto type. static variables can be used for a variable that must keep the value it had the last time the function was called. Using extern will allow the variable types from other parts of the program to be used in a function.
C programming - 35.6
Program example using global variables: /* A simple program to add two numbers and print the results */ int x = 3, /* Define global x and y values */ y = 2, add(); /* Declare an integer function called add */ main() { printf(%d + %d = %d\n, x, y, add()); /*print the results */ } int add() /* define function */ { return(x + y); /* Return the sumto the calling program */
Some basic control flow statements are while(), do-while(), for(), switch(), and if(). A couple of example programs are given below which demonstrate all the C flow statements.
Program example with a for loop: /* A simple program toprint numbers from 1 to 5*/ main() { int i; for(i = 1; i <= 5; i = i + 1){ printf(number %d \n, i); /*print the number */ } }
C programming - 35.7
or example with a while loop: main() { int i = 1; while(i <= 5){ printf(number %d \n, i); i = i + 1; } } or example with a do while loop main() { int i = 1; do{ printf(number %d \n, i); i = i + 1; }while(i <= 5) } or example with a do until loop: main() { int i = 1; do{ printf(number %d \n, i); i = i + 1; }until(i > 5) }
C programming - 35.8
Example Program with an if else: main() { int x = 2, y = 3; if(x > y){ printf(Maximum is %d \n, x); } else if(y > x){ printf(Maximum is %d \n, y); } else { printf(Both values are %d \n, x); } }
Example Program using switch-case: main() { int x = 3; /* Number of People in Family */ switch(x){ /* choose the numerical switch */ case 0: /* Nobody */ printf(There is no family \n); break; case 1: /* Only one person, but a start */ printf(There is one parent\n); break; case 2: /* You need two to start something */ printf(There are two parents\n); break; default: /* critical mass */ printf(There are two parents and %d kids\n, x-2); break; } }
C programming - 35.9
#include <filename.h> will insert the file named filename.h into the program. The *.h extension is used to indicate a header file which contains C code to define functions and constants. This almost always includes stdio.h. As we saw before, a function must be defined (as with the add function). We did not define printf() before we used it, this is normally done by using #include <stdio.h> at the top of your programs. stdio.h contains a line which says int printf();. If we needed to use a math function like y = sin(x) we would have to also use #include <math.h>, or else the compiler would not know what type of value that sin() is supposed to return.
#define CONSTANT TEXT will do a direct replacement of CONSTANT in the program with TEXT, before compilation. #undef CONSTANT will undefine the CONSTANT.
A Sample Program to Print Some sin() values (using defined constatnts) #include stdio.h #include math.h #define TWO_PI 6.283185307 #define STEPS 5 main() { double x; /* Current x value*/ for(x = 0.0; x <= TWO_PI; x = x + (TWO_PI / STEPS)){ printf(%f = sin(%f) \n, sin(x), x); } }
#ifdef, #ifndef, #if, #else and #else can be used to conditionally include parts of a program. This is use for including and eliminating debugging lines in a program.
#define, #include, #ifdef, #ifndef, #if, #else, /* and */ are all handled by the Preprocessor, before the compiler touches the program.
C programming - 35.10
Matrices are defined as shown in the example. In C there are no limits to the matrix size, or dimensions. Arrays may be any data type. Strings are stored as arrays of characters.
A Sample Program to Get a String Then Print its ASCII Values (with matrix) #include stdio.h #define STRING_LENGTH 5 main() { int i; char string[STRING_LENGTH]; /* character array */ gets(string); /* Input string from keyboard */ for(i = 0; i < STRING_LENGTH; i++){ printf(pos %d, char %c, ASCII %d \n, i, string[i], string[i]); } } INPUT: HUGH<return> OUTPUT: pos 0, char H, ASCII 72 pos 0, char U, ASCII 85 pos 0, char G, ASCII 71 pos 0, char H, ASCII 72 pos 0, char , ASCII 0
C programming - 35.11
Pointers are a very unique feature of C. First recall that each variable uses a real location in memory. The computer remembers where the location of that variable is, this memory of location is called a pointer. This pointer is always hidden from the programmer, and uses it only in the background. In C, the pointer to a variable may be used. We may use some of the operations of C to get the variable that the pointer, points to. This allows us to deal with variables in a very powerful way.
A Sample Program to Get a String Then Print its ASCII Values (with pointers): #include stdio.h main() { int i; char *string; /* character pointer */ gets(string); /* Input string from keyboard */ for(i = 0; string[i] != 0; i++){ printf( pos %d, char %c, ASCII %d \n, i, string[i], string[i]); } } INPUT: HUGH<return> OUTPUT: pos 0, char H, ASCII 72 pos 0, char U, ASCII 85 pos 0, char G, ASCII 71 pos 0, char H, ASCII 72
A C compiler has three basic components: Preprocessor, First and Second Pass
C programming - 35.12
The Preprocessor Will remove comments, replace strings which have a defined value, include programs, and remove unneeded characters.
C programming - 35.13
Use indents, spaces and blank lines, to make the program look less cluttered, and give it a block style.
Descriptive variable names, and defined constants make the purpose of the variable obvious.
All declarations for the program should be made at the top of the program listing.
C programming - 35.14
A Good Example of the same Program: #include <stdio.h> #define COUNT 10 /* Number of counts in loop */ main() { int i; /* counter */ for(i = 0; i < COUNT; i++){ /* loop to print numbers */ printf(age:%d\n, i); } exit(0); }
35.6.1 How?
A program should be broken into fundamental parts (using functions for each part) and then assembled using functions. Each function consists of programs written using the previous simpler functions.
C programming - 35.15
Frame is like one subroutine which also calls other subroutines like Suspension
Engine
Never use gotos, they are a major source of logic errors. Functions are much easier to use, once written.
Try to isolate machine specific commands (like graphics) into a few functions.
35.6.2 Why?
A top-down design allows modules to be tested as they are completed. It is much easier to find an error in a few lines of code, than in a complete program.
When programs are complete, errors tend to be associated with modules, and are thus much easier to locate.
C programming - 35.16
Updates to programs are much easier, when we only need to change one function.
It is just as easy to change the overall flow of a program, as it is to change a function. Application of C to a CAD Program
2. Define Problem - Write out the relevant theory. This description should include variables, calculations and figures, which are necessary for a complete solution to the problem. From this we make a list of required data (inputs) and necessary results (output).
3. Design User Interface - The layout of the screen(s) must be done on paper. The method of data entry must also be considered. User options and help are also considered here. (There are numerous factors to be considered at this stage, as outlined in the course notes.)
4. Write Flow Program - This is the main code that decides when general operations occur. This is the most abstract part of the program, and is written calling dummy program stubs.
C programming - 35.17
5. Expand Program - The dummy stubs are now individually written as functions. These functions will call another set of dummy program stubs. This continues until all of the stubs are completed. After the completion of any new function, the program is compiled, tested and debugged.
6. Testing and Debugging- The program operation is tested, and checked to make sure that it meets the objectives. If any bugs are encountered, then the program is revised, and then retested.
7. Document - At this stage, the operation of the program is formally described. For Programmers, a top-down diagram can be drawn, and a written description of functions should also be given.
Golden Rule: If you are unsure how to proceed when writing a program, then work out the problem on paper, before you commit yourself to your programmed solution.
Note: Always consider the basic elements of Software Engineering, as outlined in the ES488 course notes.
C programming - 35.18
35.8.1 Objectives:
The program is expected to aid the design of beams by taking basic information about beam geometry and material, and then providing immediate feedback. The beam will be simply supported, and be under a single point load. The program should also provide a printed report on the beam.
The basic theory for beam design is available in any good mechanical design textbook. In this example it will not be given.
The inputs were determined to be few in number: Beam Type, Beam Material, Beam Thickness, Beam Width, Beam Height, Beam Length, Load Position, Load Force.
The possible outputs are Cross Section Area, Weight, Axial Stiffness, Bending Stiffness, and Beam Deflection, a visual display of Beam Geometry, a display of Beam Deflection.
C programming - 35.19
The small number of inputs and outputs could all be displayed, and updated, on a single screen.
The left side of the screen was for inputs, the right side for outputs.
The screen is divided into regions for input(2), input display and prompts(1), Beam Cross section(3), Numerical Results(4), and Beam Deflection(5).
35.8.3.2 - Input: Current Inputs were indicated by placing a box around the item on the display(1).
The cursor keys could be used to cursor the input selector up or down.
C programming - 35.20
and <RETURN>. In the spirit of robustness it was decided to screen all other keys.
35.8.3.3 - Output: Equations, calculations, material types, and other relevant information were obtained from a text.
Proper textual descriptions were used to ensure clarity for the user.
For a printed report, screen information would be printed to a printer, with the prompt area replaced with the date and time.
35.8.3.4 - Help: A special set of help information was needed. It was decided to ensure that the screen always displays all information necessary(2).
35.8.3.5 - Error Checking: Reject any input which violates the input limits.
C programming - 35.21
35.8.3.6 - Miscellaneous: The screen was expressed in normalized coordinates by most sub-routines.
C programming - 35.22
main() /* * EXECUTIVE CONTROL LEVEL * * This is the main terminal point between the * various stages of setup, input, revision * and termination. * * January 29th, 1989. */ { static int error; if((error = setup()) != ERROR) { screen(NEW); screen(UPDATE); while((error = input()) != DONE) { if(error == REVISED) { screen(NEW); screen(UPDATE); } } error = NO_ERROR; } kill(); if(error == ERROR) { printf(EGA Graphics Driver Not Installed); }
C programming - 35.23
The routines were written in a top down fashion, in a time of about 30 hours. These routines are listed below.
screen() - A function to draw, or refresh part of the screen. In the interest of program speed, this function uses some low level commands.
picture() - draws the beam cross section and deflection of beam. For the sake of speed, this section will use low level commands.
input() - A function which controls the main input loop for numbers, con-
Condition and error flags were used to skip unnecessary operations, and thus speed up response. A response of more than 0.5 seconds will result in loss of attention by the user.
C programming - 35.24
High Level Executive Subroutine Top main() screen() input() box() printer()
In this case we see that most of the routines are at the bottom of the design tree. This structure shows a clear division of tasks, to their basic parts. On the above diagram, none of the functions calls any of the functions to the left of it, only to the right. In this case main() will call setup(), screen(), input() and kill() directly.
C programming - 35.25
The testing and debugging was very fast, with only realignment of graphics being required. This took a couple of hours.
35.8.7 Documentation
35.8.7.1 - Users Manual: The documentation included an Executive Summary of what the Program does.
The theory for beam design was given for the reference of any program user, who wanted to verify the theory, and possible use it.
A manual was given which described key layouts, screen layout, basic sequence of operations, inputs and outputs.
A walk through manual was given. This allowed the user to follow an example which displayed all aspects of the program.
C programming - 35.26
1. What are the basic components of a C compiler, and what do they do?
C programming - 35.27
2. You have been asked to design a CAD program which will choose a bolt and a nut to hold two pieces of sheet metal together. Each piece of sheet metal will have a hole drilled in it that is the size of the screw. You are required to consider that the two pieces are experiencing a single force. State your assumptions about the problem, then describe how you would produce this program with a Top Down design.
4. Describe some of the reasons for Using Top-Down Design, and how to do it.
units - 36.1
**a simple unit conversion example: Given, d x = 10 m Find the distance d, keep the units in the equation d = dx + dy
2 2
d y = 5 ft
d = d = d = d = d = d =
( 10 m ) + ( 5 ft ) 100 m + 25 ft
2 2
multiply by 1
m 2 2 100 m + 25 ft ( 0.092903 ) -----2 ft cancel out units 100 m + 25 ( 0.092903 ) m 102.32 m = 10.12 m
2 2 2
units - 36.2
units - 36.3
1 furlong = 660 ft 1 lightyear = 9.460528e15 m 1 parsec = 3.085678e16 m Area 1 acre = 43,559.66 ft2 1 Hectare (ha) = 10,000 m2 1 Hectare (ha) = 10,000 m2 1 Hectare (ha) = 10,000 m2 1 Hectare (ha) = 10,000 m2 Velocity 1 mph = 0.8689762 knot Angle 1 rev = 2PI radians = 360 degrees = 400 gradians 1 degree = 60 minutes 1 minute = 60 seconds Volume 1 US gallon = 231 in3 1 CC = 1 cm3 1 IMP gallon = 277.274 in3 1 barrel = 31 IMP gal. = 31.5 US gal. 1 US gal. = 3.785 l = 4 quarts = 8 pints = 16 cups 1 liter (l) = 0.001 m3 = 2.1 pints (pt) = 1.06 quarts (qt) = 0.26 gallons (gal) 1 qt (quart) = 0.9464 l 1 cup (c) = 0.2365882 l = 8 USoz 1 US oz = 8 U.S. drams = 456.0129 drops = 480 US minim = 1.040842 IMP oz = 2 tablespoons = 6 teaspoons 1 IMP gal. = 1.201 U.S. gal. 1 US pint = 16 US oz 1 IMP pint = 20 IMP oz 1tablespoon = 0.5 oz. 1 bushel = 32 quarts 1 peck = 8 quarts Force/Mass 1 N (newton) = 1 kgm/s2 = 100,000 dyne 1 dyne = 2.248*10-6 lb. (pound) 1 kg = 9.81 N (on earth surface) = 2.2046 lb 1lb = 16 oz. (ounce) = 4.448N
units - 36.4
1 oz. = 28.35 g (gram) = 0.2780N 1 lb = 0.03108 slug 1 kip = 1000 lb. 1 slug = 14.59 kg 1 imperial ton = 2000 lb = 907.2 kg 1 metric tonne = 1000 kg 1 troy oz = 480 grain (gr) 1 g = 5 carat 1 pennyweight = 24 grain 1 stone = 14 lb 1 long ton = 2240 lb 1 short ton = 2000 lb Pressure 1 Pascal (Pa) = 1 N/m2 = 6.895 kPa 1 atm (metric atmos.) =760 mmHg at 0C=14.223 lb/in2=1.0132*105 N/m2 1 psi = 2.0355 in. Hg at 32F = 2.0416 in. Hg at 62F 1 microbar = 0.1 N/m2 Scale/Magnitude atto (a) = 10-18 femto (f) = 10-15 pico (p) = 10-12 nano (n) = 10-9 micro () = 10-6 milli (m) = 10-3 centi (c) 10-2 deci (d) = 10-1 deka (da) = 10 hecto (H) = 102 kilo (K) = 103 mega (M) = 106 giga (G) = 109 tera (T) = 1012 peta (P) = 1015 exa (E) = 1018 Power 1 h.p. (horsepower) = 745.7 W (watts) = 2.545 BTU/hr. = 550 ft.lb./sec. 1 ftlb/s = 1.356 W 1 J (joule) = 1 Nm = 107 ergs = 0.2389 cal. 1 W = 1 J/s
units - 36.5
1 ev = 1.60219*10-19 J 1 erg = 10-7 J Temperature F = [(C*9)/5]+32, C = Celsius (Centigrade), F = Fahrenheit K = Kelvin Rankine (R) = F - 459.666 0.252 calories = 1 BTU (British Thermal Unit) -273.2 C = -459.7 F = 0 K = 0 R = absolute zero 0 C = 32 F = 273.3 K = 491.7 R = Water Freezes 100C = 212F = 373.3 K = 671.7 R = Water Boils (1 atm. pressure) 1 therm = 100,000 BTU Mathematical radians = 3.1416 radians = 180 degrees = 0.5 cycles 1 Hz = 1 cycle/sec. 1 rpm (revolutions per minute) = 60 RPS (Revolutions per second) = 60Hz 1 fps (foot per second) = 1 ft/sec 1 mph (miles per hour) = 1 mi./hr. 1 cfm (cubic foot per minute) = 1 ft3/min. e = 2.718
Time 1 Hz (hertz) = 1 s-1 1 year = 365 days = 52 weeks = 12 months 1 leap year = 366 days 1 day = 24 hours 1 fortnight = 14 days 1 hour = 60 min. 1 min = 60 seconds 1 millenium = 1000 years 1 century = 100 years 1 decade = 10 years
Physical Constants R = 1.987 cal/mole K = ideal gas law constant K = Boltzmanns constant = 1.3x10-16 erg/K = 1.3x10-23 J/K h = Plancks constant = 6.62x10-27 erg-sec = 6.62x10-34 J.sec Avagadros number = 6.02x1023 atoms/atomic weight density of water = 1 g/cm3 electron charge = 1.60x10-19 coul. electron rest mass = 9.11*10**-31 kg proton rest mass = 1.67*10**-27 kg
units - 36.6
speed of light (c) = 3.00x1010 cm/sec speed of sound in dry air 25 C = 331 m/s gravitational constant = 6.67*10**-11 Nm**2/kg**2 permittivity of free space = 8.85*10**-12 farad/m permeability of free space = 1.26*10**-6 henry/m mean radius of earth = 6370 Km mass of earth = 5.98*10**24 kg Electromagnetic magnetic flux = weber (We) = 10**8 maxwell inductance = henry magnetic flux density = tesla (T) = 10**4 gauss magnetic intensity = ampere/m = 0.004*PI oersted electric flux density = coulomb/m**2 capacitance = farad permeability = henry/m electric field strength = V/m luminous flux = lumen luminance = candela/m**2 1 flame = 4 foot candles = 43.05564 lux = 43.05564 meter-candles illumination = lux resistance = ohm
units - 36.7
hexadecimal
hexadecimal
decimal
decimal
ASCII
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
00000000 00000001 00000010 00000011 00000100 00000101 00000110 00000111 00001000 00001001 00001010 00001011 00001100 00001101 00001110 00001111 00010000 00010001 00010010 00010011 00010100 00010101 00010110 00010111 00011000 00011001 00011010 00011011 00011100 00011101 00011110 00011111
NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR S0 S1 DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
00100000 00100001 00100010 00100011 00100100 00100101 00100110 00100111 00101000 00101001 00101010 00101011 00101100 00101101 00101110 00101111 00110000 00110001 00110010 00110011 00110100 00110101 00110110 00110111 00111000 00111001 00111010 00111011 00111100 00111101 00111110 00111111
ASCII
binary
binary
units - 36.8
hexadecimal
hexadecimal
decimal
decimal
ASCII
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
01000000 01000001 01000010 01000011 01000100 01000101 01000110 01000111 01001000 01001001 01001010 01001011 01001100 01001101 01001110 01001111 01010000 01010001 01010010 01010011 01010100 01010101 01010110 01010111 01011000 01011001 01011010 01011011 01011100 01011101 01011110 01011111
@ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ yen ] ^ _
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
01100000 01100001 01100010 01100011 01100100 01100101 01100110 01100111 01101000 01101001 01101010 01101011 01101100 01101101 01101110 01101111 01110000 01110001 01110010 01110011 01110100 01110101 01110110 01110111 01111000 01111001 01111010 01111011 01111100 01111101 01111110 01111111
a b c d e f g h i j k l m n o p q r s t u v w x y z { | } r arr. l arr.
36.5 G-CODES
Note that G and M codes not universal standards, and may vary between machines. In any case of doubt, the manuals for the machine should be checked.
ASCII
binary
binary
units - 36.9
A basic list of G operation codes is given below. These direct motion of the tool. G00 - Rapid move (not cutting) G01 - Linear move G02 - Clockwise circular motion G03 - Counterclockwise circular motion G04 - Dwell G05 - Pause (for operator intervention) G08 - Acceleration G09 - Deceleration G17 - x-y plane for circular interpolation G18 - z-x plane for circular interpolation G19 - y-z plane for circular interpolation G20 - turning cycle or inch data specification G21 - thread cutting cycle or metric data specification G24 - face turning cycle G25 - wait for input #1 to go low (Prolight Mill) G26 - wait for input #1 to go high (Prolight Mill) G28 - return to reference point G29 - return from reference point G31 - Stop on input (INROB1 is high) (Prolight Mill) G33-35 - thread cutting functions (Emco Lathe) G35 - wait for input #2 to go low (Prolight Mill) G36 - wait for input #2 to go high (Prolight Mill) G40 - cutter compensation cancel G41 - cutter compensation to the left G42 - cutter compensation to the right G43 - tool length compensation, positive G44 - tool length compensation, negative G50 - Preset position G70 - set inch based units or finishing cycle G71 - set metric units or stock removal G72 - indicate finishing cycle (EMCO Lathe) G72 - 3D circular interpolation clockwise (Prolight Mill) G73 - turning cycle contour (EMCO Lathe) G73 - 3D circular interpolation counter clockwise (Prolight Mill) G74 - facing cycle contour (Emco Lathe) G74.1 - disable 360 deg arcs (Prolight Mill) G75 - pattern repeating (Emco Lathe) G75.1 - enable 360 degree arcs (Prolight Mill) G76 - deep hole drilling, cut cycle in z-axis G77 - cut-in cycle in x-axis G78 - multiple threading cycle G80 - fixed cycle cancel
units - 36.10
G81-89 - fixed cycles specified by machine tool manufacturers G81 - drilling cycle (Prolight Mill) G82 - straight drilling cycle with dwell (Prolight Mill) G83 - drilling cycle (EMCO Lathe) G83 - peck drilling cycle (Prolight Mill) G84 - taping cycle (EMCO Lathe) G85 - reaming cycle (EMCO Lathe) G85 - boring cycle (Prolight mill) G86 - boring with spindle off and dwell cycle (Prolight Mill) G89 - boring cycle with dwell (Prolight Mill) G90 - absolute dimension program G91 - incremental dimensions G92 - Spindle speed limit G93 - Coordinate system setting G94 - Feed rate in ipm (EMCO Lathe) G95 - Feed rate in ipr (EMCO Lathe) G96 - Surface cutting speed (EMCO Lathe) G97 - Rotational speed rpm (EMCO Lathe) G98 - withdraw the tool to the starting point or feed per minute G99 - withdraw the tool to a safe plane or feed per revolution G101 - Spline interpolation (Prolight Mill) M-Codes control machine functions and these include, M00 - program stop M01 - optional stop using stop button M02 - end of program M03 - spindle on CW M04 - spindle on CCW M05 - spindle off M06 - tool change M07 - flood with coolant M08 - mist with coolant M08 - turn on accessory #1 (120VAC outlet) (Prolight Mill) M09 - coolant off M09 - turn off accessory #1 (120VAC outlet) (Prolight Mill) M10 - turn on accessory #2 (120VAC outlet) (Prolight Mill) M11 - turn off accessory #2 (120VAC outlet) (Prolight Mill) or tool change M17 - subroutine end M20 - tailstock back (EMCO Lathe) M20 - Chain to next program (Prolight Mill) M21 - tailstock forward (EMCO Lathe) M22 - Write current position to data file (Prolight Mill) M25 - open chuck (EMCO Lathe) M25 - set output #1 off (Prolight Mill)
units - 36.11
M26 - close chuck (EMCO Lathe) M26 - set output #1 on (Prolight Mill) M30 - end of tape (rewind) M35 - set output #2 off (Prolight Mill) M36 - set output #2 on (Prolight Mill) M38 - put stepper motors on low power standby (Prolight Mill) M47 - restart a program continuously, or a fixed number of times (Prolight Mill) M71 - puff blowing on (EMCO Lathe) M72 - puff blowing off (EMCO Lathe) M96 - compensate for rounded external curves M97 - compensate for sharp external curves M98 - subprogram call M99 - return from subprogram, jump instruction M101 - move x-axis home (Prolight Mill) M102 - move y-axis home (Prolight Mill) M103 - move z-axis home (Prolight Mill) Other codes and keywords include, Annn - an orientation, or second x-axis spline control point Bnnn - an orientation, or second y-axis spline control point Cnnn - an orientation, or second z-axis spline control point, or chamfer Fnnn - a feed value (in ipm or m/s, not ipr), or thread pitch Innn - x-axis center for circular interpolation, or first x-axis spline control point Jnnn - y-axis center for circular interpolation, or first y-axis spline control point Knnn - z-axis center for circular interpolation, or first z-axis spline control point Lnnn - arc angle, loop counter and program cycle counter Nnnn - a sequence/line number Onnn - subprogram block number Pnnn - subprogram reference number Rnnn - a clearance plane for tool movement, or arc radius, or taper value Qnnn - peck depth for pecking cycle Snnn - cutting speed (rpm), spindle speed Tnnn - a tool number Unnn - relative motion in x Vnnn - relative motion in y Wnnn - relative motion in z Xnnn - an x-axis value Ynnn - a y-axis value Znnn - a z-axis value ; - starts a comment (proLight Mill), or end of block (EMCO Lathe)
materials - 37.1
Atomic # 29 26 13 74 30 14 6 22
Atomic weight 63.57 55.85 26.97 183.85 65.37 28.09 12.01 47.9
F = 96,500 coulombs
Material
Density
poisson
Type
aluminum
2.6-2.8
70-79
26-30
0.33
35-500
100-550
1-45
73 70 72
36-41 26 26
13 17 11
10-6/deg C
(Mg/m3)
(MPa)
(MPa)
(GPa)
(GPa)
(%)
materials - 37.2
Material
Density
poisson
Type
Brass
typical
8.4-8.6
96-110
36-41
0.34
70-550
200-620
4-60
Yellow Brass cold rolled annealed Red Brass cold rolled annealed Bronze Cast Iron typical typical 8.2-8.8 7.0-7.4 96-120 83-170 36-44 32-69 0.34 0.2-0.3 82-690 120 200-830 69-480 5-60 0-1
Concrete
na na na 40-47
Copper
typical
annealed hard drawn Glass typical 2.4-2.8 48-83 19-35 0.170.27 30-1000 0
Plate Fibers
Magnesium
typ. alloys
Monel
67%Ni,30% Cu
170
66
0.32
1701100 100-620
4501200 310-760
2-50
Nickel
8.8
210
80
0.31
2-50
10-6/deg C
(Mg/m3)
(MPa)
(MPa)
(GPa)
(GPa)
(%)
materials - 37.3
Material
Density
poisson
Type
Plastics Nylon Polyethylene Rock .88-1.1 .96-1.4 2.1-3.4 0.7-1.4 na na 0.4 0.4 40-80 7-28 20-100 15-300
Marble
2.6-2.9
40-100
na
0.2-0.3
Quartz
2.6-2.9
40-100
na
0.2-0.3
Limestone
2.0-2.9
20-70
na
0.2-0.3
Sandstone
2.0-2.9
20-70
na
0.2-0.3
Rubber
typical
.96-1.3
0.00070.004
0.00020.001
0.450.50
1.2-2.2
7.85
190-210
75-80
0.270.30
cold rolled annealed high strength 3401000 340-700 4001600 280-700 5501200 550-860 7001900 4001000 900 340-830 5-25
machine spring
5-25 3-15
stainless
5-40
520 200-700
8 10-40
10-6/deg C
(Mg/m3)
(MPa)
(MPa)
(GPa)
(GPa)
(%)
materials - 37.4
Material
Density
poisson
Type
astm-a47 astm-a36 astm-a5242 astm-a441 astm-a572 astm-a514 wire 340 700 2801000 500 830 5501400 20 15 5-40 250 400 30
aisi 302
typ. alloys
4.5
100-120
39-44
0.33
7601000
9001200 14004000
10
Tungsten
1.9
340-380
140-160
0.2
0-4
Water
fresh sea
1.0 1.02
Wood (dry) Douglas fir Oak Southern pine .48-.56 .64-.72 .56-.64 11-13 11-12 11-14 30-50 40-60 40-60 50-80 50-100 50-100 30-50 30-40 30-50 40-70 30-50 40-70
10-6/deg C
(Mg/m3)
(MPa)
(MPa)
(GPa)
(GPa)
(%)
materials - 37.5
Axial/Normal Stress/Strain
P = E = -A
PL = L = -----AE
Shear Stress/Strain
= G
xy xy = -----G
Poissons ratio
E = 2G(1 + )
Torsion
(cylinder)
4 - ( r4 J = - ri ) o 2 P = 2 fT
(hollow tube)
materials - 37.6
Beams
Buckling
EI P < ----------2 2 k L
k=0.5 (both ends fixed) k=0.7 (one end fixed, one pinned) k=1.0 (both ends pinned) k=2.0 (one end pinned, one free)
K 3.0 P
d/2
r P
d/2 2.5
2.0
1.5 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
r/d
materials - 37.7
K 2.5 P 2.0 D
d P
1.5
D/d = 2.0 D/d = 1.5 D/d = 1.25 D/d = 1.1 r/d 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
1.0
materials - 37.8
K T D 2.5 r d T
2.0
1.5
D/d = 2.0 D/d = 1.33 D/d = 1.2 D/d = 1.1 r/d 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
1.0
bibliography - 38.1
38. BIBLIOGRAPHY
38.1 TEXTBOOKS
38.1.2 VandeVegte
Citation: VandeVegte, John, "Feedback Control Systems", Prentice Hall, Second Edition, 1990. Topics/Chapters: Linearized dynamic models Transfer function models of physical systems Modeling of feedback systems and controllers Transient performance and the s-plane The perfoarmance and dynamic compensation of feedback systems The root-locus method
bibliography - 38.2
Frequency response analysis Frequency response design Digital control systems Digital control system analysis and design State space analysis Introduction to state space design Multivariable systems in the frequency domain Nonlinear control systems App: Vectors matrices and determinants App: Computer aids for analysis and design Comments: Directed to mechanical undergraduate students. Chapters cover a range of topics systems including motors, pneumatics, fluids, thermo, etc. Chapters 1-8 use classical design techniques. Chapters 9-10 present z-transform methods for controller analysis, some design issues are presented.