ecse-4760 computer applications laboratory analog and

19
1 Rensselaer Polytechnic Institute ECSE-4760 Computer Applications Laboratory ANALOG AND DIGITAL CONTROL OF A DC MOTOR Number of Sessions – 4 INTRODUCTION Over the past several years, the digital computer has been used in a broad range of engineering applications. One of these is in Control Systems. Major advantages of using digital computers in the Control field include the great computational speed and accuracy, the relative ease with which simple parameters or even complete program modules can be modified (with virtually no new equipment cost), and the decision making capability. The last one lately has reached new heights with fuzzy controllers and expert systems, replacing delicate human operators. Large numbers of processes can be controlled simultaneously and effectively by a single computer and detailed reports can be generated, tasks previously unthinkable with an analog computer. The purpose of this experiment is to acquaint the student with the advantages and shortcomings of using microcomputers in Control System applications, by designing and implementing regulators to control the angular position of an armature controlled DC motor made by Feedback Ltd. Both analog and digital designs will be implemented so that direct comparisons can be made of the pros and the cons of each approach. It is assumed that the experimenter is reasonably familiar with the basic principles of analog feedback control, preferably root locus techniques, and can design compensators to satisfy a set of required specifications. PROBLEM FORMULATION The objective of the experiment is to design both analog as well as digital compensators to control the angular position of an armature controlled DC motor. A step input, created by changing the polarity of the motor, will be used as a reference signal. In general an armature controlled motor can be regarded as a linear system over a finite operating range and is described by the following transfer function (p. 1.11 of the ES130 manual appended to this write-up): G p ( s) = K s Ns(" m s + 1) For the motor in the ES130 these constants are: K s = 165, N = 16, " m = 0.16 A scaling conversion factor of 34.9 Volts/rad is also present in the feedforward path, resulting in the overall transfer function of the motor given by equation (1):

Upload: others

Post on 04-Feb-2022

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ECSE-4760 Computer Applications Laboratory ANALOG AND

1

Rensselaer Polytechnic Institute

ECSE-4760 Computer Applications Laboratory

ANALOG AND DIGITAL CONTROL OF A DC MOTOR

Number of Sessions – 4 INTRODUCTION Over the past several years, the digital computer has been used in a broad range of engineering applications. One of these is in Control Systems. Major advantages of using digital computers in the Control field include the great computational speed and accuracy, the relative ease with which simple parameters or even complete program modules can be modified (with virtually no new equipment cost), and the decision making capability. The last one lately has reached new heights with fuzzy controllers and expert systems, replacing delicate human operators. Large numbers of processes can be controlled simultaneously and effectively by a single computer and detailed reports can be generated, tasks previously unthinkable with an analog computer. The purpose of this experiment is to acquaint the student with the advantages and shortcomings of using microcomputers in Control System applications, by designing and implementing regulators to control the angular position of an armature controlled DC motor made by Feedback Ltd. Both analog and digital designs will be implemented so that direct comparisons can be made of the pros and the cons of each approach. It is assumed that the experimenter is reasonably familiar with the basic principles of analog feedback control, preferably root locus techniques, and can design compensators to satisfy a set of required specifications. PROBLEM FORMULATION The objective of the experiment is to design both analog as well as digital compensators to control the angular position of an armature controlled DC motor. A step input, created by changing the polarity of the motor, will be used as a reference signal. In general an armature controlled motor can be regarded as a linear system over a finite operating range and is described by the following transfer function (p. 1.11 of the ES130 manual appended to this write-up):

!

Gp(s) =

Ks

Ns("ms +1)

For the motor in the ES130 these constants are:

!

Ks= 165, N = 16, "

m= 0.16

A scaling conversion factor of 34.9 Volts/rad is also present in the feedforward path, resulting in the overall transfer function of the motor given by equation (1):

Page 2: ECSE-4760 Computer Applications Laboratory ANALOG AND

2

!

Gp(s) =

360

s(0.16s +1)=

2250

s(s + 6.25) (1)

Due to the age and wear of the Feedback Ltd. ES130 DC servo system, the parameters in equation (1) are not exact. This will lead to discrepancies between the theoretical and actual responses during the course of the experiment when various controller designs are implemented. Because of this, you must justify why your results do not match the theoretical expectations. For extra credit, you may assume

!

Gp(s) =

K

s("ms +1)

and estimate K and � m for a step response for the proportional feedback case. The MATLAB System Identification toolbox provides some functions that will simplify this process. For this motor the following compensators must be designed and implemented:

• A pure proportional feedback controller. • An analog feedback compensator that will force the motor output to satisfy the following

specifications: 1) Overshoot to a step input ≤ 10%. 2) 2% settling time ≤ 0.2 secs. 3) Dead zone at the output ≤ 4˚. • The Tustin digital approximation to the analog compensator designed previously. • A digital controller, using the following design schemes: 1) The minimal prototype design criterion. 2) The ripple free response design criterion.

Note that for the analog part relaxing these requirements slightly permits the design of a controller that can be implemented more easily on a digital computer. To ensure success in obtaining the above desired results, it is very important that the compensator design be done on paper before the implementation is attempted. HARDWARE – SOFTWARE SETUP EQUIPMENT DESCRIPTION Attached at the end of this handout are parts of the ES130 technical manual covering the theory and circuit details regarding the DC motor. Parts of the GP-6 Analog Computer Operator's Manual for details on programming the Comdyna have been included in the course handouts. The student is expected to read both manuals and become familiar with the systems before starting the experiment. The equipment to be used for the experiment consists of the following: 1) An armature controlled DC motor used as the process to be controlled. It is called as such because a constant field current is applied to the motor, and the armature excitation is controlled. This is accomplished by means of an internal feedback path in the servo amplifier. (see p. 5 of the ES130 manual). The servo system TYPE ES 130 manufactured by Feedback Ltd., will provide the motor, the motor power supply, a servo amplifier to drive the motor, the position sensor, and attenuators. 2) The Comdyna analog computer is used to build the analog compensator during the first part of the experiment. All the basic mathematical functions are available here and its usage is straightforward. In case of problems, refer to the Comdyna manual. 3) A PC running the relevant program used to implement the digital compensator. No PC specific knowledge is required other than following the instructions included. 4) A dual trace digital sampling oscilloscope (DSO), for recording the input and motor response. Some experimentation with the time scale will be necessary so that responses are recorded with

Page 3: ECSE-4760 Computer Applications Laboratory ANALOG AND

3

maximum detail. You will want to save the screens of the digital oscilloscope to floppy files. Setting up the hardware connections is relatively straightforward. Figure 1 shows an "extended" block diagram of the whole process containing all the necessary figures and connection links.

FIGURE 1. DC Motor diagram with proportional feedback. The ES130 is divided into two sections, the SC125 control unit and the SA135 servo assembly. The SC125 provides all the electrical networks and amplifiers while the SA135 provides the motor and the sensor. Once you have located these sections on the front panel of the ES130, follow the setup procedure outlined below: • On the SA135, connect socket 1 to socket 4. Connect socket 5 to ground. • On the SC125, socket 1 outputs a voltage proportional to the difference between the input

angular position and the output angular position. The angular difference is multiplied by 34.9 Volts/rad to convert from radians to volts. Thus, if the input dial on the SA135 is moved one radian with respect to the output dial, the voltage at socket 1 of the SC125 will be 34.9 Volts. This voltage can be attenuated by connecting socket 1 to socket 3, and using socket 4 as the input to the compensator (see the warning at the end of the section). The output of the compensator should go to socket 18, an input to the servo amplifier. The servo amplifier in turn drives the motor. Set the control characteristic switch to ARMATURE.

• The motor is not energized unless the power dial is at ARM ON. Thus, if the motor goes into oscillations, turn the dial to H.T. ON. Each time prior to using the motor, check and recalibrate the Zero adjust on the SC125 when the power dial is on H.T. ON.

• To produce the step input required during the control runs, the polarity switch S1 located on the SA135 is flipped from direct to reverse. When the output has settled, return the switch to direct again before the next run.

Even though adequate, the above explanation is by no means complete. The reader is urged to refer to the ES130 manual for a more complete description of setup procedures as well as answers to probable questions. The analog controllers are to be built on the Comdyna computer. Special care must be taken when implementing the gains because of the sign inversions at the output of the amplifiers. The Comdyna dial must be on the Pot Set position during setup; during operation the dial must always be switched back and forth between the Oper and the Pot Set position, at start and end of each run. You should also note that the analog controllers implemented on the Comdyna analog computer may light the "OVLD" lamp when the amps begin to saturate. There is no problem if the indicator flashes on briefly during operation. A sustained overload condition, however, will affect the controller's operation. These effects may be minimized by reducing the input step size or reducing the overall gain of the analog computer block and proportionally boosting the gain on the SC125 input. One of the DSO channels must be connected to the process output SA135 socket 6 (and ground),

Page 4: ECSE-4760 Computer Applications Laboratory ANALOG AND

4

and the other one to the control signal SC125 socket 18 (or channel D/A0 for the discrete part), or to SC125 socket 4 (and ground) to observe the error. Use the maximum voltage range possible for more detailed results. WARNING: Even though the D/A converters are protected from overload, an input voltage in excess of +10 or -10 Volts can result in permanent damage to the A/D converter. It is therefore required that the 0.1 attenuator on the SC125 unit be used, before the % error potentiometer, since the voltage at socket 1 can be as high as 50 Volts. The SC125 should be set up so that socket 1 is connected to socket 3, and socket 4 is connected to the A/D converter. With the above configurations the % error potentiometer must be set to 100%, so that no additional attenuation is inserted. It's suggested that all calculations be done with the original transfer functions (attenuator = 1), and whenever the attenuator .1 is used, the proportional gain is to be augmented accordingly with the amp on the SC125 set to a gain of 10. There will be cases where even though the control signal will be active, no response will take place. If it is suspected that the error signal is too low, then the following procedure must very cautiously (under the TA's presence), be applied: • Turn the % error pot to 10% and flip the .1 attenuator switch to 1.; • Start slowly incrementing the % error pot and run the simulation until the output starts

responding; • Return the settings to their original positions and modify the design so that the proportional

gain is increased; • Try running the experiment again; • If problems persist, try manually adjusting the parameters around their calculated points and

rerun the experiment. The justification for this action stems from the fact that the motor model is a linear function of a nonlinear process and its parameters themselves are estimated.

COMPUTER USAGE To access the PC program do the following: • Turn the PC on in DOS mode (see the Introductory experiment) and go to the DCMOTOR

subdirectory by typing: CD \CStudio\CAL_LAB\DCMOTOR. • Type DCMOTOR to run the program. • After the introductory screen, a Data Input Menu will appear with the variable names on the left

and editable fields on the right. If the cursor does not appear press the Insert key. To move among the fields and edit the data within the fields use the cursor arrows and the regular editing keys (ENTER, Backspace, Delete).

• Unacceptable keystrokes are met with a warning sound, and a basic help screen is available by pressing F1. Be warned that whenever ranges appear next to variable names, they act in an advisory capacity, and it is at the user's discretion to enter meaningful data in the fields.

• When done editing, press the END key to start execution, or ESC to exit the Input menu. During control execution no other key is to be pressed, except CTRL-BREAK which is used to abort the current run.

• Aborting control execution brings you back to the Input Menu for more data entry. • A hard copy (Screen dump) of the data fields can be taken before starting the actual run. To do

this press the Print Screen button. Sampling time T depends on the algorithm used to derive the gains, and for the continuous implementations the general notion is the faster the sampling, the closer the computer controller resembles the analog model (20 msec or less). Sometimes the calculated values for the control signal exceed the ±10 Volts (D/A limits). In these cases a software implemented clipper prevents the D/A control values from "wrapping" around by forcing them to stay at their respective max/min values. Be warned though that if the signal remains at these levels very long (saturated), then erroneous results occur. Try using a different sampling time or coefficients.

Page 5: ECSE-4760 Computer Applications Laboratory ANALOG AND

5

PART I - ANALOG CONTROL PROPORTIONAL FEEDBACK CONTROLLER Even though the model of the motor is assumed linear, nonlinear (static & Coulomb) friction is present in the motor, resulting in a dead zone at the output of the motor, related to the error velocity constant[1] Kv by:

!

Dead Zone (degrees) =250

velocity error constant=

250

Kv

This friction can be modeled as an external disturbance and must be taken into account during the calculations. Figure 2 shows a typical block diagram with the disturbance fn and the proportional gain g, and Figure 3 shows the phase plane trajectories for such a motor. For more information on these figures and the motor friction in general see [2]. The velocity error constant Kv for a type 1 system (one free integrator) is given by equation (2):

!

Kv

=s"0lim sG

c(s)G

p(s) (2)

(Note: for a type 0 system - no free integrators, Kv will be zero.) Prior to designing a dynamic compensator, it would be desirable to try a pure proportional feedback controller of the form u(t) - Ke(t). Despite the fact that this is a type 1 system there is a possible non-zero steady state error that depends on the size of the step input. Can you explain why this occurs? Typical phase plane trajectories are given in Figure 3.

FIGURE 2. Block diagram including friction input.

Notice that once you specify the dead zone, the error velocity constant is specified. Therefore, the system is completely determined for the proportional controller. Also note that the dead zone is twice the maximum absolute value of the steady state error. To experimentally measure the dead zone move the input shaft both clockwise and counterclockwise until the output shaft barely moves and add the two displacements. For a dead zone of 4°, can you meet the specifications of overshoot ≤ 10%, or a settling time ≤ 0.2 secs, one at a time? Why?

Page 6: ECSE-4760 Computer Applications Laboratory ANALOG AND

6

e .

TERMINATION LINE

e

DEAD ZONE

fng—

-fng—

FIGURE 3. Phase plane trajectories for the friction. Even though the questions can be answered by using only the equations in the following section, it will be helpful for further analysis if the root locus for the open loop transfer function

!

Gc(s)G

p(s) is

drawn[3]. Assume that each of the specifications is individually satisfied, solve for the resulting gain Kp and the other parameters and check your results in the locus line (see the example at the end of

PART I). Use [4] for help in computing gain Kp. A detailed presentation of the root locus analysis

can be found in [5]. DYNAMIC FEEDBACK CONTROLLER Since pure proportional feedback cannot produce a closed loop system meeting the specified requirements, a lead compensator (called phase lead because a < b) as in equation (3) is required to relocate the roots of the closed loop characteristic equation of the system. The task is to determine the proper variables a, b, and β to satisfy the given criteria. Note that the relation between the dead zone and the error velocity constant still holds.

!

Gc(s) = "#

(s +a)

(s + b) (3)

The scaling factor β incorporates the proportional gain and the minus sign offsets the -1 gain (= 0.1 × -10) introduced in the feedforward path in order to keep the operational amplifiers on the Comdyna from overloading. The analog computer simulation of the compensator is shown in Figure 4. Since we're dealing with a second order process and a first order compensator, the resulting closed loop transfer function will be of third order. The overshoot and settling time specifications on the other hand, are defined for a second order process, hence a typical strategy is to choose the real

Page 7: ECSE-4760 Computer Applications Laboratory ANALOG AND

7

closed loop transfer function pole so far away in the Left Hand plane, that the remaining (complex conjugate poles) will behave as dominant ones giving a response similar to the regular second order processes.

β

β

FIGURE 4. Analog computer simulation of the compensator.

A general second order process[6] is described by its natural frequency ωn, and the damping ratio ζ as:

!

Gc(S ) =

"n

2

s2

+ 2#"ns +"

n

2 (4)

Important timing measures defined in relation with a second order process are:

Settling Time:

!

Ts

=4

"#n

Peak Time:

!

Tp

="

#n

1$% 2

(5)

and response measures for a step input are:

Peak Response:

!

Mpt

= 1+exp"#$

1"# 2

%

&

' '

(

)

* *

Percent Overshoot:

!

P.O. =M

pt"1

1#100% (6)

There are various design techniques that yield an acceptable compensator satisfying all the specifications for the output, yet it must be noted that no unique solution exists and no first time success is guaranteed; a possible modification of the parameters, by trial and error, until all requirements are met might be necessary. Two techniques will briefly be mentioned here, and the student is urged to use either them or his own favorite one, applying his/her experience and initiative. An extensive analysis of both root-locus and Bode plot (phase-gain margin) techniques, even using different compensator types can be found in [7]. Remember the decisive factor for success or failure of a design is the experimental measuring of the specification values from the saved DSO screen shots! The first technique[8] assumes that the third order process is described by a closed loop transfer function of the form:

!

Y (s)U (s)

="#s+ a

s+ b

Page 8: ECSE-4760 Computer Applications Laboratory ANALOG AND

8

!

T (s) =G

c(s)G

p(s)

1+Gc(s)G

p(s)

="

n

2

(s2+ 2#"

ns +"

n

2 )($s +1) (7)

and imitates a second order one if the real root g of the characteristic equation obeys the following:

!

1

"# 10$%

n (8)

Thus using the specifications given, the coefficients of the model T(s) are computed. Since Gp(s) is known the above equation can in general be solved (coefficient matching) for the unknown polynomial Gc(s). If the transfer function T(s) contains any finite zeros then the closer they are located to the dominant complex poles the less accurate the approximation becomes. The second technique[9] is a classic root locus phase-lead compensator design, and is broken down to the following steps:

1)Translate the design specifications (ζ, ωn) into desired dominant closed loop root locations. 2)Draw the uncompensated transfer function root locus and see if it passes nearby the desired

roots; if yes then evaluate the proportional gain K required by algebraically summing the lengths of the vectors from the open loop poles and zeros to the desired root (root locus magnitude criterion).

3)Else a compensator is needed to modify the locus curves. Place its zero directly under the desired roots.

4)Place the compensator pole in such a location that the algebraic sum of the angles of all vectors from poles and zeros to the desired root is odd multiple of 180° (root locus angle criterion).

5)Evaluate the new gain K as in step (2) and compare the design results with the specifications set. If they are not admissible start the procedure again.

The DC motor compensated open loop transfer function F(s), for use in the root locus is:

!

F(s) = KGc (s)Gp (s) = "s +a

s + b#

2250

s(s + 6.25)=

K(s +a)

s(s + 6.25)(s + b) (9)

The "extended" block diagram for the DC motor containing the compensator block is shown in Figure 5.

137−β -10

10

FIGURE 5. Extended Block Diagram including the compensator.

From (9) it's clear that

!

" =K

2250 (no attenuator taken into consideration here)

The admissibility criterion for any design meeting the P.O. and settling time requirements, will

s+a s+b

Page 9: ECSE-4760 Computer Applications Laboratory ANALOG AND

9

be the error velocity constant Kv which is computed using (2) as:

!

Kv = lims"0

sGc (s)Gp (s) =Ka

6.25b (10)

The student must be warned that the only design that is automatically rendered unacceptable is the pole cancellation process (compensator zeros coinciding with process poles) for reasons[10] [11] extending far beyond the scope of this experiment. The following example should clarify the methods described above, and serve as a model for the DC motor design. EXAMPLE

We are given a second order process

!

Gp(s) =

1

(s +1)(s + 2). A feedback compensator is to be designed

so that the process response satisfies the following specifications: settling time Ts = 0.8 sec; percent overshoot P.O. = 10%; position error constant1

!

Kp

= 100. The specifications are translated using equations (5) and (6) as follows:

!

Ts= 0.8 =

4

"#n

$"#n

= 5 (desired)

!

P.O. = 10 = 100exp"#$

1"# 2

%

&

' '

(

)

* * +# = 0.6

which means

!

" = cos#1$ = 53.13° (desired)

The product

!

"#$n (for 2nd order systems) is equal to the real part of the closed loop complex

conjugate roots. A. Pure Proportional Control

Figure 6 is the root locus of the open loop transfer function

!

F(s) = KGp(s) =

K

(s +1)(s + 2)

The open loop poles p1, p2 are located at -1 and -2. The root locus for the closed loop system consists of two straight line segments that start from -1 and -2 respectively, going towards each other, meet at -1.5 and split, one following a course parallel to the Im[s] axis and the other parallel to the -Im[s] axis. For simplicity only the upper Left Half Plane is shown in Figure 6 as the lower one is symmetric. From the locus it is obvious that any closed loop complex roots will have the -1.5 intersection point as their real part, therefore the settling time requirement cannot be met by any proportional gain. • Satisfying the P.O. requirement yields a

!

" = 0.6 and an angle

!

" = cos#1$ = 53.13°, as shown in

Figure 6. The proportional gain is then calculated by applying the gain criterion (and standard trigonometry), and from the gain the position error constant is evaluated:

!

K = (0.5)2

+ (1.5tan" )2

(#0.5)2

+ (1.5tan" )2

= 4.25

!

Kp

= Gc(0)G

p(0) =

K

2= 2.125

1 The system is of type 0 (no free integrator) hence the error characteristic is defined as the position error constant

!

Kp

= lims"0

Gc(s)G

p(s) .

Page 10: ECSE-4760 Computer Applications Laboratory ANALOG AND

10

!"#n

-1.5

$

Im[s]

-Re[s] -1-2

P1

s1

s'1

P2

#’n

#n

FIGURE 6. Root locus for proportional feedback.

Obviously the position error constant Kp is not satisfied since the resulting 2.125 is far below the required 100. • Satisfying the position error constant immediately defines the gain K. From the gain and equations (5),(6) ζ and θ are calculated, yielding the P.O.:

!

K = 2Kp

= 200

!

200 = (0.5)2

+ (1.5tan" )2

(#0.5)2

+ (1.5tan" )2$ tan" = 9.422

Therefore

!

" = 83.94°# cos" =$ = 0.1055 and

!

P.O. = 71.65% Again the Percent Overshoot is unacceptable compared with the 10% requirement. B. Feedback Compensator Design Method #1. From equation (7) the compensator general solution can be found as:

!

Gc(s)G

p(s)

1+Gc(s)G

p(s)

=T (s)" Gc(s) =

T (s)

[1#T (s)]Gp(s)

The only problem with the above formula is that it doesn't guarantee that the resulting compensator will be a lead compensator, in fact it probably won't be, unless very careful manipulations of the coefficients take place. For the scope of this experiment the analysis will stop here. C. Feedback Compensator Design Method #2.

Figure 7 is the root locus of the transfer function

!

F(s) = Gc (s)Gp ( p) =K(s +a)

(s +1)(s + 2)(s + b) with the

process poles at p1 = -1 and p2 =-2. Since the compensator pole pc = -b and zero zc = -a are variable the locus itself is variable and is not drawn at any instance. Again only the upper Left Hand plane is

Page 11: ECSE-4760 Computer Applications Laboratory ANALOG AND

11

drawn due to symmetry. Two attempts for a solution (pc, zc), (pc', zc') were made and for readability reasons the second attempt was drawn "mirror image like" on the lower Left Half Plane. The student is requested to neglect this inconvenience and assume that all regular upper plane conventions (length and angle signs), are unaltered in this case too. As mentioned before, in order to satisfy the settling time criterion the dominant complex roots must have real parts ≤ -5, defined by the vertical line LM at -5 in Figure 7. In order to satisfy the P.O. criterion � must be ≥ .6 hence the angle � must be less than 53.13° defined by the angle K0N in Figure 7. This means that all admissible solutions should lie on the left of the boundary defined by the points K, L, M, N.

ζ = 1

FIGURE 7. Root locus diagram containing solution trials (pc, zc) & (pc', zc') Let the point s1 (-5, 5) be selected as a closed loop root, and place the compensator zero zc at (-5, 0) according to the method instructions. Applying the locus angle criterion, we find the angle of the compensator pole θc and its position on the -Im[s] axis as follows:

!

"1

= arctan 5

#4= 128.66°, "

2= arctan 5

#3= 120.96°, $

c= 90°

Page 12: ECSE-4760 Computer Applications Laboratory ANALOG AND

12

!

"1 +" 2 +"c#$

c= q180°, (q = 1, 3,5,...)%"

c= 20.34°

therefore

!

pc

= "5"5

tan#c

= "18.49

Applying the locus magnitude criterion the gain K and from it the Kp, are calculated as follows:

!

K =5

2+ (5"1)

25

2+ (5" 2)

25

2+ (18.49"5)

2

52+ 02

= 107.43# Kp

=K

2= 53.72

Comparing the result with the requested Kp = 100 the solution is not accepted. As a second attempt the point sc' (-7, 7) is selected. The compensator zero is placed at zc' (-7, 0). Again the same angle calculations take place:

!

" # 1

= arctan 7

$6= 130.6°, " #

2= arctan 7

$5= 125.54°, " %

c= 90°

!

" # 1 + " # 2 + " # c$ " %

c= q180°, (q = 1, 3,5,...)& " #

c= 13.86°

therefore

!

" p c

= #7 #7

tan " $ c

= #35.37

And the magnitude criterion gives for the K and Kp:

!

K =7

2+ (7 "1)

27

2+ (7 " 2)

27

2+ (35.37 " 7)

2

7 2+ 02

= 331.7 # Kp

=K

2= 165.54

The position error criterion is met since 100 ≤ 165.54, thus the design is acceptable and the unknown compensator coefficients are a = -7 and b = -35.37. The complex conjugate roots of the closed loop transfer function are -7 ± 7j and since the difference between the open loop poles (3) and the zeros (1) is 2, the third real closed loop root can be found[12] from the sum of the poles as:

!

"si= "p

i# s

3$ 7 + j7 $ 7 $ j7 = $35.37 $ 2$1# s

3= $24.37

A final note about the design: from the way the roots were selected it's obvious that there are infinite valid solutions. An important hidden restriction is the power requirements (translated in increased gain K) needed for moving the complex poles to the desired positions. As a compromise, the best solution seems to be an acceptable design with the smallest gain K required. PART II – DIGITAL CONTROL TUSTIN APPROXIMATION Once an acceptable analog compensator has been found, its digital approximation can be derived by using the Tustin approximation, (an approximation of the differential by a difference equation).

By substituting

!

s =2( z "1)

T ( z +1) into the continuous compensator equation (3) a discrete transfer

function is obtained:

!

D( z) = Az +c

z + d (11)

Page 13: ECSE-4760 Computer Applications Laboratory ANALOG AND

13

Since the rest of the experiment will extensively use z-transforms, it is recommended that the student review the relevant material by reading[13] or his/her favorite book. Using an approach similar to that of PART I, a relation between the dead zone and the digital controller D(z) can be found:

!

Dead Zone (in degrees) =0.70

D(1) (12)

This relation will be used to calculate the third specification (velocity error constant). The hardware implementation is exactly the same as in the continuous feedback part (Figure 5), yet now the controller will be implemented on the PC. To setup and execute the program, follow the instructions in the relevant sections. The data input menu consists of the sampling period T, the proportional gain offset A, the discrete compensator zero c and pole d. When calculating the A factor, make sure that the attenuator (.1 or 1.) is taken into consideration. By choosing an appropriate sampling period, you should find a digital approximation that will satisfactory control the motor's position. It is suggested that you begin with a sampling time of about 100 msec and decrease it by steps of 20 msec down to 1 msec. The step input is applied using the S1 switch as before. Watch the oscilloscope traces to note their position when the step is applied (apply the step when the traces cross a line on the screen). MINIMAL PROTOTYPE COMPENSATOR This part of the experiment deals with the design and implementation of a digital controller based on the minimal prototype method[14]. For a zero order hold D/A converter and a system with the transfer function:

!

G(s) =K

v

s("ms +1)

(13)

the corresponding z-transform is given by:

Z

!

G0 (s)G(s){ } = 1" z"1( ) Z

!

G(s)

s

" # $

% & '

or

!

G( z) = Kv

1" z"1( )

Tz"1

(1" z"1 )2

"#

m1"e

"T /# m( )z"1

1" z"1( ) 1" z

"1e"T /# m( )

$

%

& &

'

(

) )

Simplifying the above expression,

!

G( z) = Kv

T

( z "1)"#

m1"e

"T /# m( )z "e

"T /# m( )

$

%

& &

'

(

) ) = 360

T

( z "1)"

0.16 1"e"6.25T( )

z "e"6.25T( )

$

%

& &

'

(

) )

And finally:

!

G( z) = 360 T " 0.16 1"e"6.25T( )[ ]

z "Te

"6.25T" 0.16(1"e

"6.25T )

T " 0.16(1"e"6.25T

)

( z "1)( z "e"6.25T )

For a minimal prototype response to a step input, we want the overall transfer function K(z) to be selected such that

!

1"K( z) = 1" z"1( ) . Therefore

!

K( z) = z"1

Page 14: ECSE-4760 Computer Applications Laboratory ANALOG AND

14

The digital compensator D(z) is related to G(z) by the relation:

!

D( z) =K( z)

G( z)[1"K( z)]

Substitution of K(z) and G(z) gives:

!

D( z) =1

( z "1)G( z)=

1

360 T " 0.16 1"e"6.25T( )[ ]

#z "e

"6.25T

z "Te

"6.25T" 0.16 1"e

"6.25T( )T " 0.16 1"e

"6.25T( )

This controller has the same general form as equation (11) in the discrete approximation. Thus exactly the same procedure is used for this part of the experiment as in the Tustin approximation. It is recommended that appropriate sampling times for this controller range from 1.0 to .01 seconds. Again, record the motor's response by using a DSO between socket 6 of the SA135 and ground, and another channel of the DSO between socket 4 of the SA135 and ground to measure the error. RIPPLE FREE COMPENSATOR The last part of the experiment is to design and run a digital controller based on the ripple free (also called Finite Settling Time) design method[15]. This derivation is based on the z-transform method. A derivation in the time domain may be found in[14]. From the minimal prototype part it is known that the z-transform of the motor response with zero order hold is:

!

G( z) = Kv

T "#m(1"E )[ ]

z "TE "#

m(1"E )

T "#m(1"E )

( z "1)( z "E )

where for clarity:

!

E = e"6.25T

= e"T /# m

Let c equal the zero of G(z), i.e.,

!

c =TE "#

m(1"E )

T "#m(1"E )

(14)

For ripple free response, there are two requirements. The first requirement is the error sequence e2(k) be of finite length, so that K(z) must contain all the zeros of G(z). If the system is to reach steady state within 2 sample periods, the following equation must hold:

!

K( z) = 1"cz"1( ) a0 +a1 z

"1( ) (15)

where a0 and a1 must be determined. The second requirement for Ripple Free response is that the system be able to follow a step input with zero steady state error. This gives the second relation:

!

1"K( z) = 1" z"1( ) 1+ b0 z

"1( ) (16)

To determine a0, a1, and b0 substitute (15) into (16):

!

1" 1"cz"1( ) a

0+a

1z"1( ) = 1" z

"1( ) 1+ b0z"1( )

Page 15: ECSE-4760 Computer Applications Laboratory ANALOG AND

15

and applying coefficient matching:

!

a0

= 0

!

a1

=1

1"c (17)

!

b0

="c

1"c

As previously derived, the compensator transfer function is:

!

D( z) =K( z)

G( z)[1"K( z)]

Substituting equations (15), (16) and (17) in the transfer function above we get:

!

D( z) =

1"cz"1( )

1

1"cz"1

#

$ %

&

' (

Kv

T ")m(1"E )[ ]

z "c

( z "1)( z "E )1" z

"1( ) 1"1

1"cz"1

#

$ %

&

' (

which reduces to:

!

D( z) =

1

1"c( z "E )

Kv[T "#

m(1"E )] z "

c

1"c

$

% &

'

( )

Substituting for c from (14) and further reducing:

!

D( z) =1

KvT (1"E )

#z "E

z +$

m

T"

E

1"E

%

& '

(

) *

gives

!

D( z) =1

360T (1"e"6.25T )

#z "e

"6.25T

z +.16

T"

e"6.25T

1"e"6.25T

$

% &

'

( )

Again this controller has the same general form as equation (11) in the discrete approximation. Thus exactly the same procedure is used for this part of the experiment as in the Tustin approximation. Try to find the useful range of T for this controller. What happens for large values of T (> 2 secs)? Include saved DSO screen shots and compare the response with that of the minimal prototype case for a given T. WRITE-UP The write-up is one of the most important items when an experiment is performed. It is intended that a part of the write-up be done during the lab session. Results of all three parts of the experiment must be submitted in a formal write-up. The following are minimum requirements to be included in the report:

1)Detailed description of the design of the analog compensator and the derivations of the approximation and the discrete compensators, with analytical calculations and explanations of the assumptions made.

Page 16: ECSE-4760 Computer Applications Laboratory ANALOG AND

16

2)Digital oscilloscope printouts of all runs, with appropriate scales and labels (set of coefficients used) with short comments/explanations for each run.

3)Observations regarding the rising time, percent overshoot, settling time, steady state error, dead zone, and even backlash and quantizing error must be noted for each run.

4)Comparisons of the various runs among different controllers using the same sampling period, and among different periods for the same controller.

5)Answer to all questions raised in the handout. 6)A table summarizing the pros and cons of each controller along with its characteristics. This

table should serve as a guide for a "design engineer", so that using his own set of requirements he would be able to select the proper controller.

REFERENCES In addition to context specific references listed below with their relevant numbers on the left, the first two entries contain general information pertaining to the broader area this experiment covers. Melsa, Shultz, Linear Control Systems, McGraw Hill, 1969. Shinners S.M., Modern Control System Theory and Application, Addison Wesley, 1972. [1] Dorf, R. C., Modern control Systems, A. Wesley 1980, pp. 119-122. [2] Cosgriff, R. L., Nonlinear Control Systems, Sections 6.8 and 5.4. [3] Frederick, D. K. and Carlson, A. B., Linear Systems in Communication and Control, J.

Wiley & Sons, 1971, pp. 364-366. [4] Dorf, R. C., Modern control Systems, A. Wesley 1980, p. 118. [5] Frederick, D. K. and Carlson, A. B., Linear Systems in Communication and Control, J.

Wiley & Sons, 1971, pp. 357-369. [6] Dorf, R. C., Modern control Systems, A. Wesley 1980, pp. 112-115. [7] Dorf, R. C., Modern control Systems, A. Wesley 1980, pp. 357-394. [8] Dorf, R. C., Modern control Systems, A. Wesley 1980, pp. 116-119. [9] Dorf, R. C., Modern control Systems, A. Wesley 1980, pp. 372-279. [10] Kailath, T., Linear Systems, Prentice Hall, 1980, pp. 31-35. [11] Frederick, D. K. and Carlson, A. B., Linear Systems in Communication and Control, J.

Wiley & Sons, 1971, pp. 83-84. [12] Frederick, D. K. and Carlson, A. B., Linear Systems in Communication and Control, J.

Wiley & Sons, 1971, pp. 382-383. [13] Cadzow, J. A., and Martens, H. R., Discrete-Time and Computer Control Systems,

Prentice Hall, 1970, Chapter 3. [14] Cadzow, J. A., and Martens, H. R., Discrete-Time and Computer Control Systems,

Prentice Hall, 1970, Chapter 7 and 9. [15] Ragazzini, J. R., and Franklin, G. F., Sampled Data Control Systems, McGraw Hill, 1958,

Chapter 7.

Page 17: ECSE-4760 Computer Applications Laboratory ANALOG AND

17

APPENDIX A – ANALOG COMPUTER WIRING DIAGRAMS

β

β

AMP 1 AMP 8

POT 2

POT 1

POT 3

AMP 7

AMP 2

AMP 6 AMP 4

AMP 3

Page 18: ECSE-4760 Computer Applications Laboratory ANALOG AND

18

Page 19: ECSE-4760 Computer Applications Laboratory ANALOG AND

19

APPENDIX B – Feedback LTD. ES130 Technical Manual Make sure a PDF copy of the manual for the ES130 DC Motor system has been downloaded from the class web site (http:/www.rpi.edu/dept/ecse/cal/WebCT) and has been read in preparation for this experiment.