0% found this document useful (0 votes)
12 views24 pages

Robotics - Digital Control (Done)

The document discusses industrial control systems used in various industrial applications, detailing hardware configurations such as PLCs and PACs. It explains the integration of control systems through SCADA and DCS architectures, allowing for coordinated control and higher-level business operations. Additionally, it covers digital control implementation, PID control, and examples of Arduino-based control code for practical applications.

Uploaded by

Abhinav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views24 pages

Robotics - Digital Control (Done)

The document discusses industrial control systems used in various industrial applications, detailing hardware configurations such as PLCs and PACs. It explains the integration of control systems through SCADA and DCS architectures, allowing for coordinated control and higher-level business operations. Additionally, it covers digital control implementation, PID control, and examples of Arduino-based control code for practical applications.

Uploaded by

Abhinav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Industrial Robotics

Session – Digital Control

Prof Michael Short


Industrial Control

An industrial control system is a type of control system (and its


associated hardware, software and instrumentation) which is used in
industrial applications like manufacturing plant, chemical/biological
processing refineries, the oil and gas sector and the electrical power
generation and regulation industry.

There are a wide variety of control system hardware configurations in


use. These include programmable logic controllers (PLCs),
programmable automation controllers (PACs) and embedded
microcontrollers. Such units are often found in standalone use in
smaller applications.

2
Industrial Control Applications

3
Industrial Control (cont.)

For larger applications, many smaller units may be interconnected


by a supervisory control and data acquisition (SCADA) system.
More modern approaches are based upon a distributed control
systems (DCS) architecture.

SCADA and DCS architectures allow coordinated control of


multiple loops, and also further integration into higher-level
business operations such as production planning and
maintenance systems.

4
Industry 4.0

Credit: Christoph Roser 5


Industrial Controller Implementation

Disturbance
Reference Controlled
input
+ + + Variable
Controller Actuator Process
_

Filter Sensor

Controller Interface Plant

6
Example: Analog PID
Consider the following ‘simple’ PID controller (parallel structure):

Kd s
1 + αK d s

Differentiator
/ Filter
Desired Error Controller
Value + Output
+ Kp +
- +
Variable Gain
Amplifier
Measured
Variable
Ki
s

Integrator

Ki sK d
C (s) = K p + +
s 1 + αsK d
7
Example: Analog PID (cont.)
It can be implemented using electronic circuitry:

1
R2C I ∫
VI (t ) = − VE (t )dt

dV (t )
VD (t ) = −C D R3 E
dt

8
Example: Analog PID (cont.)
All well and good, but:

How would an operator remotely change a setpoint, read the


process variable or update the PID gains from a control centre 5 KM
away?

How could an Engineer recover historical data about control loop


performance to develop a better plant model, or optimize a
production plan?

...

9
9
Digital Control Implementation

High-level
+ Digital
Controller Low-level
(Enterprise _
(Fieldbus)
)
Network
Network
Digital Filter

Control Remote
Center I/O
10
Modern DCS Control Implementation
Global Network
‘Internet’ Cloud
IP Addressing / DNS
Non managed QoS
Non Real-Time (Best
Effort) Common Network (IP-Based)
SCADA Functionality

Traffic policing
Firewall Gateway

Local Subnetwork Common Network (IP-Based)


‘Industrial Intranet’
Static IP Addressing
Managed QoS
Hard/Soft Real-time Local Control Remote
DCS Functionality Center I/O

11
Digital Control
• Digital control loop:

z − 1  G ( s) 
• Process pulse transfer function: G ( z ) = ⋅Z 
z  s 
• The closed-loop transfer function of this digital control system is:
D( z )G ( z )
GCL ( z ) =
1 + D( z )G ( z )

• The closed loop poles are the roots of the equation:


1 + D( z )G ( z ) = 0
12
DCS Pulse Transfer Function
• Look around the loop from u(k) to y(k):
Process
Dynamics
ZOH / Controlled
u(k) G(s)
Actuator Variable

Sensor /
y(k)
Sampler

𝑌𝑌(𝑧𝑧) 𝑧𝑧 − 1 𝐺𝐺(𝑠𝑠)
𝐺𝐺(𝑧𝑧) = = ⋅ 𝑍𝑍
𝑈𝑈(𝑧𝑧) 𝑧𝑧 𝑠𝑠

• Reference the network delays to the process, and apply delay


compensation (through detuning or predictive control);

• We look this week at (de)tuning a digital PID.


13
Digital PID Control
U (s)  K 
• Using the Bilinear transform on C ( s)= = K p 1 + i + K d s  we obtain:
E (s)  s 

U ( z ) K1 + K 2 z −1 + K 3 z −2
D
= ( z) =
E( z) 1 − z −1

• Or equivalently: u (k )= u (k − 1) + [ K1e(k ) + K 2 e(k − 1) + K 3e(k − 2) ]

New Old Incremental


control control Change in control

• This is the most common form of PID controller implementation (the


‘velocity’ or ‘incremental’ form).

• It is easy to implement anti-reset wind-up.

14
Digital PID Control (cont.)
• The relationships between the three digital PID gains and that of the
continuous (ideal) PID controller are as follows, assuming a sample time of Ts
seconds:
U ( z ) K1 + K 2 z −1 + K 3 z −2
D
= ( z) =
E( z) 1 − z −1

 K iTs K d 
K1 K p 
= + + 1
 2 Ts 

 K iTs 2 K d 
K2 K p 
= − − 1
 2 Ts 
K 
K3 = K p  d 
 Ts 

• These calculations may easily be put into a spreadsheet for design purposes!

15
DDS for FOPDT Plant
− sd
• For a FOPDT process: G p ( s ) =
Ke
1+τ s
− sd
• Closed loop reference model: GCL ( s ) = e
1 + λs

• For a continuous PI controller, use: τ 1


Kp = Ki =
K (λ + d ) τ

• Converting to a digital PI:


Ts + 2τ Ts − 2τ
K1 = K2 =
K (2d + 2λ + Ts ) K (2d + 2λ + Ts )
• Equations consider sampling delay; network delays must be added into
d.
16
DDS for SOPDT Plant
• For an (underdamped) SOPDT process: G ( s ) =
K ω 2 − ds
ne
s 2 + 2ζω n s + ωn2
e − sd
• Closed-loop reference model: GCL ( s ) =
1 + λs

• For a continuous PID controller, use:


2ζ ωn 1
Kp = Ki = Kd =
Kω n ( λ + d ) 2ζ 2ζω n

• For a digital PID controller, use:


Ts2ωn2 + 4ζ Tsωn + 2 Ts2ωn2 − 4ζ Tsωn − 4 2
K1 = K2 = K3 =
KTsωn2 (2d + 2λ + Ts ) KTsωn2 (2d + 2λ + Ts ) 2 KTsωn2 (2d + 2λ + Ts )

17
Setting the sample time
• Sampling time selection: t t 
Ts ≈ min  ro , rc 
 10 10 

• Closed loop rise time: trc = 2.2λ e − sd


GCL ( s ) =
1 + λs

• FOPDT open loop rise time: tro = 2.2τ Ke − sd


G (s) =
1+τ s

2.23ζ 2 − 0.078ζ + 1.12 Kωn2 e − ds


• SOPDT Open loop rise time: tro = G ( s) = 2
ωn s + 2ζω n s + ωn2

• Remember to consider extra delays of Ts/2 (effect of sampler) and Ts(ca+sc)


(effect of network delays) before tuning the gains!

18
Example
3e −2 s Digital PI / FOPDT
G ( s) = K 3.00000
1 + 20 s Tau 20.00000
d 2.00000
λ = 10 Lambda 10.00000
Ts 1.00000
ca 1.00000
0.47126 − 0.44828 z −1 sc 1.00000
D( z ) = d' 4.00000
1 − z −1 Ts max 2.20000
K1 0.47126
K2 -0.44828

19
Example (cont.)

20
Arduino Example

Master
(Node #0)

Controller #1 Controller #2
TIA-485
(Node #1) (Node #2)

Process Plant (e.g.


Robot)

21
Example Arduino Sketch (Control Code)
// Sampling time
#define SAMPLE_TIME (100U) // Same units as timer (ms)
// Global timestamp
static unsigned long int time_last=0;

// Setup code
void setup(void)
{
// Initialise ADC/DAC, TIA-485 network, etc…
}

// Loop code, executed continuously


void loop(void)
{
// Take a snapshot of the current time
unsigned long int time_now=millis();

// Is it time to execute another update?


if((time_now-time_last)>=SAMPLE_TIME) // This code is rollover safe
{
// Yes – execute update then advance timestamp
// The code below is executed periodically, once every sample time
PID_Update();
time_last+=SAMPLE_TIME;
}
// Handle communication buffer RX/TX here (very fast function)
Handle_TXRX();
}

22
Example Arduino Digital PID Control Code
// Entry point for the controller code
void Control_Update(void)
{
float Setpoint, Sensor;
static float u=0, e=0, e1=0, e2=0; // Define the controller
#define PID_K1 (1.0f)
// Read the setpoint and measured variables #define PID_K2 (1.0f)
Sensor=analogRead(SENSOR_ADC_CHANNEL); #define PID_K3 (1.0f)
Setpoint=RXBuffRead(NODE_1); #define CONTROL_MAX (10.0f)
#define CONTROL_MIN (0.0f)
// Data housekeeping
e2 = e1; e1 = e;

// Calculate the new error e(k)


e = (Setpoint-Sensor);

// Implement the PID –> change in u(k) This is specific to a given


u = u + (PID_K1*e+PID_K2*e1+PID_K3*e2);
Controller implementation!
// Anti-windup, with the incremental form of
PID we may just saturate u(k) As it is implemented in
if(u > CONTROL_MAX)u = CONTROL_MAX;
if(u < CONTROL_MIN)u = CONTROL_MIN; software, these values could even
be modified remotely…
// Write control signal
AnalogWrite(CONTROL_DAC_CHANNEL, u);
} 23
Questions?

You might also like