Summary The first week of this lab takes the steps toward building and demonstrating open loop control of an analog meter needle position. A first step is learning about and using LabVIEW vision tools for acquiring and processing images. A vision-based position sensing system is developed and used to measure the needle position. A second week s lab focus is to study the closedloop control of the analog meter needle position using the vision-based measurement for feedback.
Building a Model of the Meter In pre-lab/hw you will study a model of the meter movement This model represents a plant in a feedback control system as shown below. In a standard feedback control diagram, the controller output for this case is the EM torque applied on the moving coil. Disturbances are unknown torque loads on the needle and/or coil. Reference Signal + Error Signal Controller Disturbance + + Plant System to be controlled Output Feedback Signal LabVIEW based control Sensor In an open-loop case, the controller does not use the error signal to direct its action on the plant. Instead, knowledge about the response is used to specify the voltage as shown earlier.
As long as there are no physical changes, the needle position will respond in the manner intended by the design calculations. This is an open-loop control system design. Vin Analog Meter θ We now think of this as a system that we are trying to control precisely, and consider that there could be changes or disturbances that were not accounted for in the design. One advantage of using a closed-loop control system is to take advantage of the benefits of feedback.
First, however, we ll study the input-output relation for this system, and set up a measurement system that provides a measure of θ The meter as a system under study: Vin Analog Meter θ We want to verify the meter model that relates position to the input voltage a transfer function. For our study, all measurement and control is conducted using: (a) LabVIEW-based vision to measure position, θ, and (b) DAQ analog output* (AO) to provide the excitation voltage. *It is an advantage of this small lab system that the DAQ output is sufficient to drive our actuator no amplifier is needed.
Finding the angle using measured object positions ( ) x0, y 0 c ( x, y ) v v Use the IMAQ Count Objects 2 VI to find the vertex and the position at zero. a θ b This allows you to measure r (in pixels) from, ( x, y ) v v r = ( x x ) + ( y y ) 2 2 2 v 0 v 0 Then each new measured object position (x,y) can be used to determine the 2 2 2 angle, θ, by using the law of cosines, since a = b = r, and, Specifically, c = ( x x ) + ( y y ) 2 2 2 0 0 2 2 2 c 2r 2r cosθ =, so, c = a + b 2abcos θ, 2 1 c 2 θ = cos 1. 2r
θ IMAQ Count Objects 2 The vertex (x,y) value can be measured by placing the cursor at the pivot in the captured image, and reading the pixel values. The zero values should be read as the measured position for a zero input voltage.
A LabVIEW VI to measure the relationship between input voltage and needle position bob This VI uses vision to measure the meter position and controls a D/A to apply a specified DC voltage. This control is used to specify the analog out voltage so you can control the needle position. The needle length is also estimated in pixel units.
Example: Building a linear static model no dynamics A linear regression is shown, giving a model, θ = K V K m θ / v in / = 15.9 deg/v x v V = K θ in, OL x/ v d For this example, V in,ol is the input voltage you d need to dial in to position the needle at a desired angular position, θ d. We could define the open-loop gain for this case as, K 1 v/ θ = Kθ / v = 0.063 V/deg
A simple open loop control system for positioning the needle bob at a given angular location can then be formulated as follows: 1. Specify a desired angular position, θ d. 2. Use the static model to compute the open loop control voltage, V = K θ θ in, OL v/ d 3. Send this voltage command to an analog output VI in LabVIEW 4. Measure the actual position of the needle bob center using USB vision measurement. The following data was obtained for a few simple trials: These quick tests show that you can get reasonable results, but it s hard to judge whether you could position any better.
Open loop control positioning specify a path A formula node can be used to create a desired trajectory. Below is a graph of the desired trajectory and the measured open loop response. Absolute error is especially large during dynamic response. qd is the desired angle T is a period parameter t is the time value Note, this uses an open loop control model to specify the voltage command to be generated by the AO device.