EMP: Extended Kalman Filter Based Self-Adaptive Mold Protection Method on a Toggle Mechanism

: Nowadays, the plastic injection molding industry is ever-growing, crucial, and its plastic products can be seen everywhere. However, the mold damage problem still frustrates operators because of its high maintenance price and time-consuming maintenance process. This damage is commonly caused by foreign bodies in mold area, and the conventional mold protection method is insufﬁcient for high-performance injection molding machines because of the uncertainty from many setting parameters. To improve detection precision of mold protection driven by a toggle mechanism ( TM ), this paper puts forward EMP , i.e., an extended Kalman ﬁlter ( EKF ) based self-adaptive mold protection method, wherein the EKF is used in current curve optimization, and the self-adaptive method ( SAM ) is proposed to gain an safety range of current curve. The EMP was veriﬁed in a 140-ton electric injection molding machine. Compared with a general method, the proposed method decreases the detected distance of mold protection by 22% under different thickness foreign bodies.

The injection molding machine (I MM) is a typical piece of large equipment, and the importance of I MMs has been ever-growing. I MMs produce plastic products occupying the main plastic market. Nowadays, I MMs tend toward high speed, precise control, and low energy consumption and noise. Many studies primarily focus on the control of robustness [6][7][8][9][10], trajectory planning [11][12][13], time optimization [14], and energy consumption [15][16][17]. Hence, the performance of I MMs has been enormously improved. Meanwhile, the mold protection (MP) issue is also serious. Figure 1 provides an example, where the toggle mechanism (TM) closes with the mold in less than two seconds and under high pressure. If there are some foreign bodies in the mold without a protection mechanism, the mold will be damaged directly. This problem always frustrates operators because of the high maintenance price and time-consuming maintenance process.
At present, mold protection has attracted many researchers. One research direction is based on machine vision through comparing safe and unsafe situations to detect the foreign bodies.
Wang et al. [18] presented a method that applied technologies, such as near infrared illumination technology, the background updating algorithm, and the region of interest, to fulfill MP. Yang et al. [19] applied key technologies, including the methods for pretreatment of the cavity image, template matching of the cavity image, and cross-correlation of an abnormal cavity situation, into MP. Chi et al. [20] proposed a system that was able to correctly detect the unsafe in-mold status of the stuck ejectors or pieces by the two approaches of offset correction and dynamic safe range learning. However, the above methods need to add a special vision system. In some high speed cases, processing speed also becomes the issue, and for getting a good effect from image processing, much effort should also be made to implement a customized visual program. Electric injection molding machine with a mold. If there are some foreign bodies in the mold without protection, the mold will be damaged when the mold closes. Generally, the mold is expensive, and the maintenance is tedious.
Other improving methods are to avoid failed production based on processing data and mathematical models to reduce the possibility of the entrance of foreign bodies. Based on the monitoring data, Ribeirol et al. [21] proposed an approach for fault detection in a thermoplastic injection molding process to assure a high level of quality control over the molded parts using neural networks. The properties in injection molding can also be controlled by neural networks in [22]. A study in [23] monitored the quality of molded parts in a process from the design and processing points of view. Ribeiro et al. [24] also proposed an approach of support vector machines for quality monitoring in a plastic injection molding process to monitor in-process data and thereby the unexpected process interferences could be responded quickly. These methods are good auxiliary but not the thorough ones for MP.
IMM controller venders (e.g., Techmation and KEBA) also have their own MP methods. Those methods just compare electric current (EC) profiles simply, which need to set many parameters (e.g., MP distance, upper deviation, lower deviation, left deviation, and right deviation). Using those methods, operators always take a long time adjusting parameters, and it is still possible that the mold will be damaged because of misjudgment.
To address the issue, we propose an extended Kalman filter based self-adaptive method. The contributions of this work are as follows: 1.
The mathematical model of the TM driven by servo systems (SSs) is built used for the process analysis and further researches.

2.
Through the mathematical model, this paper successfully proposes the EMP, which can be applied in any TM driven by an SS.

3.
The proposed method was implemented in a 140-ton electric injection molding machine (EI MM), and decreased the detected distance of MP by 22% compared with general one.
An extended Kalman filter (EKF) EKF linearizes with an estimate of the current mean and covariance, which is a nonlinear kind of the Kalman filter [25,26]. It is widely used in various fields. Jana et al. [27] presented a hybrid FLC-EKF scheme for temperature control of a refinery debutanizer column. Charkhgard et al. [28] used neural networks and EKF to estimate the charging state for Lithium-ion batteries. Fang et al. [29] applied an EKF-based filter fusion method in a high-efficiency motion tracking system. Paolo proposed a two-stage EKF to build an observer for a sensorless control [30]. One key point for using the EKF is the choice of the elements of the covariance matrices, which affects both the performance and the convergence [31]. Many studies [32][33][34] have provided practical approaches and accounts. More details can be found in the surveys of [35][36][37]. However, none of these studies are involved in mold protection problems.
The remainder of this paper is structured as follows: Section 2 introduces the TM system, SS system, and MP problem (MPP); Section 3 illustrates the TM model driven by SS and EMP; Section 4 presents the effect validation of EMP; and the last section concludes our work.

Control System of the Toggle Mechanism
A typical control system of TM is shown in Figure 2. It consists of controller, servo driver, motor, and TM. The controller contained algorithms and logic programs send commands to the servo driver to drive the motor. The motor is connected to the TM by a belt or lead screw. We define a servo driver working with a motor as an SS. In some special cases, two SSs can be used together to provide greater torque. Normally, the communication among the controller, servo driver, and motor adopts a real-time Ethernet bus (e.g., EtherCat).

Motor1 Motor2
Servo Driver1 Servo Driver2 Figure 2. Control system of a toggle mechanism (TM), which consists of a controller, servo driver, motor, and TM. The controller embedded algorithms and logic programs send commands to the servo driver to drive the motor. The motor is connected with the TM by a belt or lead screw.
A mold is commonly comprised of movable and fixed parts. The movable part is fastened on the TM. When the machine is power on, the servo system receives commands continuously form the controller to drive the TM forward or backward. In the servo driver, an encoder is built-in to obtain the actual position and speed. Hence, the controller can gain the feedback (e.g., position, speed, EC) from the SS.

Mold Protection Problem
Every plastic product is molded by a specific mold. In production, an I MM uses the mold to produce automatically, and every seamless mold close can produce a good product. However, as shown in Figure 3, there may exist a foreign body which will damage the mold. The MPP is to detect the foreign body when a force is quickly pushing the movable mold on. As shown in Figure 3, we defined two key indicators of MPP below.

Servo System
SS is the power system to drive the TM. Normally, it contains three closed loops: EC, speed, and position closed loop. Position closed loop is based on the speed closed loop, and speed closed loop is based on the EC loop. EC turns to torque and then provides a force on the actuator. Since the TM fastened with the movable mold is driven by the force, the EC should be the key factor for the proposed MPP.
The EC reflects the force on foreign body in the mold and herein could be used to detect the foreign body.

EKF Based Model
Regarding the fluctuation of EC, the EKF is used to filter the EC. We can obtain the theoretical setting EC from the user setting trajectory (prediction value), and the drive feedback current (measured value) from the SS.

Toggle Mechanism Model
We have shown the model in [13] and herein simply introduced it below. From the geometry of Figure 4, we can obtain equations as follows: Φ(θ) describes the parameter relationships in the TM model. Then, we can obtain Using Hamilton's principle, we can obtain where δW A is the virtual work, and δW C = −δθ T Q C , Q C are the generalized constraint reaction forces. , and m C indicate the mass of links two, three, five, and sliders B and C, respectively. r 1 , r 2 , and r 4 indicate the three-side lengths of two, and r 3 and r 5 indicate the lengths of links three and five respectively; θ 1 , θ 2 , and θ 5 are the angular positions of link two, three, and five; h is the height between the two horizontal guides where sliders B and C travel; and f is an offset between links two and three [13].
We use energy method to gain dynamic motion equation. The total kinetic energy of the system is described below.
where T 2 , T 3 , T 5 , T B , T C represent the kinetic energies of link two, three, five, and sliders B and C, respectively. Q A , Q C are calculated as follows: where λ is the Lagrange multiplier.
Thus, the equation of motion for the TM is Using the Equation (6) and trajectory x B , we can obtainẋ B ,ẍ B , x C ,ẋ C ,ẍ C , and F C ; for details see the previous paper [13].

Servo System Model
The SS model is used to obtain theoretical setting EC (i t ) form F C . The EC and torque can be described blew.
where i(t) is current and K t is stator torque constant. The mechanical equation can be obtained as follows: where F C is the force on the slider C in Figure 4, l is the lead of ball screws, and η is the screw drive efficiency. Thus, we can gain the relation between current and force on slider C:

Process of EKF
Recall that we use the EC as the filter target, and regard i t and h t as the prediction value and measured value, respectively. Thus, we can obtain the equations of state time propagation and state measurement propagation as follows: where r is the process standard deviation, and q is the measurement standard deviation. Then we can get the Jacobian matrix F t and H t .
The covariance updating equation of P(t|t − 1) is described below.
where F t is the transpose matrix of F, Q is the process variance. According to the setting profile and feedback current, the current optimal estimation X(t|t) can be obtained.
where K g (t) is Kalman gain, and it can be calculated using the following equation.
where R is the measurement variance.
To keep the EKF running until the end of the system process, the covariance updating equation of P(t|t) is needed.
where I is a unit matrix. The Equations (11)- (16) are the process of EKF in the MP.

Self-Adaptive Model
The EKF based self-adaptive method (SAM) is used to gain the safety range of the current curve. In EKF, according to mathematical model of TM driven by SS, the setting profile is chosen as the prediction value, and the drive feedback current is chosen as the measurement value. At first, the SAM should ensure the absence of foreign bodies, and then injection machine mold close and open automatically according to self-adaptive time n. Every EKF current curve will be saved in a m × n-dimensional matrix, A m×n . m is the time of sample, and the position of every sampled point is saved in a m-dimensional matrix, P. Equation (17) records the data to calculate the standard current curves.
where A k = [i k1 , i k2 , . . . , i km ] T is one time current curve optimized by EKF. Then, we can get the safety range of current curve as follows.
where L max and L min are functions to get the maximum and minimum values of every sampled point, respectively. U and L are upper deviation current curve and lower deviation current curve, respectively; and the dimension of U and L is m. ∆ is true error. Regarding Equation (18), the safety range at every position should be between the maximum and minimum currents within n self-adaptive processes. Note that ∆ is necessary because the self-adaptive time n is limited. However, because of the unknown of the true error value, the error value is calculated by the Bessel formula below.
whereĀ = ∑ n k=1 A k n is the arithmetic mean of n-time curves.
When the I MM is running in MP checking area, it will be checked whether the actual current curve is between the two curves. If not, the machine will stop closing and then open to protect the mold.

Process of the Self-Adaptive Method
The process of the self-adaptive method is divided two phases: training and applied phases; see Figure 5. From the perspective of the training phase, setting trajectory x B is executed in the TM system several times, which must be under the condition without MMP. Every time x B is put into TM system and our mathematical model, the EKF can gain h t and i t to produce accurate EC. Then, the SAM uses the accurate ECs to produce safety range of current curve. After the training, the SAM can be used to judge whether the MMP occurs-the applied phase. In this phase, the x B is put into TM system. Meanwhile, the proposed MP method monitors the TM system as to whether any MPP occurs or not. If no MPP happens, the i t and h t produced can be used to update the SAM. Otherwise, the mold will open and give tips in the human machine interface (HMI).

Experimental Results
Experimental equipment and the control process are shown in Figure 6. The primary facility was a 140-ton EI MM, driven by SS. Data analysis was done in a Dell laptop which had a clock speed of 1.7 GHz and 4 GB DDR3 RAM. The controller was KEBA CP052 implemented the Ethercat protocol, and it used 24 v to control input and output. The servo drive was a Phase AXN 70.140.4, and the motor was a Phase U31013F.15.3 N7, whose maximum speed was 3000 RPM. An encoder built in the motor was used to feed back the position. In Figure 6, an experiment with a disposable cup is shown, which verifies the effectiveness of the method intuitively. Table 1 shows the parameters of the TM, SS, and EKF in the experiment. Based on those parameters, the following experiments were done.

Mold protection Encoder EtherCat
EtherCat 0-3000 r/min Figure 6. Experimental facility, control process, and effect of MP. In our experiment, the s-curve was chosen as the start and stop slope. We set the speed and acceleration of mold open and mold close to 500 mm/s and 2 m/s 2 , which are very fast times in real production. The displacement was set to 240 mm. In the section of EKF, the setting profile was chosen as the prediction value, and the drive feedback current was chosen as the measurement value. Figure 7 shows the displacement, velocity, acceleration, and force on slider C, which were calculated from the setting profile. When using EKF, the r was 0.01, q was 0.02, and protection monitor displacement was 7 mm. Then we tested the first effect of EKF, and Figure 8 is the effect of current profile filtered by EKF. Plus icons are measurement values. The green profile is the setting value after being calculated by our mathematical model. The blue profile is the optimized estimated value. In self-adaptive part, we set the learning time to 50. Figure 9 shows the result. The blue profiles are the 50 curves filtered by EKF. The red profile is the upper deviation curve, and the purple one is the lower deviation curve.
In the next step, we took three experiments. In these experiments, we put three foreign bodies of different thicknesses into a mold individually, whose thicknesses (D α ) were 1, 0.8, and 0.5 mm, respectively. Figure 10 shows the results. In case of 1 mm, it checked out the thickness was within a 0.16 mm range after touching the foreign body; i.e., D β = 0.16. In cases of 0.8 mm and 0.5 mm, the D β s were 0.12 mm and 0.10 mm, respectively. In the last part, we compared precision of the proposed EMP and general methods. In the contrast experiment, the thickness of each foreign body was arbitrary, and we tested the proposed method and the general one 100 times respectively. Figure 11 shows the results. In these 100 experiments, the average D β of proposed method was 0.94 mm, while the general one was 1.21 mm, which is a decrease of 22%.

Number
Detected distance (mm) Figure 11. Detection precision comparison of the EKF based self-adaptive MP method and general one for 100 rounds. The thickness of each foreign body was arbitrary. Through 100 experiments, the average detected distance of the proposed method was 0.94 mm, while that of the general one was 1.21 mm. Namely, the detected distance of the proposed method was decreased by 22%.

Conclusions
The mold protection problem is bothering engineers because of the high maintenance price and time-consuming maintenance process. Vision-based methods need an additional vision system, and customized algorithms. Without a vision system, existing methods always take a lot of time for field engineers to adjust mold protection parameters. Therefore, we proposed an EKF-based self-adaptive method in this paper. We built a mathematical model for a toggle mechanism driven by servo systems. Using the rough values from the mathematical model and toggle mechanism system, we applied the EKF to obtain an accurate electric current. Then a self-adaptive method was proposed to obtain the safety current range. At last, the proposed method was implemented in a 140-ton EI MM, and the results showed that the detected distance of foreign bodies was decreased by 22% compared with the general method.
In future, a combination of the vision and proposed methods will be studied to further improve the robustness and sensitivity of the MP for higher speed applications.

Conflicts of Interest:
The authors declare no conflict of interest.