Block Diagrams - Wescott Design · Another Block Diagram I Block diagrams can be useful even to...

Post on 21-Sep-2020

3 views 0 download

Transcript of Block Diagrams - Wescott Design · Another Block Diagram I Block diagrams can be useful even to...

Block Diagrams

Tim Wescott

Wescott Seminarswww.wescottdesign.com/seminars.html

November 2, 2012

Outline

The Language of Blocks

Analyzing with Blocks

Block Diagrams

Why we use Blocks

I Block diagrams are the control engineer's UML

I (Except it's not universal, as we shall see)

I Trying to describe a system entirely in math or in Englishdrives us crazy

I Block diagrams allow us to capture both structure andbehavior

I Blocks can be identi�ed with physical subsystems or withobjects in software

I Blocks can express the system behavior with enough detail towrite equations directly

The World's Simplest Block Diagram

I This is the world's simplest (non-trivial) block diagram.

I It shows a system, �thing�, which is operating on an inputsignal u and generating an output signal, y .

I It does not say what �thing� does; it only says that y dependson u in a manner speci�ed by �thing�.

Another Block Diagram

I Block diagrams can be useful even to people who aren't versedin them.

I This block diagram shows a simple and generic control loop.

I Block diagram language is more ad-hoc and �uid than UML,unless you are working with speci�c control-engineering CADsoftware.

Outline

The Language of Blocks

Block Diagram Elements

A Dictionary of Blocks

Block Diagram Dialects

Analyzing with Blocks

Block Diagrams

Signals

I Represent a signal with a line with an arrow indicating thedirection of signal �ow

I Annotate with a signal name as appropriate

I Signals can be scalar, vector, continuous-value or discrete,continuous-time or discrete

I If you bundle signals together into a vector, choose a sensibleset of signals

Blocks Operating on One Signal

I Represent as a rectangle

I Optionally with a name above or belowI With one signal in and one out, usually horizontalI Optionally with a function inside

I This block diagram indicates that

I the system implements the transfer function H (z),I which operates on u to generate yI presumably all in sampled time, because H is in z .

Blocks Operating on Multiple Signals

I Represent as a circle,

I with a symbol denoting the operation insideI with signals going in,I with a signal coming out,I and decorated with modi�ers to the operation

I This block diagram shows that y = u1 − u2

Blocks that Span Domains

I A sample block captures theinput signal value at thegiven time:

yk = u (k Ts)

or

yk2 = u (k1 N)

I In real practice, this will bean ADC or an explicitsampling circuit.

I A hold block takes on thevalue of a sampled-timesignal at the samplinginstant, and holds it untilthe next sampling instant:

y (t) = x

(⌊t

Ts

⌋)I In real practice this will be a

DAC or PWM.

More General Blocks

I Can stand for anything�a subsystem, an unknown system, orjust a marker for �something is here�

I Leftmost is our �simplest block diagram�

I Middle shows a system that operates on multiple inputs anddelivers multiple outputs

I Rightmost shows a system with an �auxiliary� input, such as atrigger, or mode command, or other signal that doesn't �t inthe class of �normal� signals.

Outline

The Language of Blocks

Block Diagram Elements

A Dictionary of Blocks

Block Diagram Dialects

Analyzing with Blocks

Block Diagrams

Transfer function blocks

I Implements H (z):Y (z) = H (z)U (z)

I It's the generic form for atransfer function

I Implements a speci�ctransfer function

I In this case a discrete-timedi�erentiator:

Y (z) =z − 1

zU (z)

Blocks that Implement Functions

I Implements yk = f (uk)

I The dot inside means theinput value

I Use for memorylessfunctions only, please

I Implement a speci�cfunction

I In this case, yk = (uk)2

Showing functions graphically

I Indicate function by showing an in/out plot, in this case alimiter:

yk =

ymax uk ≥ ymax

uk ymin < uk < ymax

ymin uk ≤ ymin

I Can also indicate frequency-domain functions such asproportional-integral, lead-lag, lowpass, notch, etc.

Blocks that Show Memory

I Shows a continuous-timeintegrator:

y (t) =

ˆ t

0x (τ) dτ

I It's a way to show memoryin the time domain

I Shows a discrete-timeintegrator:

yk =k∑

n=0

u (n)

I it shows memory in thediscrete-time domain

I It maps straight to software

Outline

The Language of Blocks

Block Diagram Elements

A Dictionary of Blocks

Block Diagram Dialects

Analyzing with Blocks

Block Diagrams

Block Diagram Dialects

I Di�erent disciplines have di�erent dialects of the language.

I The dialect changes over time, and with the practitioner

I Do not be surprised or dismayed if you are shown a diagramthat doesn't exactly �t.

I Ask questions�it's expected.

Outline

The Language of Blocks

Analyzing with Blocks

Block Diagrams

Outline

The Language of Blocks

Analyzing with Blocks

Direct Equation Extraction

Manipulating Block Diagrams

Multiple Inputs or Multiple Outputs

Block Diagrams

A Fully-de�ned System

I This shows a system that is commanded to generate a certainaerodynamic thrust

I This thrust command is turned into a motor speed command

I The motor speed command is applied to a feedback loop todrive the motor

I The motor, in turn, drives a propeller

Blocks to Equations

I The motor speed command is the square root of the thrustcommand: uω =

√ut

I The motor speed is controlled with a PI controller,

I So the motor drive is calculated from the error between actualspeed and commanded speed, and from its discrete-timeintegral: um = kp (uω − ωm) + ki

∑t

0(uω − ωm)

I The motor speed is an (unknown) function of the motor drive:ωm = g (um, k)

I The propeller thrust is the square of the motor speed: ft = ω2m

I These equations are nonlinear, so we can't go further in ouranalysis, and must resort to linearizing around some operatingpoint, or simulating the system.

Outline

The Language of Blocks

Analyzing with Blocks

Direct Equation Extraction

Manipulating Block Diagrams

Multiple Inputs or Multiple Outputs

Block Diagrams

Motivations

I Structural diagrams let you see the shape, but not the behavior

I Translating straight to math works, but then we're back inmath-land, and clarity can be lost

I There are long-developed techniques which let you reduce alarge diagram with simple blocks into a small diagram with few(or one) big block.

When you can

I The methods shown here depend on the properties of transferfunctions, so they only work when the constraints oftransfer-function design are not violated.

I If your system is linear, and shift-invariant (or time-invariantand entirely within the continuous-time domain) then you can.

When you can't

I If your system is nonlinear

I But sometimes you can use clever transformations to exactlymodel a nonlinear system as linear

I And often you can approximate a nonlinear system as a linearone and proceed.

I But before you proceed, you need all linear blocks.

I If your system is shift- or time-varying (a sampling stage or ahold block are time-varying)

I But sometimes you can move a sampling or a hold block, andreduce everything on one side of it

Loop Reduction

I Turn a loop into one block.I Output is a function of error: Y (z) = E (z)G (z)I Error is a function of output and input:

E (z) = U (z)− Y (z)H (z)I Substituting: Y (z) = [U (z)− Y (z)H (z)]G (z)I And solving:

Y (z)

U (z)=

G (z)

1+ H (z)G (z)

Cascading Blocks

I Turn two blocks in cascade into one

I The signal in the middle is a function of the input:X (z) = U (z)G1 (z)

I The output is a function of the intermediate signal:Y (z) = X (z)G2 (z)

I They are easily put together: Y (z) = U (z)G1 (z)G2 (z), so

Y (z)

U (z)= G1 (z)G2 (z)

Summing Junctions

I Reduce two blocks and a summing junction to one block

I The two intermediate signals are functions of the input:X1 (z) = U (z)G1 (z), X2 (z) = U (z)G2 (z)

I The output is their sum: Y (z) = U (z)G1 (z) + U (z)G2 (z).Collecting, we get Y (z) = U (z) [G1 (z) + G2 (z)]. Solving forY (z)/U(z):

Y (z)

U (z)= G1 (z) + G2 (z)

An Example

I Let us say that we have a DC motor, which is driven by acurrent ampli�er and has its speed sensed one way or another.

I A DC motor with a constant current drive, will have a torquethat is proportional to the drive. This means that the transferfunction from drive to motor speed will be an integrator:

G (z) =km

z − 1

I If we use a proportional-integral controller for good speedregulation. The block diagram might be like this:

An Example, page 2

I We would like to reduce the block diagram above, to �nd thetransfer function of the system.

I We could just go straight to math�but block manipulationmay be easier.

I First, take care of the controller by eliminating the innersumming junction:

An Example, page 3

I Now we have the controller taken care of, lump the controllertogether with the plant:

I (Note that the block's transfer function is what is known asthe �open loop� transfer function).

I Now remember that the transfer function of a wire is 1, anduse loop reduction:

An Example, page 4

I Finally, we simplify our transfer function, to get

I At this point, we could plug in numbers for km, kp, and ki ,and get an idea of how our system might behave.

I Alternately, we could start with a desired system behaviorderived from some performance bounds, a measured orcalculated value of km, then �nd kp and ki .

Moving Summing Junctions

I Summing junctions can get in the way of loop reduction,cascading gains, and other operations.

I Sometimes you want to move a summing junction from oneside of a block to another: this can be done.

I This is just a graphical representation of the commutativeproperty of multiplication: if Y (z) = [U1 (z) + U2 (z)]G (z),then Y (z) = U1 (z)G (z) + U2 (z)G (z)

More Moving Summing Junctions

I You can move a summing junction backward through a block,too:

I This is the same principal as before, except that we need tofake up the transfer function 1/G(z)

I that transfer function may not be at all realizable.I But keep in mind that at this point you're pretty much playing

with the math anyway.

A Summing Junction Example

Say that you want a loop that uses feed-forward to do the heavylifting of getting a plant where you want it, but you need feedbackto clean up around the edges. You might end up with:

A Summing Junction Example, page 2

I The loop has two summing junctions, which means that youcan't use the loop reduction rule.

I What to do?

I Move the inner summing junction back through H2, merging itwith the outer junction, or

I Move the outer summing junction forward through H1,merging it with the inner junction

I Either way, you have a de�nite loop.

I I will move the outer summing junction forward, because itavoids the 1/H2 term.

A Summing Junction Example, page 3

I We can now see, by inspection, that the transfer function is

T (z) = (H1 (z) + H2 (z))G (z)

1+ G (z)H2 (z)

Outline

The Language of Blocks

Analyzing with Blocks

Direct Equation Extraction

Manipulating Block Diagrams

Multiple Inputs or Multiple Outputs

Block Diagrams

Multiple Input Systems

I All the systems we've analyzed so far are single-input,single-output (SISO) systems.

I A multiple-input, single output system might be called a MISOsystem.

I Systems can be more complex: they can have multiple inputs,multiple outputs, or both.

I You can use block diagrams to analyze linear systems withmore than one input or output

Treating Multiple Input Systems

I The fundamental tool that you use for analyzing linear systemswith multiple inputs is superposition.

I Remember that superposition says that given two inputsignals, a linear system will give the result

h (x1 + x2) = h (x1) + h (x2)

I Superposition extends to systems with inputs coming in atdi�erent spots.

I To analyze the system's response to two signals, hold onesignal at zero and �nd the response to the other one, thenrepeat.

Multiple-Input Example

I Here's an example system, with the plant split out intoactuator and mechanism.

I The controller commands the actuator, which �pushes� on themechanism.

I But the mechanism is also disturbed by some outside in�uence

I We would to quantify the degree to which that disturbance isrejected

Multiple-Input Example, page 2

I If we assume that the disturbance is zero, then the transferfunction from the intended input to the output is

Ti (z) =Y (z)

Ui (z)=

G (z)H1 (z)H2 (z)

1+ G (z)H1 (z)H2 (z)

I If we assume that the input is zero, then the transfer functionfrom the disturbance to the output is

Td (z) =Y (z)

Ud (z)=

H2 (z)

1+ G (z)H1 (z)H2 (z)

I Important things to note:

I the denominator the same in both cases,I and the transfer functions are closely related:Ti (z) = G (z)H1 (z)Td (z).

Multiple-Input Example, page 3

I Let's say that the block diagram in question is the heatercontrol system from day 1, with

I G = 500 z−1

z+ 50+ 1.0 z

z−1, H1 = 0.1, H2 =

0.0018z(z−0.97)(z−0.94)

I We'd like to know what the response to a step change inambient temperature is, so we calculate

Td (z) =Y (z)

Ud (z)=

0.0018z(z−0.97)(z−0.94)

1+(50 z−1

z+ 5+ 0.1z

z−1

)(0.0018z

(z−0.97)(z−0.94)

)I or

Td (z) =Y (z)Ud (z)

= 0.0018(z−1)z(z−1)(z−0.97)(z−0.94)+(55.1z2−105z+50)(0.0018)

I or Td (z) =Y (z)Ud (z)

= 0.0018(z−1)zz3−2.81082z2+2.6328z−0.8218

Multiple-Input Example, page 4

Td (z) =Y (z)

Ud (z)=

0.0018 (z − 1) z

z3 − 2.81082z2 + 2.6328z − 0.8218

I You can �gure out the step response from this, but there aretwo salient points to note:

1. The roots of the denominator arez ∈ {0.9740, 0.9184± j0.0161}. All three roots are stable, sothe system is stable

2. If you apply the �nal value theorem to the step response ofTd , the answer is

ydist = limz→1

((z − 1)

(z

z − 1

)Td (z)

)= 0

which means that the steady-state error is zero. This is due tothe zero at z = 0 in the numerator of Td , which is, in turn,due to the integrator in the controller.

Multiple-Input Example, page 5

I Here is a Bode plot showing the response of the system to acommand and to changes in ambient temperature

I The response to ambient temperature goes to zero as thefrequency goes to zero�that's the same as it's response to astep going to zero at in�nite time.

Multiple Output Systems

I A dual of the multiple-input, single-output system is the singleinput, multiple-output (SIMO).

I Analysis proceeds similarly to the MISO system: ignore oneoutput, �nd the transfer function, then ignore the other outputand �nd the transfer function.

Multiple-output example

I We want to control a plant and insure that the plant output,y , is correct.

I But we also want to make sure that the plant drive, ud isreasonable.

I So we �nd the transfer function from input to drive, and inputto plant output:

IUd (z)U(z) = H(z)

1+H(z)G(z) and Y (z)U(z) = H(z)G(z)

1+H(z)G(z)

Multiple-output example, page 2

I Let's say that the plant in question are a motor with amechanical time constant of 20ms, being driven by a voltage,and with its position taken as the output variable.

I After sampling, this motor will have a transfer function of

G (z) = 0.002(z+1)(z−0.95)(z−1) .

I Assume that we're going to drive this with aproportional-derivative controller

I with a transfer function H (z) = 2+ 50 z−1

z

Multiple-output example, page 3

I Here is the bode plot of the system, for the motor position andmotor drive

I Note the high gain on the motor drive at highfrequencies�this will bite us

Multiple-output example, page 4

I Motor response is nice and snappy

I Motor drive goes sky-high (up to 52), then the rest of the timeis spent braking

I In a real system the drive would probably limit, slowing thingsdown at best

Outline

The Language of Blocks

Analyzing with Blocks

Block Diagrams

Block diagrams

I Block diagrams are a versatile and accessible way to describecontrol systems

I They can work at all levels from the abstract down to thenitty-gritty

I If you constrain your blocks correctly (i.e., make them linearand shift-invariant) you can analyze system behavior withblock diagrams

I Block diagrams can be you all the way from architecturalreview through to a �nished product.