Outline. Digital Implementation of Analog Controller Design. Digital Control Loop. Indirect Digital Controller Design

Outline • • • • • • Digital Implementation of Analog Controller Design M. Sami Fadali Professor of Electrical Engineering UNR Design analog controll...
Author: Agnes Spencer
0 downloads 0 Views 830KB Size
Outline • • • • • •

Digital Implementation of Analog Controller Design M. Sami Fadali Professor of Electrical Engineering UNR

Design analog controller for analog plant. Map analog to digital controller. Desirable mapping characteristics. Differencing methods. Bilinear transformation. Design Examples.

1

2

Digital Control Loop

Indirect Digital Controller Design 1. 2. 3. •

• •

Design analog controller for analog subsystem. Obtain an equivalent digital controller. Digitally implement the desired control. Digital controller = filter that attenuates some dynamics & accentuates others to obtain the desired time response. Use a recipe from signal processing for Step 2. Differencing methods & bilinear transformation.

3

T Zero-order Hold

kT

R(z) +

kT

E(z)

(k+1)T

Analog Subsystem

U(z) C(z)

Y(z) GZAS(z)



4

Design Procedure 6.1

Transformation Conditions

1. Design analog for analog subsystem to meet desired specs. to digital controller . 2. Map 3. Tune the gain of in the zdomain to meet the design specifications. 4. Check the sampled time response & repeat Steps 1-3, if necessary, until the design specifications are met.

1. Transform stable analog filter (poles in LHP) to stable digital filter (poles inside unit circle). 2. Frequency response of digital filter must closely resemble the frequency response of analog filter in the frequency range = sampling frequency.

5

Forward Differencing

Differencing Methods • • • •

6

Describe analog filter by a transfer function or differential equation. Numerical analysis gives standard approximations of the derivative. Reduce differential equation to difference equation. Obtain the difference equation of a digital filter from the differential equation of an analog filter. 7

• Approximation of Derivative

• 2nd derivative: Apply twice

• Similarly approximate higher order derivatives.

8

Alternative Derivation

Example 6.5 Forward Difference

• Approximation of Derivative

• Apply forward differencing to the 2nd order analog filter.

• Transform • Examine the stability of the resulting digital filter for a stable analog filter.

• Substitute

9

Solution

10

Filter Stability

• Differential equation

• Stable analog filter for positive coefficients . • Instability condition: |constant| >1, in its denominator polynomial

• Substitute for derivatives

For example, unstable digital filters for any underdamped analog filter if T= 0.2 s and rad/s.

• Simplify

11

12

Backward Differencing

Alternative Derivation

• Approximation of Derivative

• Approximation of Derivative

• 2nd derivative: Apply twice

• Transform

• Substitute • Similarly approximate higher order derivatives.

13

14

Solution

Example 6.6 Backward Difference • Apply backward differencing to the 2nd order analog filter

• Examine the stability of the resulting digital filter for a stable analog filter.

• Stability conditions (see Chapter 4)

• Stable for filters. 15

, i.e. for all stable analog 16

Pole-zero Matching

MATLAB

• Pole mapping • Map zeros using the same rule. • Analog filter has poles and zeros: add or zeros at (otherwise there will be time delay) • Adjust the gain to match the analog filter – LPF: match DC gain – BPF: match gain at center frequency to , – HPF: match gain at

• Analog transfer function

• Digital filter: use

to match gains

>> g = c2d(ga,T,’matched’) 17

18

Example 6.7

Solution

Find a pole-zero matched digital filter approximation for the analog filter

• The filter has a zero at the origin and poles at . , • Pole-zero matching transformation

• If and rad/s, determine the transfer function of the digital filter for a sampling period of 0.1 s. Check your answer using MATLAB and obtain the frequency response of the digital filter.





• The analog filter has two zeros at infinity. • Add one for a strictly proper filter: 19

20

Numerical Values

Example 6.7: Frequency Response

• For the given numerical values we have and rad/s

Bode Diagram 10 0

Magnitude(dB)

-10

rad/s

Ga(s)

-20 -30 -40

G(z)

-50 -60

,

-70 -80 0

Filter transfer function

Phase(deg)

-45 -90 -135 -180 -225 -270

-1

10

0

1

10

10

2

10

Frequency (rad/sec)

21

MATLAB >>wn=5;zeta=0.5; % Undamped natural freq, damping ratio >>ga=tf([wn^2],[1,2*zeta*wn,wn^2]) % Analog transf. function Transfer function: 25 -------------s^2 + 5 s + 25 >> g=c2d(ga,.1,'matched') % Transform with T= 0.1 Transfer function: 0.09634 z + 0.09634 ---------------------z^2 - 1.414 z + 0.6065 Sampling time: 0.1 23

22

Bilinear Transformation • First-order Approximation of

• Substitution

24

Frequency Response

Effect of Transformation •

/

Bilinear mapping squeezes the entire frequency response of the analog filter into the frequency range . 1. Distortion (warping) of frequency response. 2. Eliminates aliasing due to the periodic frequency response.

/

/

/

• At the folding frequency /

25

Prewarping • Correct the distortion of the frequency response at a single frequency • (e.g. dB frequency for PI, PD)

• Equal analog and digital if • Only effective if • For small

large.

27

26

Stability • Bilinear transformation guarantees the stability of a digital filter for a stable analog filter • Maps points in the LHP to points inside the unit circle).

28

Solution

Example 6.8

• Bilinear transformation without prewarping

Design a digital filter by applying the bilinear transformation to the analog filter • Bilinear transformation with prewarping

with s. Examine the warping effect and then apply prewarping at the 3-dB frequency.

29

Bode plots

30

Digital PI Control • Bilinearly transform analog PI controller

analog filter (solid), digital filter prewarping (dashed), without prewarping (dash-dot).

31

• Increases system type by one. • Use to improve steady-state error. 32 • Needs zero for acceptable transient response.

Digital PD Control

Corrected PD Controller

• Bilinearly transform analog PD controller

• Approximately realizable digital controller: order of numerator = order of denominator. • Fastest pole at origin. • Least effect on the controller dynamics.

• Use zero to improve the transient response. • Eliminate pole at 1: corresponds to an unbounded frequency response at the folding / frequency 33

Digital PID Controller

34

Corrected PID Controller

• Bilinearly transform analog PID

• Use two zeros to improve the transient response. • Pole at 1 replaced by a pole at 0 (bounded frequency response at folding frequency). • Transfer function (approximately realizable) 35

36

Example 6.9

Solution: Use Procedure 6.1 1. Design analog controller: Zero due to step (type 1 system)  use PI control. • Choose zero for acceptable transient response. • Simplest possible design: pole-zero cancellation

Design a digital controller for the type 0 analog plant to obtain: Zero steady-state error due to unit step,

i. ii. iii. A settling time of about 1 s.

37

Analytical Design

38

Analog Filter

• Closed loop characteristic equation

• Cancel pole with zero and use the gain

• Equate coefficients

• Analog filter TF • Choose for • Typically, must tune gain after filter transformation to obtain the same damping ratio for the digital controller. 39

40

Design Step 2

Bilinear Transformation

• Select a sampling period for • Let

(Chapter 2).

• Analog controller: pole-zero cancellation.

• Analog plant with ADC and DAC

• Digital controller: near pole-zero cancellation for and .

Z

using rlocus • Check the gain for (MATLAB) for the loop gain 41

Design Results

42

Root Locus for PI Design

• Settling time slightly worse than analog control. • Acceptable step response (settling time). • Gain = 47.2 < 51.02, (meets specs). • Tune controller gain after analog to digital controller mapping.

43

44

Step response for PI design K=46.7

Example 6.10 Design a controller for the analog plant for a and

45

Solution: Analog Design

46

Plant+ADC+DAC

• PD controller needed to improve the system transient response.

Sampling period : Z

• Pole-zero cancellation (simple design). • Using a CAD package or solving analytically: rad/s for

47

48

Bilinear Transformation

Root Locus for PD Design



Analog controller: pole-zero cancellation.



Digital controller: near pole-zero cancellation for and .

49

Design Results • For (MATLAB cursor).

50

Time response for PD Design rad/s

• Nonminimum phase: zero outside the unit circle & unstable for high gains. • • Prewarping has negligible effect: rad/s = 3 dB frequency of PD controller rad, 51

52

Example 6.11

Solution

Design a controller for the analog plant for

• zero steady-state error due to a step input  Use PI • For  = 0.3 s, try cancel pole at 1  stable system but   = 2/3 s > 0.3 • Use a PID controller: need two zeros to satisfy design specs.

i.

 < 0.3 s

ii.

Dominant pole

iii.

, and

due to step input.

53

PID Design

54

• • • •

rad/s meets design specs. Let > minimum needed in anticipation of deterioration due to PI control. Design PD controller to meet specs. Angle Condition: controller angle  52.4 Zero Location

n = 6

j

PD: Root locus for Analog System 5

4

3

2

 = 0.7 1

0

-1

 -5

55

-4

-3

-2

-1

0

56

PD Design Results

j

RL of PD Controlled System 6

• Root locus for PD controlled system shows that for rad/s • Meets transient response specs

n = 6

6

5

4

3

• 2nd zero of PID controller at not good. • Tune : Not necessary, only for comparison to digital.

 = 0.7

2

• PID:

1

F

 0 -6

-5

-4

-3

-2

-1

0

57

RL of PID Controlled System

Imaginary Axis (seconds-1)

Plant +DAC + ADC

y Gain: 5.76 Pole: -4.69 4.79i Root+ Locus Damping: 0.7 Overshoot (%): 4.62 Frequency (rad/s): 6.7

6 5

58

• Sampling period :

0.7 4

Z

3 2 1 0 -6

-5

-4

-3

-2

-1

0

Real Axis (seconds-1)

59

60

Bilinear Transformation

RL with Digital PID Control Root Locus 1.5

1

rad/s not

0.5 Imaginary Axis

dominant rad/s resp

0

-0.5

• Time response: high overshoot. • Redesign may be necessary but can be costly.

-1

-1.5 -2.5

-2

-1.5

-1

-0.5

0

0.5

1

Real Axis

61

62

Time Responses: Digital (K=11.4 red, K=7, blue) and Analog (green)

Detail: RL with Digital PID Control Root Locus 1

System: lcl Peak amplitude: 1.12 Overshoot (%): 12.2 At time (sec): 0.2

0.9

Step Response

0.8 1 System: lcl Settling Time (sec): 0.9

0.6

System: l Gain: 11.4 Pole: 0.423 + 0.318i Damping: 0.703 Overshoot (%): 4.49 Frequency (rad/sec): 36.2

0.5 0.4

System: l Gain: 7.03 Pole: 0.751 + 0.122i Damping: 0.861 Overshoot (%): 0.49 Frequency (rad/sec): 12.7

0.3 0.2

0.6

0.4

0.1 0 -0.2

System: gcl Settling Time (sec): 5.81

0.8 Amplitude

Imaginary Axis

0.7

0.2

0

0.2

0.4

0.6

0.8

Real Axis

0

0

1

2

3

4

5

6

Time (sec)

63

64

Suggest Documents