Penn State Erie, The Behrend College School of Engineering EE BD 327 Signals and Control Lab Spring 2008 Lab 9 Ball and Beam Balancing Problem April 10, 17, 24, 2008 Due: May 1, 2008 Number of Lab Periods: 3 1 Objectives In this lab, we will explore several different aspects of controller design. The objectives for this laboratory are to gain an understanding of control system design for secondorder system timedomain specifications strategies which decouple dynamics to simplify control design the effects of physical nonlinearities on design and performance We will first have to derive an analytical model for the system, perform a design study and then use SIMULINK to simulate the system response. In practice, these steps must all be completed before any hardware testing takes place. 2 Exercises The physical system is depicted in figure 1. The diagram shows a servomotor coupled to a ball and beam setup. The motor drives a lever arm which is coupled to a track upon which a rolling ball rests. The purpose of the design is to control the position of the ball along the track by manipulating the angular position of the servo. The controller is to be designed so that the ball responds to step changes in the desired ball position with low overshoot (preferably below 5%), no more than 4 seconds 5% settling time and steadystate error as small as possible. A block diagram of the proposed control configuration is shown in figure 2. There are two phases to the design. In the first phase, the inner loop, i.e., the servomotor control loop is designed. This design is to be accomplished so that the servomotor angular position response to step inputs 1
Figure 1: Physical plant V X,d 0.1 V K(s) Θ,d V in C(s) Motor ball/beam Θ X Sensor V Θ Sensor V X 0.1 Figure 2: Closedloop system configuration is fast relative to the ball and beam loop which is to be designed later. By designing the inner loop in this fashion, one essentially decouples the servomotor control design from the ball and beam control design. Once the first phase of the design is complete, the controlled servomotor system may be seen as part of the plant dynamics. Now, because the dynamics have been designed to be fast, the dynamics of entire system can be seen as a dominant secondorder system. Moreover, it can even be regarded as a constant gain transfer function from V Θ,d to V Θ since the system reach steady state very fast. The secondphase is to design the outer loop, i.e., the ball position control loop, so that the ball dynamics are appropriately controlled. The elements of each phase of the design are now described. Background information, including theoretical models, is included in the Appendix. Please download the following files from http://ecse.bd.psu.edu/eebd327/ for your usage in the design and simulation. stepdata.mat This is a file containing step response data for the servo motor. The experiment 2
was conducted with a unity feedback controller configuration. The controller in the forward loop was a constant gain controller with gain K = 20. The reference input was a 0.5V step function. servo.mdl This is a SIMULINK file which contains a model of the servomotor obtained from previous experimentation. Some nonlinear effects, such as motor stiction, motor velocity limits and amplifier output saturation have been included in the model. ballbeam.mdl This is a SIMULINK file which contains the model of the servomotor contained in servo.mdl coupled with the ball and beam dynamics. balltdem.mdl This is a SIMULINK file which contains closedloop block diagrams of the whole systems for the purpose of design and simulation. animation.m This is a MATLAB function which animates the physical systems. EXERCISE A (Inner Loop Identification and Design) 45 points 1. System Identification: Derive the transfer function of the servomotor subsystem (from V in to V Θ ) using the information of mathematical models provided in Appendix A. Be sure to include the sensor gains in the models. Take care to keep track of measurement units (e.g., L m =0.18mH should be regarded as 0.18 10 3 H, J m =0.387μKg m 2 as 0.387 10 6 Kg m 2 when you substitute the values into the formulae, and you also need to convert degree to radian) since unit conversions will affect gains in the system. Keep only the system dynamics which will dominate the response. Note that the system is unstable. 2. Verification of the Model: Using the following technique to verify that your theoretical model is accurate. Suppose that the (unknown) transfer function model for the servomotor subsystem is labelled G m (s). Connect G m (s) with constant gain controller, K =20, as shown in figure 3 and obtain a 0.5V step response from the closed loop system. (The experiment has already been performed. Data for this step response is stored in stepdata.mat.) Find a secondorder transfer function Y (s)/r(s) which fits the data. Note that any model will have error due to motor nonlinearities (stiction and velocity limits). Use this transfer function model, along with knowledge of the gain K, tosolveforg m (s). Compare the G m (s) with Figure 3: Motor identification experiment your theoretical model (i.e., V Θ(s) V in (s)). Explain differences. 3. Controller Design: Find a continuous controller, C(s), as depicted in figure 2 so that the servomotor subsystem, V Θ (s)/v Θ,d (s) responds to a 0.5volt step input with no more than 5% 3
overshoot and a peaktime of approximately 0.2 seconds. Use the model supplied in servo.mdl to verify your design in Simulink. Obtain a printout of the Simulink block diagram used and the resulting stepresponse, appropriately annotated. Be sure to include these in your report. (Hint: you may consider using just a gain controller C(s) =K 1.) EXERCISE B (Outer Loop Identification and Design) 45 points 1. System Identification: Derive the transfer function X(s)/V Θ,d (s) with the servomotor controller in place. Be sure to document your modelling assumptions in your lab report. (Hint: You may regard the inner loop as a constant gain transfer function since it is much faster than the outer loop. And sin(θ l ) may be roughly approximated by θ l ). 2. Controller Design Design a controller K(s) so that the closedloop response x(t) to a step input x d (t) has low overshoot (preferably below 5%), less than 4 seconds 5% settling time and steadystate error as small as possible. You may use any method you like (e.g., PID controller). Use the model supplied in balltdem.mdl to verify your design in SIMULINK. Obtain a printout of the SIMULINK block diagram used and the resulting stepresponse, appropriately annotated. Include these in your report. 3. Documentation: Be sure to include all derivations and assumptions in your lab report. Your report should also include a detailed system block diagram similar to figure 2 with your mathematical models indicated. The instructor will need to check your simulation and animation results. EXERCISE C (Animation) 10 points Run the animation file using the t, x, theta, alpha you obtained from simulation. Make sure that you choose the Solver options in Simulation Simulation parameters... to be Fixedstep with step size 0.001 and ode4 (RungeKutta). Note that the movie will clip 20 frames per second with respect to t. However, when displaying, it will show about 10 frames per second of real time. So the total time of each movie show will be about twice the maximum time in t. Also note that the animation movie will be shown 30 times. It is better to observe the system s behavior in the third or later movie show. 4
Appendix A: Mathematical Models Mathematical models for the physical components are described as follows. Servomotor The servomotor is a brushless armaturecontrolled DC motor. An electromechanical diagram of the servomotor, including the power amplifier which supplies current, is shown in figure 4. The electrical dynamics can be described by Figure 4: Electromechanical servomotor model di m v in = R m i m L m dt K dθ m b (1) dt where v in is the voltage supplied to the power amplifier, R m, L m, i m and θ m are the armature resistance, inductance, current and angular position, respectively, and K b is the back EMF constant of the motor. The mechanical equations of motion can be described by τ m = J m d 2 θ m dt 2 J l d 2 θ m Kg 2 dt 2 (2) where τ m is the torque exerted by the motor shaft, J m isthearmatureinertia,j l is the load inertia and K g is the gear ratio between the motor shaft and the load. Because this is an armature controlled configuration, the field current in the motor is held constant and the motor torque is proportional to the armature current, i.e. τ m = K m i m (3) where K m is the torque constant of the motor. Note that the angular position of the load, θ l, is translated to the angular position of the motor, θ m,usingthegearratio θ m = K g θ l (4) The motor parameters supplied by the manufacturer are listed in table 1 Nonlinearities: There are three types of nonlinearities which will affect the system response in this exercise. The first of these is called motor stiction. Stiction is the static friction in the motor which must be overcome before any movement can occur. It manifests itself as a voltage threshold below which the motor will not move. In feedback control designs, the effect of stiction is seen as a steadystate error to step inputs. This error arises because as the system approaches its tracking requirements, the feedback error signal which controls the 5
quantity value units R m 2.6 Ω L m 0.18 mh K b 0.00767 V/(rad/sec) K m 0.00767 Nm/amp K g 70 J m 0.387 μkg m 2 Table 1: Servo motor parameter values Figure 5: Servomotor nonlinearities input to the motor becomes so small that it cannot overcome the stiction. In this case, the step response may exhibit a steadystate error even though the linear motor model is a type I system. A typical response is depicted in figure 5. The second nonlinearity which will affect response is a motor velocity limit. If one increases the input voltage to the motor, its output velocity increases proportionately until magnetic field saturation occurs within the motor. The output velocity then remains essentially constant regardless of the voltage applied. In a feedback control system, this effect will appear if the control gains are too high. The effect is a damping of the step response, as depicted in figure 5. Large load inertias will magnify the velocity limit effect. The final nonlinearity is a characteristic of the amplifier used to supply power to the motor and is generally referred to as actuator saturation. This problem occurs when the requested input voltage to the motor exceeds the output limits of the amplifier; in this case, the amplifier output voltage will saturate at the voltage limit. Actuator saturation is almost always undesirable. It is a highly nonlinear effect which, at the least, degrades performance and can cause system instability. Control designs with high gains and large operating regions or fast response requirements are especially susceptible to this problem. Ball and Beam Dynamics A simplified diagram of the ball and beam geometry is shown in figure 6. The force equilibrium indicated by the freebody diagram yields the dynamical equation d 2 x dt 2 = 5 g sin(α) (5) 7 6
Figure 6: Ballbeamservo geometry which describes the motion of the center of mass of the ball. The beam angle α can be related to the motor angular position, θ l, using simple geometry: L sin(α) = r sin(θ l ) (6) where L and r are as indicated in figure 6. Note that a positive change in motor angle corresponds to clockwise rotation. The combined structure of the ball, beam and gears create the load inertia J l seen by the motor. The ball and beam parameters supplied by the manufacturer are listed in table 2 quantity value units L 43.18 cm r 2.54 cm g 9.8 m/s 2 J l 0.0029 Kg m 2 Table 2: Ball and beam parameter values Sensors There are two sensors used for feedback of ball position and motor angle. The sensor configurations are depicted in figure 7. angular position sensor The rotor of the servomotor is connected, via a 1 : 1 gear ratio, to the wiperarm of a biased potentiometer. Changes in rotor angular position correspond to changes in the potentiometer output voltage. The resulting sensor gain is supplied by the manufacturer as angular position sensor gain = 0.0284 V/deg The wiperarm voltage is connected to the A/D converter in parallel with a 1μF capacitor which filters noise generated by the resistor. 7
Figure 7: (a) Motor position sensor configuration (b) Ball position sensor configuration ball position sensor The ball position sensor is the ball and beam apparatus itself, which consists of a length of conductive plastic, a stainles steel shaft and the stainless steel ball. Placing the ball on the beam completes the circuit which consists of the indicated bias resistors and the conductive plastic between the ball and the and of the beam. As the ball moves, this length changes, modifying the series restistence and, hence, the voltage at the stainless steel shaft. The voltage is related to ball position via ball position sensor gain = 0.23 V/cm The ball position range is ±21.5cm. The shaft voltage is connected to the A/D converter in parallel with a 1μF capacitor which filters noise generated by the resistor. 8