Docsity

Safety in Automation Systems, Appunti di Impianti Industriali e Sicurezza sul lavoro

Toggle sidebar
bg1
Process monitoring
Introduction and goals:
The aim of the process monitoring is to observe the flow of the system and understand if something
is going wrong (fault).
We study two subsystems:
oProcess
oRegulator
Why do we want to avoid faults?
1. To Reduce Inoperability
2. To Reduce Operating Costs
3. To Improve Safety
Procedure
We can write a standard procedure for the detection and the correction of the faults:
The 1st one is the detection or identification of the fault
Then there is the fault diagnosis where we try to understand the type of fault that occurred
At the end, there is the process recovery where we try to restore the functionalities. Usually,
we need to stop the system for this stage. (Block the system is very expensive!!)
Techniques
There are three main families of methods:
1. Data Driven approach:
It uses the data to build a model of the system.
Pro: Powerful
Con: Data are not always easy to obtain
2. Analytical approach:
It uses a physical model. The strategy is to use the data obtained using the digital
twin (based on physical model) and compare them with real data obtained from the
system. The idea is that if they are different (over some threshold) the system is in
fault.
Pro: Good with a good model
Con: I need a good model
3. Knowledge based approach:
It is based on previous knowledge. Usually, the behaviour of the system is described
in words (fuzzy system).
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36

Anteprima parziale del testo

Scarica Safety in Automation Systems e più Appunti in PDF di Impianti Industriali e Sicurezza sul lavoro solo su Docsity!

Process monitoring

Introduction and goals:

The aim of the process monitoring is to observe the flow of the system and understand if something

is going wrong (fault).

We study two subsystems:

o Process

o Regulator

Why do we want to avoid faults?

  1. To Reduce Inoperability
  2. To Reduce Operating Costs
  3. To Improve Safety

Procedure

We can write a standard procedure for the detection and the correction of the faults:

 The 1

st one is the detection or identification of the fault

 Then there is the fault diagnosis where we try to understand the type of fault that occurred

 At the end, there is the process recovery where we try to restore the functionalities. Usually,

we need to stop the system for this stage. (Block the system is very expensive!!)

Techniques

There are three main families of methods:

  1. Data Driven approach:

It uses the data to build a model of the system.

Pro: Powerful

Con: Data are not always easy to obtain

  1. Analytical approach:

It uses a physical model. The strategy is to use the data obtained using the digital

twin (based on physical model) and compare them with real data obtained from the

system. The idea is that if they are different (over some threshold) the system is in

fault.

Pro: Good with a good model

Con: I need a good model

  1. Knowledge based approach:

It is based on previous knowledge. Usually, the behaviour of the system is described

in words (fuzzy system).

Data driven methods

The principal methods are:

 Physical redundancy: It is used to avoid the failure related to the sensors. The idea is

to use more than 2 sensors (>=3). In this way if one value is different from the other

two means that this sensor is in fault.

 Analysis of signal variability: The measured values are compared with some

threshold. Therefore, if the value changes to much I detect a fault.

 Spectral analysis: It changes the reference domain. In this case we study the data

looking to the spectrum. Also in this case I compare the measures spectrum with the

“nominal” one and if there is a discrepancy I interpret it as a fault. This method is

very used for rotating elements.

Obs: These methods are not “in contrast” each other, I can use more than 1 of them!

Statistical approach

When we analyse signals, we rely on statistical approaches. In particular, based on the number of

studied variables, we speak about:

 UNIVARIATE ANALYSIS: Only one variable at a time is analysed. In this case the used methods

belong to the family of SPC (Statistical Process Control)

 MULTIVARIATE ANALYSIS: More than one variable at each time is analysed, therefore in this

case we will study also the correlation between different variables.

SPC (Statistical Process Control)

Its goal is to improve the quality of the production. Usually, to reach the aim we want to minimize

the variability of the system. An important instrument used in SPC are the control charts.

To detect if a system is in control or out of control we can study the characteristics of the product.

This characteristic changes with time due to:

 Common cause: Due to natural variability

 Special cause: Due to malfunctions

A process operating without special cause variation is in control.

We need to know the system’s variability in stationary conditions (without disturbances, fault,…)

Control charts

A control chart is characterized by 3 values:

 Points: Measures, mean, range and other values

 Centerline: represents the mean (expected value)

It is called Moving Average because it considers the last measurement + the previous k. Therefore,

the consider window moves with time.

We will use this variable: (^) M i

x i

  • x i− 1

+…+ x i−w+ 1

w

Mean: E^ [ M^ i ]

=μ

Variance: var [

M

i ]

σ

2

w

MA chart with:

 Centerline: μ

 UCL: μ+^3 √

var [

M

i ]

 LCL: μ− 3 √

var [

M

i ]

INITIALIZATION

In the first steps we don’t have enough

points to use this method, or better, we

don’t have enough points to use a window

large as desired. For example, if I’m at the

first step, I have only one measurement

therefore I cannot use a window equal to 4.

I start with a smaller window and very large

control limits (UCL, LCL) and after these

values will adapt themselves.

EFFECTS OF AN INCREASE OF THE WINDOW

 Reduces the variance (less “noise”) and allows to detect shifts and trends.

 Introduces positive correlation (usually sequential values are not independent each other)

 Increases the time to detect a fault (if I use w=100 and my mean is 1, if I take a point x i

the mean becomes 1.09. After two points 1.18 etc. If w=10mean after x i

CONCLUSIONS

Pros :

o Detect small shifts (using a big window)

o New points at any new sample (We don’t need to wait and collect measurements)

o Robust to gaussian assumption (when w>4 this because the mean tends to be gaussian)

Cons :

o EWMA charts are better

o Correlation

o Not suitable for isolated discontinuities

EWMA charts (Exponentially Weighted Moving Average charts)

Each measurement is weighted with a weight w. The most recent values are more weighted. It’s a

forgetting factor.

V

i

=w o

∙ x i

+w 1

∙ x i− 1

  • w 2

∙ x i− 2

+…+w k

∙ x i−k

V

i

=( 1 −λ) ∙V i− 1

+λ ∙ x i

, 0 ≤ λ ≤ 1

o If λ is close to 1 means that you are weighting more the recent datafast filter

o If λ is close to 0 means that you are weighting less the recent dataslow filter

V

i

=( 1 −λ)

i ∙V 0

∑

j= 0

i− 1

( 1 −λ )

i− 1 − j ∙ λ ∙ x j+ 1

Mean: E^ [ V^ i ]=μ

Variance: Var^ [ V^ i ]

=σ

2 ∙

λ

2 −λ

∙ (^) [ 1 −( 1 −λ)

2 i

]

lim

i → ∞

Var (^) [ V i ]=σ V

2 =σ

2 ∙

λ

2 −λ

Steady state variance

CHART

Centerline: μ

UCL, LCL: (^) μ ± 3 ∙ √var^ [V^ i ]=±^3 ∙^ σ^

√

λ

2 −λ

∙ [ 1 −(^1 −λ)

2 i

]

IF I DECREASE λ:

Pros :

o Reduces the effects of random variations

o Allows to detect shift and trends

o Faster than regular MA

Cons :

o Positive correlation

o Requires time to reach stationary conditions

o Long periods where points are above or below the centerline

Empirical rule: λ small when the shifts to be detected are smallAn excessive filtering can hide the

faulty condition.

Capability indices

These indices are used to analyze the distribution of a collection of measurements and to compare

the distribution to a certain USL and LSL.

Assumption:

We collect data in normal operating conditions:

 No faults

 No transients

Training set:

X =

x 11

⋯ x 1 m

x n 1

⋯ x nm

Each row is a measurement at time k

Each column is a state (pressure, temperature, …)

In general, I have many more measurements than variables (n≫m, rows ≫columns)

DATA PREPROCESSING

To extract useful information:

 Removal of outliers

 Normalization of the variables, since the variables have very different scales (e.g. 10 mA vs

100 V)

x i , N

x i

−μ i

σ i

Obs: during the monitoring you need to normalize the data with respect to μ i and σ^ i that are

been used for training

χ

2 DISTRIBUTION

Given m independent gaussian random variables x i with E^ [ x i ]=^0 and Var^ [ x i ]=^1 :

χ m

2 =x 1

2 +…+ x m

2

E (^) [ χ m

2

]=m∙^ Var^ [ x i ]

=m

Var [ χ m

2 ] = 2 ∙ m

The probability density

function tends to a

gaussian for m→ ∞.

α

: Significance level

Area outside the CI (Confidence Interval)

χ α , n

2 : Right-tail quantile

CI :[0.051 , 7,38] with 97.5 % of Probability

Hotelling distance T

2

This distance is a statistical distance (not “physical” as Euclidian distance).

Until now we collected and normalized data (X ).

The covariance matrix is:

S=

n− 1

∙ X

T ∙ X

Symmetric, squared and positive definite matrix

We can define the hotelling distance:

T

2 =X

' ∙ S

− 1 ∙ X

It has a chi-square distribution, and we can use a confidence interval to detect if we are in fault or

not.

e.g.: m= 2 and α =0.025 → CI=[0,7.30]

I evaluate the (^) T

2 in the process using the available data and:

 If (^) T

2 ≤ T α

2 = χ α ,m

2 the process is in control

 T

2

≥ T α

2

= χ α ,m

2 I’m out of control

If we observe the region interpolating the two variables, we can observe

that the area is an ellipse (as seen before).

If we are inside the ellipse the system is in control, otherwise I’m out of

control (point B out of control)

Obs: If we use the mean and the variance of the experimental data also for the process data the

value of T

2

=X

'

∙ S

− 1

∙ X is statistically wrong unless the mean and the variance of the process

are exactly the same as experimental ones.

Solution: If expected value and variance are estimated from data, the confidence region is

defined by a Fisher Distribution:

T

α

2

m( n− 1 )

n−m

∙ F

α

(m , n−m)

 X , matrix with m variables (columns) and n measurements (rows)

 m  SPE and Hotelling distance are only instruments used to detect faults. They don’t tell you

where the fault occurs!!

GOAL

  1. Classify the data

 wx +b ≥ 1 if y i

 wx +b ≤− 1 if y i

 y i

( wx+ b) ≥ 1

  1. Maximize the margin

 max (^ M )=max (

|w|

)

=max (

w

T ∙ w

)

 max ( M ) is equal to min (

M

)

=min (

w

T ∙ w

)

Conclusion :

min

w ,b

ϕ ( w )=

w

T ∙ w, subjects to y i

( wx+b) ≥ 1 ∀ i

REMARK

If the data is noisy, I may not be able to separate the two sets linearly. We have two possibilities:

 To use Kernel trick. With this method we plot the

data on a higher dimensional space and try to

separate it in this new environment.

To do that we must define suitable features.

 To use Slack Variables relax the constraints

ϕ ( w )=

w

T ∙ w +c (^) ∑

i= 0

n

ϵ i

, subjects to

y i

( wx+ b) ≥ 1 −ϵ i

∀ i

In the first case there exists a plane that separates the 2 sets. In the second case there isn’t a

plane that separates the two setsI can relax my constraints (soft SVM)

Multiclass SVM

In case of more than 2 classes we can’t use a single classifier. There exists different approaches, the

main are:

 One Versus All (OVA)

o We assume to have N classes.

o We trained one classifier for each class. The first one says if the point belongs to it or

not, the second one if the point belongs to the second class or not, etc.

o The algorithm is easy. For each data it explores each classifier and finds a related

cost (a number that gives a probability to belong to its class. It usually is the distance

from the classifier). Comparing all the costs, the class to which the data test most

likely belongs is selected.

 One Versus One (OVO)

o The only difference with respect to OVA is that the classifier is not between 1 class

and all the others. But is from one class to another class.

Example with 4 classes:

CLASSIFIER OVA OVO

1 {A}vs{B,C,D} {A}vs{B}

2 {B}vs{A,C,D} {A}vs{C}

3 {C}vs{A,B,D} {A}vs{D}

4 {D}vs{A,B,C} {B}vs{C}

5 {B}vs{D}

6 {C}vs{D}

Neural Networks

A neuron is an entity that given some inputs assigns a value to an output thanks to an activation

function:

Combining more neurons we create a Feedforward Neural Network (NN):

Where y i is the label of the i-th observation

Regulator monitoring

This is a technique used for SISO systems. It’s an easy method to analyze the behavior of the

regulator and to understand if its performances are still good or we need to retune its parameters.

Minimum variance control

The objective is to minimize the variance changing the regulator parameters.

We can consider this strategy as the grandfather of the MPC (Model Predictive Control). This

method, however, is a little bit too aggressive.

For our discussion we assume to have an ARMAX model (auto regressive, moving average with

exogenous inputs model):

A ∙ y ( k )=B∙ u ( k −d ) +C ∙ ξ ( k )

Where:

A , B and C are polynomials in z

ξ (^ k )^ WN ( 0 , σ

2 )

d ≥ 1 , is the delay

The cost function is:

J=E [ ( y ( k +d ) − y

0 )

2

]

The goal is to minimize the error variance (cost function) acting on the control action:

min

u (k)

J

DIOPHANTINE EQUATION

C (^ z

− 1

) =E ( Z

− 1

) ∙ A ( Z

− 1

) + z

−d

∙ F (^ z

− 1

C (^ z

− 1

E (^ Z

− 1

= A (^ Z

− 1

) + z

−d ∙

F (^ z

− 1

E (^ Z

− 1

It has a unique solution, and it is a triangular linear system with respect to the unknown e i and f i

Given our system and the Diophantine equation

{

A ∙ y ( k )=B ∙ u ( k−d) +C ∙ξ ( k )

C (^ z

− 1

)=E ( z

− 1

) ∙ A ( z

− 1

) + z

−d

∙ F (^ z

− 1

→ A ∙ E ∙ y ( k )=B∙ E ∙ u ( k−d) +C ∙ E ∙ ξ ( k )

→ (^ C−z

−d

∙ F )^ ∙ y (^ k )=B ∙ E ∙u (^ k−d )^ +C ∙ E ∙ ξ (^ k )

→ C ∙ y ( k +d )=F ∙ y ( k ) +B ∙ E ∙u ( k )+ C ∙ E ∙ ξ ( k +d )

→ y ( k+ d )=

F ∙ y ( k )+ B ∙ E ∙u ( k )+C ∙ E ∙ ξ ( k+ d )

C

We can split the output in two parts:

y ( k +d ) =^y ( k +d ) +

y ( k +d )=

F ∙ y ( k ) +B ∙ E ∙u ( k )

C

C ∙ E∙ ξ ( k +d )

C

We have that ^y ( k +d ) is predictable but

y ( k + d ) not.

The cost function is (^) J=E [ (^ y^ (^ k^ +d^ )^ −^ y

0 )

2

]=E^ [ (^ ^y^ (^ k^ +d^ )^ +

y ( k + d )− y

0 )

2

]

To minimize it we can only work on the predictable part changing the control law and following the

reference output.

^y ( k +d ) =

F ∙ y ( k ) +B∙ E ∙ u ( k )

C

= y

0

B∙ E ∙ u (^ k )=C ∙ y

0 −F ∙ y (^ k )

Control law:

u (^ k )^ =

C ∙ y

0 −F ∙ y (^ k )

B ∙ E

HARRIS INDEX

When I’m at steady state I expect that the output remains constant at a certain value. Obviously, it is

impossible to have a perfect output due to noise.

The idea is to evaluate the current variance and to compare it to the minimum variance possible.

For this aim we use the Harris index : h=

current variance

minimum variance

 If the current variance is near to the best one, the regulator is well-tuned. h ≈ 1

 Otherwise, I need to retune the regulator. h> 1

The Harris index is: h=^

real variance

minimum variance

σ y

2

σ MV

2

σ MV

2 =E (^) [( ^y ( k + d )+

y ( k + d )− y

0 )

2

]

¿ E [

y ( k +d )

2 ]

¿ E (^) [ ( E ∙ ξ ( k +d ) )

2

]

Another possible index is the idle index. It is based on the response of the system caused by additive

disturbances.

It checks if the response is too slow, and if the response is affirmative the regulator R ( z ) is retuned.

Obs: It works only for OVERDAMPED systems without oscillations

Figure 1 The red one is too slow, the green is good

The idea is that we would like that, after an initial response, dy ∙ du< 0 This means that the input

increases and the output decreases or vice versa.

This means that we have a fast reaction of the input It overcomes the equilibrium input (in this

way the input is higher, and the output comes to desired value faster) and after it decreases.

If after an initial response, dy ∙ du> 0 , means that the response is too slow.

Regulation:

o Good if after an initial response dy ∙ du< 0

o Sluggish after an initial response dy ∙ du> 0

t pos {

t pos

  • h if Δ u ∙ Δ y > 0

t pos

if Δ u ∙ Δ y ≤ 0

t ¬¿¿ ¿

Idle index:

I

i =t pos

t ¬¿

t pos

+t ¬¿

{

− 1 → Regulation good

1 → Regulation slow

I

i obviously assumes intermediate values

Issues:

o All signals are noisy, and this can change their slopes. A possible solution is filtering them.

Additive disturbance

o I i

− 1 can be obtained for oscillatory systems

o We can use other techniques

o In this case we cannot trust I^ i

o It can manage only sudden variation of disturbance. Otherwise, if the disturbance is a “drift”

type one, I^ i can detect sluggish responses also if R ( z ) is properly tuned.

fault detection

Analyti cal redundancy methods

Until now we have spoken about process monitoring. We are able to see if something goes wrong in

the system, but we are not able to identify where the problem takes place.

RESIDUALS

A first important indicator is the residual. To understand better what it is we start with an example:

Example: pipe

o u is the inner flux.

o du is the error in the inner flux (actuator error).

o Y 1

and Y 2

are the fluxes in the two sections.

o l 1

and l 2

are the leakages in the two sectors.

o d y 1

and d y 2

are the errors due to measurements (sensors’ errors).

The equations in the system are:

Y

1 =u+ du+l 1

  • d y 1

Y

2

=u+ du+l 1

+l 2

  • d y 2

If there aren’t errors:

{

Y

1

=u

Y

2

=u

We call primary residuals the values:

{

r p 1

=Y

1

−u=du+l 1

+d y 1

r p 2

=Y

2

−u=du+l 1

+l 2

+d y 2