1. Introduction
The aluminum electrolysis industry is an important aspect of modern industry, involving complex electrochemical reactions and the regulation of various process parameters [
1,
2,
3,
4]. The production process consists of four main stages: bauxite processing, alumina electrolysis, the handling of molten aluminum, and aluminum ingot casting [
5,
6]. This study focused on the aluminum extraction stage following alumina electrolysis, as shown in
Figure 1. The greatest challenge associated with the aluminum tapping process is precise control. Accurate aluminum tapping is crucial for the precise calculation of costs, the maintenance of a relatively stable aluminum liquid level in the electrolytic cell, the stabilization of the electrolysis process, the achievement of energy savings and the improvement of efficiency.
Aluminum extraction is controlled by a precise system composed of upper and lower controllers. The upper-level controller downloads operator-set extraction parameters into the Programmable Logic Controller (PLC) of the lower-level system. The PLC then records the ladle weights, manages aluminum extraction, and initializes the system. When the PLC closes the electromagnetic valve upon command, residual negative pressure in the ladle prevents the immediate cessation of aluminum flow. To address this overshoot, the system employs a preemptive valve closure strategy, enhancing the extraction accuracy. Activating the valve is referred to as “air-on”, while closing it is termed “air-off”. The “pre-close wind volume” compensates for the overshoot, aiming to match it precisely. The net aluminum output is calculated as the difference between the ladle weight when the valve is activated and the final ladle weight. This is a real-time updated value. When the sum of the pre-close wind volume and net output equals or exceeds the planned output, the PLC closes the valve.
However, controlling this process is challenging due to the complexity of accurately calculating the pre-close wind volume. This requires two key parameters: the real-time extraction flow rate at air-off and the pre-close wind volume coefficient. The flow rate, derived from the net aluminum output, is subject to significant variability and measurement noise; thus, filtering must be performed in order to improve accuracy. Additionally, the pre-close wind volume coefficient, traditionally determined empirically, must dynamically adapt to changes in the flow rate to maintain precision. Faster flow rates require larger coefficients, while slower rates necessitate smaller ones.
As discussed earlier, the rapid and accurate calculation of aluminum extraction flow rates is indispensable in determining the pre-close wind volume. However, the electronic scale is a hanging scale, and during its operation, the inevitable swinging of the lifted package generates observational noise. Moreover, the aluminum tapping process in the electrolytic aluminum cell is inherently nonlinear [
7]. As a result, the aluminum tapping process exhibits strong nonlinearity and randomness, making it difficult for traditional computational methods, such as the standard Kalman Filter (KF), to simultaneously meet the accuracy and computational speed required to predict the aluminum flow rate. The Extended Kalman Filter (EKF), which linearizes nonlinear systems using the Taylor expansion, performs better with mildly nonlinear systems [
8,
9]. However, its linearization process introduces errors, especially in highly nonlinear systems. In contrast, the Unscented Kalman Filter (UKF) directly addresses nonlinearity using the Unscented Transformation (UT) [
10,
11], avoiding derivative calculations and reducing the number of linearization errors. This enables the UKF to capture nonlinear dynamics more accurately. Additionally, while Particle Filters (PFs) theoretically achieve high precision in estimating nonlinear, non-Gaussian systems, they are computationally expensive, especially when there is a large number of particles [
12,
13]. The UKF strikes a balance between computational complexity and estimation accuracy, making it more suitable for real-time applications. Compared to Moving Window Filters (MWFs), which excel at smoothing but are less effective in dynamic state estimation [
14], the UKF provides more stable and precise results in complex dynamic systems. Similarly, while neural networks capture complex nonlinear relationships through data-driven training [
1,
2,
13], they require large datasets and are better suited to pattern recognition tasks. UKF, on the other hand, excels in real-time state estimation and noise filtering in systems with strong prior knowledge, offering enhancements in real-time performance and computational efficiency.
Given these strengths, the UKF is a superior choice for estimating the aluminum extraction flow rate in the highly nonlinear and noisy aluminum electrolysis system. It significantly improves the accuracy and timeliness of state estimation, making it well suited for practical applications in complex dynamic systems.
As highlighted earlier, the accurate calculation of the pre-close wind volume also depends on determining the pre-close wind volume coefficient. Current methods often overlook this critical aspect. Therefore, this study proposes a novel method for adjusting the dynamics of the pre-close wind volume coefficient, using the aluminum extraction deviation as the basis. This deviation, defined as the difference between the planned and actual aluminum output, is filtered using an Average Filter (AF) to enhance the calculation accuracy. The AF is computationally simple, highly stable, and widely applicable, performing exceptionally well in systems with minimal noise [
15,
16]. Improving the precision of coefficient calculation has significant implications for enhancing the calculation of the pre-close wind volume and the overall accuracy of control.
This paper introduces a precise pre-close wind volume calculation algorithm in order to provide a theoretical foundation for accurate aluminum extraction control in aluminum electrolysis. The remainder of this paper is organized as follows:
Section 2 details the calculation of the aluminum extraction flow rate;
Section 3 discusses the precise determination of the pre-close wind volume coefficient;
Section 4 presents the results and discussion, highlighting the advantages of the UKF algorithm and the effectiveness of the proposed coefficient calculation method, as well as identifying existing shortcomings; and
Section 5 concludes the study.
2. Precise Calculation of the Aluminum Extraction Flow Rate
2.1. Aluminum Output Speed Model Establishment
In the aluminum electrolysis process, the PLC calculates the speed of aluminum extraction based on weight data from the electronic scale. By dividing the difference in the net aluminum weight between two consecutive measurements by the sampling interval, the real-time extraction speed is determined. However, in this process, due to the measurement errors caused by the swinging of the electronic scale and the real-time changes in the aluminum tapping speed, nonlinearities arise, leading to inevitable errors in the velocity calculation. First, the following about the electrolysis system is assumed:
It is assumed that the system parameters (such as electrolyte conductivity and temperature gradient) are relatively stable over short periods.
It is assumed that electrochemical reactions follow linear dynamics, ignoring the effects of complex reaction rate variations.
It is assumed that the noise in aluminum output follows a Gaussian distribution.
This study used the UKF method to filter extraction speed data. The simulations assumed a PLC sampling frequency of 8 Hz, with the initial speed set to 10 kg·s−1 and this transitioning to 15 kg·s−1 after 6.25 s. The initial extraction weight is 0 kg, with Gaussian white noise (1 dBW intensity) being used to model the scale observation noise. Using MATLAB R2021b software, the wgn function is used to generate Gaussian white noise, and simulations are performed on an Intel Core i7-12700H processor (Intel, Santa Clara, CA, USA).
2.2. Unscented Kalman Filter
The UKF is a filtering method designed to address nonlinear-state estimation problems. Unlike the standard KF, the UKF does not require the system model to be linear. The UKF employs a technique known as “Unscented Transformation” to handle the nonlinear characteristics of the system. Unscented Transformation primarily uses a set of deterministic sampling points, called sigma points, to approximate the probability distribution of the state variables. The specific principles are as follows [
17,
18,
19].
2.2.1. State Prediction
Sigma Point Generation: Sigma points are generated by expanding the current state mean and covariance matrix. The degree of expansion is controlled by the Unscented Transformation parameters. For a state
x and covariance matrix
P, the generated sigma points are as follows [
20]:
where
is the expansion parameter and
is the
i-th column of the covariance matrix.
State Prediction: the state transition model is used to predict all sigma points:
where
f(
x) is the state transition function.
The predicted mean and covariance are calculated:
where
and
are the weights of the mean and covariance, respectively, and
Q is the process noise covariance matrix, which influences sensitivity to system dynamics. A larger
Q indicates that the filter assumes greater variability in system dynamics, reducing reliance on the state prediction model and increasing trust in measurement values. This is suitable for systems with frequent, unpredictable changes or those that exhibit difficulties in accurate modeling. Conversely, a smaller
Q suggests smoother system dynamics, prompting greater reliance on the state prediction model and less frequent corrections from measurements.
2.2.2. Observation Prediction
Predicting Observation Sigma Points: Use the observation model to predict all the sigma points [
21]:
where
h(
x) is the observation function.
The predicted observation mean and covariance are calculated:
where
R, the observation noise covariance matrix, determines the level of trust in the measurement data. A larger
R implies that there is significant measurement noise, leading the filter to trust predictions more and rely less on potentially noisy measurements; it thus fits for environments with heavy signal interference. A smaller
R indicates that the measurement data are more reliable, increasing dependency on observations and reducing the reliance of corrections on the model.
2.2.3. Update Step
The Cross-Correlation Matrix is computed [
22]:
The Kalman gain is computed:
The state estimate and covariance matrix are updated:
2.2.4. Parameter Selection
α: Controls the spread of the sigma points.
β: Improves the adaptation to Gaussian distributions.
κ: Adjusts the distribution of the sigma points, typically set to 0 [
23].
2.3. Program Analysis
2.3.1. Parameter Settings
First, the time steps, state dimensions, and observation dimensions are set. The state transition matrix G and observation matrix H are used to describe the state transition and observation processes of the electrolytic cell system. The state transition noise covariance matrix and observation noise covariance matrix are set to and 1, respectively.
The initial velocity and weight, as well as the covariance, are set according to the conditions mentioned earlier. The initial state is set to [0; 10], and the state is updated to 15 after 6.25 s based on the state transition matrix G. The initial covariance is set to . The observational noise generated by the swinging of the electronic scale and the system nonlinearities is simulated by generating white noise. Subsequently, the program generates an observation vector y with a length of 200 using the mass calculation formula.
2.3.2. Parameter Settings for the Unscented Kalman Filter Algorithm
In the program, the UKF parameters are set as = 0.9, = 107 and = 0. The parameters for the unscented transformation are calculated and initialized accordingly. The filter’s initial state and covariance are set to the initial state and initial covariance, respectively. At each time step, the program first calculates and predicts the sigma points. It then computes the predicted mean and covariance, as well as the observation mean and the covariance of the observation sigma points. The Kalman gain is obtained by calculating the cross-covariance, and finally, the state estimate and covariance are updated.
2.3.3. Velocity Change Calculation
The program calculates the change in velocity by differentiating the weight state and multiplying it by a coefficient of 8. Finally, it plots the real and computed aluminum output velocities and weights over time to verify the performance of the Unscented Kalman Filter.
2.3.4. Flowchart and Pseudocode
Figure 2 shows the flowchart of the UKF, and the program pseudocode is shown in Algorithm 1.
Algorithm 1. Pseudocode for the UKF Algorithm |
Initialize the parameters: numSteps = 200 stateDim = 2 observationDim = 1 Initialize the matrices: G = [1, 1/8; 0, 1] H = [1, 0] processNoiseCov = 0.6 * eye(stateDim) observationNoiseCov = 1 Set the initial state and covariance: initialState = [0; 10] initialCovariance = 1e6 * eye(stateDim) Generate observations: v = whiteNoise(1, numSteps) x(:, 1) = initialState + [1; 0] * v(1) for i from 1 to numSteps-1: if i < 50: x[:, i+1] = G * x[:, i] else: x[:, i+1] = G * x[:, i] x[2, i+1] = 15 y = x(1, :) + v Initialize the UKF parameters: alpha = 0.9 beta = 1e7 kappa = 0 lambda = alpha^2 * (stateDim + kappa) − stateDim gamma = sqrt(stateDim + lambda) Initialize the estimated state and covariance: estimatedState = zeros(stateDim, numSteps) P = initialCovariance estimatedState(:, 1) = initialState UKF loop: for t from 2 to numSteps: Compute sigma points Predict sigma points Calculate predicted mean and covariance Compute observation sigma points Calculate predicted observation mean and covariance Compute cross covariance Calculate Kalman gain Update state and covariance Compute the velocity change: deltaEstimatedState = 8 * diff(estimatedState(1, :)) deltaEstimatedState1 = zeros(1, numSteps) for i from 1 to numSteps-1: deltaEstimatedState1(i+1) = deltaEstimatedState(i) |
To highlight the advantages of the UKF, its results are compared with those of the KF. The pseudocode for the KF is shown in Algorithm 2.
Algorithm 2. Pseudocode for the KF Algorithm. |
Initialize observation noise: v = generate white noise(1, 200) System matrices: G = [1, 1/8; 0, 1] H = [1, 0] Generate true state: x[:, 1] = [0; 10] + [1; 0] * v(1) for i from 1 to 199: if i < 50: x[:, i + 1] = G * x[:, i] else: x[:, i + 1] = G * x[:, i] x[2, i + 1] = 15 Generate observations: z = x(1, :) + v Kalman Filter Parameters: Q = 0.6 * identity(2) % Process noise covariance R = 1 % Observation noise covariance P = 10e6 * identity(2) % Initial covariance x_hat = zeros(2, 200) % State estimates Initial state: x_hat[:, 1] = [0; 10] Kalman Filter Loop: for k from 1 to 199: Prediction: x_hat[:, k + 1] = G * x_hat[:, k] P = G * P * G’ + Q Update: K = P * H’ / (H * P * H’ + R) x_hat[:, k + 1] = x_hat[:, k + 1] + K * (z[k + 1] − H * x_hat[:, k + 1]) P = (identity(2) − K * H) * P |
2.4. Aluminum Output Speed Estimation Comparison Analysis
To achieve accurate aluminum extraction flow rate measurements and calculate the advance shut-off volume for precise aluminum extraction, an improved UKF was applied due to its superior handling of Gaussian noise. A comparative analysis was conducted using a standard KF, and this was used as a control group. Simulations produced a filtered aluminum flow rate and weight graphs for evaluation. In
Figure 3 and
Figure 4, the black curve represents true values, the red curve shows the UKF estimates, and the blue curve indicates the KF estimates, demonstrating the UKF’s superior performance.
From the comparison of the aluminum output speed, it is evident that the UKF exhibited a better filtering performance than the KF. In the first 50 time steps, the effect of UKF’s filtering was significantly superior, with the system’s state changes appearing more stable. After the 50th time step, when the system speed suddenly changed to 15 kg·s−1, the KF, while able to adapt to this change more quickly, exhibited greater noise. The UKF, on the other hand, provided a more accurate speed estimate. The final speed estimate obtained using the UKF was 14.99441 kg·s−1, while that obtained using the KF was 14.62115 kg·s−1. Compared to the true speed of 15 kg·s−1, the UKF’s relative error was only 0.0373%, whereas the KF’s relative error was 2.52%, making the UKF 98.5% more accurate than the KF.
In a comparison of the aluminum’s weight, both the KF and UKF provided estimates close to the true weight. This is because weight changes are relatively smoother compared to speed changes, and the impact of noise is less significant. For the UKF, the final estimated weight was 342.24572 kg, while the KF’s final estimate was 342.10987 kg. Compared to the actual weight of 341.875 kg, the relative errors were 0.108% for the UKF and 0.0686% for the KF. The difference was minimal, and both filtering methods provided fairly accurate weight estimates for most time steps.
Meanwhile, the computation time for the KF in MATLAB R2021b was significantly higher than that of the UKF. The UKF achieved a computation time of approximately 0.2 s, while the KF required a computation time of approximately 0.4 s. This difference likely arised from the UKF’s higher initial accuracy, enabling it to quickly converge, produce reliable results and thus reduce the overall computation time.
Overall, the UKF demonstrated superior adaptability, greater estimation accuracy, and faster computation in scenarios involving abrupt speed changes. By leveraging sigma points, the UKF effectively captured nonlinear system dynamics, making it more suitable for estimating aluminum extraction speeds in nonlinear systems than the KF.
3. Precise Calculation of the Pre-Close Wind Volume Coefficient
As mentioned earlier, the pre-close wind volume compensates for the overshooting that occurs after the wind has been closed. The pre-close wind volume should be as close as possible to the amount of overshooting to ensure that the compensation is appropriate. The calculation of the pre-close wind volume is performed according to Equation (14). Therefore, after using the UKF method to accurately estimate the aluminum output speed, the pre-close wind volume coefficient is calculated to precisely obtain the pre-close wind volume:
where
c represents the pre-close wind volume coefficient, which is typically set to 5 based on experience;
v denotes the aluminum output speed at the time the wind is closed; and
M is the pre-close wind volume.
After each aluminum output, the programmable controller calculates the aluminum deviation. A deviation greater than 0 indicates under-compensation. A deviation less than 0 indicates over-compensation. To adjust the parameter
c so that the compensation is correct, the programmable controller can be used to find the optimal value of
c after each aluminum output based on the deviation, as shown in Equation (15):
where
is the optimal value of
c;
A is the overshoot after closing the valve; and
e is the aluminum deviation.
By performing a transformation of Equation (15), the optimal value
of parameter
c can be calculated using Equation (16), as shown below:
Based on Equation (16), after each aluminum output, an optimal value
for parameter
c can be calculated. Considering that the optimal value
obtained from Equation (16) may be affected by interference, the calculated parameter is filtered using Average Filter (AF), as shown in Equation (17):
Using the filtered value of , the parameter c is set in the pre-close wind volume calculation formula.
Based on the above formula, a program can be designed to calculate the pre-close wind volume coefficient. The self-correction program will compute an optimal value for parameter c after each aluminum extraction and store it in the PLC memory. Then, by applying AF to multiple optimal values, parameter c in the pre-close wind volume calculation formula will be updated, reducing errors and achieving precise aluminum extraction.
4. Results and Discussion
The product of the pre-close wind volume coefficient and the aluminum extraction speed comprise the pre-close wind volume, as shown in Equation (14). In this study, the UKF algorithm was used to accurately and rapidly calculate the aluminum extraction speed, and a self-correction mechanism for the pre-close wind volume coefficient was introduced. The AF algorithm was used to precisely calculate the coefficient. In a MATLAB simulation, comparing it with the KF algorithm, the UKF algorithm improved the estimation accuracy of the aluminum extraction speed by 98.5%, while significantly reducing the computation time by approximately 50%. However, the UKF algorithm also had some shortcomings, such as a higher dependence on the accuracy of the system model and initial parameters, especially when the electrolytic cell operating conditions change drastically, leading to a potential decrease in estimation accuracy. Additionally, the computational complexity of the UKF was still higher than that of the KF, which may lead to challenges regarding the system load in real-time industrial environments with limited hardware resources.
To further improve the accuracy of aluminum extraction, this study proposes a method for calculating the pre-close wind volume coefficient that considers aluminum extraction deviation. By introducing the self-correction mechanism for the pre-close wind volume coefficient, the aluminum extraction deviation, i.e., the difference between the planned and actual aluminum extraction, was calculated after each extraction. The optimal pre-close wind volume coefficient was determined using Equation (16), and this coefficient was used for the next pre-close wind volume prediction calculation. Several optimal coefficients were processed with the AF algorithm to obtain the final pre-close wind volume coefficient. This method can significantly improve computational accuracy and filter the noise caused by the system’s weighing process. However, some limitations remain, such as the real-time performance of the AF algorithm, which is constrained by its reliance on historical data for smoothing. In complex, nonlinear conditions, the linear smoothing characteristic of the AF algorithm may not capture the dynamic features of the system, limiting the further improvement of the compensation accuracy.
5. Conclusions
In this study, a method was designed for the precise calculation of the pre-close wind volume in electrolytic aluminum production based on the UKF algorithm for aluminum extraction speed estimation and pre-close wind volume coefficient calculation. Through simulation experiments with actual production data and comparison with the traditional KF method, the advantages of the UKF in improving speed estimation accuracy and robustness were demonstrated. By introducing a self-correction mechanism and adjusting the pre-close wind volume coefficient, the AF was used to achieve precise calculation of the pre-close wind volume, providing theoretical and technical support for precise aluminum extraction in industrial electrolytic aluminum production.
For the first time, the UKF method was used to estimate the speed of aluminum extraction, showing a superior filtering performance compared to the KF. During the first 6.25 s, the UKF provided smoother-state estimates and delivered a more accurate speed estimation (14.99441 kg·s−1) when the system speed suddenly changed to 15 kg·s−1, with a relative error of only 0.0373%; this is in comparison to KF’s speed estimation of 14.62115 kg·s−1 and relative error of 2.52%. Additionally, the computation time for the UKF algorithm was approximately 0.2 s, half that of the KF algorithm; this indicates that the UKF is more suitable for estimating the speed of aluminum extraction during the production of electrolytic aluminum.
This study introduced a self-correction mechanism for the pre-close wind volume coefficient c, based on the aluminum output deviation. After each aluminum extraction, the system adjusts parameter c according to the actual output deviation in order to calculate the optimal pre-close wind volume coefficient, precisely compensating for post-close wind volume overshoot. By using AF to mitigate interference and improve the compensation accuracy, this study ultimately achieved the precise calculation of the pre-close wind volume for aluminum electrolysis, providing a feasible solution for accurate aluminum output control.