Instructions for running the process model, generating the external variable datasets, tuning the feedback and feedforward controllers, performing the fault detection, and quantifying the fault detection performance are provided in this document.
- 1. Process model [1]
- 2. External variables
- 3. Controller tuning [4]
- 4. Fault detection
- 5. ROC curves [7]
- References
- Run the Simulink model from the MATLAB Live Script
process_model/copper_solvent_extraction_model.mlx
- Run the MATLAB Live Script from the main
Process-State-Identification
folder
The Simulink model requires the MATLAB Control System Toolbox
to be installed.
Setting | Values | Description |
---|---|---|
SAVE_IMAGES |
true false |
Saves the generated images to the respective output folders if set to true . |
SAVE_DATA |
true false |
Saves the simulation data to the respective output folder if set to true . |
SENSOR_NOISE |
true false |
Adds sensor noise to the measurements if set to true . |
FEEDBACK_CONTROL |
true false |
Enables feedback control of the process if set to true . |
FEEDFORWARD_CONTROL |
true false |
Enables feedforward control of the process if set to true . |
EXTERNAL_VARIABLES_STEADY_STATE |
true false |
Sets the external variables to their constant steady-state values when set to true , or loads the non-steady-state external variable dataset selected by EXTERNAL_VARIABLES_DATASET when set to false . |
EXTERNAL_VARIABLES_DATASET |
'training' 'testing' |
Loads the training non-steady-state external variable dataset when set to 'training' , or the testing non-steady-state external variable dataset when set to 'testing' . Must specify a dataset to use regardless of the value of EXTERNAL_VARIABLES_STEADY_STATE . |
LOWPASS_FILTER_TUNING |
true false |
Stops the loaded organic and lean electrolyte stiction models from 'sticking' when set to true . This can be used to tune the loaded organic and lean electrolyte stiction lowpass filters (see below). The loaded organic and lean electrolyte stiction models work as expected when set to false . |
PROCESS_STATE |
see below | Select which process faults occur by selecting the process state. See section 1.4. Process States below. |
PROCESS_STATE_PLOTTING_REDUCED |
true false |
Only plots the single-fault process states (0 to 4 ) when set to true . Plots all the process states (0 to 8 ) when set to false . |
The .gitignore file has been set up to ignore all output folders.
Create the following folder structure to save the simulation results using the SAVE_IMAGES
and SAVE_DATA
settings:
.
|__ process_model
|__ output
|__ data
|__ graphs
|__ measured_variables
|__ process_variables
|__ valve_states
The desired fault combinations can be set using the PROCESS_STATE
setting. The following table shows which loaded organic valve faults [2] and which lean electrolyte valve faults occur for the selected process state.
Process State | Loaded Organic Valve | Lean Electrolyte Valve |
---|---|---|
0 |
normal | normal |
1 |
stuck | normal |
2 |
stiction | normal |
3 |
normal | stuck |
4 |
normal | stiction |
5 |
stuck | stuck |
6 |
stuck | stiction |
7 |
stiction | stuck |
8 |
stiction | stiction |
9 |
custom | custom |
State 9
allows for custom behaviour to be defined in each control valve's custom
variant subsystem's Stateflow chart.
The valve states are represented by the following values, and are selected using variant subsystems:
Value | Valve State |
---|---|
0 |
normal |
1 |
stuck |
2 |
stiction |
The time that the selected process faults occur can be set using the following start_time
parameters. Corresponding stop_time
parameters are also provided to set the time at which the process faults stop occurring. If no stop time is desired, set the respective stop_time
parameter equal to the simulation time plus one.
Parameter | Units | Description |
---|---|---|
valve_LO_fault_start_time |
s | Time for the loaded organic valve's fault to occur |
valve_LO_fault_stop_time |
s | Time for the loaded organic valve's fault to stop |
valve_LE_fault_start_time |
s | Time for the lean electrolyte valve's fault to occur |
valve_LE_fault_stop_time |
s | Time for the lean electrolyte valve's fault to stop |
The loaded organic and lean electrolyte control valve stiction models use 1st order Butterworth lowpass filters [3] to account for the sensor noise's effect on the valve stem positions. The valves 'stick' when the filtered valve position reaches a turning point.
The cutoff frequency of the lowpass filters can be tuned by seting the LOWPASS_FILTER_TUNING
setting to true
. The stiction models then still run, but the control valves will not 'stick'. The filtered signals can be viewed using the Valve LO Lowpass Filter Scope
and Valve LE Lowpass Filter Scope
scopes found in their respective stiction-valve-model subsytems. The process state has to be set to such a state in which the valve under consideration is experiencing stiction for the lowpass filters to be active.
The cutoff frequency for the loaded organic control valve's lowpass filter can be set using valve_LO_stiction_lowpass_filter_cutoff_frequency
(rad/s). The cutoff frequency for the lean electrolyte control valve's lowpass filter can be set using valve_LE_stiction_lowpass_filter_cutoff_frequency
(rad/s).
- Run the Simulink model from the MATLAB Live Script
gaussian_external_variables.mlx
- Run the MATLAB Live Script from the main
Process-State-Identification
folder
Create the following folder structure to save the smoothed external variable data and graphs:
.
|__ external_variables
|__ output
|__ data
|__ graphs
Copy the generated external variable .mat files over to the following folder to use them in the process model:
.
|__ external_variables
|__ data
The following settings were used in the Signal Builder blocks in the gaussian_external_variables.slx
file to generate the non-steady-state external variables used for the process model:
Property | Value |
---|---|
Simulation time | 200 hours (720 000 seconds) |
Sampling time | 1 second |
Standard deviation |
|
Sample frequency | 0.00005 Hz |
The first and last points of each signal were manually changed to start and stop on the steady-state values of the respective variable.
Variable | Mean | Standard deviation | Units | Seed |
---|---|---|---|---|
7 | 0.7 | g/L | 1 | |
35 | 3.5 | g/L | 2 | |
278 | 27.8 | L/s | 5 | |
278 | 27.8 | L/s | 16 |
Variable | Mean | Standard deviation | Units | Seed |
---|---|---|---|---|
7 | 0.7 | g/L | 19 | |
35 | 3.5 | g/L | 22 | |
278 | 27.8 | L/s | 28 | |
278 | 27.8 | L/s | 30 |
- Run the Simulink model from either of the following two MATLAB Live Scripts:
feedback_arx_models.mlx
feedforward_arx_models.mlx
- Run the above mentioned MATLAB Live Scripts from the main
Process-State-Identification
folder
Create the following folder structure to save the ARX model [5] results:
.
|__ controller_tuning
|__ output
|__ feedback
|__ feedforward
- Run the fault detection MATLAB Live Script from the main
Process-State-Identification
folder
Setting | Values | Description |
---|---|---|
SAVE_IMAGES |
true false
|
Saves the generated images to the respective output folders if set to true . |
SAVE_DATA |
true false
|
Saves the fault detection data to the respective output folder if set to true . |
NUMBER_OF_PRINCIPLE_COMPONENTS_TO_USE |
1 to 11
|
Specify the number of principal components to use for the reduced principal component subspace. |
T2_ALPHA |
Upper control limit (UCL) for the Hotelling's T2 statistic control chart [6]. | |
Q_ALPHA |
UCL for the Q statistic control chart [6]. | |
NUMBER_CONSECUTIVE_ABOVE_UCL |
Specify the number of consecutive measurements that must be above the UCL before a fault is detected. | |
PROCESS_STATE_PLOTTING_REDUCED |
true false
|
Only plots the single-fault process states (0 to 4 ) when set to true . Plots all the process states (0 to 8 ) when set to false . |
ROC_CURVE_CONSTRUCTION_T2 |
true false
|
Appends the Hotelling's T2 ROC curve results for the current ROC_CURVE_DATA_T2 table to use for constructing a Hotelling's T2 ROC curve. |
ROC_CURVE_CONSTRUCTION_Q |
true false
|
Appends the Q statistic ROC curve results for the current ROC_CURVE_DATA_Q table to use for constructing a Q statistic ROC curve. |
STATE_1_START_TIME |
The time at which process state 1 starts in the fault detection dataset in units of seconds. Must be divisable by SAMPLING_RATE . |
|
STATE_1_STOP_TIME |
The time at which process state 1 stops in the fault detection dataset in units of seconds. Must be divisable by SAMPLING_RATE . |
|
STATE_2_START_TIME |
The time at which process state 2 starts in the fault detection dataset in units of seconds. Must be divisable by SAMPLING_RATE . |
|
STATE_2_STOP_TIME |
The time at which process state 2 stops in the fault detection dataset in units of seconds. Must be divisable by SAMPLING_RATE . |
|
STATE_3_START_TIME |
The time at which process state 3 starts in the fault detection dataset in units of seconds. Must be divisable by SAMPLING_RATE . |
|
STATE_3_STOP_TIME |
The time at which process state 3 stops in the fault detection dataset in units of seconds. Must be divisable by SAMPLING_RATE . |
|
STATE_4_START_TIME |
The time at which process state 4 starts in the fault detection dataset in units of seconds. Must be divisable by SAMPLING_RATE . |
|
STATE_4_STOP_TIME |
The time at which process state 4 stops in the fault detection dataset in units of seconds. Must be divisable by SAMPLING_RATE . |
|
SAMPLING_RATE |
The sensor sampling rate used for the data in units of seconds. | |
DETECTION_DELAY_CONSTRUCTION_T2 |
true false
|
Appends the Hotelling's T2 detection delay results for the current DETECTION_DELAY_DATA_T2 table to use for constructing a Hotelling's T2 detection delay plot. |
DETECTION_DELAY_CONSTRUCTION_Q |
true false
|
Appends the Q statistic detection delay results for the current DETECTION_DELAY_DATA_Q table to use for constructing a Q statistic detection delay plot. |
Create the following folder structure to save to fault detection results using the SAVE_IMAGES
and SAVE_DATA
settings:
.
|__ fault_detection
|__ output
|__ data
|__ fault_detection
|__ PCA
|__ training
- Run the ROC curves MATLAB Live Script from the main
Process-State-Identification
folder
Setting | Values | Description |
---|---|---|
T2_TRAINING_INDEX |
The index of the Hotelling's T2 training |
|
Q_TRAINING_INDEX |
The index of the Q statistic training |
|
T2_RECOMMENDED_INDEX |
The index of the Hotelling's T2 recommended |
|
Q_RECOMMENDED_INDEX |
The index of the Q statistic recommended |
|
T2_OPTIMAL_SENSITIVITY_INDEX |
The index of the Hotelling's T2 optimal sensitivity |
|
Q_OPTIMAL_SENSITIVITY_INDEX |
The index of the Q statistic optimal sensitivity |
Save the ROC_CURVE_DATA_T2
and ROC_CURVE_DATA_Q
data tables from the fault detection as .mat files and copy them over to the following folder to use for constructing the ROC curves:
.
|__ roc_curves
|__ data
Create the following folder structure to save to generated ROC curves:
.
|__ roc_curves
|__ output
[1] T. Komulainen, P. Pekkala, A. Rantala, and S.-L. Jämsä-Jounela, “Dynamic modelling of an industrial copper solvent extraction process,” Hydrometallurgy, vol. 81, no. 1, pp. 52–61, Jan. 2006, doi: 10.1016/j.hydromet.2005.11.001.
[2] M. A. A. Shoukat Choudhury, N. F. Thornhill, and S. L. Shah, “Modelling Valve Stiction,” Control Eng Pract, vol. 13, no. 5, pp. 641–658, May 2005, doi: 10.1016/j.conengprac.2004.05.005.
[3] MathWorks, “Butterworth filter with varying coefficients - Simulink,” 2022. https://www.mathworks.com/help/control/ref/varyinglowpassfilter.html (accessed Oct. 25, 2022).
[4] T. Komulainen, F. J. Doyle, A. Rantala, and S. L. Jämsä-Jounela, “Control of an industrial copper solvent extraction process,” J Process Control, vol. 19, no. 1, pp. 2–15, Jan. 2009, doi: 10.1016/j.jprocont.2008.04.019.
[5] T. E. Marlin, Process Control: Designing Processes and Control Systems for Dynamic Performance, 2nd ed. 2015.
[6] A. Bakdi and A. Kouadri, “An improved plant-wide fault detection scheme based on PCA and adaptive threshold for reliable process monitoring: Application on the new revised model of Tennessee Eastman process,” J Chemom, vol. 32, no. 5, p. e2978, May 2018, doi: 10.1002/CEM.2978.
[7] G. James, D. Witten, T. Hastie, and R. Tibshirani, An Introduction to Statistical Learning. New York, NY: Springer US, 2021. doi: 10.1007/978-1-0716-1418-1.