Вы находитесь на странице: 1из 52
FACULTY OF ENGINEERING AND APPLIED SCIENCE ENGR/MECE 3350U Control Systems Laboratory Manual Fall 2014 Supported

FACULTY OF ENGINEERING AND APPLIED SCIENCE

ENGR/MECE 3350U

Control Systems Laboratory Manual

Fall 2014

Supported by

AND APPLIED SCIENCE ENGR/MECE 3350U Control Systems Laboratory Manual Fall 2014 Supported by Revised by Cliff

Revised by Cliff Chan

FACULTY OF ENGINEERING AND APPLIED SCIENCE Lab 1: Motor Static Relationship and Motor Parameter Estimation

FACULTY OF ENGINEERING AND APPLIED SCIENCE

Lab 1: Motor Static Relationship and Motor Parameter Estimation

Page 2 of 12

1.

Laboratory Objectives

The objective of this laboratory is to develop your understanding of modeling for control design and to practice modeling skills using the DC Motor Control Trainer. In particular, you will have to:

practice the first principle of the system modeling,

determine the system parameters by experimental tests, and

develop an insight into the linear and nonlinear aspects of the model.

2. Preparation and Pre-Requisition

Before proceeding, you should first review the modeling section of your textbook. A brief summary is given in Section 3. You should also review the following material from the courses in mechanics and physics, which you have already had:

Calculation of moments of inertia;

Basic Newtonian mechanics;

Forces on a conductors in a magnetic field;

Voltage generated in a conductor that moves in a magnetic field.

3. Introduction

Modeling is an essential aspect of the control system study. The key elements of modeling are briefly outlined as:

Get an overview of the system and get familiar with its components.

Understand the physics of the system and how the system works.

First principles involving in component modeling.

Modeling from the experimental tests — Parameter Estimation.

Disturbances applied to the system.

Model uncertainty.

Model validation.

Page 3 of 12

An overview of the system can be obtained by the pictures, schematic diagrams, and the

block diagrams. This gives the representations of a system, which emphasizes the aspects

of the system that are relevant for the control and suppresses many details. The work is

guided by focusing on the variables that are of primary interest for control.

The block diagram presents a natural partition of the system. The mathematical

descriptions of the behavior of the subsystems representing each block are necessary to

have a complete model. In control it is often sufficient to work with the linearized models,

where the dynamics are represented by the transfer functions. These transfer functions can

be obtained from the first principles by applying the basic physical laws that describe the

subsystems or by experiments on a real system. First principle modeling always requires a

good knowledge of the physical phenomena involved and a good sense for reasonable

approximations.

Experiments on the actual physical system are good complements to the first principles of

system modeling. This can also be used when the knowledge required for first principles

modeling is not available.

It is a good practice to start the experiments by first determining the static input-output

characteristics of the actual system. For the systems with several inputs (Multi-Inputs as

for the case of the motor in the DCMCT) one can often obtain an additional insight to the

dynamics of the system by exploiting all the input signals.

4. Nomenclature

The following list of nomenclature, as described in Table 1.1, is used for the modeling of an open-loop control system.

Page 4 of 12

Table 1.1: Open-Loop System Nomenclatures

Symbol

Description

Unit

ω m

Motor speed which can be computed from the motor angle

rad/s

Vm

Voltage from the amplifier which drives the motor

V

Td

Disturbance torque externally applied to the inertial load

N.m

Tm

Torque generated by the motor

N.m

Im

Motor Armature Current

A

km

Motor Torque Constant

N.m/A

Rm

Motor Armature Resistance

Lm

Motor Armature Inductance

mH

Jm

Moment Of Inertia Of Motor Rotor

kg.m2

J 1

Moment Of Inertia Of Inertial Load

kg.m2

Jeq

Total Moment Of Inertia Of Motor Rotor And The Load

kg.m2

K

Open-Loop Steady-State Gain

rad/(V.s)

τ

Open-Loop Time Constant

s

M 1

Inertial Load Disc Mass

kg

r 1

Inertial Load Disc Radius

mH

h

Sampling Interval

s

s

laplace Operator

rad/s

t

Continuous Time

s

5. Laboratory Session

5.1. QICii Modeling Module

The main tool for this laboratory experiment is the front panel of the module entitled Modeling in the QICii software, which should be similar to the one shown in Figure 1.1.

As a quick module description, Table 1.2 lists and also describes the main elements composing the QICii Modeling module user interface. Every element is uniquely identified through an ID number and located in Figure 1.1.

Page 5 of 12

Figure 1.1: Modeling Module of the QICii Software Table 1.2: QICii Modeling Module Nomenclatures ID#

Figure 1.1: Modeling Module of the QICii Software

Table 1.2: QICii Modeling Module Nomenclatures

ID#

Label

1

Speed

2

Current

3

Voltage

4

Signal

Generator

5

Amplitude

6

Frequency

7

Offset

8

Speed

9

Voltage

10

K

11

τ

12

Tf

Parameter

ω m

I m

V m

ω m

V m

K

Tf

Description

Motor Output Speed Numeric Display

Motor Armature Current Numeric Display

Motor Input Voltage Numeric Display

Type of Generator For The Input Voltage Signal

Generated Signal

Amplitude Input Box

Generated Signal Frequency Input Box Generated Signal Offset Input Box Scope With Actual (in red) and Simulated (in blue) Motor Speeds

Unit

Rad/s

A

V

V

Hz

V

rad/s

Scope With Applied Motor Voltage(red)

V

Motor Model Steady-State Gain Input Box

rad/(V.s)

Motor Model Time Constant Input Box

s

Time Constant of Filter for Measured Signal

s

Page 6 of 12

The Modeling Module program runs the process in the open-loop condition by utilizing the motor voltage given by the signal generator. There are two windows that show the time histories of the motor speed and the motor voltage, respectively.

A simulation study of the system runs in parallel with the hardware. The output of the simulation study can be used for the model fitting and the parameter validation. The input for the simulation study is equal to the motor voltage while the output of the simulation is displayed (blue trace) in the same window as the actual motor speed (red trace).

The parameters K and t of the simulation model could be adjusted from the front panel.

The simulated motor speed, ω s is obtained from the simulated transfer function and the

actual motor voltage as illustrated in the following

s

(

s

)

KV

m

(

s

)

s

1

The implemented digital controller in the QIC runs at 100Hz. Thus the sampling interval is therefore being equal to h = 0.01 [s]

The actual speed is obtained by filtering the position signal using the following filter:

m

s

m

T s 1

f

where θ m is the position of the motor shaft measured by the encoder.

5.2. Module Startup Procedure

Power up the DCMCT: To start and use the Modelling module, first launch the QICii software and then select Modelling in the drop-down menu.

To download the controller code, follow the steps described below:

1. Press the Download program button on top of the QICii window.

2. Click on the Write (F4) button of the PIC downloader popup window.

3. Push the Reset button on the QICii to actually start the download. The two LED's stop flashing.

4. Once the download is complete, press down the Reset button on the QICii one more time. The two LED's should now start flashing again.

5. Close the PIC downloader window.

Page 7 of 12

Once it is loaded, the controller code stays on the QICii (even when the power to the DCMCT is off).

To start the controller, press down the DCMCT “User Switch” (i.e., the pushbutton next to the two flashing LED's). “The two LED's stop flashing” The controller starts running.

Select the Connect to data source button on top of the QICii window in order to be able

to receive / send data from / to the controller. LED2 should now turn on.

Table 1.3: Default Module Parameters

Signal

Amplitude

Frequency

Offset

K

τ

 

Type

[V]

[HZ]

[V]

[Rad/V.S]

[S]

T f

[s]

Square

           

Wave

2.0

0.4

0.0

10.0

0.2

0.0

5.3. Static Relationship

Experimental Procedure

A procedure of this type is very useful in order to make sure that a system will function

properly.

Please follow the steps exactly as described below:

1. Run the system as an open-loop one by changing the voltage to the motor. The motor voltage is set by the signal generator. With zero signal amplitude, change the signal offset to generate a constant DC voltage. Sweep the voltage gently over the full signal (voltage) range and observe the steady-state speed, current, and the motor input voltage. What are the minimum and maximum voltages you can input to the system? What exactly happens to the variables as you change the offset (i.e. change the offset from -3V to +3V)? Can you determine the following relationships: i) input voltage vs motor speed; and ii) current vs motor speed?

2. Start with a zero value of voltage on the motor and increase the voltage gradually until the motor starts to move. Determine the value of the voltage (start-up voltage) when this occurs. Repeat the test with negative values of voltages. What forces are restricting the motor from spinning?

Page 8 of 12

3. Determine the actual maximum value of the motor velocity and compare it with the calculate one. To determine the calculated value, you have to record the motor velocity values subjected to the change of the input voltage from -3V to 3V with an increment of 1V. Then, draw a best-fit-line through these data points. Next, extrapolate the motor velocity values to determine the calculated maximum value of the motor velocity. Do you see the difference between the actual and the calculated values? (Hint: You may or may not see the difference. In either case, explain your observation.)

5.4. Estimate The Motor Resistance

Some of the parameters of the mathematical model of the system can be determined by measuring how the steady-state velocity and the current would change with the applied voltage.

To estimate the motor resistance experimentally, follow the steps described below:

1. Set the generated signal amplitude to zero. If the signal offset is different from zero then the motor will spin in one direction, since a constant voltage is applied. You can change the applied voltage by entering the desired value in the Offset numeric control of the Signal Properties box. You can also read off the actual value of the current of the motor from the digital display. The value is in Amperes. Fill up the following table (i.e., Table 1.4). For each measurement hold the motor shaft stationary by grasping the inertial load to stall the motor. Note that for zero Volts you will measure a current, I bias that is possibly a non-zero value. This is an offset in the measurement, which you will need to subtract from the subsequent measurements in order to obtain the exact value of the current (I m (i) = I meas (i)-I bias ). Note also that the current value shown in the digital display is filtered and you must wait for the value to settle down (steady state is reached) before writing it down.

Page 9 of 12

Table 1.4: Motor Resistance (Experimental results)

SAMPLE

V m (i)

 

Offset in Measured

 

i

[V]

Current: I bias [A]

0

0

   

SAMPLE

Voltage

V m (i)

Measured Current: I

Corrected for

Resistant:

i

Offset [V]

[V]

meas [A]

Bias: I m (i) [A]

Rm(i) [ ]

1

-5

       

2

-4

       

3

-3

       

4

-2

       

5

-1

       

6

1

       

7

2

       

8

3

       

9

4

       

10

5

       
 

Average Resistant: R avg []

   

From the values noted in Table 1.4, calculate the values of the motor resistance R m (i) for every iteration and obtain an average value for it, R avg . Explain the procedure that you have used to estimate the resistance R m .

2. From the system parameters, which are given in Appendix A, the value of the resistance is 10.6± 10%. Compare the estimated value for R m (i.e., R avg ) with the specified value and discuss your results in detail.

Page 10 of 12

5.5.

Estimate The Motor Torque Constant

To estimate the value of the motor back-EMF constant experimentally, follow the steps described below:

1. With the motor free to spin, apply the same procedure as given above and fill the given table (i.e., Table 1.5). You can read off a value for the motor angular speed from the digital display. Wait a few seconds after you entered a new voltage value as the displayed speed values are low-pass filtered. The values of the angular speed are in radians per seconds. The current measurement may have an offset, which you should need to account for. The speed measurement will have a very small offset, which also need to be compensated for. Calculate the motor back- EMF constant for each measurement iteration and then calculate an average value for the 10 measurements. You should use the value of R m that you have estimated in the previous section.

Note that k m can be calculated using

k

m

V

m

R

m

I

m

m

2. From the system parameters that are given in Appendix A, k m = 0.0502Vs/rad. Compare the estimated value for k m (i.e., k m_avg ) with the specified value, and then discuss your results in detail.

5.6. Obtain the Transfer Function of the Motor

The open-loop transfer function of the system can be described as

where

K

1

k

m

system constant;

G

, V

(

s

)

and

K

s

1

R

J

eq m

k

m

2

system time constant

From the above estimates, determine a numerical expression for the open-loop transfer function G ω,V of the motor (J eq = 0.0000221 kg.m 2 , 0.130 s). What are the estimated open-loop steady-state gain value and the time constant?

Page 11 of 12

Table 1.5: Back-EMF Constant Experimental Results

SAMPLE

V m (i)

 

Offset in Measured

R aver

 

i

[V]

Current: I bias [A]

[]

0

0

     

SAMPLE

Offset

V m (i)

Measured Speed:

I meas (i)

I

m (i)

K m (i)

i

Voltage [V]

[V]

ω m (i) [Rad/S]

[A]

[A]

[V.s/Rad]

1

-5

         

2

-4

         

3

-3

         

4

-2

         

5

-1

         

6

1

         

7

2

         

8

3

         

9

4

         

10

5

         
 

Average Back EMF--Constant: Km(i) [V.s/Rad]

   

5.7. Estimate The Measurement Noise

The measurement noise could be determined experimentally. Please follow the steps described below:

1. Determine the measurement noise for the speed control by running the motor with a constant positive as well as a constant negative voltage and observe the fluctuations in the velocity, if any.

2. Does the noise level depend on the velocity and /or the direction of rotation? Do you also observe any repeatable fluctuations in the velocity signal? Can you find

their causes?

Hint: Can the fluctuations in the velocity signal be related to the motor position?

Page 12 of 12

FACULTY OF ENGINEERING AND APPLIED SCIENCE Lab 2: Dynamics Modeling Experimental Determination of System Dynamics

FACULTY OF ENGINEERING AND APPLIED SCIENCE

Lab 2: Dynamics Modeling Experimental Determination of System Dynamics

Page 1 of 6

1.

Experiment Objective

The objective of this experiment is to develop your understanding of modeling for control system design and to practice modeling skills using the DC Motor Control Trainer. In particular, you will:

Observe and understand the transient response of a first-order dynamic system

Practice modeling from experimental tests

Understand the importance and the technique of system validation

2. Lab Preparation

Before the proceeding you should review the modeling experiment you did in Lab 1.

3. Introduction

Model of a dynamic system can be approximated by exciting the system with a known input and observing its system response. The so called “bump test” is a simple method to determine the response based on a step function input. When a step input of known amplitude is applied to a dynamic system, its time response is captured until the condition of steady-state is reached. A graphical method (as described in Section 4.1.1) can then be applied to the plot of time response to estimate the parameters of the dynamic system. For instance, in the case of the first-order system, the system gain, K and the time constant, can be estimated. A model can in principle be obtained by applying any type of input to the system and analyzing the corresponding response. There is abundant literature and good software available to do this. In this experiment we will utilize a simple graphical method. You can review your lecture notes on this subject. When a model is obtained, it is a good practice to assess the validity of the model by running simulations of the model and comparing its response with that of the actual system. To determine how closely a model resembles or fits the actual system, we usually compare the difference of their responses by measuring the error (as described in Section 4.2.1) between them. Model validation is an important procedure that should be performed in order to give a level of confidence in the expected performance before such model is applied to a closed-loop system.

Page 2 of 6

4.

In-Laboratory Content

4.1 The Bump Test (Step function input)

4.1.1 Preamble

The bump test is a simple model estimation method based on the step response of a stable system. It is carried out by inducing a step input of known amplitude to a stable system, whose output will eventually reach the equilibrium state. If the system output is recorded during the estimation period (from the time when the step input is induced until the time when steady state is reached), a plot of the time response, similar to the one depicted in Figure 1 for a first-order system, can be produced. As you recall from Lab 1, the DC motor control system actually demonstrates a first-order system response. Thus, we will approximate the motor control system according to the first-order system transfer function given below:

G

(

, V

s

)

K

s 1

[2.1]

G (  , V s )  K  s  1 [2.1] Figure 1:

Figure 1: Bump test (Step function) input and output response

Page 3 of 6

Assuming that the input changes with Δ u and that the corresponding change in the

steady-state output is Δ y , an estimate of the steady-state gain is then given by:

K



y

u

[2.2]

The quantity τ (time constant) is approximately given by the time the output has reached

63% of its total change at steady state.

output has reached 63% of its total cha nge at steady state. 4.1.2 Experiment Process Please

4.1.2 Experiment Process

Please read Appendix B which describes how to use the QICii plots to take measurements

of the acquired data, to start and stop the plots, and to measure point coordinates on the

plots. Please follow the steps below:

1. Apply a series of step inputs to the open-loop system by setting the QICii module

parameters as described in Table 2.1.

Signal

Amplitude

Frequency

Offset

K

Type

[V]

[Hz]

[V]

[rad/(V.s)]

[s]

Square

         

Wave

2

0.4

3

0

0.0

Table 2.1: Module Parameters for the Bump-test experiment

2. The open-loop controller now applies a constant-amplitude voltage square wave

to the motor. Step voltages are applied to the motor from the signal generator with

a period that is so long that the system well reaches steady-state at each step. The

motor should run at the corresponding constant speeds. Determine the transfer

function from the voltage V m to angular velocity ω m using the obtained bump

tests.

Page 4 of 6

3.

Determine the parameters K and τ of the model defined in [2.1].

4. Repeat the procedure for a few different signal amplitudes, as well as for the rising and falling steps. Average your estimated parameters.

4.2 Model Validation

4.2.1 Preamble

A simple form of the model validation can be done because the software Modelling contains a first-order simulation, whose model expressed by Equation [2.1] is driven by the actual open-loop motor voltage. This model is running in parallel with the motor,

which can be used for model fitting. The simulation parameters K and τ can be adjusted

from the front panel. The output of the model is displayed together with the actual motor speed.

To measure how closely a model fits the actual system, we can calculate the root mean squared (RMS) error measured within the validation period as given below:

measured within the validation period as given below: [2.3] where is the output of the actual

[2.3]

where is the output of the actual system, is the output of the simulation model,

the actual system, is the output of the simulation model, i is the index of the
the actual system, is the output of the simulation model, i is the index of the

i is the index of the data point, and n is the index of the last (at the end of the validation period) data point.

Page 5 of 6

Alternatively, Eq. [2.3] can be expressed in terms of its relative percentage error, given by:

in terms of its relative percentage error, given by: 4.2.2 Experiment Process Follow the procedures described

4.2.2 Experiment Process

Follow the procedures described below:

[2.4]

1. Activate the model by changing the simulation parameters K and τ.

2. Set K and τ to the values which you have previously estimated from the bump test. Do you obtain a good fit between the estimated and the actual responses?

3. Try to minimize the error between the simulated response and the actual response

by adjusting the simulation parameters K and τ on-the-fly until you obtain a good

fit. This procedure is called “model fitting”.

4. Change the signal amplitude to see if you have to change the values of the simulation parameters in order to get a better fit.

5. Is your model valid? Apply Eq. [2.4] to determine if your model is valid and summarize your observation.

Page 6 of 6

FACULTY OF ENGINEERING AND APPLIED SCIENCE Lab 3: Qualitative Properties of PI Control Page 1

FACULTY OF ENGINEERING AND APPLIED SCIENCE

Lab 3: Qualitative Properties of PI Control

Page 1 of 11

1.

Laboratory Objective

The objective of this laboratory is to develop an understanding of the PI (Proportional + Integral) control (applied to speed control), how does it work, and how it can be tuned to meet the required specifications.

In particular, in this experiment you will explore:

Pure proportional control action.

Pure integral control action

Proportional and integral control action

2. Preparation and Pre-Requisites

A pre-requisite to this laboratory is to have successfully completed the modelling and

model validation laboratory in Lab 1 and Lab 2.

Before the lab, you should also review the Proportional + Integral (PI) control from your textbook.

The system can be represented by the block diagram as shown in Figure 3.1. This block diagram illustrates the parts of the system that are relevant for the speed control.

parts of the system that are relevant for the speed control. Figure 3.1 DCMCT Block Diagram

Figure 3.1 DCMCT Block Diagram for the Speed Control

The process is represented by a block which has the motor voltage V m and the torque T d

as the inputs and the motor speed ω m as the output. The torque is typically a disturbance torque that you can apply manually to the inertial load.

Page 2 of 11

The velocity is actually computed in the PIC by filtered differences of the motor angle θ m using the following relationship

where T f

angle θ m using the following relationship where T f is the time constant of the

is the time constant of the filter and s is the Laplace Transform operator.

The controller block represents the control algorithm in the computer and the power amplifier. V sd is a simulated external disturbance voltage.

Make sure that you understand this fully.

The linear behaviour of the system is described by the transfer functions given in the block diagram. The major nonlinearities are the saturation of the motor amplifier at 15 V, the Coulomb friction corresponding to 0.5 V, and the quantization of the encoder.

The major unmodeled dynamics is due to the effects of the sampling and filtering. The former can be approximated by a time delay of one sampling period.

3. Introduction: The PI Controller

The PI controller is the most common control algorithm. It is used for a variety of purposes and it often works very well. For systems with simple dynamics it can give close to the optimal performance and for processes with complicated dynamics, it can often give good performance provided that the specifications are not too demanding.

Better performance can, however, be obtained by using more complicated controllers.

3.1 PI Control Law

The linear behaviour of a PI controller can be described by:

linear behaviour of a PI c ontroller can be described by: where, u ( t )

where, u(t) is the control signal, r(t) the reference, and y(t) the measured process output.

Page 3 of 11

The reference r(t) is also called the set-point or the command. The linear behaviour of the controller is governed by three parameters:

k p : proportional gain

k i : integral gain

b sp : set-point weight

Further in this experiment, we introduce a fourth parameter, a w , which governs the nonlinear properties of the controller.

Sometimes the filtered measurement y f(t) is also used in the control loop. It is computed from T f , the time constant of filter for measured signal. The filter time constant T f is typically set to a constant value and it is often combined with the sensor. The filter provides the roll-off at high frequencies.

It is important to reduce the effects of the sensor noise, which it improves robustness. In

this particular case, the filtering is incorporated in the calculation of the velocity from the

encoder signal.

3.2 The magic of Integral Action

A nice property of a controller with the integral action is that it always gives the correct

steady-state value provided that there is equilibrium. This can be seen simply by assuming that there is a steady-state value with constant u(t) = u ss , r(t) = r ss , and y(t) = y ss .

Equation [3.1] can then be written as:

y(t) = y s s . Equation [3.1] can then be written as: Since the left-hand-side

Since the left-hand-side is a constant, the right-hand-side must also be a constant. This requires that y ss = r ss . Notice that the only assumption, which has been made about the process is that there exists an asymptotic steady-state value.

4. Laboratory Session

4.1 QICii Modeling Module

The main tool for this experiment is the front panel of the module entitled Speed Control

in the QICii software, which should be similar to the one shown in Figure 3.2.

Page 4 of 11

Figure 3.2 Speed Control Module of the QICii Software As a quick module description, Table

Figure 3.2 Speed Control Module of the QICii Software

As a quick module description, Table 3.1 lists and describes the main elements composing the QICii Speed Control module user interface. Every element is uniquely identified through an ID number and located in Figure 3.2.

The Speed Control module program runs the process in the closed-loop using the motor reference speed given by the signal generator. There are two windows that show the time histories of the motor speed (control output) and the motor voltage (control input).

The implemented digital controller in the QIC runs at 100Hz. Thus the sampling interval is:

h=0.01 [s]

The actual speed is obtained by filtering the position signal using the following filter:

m

s

m

T

f

s 1

where, θ m is the position of the motor shaft measured by the encoder.

Page 5 of 11

ID#

Label

1

Speed

2

Current

3

Voltage

Signal

4

Generator

5

Amplitude

6

Frequency

7

Offset

8

Speed

9

Voltage

10

Kp

11

Ki

12

bsp

13

aw

14

Tf

Parameter

ω m

I m

V m

ω m, r

V m

Kp

Ki

b sp

a w

Tf

Description

Motor Output Speed Numeric Display

Unit

Rad/s

Motor Armature Current Numeric Display

A

Motor Input Voltage Numeric Display

V

Type of Generator For The Input Voltage Signal

Generated Signal Amplitude Input Box

V

Generated Signal Frequency Input Box

Hz

Generated Signal Offset Input Box

V

Scope With Actual (in red) and Reference (in blue) Motor Speeds

Scope With Applied Motor Voltage(red)

Controller Proportional Gain Input Box

Controller Intergral Gain Input Box

rad/s

V

V.S/rad

V/rad

Controller Set-point Weight Input Box

Controller Windup protection Parameter Input Box

Time Constant of Filter for Measured Signal

s

Table 3.1 QICii Modeling Module Nomenclatures

4.2 Module Startup

Power up the DCMCT: To start and use the Speed Control module, launch the QICii software and select the Speed Control in the drop-down menu.

Page 6 of 11

To download the controller code, follow the steps described below:

1. Press the Download program button on top of the QICii window.

2. Click on the Write (F4) button of the PIC downloader popup window.

3. Push the Reset button on the QICii to actually start the download. The two LED's stop flashing.

4. Once the download is completed, press the Reset button on the QICii one more time. The two LED's should start flashing again.

5. Close the PIC downloader window.

Once loaded, the controller code stays on the QICii (even when the power to the DCMCT is off).

To start the controller, press the DCMCT User Switch (i.e. pushbutton next to the two flashing LED's). The two LED's now stop flashing. The controller starts running. Select the Connect to data source button on top of the QICii window to be able to receive/send data from/to the controller. LED2 should turn on.

Table 3.2: Default Parameters for the Speed Control Module

Signal

Amplitud

Frequency

Offset

Kp

Ki

b sp

a w

T f

[s]

Type

e [Rad/s]

[HZ]

[V]

[V.S/Rad]

[V/rad]

 

Square

50.0

0.4

100.0

0.0

1.0

0.0

0.0

0.01

Wave

4.3 Qualitative Properties of the Proportional and Integral Control

The goal of the following procedures is to develop an intuitive feel for the properties of the proportional and integral control.

1. Pure Proportional Control

Start by exploring the properties of the pure proportional control. Please follow the steps below:

Page 7 of 11

Step 1:

Set the reference signal to a square wave. Reasonable amplitude is 50 rad/s. When you change the reference signal level ensure that the control signal does not reach saturation. It may be useful to adjust the Offset of the signal generator so that the sign of the velocity does not change. In this way you will avoid the effects of the Coulomb friction.

What is saturation?

Saturation is a nonlinear response and it also determines the physical control limit of a system (e.g. how high the voltage you can supply to the motor until it stops increasing the speed, as depicted in Fig. 4.1 below). When you sweep the control signal from low to high level, the motor speed may behave nonlinearly when it approaches its physical limits (upper and lower bounds). Saturation can limit the controllable range of a system. Hence, it is important to know the saturation characteristic of a system before a controller can be constructed. The effect of saturation can be seen on a time-domain plot where a portion of the plot is chopped off horizontally when the system is reaching its upper or lower limit. If such scenario happens, you should lower the value of the control signal so to eliminate the effect of saturation.

value of the control signal so to eliminate the effect of saturation. Fig. 4.1 Effect of

Fig. 4.1 Effect of saturation (circled in blue)

Page 8 of 11

Set the integral gain to zero. Set the proportional gain to 0.02 V.s/rad to start with. Ensure that the following parameters of the Speed Control window, as displayed in Table 3.3, are set properly.

Signal

Amplitude

Frequency

Offset

k

i

k

p

b

sp

Type

[rad/s]

[Hz]

[rad/s]

[V/rad]

[V.s/rad]

 

Square

           

Wave

50

0.4

100

0

0.02

1

Table 3.3 Module Parameters for Pure Proportional Control

Step 2:

Change the proportional gain by incremental steps of 0.04 V.s/rad to investigate the closed-loop system for the proportional controllers (k i = 0) with different gains.

What are your observations?

Step 3:

Determine the critical gain, k pc , where the system becomes “critically stable” and a stable oscillation is achieved. Also determine the “critical period” T pc of the corresponding oscillations.

Step 4:

Describe the steady-state error to a step input.

Step 5:

Repeat the previous observations. Change the Amplitude of the reference signal and observe under what conditions the control signal saturates.

Step 6:

Summarize your observations in your report. Select some representative results, screen captures, and plots.

Page 9 of 11

2.

Pure Integral Control

In this procedure we will explore the pure integral control. Please follow the steps below:

Step 1:

Set the proportional gain to zero. Set the integral gain to 0.02 V/rad to start with. Ensure that the parameters of the QICii module window, as listed in Table 3.4, are set properly.

Signal

Amplitude

Frequency

Offset

k

p

k

i

a

w

Type

[rad/s]

[Hz]

[rad/s]

[V.s/rad]

[V/rad]

 

Square

           

Wave

50

0.4

100

0

0.02

0

Table 3.4: Module Parameters for Pure Integral Control

Step 2:

Change the integral gain by incremental steps of 0.5 V/rad to investigate the closed- loop system for the integral controllers (k p = 0) with different gains.

What are your observations?

Step 3:

Determine the critical gain, k ic where the system becomes critically stable and a stable oscillation is sustained.

Also determine the critical period T ic of the corresponding oscillations.

Step 4:

Determine a value of the integral gain, which gives a set-point response without the overshoot. Determine the settling time for the closed loop system.

Step 5:

Repeat the previous observations. Change the Amplitude of the reference signal and observe under what conditions the control signal saturates?

Page 10 of 11

Step 6:

Summarize your observations in your report. Select some representative results, screen captures, and plots.

3. Proportional and Integral Control

The combination of the proportional and integral control action will now be explored.

Please follow the steps below.

Step 1:

Set the parameters of the QICii module window as listed in Table 3.5.

Signal

Amplitude

Frequency

Offset

b

sp

a

w

Type

[rad/s]

[Hz]

[rad/s]

   

Square

         

Wave

50

0.4

100

1

0

Table 3.5 Module Parameters for Proportional and Integral Control

Step 2:

Set the proportional gain to a constant value, like k p = 0.1 V.s/rad, and change the integral gain. Observe the tracking error and the control signal.

Step 3:

Set the integral gain to a constant value, like k i = 0.5 V.s/rad, and change the proportional gain. Observe the tracking error and the control signal.

Step 4:

Summarize your observations in your report. Select some representative results, screen captures, and plots.

Page 11 of 11

FACULTY OF ENGINEERING AND APPLIED SCIENCE Lab 4: Speed Control Page 1 of 11

FACULTY OF ENGINEERING AND APPLIED SCIENCE

Lab 4: Speed Control

Page 1 of 11

1.

Laboratory Objective:

The objective of this laboratory experiment is:

to develop an understanding of the Proportional plus Integral (PI) control (applied to speed control),

as how the system works, and

as how it can be tuned in order to meet the required specifications.

In particular you will explore in this experiment the followings:

Ziegler-Nichols method

Set-point Weighting

Response to load disturbance

2. Preparation and Pre-Requisites:

A pre-requisite to this laboratory is to have successfully completed the modelling and the

PI control in the previous Lab 3.

Before you start the experiment, you should also review the Proportional-plus-Integral (PI) controller action from your lecture notes and textbook.

The system can be represented by the block diagram shown in Figure 4.1. This block diagram illustrates the parts of the system that are relevant for speed control.

the parts of the system that are relevant for speed control. Figure 4.1: DCMCT Block Diagram

Figure 4.1: DCMCT Block Diagram for the Speed Control

The process is represented by a block which has the motor voltage V m and the torque T d

as the inputs and the motor speed ω m as the output. The torque is typically a disturbance torque that you will apply manually to the inertial load.

Page 2 of 11

The velocity is actually computed in the PIC by filtered the differences of the motor angle θ m using the following relationship:

the motor angle θ m using the following relationship: where T f is the filter’s time

where T f is the filter’s time constant and s is the Laplace transform operator.

The controller block represents the control algorithm in the computer and the power amplifier. V sd is a simulated external disturbance voltage.

Make sure that you understand this fully.

The linear behaviour of the system is described by the transfer functions given in the block diagram. The major nonlinearities are the saturation of the motor amplifier at 15 V, the Coulomb friction corresponding to 0.5 V, and the quantization of the encoder.

The major un-modeled dynamics is due to the effects of the sampling and filtering. The former can be approximated by a time delay of one sampling period.

3. Introduction

3.1 The Ziegler-Nichols Method

A good way to find the ball park values of the controller parameters is to look at pure

proportional and integral controllers and to determine the gains where the system become critically stable (a.k.a., a stable). The Ziegler-Nichols frequency response method is a classical tuning rule based on this idea. A proportional controller is adjusted so that the system reaches the stability limit. The critical gain kpc where this occurs is observed together with the period of oscillation Tpc.

In the early 1940s J.G. Ziegler and N.B. Nichols experimentally developed the PID tuning methods based on the closed-loop tests. However the Ziegler-Nichols method suffers from one major drawback.

That is the physical system has to tolerate to be brought into a critically stable state without catastrophic consequences. For example, the sustained oscillation is generally out

of the question for most industrial processes.

The Ziegler-Nichols closed-loop method recommends the following PI controller gain tuning:

Page 3 of 11

3.2 Simulated Load Disturbance: Dist urbance Response with PI Control A disturbance torque can be

3.2 Simulated Load Disturbance: Disturbance Response with PI Control

A disturbance torque can be simulated by applying an additional voltage, Vsd, to the motor input. The DCMCT system uses this as a way to simulate a load disturbance in a repeatable manner, as illustrated in Figure 4.2.

You can do this by depressing the User Switch on the DCMCT.

can do this by depressing the User Switch on the DCMCT. Figure 4.2: DCMCT Regulation Block

Figure 4.2: DCMCT Regulation Block Diagram with Simulated Load Disturbance

4. Laboratory Session

4.1 QICii Modeling Module

The main tool for this lab is the front panel of the module entitled Speed Control in the QICii software, which should be similar to the one shown in Figure 4.3.

Page 4 of 11

Figure 4.3: Speed Control Module of the QICii Software As a quick module description, Table

Figure 4.3: Speed Control Module of the QICii Software

As a quick module description, Table 4.1 lists and describes the main elements composing the QICii Speed Control module user interface. Every element is uniquely identified through an ID number and located in Figure 4.3.

The Speed Control module program runs the process in the closed-loop using the motor reference speed given by the signal generator. There are two windows that show the time histories of motor speed (control output) and the motor voltage (control input).

The implemented digital controller in the QIC runs at 100Hz. Thus the sampling interval is:

h = 0.01 [s]

The actual speed is obtained by filtering the position signal using the following filter:

m

s

m

T

f

s 1

where θ m is the position of the motor shaft, measured by the encoder.

Page 5 of 11

Table 4.1 QICii Modeling Module Nomenclatures

ID#

Label

1

Speed

2

Current

3

Voltage

Signal

4

Generator

5

Amplitude

6

Frequency

7

Offset

8

Speed

9

Voltage

10

Kp

11

Ki

12

bsp

13

aw

14

Tf

Parameter

ω m

I m

V m

ω m, r

V m

Kp

Ki

b sp

a w

Tf

Description

Motor Output Speed Numeric Display

Unit

Rad/s

Motor Armature Current Numeric Display

A

Motor Input Voltage Numeric Display

V

Type of Generator For The Input Voltage Signal

Generated Signal Amplitude Input Box

V

Generated Signal Frequency Input Box

Hz

Generated Signal Offset Input Box

V

Scope With Actual (in red) and Reference (in blue) Motor Speeds

Scope With Applied Motor Voltage(red)

Controller Proportional Gain Input Box

Controller Intergral Gain Input Box

rad/s

V

V.S/rad

V/rad

Controller Set-point Weight Input Box

Controller Windup protection Parameter Input Box

Time Constant of Filter for Measured Signal

s

4.2 Module Startup

Power up the DCMCT: To start and use the Speed Control module, launch the QICii software and select Speed Control in the drop-down menu.

To download the controller code, follow the steps described below:

1. Press the Download program button on top of the QICii window.

2. Click on the Write (F4) button of the PIC downloader popup window.

3. Push the Reset button on the QICii to actually start the download. The two LED's stop flashing.

Page 6 of 11

4.

Once the download is complete, press the Reset button on the QICii one more time. The two LED's should start flashing again.

5. Close the PIC downloader window.

Once loaded, the controller code stays on the QICii (even when the power to the DCMCT is off).

To start the controller, press the DCMCT User Switch (i.e. the pushbutton next to the two flashing LED's). The two LED's will stop flashing. The controller starts running. Select the Connect to data source button on top of the QICii window to be able to receive/send data from/to the controller. The LED2 should turn on. Table 4.2: Default Parameters for the Speed Control Module

Signal

Amplitud

Frequency

Offset

Kp

Ki

b sp

a w

T f

Type

e [Rad/s]

[HZ]

[V]

[V.S/Rad]

[V/rad]

[s]

Square

50.0

0.4

100.0

0.0

1.0

0.0

0.0

0.01

Wave

4.3 Manual Tuning: Ziegler-Nichols

In Lab 3, we have obtained a good feel for the properties of the Proportional and the Integral control. This knowledge will now be used to develop manual tuning procedures.

Manual tuning procedures are generally used when no mathematical model of the system is available to perform control system design. Typically in the manual control, we first set the integral gain to zero and increase the proportional gain until the system reaches the stability boundary. At this point a critically stable condition (i.e. a stable output oscillation) is achieved and the critical gain k pc , where this occurs and the frequency of the oscillation T pc are determined. Similarly, applying the same technique to pure integral control gives k ic and T ic . The values of k pc and k ic give the ranges for the proportional gain and integral gain respectively. Suitable values can then be determined empirically or by the traditional tuning rules.

Please carry on with the following process:

Step 1: Set the parameters of the QICii module window as following table.

Signal

Amplitude

Frequency

Offset

b

sp

a

w

Type

[rad/s]

[Hz]

[rad/s]

   

Square

         

Wave

50

0.4

100

1

0

 

Page 7 of 11

 

Set both the proportional and the integral gains to the recommended values by the Ziegler-Nichols method as

K p = 0.4 K pc

and

T i = 0.8 T pc

then

K i = K p / T i

or

K i = 0.5K pc / T pc

1. What is the resulting 2 % settling time?

2. What are your observations?

Step 2: Adjust the proportional and the integral gains manually to give a very slightly under-damped set-point response with no saturation.

Step 3: Summarize your observations and your calculations in your report. Select some representative results, screen captures, and plots.

4.4 Set-Point Weighting

We have only investigated the effects of the proportional gain k p and the integral gain k i . The PI controller does however, have more parameters to examine. In this Section we will explore the effects of the set-point weight for the proportional gain b sp . This parameter, which ranges from 0 to 1, was set to b sp = 1 in the earlier experimental procedures.

You will observe that the set-point weight has a significant effect on the response to command signals. However as expressed by Equation [3.1] in Lab 3, it only affects the reference signal input but does not influence the response to load disturbances.

but does not influe nce the response to load disturbances. where u ( t ) is

where u(t) is the control signal and r(t) is the reference or set-point (defined by the amplitude, offset and frequency settings).

Experimental Process:

Step 1

Set the values of k p = 0.23 V.s/rad and k i = 2.3 V/rad. Choose a Square Wave signal from the QICii signal generator.

Investigate the effects of the set-point weight on the step response and the control signal by initially setting the value of b sp to 0 then gradually increase the value with an

Page 8 of 11

increment of 0.20 until the value reaches unity. Capture the graph each time when you increase the value.

Step 2

Make some analysis that explains your observations based on the equation [3.1].

Step 3

In your report document your results and your analysis and illustrate with typical responses.

4.5 Response to the Load Disturbance

In this session the students will carry out an experimental investigation into the system

response to the applied load disturbances.

4.5.1 Manual Load Disturbance

A load disturbance can be introduced by manually applying a torque to the inertial load.

Please follow the steps below:

Step 1

The regulation problem, at r = 100 rad/s, is investigated. Set the QICii module parameters

as given in the following table.

Amplitude [rad/s]

Offset [rad/s]

a

w

0

100

0

Step 2

Choose a pure proportional controller (i.e., k i = 0) with the given value of the gain being k p = 0.10 V.s/rad, and b sp = 1.0.

Page 9 of 11

Step 3

Apply a torque manually by gently touching the inertial load with your finger. Observe closely as what happens when you change the proportional gain of the controller (e.g. gradually increase the value of k p with an increment of 0.10 Vs/rad until k pc is reached).

Step 4

Investigate a controller with the pure integral action. To do so, set the proportional gain

to zero (k p = 0) and the initial value of the integral gain to unity (k i = 1.0 V/rad). Now

apply a disturbance torque manually and observe what happens when you increase the integral gain of the controller gradually with an increment of 0.50 V/rad until k ic is reached.

4.5.2 Simulated Load Disturbances: Disturbance Response With PI Control

A disturbance torque can be simulated by applying an additional voltage, V sd , to the

motor input (i.e. control signal disturbance).

Experimental Process

Step 1

The regulation problem at zero velocity (i.e., r = 0 rad/s) should be investigated.

Set the QICii module parameters as given in the following table.

Amplitude [rad/s]

Offset [rad/s]

a

w

0

0

0

Step 2

Emulate a load disturbance torque by pressing down and holding or releasing the “User Switch”.

Page 10 of 11

Step 3

Investigate the behaviour of the closed-loop system for the pure proportional controllers (i.e., k i = 0 and b sp = 1) with different values of the gain. You can start off with k p = 0.10 Vs/rad and step up the value with an increment of 0.10 Vs/rad until k pc is reached.

1. Summarize your observations in your report.

2. Determine the steady-state error ω ss_P .

3. Select some representative results, screen captures, and plots.

Step 4

Investigate the behaviour of the closed-loop system for the pure integrating controllers (i.e., k p = 0 and a w = 0) with different values of the gain. You can start off with k i = 1.0 V/rad and step up the value with an increment of 0.50 V/rad until k ic is reached. Summarize your observations in your report. Select some representative results, screen captures, and plots.

Step 5

Can you estimate from your experiment as how much voltage disturbance, V sd , is applied when you press the DCMCT “User Switch”? Please explain in detail as how you have arrived at this.

Page 11 of 11

University of Ontario Institute of Technology Lab 5: Position Control PD, PI and PID Controllers

University of Ontario Institute of Technology

Lab 5: Position Control

PD, PI and PID Controllers

Page 1 of 12

1.

Laboratory Objectives:

The objective of this laboratory experiment is to develop an understanding of PID control of

motor rotational angle, how it works, and how it can be tuned to meet the required

specifications.

In particular you will explore the followings:

Qualitative properties of the proportional, derivative, and the integral actions

Comparisons with the PI control of motor speed

2. Preparation and the Pre-requisite:

A pre-requisite to this laboratory is to have successfully completed the modelling experiment

and the model validation experiment described in Laboratories 1 and 2, respectively. Before

the start of this lab experiment, you should also review the topic of the Proportional-plus-

Integral (PI) control of motor speed, as you have performed in Laboratories 3 and 4.

For the purpose of the position control, the system can be represented by the block diagram as

shown in Figure 5.1. This block diagram illustrates the parts of the system that are relevant for

the position control.

of the system that are relevant for the position control. Figure 5.1 DCMCT Block Diagram for

Figure 5.1 DCMCT Block Diagram for the Position Control

The process is represented by a block, which has the motor voltage V m and the torque T d as

the load disturbance and the motor rotational angle θ m as the output. The torque disturbance T d

is

typically a torque that you could apply manually to the inertial load (e.g. using your finger

to

apply a retarding force to the flywheel momentarily, as seen in Lab 4). The PID controller

block represents the control algorithm in the computer and the power amplifier unit. The

control signal disturbance V sd is a simulated external disturbance voltage. Page 2 of 12

The linear behaviour of the system is described by the transfer functions given in the block diagram. The major sources of nonlinearities are the saturation of the motor amplifier at 15 V, the Coulomb friction corresponding to 0.4 V (i.e., the minimum voltage required to start-up the motor from stationary), and the quantization of the encoder which, causes a time delay of 1 sampling period (i.e., due to a combination of the encoder resolution of 4096 counts per revolution and the sampling rate of the encoder being set at h = 100 Hz).

3. Introduction : PID controller

The PID controller is a classical control algorithm. It is used for a variety of purposes and it often works very well. For systems with simple dynamics it can give close to optimal performance and for processes with complicated dynamics, it can often give good performance provided that specifications are not too demanding. Better performance can, however, be obtained by using more complicated controllers.

3.1 The PID Control Law

The linear behaviour of a PID controller can be described by the following equation:

a PID controller can be described by the following equation: where, u ( t ) is

where, u(t) is the control signal, r(t) being the reference signal and y(t) is the measured process output. The reference signal r(t) is also called the set-point or the command signal.

The linear behavior of the PID controller is governed by the following parameters:

k p : proportional gain

k i : integral gain

k d : derivative gain

b sp : proportional set-point weight

b sd : derivative set-point weight

T f : time constant of the filter for the measured signal

Page 3 of 12

Sometimes the filtered measurement y f(t) is also used in the control loop. It is computed from T f , the time constant of the filter for the measured signal. The filter time constant T f is typically set to a constant value and it is often combined with the sensor. The filter provides the roll-off at high frequencies. It is important to reduce the effects of the sensor noise as it improves the system robustness.

The PID controller is similar to the PI controller and the additional derivative term provides added flexibility. In particular, it improves the possibilities of introducing the damping effect because it is an approximate prediction of future measurements.

3.2 The Magic of Integral Action

An interesting property of a controller with an integral action is that it always gives the correct steady-state value provided that there is equilibrium. This can be seen simply by assuming that there is a steady-state value with the constant values of u(t) = u ss , r(t) = r ss , and also y(t) = y ss .

Equation [5.1] can now be written as:

( t ) = y s s . Equation [5.1] can now be written as: Since

Since the left-hand-side is a constant, then the right-hand-side must also be a constant. This requires that y ss = r ss . Notice that the only assumption that has been made about the process is that there should be an asymptotic steady-state condition.

The load disturbance response of a PID controller has an interesting property, which can be seen as follows:

has an inte resting property, which can be seen as follows: where, e is the control

where, e is the control error, as defined:

Page 4 of 12

e(t) r(t) y(t)

One can assume that the PID controller is connected to a process and also the closed–loop system remains stable. Apply a load disturbance in the form of a step function to the system. There will be a transient response and the error will then approaches to zero because the system is stable. The above equation implies that:

the system is stable. The above equation implies that: The value of u (  )

The value of u() is the steady-state control signal required to eliminate the load disturbance. We can conclude from Equation [5.2] that the integral of the error signal due to a load disturbance is inversely proportional to the integral gain of the controller.

3.3 Controls with Two–Degree–of–Freedom

A PID controller with the set-point weights b sp = 1 and b sd = 1 is a controller with the error

feedback because the control actions are based on the error e = r y. A controller where, one of the set–point weights is different from one is said to have two–degrees–of–freedom because the signal transmission from the reference r to the control u is different than from the signal transmission from the measurement y to the control u.

A controller with two–degrees–of–freedom has two inputs and one output, as shown in the

block diagram of Figure 5.1.

The set-point weights have no effect on the load disturbance response or on the system dynamics but they can influence the response to command signals significantly. Both the set- point weights range from 0 to 1.

4. Laboratory Content

4.1 The QICii Position Control Module

4.1.1 Module Description

Page 5 of 12

The main tool for this laboratory experiment is the front panel of the module entitled Position Control in the QICii software, which should be similar to the one shown in Figure 5.2.

which should be similar to the one shown in Figure 5.2. Figure 5.2: The Position Control

Figure 5.2: The Position Control Module of the QICii Software

As a quick module description, Table 5.1 lists and describes the main elements composing the QICii Position Control module user interface.

Every element is uniquely identified through an ID number and located in Figure 5.2.

The Position Control module program runs the process in the closed–loop with the motor reference position angle given by the signal generator. There are two windows that show the time histories of the motor position (i.e., the control output) and the motor voltage (i.e., the control input).

Page 6 of 12

Table 5.1: System Modelling Nomenclature

ID #

Label

Parameter

Description

Unit

1

Position

θ

m

Motor Output Position Numeric Display

rad

2

Current

I

m

Motor Armature Current Numeric Display

A

3

Voltage

V

m

Motor Input Voltage Numeric Display

V

4

Signal

 

Type of Generator For The Angle Reference Signal: Saw–tooth Wave or Square Wave

 

Generator

5

Amplitude

 

Generated Signal Amplitude Input Box

rad

6

Frequency

 

Generated Signal Frequency Input Box

Hz

7

Offset

 

Generated Signal Offset Input Box

rad

8

Position

θ