Contents EE 474 Lab Part 2: Open-Loop and Closed-Loop Control (Velocity Servo) 1 Introduction 1 1.1 Discovery learning in the Controls Teaching Laboratory.............. 1 1.2 A Laboratory Notebook............................... 2 2 Prelab 2 2.1 Goals of Lab 2.................................... 2 2.2 Writeup for the prelab................................ 3 2.3 Introducing open and closed-loop control...................... 3 2.3.1 Open-loop control.............................. 3 2.3.2 Closed-loop control............................. 4 2.4 Determining DC gain and designing open-loop control............... 5 2.5 Open-loop controller design............................. 6 2.6 Designing P-type closed-loop control........................ 6 2.7 Designing P-type closed-loop control with feed forward............... 7 1 Introduction 1.1 Discovery learning in the Controls Teaching Laboratory The Controls Teaching Laboratory sequence of six laboratory exercises is designed to maximize discovery learning. Toward this objective, the laboratory handouts, starting with this one, become progressively more open ended. In the section below, the laboratory goals are spelled out with some detail and some guidance on carrying out the measurements, controller design and evaluation. In the succeeding Labs, the description of goals becomes successively broader and the quantity of detail will be progressively reduced, giving the student progressively more freedom in designing the details of measurement, analysis, design and testing for each lab. The fifth laboratory handout is only 3 pages long! Here are some suggestions Think through the goals and how the tools can be used to reach them. Its no crime to go down the wrong path, and start over (but good to figure it out sooner, rather than later). Ask questions! EE-474 Lab Part 2: Open-Loop and Closed-Loop Control (Revised: Sep 25, 2017) Page 2-1
1.2 A Laboratory Notebook In lab you will need a laboratory notebook and graph paper. In EE-474 Lab you will be doing five laboratory exercises. Each exercise builds on those previous, and you will need good notes of what you have already done. Each laboratory group will need a laboratory notebook. The notebook must be on hand for the first laboratory experiment, to record calibrations and measurements taken. The appropriate standard for a professional engineers notebook is sufficient explanation of what was done and what was used to reproduce the situation, and sufficient detail of observations and measurements to accurately reconstruct what happened. You will be surprised as you enter professional practice how often in real life things are not completely understood the first time around. Questions come up after a piece of equipment has left the shop floor, and notes which permit reconstructing something unanticipated at the time the observations were made will have a value beyond their measure. 2 Prelab 2.1 Goals of Lab 2 The goals of lab 2are to do these things: 1. Learn to use the Quanser Hardware In the Loop (HIL) tools in Simulink. Open, modify and run model EE474_Lab01_Model01.mdl Observe command voltage and sensor values with Scope blocks Utilize and save data recorded to the Matlab workspace 2. Characterize the performance of the three sensors on the SRV02 3. Calibrate each of the three sensors on the SRV02 4. Determine the linearized model of the SRV02, by measuring the steady-state velocity as a function of applied voltage, to develop data comparable to that of figure 4, setting an operating point, and determining the DC Gain K uv. 5. Design open and closed-loop controllers for the SRV02, test these with respect to square wave tracking. The materials related to goals 1, 2 and 3 are addressed in the EE 474 Lab Reference Manual. Read the reference manual and answer the prelab questions given there, before proceeding with the items here. EE-474 Lab Part 2: Open-Loop and Closed-Loop Control (Revised: Sep 25, 2017) Page 2-2
2.2 Writeup for the prelab 1. Answer the prelab questions found at the end of the Reference Manual, which address material in the reference manual. 2. Answer questions included in this section, in subsections 2.3 to 2.7. 2.3 Introducing open and closed-loop control Controllers generate and send a command signal regulates equipment or a process. Examples are industrial process controls, vehicle control, such as car cruise control or a flight autopilot, or regulation of robot motions. Controllers can be classified into two groups: open and closed-loop control. 2.3.1 Open-loop control Open-loop control is characterized by the absence of a feedback path, that is, the absence of a signaling pathway for the output signal to affect the input. An open-loop control system is illustrated in figure 1. d(t) r(t) Open-Loop Control Law u c (t) u(t) Plant y(t) u(t) = b 0 b 1 r(t) G uv (s) Figure 1: Open-loop velocity control with disturbance input. An example system that can be operated with open-loop control is the SRV02 motor servo, seen in figure 2. Considering this example, G uv (s) is the transfer function model for the motor servo from voltage input to velocity output. The signals of the system in figure 1 are listed in table 1. r(t) reference input, [radians/second] u c (t) motor command (controller output), [volts] d(t) u(t) y(t) disturbance input (shown in parallel with the motor command), [volts-equivalent] Total effective command to the motor [volts] system output, [radians/second] Table 1: Definitions of signals in figure 1. Transfer function G uv (s) is the model of the SRV02 that is the basis for controller design. Since we are considering the velocity of the output, the transfer function has units of radians per second EE-474 Lab Part 2: Open-Loop and Closed-Loop Control (Revised: Sep 25, 2017) Page 2-3
Figure 2: Quanser SRV02 motor servo. of rotation speed per applied volt, G uv (s) : [ ] radians/sec = volt [ ] radians. volt-second 2.3.2 Closed-loop control A closed-loop controller is characterized by the utilization of feedback, that is, a pathway for the output signal to affect the input. An closed-loop control system is illustrated in figure 3. The additional signals of the system in figure 3 are listed in table 2. r(t) e(t) Closed-Loop Control Law u c (t) u(t) Plant y(t) G c (s) G uv (s) - P-type control: u(t) = K p e(t) n(t) y s (t) d(t) Figure 3: Closed-loop velocity control with velocity sensing and disturbance input. e(t) the error signal, it is the difference between r(t) and y(t), [radians/second] n(t) sensor noise signal, [radians/second] y s (t) sensed velocity signal, [radians/second] Table 2: Signals added for the closed-loop system. EE-474 Lab Part 2: Open-Loop and Closed-Loop Control (Revised: Sep 25, 2017) Page 2-4
In lab 2 you will approximate the plant model G uv (s) with a constant: G uv (s) = K uv (1) where K uv is the DC gain of the motor servo. You will identify (measure) K uv and design open-loop and closed-loop controllers to cause the motor output y(t) to track the reference input r(t). And evaluate the performance of your controllers for a step input. 2.4 Determining DC gain and designing open-loop control Velocity versus applied voltage data for one possible motor servo are seen in figure 4. These data show velocity to be a nearly linear function of voltage, except near zero volts where motor friction introduces a nonlinearity. The DC gain of the system for variations in velocity about an operating point of 12.5 [rad/sec] can be determined from the slope of the input-output function at the operating point. The slope is seen to be 7.25 [rad/sec/volt] in figure 4. 20 15 12.5 10 5 0 5 Measured Velocity [rad/sec] 10 Fit Curve Operating Point 1.0 7.25 1.86 Nonlinearity 15 20 2.5 2 1.5 1 0.5 0 0.5 1 1.5 2 2.5 Applied Voltage Figure 4: A plot of measured velocity as a function of applied voltage. The points mark the data points, the curves are lines fit through the data points. EE-474 Lab Part 2: Open-Loop and Closed-Loop Control (Revised: Sep 25, 2017) Page 2-5
2.5 Open-loop controller design An open-loop controller is seen in figure 1. Starting with the modeling equations y(t) y 0 K uv δu(t) (2) δu(t) = u(t) u 0 (3) and adding the control law u(t) = b 0 b 1 r(t) (4) an open-loop controller can be found according to b 1 = 1 K uv (5) b 0 = u 0 b 1 y 0 (6) Question 1. What are the units of b 0 and b 1? Show that the units in equation (4) balance. Question 2. Starting with modeling equations (2) and (3), and control law (4), show mathematically that design equations (5) and (6) would give perfect tracking (that is, y(t) = r(t)) if the model is perfect and there are no disturbances. Question 3. Determine the open-loop gains, b 0 and b 1, for the system associated with the data of figure 4 using an operating point of y 0 =12.5 [rad/sec]. Determine the applied voltage when r(t) = 10:0 [rad/sec]. 2.6 Designing P-type closed-loop control In a closed-loop controller, such as seen in figure 3, the control law is the function that computes the control signal based on an error signal. Writing in the most general form, we may write the control law as u(t) = g c (e(t)) (7) where g c ( )is a function. For what is known as proportional-type or P-type control (used in many simple applications) the control effort is given as u(t) = K p e(t) (8) where K p is the controller proportional gain constant. EE-474 Lab Part 2: Open-Loop and Closed-Loop Control (Revised: Sep 25, 2017) Page 2-6
The loop gain of a servo system is the product of the gains of all of the blocks in the feedback loop. Approximating the plant transfer function by its DC gain (the simplest approximation to the actual transfer function): G p (s) = K uv (9) then the loop gain is given as the product G loop (s) = G c (s) G p (s) = K p K uv. (10) where G c (s) = K p is the transfer function of a P-type controller. Turning around equation (10) gives an equation for designing P-type closed-loop control: K p = K loop K uv (11) where K loop is the DC value of the loop gain G loop (s). Question 4. For the system of figure 3 and data given in figure 4, determine K p to give a loop gain of 10.0. Determine the applied voltage when r(t) = 10:0 [rad/sec] and y(t) = 9:0 [rad/sec]. 2.7 Designing P-type closed-loop control with feed forward Equation (4) is an example of a feed-forward control term; it is a calculation of the control effort based on the reference signal r(t). Equation (8) is an example of a feedback control term; it is a calculation of control effort based on the measured output of the system y(t). Feedback control is widely used in practice, because of its ability to correct for errors. In some controllers a feed-forward term is added to the control law, to reduce the errors that require correction. The control law for P-type closed-loop control with feed forward may be written: u(t) = b 0 b 1 r(t)k p e(t) (12) QuestionCap Draw the block diagram for a system with control law (12). Using the controller parameters determined in steps 3 and 4 in equation (12), calculate the applied motor voltage when r(t) = 10:0 and y(t) = 9:0 [rad/sec]. EE-474 Lab Part 2: Open-Loop and Closed-Loop Control (Revised: Sep 25, 2017) Page 2-7