258
Control System Design Introduction K. Craig 1 Control System Design: An Introduction Electrical- Electronics Engineer Controls Engineer Mechatronic System Design Mechanical Engineer Computer Systems Engineer Electro- Mechanics Sensors Actuators Embedded Control Modeling & Simulation

Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 1

Control System Design:

An Introduction

Electrical-ElectronicsEngineer

Controls Engineer

Mechatronic System Design

MechanicalEngineer

ComputerSystemsEngineer

Electro-Mechanics

SensorsActuators

EmbeddedControl

Modeling &Simulation

Page 2: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 2

Topics

• Control System Design Overview

– Fundamental Concepts

• System Inputs

• Step and Sine Inputs

• Transfer Functions and Analogies

• Poles and Zeros of Transfer Functions

• Block Diagrams and Loading Effects

• Time Domain and Frequency Domain

• State-Space Representation

• Linearization of Nonlinear Effects

Page 3: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 3

– Open-Loop Control

• Basic and Feedforward Control

– Closed-Loop Control

• Stability and Performance

• Sensitivity Analysis

• Feedback Control Design Procedure

• PID Control and Digital Implementation

• Pulse Width Modulation

• Parasitic Effects

• Sensor Fusion

• Observers for Measurement and Control

• Advanced Control: Adaptive, Fuzzy Logic

• Trade-Offs & Control Design Performance Limitations

Page 4: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 4

Control System Design Overview

• Classical Control Design (root-locus and frequency

response analysis and design, i.e., transform methods) is

applicable to linear, time-invariant, single-input, single-

output systems. This is a complex frequency-domain

approach. The transfer function relates the input to output

and does not show internal system behavior.

• Modern Control Design (state-space analysis and

design) is applicable to linear or nonlinear, time-varying or

time-invariant, multiple-input, multiple-output systems.

This is a time-domain approach. This state-space system

description provides a complete internal description of the

system, including the flow of internal energy.

Page 5: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 5

• The aim of both techniques is to find a compensation

Gc(s) that satisfies the design specifications.

• Knowledge of both approaches, modern and

classical, is essential to produce the best designs.

Feedback Control System

Gc(s)

H(s)

C(s)

R(s) E(s)

B(s)

M(s)

D(s)

+

+

_+

G(s)A(s)

V(s)

+

+

N(s)

Page 6: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 6

Fundamental Concepts

• System Inputs

• Step and Sine Inputs

• Transfer Functions and Analogies

• Poles and Zeros of Transfer Functions

• Block Diagrams and Loading Effects

• Time Domain and Frequency Domain

• State-Space Representation

• Linearization of Nonlinear Effects

Page 7: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 7

System Inputs

Page 8: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 8

System Inputs

Initial Energy

StorageExternal Driving

PotentialKinetic Deterministic Random

Stationary Unstationary

Transient Periodic"Almost

Periodic"

SinusoidalNon-

Sinusoidal

Input / System / Output

Concept:

Classification of

System Inputs

Page 9: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 9

• Input – some agency which can cause a system to respond.

• Initial energy storage refers to a situation in which a system,

at time = 0, is put into a state different from some reference

equilibrium state and then released, free of external driving

agencies, to respond in its characteristic way. Initial energy

storage can take the form of either kinetic energy or

potential energy.

• External driving agencies are physical quantities which vary

with time and pass from the external environment, through

the system interface or boundary, into the system, and

cause it to respond.

• We often choose to study the system response to an

assumed ideal source, which is unaffected by the system to

which it is coupled, with the view that practical situations

will closely correspond to this idealized model.

Page 10: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 10

• External inputs can be broadly classified as deterministic or

random, recognizing that there is always some element of

randomness and unpredictability in all real-world inputs.

• Deterministic input models are those whose complete time

history is explicitly given, as by mathematical formula or a

table of numerical values. This can be further divided into:

– transient input model: one having any desired shape, but

existing only for a certain time interval, being constant before

the beginning of the interval and after its end.

– periodic input model: one that repeats a certain wave form

over and over, ideally forever, and is further classified as

either sinusoidal or non-sinusoidal.

– almost periodic input model: continuing functions which are

completely predictable but do not exhibit a strict periodicity,

e.g., amplitude-modulated input.

Page 11: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 11

• Random input models are the most realistic input models

and have time histories which cannot be predicted before

the input actually occurs, although statistical properties of

the input can be specified.

– When working with random inputs, there is never any

hope of predicting a specific time history before it

occurs, but statistical predictions can be made that

have practical usefulness.

– If the statistical properties are time-invariant, then the

input is called a stationary random input. Unstationary

random inputs have time-varying statistical properties.

These are often modeled as stationary over restricted

periods of time.

Page 12: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 12

Step and Sine Inputs

• Engineers typically use two inputs to evaluate

dynamic systems: a step input and a sinusoidal input.

• Step Input

– By a step input of any variable, we will always

mean a situation where the system is at rest at

time t = 0 and we instantly change the input

quantity, from wherever it was just before t = 0, by

a given amount, either positive or negative, and

then keep the input constant at this new value

forever. This leads to a transient response called

the step response of the system.

Page 13: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 13

• Sine Input

– When the input to the system is a sine wave, the

steady-state response of the system, after all the

transients have died away, is called the frequency

response of the system.

• These two input types lead to the two views of dynamic

system response: time response and frequency response.

• Why only use these two types of input to evaluate a

dynamic system?

– The practical difficulty is that precise mathematical

functions for actual real-world inputs will not generally

be known in practice. Therefore the random nature of

many practical inputs makes difficult the development

of performance criteria based on the actual inputs

experienced by real system.

Page 14: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 14

– It is thus much more common to base

performance evaluation on system response to

simple "standard" inputs – step input and sine

wave input. This approach has been successful

for several reasons:

• Experience with the actual performance of various

classes of systems has established a good correlation

between the response of systems to these standard

inputs and the capability of the systems to accomplish

their required tasks.

• Design is much concerned with comparison of

competitive systems. This comparison can often be

made nearly as well in terms of standard inputs as for

real inputs.

• Simplicity of form of standard inputs facilitates

mathematical analysis and experimental verifications.

Page 15: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 15

Transfer Functions & Analogies

• Definition and Comments

– The transfer function of a linear, time-invariant,

differential equation system is defined as the ratio of

the Laplace transform of the output (response

function) to the Laplace transform of the input (driving

function) under the assumption that all initial

conditions are zero.

– By using the concept of transfer function, it is

possible to represent system dynamics by algebraic

equations in the Laplace variable s, or the differential

operator D. The highest power of s or D in the

denominator determines the order of the system.

Page 16: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 16

22

2

2

dx d xDx D x

dt dt

x x(x)dt (x)dt dt

D D

2

x 2

d xF M Mx

dt

F(t) Bx Kx Mx

Mx Bx Kx F(t)

+x

F(t)

M

KxB(dx/dt)

M

K

F(t)

B

+x

Physical Model

Free-Body Diagram(x is measured from the

static equilibrium

position)

Differential Operator D

Mass-Spring-Damper

Physical Model

Newton’s 2nd Law

D ↔ s

Laplace Variable s

Page 17: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 17

22

2

2

2

2

Differential Equation

Algebraic Equation

Tra

Mx Bx Kx F(t)

d x dxMD x M =Mx BDx B Bx

dt dt

MD x MDx Kx F(t)

(MD BD K)x F(t)

xnsf

1

F MD BDer Functio

Kn

Using the differential operator D we can transform the

differential equation to an algebraic equation and then write

the transfer function for the system.

Page 18: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 18

– The transfer function is a property of a system itself,

independent of the magnitude and nature of the input

or driving function.

– The transfer function gives a full description of the

dynamic characteristics of the system.

– The transfer function does not provide any information

concerning the physical structure of the system; the

transfer functions of many physically different systems

can be identical.

– If the transfer function of a system is known, the

output or response can be studied for various forms of

inputs with a view toward understanding the nature of

the system.

– If the transfer function of a system is unknown, it may

be established experimentally by introducing known

inputs and studying the output of the system.

Page 19: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 19

Basic Component

Equations

(Constitutive Equations)

in out

out

e e iR

dei C

dt

Kirchhoff’s Current Node Law

R C out

R C

R C

in out out

i i i

i i 0

i i

e e deC

R dt

outout in

outout in

out out in

out

in

deRC e e

dt

dee Ke

dt

De e Ke

e K

e D 1

K 1

RC

Cein eout

iin iout

R

RC Low-Pass Filter

Page 20: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 20

K

fi

B

+v

fo

oo i

dfBf f

K dt

Large Reservoir

Constant Height H

HFlow

Resistance

R

h

Tank

(Area A)

Sp constant gH (bottom of reservoir)

fluid density

g acceleration due to gravity

supply pressure

pS

tankp gh q = volume flow rate

dhRC h H

dt

AC

g

outout in

dee Ke

dt

Analogies

Page 21: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 21

+

-

∫Σ

1

Voltage

eout

External

Voltage

ein

Gain Block

Gain Block

Summation

BlockIntegration

Block

Output

Block

Input

Block

outde

dtK1

Gain Block

oute

outout in

outin out

dee Ke

dt

de 1Ke e

dt

1st – Order System Block Diagram

RC Electrical System

RC K 1

Simulation Block Diagram

Page 22: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 22

The Three Basic Element Input-Output Relationships

Resistor

Damper

Capacitor

Spring

Inductor

Mass

Page 23: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 23

Resistor, Damper

1 1i e v f

R B

e Ri f Bv

qin = i, v

qout = e, f

de 1 df 1i C CDe v Df

dt K dt K

1 Ke i f v

CD D

di dve L LDi f M MDv

dt dt

1 1i e v f

LD MD

Capacitor, Spring

Inductor, Mass

Page 24: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 24

• Step Response and Impulse Response

– The integral of a step input is a ramp and the derivative of a

step input is an impulse.

– An impulse has an infinite magnitude and zero duration and

is mathematical fiction and does not occur in physical

systems.

– If, however, the magnitude of a pulse input to a system is

very large and its duration is very short compared to the

system’s speed of response, then we can approximate the

pulse input by an impulse function. The impulse input

supplies energy to the system in an infinitesimal time.

– The step response of a component or system is the time

response to a step input of some magnitude. The impulse

response of a system is the derivative of the step response

and is the time response to an impulse input of some

strength.

Page 25: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 25

The impulse function is explained by the figure,

where we approximate the step function by a

terminated ramp and then let the rise time of

the ramp approach zero. As we let the ramp

get steeper and steeper, the magnitude of

de/dt approaches infinity, and its duration

approaches zero, but the area under it will

always be es. If es = 1 (a unit step function), its

derivative is called the unit impulse function

with an area or strength equal to one unit. The

step function is the integral of the impulse

function, or conversely, the impulse function is

the derivative of the step function. When we

multiply the impulse function by some number,

we increase the “strength of the impulse”, but

“strength” now means area, not height as it

does for “ordinary” functions.

Page 26: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 26

Step Responses

of the

Three Basic Elements

Page 27: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 27

• Frequency Response

– If the input to a linear system is a sine wave, the

steady-state output (after the transients have died

out) is also a sine wave with the same frequency,

but with a different amplitude and phase angle.

Both amplitude ratio and phase angle change with

frequency.

– The following plots show the frequency response

of the three basic elements.

– Note that a decibel dB = 20 log10 (amplitude ratio).

• 0 dB is an amplitude ratio of 1

• + 6 dB is an amplitude ratio of 2

• - 6 dB is an amplitude ration of ½

• + 20 dB is an amplitude ratio of 10

• - 20 dB is an amplitude ratio of 1/10.

Page 28: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 28

Frequency Response

Page 29: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 29

Frequency Response

Page 30: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 30

qin qout1

KD t

out in in out initial

0

1 1q q q dt q

KD K

in

t

out out initial 0

out out initial

out initial

q Asin t

1q q Asin t

K

A Aq q cos t

K K

A Aq sin t

K 2 K

Frequency Response

Page 31: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 31

Analogies

• Analogies Give Engineers Insight!

– Insight based on fundamentals is the key to

innovative multidisciplinary problem solving.

– A person trying to explain a difficult concept will often say

“Well, the analogy is …” The use of analogies in everyday

life aids in understanding and makes everyone better

communicators. Mechatronic systems depend on the

interactions among mechanical, electrical, magnetic, fluid,

thermal, and chemical elements, and most likely

combinations of these. They are truly multidisciplinary and

the designers of mechatronic systems are from diverse

backgrounds. Knowledge of physical system analogies can

give design teams a significant competitive advantage.

Page 32: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 32

Electrical – Mechanical Analogies

• A signal, element, or system which exhibits mathematical

behavior identical to that of another, but physically

different, signal, element, or system is called an

analogous quantity or analog.

• Let’s explore the common electrical-mechanical analogy.

– These systems are modeled using combinations of pure (only

have the characteristic for which they are named) and ideal

(linear in behavior) elements: resistor (R), capacitor (C), and

inductor (L) for electrical systems and damper (B), spring (K), and

mass (M) for mechanical systems. The variables of interest are

voltage (e) and current (i) for electrical systems and force (f) and

velocity (v) for mechanical systems.

Page 33: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 33

• Force causes velocity, just as voltage causes current.

• A damper dissipates mechanical energy into heat, just as

a resistor dissipates electrical energy into heat.

• Springs and masses store energy in two different ways

(potential energy and kinetic energy), just as capacitors

and inductors store energy in two different ways (electric

field and magnetic field).

• The product (f)(v) represents instantaneous mechanical

power; (e)(i) represents instantaneous electrical power.

2 2 22 2

2 2

1 1 (Kx) 1 f 1 1 qKx Ce

2 2 K 2 K 2 2 C

1 1Mv Li

2 2

Spring

Potential Energy

Mass

Kinetic Energy

Capacitor

Electric Field

Energy

Inductor

Magnetic Field

Energy

Page 34: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 34

Page 35: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 35

Page 36: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 36

force f voltage e

velocity v current i

damper B resistor R

spring K capacitor 1/C

mass M inductor L

Resistor e Ri Damper f Bv

di dvInductor e L Mass f M

dt dt

1Capacitor e idt Spring f K vdt

C

Electrical – Mechanical

Analogies

Page 37: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 37

RC Electrical System Spring-Damper Mechanical System

K

fi

B

+v

fo

C

ein eout

i

iR

in R C

in out

outin out

outout in

out

in

e e e 0

e iR e 0

dee C R e 0

dt

deRC e e

dt

e 1

e RCD 1

i B K

i

i o

oi o

o o i

o

i

f f f 0

f Bv Kx 0

f Bv f 0

ff B f 0

K

Bf f f

K

f 1

BfD 1

K

RC

B

K

Page 38: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 38

Reineout

i

L

i

in L R

in out

outin out

outout in

out

in

e e e 0

die L e 0

dt

ede L e 0

dt R

deLe e

R dt

e 1

LeD 1

R

LR Electrical System Mass-Damper Mechanical System

fi

B

+v

fo M

i B M

i

oi o

o o i

o

i

f f f 0

f Bv M v 0

ff f M 0

B

Mf f f

B

f 1

MfD 1

B

L

R M

B

Page 39: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 39

in L R C

in out

out outin out

2

out outout in2

out S

22in

2

n n

e e e e 0

die L Ri e 0

dt

de dede L C R C e 0

dt dt dt

d e deLC RCdt e e

dt dt

e K1=

1 2e LCD RCD 1D D 1

fi

B

+v

M

K

fo

LRC Electrical System

Mass-Spring-Damper

Mechanical System

Cein i

LR

eout

i K B M

i

o oi o

o o o i

o S

2 2i2

n n

f f f f 0

f Kx Bv M v 0

f ff f B M 0

K K

M Bf f f f

K K

f K1=

M B 1 2fD D 1 D D 1

K K

n S

1 R CK 1

LC 2 L

n S

K B 1K 1

M 2 KM

Page 40: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 40

• We can use this analogy to explain the flow of current and the

changes in voltages in a LC (inductor-capacitor) electrical circuit

– difficult to envision for most mechanical engineers and even

for some electrical engineers – by comparing it to a spring-mass

mechanical system.

– The diagrams on the next two slides are color-coded: green, blue,

purple, and orange diagrams for each system correspond to each

other, as do the vertical lines on the graph indicating capacitor

voltage and inductor current at the four specific instances. By

comparing the motion of the mass – its changing potential energy

corresponding to energy stored in the electric field of the capacitor

and its changing kinetic energy corresponding to energy stored in

the magnetic field of the inductor – one can better understand how

electrical capacitors and inductors function.

• For enhanced multidisciplinary engineering system design and

better communication and insight among the design team

members, the use of analogies is a powerful addition to an

engineer’s toolbox.

Page 41: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 41

eL

i

eC

CL

eL

i = 0

eC

CL

eL

i

eC

CL

i = 0

eC

CL

eL

eL

i

eC

CL

imax

eC = 0CL

eL = 0

eL

i

eC

CL

imax

eC = 0CL

eL = 0

M

K

v = 0

x = +max

M

K

v = max

x = 0

M

K

v = max

x = 0

M

K

v = 0

x = -max

Inductor-Capacitor (LC) ↔ Mass-Spring (MK) Oscillations

Page 42: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 42

eL

i

eC

CL

eL

i = 0

eC

CL

eL

i

eC

CL

i = 0

eC

CL

eL

eL

i

eC

CL

imax

eC = 0CL

eL = 0

eL

i

eC

CL

imax

eC = 0CL

eL = 0

Page 43: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 43

Poles and Zeros of Transfer Functions

• Definition of Poles and Zeros

– A pole of a transfer function G(s) is a value of s

(real, imaginary, or complex) that makes the

denominator of G(s) equal to zero.

– A zero of a transfer function G(s) is a value of s

(real, imaginary, or complex) that makes the

numerator of G(s) equal to zero.

– For Example:2

K(s 2)(s 10)G(s)

s(s 1)(s 5)(s 15)

Poles: 0, -1, -5, -15 (order 2)

Zeros: -2, -10, (order 3)

Page 44: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 44

• Colocated Control System

– All energy storage elements that exist in the

system exist outside of the control loop.

– For purely mechanical systems, separation

between sensor and actuator is at most a rigid

link.

• Noncolocated Control System

– At least one storage element exists inside the

control loop.

– For purely mechanical systems, separating link

between sensor and actuator is flexible.

Page 45: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 45

m0 m1

K

x0 x1

Frictionless Surface

F

1

t 0 1 e

0 1

1 1m m m m

m m

2

0 10 2 2

t e

11 2 2

t e

x (s) m s KG (s)

F(s) m s (m s K)

x (s) KG (s)

F(s) m s (m s K)

G0(s) – Colocated System

G1(s) – Noncolocated System

e

s 0 s 0

Ks i

m

1

Ks i

m

Open-Loop Poles

Open-Loop ZerosColocated System:

Noncolocated System: No Zeros

Rigid Body Mode

Flexible Mode

Page 46: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 46

2

2

2 2

x (s) Ms 2KG(s)

F(s) (Ms 3K)(Ms K)

Colocated Transfer Function

Complex Conjugate Poles1 1

3 3

Ki

M

3Ki

M

Complex Conjugate Zeros2 1

2Ki

M

1 3

2

M MK K K

x2x1

F(t)

Frictionless Surface

Page 47: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 47

M MK K K

M MK K K

M MK K K

1

K

M

3

3K

M

2

2K

M

fixed

undeflected

node

Mode Shapes

Page 48: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 48

• Physical Interpretation of Poles and Zeros

– Complex Poles

• Complex Poles of a colocated control system and

those of a noncolocated control system are identical.

• Complex Poles represent the resonant frequencies

associated with the energy storage characteristics of

the entire system.

• Complex Poles, which are the natural frequencies of

the system, are independent of the locations of

sensors and actuators.

• Complex Poles correspond to the frequencies where

the system behaves as an energy reservoir. Energy

can freely transfer back and forth between the

various internal energy storage elements of the

system.

Page 49: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 49

– Complex Zeros

• Complex Zeros of the two control systems are

quite different and they represent the resonant

frequencies associated with the energy

storage characteristics of a sub-portion of the

system defined by artificial constraints

imposed by the sensors and actuators.

• Complex Zeros correspond to the frequencies

where the system behaves as an energy sink.

• Complex Zeros represent frequencies at which

energy being applied by the input is

completely trapped in the energy storage

elements of a sub-portion of the original

system such that no output can ever be

detected at the point of measurement.

Page 50: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 50

Block Diagrams & Loading Effects

• A block diagram of a system is a pictorial representation

of the functions performed by each component and of the

flow of signals. It depicts the interrelationships that exist

among the various components.

• It is easy to form the overall block diagram for the entire

system by merely connecting the blocks of the

components according to the signal flow. It is then

possible to evaluate the contribution of each component

to the overall system performance.

• A block diagram contains information concerning dynamic

behavior, but it does not include any information on the

physical construction of the system.

Page 51: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 51

• Many dissimilar and unrelated systems can be

represented by the same block diagram.

• A block diagram of a given system is not unique. A

number of different block diagrams can be drawn for

a system, depending on the point of view of the

analysis.

• Blocks can be connected in series only if the output

of one block is not affected by the next following

block. If there are any loading effects between

components, it is necessary to combine these

components into a single block.

Page 52: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 52

Some Rules of Block Diagram Algebra

Page 53: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 53

• The unloaded transfer function is an incomplete

component description.

• To properly account for interconnection effects one

must know three component characteristics:

– the unloaded transfer function of the upstream

component

– the output impedance of the upstream component

– the input impedance of the downstream

component

• Only when the ratio of output impedance Zo over

input impedance Zi is small compared to 1.0, over the

frequency range of interest, does the unloaded

transfer function give an accurate description of

interconnected system behavior.

Page 54: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 54

G1(s)u yG2(s)

1 2o1

i2

Y(s) 1G (s) G (s)

ZU(s)1

Z

o1

i2

Z1

Z

Only if this is true for the frequency

range of interest will loading effects

be negligible.

G1(s) and G2(s) are Unloaded Transfer Functions

Page 55: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 55

• In general, loading effects occur because when

analyzing an isolated component (one with no other

component connected at its output), we assume no

power is being drawn at this output location.

• When we later decide to attach another component to

the output of the first, this second component does

withdraw some power, violating our earlier

assumption and thereby invalidating the analysis

(transfer function) based on this assumption.

• When we model chains of components by simple

multiplication of their individual transfer functions, we

assume that loading effects are either not present,

have been proven negligible, or have been made

negligible by the use of buffer amplifiers.

Page 56: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 56

Passive

RC Low-Pass Filter

Loading Effects Example

Cein eout

iin iout

R

outin

outin

outout

in

ee RCs 1 R

ii Cs 1

e 1 1 when i 0

e RCs 1 s 1

Page 57: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 57

2 RC Low-Pass Filters in Series

Cein

iin

RC eout

iout

R

out

2

in

e 1

e RCs 1 RCs

out1 unloaded 2 unloaded

in

e 1 1G(s) G(s)

e RCs 1 RCs 1

Analysis of Complete Circuit:

Page 58: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 58

in

out

outout

out e 0

inin

in i 0

e RZ

i RCs 1

e RCs 1Z

Output Impedance

Input Impeda i Cs

nce

Cein eout

iin iout

R

Page 59: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 59

out1 loaded 2 unloaded

in

out 1

in 2

2

eG(s) G(s)

e

1 1 1

ZRCs 1 RCs 11

Z

1

RCs 1 RCs

Only if Zout-1 << Zin-2

for the frequency range of interest

will loading effects be negligible.

Page 60: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 60

Time & Frequency Domains

• We have all witnessed how engineers from different

backgrounds describe the same concepts using different

language and different points of view which often can lead

to confusion and ultimately design errors. Being able to

describe concepts, with clarity and insight, in a variety of

ways is essential.

• Time domain and frequency domain are two ways of

looking at the same dynamic system. They are

interchangeable, i.e., no information is lost in changing

from one domain to another. They are complementary

points of view that lead to a complete, clear

understanding of the behavior of a dynamic engineering

system.

Page 61: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 61

• The time domain is a record of the response of a dynamic

system, as indicated by some measured parameter, as a

function of time. This is the traditional way of observing

the output of a dynamic system.

• An example of time response is the displacement of

the mass of the spring-mass-damper system versus

time in response to the sudden placement of an

additional mass (here 50% of the attached mass) on

the attached mass. The resulting response is the step

response of the system due to the sudden application

of a constant force to the attached mass equal to the

weight of the additional mass. Typically when we

investigate the performance of a dynamic system we

use as the input to the system a step input.

Page 62: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 62

Physical System Model

Physical Model Step Response

Time Domain

Page 63: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 63

• Over one hundred years ago, Jean Baptiste Fourier

showed that any waveform that exists in the real world

can be generated by adding up sine waves. By picking

the amplitudes, frequencies, and phases of these sine

waves, one can generate a waveform identical to the

desired signal. While the situation presented below is

contrived, it does illustrate the idea. On the left is a “real-

world” signal and on the right are three signals, the sum of

which is the same as the “real-world” signal.

Real-World Signal Three Component Signals

Page 64: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 64

Real-World Signal Three Component Signals

Any real-world signal can be broken down into a sum of sine waves

and this combination of sine waves is unique.

Every dynamic signal has a frequency spectrum and if we can

compute this spectrum and properly combine it with the system

frequency response, we can calculate the system time response.

Frequency Domain

Page 65: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 65

• Most signals and processes involve both fast and slow

components happening at the same time. In the time

domain (temporal) we measure how long something

takes, whereas in the frequency domain (spectral) we

measure how fast or slow it is. No one domain is always

the best answer, so the ability to easily change domains is

quite valuable and aids in communicating with other team

members.

• To show how the time and frequency domains are the

same, the figure on the next slide shows three axes: time,

amplitude, and frequency. The time and amplitude axes

are familiar from the time domain. The third axis,

frequency, allows us to visually separate the sine waves

that add to give us the complex waveform. Note that

phase information is not represented here.

Page 66: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 66

Relationship between

Time & Frequency Domains

Page 67: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 67

State Space Representation

– A state-determined system is a special class of

lumped-parameter dynamic system such that: (i)

specification of a finite set of n independent

parameters, state variables, at time t = t0 and (ii)

specification of the system inputs for all time t t0 are

necessary and sufficient to uniquely determine the

response of the system for all time t t0.

– The state is the minimum amount of information

needed about the system at time t0 such that its future

behavior can be determined without reference to any

input before t0.

Page 68: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 68

– The state variables are independent variables capable

of defining the state from which one can completely

describe the system behavior. These variables

completely describe the effect of the past history of the

system on its response in the future.

– Choice of state variables is not unique and they are

often, but not necessarily, physical variables of the

system. They are usually related to the energy stored

in each of the system's energy-storing elements, since

any energy initially stored in these elements can affect

the response of the system at a later time.

– State variables do not have to be physical or

measurable quantities, but practically they should be

chosen as such since optimal control laws will require

the feedback of all state variables.

Page 69: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 69

– The state-space is a conceptual n-dimensional

space formed by the n components of the state

vector. At any time t the state of the system may be

described as a point in the state space and the time

response as a trajectory in the state space.

– The number of elements in the state vector is

unique, and is known as the order of the system.

– Since integrators in a continuous-time dynamic

system serve as memory devices, the outputs of

integrators can be considered as state variables that

define the internal state of the dynamic system.

Thus the outputs of integrators can serve as state

variables.

Page 70: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 70

x(t) A(t)x(t) B(t)u(t)

y(t) C(t)x(t) D(t)u(t)

Linear, Time-Varying

B(t)

A(t)

D(t)

C(t)dt

+

++

+

Direct Transmission Matrix

Input Matrix

State Matrix

Output Matrix

x(t)

x(t) y(t)

u(t)Outputs

Inputs

The state-variable equations are a coupled set of first-order ordinary

differential equations. The derivative of each state variable is expressed as

an algebraic function of state variables, inputs, and possibly time.

Page 71: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 71

2

Mx Bx Kx F t

x 1

F MD BD K

x v

1v F Bv Kx

M

0 1 0x x

FK B 1v v

M M M

2

2

1Kx

2

1Mv

2

Spring Potential Energy

Mass Kinetic Energy

Page 72: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 72

L

RC eoutein

iRiout = 0

iL

iC

2

out outout in2

d e deLC RC e e

dt dt

out

2

in

e 1

e LCD RCD 1

2

C

2

L

1Ce

2

1Li

2

Capacitor Electric

Field Energy

Inductor Magnetic

Field EnergyR L C out C

in out

out

out

i i i i e e

die Ri L e

dt

1e idt

C

de i

dt C

in

CC

R 11

ii L LeL

e1e00

C

Page 73: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 73

Linearization of Nonlinear Effects

• Many real-world nonlinearities involve a “smooth”

curvilinear relation between an independent variable x

and a dependent variable y: y = f(x)

• A linear approximation to the curve, accurate in the

neighborhood of a selected operating point, is the

tangent line to the curve at this point. This approximation

is given conveniently by the first two terms of the Taylor

series expansion of f(x):2 2

2

x x x x

x x

df d f (x x)y f (x) (x x)

dx dx 2!

dfy y (x x)

dx

x x

dfy y (x x)

dx

ˆ ˆy Kx

Page 74: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 74

• Often a dependent variable y is related nonlinearly to

several independent variables x1, x2, x3, etc. according to

the relation: y=f(x1, x2, x3, …).

• We may linearize this relation using the multivariable form

of the Taylor series:

1 2 3 1 2 3

1 2 3

1 2 3 1 2 3 1 2 3

1 2 3 1 1 2 2

1 2x ,x ,x , x ,x ,x ,

3 3

3 x ,x ,x ,

1 2 3

1 2 3x ,x ,x , x ,x ,x , x ,x ,x ,

1 1 2 2 3 3

f fy f (x ,x ,x , ) (x x ) (x x )

x x

f(x x )

x

f f fˆ ˆ ˆy y x x x

x x x

ˆ ˆ ˆ ˆy K x K x K x

The partial derivatives can be thought of as the sensitivity of the dependent

variable to small changes in that independent variable.

Page 75: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 75

Electromagnet

Infrared LEDPhototransistor

Levitated Ball

ExampleMagnetic Levitation System

Applications

include magnetic

bearings for

vacuum pumps,

conveyor systems

in clean rooms,

high-speed

levitated trains,

and

electromagnetic

automotive valve

actuators.

Page 76: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 76

2

2

imx mg C

x

At Equilibrium:

Equation of Motion:

2

2

img C

x

2 2 2

2 2 3 2

i i 2 i 2 i ˆˆC C C x C ix x x x

2 2

2 3 2

i 2 i 2 i ˆˆ ˆmx mg C C x C ix x x

2

3 2

2 i 2 i ˆˆ ˆmx C x C ix x

Linearization:

Magnetic Levitation System

+x

i

mg

Electromagnet

Ball (mass m)

2

2

if x,i C

x

Page 77: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 77

Use of Experimental Testing in Multivariable Linearization

0 00 0

m

m 0 0 0 0

i ,yi ,y

f f (i, y)

f ff f i , y y y i i

y i

Page 78: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 78

Control System Types

Everything Needs Controls

for Optimum Functioning!

• Process or Plant

• Process Inputs

‒ Manipulated Inputs

‒ Disturbance Inputs

• Response Variables

Control systems are an integral part

of the overall system and not

after-thought add-ons!

The earlier the issues of control are

introduced into the design process, the

better!

Why Controls?

• Command Following

• Disturbance Rejection

• Parameter Variations

Plant

Manipulated

Inputs

Disturbance

Inputs

Response

Variables

Page 79: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 79

• Classification of Control System Types– Open-Loop

• Basic

• Input-Compensated Feedforward

– Disturbance-Compensated

– Command-Compensated

– Closed-Loop (Feedback)

• Classical

– Root-Locus

– Frequency Response

• Modern (State-Space)

• Advanced

– e.g., Adaptive, Fuzzy Logic

Page 80: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 80

Basic Open-Loop Control System

Satisfactory if:

• disturbances are not too great

• changes in the desire value are not too severe

• performance specifications are not too stringent

Plant

Control

Director

Control

Effector

Desired Value

of

Controlled Variable

Controlled

Variable

Plant Disturbance Input

Plant

Manipulated

Input

Flow of Energy

and/or Material

Page 81: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 81

Open-Loop Input-Compensated Feedforward Control:

Disturbance-Compensated

• Measure the disturbance

• Estimate the effect of the disturbance on the

controlled variable and compensate for it

Plant

Control

Director

Control

Effector

Desired Value

of

Controlled Variable

Controlled

Variable

Plant Disturbance Input

Plant

Manipulated

Input

Flow of Energy

and/or Material

Disturbance

Sensor

Disturbance

Compensation

Page 82: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 82

• Disturbance-Compensated Feedforward

Control

– Basic Idea: Measure important load variables and

take corrective action before they upset the

process.

– In contrast, a feedback controller, as we will see,

does not take corrective action until after the

disturbance has upset the process and generated

an error signal.

– There are several disadvantages to disturbance-

compensated feedforward control:

• The load disturbances must be measured on

line. In many applications, this is not feasible.

Page 83: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 83

• The quality of the feedforward control

depends on the accuracy of the process

model; one needs to know how the

controlled variable responds to changes in

both the load and manipulated variables.

• Ideal feedforward controllers that are

theoretically capable of achieving perfect

control may not be physically realizable.

Fortunately, practical approximations of

these ideal controllers often provide very

effective control.

Page 84: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 84

Open-Loop Input-Compensated Feedforward Control:

Command-Compensated

Based on the

knowledge of plant

characteristics, the

desired value input is

augmented by the

command

compensator to

produce improved

performance.

Plant

Control

Director

Control

Effector

Desired Value

of

Controlled Variable

Controlled

Variable

Plant Disturbance Input

Plant

Manipulated

Input

Flow of Energy

and/or Material

Command

Compensator

Page 85: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 85

• Comments:

– Open-loop systems without disturbance or command

compensation are generally the simplest, cheapest,

and most reliable control schemes. These should be

considered first for any control task.

– If specifications cannot be met, disturbance and/or

command compensation should be considered next.

– When conscientious implementation of open-loop

techniques by a knowledgeable designer fails to yield

a workable solution, the more powerful feedback

methods should be considered.

Page 86: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 86

Closed-Loop (Feedback)

Control System

Open-Loop Control System

is converted to a

Closed-Loop Control System

by adding:

• measurement of the controlled variable

• comparison of the measured and desired values of the

controlled variable

Plant

Control

Director

Control

Effector

Desired Value

of

Controlled Variable

Controlled

Variable

Plant Disturbance Input

Plant

Manipulated

Input

Flow of Energy

and/or Material

Controlled

Variable

Sensor

Page 87: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 87

• Basic Benefits of Feedback Control

– Cause the controlled variable to accurately follow the

desired variable; corrective action occurs as soon as

the controlled variable deviates from the command.

– Greatly reduces the effect on the controlled variable

of all external disturbances in the forward path. It is

ineffective in reducing the effect of disturbances in

the feedback path (e.g., those associated with the

sensor), and disturbances outside the loop (e.g.,

those associated with the reference input element).

– Is tolerant of variations (due to wear, aging,

environmental effects, etc.) in hardware parameters

of components in the forward path, but not those in

the feedback path (e.g., sensor) or outside the loop

(e.g., reference input element).

Page 88: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 88

– Can give a closed-loop response speed much

greater than that of the components from which

they are constructed.

• Inherent Disadvantages of Feedback Control

– No corrective action is taken until after a deviation

in the controlled variable occurs. Thus, perfect

control, where the controlled variable does not

deviate from the set point during load or set-point

changes, is theoretically impossible.

– It does not provide predictive control action to

compensate for the effects of known or

measurable disturbances.

Page 89: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 89

– It may not be satisfactory for processes with large

time constants and/or long time delays. If large

and frequent disturbances occur, the process may

operate continually in a transient state and never

attain the desired steady state.

– In some applications, the controlled variable

cannot be measured on line and, consequently,

feedback control is not feasible.

• For situations in which feedback control by itself is

not satisfactory, significant improvements in control

can be achieved by adding feedforward control.

Page 90: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 90

Gc(s)

H(s)

C(s)

R(s) E(s)

B(s)

M(s)

D(s)

+

+

_+

G(s)A(s)

V(s)

+

+

N(s)

Feedback Control System Block Diagram

c

B(s)G (s)G(s)H(s)

E(s)

c

C(s)G (s)G(s)

E(s)

c

c

G (s)G(s)C(s)

R(s) 1 G (s)G(s)H(s)

c

C(s) G(s)

D(s) 1 G (s)G(s)H(s)

c

c

G (s)G(s)H(s)C(s)

N(s) 1 G (s)G(s)H(s)

Closed

Loop

Open Loop

Feedforward

Page 91: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 91

Stability and Performance

• If a system in equilibrium is momentarily excited by command

and/or disturbance inputs and those inputs are then removed,

the system must return to equilibrium if it is to be called

absolutely stable.

• If action persists indefinitely after excitation is removed, the

system is judged absolutely unstable.

• If a system is stable, how close is it to becoming unstable?

Relative stability indicators are gain margin and phase margin.

• If we want to make valid stability predictions, we must include

enough dynamics in the system model so that the closed-loop

system differential equation is at least third order.

– An exception to this rule involves systems with dead times,

where instability can occur when the dynamics (other than

the dead time itself) are zero, first, or second order.

Page 92: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 92

• The analytical study of

stability becomes a

study of the stability of

the solutions of the

closed-loop system’s

differential equations.

• A complete and general

stability theory is based

on the locations in the

complex plane of the

roots of the closed-loop

system characteristic

equation, stable

systems having all of

their roots in the LHP.

Page 93: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 93

• Results of practical use to engineers are mainly limited to

linear systems with constant coefficients, where an exact

and complete stability theory has been known for a long

time.

• Exact, general results for linear time-variant and

nonlinear systems are nonexistant. Fortunately, the

linear time-invariant theory is adequate for many practical

systems.

• For nonlinear systems, an approximation technique

called the describing function technique has a good

record of success.

• Digital simulation is always an option and, while no

general results are possible, one can explore enough

typical inputs and system parameter values to gain a high

degree of confidence in stability for any specific system.

Page 94: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 94

• Two general methods of determining the presence of

unstable roots without actually finding their numerical

values are:

– Routh Stability Criterion

• This method works with the closed-loop

system characteristic equation in an algebraic

fashion.

– Nyquist Stability Criterion

• This method is a graphical technique based on

the open-loop frequency response polar plot.

• Both methods give the same results, a statement of

the number (but not the specific numerical values) of

unstable roots. This information is generally

adequate for design purposes.

Page 95: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 95

• This theory predicts excursions of infinite magnitude for

unstable systems. Since infinite motions, voltages,

temperatures, etc., require infinite power supplies, no

real-world system can conform to such a mathematical

prediction, casting possible doubt on the validity of our

linear stability criterion since it predicts an impossible

occurrence.

• What actually happens is that oscillations, if they are to

occur, start small, under conditions favorable to and

accurately predicted by the linear stability theory. They

then start to grow, again following the exponential trend

predicted by the linear model. Gradually, however, the

amplitudes leave the region of accurate linearization,

and the linearized model, together with all its

mathematical predictions, loses validity.

Page 96: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 96

• Since solutions of the now nonlinear equations are usually

not possible analytically, we must now rely on experience

with real systems and/or nonlinear computer simulations

when explaining what really happens as unstable

oscillations build up.

• First, practical systems often include over-range alarms

and safety shut-offs that automatically shut down

operation when certain limits are exceeded. If certain

safety features are not provided, the system may destroy

itself, again leading to a shut-down condition. If safe or

destructive shut-down does not occur, the system usually

goes into a limit-cycle oscillation, an ongoing,

nonsinusoidal oscillation of fixed amplitude. The wave

form, frequency, and amplitude of limit cycles is governed

by nonlinear math models that are usually analytically

unsolvable.

Page 97: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 97

• Most of our discussion of performance will involve

rather specific mathematical performance criteria

whereas the ultimate success of a controlled process

generally rests on economic considerations which are

difficult to calculate.

• This rather nebulous connection between the

technical criteria used for system design and the

overall economic performance of the manufacturing

unit results in the need for much exercise of judgment

and experience in decision making at the higher

management levels.

• Control system designers must be cognizant of these

higher-level considerations but they usually employ

rather specific and relatively simple performance

criteria when evaluating their designs.

Page 98: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 98

• Control System Objective

– C follow desired value V and ignore disturbances

– Technical performance criteria must have to do

with how well these two objectives are attained

• Performance depends both on system characteristics

and the nature of V, D, and N.

Gc(s)

H(s)

C(s)

R(s) E(s)

B(s)

M(s)

D(s)

+

+

_+

G(s)A(s)

V(s)

+

+

N(s)

Basic Linear Feedback System

Page 99: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 99

• The practical difficulty is that precise mathematical functions

for V, D, and N will not generally be known in practice.

• Therefore the random nature of many practical commands

and disturbances makes difficult the development of

performance criteria based on the actual V, D, and N

experienced by real system.

• It is thus much more common to base performance

evaluation on system response to simple "standard" inputs

such as steps, ramps, and sine waves.

• This approach has been successful for several reasons:

– In many areas, experience with the actual performance of

various classes of control systems has established a

good correlation between the response of systems to

standard inputs and the capability of the systems to

accomplish their required tasks.

Page 100: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 100

– Design is much concerned with comparison of

competitive systems. This comparison can often

be made nearly as well in terms of standard

inputs as for real inputs.

– Simplicity of form of standard inputs facilitates

mathematical analysis and experimental

verifications.

– For linear systems with constant coefficients,

theory shows that the response to a standard

input of frequency content adequate to exercise

all significant system dynamics can then be used

to find mathematically the response to any form of

input.

Page 101: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 101

• Standard performance criteria may be classified as

falling into two categories:

– Time-Domain Specifications: Response to steps,

ramps, and the like, e.g., step response criteria

rise time, peak time, percent overshoot, settling

time, decay ratio, and steady-state error.

– Frequency-Domain Specifications: Concerned

with certain characteristics of the system

frequency response, e.g., bandwidth, peak

amplitude ratio, gain margin, and phase margin.

Page 102: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 102

• Both time-domain and frequency-domain design

criteria generally are intended to specify one or the

other of:

– speed of response

– relative stability

– steady-state errors

• Both types of specifications are often applied to the

same system to ensure that certain behavior

characteristics will be obtained.

• All performance specifications are meaningless

unless the system is absolutely stable.

Page 103: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 103

• It is important to realize that, because of model

uncertainties, it is not merely sufficient for a system to

be stable, but rather it must have adequate stability

margins.

• Stable systems with low stability margins work only

on paper; when implemented in real time, they are

frequently unstable.

• The way uncertainty has been quantified in classical

control is to assume that either gain changes or

phase changes occur. Typically, systems are

destabilized when either gain exceeds certain limits

or if there is too much phase lag (i.e., negative phase

associated with unmodeled poles or time delays).

• The tolerances of gain or phase uncertainty are the

gain margin and phase margin.

Page 104: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 104

• Consider the following design problem:

– Given a plant transfer function G2(s), find a

compensator transfer function G1(s) which yields

the following:

• stable closed-loop system

• good command following

• good disturbance rejection

• insensitivity of command following to modeling

errors (performance robustness)

• stability robustness with unmodeled dynamics

• sensor noise rejection

Page 105: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 105

• Without closed-loop stability, a discussion of

performance is meaningless. It is critically important

to realize that the compensator is actually designed

to stabilize a nominal open-loop plant. Unfortunately,

the true plant is different from the nominal plant due

to unavoidable modeling errors.

• Knowledge of modeling errors should influence the

design of the compensator.

• We assume here that the actual closed-loop system

is absolutely stable.

Page 106: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 106

Desired Shape for Open-Loop

Transfer Function

Smooth transition from the low to high-frequency range, i.e., -20 dB/decade

slope near the gain crossover frequency

Frequencies for good

command following,

disturbance reduction,

sensitivity reduction

Sensor noise,

unmodeled high-

frequency dynamics

are significant here.

Gain below this level

at high frequencies

Gain above this level

at low frequencies

• stable closed-loop system

• good command following

• good disturbance rejection

• insensitivity of command

following to modeling

errors (performance

robustness)

• stability robustness with

unmodeled dynamics

• sensor noise rejection

Open-Loop Shaping

Linear, Time-Invariant Systems

Page 107: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 107

Instability in Feedback Control Systems

• All feedback systems can become unstable if

improperly designed.

• In all real-world components there is some kind of

lagging behavior between the input and output,

characterized by ’s and n’s.

• Instantaneous response is impossible in the real

world!

• Instability in a feedback control system results from

an improper balance between the strength of the

corrective action and the system dynamic lags.

Page 108: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 108

Example• Liquid level C in a tank is

manipulated by controlling

the volume flow rate M by

means of a three-position

on/off controller with error

dead space EDS.

• Transfer function 1/As

between M and C

represents conservation of

volume between volume

flow rate and liquid level.

• Liquid-level sensor

measures C perfectly but

with a data transmission

delay dt. Tank Liquid-Level Feedback Control System

Area A

+M -M

EDS

C(t)

Page 109: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 109

MatLab / Simulink Block Diagram

M = 5, A = 2, tau_dt = 0.2 : unstable

M = 3, A = 2, tau_dt = 0.1 : stable

Tank Level Feedback Control System

Three-PositionOn-Off Controller

Transport Delay

SumStep Input

Sign

s

1/A

Plant

M

M

M

Flow RateDead Zone

C

C

B

B

Strength of corrective action is represented by M (also by 1/A).

System dynamic lag is represented by dt.

Page 110: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 110

0 0.5 1 1.5 2 2.5 30

0.5

1

1.5

2

2.5

3

3.5

time (sec)

signal C: solid

signal B: dotted

signal 0.1*M: dashed

Stable Behavior of the Tank Liquid-Level

Feedback Control System

C

B

M

Page 111: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 111

0 0.5 1 1.5 2 2.5 3-0.5

0

0.5

1

1.5

2

2.5

3

3.5

time (sec)

signal C: solid

signal B: dotted

signal 0.1*M: dashed

Unstable Behavior of the Tank Liquid-Level

Feedback Control System

C

B

M

Page 112: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 112

Sensitivity Analysis

• Consider the function y = f(x). If the parameter x

changes by an amount x, then y changes by the

amount y. If x is small, y can be estimated from

the slope dy/dx as follows:

• The relative or percent change in y is y/y. It is

related to the relative change in x as follows:

dyy x

dx

y dy x x dy x

y dx y y dx x

Page 113: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 113

• The sensitivity of y with respect to changes in x is

given by:

• Thus

• Usually the sensitivity is not constant. For example,

the function y = sin(x) has the sensitivity function:

y

x

x dy dy / y d(ln y)S

y dx dx / x d(ln x)

y

x

y xS

y x

y

x

x dy x xcos(x) xS cos(x)

y dx y sin(x) tan(x)

Page 114: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 114

• Sensitivity of Control Systems to Parameter

Variation and Parameter Uncertainty

– A process, represented by the transfer function G(s),

is subject to a changing environment, aging,

ignorance of the exact values of the process

parameters, and other natural factors that affect a

control process.

– In the open-loop system, all these errors and

changes result in a changing and inaccurate output.

– However, a closed-loop system senses the change

in the output due to the process changes and

attempts to correct the output.

– The sensitivity of a control system to parameter

variations is of prime importance.

Page 115: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 115

– Accuracy of a measurement system is affected by

parameter changes in the control system

components and by the influence of external

disturbances.

– A primary advantage of a closed-loop feedback

control system is its ability to reduce the system’s

sensitivity.

– Consider the closed-loop system shown. Let the

disturbance D(s) = 0.

Gc(s)

H(s)

C(s)R(s) E(s)

B(s)

M(s)

D(s)

+

+

_+

G(s)

Page 116: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 116

– An open-loop system’s block diagram is given by:

– The system sensitivity is defined as the ratio of

the percentage change in the system transfer

function T(s) to the percentage change in the

process transfer function G(s) (or parameter) for a

small incremental change:

T

G

C(s)T(s)

R(s)

T / T T GS

G / G G T

C(s)R(s)Gc(s) G(s)

Page 117: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 117

– For the open-loop system

– For the closed-loop system

c

T

G c

c

C(s)T(s) G (s)G(s)

R(s)

T / T T G G(s)S G (s) 1

G / G G T G (s)G(s)

c

c

T

G

2cc c c

c

G (s)G(s)C(s)T(s)

R(s) 1 G (s)G(s)H(s)

T / T T GS

G / G G T

1 G 1

G G(1 G GH) G 1 G GH

1 G GH

Page 118: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 118

– The sensitivity of the system may be reduced

below that of the open-loop system by increasing

GcGH(s) over the frequency range of interest.

– The sensitivity of the closed-loop system to

changes in the feedback element H(s) is:

c

c

T

H

2

c c

2cc c

c

G (s)G(s)C(s)T(s)

R(s) 1 G (s)G(s)H(s)

T / T T HS

H / H H T

(G G) G GHH

G G(1 G GH) 1 G GH

1 G GH

Page 119: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 119

– When GcGH is large, the sensitivity approaches

unity and the changes in H(s) directly affect the

output response. Use feedback components that

will not vary with environmental changes or can

be maintained constant.

– As the gain of the loop (GcGH) is increased, the

sensitivity of the control system to changes in the

plant and controller decreases, but the sensitivity

to changes in the feedback system (measurement

system) becomes -1.

– Also the effect of the disturbance input can be

reduced by increasing the gain GcH since:

c

G(s)C(s) D(s)

1 G (s)G(s)H(s)

Page 120: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 120

• Therefore:

– Make the measurement system very accurate and

stable.

– Increase the loop gain to reduce sensitivity of the

control system to changes in plant and controller.

– Increase gain GcH to reduce the influence of

external disturbances.

• In practice:

– G is usually fixed and cannot be altered.

– H is essentially fixed once an accurate

measurement system is chosen.

– Most of the design freedom is available with

respect to Gc only.

Page 121: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 121

• It is virtually impossible to achieve all the design

requirements simply by increasing the gain of Gc.

The dynamics of Gc also have to be properly

designed in order to obtain the desired performance

of the control system.

• Very often we seek to determine the sensitivity of the

closed-loop system to changes in a parameter

within the transfer function of the system G(s). Using

the chain rule we find:

• Very often the transfer function T(s) is a fraction of

the form:

T T G

GS S S

N(s, )T(s, )

D(s, )

Page 122: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 122

– Then the sensitivity to (0 is the nominal value)

is given by:

0 0

T N DT / T ln T ln N ln DS S S

/ ln ln ln

Page 123: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 123

Feedback Control System Design

Procedure

• Control Engineering is an important part of the design

process of most dynamic systems.

• The deliberate use of feedback can:

– Stabilize an otherwise unstable system

– Reduce the error due to disturbance inputs

– Reduce the tracking error while following a command

input

– Reduce the sensitivity of a closed-loop transfer

function to small variations in internal system

parameters

Page 124: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 124

• Remember that the purpose of control is to aid the

product or process – the mechanism, the robot, the

chemical plant, the aircraft, or whatever – to do its

job.

• Engineers must take into account early in their plans

the contribution of control to the design process!

More and more systems are being designed so that

they will not work without feedback!

• Control system design begins with a proposed

product or process whose satisfactory dynamic

performance depends on feedback for:

– Stability

– Disturbance Regulation

– Tracking Accuracy

– Reduction of the Effects of Parameter Variations

Page 125: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 125

• Having a general step-by-step approach for feedback

control system design serves two purposes:

– It provides a useful starting point for any real-

world controls problem.

– It provides meaningful checkpoints once the

design process is underway.

System

Design

System Dynamics

&

Control Structure

Page 126: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 126

Other Components

Communications

ComputationSoftware, Electronics

Operator

InterfaceHuman Factors

ActuationPower Modulation

Energy Conversion

Physical SystemMechanical, Fluid, Thermal,

Chemical, Electrical,

Biomedical, Civil, Mixed

InstrumentationEnergy Conversion

Signal Processing

Modern

Multidisciplinary

Engineering

System

Simultaneous

Optimization

of all

System Components

Page 127: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 127

Electrical-ElectronicsEngineer

Controls Engineer

Multidisciplinary System Design

MechanicalEngineer

ComputerSystemsEngineer

Electro-Mechanics

SensorsActuators

EmbeddedControl

Modeling &Simulation

Social Scientists

&

Non-Technical Experts

Business

Experts

Problem-

Specific

Engineers

Physicists, Chemists,

Mathematicians, &

Computer Scientists

Multidisciplinary Engineering System Design Team

Page 128: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 128

• Sequence of Steps for Feedback Control System

Design

1. Understand the process and translate dynamic

performance requirements into time, frequency, or pole-

zero specifications.

– What is the system and what is it supposed to do?

– The importance of understanding the process cannot

be overemphasized!

– Do not confuse the approximation with the reality!

– You must be able to:

• Use the simplified model for its intended purpose

• Return to an accurate model or the actual physical

system to really verify the design performance

Page 129: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 129

Examples of Dynamic Performance Requirements

Time Response Frequency Response

Pole-Zero

Page 130: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 130

2. Select the types and number of sensors considering

location, technology, functional performance,

physical properties, quality factors, and cost.

– If you can’t observe it, you can’t control it!

– Which variables are important to control?

– Which variables can physically be measured?

– Select sensors that indirectly allow a good

estimate to be made of the critical unmeasurable

variables.

– It is important to consider sensors for the

disturbances, e.g., in chemical processes, it is

often beneficial to sense a load disturbance

directly because improved performance can be

obtained if this information is fed forward to the

controller.

Page 131: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 131

3. Select the types and number of actuators

considering location, technology, functional

performance, physical properties, quality factors,

and cost.

– In order to control a dynamic system, you must be

able to influence the response. The actuator does

this.

– Before choosing a specific actuator, consider

which variables can be influenced.

– The actuators must be capable of driving the

system so as to meet the required performance

specifications.

Page 132: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 132

4. Make a linear model of the process, actuator, and

sensor.

– Take the best choice for process, actuator, and sensor.

– Identify the equilibrium point of interest.

– Construct a small-signal dynamic model valid over the

range of frequencies included in the performance

specifications.

– Validate this model with experimental measurements

where possible.

– Express the model in many forms: state-variable, pole-

zero, and frequency-response forms.

– Simplify and reduce the order of the model, if necessary.

– Quantify model uncertainty.

Page 133: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 133

5. Make a simple trial design based on concepts of

lead-lag compensation or PID control.

– To form an initial estimate of the complexity of the

design problem, sketch a frequency-response

(Bode) plot and a root-locus plot with respect to

plant gain.

– If the plant-actuator-sensor model is stable and

minimum phase, the Bode plot will probably be

the most useful; otherwise, the root locus shows

very important information with respect to

behavior in the right-half plane.

– Try to meet specifications with a simple controller

of the lead-lag, PID variety.

– Do not overlook feedforward of the disturbances.

– Consider the effect of sensor noise.

Page 134: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 134

6. Consider modifying the plant itself for improved closed-

loop control.

– Based on the simple control design, evaluate the source

of the undesirable characteristics of system

performance.

– Reevaluate the specifications, the physical configuration

of the process, and the actuator and sensor selections in

light of the preliminary design. Return to step 1 if

improvement seems necessary or feasible.

– It may be much easier to meet specifications by altering

the process than to meet them by control strategies

alone!

– Consider all parts of the design, not only the control

logic, to meet the specifications in the most cost-

effective way.

Page 135: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 135

7. Make a trial pole-placement design based on optimal

control or other criteria.

– If the trial-and-error compensators do not give entirely

satisfactory performance, consider a design based on

optimal control.

– Select the location for your control poles that balance

system performance and control effort.

– Select the location for the estimator poles that

represent a compromise between sensor and process

noise.

– Plot the corresponding open-loop frequency response

and the root locus to evaluate the stability margins of

this design and its robustness to parameter changes.

– Compare this optimal design with the transform-

method design and select the better of the two.

Page 136: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 136

8. Build a computer model and simulate the performance of

the design.

– After reaching the best compromise among process

modification, actuator and sensor selection, and controller

design choice, run a simulation of the system.

– Include important nonlinearities, parasitic effects, and

parameter variations you expect to find during operation.

– Design iterations should continue until the simulation

confirms acceptable stability and robustness.

– As the design progresses, more complete and detailed

models (“truth models”) will be used.

– Digital control implementation should be taken into account.

– If the performance is not satisfactory, return to step 1 and

repeat. Consider modifying the plant itself for improved

closed-loop control.

Page 137: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 137

9. Build a prototype and test it.

– The proof of the pudding is in the eating!

– Simulation without experimental verification is at

best questionable and at worst useless!

– At this point you verify the quality of the model,

discover unexpected effects, and consider ways to

improve the design.

– Implement the controller using an embedded

software/hardware.

– Tune the controller, if necessary.

– After these tests, you may want to reconsider the

sensor, actuator, and process and return to step 1.

Page 138: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 138

• This outline is an approximation of good practice.

• One very important consideration (Step 6) was for

changing the plant itself to make the control problem

easier and provide maximum closed-loop

performance.

– In many cases, proper plant modifications can

provide additional damping or increase the

stiffness, change in mode shapes, reduction of

system response to disturbances, reduction of

Coulomb friction, change in thermal capacity or

conductivity, and so on.

– Designing the system and “throwing it over the

wall” to the control group is inefficient and flawed!

– System design and control design must be done

simultaneously!

Page 139: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 139

Digital Implementation of PID Control

Anti-Aliasing

FilterSensor

Plant /

ProcessActuator

A/D

Converter

D/A

Converter

Digital

Computer

Sampling

System

Digital Set Point

Sampled &

Quantized

Measurement

Sampled & Quantized

Control Signal

Sampling

Switch

Power Domain

Information Domain

Page 140: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 140

• Advantages of Digital Control

– The current trend toward using dedicated,

microprocessor-based, and often decentralized

(distributed) digital control systems in industrial

applications can be rationalized in terms of the major

advantages of digital control:

• Digital control is less susceptible to noise or

parameter variation in instrumentation because

data can be represented, generated, transmitted,

and processed as binary words, with bits

possessing two identifiable states.

Page 141: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 141

• Very high accuracy and speed are possible

through digital processing. Hardware

implementation is usually faster than software

implementation.

• Digital control can handle repetitive tasks

extremely well, through programming.

• Complex control laws and signal conditioning

methods that might be impractical to

implement using analog devices can be

programmed.

• High reliability can be achieved by minimizing

analog hardware components and through

decentralization using dedicated

microprocessors for various control tasks.

Page 142: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 142

• Large amounts of data can be stored using

compact, high-density data storage methods.

• Data can be stored or maintained for very long

periods of time without drift and without being

affected by adverse environmental conditions.

• Fast data transmission is possible over long

distances without introducing dynamic delays,

as in analog systems.

• Digital control has easy and fast data retrieval

capabilities.

• Digital processing uses low operational

voltages (e.g., 0 - 12 V DC).

• Digital control has low overall cost.

Page 143: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 143

Digital Signals are:

• discrete in time

• quantized in amplitude

You must understand the effects of:

• sample period

• quantization size

Discrete

in

Time

Continuous

in

Time

Discrete

in

Amplitude

D-D

D-C Continuous

in

Amplitude

C-D

C-C

Page 144: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 144

• In a real sense, the problems of analysis and design

of digital control systems are concerned with taking

into account the effects of the sampling period, T,

and the quantization size, q.

• If both T and q are extremely small (i.e., sampling

frequency 50 or more times the system bandwidth

with a 16-bit word size), digital signals are nearly

continuous, and continuous methods of analysis and

design can be used.

• It is most important to understand the effects of all

sample rates, fast and slow, and the effects of

quantization for large and small word sizes.

• It is worthy to note that the single most important

impact of implementing a control system digitally is

the delay associated with the D/A converter, i.e., T/2.

Page 145: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 145

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.2

0.4

0.6

0.8

1

1.2

1.4

time (sec)

am

plit

ud

e:

co

ntin

uo

us a

nd

qu

an

tize

d

Simulation of Continuous and Quantized Signal

Page 146: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 146

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

time (sec)

am

plit

ud

e

Continuous Output and D/A Output

Page 147: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 147

• Aliasing

– The analog feedback signal coming from the sensor

contains useful information related to controllable

disturbances (relatively low frequency), but also may

often include higher frequency "noise" due to

uncontrollable disturbances (too fast for control

system correction), measurement noise, and stray

electrical pickup. Such noise signals cause

difficulties in analog systems and low-pass filtering is

often needed to allow good control performance.

Page 148: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 148

– In digital systems, a phenomenon called aliasing

introduces some new aspects to the area of noise

problems. If a signal containing high frequencies is

sampled too infrequently, the output signal of the

sampler contains low-frequency ("aliased")

components not present in the signal before

sampling. If we base our control actions on these

false low-frequency components, they will, of course,

result in poor control. The theoretical absolute

minimum sampling rate to prevent aliasing is 2

samples per cycle; however, in practice, rates of

about 10 are more commonly used. A high-

frequency signal, inadequately sampled, can produce

a reconstructed function of a much lower frequency,

which can not be distinguished from that produced by

adequate sampling of a low-frequency function.

Page 149: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 149

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2-0.5

-0.4

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

0.4

0.5

time (sec)

am

plit

ud

e:

an

alo

g a

nd

sa

mp

led

sig

na

ls

Simulation of Continuous and Sampled Signal

Page 150: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 150

PID Control & Digital Implementation

• A digital controller differs from an analog controller in that

the signals must be sampled and quantized.

• A signal to be used in digital logic needs to be sampled

first; then the samples need to be converted by an analog-

to-digital (A/D) converter into a quantized digital number.

• Once the digital computer has calculated the proper next

control signal value, this value needs to be converted into a

voltage and held constant or otherwise extrapolated by a

digital-to-analog converted (D/A) in order to be applied to

the actuator of the process.

• The control signal is not changed until the next sampling

period.

Page 151: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 151

• As a result of the sampling, there are more strict limits on

the speed or bandwidth of a digital controller than on

analog devices.

• A reasonable rule of thumb for selecting the sampling

period is that during the rise time of the response to a

step, the input to the discrete controller should be

sampled approximately 6 times. By adjusting the

controller for the effects of sampling, the sampling can

be adjusted to 2 to 3 times per rise time. This

corresponds to a sampling frequency that is 10 to 20

times the system’s closed-loop bandwidth.

• The quantization of the controller signals introduces an

equivalent extra noise into the system, and to keep this

interference at an acceptable level, the A/D converter

usually has an accuracy of 10 to 12 bits.

Page 152: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 152

• We will consider a simplified technique for finding a

discrete (sampled, but not quantized) equivalent to a

given continuous controller.

• The method depends on the sampling period Ts being

short enough that the reconstructed control signal is

close to the signal that the original analog controller

would have produced.

• We also assume that the numbers used in the digital

logic have enough accurate bits so that the quantization

implied in the A/D and D/A processes can be ignored.

• Finding a discrete equivalent to a given analog controller

is equivalent to finding a recurrence equation for the

samples of the control which will approximate the

differential equation of the controller.

Page 153: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 153

• The assumption is that we have the transfer function of an

analog controller and wish to replace it with a discrete

controller that will accept samples of the controller input

e(kTs), from a sampler and, using past values of the control

signal, u(kTs), and present and past values of the input,

e(kTs), will compute the next control signal to be sent to the

actuator.

• Let’s consider the PID controller, as an example. The

proportional-integral-derivative (PID) controller is the most

widely used controller in use today. It can stabilize a

system, increase the speed of response of a system, and

reduce steady-state errors of a system. t

P I D0

IP D

de(t)u(t) K e(t) K e( )d K

dt

KU(s) K K s E(s)

s

Page 154: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 154

• Proportional Control

– Virtually all controllers have a large proportional gain.

While we will see that derivative gain can provide

incremental improvements at high frequencies, and

integral gain improves performance at lower

frequencies, the proportional gain is the primary actor

across the entire frequency range of operation.

– Here the manipulating variable U is directly

proportional to the actuating signal E.

– The corrective effort is made proportional to system

"error"; large errors engender a stronger response

than do small ones. We can vary in a continuous

fashion the energy and/or material sent to the

controlled process.

Page 155: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 155

– Proportional control exhibits nonzero steady-state

errors for even the least-demanding commands and

disturbances.

• Why is this so? Suppose for an initial equilibrium

operating point xc = xv and steady-state error is

zero. Now ask xc to go to a new value xvs. It

takes a different value for the manipulated input U

to reach equilibrium at the new xc. When the

manipulated input U is proportional to the

actuating signal E, a new U can only be achieved

if E is different from zero which requires xc xv;

thus, there must be a steady-state error.

P P

P s s P s s

u (t) K e(t)

u (kT T ) K e(kT T )

Page 156: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 156

• Integral Control

– When a proportional controller can use large loop

gain and preserve good relative stability, system

performance, including those on steady-state error,

may often be met.

– However, if difficult process dynamics such as

significant dead times prevent use of large gains,

steady-state error performance may be

unacceptable.

– When human process operators notice the existence

of steady-state errors due to changes in desired

value and/or disturbance they can correct for these

by changing the desired value ("set point") or the

controller output bias until the error disappears. This

is called manual reset.

Page 157: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 157

– Integral control is a means of removing steady-state

errors without the need for manual reset. It is

sometimes called automatic reset.

– If the value of e(t) is doubled, then the value of u(t)

varies twice as fast.

– For e(t) = 0, u(t) remains stationary.

– We have seen why proportional control suffers from

steady-state errors. We need a control that can

provide any needed steady output (within its design

range, of course) when its input (system error) is

zero.

II

t

I0

Kdu(t) U(s)K e(t)

dt E(s) s

u(t) K e( )d

Page 158: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 158

Integral control has the undesirable side effects of

reducing response speed and degrading stability.

Proportional vs. Integral Control

Page 159: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 159

– Although integral control is very useful for removing

or reducing steady-state errors, it has the undesirable

side effect of reducing response speed and

degrading stability.

– Why? Reduction in speed is most readily seen in the

time domain, where a step input (a sudden change)

to an integrator causes a ramp output, a much more

gradual change.

– Stability degradation is most apparent in the

frequency domain (Nyquist Criterion) where the

integrator reduces the phase margin by giving an

additional 90 degrees of phase lag at every

frequency, rotating the (B/E)(i) curve toward the

unstable region near the -1 point.

Page 160: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 160

– Occasionally an integrating effect will naturally

appear in a system element (actuator, process, etc.)

other than the controller.

– These gratuitous integrators can be effective in

reducing steady-state errors. Although controllers

with a single integrator are most common, double

(and occasionally triple) integrators are useful for the

more difficult steady-state error problems, although

they require careful stability augmentation.

– Conventionally, the number of integrators between E

and C in the forward path has been called the system

type number.

Page 161: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 161

In addition to the number of

integrators, their location (relative

to disturbance injection points)

determines their effectiveness in

removing steady-state errors.

In Figure (a) the integrator gives

zero steady-state error for a step

command but not for a step

disturbance.

By relocating the integrator as in

Figure (b), either or both step

inputs Vs and Us can be

"canceled" by M without requiring

E to be nonzero.

Integrators must be located upstream

from disturbance-injection points if they

are to be effective in removing steady-

state errors due to disturbances.

Location is not significant for steady-

state errors caused by commands.

Page 162: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 162

– Integral control can be used by itself or in combination

with other control modes. Proportional + Integral (PI)

Control is the most common mode.

– Integral gain provides DC and low-frequency stiffness.

When a DC error occurs, the integral gain will move to

correct it. The higher the gain, the faster the correction.

Fast correction implies a stiffer system.

– Don’t confuse DC stiffness with dynamic stiffness. A

system can be quite stiff at DC and not stiff at all at high

frequencies! Higher integral gains will provide higher

DC stiffness but will not substantially improve stiffness

at or above the loop bandwidth.

Page 163: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 163

– PI controllers are more complicated to implement than P

controllers. Saturation becomes more complicated, as

integral wind-up must be avoided. In analog controllers,

clamping diodes must be added, and in digital

controllers, saturation algorithms must be coded.

– Integral gain can cause instability. In the open loop, the

integral, with its 90º phase lag, reduces phase margin.

In the time domain, the common result of adding integral

gain is overshoot and ringing. As a result, larger

integral gains usually reduce bandwidth.

Page 164: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 164

s s

s s s

s

kT T

I s s I0

kT kT T

I I0 kT

I s I

sI s I s s s

u (kT T ) K e( )d

K e( )d K e( )d

u (kT ) K [area under e( )over one period]

Tu (kT ) K e(kT T ) e(kT )

2

Graphical Interpretation

of Numerical

Integration:

Area of Trapezoid

Page 165: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 165

• Derivative Control

– Proportional and integral control actions can be used

as the sole effect in a practical controller.

– But the various derivative control modes are always

used in combination with some more basic control law.

This is because the derivative mode produces no

corrective effect for any constant error, no matter how

large, and therefore would allow uncontrolled steady-

state errors.

– One of the most important contributions of derivative

control is in system stability augmentation. If absolute

or relative stability is the problem, a suitable derivative

control mode is often the answer.

– The stabilization or "damping" aspect can easily be

understood qualitatively from the following discussion.

Page 166: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 166

– Invention of integral control may have been

stimulated by the human process operators’ desire to

automate their task of manual reset. Derivative

control hardware may first have been devised as a

mimicking of human response to changing error

signals. Suppose a human process operator is given

a display of system error E and has the task of

changing manipulated variable M (say with a control

dial) so as to keep E close to zero.

Page 167: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 167

– If you were the operator, would you produce the same

value of M at t1 as at t2? A proportional controller would

do exactly that.

– A stronger corrective effect seems appropriate at t1 and

a lesser one at t2 since at t1 the error E is E1,2 and

increasing, whereas at t2 it is also E1,2 but decreasing.

– The human eye and brain senses not only the ordinate

of the curve but also its trend or slope. Slope is clearly

dE/dt, so to mechanize this desirable human response

we need a controller sensitive to error derivative.

– Such a control can, however, not be used alone since it

does not oppose steady errors of any size, as at t3, thus

a combination of proportional + derivative control, for

example, makes sense.

Page 168: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 168

– The relation of the general concept of derivative

control to the specific effect of viscous damping in

mechanical systems can be appreciated from the

figure below.

– Here an applied torque T tries to control position of

an inertia J. The damper torque on J behaves

exactly like a derivative control mode in that it always

opposes velocity d/dt with a strength proportional to

d/dt making motion less oscillatory.

Page 169: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 169

– Derivatives of E, C, and almost any available signal

in the system are candidates for a useful derivative

control mode.

– First derivatives are most common and easiest to

implement.

– The noise-accentuating characteristics of derivative

operations may often require use of approximate

(low-pass filtered) derivative signals.

– Derivative signals can sometimes be realized better

with sensors directly responsive to the desired value,

rather than trying to differentiate an available signal.

– In addition to stability augmentation, derivative

modes may also offer improvements in speed of

response and steady-state errors.

Page 170: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 170

– The derivative gain advances the phase of the loop

by virtue of the 90º phase lead of a derivative. Using

derivative gain will usually allow the system

responsiveness to increase, allowing the bandwidth

to nearly double in some cases.

– Derivative gain has high gain at high frequencies. So

while some derivative gain does help the phase

margin, too much hurts the gain margin by adding

gain at the phase crossover frequency, typically a

high frequency. This makes the derivative gain

difficult to tune. The designer sees overshoot

improve because of increased phase margin, but a

high-frequency oscillation, which comes from

reduced gain margin, becomes apparent.

Page 171: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 171

– Derivatives are also very sensitive to noise. The

derivative gain needs to followed by a low-pass filter

to reduce noise content. However, the lower break

frequency of the filter, the less benefit can be gained

from the derivative gain.

– Proportional + Derivative Control

– Derivative control has an anticipatory character,

however, it can never anticipate any action that has

not yet taken place.

– Derivative control amplifies noise signals and may

cause a saturation effect in the actuator.

P D

P D

de(t)u(t) K e(t) K

dt

U(s)K K s

E(s)

Page 172: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 172

– In the derivative term, the roles of u and e are

reversed from integration and a consistent

approximation can be written down at once.

sI s s I s I s s s

Tu (kT T ) u (kT ) K e(kT T ) e(kT )

2

Integration

sD s s D s D s s s

Tu (kT T ) u (kT ) K e(kT T ) e(kT )

2

Differentiation

Page 173: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 173

• Z Operator

– The Laplace Transform variable s is a differential

operator. The Z Transform variable z is a prediction

operator or a forward-shift operator.

– Consider the integral term.

s

s s

U(z) is the transfrom of u(kT )

zU(z) is the transform of u(kT T )

sI s s I s I s s s

sI I I

sI I

Tu (kT T ) u (kT ) K e(kT T ) e(kT )

2

TzU (z) U (z) K zE(z) E(z)

2

T z 1U (z) K E(z)

2 z 1

Page 174: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 174

– The derivative term is the inverse of the integral term.

– The complete discrete PID controller is thus

described by:

– The effect of the discrete approximation in the z-

domain is as if everywhere in the analog transfer

function the operator s has been replaced by the

composite operator

– The discrete equivalent to Da(s) is

D D

s

2 z 1U (z) K E(z)

T z 1

sP I D

s

T z 1 2 z 1U(z) K K K E(z)

2 z 1 T z 1

s

2 z 1

T z 1

d a

s

2 z 1D (z) D

T z 1

Page 175: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 175

• Example Problem

– The closed-loop system has a rise time of about 0.2

seconds and an overshoot of about 20%.

– What is the discrete equivalent of this controller?

Compare the step responses and control signals of

the two systems. Consider a sample period of 0.07

seconds (about three samples per rise time) and a

sample period of 0.035 seconds (about 6 samples

per rise time).

Y 45G s Plant Transfer Function

U (s 9)(s 5)

U s 6D s 1.4 PI Controller Transfer Function

E s

Page 176: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 176

d s

1.21z 0.79D (z) 1.4 for T 0.07

z 1

u(k 1) u(k) 1.4 1.21e(k 1) 0.79e(k)

d s

1.105z 0.895D (z) 1.4 for T 0.035

z 1

u(k 1) u(k) 1.4 1.105e(k 1) 0.895e(k)

Page 177: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 177

Output Response Control Signals

Page 178: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 178

Pulse Width Modulation

• Pulse width modulation (PWM) is a technique in which a

series of digital pulses is used to control an analog

circuit. The length and frequency of these pulses

determines the total power delivered to the circuit. PWM

signals are most commonly used to control DC motors,

but have many other applications ranging from controlling

valves or pumps to adjusting the brightness of an LED.

• The digital pulse train that makes up a PWM signal has a

fixed frequency and varies the pulse width to alter the

average power of the signal. The ratio of the pulse width

to the period is referred to as the duty cycle of the signal.

Page 179: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 179

– For example, if a PWM signal has a 10 ms period

and its pulses are 2 ms long, that signal is said to

have a 20 percent duty cycle.

• PWM can be used to reduce the total amount of

power delivered to a load without losses normally

incurred when a power source is limited by resistive

means. This is because the average power delivered

is proportional to the modulation duty cycle. With a

sufficiently high modulation rate, passive electronic

filters can be used to smooth the pulse train and

recover an average analog waveform.

Page 180: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 180

• High frequency PWM power control systems are easily

realizable with semiconductor switches. The discrete

on/off states of the modulation are used to control the

state of the switch(es) which correspondingly control

the voltage across or current through the load.

• The major advantage of this system is the switches

are either off and not conducting any current, or on

and have (ideally) no voltage drop across them. The

product of the current and the voltage at any given

time defines the power dissipated by the switch, thus

(ideally) no power is dissipated by the switch.

Realistically, semiconductor switches are non-ideal

switches, but high efficiency controllers can still be

built.

Page 181: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 181

A PWM signal is generated by comparing a triangle wave

signal with a DC signal.

This 3-Op-Amp Circuit produces a triangular wave and a

variable-pulse-width output.

U1A and U1B form a triangle-wave generator. U1B is a

comparator.

Page 182: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 182

Waveforms created

by the 3-Op-Amp

Circuit

U1A is configured as an integrator and U1B as a

comparator with hysteresis. At power up, the

comparator’s output voltage is assumed to be zero.

Page 183: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 183

Using PWM to Generate Analog Output

• PWM can be used as an inexpensive digital-to-

analog (D/A) converter. A wide variety of

microcontroller applications exist that need analog

output but do not require high-resolution D/A

converters.

• Conversion of PWM waveforms to analog signals

involves the use of analog low-pass filters.

• In a typical PWM signal, the frequency is constant,

but the pulse width (duty cycle) is a variable. The

pulse width is directly proportional to the amplitude of

the original unmodulated signal.

Page 184: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 184

Typical PWM Waveform

Frequency Spectrum

of a

PWM Signal

External Low-Pass Filter

PWM BWF K F

K 1

Page 185: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 185

Signal BW

4 kHZ

PWM

K = 5

PWM BWF K F 20kHz

Choose the -3 dB point

at 4 kHz

51RC 3.98(10 )

2 f

R 4.0k C 0.01 F

10

2

f 20kHz

1dB 20log 14.2dB

2 f RC 1

If the -14 dB attenuation will not suffice, a higher-order active low-

pass filter may be necessary or a higher PWM frequency.

Page 186: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 186

1/tau = 10 Hz = 62.8 rad/s

PWM Frequency K = 5, 10, 15, 20

PWM Low -Pass Filter Demonstration

Transfer FcnRC Low-Pass Filter

1

0.0159s+1Analog

PWM

Start

0

PWM

Amplitude

Frequency (hz)

Start Time (s)

Duty %

PWM Output

Frequency (Hz)

200

Duty (%)

50

Amplitude

1

Simulink Simulation

Page 187: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 187

0 0.05 0.1 0.15 0.2 0.250

0.1

0.2

0.3

0.4

0.5

0.6

0.7

time (sec)

am

plit

ude

Response of Low-Pass Filter (1/tau = 10 Hz) to PWM Signal (50% Duty, 50 Hz)

0 0.05 0.1 0.15 0.2 0.250

0.1

0.2

0.3

0.4

0.5

0.6

0.7

time (sec)

am

plit

ude

Response of Low-Pass Filter (1/tau = 10 Hz) to PWM Signal (50% Duty, 100 Hz)

Page 188: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 188

0 0.05 0.1 0.15 0.2 0.250

0.1

0.2

0.3

0.4

0.5

0.6

0.7

time (sec)

am

plit

ude

Response of Low-Pass Filter (1/tau = 10 Hz) to PWM Signal (50% Duty, 150 Hz)

0 0.05 0.1 0.15 0.2 0.250

0.1

0.2

0.3

0.4

0.5

0.6

0.7

time (sec)

am

plit

ude

Response of Low-Pass Filter (1/tau = 10 Hz) to PWM Signal (50% Duty, 200 Hz)

Page 189: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 189

1/tau = 91 Hz = 571 rad/s

PWM LR Circuit Demonstration

Transfer FcnLR Circuit

R = 0.04 OhmsL = 70 micro-henries

1/.04

0.00175s+1

Transfer FcnLR Circuit

R = 0.04 OhmsL = 70 micro-henries

1/.04

0.00175s+1

Current_Step

Current_PWM

PWM

Step50% of 1 V

Start

0

PWM

Amplitude

Frequency (hz)

Start Time (s)

Duty %

PWM Output

Frequency (Hz)

30000

Duty (%)

50

Amplitude

1

Simulink Simulation

Page 190: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 190

0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.020

2

4

6

8

10

12

14

time (sec)

curr

ent

(am

ps)

Response of LR Circuit (tau = 0.00175) to Step Input 0.5 volts

Page 191: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 191

What should the PWM switching frequency be so that the

current waveform is within P% of the step response?

TR

t Rt 2

L L

step

T TR R

2 2

L L

TR

2

L

R PI i Ie Ie Ie 1 I

e 100

P PIe 1 I Ie 1 I

100 100

P 2L Pe 1 T ln 1

100 R 100

Rf

P2Lln 1

100

Percentage Frequency

1 28.4 kHz

5 5.6 kHz

10 2.7 kHz

20 1.3 kHz

50 412 Hz

Page 192: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 192

0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.020

2

4

6

8

10

12

14

time (sec)

curr

ent

(am

ps)

Response of LR Circuit (tau = 0.00175) to Step Input 0.5 volts and PWM 2.7 kHz

Page 193: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 193

0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.020

2

4

6

8

10

12

14

time (sec)

curr

ent

(am

ps)

Response of LR Circuit (tau = 0.00175) to Step Input 0.5 volts and PWM 28.4 kHz

Page 194: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 194

Parasitic Effects

• Parasitic effects are present in all real-world systems

and are troublesome to account for when the

systems are designed. They are rarely disabling

alone, but are debilitating if not dealt with effectively.

• These effects include:Coulomb Friction

Time Delay

Saturation

Compliance / Resonance

Backlash

Nonlinearity

Noise

Quantization

Page 195: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 195

• Questions:

– Are they significant?

• While individually they may not be debilitating, in

combination they might be.

• Also, implementing solutions to any of these

effects might exacerbate other effects.

– What to do about them?

• Approaches:

– Ignore them and hope for the best! Murphy’s Law says

ignore them at your own peril.

– Include the parasitic effects that you think may be

troublesome in the truth model of the plant and run

simulations to determine if they are negligible.

– If they are not negligible and can adversely affect your

system, you need to do something – but what?

Page 196: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 196

• General Remedies:

– Alter the design to reduce the effective loop gain

of the controller, especially at high frequencies

where the effects of parasitics are often

predominant. This generally entails sacrifice in

performance.

– Techniques specifically intended to enhance

robustness of the design are also likely to be

effective, but may entail use of a more

complicated control algorithm.

Page 197: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 197

Sensor Fusion

• When measuring a particular variable, a single type

of sensor for that variable may not be able to meet all

the required performance specifications.

• We sometimes combine several sensors into a

measurement system that utilizes the best qualities of

each individual device.

• Thus, sensors complement each other, giving rise to

the name complementary filtering. Another name is

sensor fusion and a more advanced version of a

similar idea is called Kalman filtering.

Page 198: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 198

• Basic Concept

– If a time-varying signal is applied to both a low-pass

filter and a high-pass filter, and if the two filter output

signals are summed, the summed output signal is

exactly equal to the input signal.

1

s 1

s

s 1

qi qi

+

+

Low-Pass Filter

High-Pass Filter

Page 199: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 199

-60

-50

-40

-30

-20

-10

0

Magnitu

de (

dB

)

10-2

10-1

100

101

102

-90

-45

0

45

90

Phase (

deg)

Bode Diagram

Frequency (rad/sec)

Page 200: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 200

Page 201: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 201

– The high-pass filter and the low-pass filter do not

have to be the simple filters shown. An example of

“stronger” filters would be:

• Mechatronics Example: Absolute Angle

Measurement

– The two basic sensors used are a micro-electro-

mechanical (MEMS) rate gyro using piezoelectric

tuning forks (no spinning wheel) and an inclinometer.

2

3 2

3s 3s 1Low Pass Filter

s 3s 3s 1

3

3 2

sHigh Pass Filter

s 3s 3s 1

Page 202: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 202

– The inclinometer measures tilt angle relative to gravity

vertical by immersing two circular sector capacitance

plates in a dielectric liquid. Angular tilting causes one

pair of plates to increase capacitance and the other to

decrease. These capacitance changes cause a

frequency change in an oscillator, which is then

converted to a pulse-width-modulated (PWM) signal.

By low-pass filtering the PWM signal, a DC voltage

proportional to tilt angle is obtained.

– A rate gyro gives a DC voltage output proportional to

angular velocity, with a flat frequency response to

about 50 Hz. Op-amp analog integration would give us

angular position, but the bias error in the rate gyro,

when integrated, quickly gives an unacceptable, ever-

increasing drift of the position signal.

Page 203: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 203

– The inclinometer does not suffer from a drift problem

(no integration is involved) and can thus be used to

correct for the gyro drift problem. It cannot, however,

be used by itself for angle measurements in

applications that require a fast response (like

measuring vehicle or robotic motions) since it is a

first-order instrument with low bandwidth, typically 0.5

Hz to 6 Hz, too slow for many applications.

– The two sensors are thus good candidates for a

complementary-filtering application, giving both

angular position and angular velocity data over about

a 50-Hz bandwidth with negligible drift.

Page 204: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 204

– While the configuration of the separate high-pass and

low-pass filters is most useful for explaining the basic

concept of complementary filtering, the practical

implementation uses instead a feedback type of

configuration that produces identical differential

equations and transfer functions.

– Also, realistic sensor models should be used for

analysis and simulation purposes. The inclinometer is

modeled as a first-order system (e.g., Ki =1, time

constant = 0.3). The rate gyro is modeled as a second-

order system (e.g., Kg = 1, damping ratio = 0.5, and

natural frequency = 50 Hz).

g g

gsensor sensori

2gactual i actual

2

n n

K sKInclinometer Rate Gyro

2 sss 11

Page 205: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 205

– The gyro bias error is taken as a constant (e.g., 0.005

rad/s) and the inclinometer noise is taken as a small

random signal.

– The complementary filter has two adjustments: ωn

which we take to be 0.2 rad/s and ζ which we take to

be 0.7. The major effect is that of ωn; larger values

correct bias effects more quickly but filter noise

effects less effectively.

– To test out this algorithm, we will take the input angle

to be zero for the first 20 seconds to see how the

system “fights out” the gyro bias and attenuates the

inclinometer noise. At 20 seconds, the input angle

steps up to 1.0 radian, so we can see the response to

sudden changes.

Page 206: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 206

Page 207: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 207

– Analyzing this block diagram results in the following

equation:

– This is how the Watson Vertical Reference System is

implemented. The description of that system is

shown on the next page.

2

2

n nm rg rg _ b inc inc _ n2 2

2 2

n n n n

s 2 s1

s 2 s s 2 s1 1

High-Pass Filter Low-Pass Filter

Page 208: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 208

Page 209: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 209

Sensor Fusion

theta_rg

UncorrectedGyro Angle

StepInputAngle

Sine Wave

Num_rg(s)

Den_rg(s)

Rate Gyro TF

theta_inc

NoisyInclinometer

Angle

theta_m

MeasuredAngle

Manual Switch

1/s

1/s

1/s

Num_inc(s)

Den_inc(s)

Inclinometer TF

2*zeta*omega_n

(omega_n) 2̂

gyro_bias

Constant

Band-LimitedWhite Noise

theta_actual

ActualAngle

Simulink Simulation

Page 210: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 210

0 5 10 15 20 25 30 35 40 45 50-0.2

0

0.2

0.4

0.6

0.8

1

1.2

1.4

time (sec)

angle

(ra

dia

ns)

Comparison: Integrated Rate-Gyro Angle and Corrected Angle (Noisy Inclinometer Angle Not Shown)

Corrected Angle

Uncorrected Angle

Page 211: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 211

Observers

• Controls and Sensors

– Sensors measure the quantity under control.

– We often assume the availability of near-perfect

feedback signals. This assumption is often

invalid.

• Four Common Problems Caused By Sensors

– Sensors and associated cabling are expensive.

– Sensors plus associated cabling reduce control

system reliability.

Page 212: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 212

– Some signals are impractical to measure or are

inaccessible.

– Sensors usually induce significant errors, e.g.,

noise, cyclical errors, limited responsiveness.

• Observers

– Augment or replace sensors in a control system.

– They are algorithms that combine sensed signals

with other knowledge of the control system to

produce observed signals which can be more

accurate, less expensive to produce, and more

reliable than sensed signals.

– They are an alternative to adding new sensors or

upgrading existing ones.

Page 213: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 213

• Observed Signals, compared to sensed signals, can be:

– More accurate

– Less expensive to produce

– More reliable

• Observer Advantages:

– Remove sensors which reduces cost and improves

reliability.

– Improve the quality of signals that come from sensors

allowing performance enhancement.

• Observer Disadvantages:

– Can be complicated to implement.

– Expend computational resources.

– Because observers form software control loops, they

can become unstable under certain conditions.

Page 214: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 214

• Design Issues

– Select observer technique for a given system

– How much will observer improve performance?

– Additional cost?

– Limitations of observers?

– Will observer be useful and what are required

resources?

• Implementation Issues

– Installation of observers

– Tune an observer

– Recognize effects of changing system parameters

on observer performance

Page 215: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 215

• Observers can combine knowledge of plant, power

converter device output, and feedback device to

extract a feedback signal that is superior to that

which can be obtained by using a feedback device

alone.

• Principle of an Observer

– By combining a measured feedback signal with

knowledge of the control-system components

(plant + feedback system) the behavior of the

plant can be known with greater accuracy and

precision than by using the feedback alone.

Page 216: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 216

• Role of an Observer in a Control System

– Observer augments sensor output and provides a

feedback signal.

Page 217: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 217

• Observer can be used to enhance system performance

– More accurate than sensor

– Reduce phase lag inherent in sensor

– Can provide observed disturbance signals which can

be used to improve disturbance response

– Can reduce system cost by augmenting performance of

low-cost sensor

– Can eliminate a sensor altogether

• Observers

– Not a panacea

– Add complexity to a system

– Requires computational resources

– May be less robust than physical sensors especially

when parameters change substantially during operation

Page 218: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 218

ControllerYPCR C

+

Power

ConverterPlant Sensor

Observer

Controller

Plant

Model

Sensor

Model

_

+

+ _

YO

CO

+

Σ

Σ Σ

Physical System

Modeled System

Observer

An observer is a mathematical structure that

combines sensor output and plant excitation

signals with models of the plant and sensor.

Page 219: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 219

• An observer provides feedback signals that are

superior to the sensor output alone.

• There are 5 Elements of an Observer:

– Sensor output

– Power converter output (plant excitation)

– Model (estimation) of the plant

– Model of the sensor

– PI or PID observer compensator

Page 220: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 220

• Key Guidelines for using an Observer in a Motion

System

– Performance Requirements

• Machines that demand rapid response to command

changes, stiff response to disturbances, or both will

likely benefit from an observer.

• The observer can reduce phase lag in the servo

loop, allowing higher gains, which improve command

and disturbance response.

– Available Computational Resources

• Observers almost universally rely on digital control.

• If the actual or planned control system is executed

on a high-speed processor, an observer can be

added without significant cost burden.

Page 221: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 221

• If digital control techniques are already

employed, the additional design effort to

implement an observer is relatively small.

– Controls Expertise in the User Base

• Observers require some level of controls

expertise for installation and configuration.

• The user base must be capable of

understanding the features of an observer if it

is to provide benefit.

– Sensor Noise

• Observers are most effective when the

position sensor produces limited noise.

• Sensor noise is often a problem in motion-

control systems.

Page 222: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 222

• Noise in servo systems comes from two major

sources: EMI generated by power converters and

transmitted to the control section of the servo

system, and resolution limitations in sensors,

especially in the feedback sensor.

• EMI can be reduced through appropriate wiring

practices and through the selection of

components that limit noise generation.

• Noise form sensors is difficult to deal with as

observers often exacerbate sensor-noise

problems. Lowering observer bandwidth will

reduce noise susceptibility, but it also reduces the

ability of the observer to improve the system, e.g.,

reducing observer bandwidth reduces the

accuracy of the observed disturbance signal.

Page 223: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 223

• The availability of high-resolution feedback sensors

raises the likelihood that an observer will

substantially improve system performance.

– Phase Lag in Motion Control Systems

• The two predominant sensors in motion-control

systems are incremental encoders and resolvers.

• Incremental encoders respond to position change

without substantial phase lag.

• Resolver signals are commonly processed with a

tracking loop, which generates substantial phase

lag, their presence makes it more likely that an

observer will substantially improve system

performance. The same applies to a sine encoder.

Page 224: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 224

• Independent of a feedback sensor, most motion-

control systems generate phase lag in the control

loop when they derive velocity from position.

Velocity is commonly derived from position using

simple differences. It is well known to inject a

phase lag of half the sample time. The phase lag

also provides an opportunity for the observer to

improve system performance.

– Summary: Five Key Guidelines for using an Observer

in a Motion System

• Need for high performance in the application

• Availability of computational resources in the

controller

Page 225: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 225

• Ability of the average user to install and configure

the system

• Availability of highly resolved position feedback

signal

• Presence of phase lag in the position or velocity

feedback signals

– The more of these guidelines that an application

meets, the more likely the observer can substantially

improve system performance.

Page 226: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 226

Adaptive Control

• Normal Control Design Procedure

– Develop a hierarchy of models (both physical and

mathematical) of the plant, ranging from a truth model, the

most realistic model developed, to a design model, one

simple enough for design purposes while still capturing the

essential characteristics of the actual system.

– Validate the models through comparisons of predicted

responses with actual measured responses.

– Design a controller on the basis of the plant design model.

– Test the control design by simulation on both the design

model and the truth model.

– Implement the control design on the actual plant.

– Tune the controller after installation.

Page 227: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 227

• Robust Control System

– When we use a model of the plant as the basis of a control

system design, we are assuming tacitly that this model is a

reasonable representation of the plant.

– Although the design model always differs from the true

plant in some details, we are confident that these details

are not important enough to invalidate the design.

– Also, ordinary feedback attempts to reduce the effects of

plant uncertainty and disturbances.

– A two-degrees-of-freedom control system (feedforward +

feedback) results in a robust control system where the

following key issues can be addressed effectively.

• command tracking and disturbance rejection

• insensitivity to modeling errors and to sensor noise

• insensitivity to unmodeled high frequency dynamics

• stability margins

Page 228: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 228

GC1(s)

H(s)

GC2(s)

Y(s)R(s) E(s)

D(s)

+_

+GP(s)

N(s)

+

+

++

B(s)

+

U(s)

Two-Degrees-of-Freedom

Control System

Page 229: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 229

• Need for Adaptation

– There are many applications, however, for which

a design model cannot be developed with any

reasonable degree of confidence. For example:

• Processes in which the underlying physical

principles are not understood well enough for

physical and mathematical modeling.

• Processes for which the physical principles are

understood but which have parameters that cannot

be measured or accurately estimated.

– Moreover, most dynamic processes change with

time. Parameters may vary because of plant

load, normal wear, aging, breakdown, and

changes in the environment in which the process

operates.

Page 230: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 230

• For example, the mass of the object being moved by a

robot manipulator will have a considerable effect on the

dynamics of the closed-loop system, and will mean that

a controller which is well tuned for an intermediate value

of the mass will be less well tuned if an extreme value is

used, and may even result in an unstable system.

– The feedback mechanism provides some degree of

immunity to discrepancies between the physical plant

and the model that is used for the design of the control

system.

– But sometimes that is not enough. A control system

designed on the basis of a nominal design model may

not behave as well as expected, because the design

model does not adequately represent the process in

its operating environment.

Page 231: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 231

– How can one deal with processes that are prone to

large changes, or for which adequate design models

are not available?

• One approach is brute force, i.e., high loop gain: as the

loop gain becomes infinite, the output of the process

tracks the input with vanishing error. Brute force rarely

works, however, for well-known reasons: dynamic

instability, control saturation, and susceptibility to noise

and other extraneous inputs.

• Modern robust control design techniques tolerate

substantial variation in one or more parameters, but

often with a sacrifice in performance. Moreover, these

techniques are not readily applicable to processes for

which no design model is available.

Page 232: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 232

• Adaptive Control

– Adaptive control may provide a solution to the

problem. The basic idea is to have the control law

adapt its own behavior, as it learns about the

process it is designed to control, or as the process

changes with its environment.

– An adaptive controller is a controller that can

modify its behavior in response to changes in

process dynamics and disturbance

characteristics; it is a controller with adjustable

parameters and a mechanism for adjusting the

parameters.

– The controller becomes nonlinear because of the

parameter-adjustment mechanism, but with a

special structure.

Page 233: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 233

An adaptive control system can be thought of as having

two loops:

• normal feedback loop with the process and the

controller

• parameter-adjustment loop, which is often slower than

the normal feedback loop

Controller Plant

Command

Signal

Parameter

Adjustment

Output

Control

Signal

Adaptive Control System

Controller Parameters

Page 234: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 234

– Note that there are a number of solutions to the

problem of keeping a controller in tune, as the

parameters of the system it is controlling vary.

• They range from common-sense approaches to

much more mathematical ones.

• The extra complexity of the more mathematical

approaches is often justified by lesser hardware

requirements and more reliable operation.

However, it is very difficult to prove the stability

properties of controllers whose parameters can

vary as time passes, therefore only fairly

restricted adaptation may be allowed in some

applications.

Page 235: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 235

– Two basic viewpoints on adaptive control have

emerged over the years.

• The first assumes that a design model is available,

but that the parameters of the model are either not

known or subject to a wide variation.

– Gain Scheduling

– Self Tuning

• The second assumes that no such design model is

available.

– Model Reference

• Direct Methods (gain scheduling and model-

reference) change control parameters directly while

Indirect Methods (self tuning) change control

parameters based on a solution to a design problem.

Page 236: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 236

– First Viewpoint: Design Model is Available

• The control system design depends explicitly upon the

parameters that are subject to variation, and then uses

measurements or estimates of these parameters as inputs

to the control system for the purpose of tuning it during the

course of its operation.

• If the parameters can be measured directly, the control

system gains can be scheduled for these measured

parameters. This approach is often called gain scheduling.

• If it is not possible to measure the uncertain parameters

directly, the relationships between these parameters and

the other measurable quantities in the system might

feasibly be exploited to estimate the parameters. A design

based on estimates of parameters may be called a self-

tuning controller, since it uses its own operating data to

estimate parameters in real time and thereby tune its own

behavior.

Page 237: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 237

Operating

Condition

Controller Plant

Command

Signal

Gain

Schedule

OutputControl

Signal

Adaptive Control System

Gain Scheduling

Controller Parameters

In gain scheduling there is an inner loop composed of the process and

the controller and an outer loop that adjusts the controller parameters on

the basis of the operating conditions. Gain scheduling can be regarded

as a mapping from process parameters to controller parameters. It can

be implemented as a function or a table lookup. Gain scheduling is thus

a very useful technique for reducing the effects of parameter variations.

Page 238: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 238

Controller Plant

Command

Signal

Estimation

Output

Control

Signal

Adaptive Control System

Self-Tuning

Controller Parameters

Process

Parameters

Controller

Design

Specification

In self-tuning, the inner loop consists of the process and an ordinary

feedback controller. The parameters of the controller are adjusted in real

time by the outer loop, which is composed of an estimator and a design

calculation. The process model and the control design are updated at each

sampling period. The block labeled “controller design” represents an on-

line solution to a design problem for a system with known parameters.

Page 239: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 239

– Second Viewpoint: Design Model is Unavailable

• If the process is not amenable to being modeled with any

reasonable accuracy, the control law must be designed

with little or no knowledge of the process. Model-

reference adaptive control (MRAC) takes this approach.

Known only is how the closed-loop system is required to

behave in response to the command signal. The desired

behavior is represented by an ideal or reference model.

• The key problem with MRAC is to determine the

adjustment mechanism so that a stable system, which

brings the performance error to zero, is obtained. This

parameter vector is typically a set of controller gains and

has nothing to do with the physical parameters of the

process being controlled. In principle, the operation of

the tuner is indifferent to the dynamics of the plant.

Page 240: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 240

Controller Plant

Command

Signal

Adjustment

Mechanism

Output

Control

Signal

Adaptive Control System

Model-Reference Adaptive

Controller Parameters

Model

In MRAC there is an inner feedback loop composed of the process and the

controller and an outer loop that adjusts the controller parameters. The reference

input is applied to both the real closed-loop plant and the ideal model. If the

performance error (the difference between the process output and the model

output) is sufficiently small, the closed-loop system is operating as desired and left

alone. But if the error is appreciable, it becomes the input to an adjustment

mechanism that adjusts controller parameters.

Page 241: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 241

– Summary

• In adaptive control, the process is controlled by a controller

that has adjustable gains. It is assumed that there exists

some kind of design procedure that makes it possible to

determine a controller that satisfies some design criteria if

the process and its environment are known. This is called

the underlying design problem. The adaptive control

problem is then to find a method of adjusting the controller

when the characteristics of the process and its environment

are unknown or changing.

• Gain scheduling and model-reference adaptive control are

called direct methods, because the controller parameters

are changed directly without the characteristics of the

process and its disturbances first being determined. The

self-tuning controller is called an indirect method, as the

controller parameters are obtained from a solution to a

design problem using the estimated process parameters

and possibly disturbance characteristics.

Page 242: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 242

• The construction of an adaptive controller thus contains

the following steps:

– Characterize the desired behavior of the closed-

loop system.

– Determine a suitable control law with adjustable

parameters.

– Find a mechanism for adjusting the parameters.

– Implement the control law.

• The key factors in choosing adaptive control are:

– Variations in process dynamics

– Variations in the character of the disturbances

– Engineering efficiency and ease of use

• Use of an adaptive controller will not replace good

process knowledge, which is still needed to choose

specifications, the structure of the controller, and the

design method.

Page 243: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 243

Fuzzy Logic Control

• Intelligent control is the discipline in which control

algorithms are developed by emulating certain

characteristics of intelligent biological systems. The

emergence of intelligent control has been fueled by

advancements in computing technology. Examples

include:

– Expert Systems, computer programs that emulate

the actions of a human who is proficient at some

task, are being used to construct expert

controllers that seek to automate the actions of a

human operator who controls a system.

Page 244: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 244

– Fuzzy Systems, rule-based systems that use fuzzy

logic for knowledge representation and inference,

are being used to automate the perceptual,

cognitive, and action-taking characteristics of

humans who perform control tasks.

– Artificial Neural Networks emulate biological neural

networks and have been used to learn how to control

systems by observing the way that a human

performs a control task and to learn in an on-line

fashion how best to control a system by taking

control actions, rating the quality of the responses

achieved when these actions are used, and then

adjusting the recipe used for generating control

actions so that the response of the system improves.

Page 245: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 245

– Genetic Algorithms, either on line or off line, are

being used to evolve controllers by maintaining a

population of controllers and using “survival of the

fittest” principles where “fittest” is defined by the

quality of the response achieved by the controller.

• The trend in the field of control is to integrate the

functions of intelligent systems with conventional control

systems to form highly autonomous systems that have

the capability to perform complex control tasks

independently with a high degree of success.

• These intelligent controllers are not mystical; they are

simply nonlinear, often adaptive controllers, and there

seems to be an existing conventional control approach

that is analogous to every new intelligent control

approach that has been introduced.

Page 246: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 246

• Fuzzy Control

– A fuzzy controller can be designed to roughly

emulate the human deductive process (i.e., the

process whereby we successfully infer

conclusions from our knowledge). As shown in

the figure on the next slide, the fuzzy controller

consists of four main parts.

• The rule base holds a set of if-then rules that

are quantified via fuzzy logic and used to

represent the knowledge that human experts

may have about how to solve a problem in

their domain of expertise.

Page 247: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 247

Inference

Mechanism

Rule

Base

Process

Fuzzific

atio

n

Fuzzy Controller

Reference

Input Inputs

Outputs

y(t)

r(t)u(t)

Fuzzy Controller Architecture

Page 248: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 248

– The fuzzy inference mechanism successively decides

what rules are the most relevant to the current

situation and applies the actions indicted by the rules.

– The fuzzification interface converts numeric inputs

into a form that the fuzzy inference mechanism can

use to determine which knowledge in the rule base is

most relevant at the current time.

– The defuzzification interface combines the

conclusions reached by the fuzzy inference

mechanism and provides a numeric value as an

output.

• Overall, the fuzzy control design methodology, which

primarily involves the specification of the rule base,

provides a heuristic technique to construct nonlinear

controllers.

Page 249: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 249

Trade-Offs & Performance Limitations

• Feedback control is at the heart of every mechatronic system.

• Changes cannot be effected instantaneously in a dynamical

system, and a correct control decision applied at the wrong

time could result in catastrophe.

• Control systems must be safe and robust, and guaranteed to

be so, before any thoughts of performance are considered.

• Robustness achieved through feedback control is subject to

limits; there is a robustness tradeoff present in all feedback

systems.

• An understanding of fundamental limitations, in practical,

physical terms rather than abstract, mathematical terms, is an

essential element in all engineering.

Page 250: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 250

• The ability to identify performance trade-offs and

fundamental performance limitations (at both the

component and system level), their sources, and quantify

their impact on performance is essential in mechatronics

design and control.

• The ability of most mechatronic systems to deliver

exceptional performance relies mainly on the dynamic

interaction between its components and on the

performance of its control system.

• Mechatronic systems are typically composed of

components such as sensors, actuators, communication

hardware, electronics, and signal conversion hardware.

Each of these components or subsystems have their own

performance characteristics, trade-offs, and limitations that

would impact the overall performance of the system.

Page 251: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 251

+

-

C(s)V(s)

+

+K(s) G(s)

D(s)

Σ Σ

K(s)G(s) C(s)T(s)

1 K(s)G(s) V(s)

1 C(s)S(s)

1 K(s)G(s) D(s)

T(s) S(s) 1

Page 252: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 252

• Fundamental Limitations in Feedback Control

Systems

– These fundamental limitations typically take three

forms.

– Some are in the form of algebraic equations, e.g.,

T(s) + S(s) = 1 holds at all frequencies, where

T(s) and S(s) are the complementary and

sensitivity transfer functions, respectively.

• This relation can be regarded as a constraint

on design, preventing independent choices

being made in regard to command-following

and disturbance-rejection performance.

Page 253: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 253

– Other constraints take the form of a frequency-domain

integral on a closed-loop transfer function such as S(s).

Hendrik Bode observed that there is a fundamental

limitation on the achievable sensitivity function S(s)

(sensitivity to disturbances and modeling errors) for a

feedback system.

• The log of the magnitude of the sensitivity function of a LTI

(linear, time-invariant), SISO (single-input, single-output)

feedback system, integrated over frequency, is conserved

under the action of feedback – it is zero for stable plant /

compensator pairs and is some fixed positive value for

unstable ones.

• Sensitivity improvements in one frequency range must be

paid for with sensitivity deteriorations in another frequency

range, and the price is higher if the plant is open-loop

unstable.

0log S(i ) d 0

Page 254: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 254

Sensitivity reduction at low frequency unavoidably leads

to sensitivity increase at higher frequencies.

Page 255: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 255

• However, physical systems do not exhibit good

frequency response fidelity beyond a certain

bandwidth. This is due to uncertain or unmodeled

dynamics in the plant, to digital control

implementations, to power limits, and to

nonlinearities, for example. So the integration is

performed over a finite frequency range, a

constraint imposed by the physical hardware we

use in the control loop. All the action of the

feedback design, the sensitivity improvements as

well as the sensitivity deteriorations, must occur

within a finite frequency range. So reducing the

sensitivity of a system to disturbances at one range

of frequencies by feedback control will amplify

transients and oscillations at other frequencies.

Page 256: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 256

– Example: Stick-Balancing (Inverted Pendulum

Problem)

• The difference between balancing long sticks and

short sticks has to do with the location of the

unstable mode. As ℓ gets smaller, the unstable

pole magnitude gets larger.

F

2

2 2

1s

2sM m M mF

s s g3 12 2

2

2 2

gs

X 3 2sM m M mF

s s g3 12 2

Page 257: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 257

• A long rigid stick is easy to balance, but as it

becomes shorter, balancing it becomes more

difficult. Handicaps to human control include

reaction time, neuromuscular lags, limb

inertias, and other uncertainties. So while the

stick is rigid, the compensator frequency range

might be good for a frequency range up to

about 2 Hz. The control strategy is to keep the

sensitivity as small as possible over that

range. However, a dramatic increase in

sensitivity occurs as the stick becomes shorter

and even minor imperfections in the

implementation will cause instability. This is

the reason humans have trouble balancing

short sticks.

Page 258: Computer Embedded Controls Mechatronic System Design · Mx Bx Kx F(t) d x dx MD x M =Mx BDx B Bx dt dt MD x MDx Kx F(t) (MD BD K)x F(t) x nsf 1 F MD BD er Functio K n { { Using the

Control System Design Introduction K. Craig 258

– The third type takes the form of time-domain

integral constraints on a system signal such as

the feedback error.

• If the open-loop transfer function has two

poles at the origin (a double integrator) and

the closed-loop system is stable, then the error

e(t) following the application of a unit step

input applied at t = 0 must satisfy the relation:

• Equal areas of positive and negative error

must result.

0e(t)dt 0