You are on page 1of 7

ENGN3223 & ENGN6223 Control Systems Hardware Labs HLAB1 Identication and Control of a Grey Box System: System

Response of a Passive RC Circuit Duration: 1 lab session

Aim
1. To gain experience in modeling of physical hardware. 2. To develop skills in using Matlab and Simulink for system identication and control.

Resources
1. Simulink RTwin intro.pdf 2. Fun with RTwin.pdf 3. One-shot-ID.pdf

Introduction

A black box identication problem is one where the control engineer has no information at all regarding the physical nature of the system considered. A grey box identication problem is one in which some physical information is available that allows the engineer to have an idea of what to expect in the system response and considerably simplies the identication procedure. In this laboratory you will have the circuit diagram of the underlying system available without knowledge of the component parameters. The grey box nature of the identication problem should not be confused with the colour of the box containing the circuit, which is black. Each group should have a (black) grey box passive network for testing, a computer with an A/D board installed along with its drivers, MATLAB, the control toolbox, Simulink, Real-Time Workshop (RTW) and Real-Time Target. In addition, you should have a copy of the Simulink and RT-Windows overview and the Fun with RT Windows document.

Preparation

Consider the following circuit diagram the grey box passive network. Consider the following circuit diagram forfor the grey box passive network.

Question 1: Consider the circuit obtained by grounding terminal D, connecting a driving voltage V0 to terminal B and measuring a voltage Vd (to ground) at terminal C. This 4arrangement of the circuit will be termed the BCD conguration. Other congurations Preparation will be labelled using the same conventions. The 1: Consider the resistors and capacitors in the circuit are connecting a driving Questionexact values of thecircuit obtained by grounding terminal D,unknown, however, it is possible to compute B and measuring the system (to ground) at terminal C. This voltage V0 to terminal a generic model for a voltage Vand use this physical understanding to provide template for will be termed the that conguration. Other experimental arrangementaof the circuit the transfer function BCDmust be identied usingcongurations data. will be labelled using the same conventions. The exact values of the resistors and capacitors in the circuit are unknown, however, it 1. Compute the transfer function for the BCD circuit conguration from driving voltage is possible to compute a generic model for the system and use this physical understanding V0 to measured voltage Vd . to provide a template for the transfer function that must be identied using experimental data.2. Compute the DC-gain K and time-constant of the transfer function in terms of the physical parameters R1 , R2 , C2 and write the function in terms of these parameters. 1. Compute the transfer function for the BCD circuit conguration from driving voltage 3. Imagine a voltage step V . V0 to measured voltage input to the circuit d V0 = Ru(t) 2. Compute the DC-gain K and time-constant of the transfer function in terms of the physical R > 0 is the value 2 , C2 and write theand u(t) isin terms of theseCompute the where parameters R1 , R of the new voltage function the step-input. parameters. expected output Vd (t) of the measured voltage as function of the parameters. 3. Imagine a voltage step-input to the circuit Question 2: A rst order, proper, stable system has a transfer function of the form V0 = Ru(t) K H(s) = where R > 0 is the value of the new voltage + 1) u(t) is the step-input. Compute the (s and expected output Vd (t) of the measured voltage as function of the parameters . 2

Control Systems

oratory 2: nd Control of Electrical Circuit: the constant > 0 is termed the time-constant. The constant K is termed the gain, while of a PassiveConsider the situation where the time response y(t) is measured in an experiment and RC-circuit
it is wished to determine the parameters K and from this data.

1. Compute and has the information at all here the control engineer sketch no time response to a unit step input. 2. Show that the DC-gain can be measured from the idered. A grey box identificationKproblem is one in time response y(t) by evaluating that allows thethe limiting valuehave an tidea of what to engineer to of y(t) as . 3. Compute the derivative ably simplifies the identification procedure. In this d B = y(t) ram of the underlying system available without. dt t=0 he `grey box' nature of the identification problem = 0 on your sketch of the output. Draw the tangent to the data y(t) at the point t he box containing the circuit, equation for the tangent ylinear(t). Calculate the time T at which Compute the linear which is black. Each the linear tangent reaches the DC-gain board network for testing, a computer with an A/Dof the system ylinear(T ) = K. Use this to propose a method to calculate the time constant from the data y(t). he control toolbox, Simulink, Real-Time Workshop 4. For value t compute the value of y(t) you should have athe a method the Simulink and RT-forfrom the data y(t). Use this to copy of= to calculate the time constant any given time t. propose

Laboratory

5.1 Parameter identication using step responses Step-Responses


5.1.1 First order system (BCD circuit)

t)

Recall the RC circuit diagram for the grey box passive network:

or the grey box

rget environment de in Windows ing input signals

e a step function ue output. a sample time of

3 rom the D/A-board to terminal B and connect the

connect to target and run the simulation.

The MATLAB Simulink and Real-Time target environment (which enables running the compiled code in a Windows environment) provide a method of generating input signals and logging output data. 1. Open a new Simulink model and wire a step function block with 5V amplitude to an analogue output. 2. Congure the Simulink blocks. Use a sample time of 10-4s (0.1ms). 3. Wire the relevant analogue output from the D/A-board to terminal B, the analogue input to terminal C, and connect the ground to terminal D. 4. In Simulink/RTW build your model, connect to target and run the simulation. 5. You will need to alter the time range parameter in the scope settings to display the data in real time. To obtain a clean plot of the output in real-time you also need to modify the trigger options. Read the relevant section of Simulink and RT-Windows overview to see how to do this. 6. Run an experiment and log data to the MATLAB workspace. This can be done by setting the parameters of the scope to save the data to the MATLAB workspace. 7. In the MATLAB workspace use the plot command to produce a plot of the system step response. Use the MATLAB plot tools to annotate the plot to aid identication of the system parameters. Use the command ginput to obtain parameter estimates directly in the MATLAB workspace and make accurate calculations. 8. Consider the output trace in detail. Make an estimate of the noise component of the signal and what are its sources (e.g. mains hum, quantisation error, etc.). Measure the time-lag in the output trace compared to the input step, based on this make an educated guess on the way in which RTWIN handles the input-output routine in its simulation environment. 9. Design and run an experiment to verify the dynamic parameters that you have identied for your system. Using the SIMULINK continuous block-set, wire in a plant model based on your identied parameters in parallel to the real world system. (Note: see the Fun with RT Windows document for the appropriate RT Windows parameter settings). Display the output of the simulated and real systems on the same graph. Separately display the identication error by subtracting the two signals. Adjust your plant estimates until you have obtained a good identication of the system. 5.1.2 Second order system (BDE circuit)

In this experiment we will investigate the BDE conguration as a second-order system. The system has two poles and one zero.

1. Wire the relevant analogue output from the D/A-board to terminal B, the analogue input to terminal D, and connect the ground to terminal E. 2. In Simulink, build your model, connect to target and run the simulation. 3. Log data from a step response and make an estimate of the DC-gain and timeconstants of the system. 4. Verify the system model that you have identied using the MATLAB control tool box functions.

5.2

Feedback control for BCD circuit

For the BCD circuit, design a proportional feedback controller with gain K to guarantee a 10% steady-state error. 1. For classical proportional feedback architecture calculate, the steady-state DC-response of the BCD circuit in feedback with a compensator gain of K. Compute a value of the gain K to guarantee a relative tracking error of 0.5 volts (10%) for inputs up to 5V. 2. Wire the BCD circuit into an input/output conguration with SIMULINK and wire up a classical proportional feedback loop around the circuit response. Set the gain as specied and choose a reference signal r(t) as a square wave of 5V. Verify the performance of your control design. 3. Compute the control gains necessary (using a proportional feedback compensator) to achieve a tracking error of 0.1V and 0.01V respectively for an input of 5V. Implement the control design and verify the performance of your algorithm.

Appendix: Identication from step response


1. For a rst order system G(s) = K . s + 1

Appendix:

Identification from Step-response

irst-order system,

KCollege of Engineering and Computer Science (CECS) s# ! 1 Appendix: he system gain K Identification from Step-response can be measured om A and R as shown in the figure as A K" R a first-order system, ime constant # can also be measured K irectly from the figure. The systemG ( s ) " s# ! 1 pole -1/# The system gain K can be measured from A and R as shown in the figure as A K" R Time constant # can also be measured directly from the figure. The system pole econd-order system, (a) The system gain K can be measured from A and R as shown in the gure as is -1/# A K ( s$ ! 1) K= . G ( s) " R ( s# 1 ! 1)( s# 2 ! 1) G ( s) "

ian National University

(b) The time constant can also be measured directly from the gure. The system he system gain K can be pole is 1 . measured om A and R as shown in the figure as a second-order system, For a second order system A K " 2. R K(s + 1) ime constant #1 of the slow G ( s ) " pole can K ( s$ ! 1) G(s) = . (s (s1 + 1)(s2 + 1) e measured directly from the slow# 1 ! 1)( s# 2 ! 1) esponse in the figure. The system pole The system gain K can be measured at -1/#1. from A and # as shown in the figure as ime constantR 2 of the fast pole can be measured from the " A response in the K fast R gure. The system pole is at -1/#2. Time constant # of the zero can can he time constant1 for the slow pole be be measured directly stimated from the graph from the slow response in the figure. The system pole B $ " (# 1 % # 2 ) ! # 2 is at -1/#1. A Time constant #2 of the fast pole can be measured from the fast response in the figure. The system pole is at -1/#2. The time constant for the zero can be estimated from the graph B $ " (# 13/3 (a) The system % # 2 ) ! # 2can be measured from Control Systems shown in the gure as gain K A and R as 3 A K= A . R

6
3/3 Control Systems

223

(b) The time constant 1 of the slow pole can be measured directly from the slow response in the gure. The system pole is at 11 . (c) The time constant 2 of the fast pole can be measured from the fast response in the gure. The system pole is at 12 . (d) The time constant for the zero can be estimated from the graph as = B (1 2 ) + 2 . A

You might also like