35
Practicalities of Digital Control A Survey

Practicalities of Digital Control

  • Upload
    kedem

  • View
    22

  • Download
    2

Embed Size (px)

DESCRIPTION

Practicalities of Digital Control. A Survey. The Overall System. The individual controllers The interconnection The central computer or computers The transducers and actuators. The individual controllers. P L C General-purpose controllers Purpose-built. More on the P L C. - PowerPoint PPT Presentation

Citation preview

Page 1: Practicalities of Digital Control

Practicalities of Digital Control

A Survey

Page 2: Practicalities of Digital Control

The Overall System

• The individual controllers• The interconnection• The central computer or computers• The transducers and actuators

Page 3: Practicalities of Digital Control

The individual controllers

• P L C• General-purpose controllers• Purpose-built

Page 4: Practicalities of Digital Control

More on the P L C

• Probably still ‘ladder logic’ -- good for on-off control but cumbersome for analogue --but ...

• Can incorporate analogue I/O• Can often include p.i.d. controller blocks and

routines in high-level languages• Most modern PLC types can be interfaced to

a SCADA system

Page 5: Practicalities of Digital Control

Traditional example -- Mitsubishi F1/F2

• Basically ladder logic• Can do analogue quantities, but awkward• Good at on -- off control• An analogue ladder example follows• More modern networkable PLCs will be

described in a later lecture

Page 6: Practicalities of Digital Control

General-purpose Controllers

• Most common type is PID but other strategies possible

• Parameters can be changed/downloaded by/from SCADA system

• Self-tuning types becoming more popular but care is still needed in their use

• Less good at on-off than the PLC• Better at ‘analogue’ control

Page 7: Practicalities of Digital Control

DSP Possibility

• Can be based on DSP Chips• Very fast micros optimised for multiply-

and-add ... the sums of digital control• Some can operate in floating-point• Serial interface to I/O

Page 8: Practicalities of Digital Control

How fast shall we sample ?

• Shannon/Nyquist Theorem -- we must sample at least twice the highest frequency present if we are not to lose information

• Actually we need to sample faster than this to avoid aliasing and because of noise

• 10 - 20 x highest frequency of interest is usual

Page 9: Practicalities of Digital Control

Why ?

• Less than 10 x means it is difficult to produce an effective anti-aliasing filter

• More than 20 x leads to a double penalty ...• We have to do the sums faster ...• ... and more accurately if they are to work !• But what is this aliasing thing ?

Page 10: Practicalities of Digital Control

Suppose we sample this signal every 14 s

0 20 40 60 80 100-10

-5

0

5

10

x

x

x

x

x x

x

Page 11: Practicalities of Digital Control

“I’ve got aliasing, doctor.”

• We have ‘found’ a sine wave of much lower frequency than the actual one.

• The system may be able to respond to the lower frequency one ...

• ... even if the original was too fast for it to respond to.

Page 12: Practicalities of Digital Control

“I’ll give you a prescription for ...”

• Some effective screening (the high-frequency signal is likely to be the mains or Radio 1/2/3/4/5/etc)

• An analogue low-pass filter on the inputs

Page 13: Practicalities of Digital Control

The anti-aliasing filter

• Has to be analogue (it would itself be at the risk of aliasing if it were digital !)

• It must not appreciably affect signals within the normal frequency range of the controller but it must effectively remove everything above half the sampling frequency.

• The faster we sample, the easier it is to remove the aliasing signals.

Page 14: Practicalities of Digital Control

A Sampling-rate Example

• Controller 0.1s + 1 +2/s• We have already digitised with a sampling

interval of 0.05 s• We will see what happens with 0.25 s ...• ... and 0.01 s. • Using the simple substitution.

Page 15: Practicalities of Digital Control

We obtain with Ts = 0.25 s ...

• 1.9 - 1.8z-1 + 0.4z-2

• -----------------------• 1 - z-1

• This one causes very serious degradation of performance -- if not actual instability

Page 16: Practicalities of Digital Control

What is happening ?

• The problem is that by sampling we are producing a Transport lag

• We remember from Analogue Control that a Transport Lag is a pure time delay ..

• ... and that it reduces system stability by increasing the phase lag in the loop.

• We introduce one by sampling ...

Page 17: Practicalities of Digital Control

What is happening -- Continued

• ... because an event happening during a sampling interval is only detected at the next sampling instant.

• So the delay in detecting it can be anything between zero and a full sampling interval ..

• .. so it is Ts/2 on average.• This is the effective extra transport lag

introduced by sampling.

Page 18: Practicalities of Digital Control

...So let us use Ts = 0.02 s ...

• 11.02 - 21z-1 + 10z-2

• ---------------------------• 1 - z-1

• If we do not do the sums very accurately, we entirely lose the integral term !

Page 19: Practicalities of Digital Control

Ts = 0.02 s .. A Consequence

• We will lose the integral term entirely if we use 8-bit arithmetic.

• I will do the sum ...• ... in which we are only allowed integer

numbers between 0 and 255 (or probably between -128 and +127 in practice)

Page 20: Practicalities of Digital Control

Interconnection

• Multi-line bus (VME etc)• Parallel or serial• Two-wire (FIELDBUS etc)• Systems often combine hardware and

software

Page 21: Practicalities of Digital Control

Analogue Interfaces

• Voltage ranges (often 0 -> 10 V or -10 -> 10 V)

• Current loop (usually 4-20 mA)• So e.g. for 8-bit, 4 mA converts to 0 and 20

mA converts to 25510

• What would the values be for 12 and 16 bits ?

Page 22: Practicalities of Digital Control

Arithmetic

• Now normally floating-point within the controller

• Fixed-point arithmetic is still used in some low-cost (often mass-produced) equipment

• It saves hardware cost but incurs extra development time

• Input and output are still fixed-point

Page 23: Practicalities of Digital Control

Precision

• 8-bit I/O restricts us to 0-255 decimal• 12-bit often used in ‘good’ systems

Page 24: Practicalities of Digital Control

Supervisory Control -- SCADA

• Central computer (or network) connected to local controllers, PLCs and data loggers

• Data recording as well as control -- often now with an economic process optimisation overtone

• Central control of parameters and setpoints but the local controllers and PLCs do the actual controlling

Page 25: Practicalities of Digital Control

SCADA Continued

• Often able to do statistical analysis on the data collected

• Especially ‘trending’ to see if quantities are changing when they should be constant (or vice versa)

Page 26: Practicalities of Digital Control

SCADA Continued

• Upmarket PCs often used now instead of minis/mainframes/workstations

• Examples follow ....

Page 27: Practicalities of Digital Control

First -- just a PLC !

• Canal-lock control panel• Controlling two sets of gates and ..• ... two sets of paddles.• Needs to detect gate position and water

level on each side (done via pressure)• Hydraulics to operate gates and paddles

Page 28: Practicalities of Digital Control

Again not SCADA -- Disk Head Drive

• Linear motor plus drive electronics• Must be fast, so DSP chip used• Position feedback from format track pattern

on disk

Page 29: Practicalities of Digital Control

A Glassworks

• Central Computer -- high-spec PC (duplicated)

• “Hot End” -- GP Controller for zone temperatures and feed + PLC for batching

• “Cold End” -- PLC (mostly on-off)• Transducers -- mostly of the “on-off” type

apart from temperature

Page 30: Practicalities of Digital Control

Transducers

• Analogue then A - D ...• or...• ... direct to digital

Page 31: Practicalities of Digital Control

Example -- Position or Angle

• We can use a potentiometer or LVDT• to give a voltage dependent on the position

or angle to be measured• then digitise it

Page 32: Practicalities of Digital Control

Position or Angle -- Continued

• Or we can use a Gray-coded disc or strip to give a digital reading directly.

Page 33: Practicalities of Digital Control

Precision

• The control is only as accurate as our measurement of the quantity being controlled

• Our transducer must be accurate enough to fulfil the specification

Page 34: Practicalities of Digital Control

Timing

• Interrupts• Real-Time Clock• Watchdog Timer

Page 35: Practicalities of Digital Control

Real-Time

• Operating System or Language ?• Hierarchy of interrupts• Solves the sampling-interval problem• May need an arrangement for immediate

action in the event of problems during an interval

• Local or central ?