Professional Documents
Culture Documents
Minerals Engineering
journal homepage: www.elsevier.com/locate/mineng
A R T I C L E I N F O A B S T R A C T
Keywords: As processes involved in mineral processing operations increase their complexity, automation and control
Paste thickening become critical to ensure an economically viable and environmentally sustainable operation. In the context of
Model predictive control modern mineral processing, paste thickening stands out as a relatively new method for producing high density
Random forest
slurries that has proven challenging for standard control algorithms. In this setting, the use of machine-learning-
Machine learning
based models within a predictive control strategy arises as an appealing alternative. This work presents a
Random Forest Model Predictive Control scheme for paste thickening based on a purely data-driven approach for
modeling and evolutionary strategies for solving the associated optimization problem. Results show that the
proposed strategy outperforms conventional predictive control both qualitatively and quantitatively.
☆
This work was supported in part by ANID under grant ANID PIA ACT192013
* Corresponding author.
E-mail addresses: pdiaz2@uc.cl (P. Diaz), jcsalasm@ing.puc.cl (J.C. Salas), aciprian@ing.puc.cl (A. Cipriano), fenunez@ing.puc.cl (F. Núñez).
https://doi.org/10.1016/j.mineng.2020.106760
Received 26 July 2020; Received in revised form 29 November 2020; Accepted 21 December 2020
Available online 19 January 2021
0892-6875/© 2021 Elsevier Ltd. All rights reserved.
P. Diaz et al. Minerals Engineering 163 (2021) 106760
2
P. Diaz et al. Minerals Engineering 163 (2021) 106760
problem. Fig. 1 illustrates a paste thickener with the three regions independent and identical distributions, without increasing each
highlighted. learner’s variance as much.
Bootstrapping with replacement generates identically distributed As all MPC strategies, the proposed RF-MPC is comprised of a pre
predictors (Hastie et al., 2009). Therefore, the bias of the bagged dictive model, an objective function and system constraints.
ensemble of trees is the same as that of each individual and a correlation
coefficient ρ exists between them. Random forests deal with this precise 4.1. Elements of the controller
issue (Breiman, 2001). By randomly selecting the input variables at each
partition the correlation coefficient ρ is decreased, mimicking Naturally, the predictive models used are random forests:
3
P. Diaz et al. Minerals Engineering 163 (2021) 106760
( )
yi t + 1 = ℱ
̂
( ( ))
̂ i mi t, na , nb , np , i = 1, 2. (5) 1983; Chiandussi et al., 2012).
In this work, a modified version of the Particle Swarm Optimization
(PSO) (Mezura-Montes and Coello, 2011; Pedersen and Chipperfield,
As for the optimization problem solved to calculate the sequence
2010) algorithm is used. Since (6) uses Δukj+i in its formulation, the
u[j;j+Nu − 1] , in this work a generic quadratic objective function is used,
which considers n = 2 controlled variables and m = 2 manipulated sequence Δuk[j;j+Nu − 1] is unrolled into a particle Xk of size Nu .
variables, then the optimization problem solved at time instant j is given PSO termination depends on various terminal conditions. Typically,
by these consist on exceeding a specified number of iterations, objective
( ) ( ) function stall or timeouts.
∑ n ∑m N∑u− 1
min V y, u = Vi y i +
Rk ( k ( ))2
Δu j + i , (6) In an MPC problem, the cost of the objective function itself is of less
Δu
i=1 k=1 i=0
s k importance than the sequence of decision variables. A particle distance
stall criterion is added for termination if the best particle lies at a dis
where each Vi (yi ), one per controlled variable, is equal to tance δs of the previous one for Is iterations.
N
( ) N∑
y− 1
Qi ( i ( ))2 ∑ y
∊i(j+t) 4.3. Implementation
Vi y i = e j+t
̂ + Λi
li li
t=1 t=1 (7)
( i( ) )2 Fig. 2 shows the different components of the RF-MPC implemented
+ y j + Ny − yiss ,
βi ̂ and their interaction.
Each particle component is constrained to δuk accordingly in the
and particle generation block. Since predictors mi (t + (j − 1)) contain lagged
values of u(t + (j − 1)) the decision variables are decoded consequently
( )
• Ny ∈ Z⩾0 and Nu ∈ Z⩾0 are the prediction and control horizon,
respectively. and saturated to U k , Uk if required.
i i
• ̂e (t +j) := ̂ y (t +j) − wi (t +j) ∈ R is the predicted error for the The Random Forest Prediction block executes the recursive predic
controlled variable i, with respect to the reference sequence tive strategy as introduced in Section 3.
wi[j;j+Ny − 1] . All error terms from the objective function 7 are computed in the
• yiss ∈ R is the steady-state target for the controlled variable i, and subsequent block. In the case of the on-ff variables ∊ij the predictions are
checked to see if limits are violated. Finally, these results are fed to the
hence yiss = wi (t +Ny ) holds.
objective function block for fitness value computation.
• ∊i(j+t) ∈ {0, 1} is a binary on-off variable that takes into account the
The last step in Fig. 2 consists on the implementation of the PSO
violation of a constraint for the controlled variable i at time j + t.
algorithm. After checking for terminal conditions, particle positions are
• Qi , Rk , βi , Λi ∈ R⩾0 are real positive weights.
updated and the whole process is restarted every τC time units.
• li , sk ∈ R⩾0 are normalization coefficients.
⃒ k ( )⃒
⃒Δu j ⃒⩽δuk , ∀j ∀k. (10)
4
P. Diaz et al. Minerals Engineering 163 (2021) 106760
5. Experimental results
5.1. RF-MPC implementation as a toolbox Fig. 4. Process and instrumentation diagram of the industrial thickener used in
this work.
The RF-MPC algorithm implemented is fully vectorized. The ele
ments that go through each of the blocks in Fig. 2 are matrices that
contain transformations of the particles. For example, the prediction three Siemens sitrans FM MAG5100W flow sensors, and the PLA
block transforms the particle matrix into a prediction matrix for each SmartDiver sensor. During data acquisition, the thickener was operated
separate prediction step and for each separate output. by manually writing the process values into the actuators via the DCS and
It was observed in preliminary tests that built-in Matlab functions the PLC. Fig. 4 presents the process and instrumentation diagram of the
used for prediction amounted up to 30% of the execution time of each thickener. Input data is collected at the rate the DCS operates and then
RF-MPC iteration. To overcome this issue, prediction functions, which downsampled to the predictive model period τR . The training dataset
load trees, where converted to Matlab executable files (.mex). This with sampling period τR contains 6912 points (about one month of
approach significantly reduces computation times thanks to efficient operation) and is shown in Fig. 5. An 85/15 % train-test ratio was used.
dynamic memory usage. When applied to paste thickening, the average Additionally, considering the control action period, Table 1 shows the
prediction time obtained was 3 ms. different time scales involved in the problem. As operational data was
The algorithms developed were packaged as a general purpose acquired under manual supervision and control, inputs and outputs are
toolbox that can be adapted to control any system. The toolbox, which is correlated hence identification is an even more complex task.
freely available as a repository in Github (Díaz, 2019), is comprised of
three main libraries: 5.2.1. Predictive modeling
Performance of random forest as predictors will be benchmarked
5.1.1. Machine learning library against an ARIMAX model
Contains all training, validating and testing functions and utilities to ( ) () ( ) ( ) ()
C(z− 1 )
generate the Random Forests. It also implements other predictors, such A z− 1 y t = z− L B z− 1 u t − 1 + e t . (11)
1− z − 1
as ARIMAX models.
For each output of the ARIMAX model the tuning parameters are (na ,
5.1.2. C-MEX generation library
nb = np ,nc ). Additionally, different input delays L can be considered for
Creates a compact version of the forests identified for storage and
each transfer function. Random forests posses two additional parameters
translates the code to the .mex files for fast prediction and use in the
for performance tuning: number of ensembles to be learned B and
Simulink environment.
minimum leaf size lmin . It is important to note that random forests as
expressed (4) do not account for unmeasured disturbances, that is, nc =
5.1.3. RF-MPC library
0 for all forests. For identification, certain physical limits of the process
Contains the implementations and algorithms of all the blocks in
itself limit the search space, such as the thickener residence time, whose
Fig. 2 as well as other utilities.
upper bound is estimated at six hours (Langlois and Cipriano, 2019).
The final implementation of the RF-MPC is in the Simulink frame
Parameters are selected by a greedy heuristic based on the mean
work through the custom function block of Fig. 3. Four inputs are
squared one-step ahead prediction error (MSE),
considered, the disturbance sequence d, the output sequence y the
reference sequence w, and the system clock clk. As outputs, the block 1 ∑N
( i( ) ( ))2
delivers the control action u(t), and additional information of the J iMSE = y k − ̂y i k , (12)
N k=1
controller operation: exitflag and fval contain information about
PSO termination and final cost, while yHat and controlMoves pro i
where yi (k) represents the ith target at time step k, while ̂
y (k) represents
vide the predicted trajectory and the complete u sequence.
the predicted value. An exhaustive search was performed by varying na ,
nb , and np from 0 to 100 in increments of 2, nc and L from 0 to 10 in
5.2. System identification results
increments of 2, B from 0 to 200 in increments of 10 and lmin from 0 to 20
in increments of 5. Table 2 summarizes the parameters that delivered the
To obtain a model of the thickener under study, operational data
best results in terms of JiMSE . It should be noted that bootstrapping
from a real operation was used, which was obtained from the Distributed
Control System (DCS) governing the process. The thickener under contributes to considering different initializations in the identification
analysis is controlled by a Siemens S7-400 PLC connected to a Siemens process, which increases robustness of the forest. In the case of the
PCS 7 DCS, which concentrates measurements from: two Berthold LB- ARIMAX model, a consistent convergence of the parameters is observed.
491 density sensors, two Siemens sitrans P DSIII pressure sensors, An important conclusion obtained from Table 2 is that both
5
P. Diaz et al. Minerals Engineering 163 (2021) 106760
Fig. 5. Part of the dataset used for system identification, blue data (6912 datapoints) was used for training and red data (1220 datapoints) for validation. (a): ϕf
(disturbance), (b): h (controlled variable), (c): ϕu (controlled variable), (d): Qu (manipulated variable). (For interpretation of the references to color in this figure
legend, the reader is referred to the web version of this article.)
Table 1 Table 3
Samplings periods used in the implementation. BFR of random forests and ARIMAX models for different prediction horizons.
Parameter Value Unit 1 step 18 steps 24 steps 48 steps
Table 2 tance. Samples not used for training are passed down each tree Tb when
Best hyperparameter combination for thickener model identification. grown, and the prediction accuracy is recorded. Values for a variable k
Random Forest ARIMAX
are randomly permuted in the OOB samples and accuracy is recom
puted. This Permuted Delta Error (PDE) is averaged over all trees
(na , nb , np , nc ) (72, 72, 72, 0) (60, 30, 30, 6)
measuring the importance of variable k (Hastie et al., 2009). Fig. 6
Delay L 0
–
shows the logarithm of this importance measure for the ϕu (t) forest. It
(B, lmin ) (100, 10) –
can be seen that recent outputs are considered relevant for the predic
tion. However, recent samples of Qu score significantly high as well. This
property is extremely useful for the generation of a controllable model.
Also, predictor importance is statistically significant for the oldest
sample for all variables, which explains the need of high-order models.
6
P. Diaz et al. Minerals Engineering 163 (2021) 106760
Fig. 7. Comparison of 18-step ahead prediction of random forest and ARIMAX strategies for (a) ϕu (t) and (b) h(t).
Table 4
Horizons and control period used in the experiments.
Controller action τC 5 min
Prediction Horizon Ny 90 min
Control Horizon Nu 15 min
Table 5
Process limits considered in the experiments.
ϕu h Qu F
controllability. On the one hand, the forest predictor deems both auto-
regressive and exogenous coefficients important, as depicted in Fig. 6.
However, results in Fig. 7 show that the forest forecasting accuracy is Fig. 8. Evolution of ϕf (t) during the ϕu (t) set-point tracking experiment.
biased towards recent samples of the output. The ARIMAX predictor,
however, seems to misinterpret the effect of the inputs on the outputs.
Since in any MPC scheme models are instrumental to determine the 5.3.1. Control specifications
control sequence, the real potential of the models will be clarified in the Table 4 lists the parameters used for control purposes in both stra
following predictive control experiments. tegies, to provide a fair comparison. The prediction horizon corresponds
to the 18-steps ahead established previously. As τC = τR , move blocking
5.3. Control results is not used. Constraints were imposed on process variables based on the
literature regarding thickener operation (Langlois and Cipriano, 2019).
For benchmarking purposes, the proposed RF-MPC is compared to a These are listed in Table 5 and illustrate the tight operating window for
conventional MPC strategy based on the identified ARIMAX model. The ϕu . The operating point specified for control and disturbance variables is
system was driven to steady-state using data from 200 h of real opera ϕu (0) = 73.76%, h(0) = 4.12m, and ϕf (0) = 28.31%.
tion, subject to the process disturbance. The tuning of each controller For this work, and in compliance with thickener control objectives,
was based on trial and error by testing tuples of weighting factors and emphasis was given to setpoint tracking and constraint satisfaction by
recording the MSE as defined in (14) (see Section 5.4). Those tuples with picking large Qi and Λi in (7). Also, flocculant use was penalized with a
the minimum MSE were selected as nominal parameters for each higher cost since it is a resource consumed during operation rather than
controller, in order to compare the best effort for each case. the aperture of a valve. The exact values of all parameters can be found
in Table A.7 and A.8 in the Appendix.
As the proposed RF-MPC depends on PSO to solve the online
7
P. Diaz et al. Minerals Engineering 163 (2021) 106760
Table 6
Performance indicators of RF-MPC and conventional MPC for set-point tracking.
MSE ϕu (t) MAE ϕu (t) MSE h(t) MAE h(t)
controlled variables.
A closer look to Fig. 9b elucidates this behaviour. For the first 40 h of
the simulation, both controllers push Qu to levels near its higher limit. In
fact, conventional MPC saturates its output while the RF-MPC outputs
subtle variations.
However, as shown in Fig. 9a, conventional MPC stabilizes ϕu with
no steady-state error, while the proposed strategy is unable to do so. The
reason behind is that the interface level h rises towards its limit. Hence,
the RF-MPC reduces Qu beforehand to track both setpoints simulta
neously. In fact, conventional MPC violates the h limit in Table 5.
After this time period, the setpoint is changed back to its original
state. This forces both controllers to abruptly reduce Qu levels. However,
as h drops rapidly, a situation similar to the results depicted in Fig. 7b
occurs. The poorly identified influence of exogenous variables on the
outputs of the ARIMAX model produces a destabilizing response in the
conventional linear MPC strategy. The linear predictor estimates that
lower saturation of the inputs is optimal. The RF-MPC strategy, how
ever, offers a radically different solution, attaining stabilization of ϕu
with no steady-state error between hours 40 to 70.
The last portion of the simulation shows that the RF-MPC fails to
drive ϕu to its setpoint. The decrease of ϕf in the last 20 h of the horizon
explains this. To cope with this, the RF-MPC increases the average level
of flocculant added to the system to maintain both ϕu and h as close as
possible to their setpoints.
Quantitative comparison of the controller performance can be made
in terms of the mean squared error (MSE) and maximum absolute error
(MAE),
( ) ( )
∑ N
(w(k) − y(k))2
MSE = , MAE = max |w k − y k |. (14)
k=1
N k∈[1;N]
The primary objective in thickener control is to maintain a high ϕu This article proposes a novel original model predictive control
throughout operation while rejecting solid intake disturbances (Jewell strategy based on machine learning techniques. The main contribution
and Fourie, 2015). To test controller performance, an abrupt change of consists in generating a purely data-driven controller in the form of a
±1% was applied to the ϕu setpoint over the initial operating point for a toolbox. As recently random forests have gained scientific acclaim for
time window of 100 h. nonlinear model identification, this technique was chosen for the pre
Fig. 8 shows the evolution of ϕf (real operational data) during the dictive model.
simulation horizon. As ϕf is collected in a manual and hourly fashion it is The use of random forests for multiple step ahead prediction results
subject to a slower rate of change. in a non convex and nonlinear online optimization problem for the
Simulation results for the setpoint tracking experiment are shown in controller. To overcome this issue, another machine learning approach,
Fig. 9. It can be seen that RF-MPC performs better in these tests for both
8
P. Diaz et al. Minerals Engineering 163 (2021) 106760
9
P. Diaz et al. Minerals Engineering 163 (2021) 106760
Tan, C.K., Setiawan, R., Bao, J., Bickert, G., 2015. Studies on parameter estimation and Xu, N., Wang, X., Zhou, J., Wang, Q., Fang, W., Peng, X., 2015. An intelligent control
model predictive control of paste thickeners. J. Process Control 28, 1–8. strategy for thickening process. Int. J. Miner. Process. 142, 56–62.
Tan, C.K., Bao, J., Bickert, G., 2017. A study on model predictive control in paste Zhang, W., Quan, H., Srinivasan, D., 2018. Parallel and reliable probabilistic load
thickeners with rake torque constraint. Miner. Eng. 105, 52–62. forecasting via quantile regression forest and quantile determination. Energy 160,
Wang, R., Bao, J., Yao, Y., 2019. A data-centric predictive control approach for nonlinear 810–819.
chemical processes. Chem. Eng. Res. Des. 142, 154–164.
10