Sei sulla pagina 1di 21

# ELECTRICAL ENGINEERING 4 LABORATORY

## DC SERVO CONTROL SYSTEM DESIGN

1
1.1

INTRODUCTION
Objective

The aim of this laboratory is to design and implement a DC servo control system. The control system is to meet a given set of specications and achieve a rise time which is as fast as possible. Each student will undertake laboratory preparation which will involve a dry run control system design using a given nominal transfer function. In the actual laboratory session, student groups will act as design teams competing with each other to produce the fastest servo system. First experiments will be undertaken to determine the actual transfer function of their servo system. Then the design will be carried out using ideas from the group members preparation. Students can use any design technique which they are familiar with to produce the controller design. Finally the design will be implemented and its performance evaluated. The laboratory including the preparation will be graded out of 100. There will be a prize of 20 bonus marks (up to a maximum of 100) for the group which meets all the specications and achieves the shortest rise time. To receive the bonus marks, the design and satisfaction of the specications together with the nal results must be fully documented.

1.2

Hardware Description

The hardware used in this laboratory experiment consists of the following: DVH-1000 Control System Module DVH-10 Power Amplier Comdyna 767 Interface unit A PC containing a dSPACE ds1102 board.

1.3

## Estimating the plant transfer function

A DC servo system such as can be found in the control laboratory can be modelled by a transfer function of the form a Y (s) = (1.1) Gam (s) = X (s) s(s + b) where a and b are parameters of the system; see Figure 1.1.

U(s)

a (s+b)
Figure 1.1: Transfer Function Model

Y(s)

Before, we can design a controller for the DC servo system, we must estimate the parameters a and b in the transfer function given in equation (1.1).

A general linear second order system can be described by the transfer function model
2 Y (s) n = 2 2 X (s) s + 2n s + n

(1.2)

where n is dened as the undamped natural frequency and is the system damping constant. For a unit step input X (s) = 1/s, taking the inverse Laplace Transform of equation (1.2) yields the unit step response y (t) y (t) = 1 en t 1 2 sin(n 1 2 t + tan1 1 2 ). (1.3)

## Also, the corresponding transient oscillation period is Tt = 2 . t

The expression for percentage overshoot (PO) is obtained by nding the rst time when y (t) = 0. Using this method, it can be shown that P O = 100exp and hence
O ln2 ( P 100 ) = O 2 ln2 ( P 100 ) +

1 2
1 2

(1.5)

## Also, it follows from (1.4) that n =

t 1 2

(1.6)

The percentage overshoot and the transient oscillation frequency are both quantities which can be easily determined from the system step response as shown in Figure 1.2. This gure also indicates the rise time of the system.

1.5

## rise time 10% 0 0 1 2 3 4 5 6 Time (secs) 7 8 9 10

Figure 1.2: System Step Response The approach to estimating the parameter a in transfer function (1.1) is to form a closedloop, feedback system around the DC servo motor. A proportional control system for the DC servo motor is illustrated in Figure 1.3, where Kc is the controller gain Vi

placements

e -

Kc

Kpa

Ks

Vo

+ Power Amp

Ks Kc KP A

= = =

## Potentiometer Scaling Controller Gain Power Amplier Gain.

In the block diagram shown in Figure 1.3, we now replace the DC servo motor system and its associated components by the corresponding transfer function. This leads to the block diagram shown in Figure 1.4. The closed loop transfer function for the system of Figure 1.4 is Y (s) Kc a = 2 . X (s) s + bs + Kc a (1.7)

Equating like coecients in equations (1.2) and (1.7) provides the following relationships: Kc a b = =
2 n

2n .

(1.8)

The procedure to estimate the a parameter value of the plant transfer function (1.1) is to determine the undamped natural frequency n and the system damping constant for the closed loop system in Figure 1.4.  - +  6 Kc -

Vi

a s(s+b)

X -

Figure 1.4: Closed Loop system From the step response of this system, the percentage overshoot and oscillation frequency can be obtain. From this, both n and can be estimated using equations (1.5) and (1.6). Then it follows from equation (1.8) that 2 (1.9) a= n. Kc Note that equation (1.8) could also be used to estimate the b parameter. However, a more reliable method is given below. The procedure for determining the b parameter is quite simple. It involves recording the output response of an open loop system driven by a step input. The block diagram of the open loop system conguration is illustrated in Figure 1.5. In order to estimate b, the step response is required. It follows from the transfer function (1.1) that the transfer function of the signal X of this system will be of the form (s)/Vi (s) = a X s+b where is a scaling constant dependent on the Tachometer gain. The time constant m of this to reach 62.3% of transfer function is then calculated to be the time required for the output X its nal value. This is illustrated in Figure 1.6. The b parameter is then obtained from the relationship 1 . (1.10) b= m 5

X Vi a s+b -

## Figure 1.5: Open Loop System

Step Response F

0.63F

Amplitude

Time Constant

0 0 1 2 3 4 5 6

Time (sec.)
Figure 1.6: Step Response of Open Loop System

## USING THE 767 CONTROL PANEL

The 767 control panel is used to interface to the DC servo system. The functions of the connections in this panel relevant to this experiment are given in Figures 6

## 2.1 and 2.2

SYMBOL + COLOUR CODE Orange DESCRIPTION +10 Volts reference

Yellow

Green

## Power amplifier input

Do not ever connect anything to this red connector (if you have one) It can be at a high voltage which can damage the dSPACE board.

SYMBOL Voltage

COLOUR CODE

## White Current Norm Zero Max

Grey

Enables calibration through the power amplifier. Norm gives the green patch panel input, Zero gives zero volts and Max gives +10 volts.

ON

Red

## Disconnects the power amplifier from the load

OFF

H M L

Yellow

Senosr input gain selections; H is unity gain M is middle gain selection, L is the greatest gain

Knob

## Adjust sensor output to zero.

Knob

Figure 2.2: 767 Control Panel Functions (Continued) The Power amplier mode switch should be set to voltage mode throughout the experiment. The power amplier calibration switch should be set on norm throughout the experiment. The power amplier load switch should be set on o while a circuit is being wired up and then set to on when the circuit is ready for operation. The sensor gain selection switches should be set to H to give unity gain. The sensor gain knobs should be set to maximum. The position sensor zero knob should be set to give zero output when the load angle is zero degrees. The velocity sensor zero knob should be set to give zero output when the load is stationary.

## USING THE dSPACE SYSTEM

The dSPACE system is high performance digital control system based on the TI TMS320C31 DSP processor. It is directly interfaced with MATLAB/SIMULINK running on a PC. A simulink block diagram is converted to real time C code, cross compiled and downloaded to the DSP board. Software is also available for controlling the DSP from the PC and plotting variables in real time in the DSP. In this laboratory, you will familiarize yourself with some of the capabilities of the dSPACE system including the implementation of transfer functions and the ability to provide step inputs and to plot the resulting step responses of the systems under consideration. Each of the four IBM PCs in the control lab contains a dSPACE ds1102 DSP board. This board can be connected to the outside world via a connector box. The rst step in using the dSPACE system involves logging on to the PC. You should use the username student and the password Eleceng1. All of the les that you generate during the course of the laboratory should be stored in the directory C:\MATLABR11\work\student Do not create any other les or directories on the PC. Also, you should remove your les in the above mentioned directory after the end of the laboratory period. The demonstrator will check the PCs after the end of the laboratory and if you do not leave the PC in the condition you found it, all members of your group may lose marks from their nal lab grade.

3.1

## Creating a dSPACE Block Diagram

We now present a case study of using the dSPACE system. The implementation of this case study is not part of the laboratory but should give you an idea as to how to carry out the actual laboratory. In order to use the dSPACE system, you must construct block diagrams on MATLAB/SIMULINK and run them on your dSPACE board. After you log onto the PC, run MATLAB as follows: Start Programs Matlab Matlab 5.3 Run simulink and create a block diagram which you wish to implement on dSPACE; e.g., see below:

1 s Integrator

1 s Integrator1

1 Gain

DS1102DAC

1 Gain1

3.2

## The ControlDesk Package

This is a powerful dSPACE software package used to interact with the program you have running on the dSPACE DSP board. In particular, it is used to change parameters in the model and to plot variables and signals in the DSP.

10

11

Figure 3.2: ControlDesk Window As illustrated in this diagram, the main window contains a number of elements: Navigator. The Navigator panel provides access to the dierent parts of a real-time experiment. These are, the Hardware View, the Experiment View and the Instrument View. The current view is controlled by the tabs at the bottom of the Navigator panel. Menu Bar. These menus allow for the various commands to be given to ControlDesk. The menus are dynamic and depend on the view and element selected in the Navigator. Tool Bars. These provide quick ways of giving ControlDesk commands rather than using the menus. The tool bars can be turned on or o. Tool Window. This window is used for various tools controlling the experiment depending on the view chosen from the Navigator. Most commonly used is the variable manager which enables the selection variables from a simulink model. Working Area. This is the area in which a ControlDesk instrument layout is constructed and used. Status Bar This displays some information about the state of the ControlDesk system. We now outline how to create a simple experiment which is based on the simulink block diagram above. The aim of this experiment is to display the output signals for this system using 12

13

14

>> load output >> plot(trace_x,trace_y),xlabel(trace_x_n),ylabel(trace_y_n) This plot can then be printed if required. (Before printing, be sure to choose matlab print setup and set the paper type to A4. If you dont do this, you will need to press shift continue on the printer to obtain the plot.) Our nal step in this example will be to add a gauge to our layout which displays the program turnaround time. With the layout in edit mode, click on the virtual instrument button in the virtual instruments panel and then click on the Gauge icon. Then draw a suitable size rectangle in the layout panel for the gauge. A gauge should appear in the layout. To get this gauge to display the turnaround time, click on the Timer Task 1 item in the Tool Window. The variable panel should then display various variables associated with the program running on the DSP board. Drag and drop the turnaroundTime item onto the gauge instrument in the layout panel. The gauge should now be labelled turnaroundTime. Right click on the gauge instrument and choose properties. Then click the gauge tab. Adjust the stop value to 100e-6. Then click on the Tics tab and adjust the Delta to 25e-6. Restarting the animation, this gauge should now display the turnaroundTime in micro seconds. This completes our layout for this experiment. The layout can be added to the experiment by right clicking on the layout panel and then choosing Add layout to Experiment (This will also ask you to save your layout which you should do). A new Instrumentation element should appear in your experiment listing which contains the corresponding layout le. The nal ControlDesk window should look something like the following:

15

3.3

## Using dSPACE to nd a Step Response

The best way to use the dSPACE system to construct a step response is to add a constant block to your simulink block diagram which will provide the step input. Then use the ControlDesk package to control the step and view the resulting step response using a plotter instrument. To provide the step input, we do NOT use the standard simulink step block. (The step would be over before we had time to set things up). Rather we add a Constant block whose value will be adjusted by ControlDesk to provide the step input at the required time. Also, the ADC and DAC blocks can be removed. For the above example, this leads to the following simulink block diagram.

16

0 Constant

1 s Integrator

1 s Integrator1

1 Gain

1 Gain1
Figure 3.4: Simulink block diagram for step response Compile the system as normally. Return to ControlDesk and close any old experiments. Open a new experiment and give it a suitable name. As described in the previous example, add the hardware conguration and .trc le to this experiment. Create a new layout (or modify the existing layout) as follows:

17

Figure 3.5: Instrument layout for step response In this instrument layout, the plotted signal is the output of the system B:Integrator1. Also, plotted on the same graph is input to the system B:Constant. This is achieved by dragging both of these variables to the Y-axis of the plot. The capture instrument is set as above. In this case, the trigger variable is the step input signal B:Constant. The time interval is 10sec and a factor of 10 down sampling is used to ensure the DSP does not run out of memory with this long time interval. Triggering is set up as above. Also, the data can be saved to a le and loaded into matlab as above. A step input is achieved by using an On/O button to control the constant block in the simulink block diagram. A suitable On/O button can be obtained as one of the options in the RadioButton Instrument. To achieve a step input, the constant value parameter variable P: Constant Value is dragged to the On/O button in the layout. Also, the properties of this instrument are set so that its form is as shown above and the On value is set to the size of the required step and the O value is zero. The above layout also includes two Display instruments. One displays the input variable B: Constant and the other displays the output variable B: Integrator1 To use this ControlDesk experiment, the layout should be put in animation mode and then the constant value set from o to on. This should trigger the data capture and produce the resulting step response. The parameters of this step response such as percentage overshoot, rise time and transient oscillation period can be measured using the cursor feature of the plotter instrument.

18

The above procedure can be used to plot the step response of any physical system connected to the dSPACE board. Connect the input of the system to a DAC channel (Vout(1) in the connector box) and connect the output of the physical system to an ADC channel (Vin(1) in the connector box). Construct a simulink block diagram as shown below

0 Constant

## DAC #1 DAC #2 DAC #3 DAC #4

1 Output

DS1102DAC

Figure 3.6: Physical system step response Compile the system and obtain the step response using ControlDesk as above.

Specications

In this laboratory, you must design a controller for the DC servo system of the form shown in Figure 4.1.

## Ref Input Controller H(s) + Plant G(s)

Shaft angle

Figure 4.1: Block diagram of DC servo system The DC servo control system must meet the following specications: (i) Based on your identied plant transfer function, your controller should achieve a Gain Margin of at least 6dB to both gain increase and gain decrease. It should also achieve a Phase Margin of at least 30 to both phase advance and phase lag. 19

(ii) For a step change in the reference input of 20 , your control system should have an overshoot of at most 4 (20%). (iii) In addition to meeting all of the above specications, your control system should achieve the shortest possible rise time for a step change in the reference input of 20 .

Laboratory Preparation