Electric Motor Control for Online Tuning Based on Positive Flow System for Electric Construction Machinery

: With the increasingly serious environmental pollution and stricter emission standards, energy saving and emission reduction in construction machinery (CM) are imminent. Electriﬁcation of CM is an inevitable trend. Due to the complicated working conditions and the violent load ﬂuctuations, the existing motor controller cannot adapt well to the operating characteristics of the electric CM. In this paper, the work requirements of the positive ﬂow system are analyzed. Considering the robustness and resistance to load disturbance of the control system, a vector control strategy through online tuning of speed PI parameters based on fuzzy control is proposed. The characteristics of the control system are analyzed with the co-simulation of AMESim and MATLAB/Simulink. A test rig was set up to verify the feasibility of the control strategy. The results show that when the load is variable, the ﬂuctuation of rotation speed is approximately 1.5% with fuzzy PI, and 2.5% with traditional PI. Furtherly, the vector control algorithm based on fuzzy PI is tested on a positive ﬂow system. The test results show that when the load ﬂuctuates drastically, the electric motor speed ﬂuctuation is within 3.5%, and the steady-state error is only approximately 0.3%.


Introduction
As global environmental pollution and energy shortages continue to intensify, green, energy saving, and environmental protection have attracted widespread attention from all over the world [1,2]. Construction machinery (CM) has low energy efficiency and poor emissions, which has gradually been unable to meet the need of the times. Electric CM using a motor instead of an engine can achieve zero emission, and is treated as a major trend in industrial development [3,4].
At present, the electric motor control system is relatively mature [5,6], many advanced control methods are employed [7]. However, due to the complicated working conditions and the violent load fluctuations, the existing motor controller used in the industrial field and other stable load conditions cannot adapt well to the operating characteristics of the CM [8,9]. Research on electric motor control systems based on the CM load characteristics has gradually attracted attention. Control strategies for the electric motor are mainly vector control and direct torque control (DTC). DTC has the advantage of fast dynamic response, but it also has the disadvantage of large torque ripple, poor low-speed performance, and low current utilization [10,11]. Vector control adopts coordinate transformation to equate the mathematical model of the alternating current (AC) motor to the direct current (DC) motor [12,13]. While simplifying the control method, it obtains the control performance comparable to that of the DC motor. Compared with the DTC, the speed regulation range of vector control is wider, the low-speed performance is better, and the current utilization is higher.
The working condition of electric CM is complex. Therefore, special research on its power motor is needed [14]. Chen et al. designed a novel DTC for a permanent magnet synchronous motor (PMSM) in hybrid power train system to reduce the influence of DC voltage on the maximum output torque of the PMSM. The results demonstrated that the proposed DTC can reduce the effect of DC voltage variation on the maximum output torque of the PMSM [15]. Wang et al. employed a segmented Halbach permanent magnet (PM) array for the permanent magnet synchronous generator rotor configuration for the PMSM structure. The results showed that this method effectively improved the energy-saving efficiency of the hydraulic system [16]. Hoai et al. proposed a novel type of sliding mode controller that combines intelligent control and phase-locked loop. Through simulation and experiments, it was verified that the motor control system had the characteristics of smooth switching, good tracking response, and strong anti-interference ability [17]. Elsonbaty et al. proposed a control strategy for a hybrid-excitation salient-pole PMSM in which the armature winding and the DC excitation winding were located on the stator at the same time. The simulation verified that the control strategy met the motor requirements of electric vehicles and hybrid electric vehicles, and the control strategy had superior responsiveness and robustness [18]. Currently, the development of AC motor control strategies mostly makes simple improvements on traditional control strategies, without analyzing the working conditions of CM [19]. The traditional vector control adopts the PI controller for closed-loop regulator design of speed and current [20]. Electric CM has severe load fluctuations and complex working conditions, which is a typical load time-varying system. The fixed PI parameters of traditional control cannot change with the load variation, which results in poor dynamic adjustment ability and poor anti-load disturbance ability of the controller.
Considering the complex working conditions of CM, the PI parameters of the motor controller should be adjusted in real time according to the characteristics of CM working conditions. PI parameter online tuning technology mainly includes online tuning based on model parameters and intelligent algorithms [21]. Online tuning based on model parameters can identify the control system parameters under dynamic working conditions. Combining with the system mathematical model, online tuning formulas can adjust and update the PI controller parameters in real time. Though the online tuning technology based on the intelligent algorithm is complicated and large amount of calculation is needed, its algorithm is relatively simple and highly targeted. Therefore, due to its powerful computing power and strong self-adjustment ability, the online tuning effect is significantly better than the online tuning technology based on model parameters. With the rapid development of computer technology and intelligent algorithms, online tuning technology based on model parameters is gradually being replaced by that based on intelligent algorithms [22].
To provide full play to the superior speed regulation characteristics and flow matching characteristics of CM electric power system, a typical positive flow system in CM is taken as the application object, the motor vector control system based on fuzzy control of the speed PI parameter online tuning is proposed. This paper is organized as follows: In Section 2, mathematical model analysis of PMSM and positive flow system is presented. Design of electric motor control strategy and regulators is introduced in Section 3. Simulation analysis and experiments verification under different conditions are shown in Sections 4 and 5, respectively. Finally, the conclusion is obtained.

Mathematical Model Analysis
To make the motor control strategy better adapt to the load characteristics of electric CM, the mathematical model of a PMSM and a positive flow system of CM is analyzed. Through the mathematical model of the positive flow system, the requirements for speed and torque output characteristics of the PMSM are studied.

Mathematical Model of PMSM
Among different motors, PMSM has the advantages of small size, easy maintenance, high power density, and good speed regulation performance, which is widely used in electric vehicles [23,24]. Therefore, the PMSM is used for the power train system in this study.
The electric motor torque equation in the two-phase synchronous rotating coordinate system can be provided as: where subscripts d and q are the components of the d and q axes, respectively, in the rotating coordinate system; i is the stator current; L is the stator inductance; T e is the electromagnetic torque; P is the electric motor pole pairs; and ψ f is the rotor flux. For surface-mount PMSM, the inductances of the quadrature and straight shafts of the electric motor are approximately equal. The Equation (1) can be rewritten as: In the two-phase rotating coordinate system, the mathematical model of the electric motor is decoupled. Thus, for surface-mounted PMSM, i d = 0 is often used to achieve decoupling control of the quadrature and straight shafts current.
The torque balance equation of the PMSM can be deduced as: According to Equations (2) and (3), the relationship between the motor speed and the current of the quadrature and straight shafts can be obtained.

Mathematical Model of Positive Flow System
The traditional positive flow system applied to a traditional CM uses a variable pump with a constant speed system [1]. Due to the excellent motor speed response, the quantitative pump-variable speed positive flow system was investigated. The principle of the quantitative pump-variable speed positive flow system is shown in Figure 1.  The mathematic model of the hydraulic system is analyzed. To simplify the analysis, some assumptions are provided as:

•
Hydraulic pump inlet pressure, system return pressure, and the tank pressure are assumed to be zero; • The relief valve is not set at the pump outlet port. The leakage of hydraulic pump, valves, and actuators is ignored; • The flow fluctuation caused by pipeline pressure loss and pipeline friction is not considered. The target speed of the electric motor pump is controlled by the pilot handle output signal. The greater the pilot output signal is, the greater the electric motor speed achieves. To prevent the system from overloading, relief valves are equipped in both chambers of the oil cylinder. A check globe valve is set up to avoid the cylinders falling because of the gravity when the multi-way valve is in the neutral position.
The mathematic model of the hydraulic system is analyzed. To simplify the analysis, some assumptions are provided as:

•
Hydraulic pump inlet pressure, system return pressure, and the tank pressure are assumed to be zero; • The relief valve is not set at the pump outlet port. The leakage of hydraulic pump, valves, and actuators is ignored; • The flow fluctuation caused by pipeline pressure loss and pipeline friction is not considered.
The output flow equation of the pump can be expressed as: where q V 1 is the pump output flowrate; V 1 is the pump displacement; n is the pump speed; C p is the pump leakage factor; and p 1 is the pump output pressure. The relationship between the output pressure and the torque of the pump can be deduced as: where T is the pump output torque. The force balance equation of the globe valve when the cylinder extends is: where p 2 is the output pressure of the check valve; p 3 is the pressure of the cylinder in a rodless cavity; k 1 is the elastic coefficient of the globe valve in the spring cavity; x 1 is the spring displacement of the globe valve; and A 1 is the effective area of the globe valve in the spring cavity. The force balance equation of the globe valve when the cylinder retracts can be provided as: where p 4 is the inlet pressure of orifice in the multi-way valve. The flow equation of orifice in the multi-way valve can be written as: where q V 2 is the flowrate through the orifice; C q is the flow coefficient; W v is the flow area gradient; X v is the orifice opening size; ρ is the oil viscosity; and ∆p is the pressure difference before and after orifice. The force balance equation of cylinder can be expressed as: where A 2 is the effective area of the cylinder in a rodless cavity; p 4 is the pressure of the cylinder in a rod cavity; A 3 is the effective area of the cylinder in a rod cavity; m is the mass of the piston and the load converted to the piston; v is the cylinder speed; b L is the viscous damping of the piston and load; and F is the load force. It can be seen from the mathematical model of the positive flow system that the performance of the pump outlet flowrate is closely related to the electric motor speed performance which directly affects the speed control performance of the positive flow system. Furthermore, pump outlet pressure is closely related to the pump input torque which directly affects the pump output pressure characteristics. Therefore, improvement of the responsiveness and robustness of the electric motor speed, and the stability of the electric motor output torque greatly enhances the controllability of the positive flow system.

Control System Overall Scheme
The hardware circuit structure diagram of the PMSM control system is shown in Figure 2 The main control chip adopts the Digital Signal Processing (DSP) chip TMS320F28335 developed by TI company. The control system includes the signal acquisition circuit, the pulse-width modulation (PWM) isolation drive circuit, the communication circuit, the power circuit, and the fault protection circuit, etc.  Figure 2. Hardware circuit structure diagram of PMSM control system.
In the traditional vector control, the current loop is set as the inner loop, and the speed loop is set as the outer loop. Meanwhile, the traditional PI regulator is used to design the current loop and the speed loop. Since the controllability of the positive flow system is closely related to the motor operating performance which directly affects the speed regulation performance of the positive flow system. Improving the responsiveness and robustness of the electric motor speed output is very vital for the positive flow system. Therefore, the vector control strategy scheme based on online tuning of speed PI parameters shown in Figure 3 is proposed by adopting fuzzy PI to observe the speed.

Closed Loop Regulator Design
As can be seen in Figure 3, the current loop is designed by traditional PI, the speed loop is designed by fuzzy PI control. The dynamic structure of the PMSM vector control system is shown in Figure 4. Where  In the traditional vector control, the current loop is set as the inner loop, and the speed loop is set as the outer loop. Meanwhile, the traditional PI regulator is used to de-sign the current loop and the speed loop. Since the controllability of the positive flow system is closely related to the motor operating performance which directly affects the speed regulation performance of the positive flow system. Improving the responsiveness and robustness of the electric motor speed output is very vital for the positive flow system. Therefore, the vector control strategy scheme based on online tuning of speed PI parameters shown in Figure 3 is proposed by adopting fuzzy PI to observe the speed.  Figure 2. Hardware circuit structure diagram of PMSM control system.
In the traditional vector control, the current loop is set as the inner loop, and the speed loop is set as the outer loop. Meanwhile, the traditional PI regulator is used to design the current loop and the speed loop. Since the controllability of the positive flow system is closely related to the motor operating performance which directly affects the speed regulation performance of the positive flow system. Improving the responsiveness and robustness of the electric motor speed output is very vital for the positive flow system. Therefore, the vector control strategy scheme based on online tuning of speed PI parameters shown in Figure 3 is proposed by adopting fuzzy PI to observe the speed.

Closed Loop Regulator Design
As can be seen in Figure 3, the current loop is designed by traditional PI, the speed loop is designed by fuzzy PI control. The dynamic structure of the PMSM vector control system is shown in Figure 4. Where te K is the electric motor torque coefficient,

Closed Loop Regulator Design
As can be seen in Figure 3, the current loop is designed by traditional PI, the speed loop is designed by fuzzy PI control. The dynamic structure of the PMSM vector control system is shown in Figure 4. Where K te is the electric motor torque coefficient, K te = 3/ 2n p ψ f ; T m is the mechanical time constant, T m = J·2π/60; K e is the electric motor back-EMF coefficient, K e = 2π/(60n p ψ d ); and T 1 is the electric motor armature time constant, T 1 = L q /R. The inverter is equivalent to the first-order inertial loop with an amplification factor of Ks. ACR is Automatic Current Regulator. ASR is Automatic Speed Regulator.  In the case of multiple closed-loop control, the design principle of first inner loop and then outer loop is usually used. Therefore, the current regulator is designed first.

Automatic Speed Regulator (ASR) Design
Since the speed loop is designed with fuzzy PI control, it is necessary to design the speed PI regulator first and calculate the theoretical value of the initial PI parameter. The simplified current loop can be treated as an intermediate link of the speed loop, and its closed-loop transfer function can be simplified as: According to Equation (10), the structure of the PMSM vector control system can be simplified as shown in Figure 5.   In the case of multiple closed-loop control, the design principle of first inner loop and then outer loop is usually used. Therefore, the current regulator is designed first.

Automatic Speed Regulator (ASR) Design
Since the speed loop is designed with fuzzy PI control, it is necessary to design the speed PI regulator first and calculate the theoretical value of the initial PI parameter. The simplified current loop can be treated as an intermediate link of the speed loop, and its closed-loop transfer function can be simplified as: According to Equation (10), the structure of the PMSM vector control system can be simplified as shown in Figure 5.  In the case of multiple closed-loop control, the design principle of first inner loop and then outer loop is usually used. Therefore, the current regulator is designed first.

Automatic Speed Regulator (ASR) Design
Since the speed loop is designed with fuzzy PI control, it is necessary to design the speed PI regulator first and calculate the theoretical value of the initial PI parameter. The simplified current loop can be treated as an intermediate link of the speed loop, and its closed-loop transfer function can be simplified as: According to Equation (10), the structure of the PMSM vector control system can be simplified as shown in Figure 5. From Figure 5, the open-loop transfer function of the speed loop is: From Figure 5, the open-loop transfer function of the speed loop is: where K ASR = 45n p ψ f K p πJτ n . According to the Equation (11), the speed loop is a third order system. The system block diagram is shown in Figure 6. According to the actual object system response and anti-disturbance requirements on the speed, the speed loop should be equivalent to a typical II-type system. As shown in Figure 6, the system has two characteristics: • The system contains two pure integration loops, the initial slope of the amplitudefrequency characteristic is −40 dB, and the initial phase angle is −180°; • The corner frequency of the system is ( ) The intermediate frequency bandwidth is within the range of the differential loop and the integral loop. The intermediate frequency bandwidth determines the system response speed, and the phase margin of the cut-off frequency determines the system stability. For the electric motor control system, the parameter design process is to optimize these two indexes.
The highest point of the phase-frequency curve is the point with the largest phase margin. Meanwhile, this point is also the midpoint of the two-corner frequency. Thus, the calculation formula of the phase margin is: where h is the intermediate frequency bandwidth.
Then the phase margin is: Then Based on the previous analysis, the PI parameter of the speed regulator can be obtained as: According to the actual object system response and anti-disturbance requirements on the speed, the speed loop should be equivalent to a typical II-type system. As shown in Figure 6, the system has two characteristics:

•
The system contains two pure integration loops, the initial slope of the amplitudefrequency characteristic is −40 dB, and the initial phase angle is −180 • ; • The corner frequency of the system is 1/(4T s ) in the inertia loop and 1/τ n in the differential loop.
The intermediate frequency bandwidth is within the range of the differential loop and the integral loop. The intermediate frequency bandwidth determines the system response speed, and the phase margin of the cut-off frequency determines the system stability. For the electric motor control system, the parameter design process is to optimize these two indexes.
The highest point of the phase-frequency curve is the point with the largest phase margin. Meanwhile, this point is also the midpoint of the two-corner frequency. Thus, the calculation formula of the phase margin is: where h is the intermediate frequency bandwidth. Then the phase margin is: Then Based on the previous analysis, the PI parameter of the speed regulator can be obtained as: where T sm = 4T s .

Fuzzy PI Regulator Design
The fuzzy control system takes the deviation, the deviation variation rate, and the variation rate of deviation change as the input of the fuzzy controller. According to the input numbers, fuzzy controllers can be divided into one-dimensional, two-dimensional, and three-dimensional. This paper chose a two-dimensional fuzzy controller as the core of the fuzzy control system.
In this paper, there are two inputs of the fuzzy controller. One is the difference between the target speed and the actual speed of the electric motor, and the other one is the change in the difference. The output is the change in the PI parameters, they are ∆K p and ∆K i . It can be concluded that the structure of the online tuning regulator for speed PI parameters of PMSM vector control system is shown in Figure 7. The final expression of the speed PI parameter online tuning regulator is: where K p0 and K i0 are the initial PI parameters obtained by the engineering method for the mathematical model of PMSM.
Appl. Sci. 2022, 12, 10072 9 of 24 The fuzzy control system takes the deviation, the deviation variation rate, and the variation rate of deviation change as the input of the fuzzy controller. According to the input numbers, fuzzy controllers can be divided into one-dimensional, two-dimensional, and three-dimensional. This paper chose a two-dimensional fuzzy controller as the core of the fuzzy control system.
In this paper, there are two inputs of the fuzzy controller. One is the difference between the target speed and the actual speed of the electric motor, and the other one is the change in the difference. The output is the change in the PI parameters, they are  To make the fuzzy controller work normally, variables should be defined by fuzzy language. In this paper, fuzzy variables e and ec are defined as: where N is negative, B is big, M is middle, S is small, ZO is zero, and P is positive. According to engineering practice experience, the adjustment function of PI parameters and fuzzy inference rules, the requirements of e and ec for According to the characteristics of PI parameters and the above requirements, fuzzy control rules of K and K changing for e and ec can be obtained, as shown in Ta- To make the fuzzy controller work normally, variables should be defined by fuzzy language. In this paper, fuzzy variables e and ec are defined as: { NB, NM, NS, ZO, PS, PM, PB} (18) where N is negative, B is big, M is middle, S is small, ZO is zero, and P is positive. According to engineering practice experience, the adjustment function of PI parameters and fuzzy inference rules, the requirements of e and ec for K p and K i can be obtained.

•
When e is large and e > 0, K p should be increased to make the system output quickly approach the target value, while K i should be reduced to prevent the system from overshooting; • When e is large and e < 0, K p should be appropriately reduced to reduce overshoot, while K i should be increased to eliminate the steady-state error; • When e is small and ec is large, K p should be reduced and K i should be appropriately increased; • When e is close to zero, K p and K i should be increased appropriately to improve the steady-state accuracy and dynamic characteristics of the system.
According to the characteristics of PI parameters and the above requirements, fuzzy control rules of K p and K i changing for e and ec can be obtained, as shown in Tables 1 and 2. The fuzzy controller parameters that are the quantization factor of the input variable and the proportional factor of the output control quantity affects the performance of the system directly. The quantization factor of the input variable and the scale factor of the output control quantity can be expressed as: The quantization factor of the input variable and the scale factor of the output control value calculated according to Equation (19) are ideal values. In practical application, the specific value of the fuzzy controller parameters should be adjusted according to the actual control effect.

Simulation Study
The AMESim-Simulink co-simulation model of the positive flow system was built to verify the control performance. The performance of positive flow system under fuzzy PI control and traditional PI control was compared.
The co-simulation model is shown in Figure 8. The simulation model includes the main pump, the pilot pump, the pilot valve, the multi-way valve, the check globe valve, relief oil supplementary valve, the actuator, the co-simulation interface, etc. The regulator for online tuning of speed PI parameter is designed with a fuzzy PI controller. The controller mainly includes a fuzzy logic controller, a proportional loop, an integral loop, and a speed limiting module.

Comparison of Traditional PI and Fuzzy PI
The speed responses of the two speed control methods are shown in Figures 9 and 10. When the electric motor starts, the overshoot of the traditional PI control and fuzzy PI control are 12 r/min and 6 r/min, respectively. The time to steady state is 40 ms and 31 ms, respectively. When the speed changed suddenly, the overshoot of the traditional PI control and fuzzy PI control are 8 r/min and 5 r/min, respectively. The time to steady state is 24 ms and 16 ms, respectively. A 15 N·m load is added at 0.2 s, the electric motor speed drop of the traditional PI control and fuzzy PI control are 10 r/min and 6 r/min, respectively. Moreover, the adjustment time is 16 ms and 7 ms, respectively. Therefore, when the fuzzy PI control is used, the motor speed output overshoot is smaller, the response is faster, the load disturbance has less affection, and the stability is higher.

Comparison of Traditional PI and Fuzzy PI
The speed responses of the two speed control methods are shown in Figures 9 and 10. When the electric motor starts, the overshoot of the traditional PI control and fuzzy PI control are 12 r/min and 6 r/min, respectively. The time to steady state is 40 ms and 31 ms, respectively. When the speed changed suddenly, the overshoot of the traditional PI control and fuzzy PI control are 8 r/min and 5 r/min, respectively. The time to steady state is 24 ms and 16 ms, respectively. A 15 N·m load is added at 0.2 s, the electric motor speed drop of the traditional PI control and fuzzy PI control are 10 r/min and 6 r/min, respectively. Moreover, the adjustment time is 16 ms and 7 ms, respectively. Therefore, when the fuzzy PI control is used, the motor speed output overshoot is smaller, the response is faster, the load disturbance has less affection, and the stability is higher.

Comparison of Traditional PI and Fuzzy PI
The speed responses of the two speed control methods are shown in Figures 9 and  10. When the electric motor starts, the overshoot of the traditional PI control and fuzzy PI control are 12 r/min and 6 r/min, respectively. The time to steady state is 40 ms and 31 ms, respectively. When the speed changed suddenly, the overshoot of the traditional PI control and fuzzy PI control are 8 r/min and 5 r/min, respectively. The time to steady state is 24 ms and 16 ms, respectively. A 15 N·m load is added at 0.2 s, the electric motor speed drop of the traditional PI control and fuzzy PI control are 10 r/min and 6 r/min, respectively. Moreover, the adjustment time is 16 ms and 7 ms, respectively. Therefore, when the fuzzy PI control is used, the motor speed output overshoot is smaller, the response is faster, the load disturbance has less affection, and the stability is higher.   The change curve of the electric motor output torque under load mutation condition is shown in Figure 11. A 15 N·m load is loaded at 0.2 s, the adjustment times of the two control systems are 15 ms and 7 ms, respectively. The torque overshoot of traditional PI control is smaller, but the adjustment time is slower than that of fuzzy PI control. At the same time, the adjustment process of traditional PI control oscillates obviously. Even when the torque reaches the steady state, there are fluctuations. It can be seen that when the fuzzy PI control is used, the electric motor output torque overshoot is slightly increased, but the responsiveness and stability are significantly improved. Figure 11. The torque change view when the load was suddenly loaded.

PI Parameter Online Tuning System-Positive Flow System
In the variable speed quantitative pump positive flow system, an electronic control handle is used to achieve pilot signal control. Meanwhile, the output signal of the electronic control handle is converted to the target speed information of the main pump. The simulation process simulates a movement cycle of the boom cylinder of an 8-ton pure electric hydraulic excavator under typical cycle conditions.
The output signal curve of the pilot handle is shown in Figure 12. The displacement curve of the actuator cylinder which is a typical movement cycle of the boom cylinder is shown in Figure 13. When the pilot signal output is 0, the motor to drive the main pump is in the idling stage and the cylinder does not move. At 1 s, the given boom-rise pilot output signal is 10 V. The boom cylinder extends at the highest speed with uniform speed. At 5.5 s, the boom-drop pilot output signal is linear to increase, and becomes constant at 6.5 s. The boom cylinder decreases at an accelerated speed first, and then decreases at a uniform speed. During the descent process, the shoveling and digging loading action is performed. After the shoveling action is executed, the boom cylinder is extended again. After the cylinder is fully extended, the slewing mechanism performed the revolving action and unloaded at the designated position. The change curve of the electric motor output torque under load mutation condition is shown in Figure 11. A 15 N·m load is loaded at 0.2 s, the adjustment times of the two control systems are 15 ms and 7 ms, respectively. The torque overshoot of traditional PI control is smaller, but the adjustment time is slower than that of fuzzy PI control. At the same time, the adjustment process of traditional PI control oscillates obviously. Even when the torque reaches the steady state, there are fluctuations. It can be seen that when the fuzzy PI control is used, the electric motor output torque overshoot is slightly increased, but the responsiveness and stability are significantly improved. The change curve of the electric motor output torque under load mutation condition is shown in Figure 11. A 15 N·m load is loaded at 0.2 s, the adjustment times of the two control systems are 15 ms and 7 ms, respectively. The torque overshoot of traditional PI control is smaller, but the adjustment time is slower than that of fuzzy PI control. At the same time, the adjustment process of traditional PI control oscillates obviously. Even when the torque reaches the steady state, there are fluctuations. It can be seen that when the fuzzy PI control is used, the electric motor output torque overshoot is slightly increased, but the responsiveness and stability are significantly improved. Figure 11. The torque change view when the load was suddenly loaded.

PI Parameter Online Tuning System-Positive Flow System
In the variable speed quantitative pump positive flow system, an electronic control handle is used to achieve pilot signal control. Meanwhile, the output signal of the electronic control handle is converted to the target speed information of the main pump. The simulation process simulates a movement cycle of the boom cylinder of an 8-ton pure electric hydraulic excavator under typical cycle conditions.
The output signal curve of the pilot handle is shown in Figure 12. The displacement curve of the actuator cylinder which is a typical movement cycle of the boom cylinder is shown in Figure 13. When the pilot signal output is 0, the motor to drive the main pump is in the idling stage and the cylinder does not move. At 1 s, the given boom-rise pilot output signal is 10 V. The boom cylinder extends at the highest speed with uniform speed. At 5.5 s, the boom-drop pilot output signal is linear to increase, and becomes constant at 6.5 s. The boom cylinder decreases at an accelerated speed first, and then decreases at a uniform speed. During the descent process, the shoveling and digging loading action is performed. After the shoveling action is executed, the boom cylinder is extended again. After the cylinder is fully extended, the slewing mechanism performed the revolving action and unloaded at the designated position.

PI Parameter Online Tuning System-Positive Flow System
In the variable speed quantitative pump positive flow system, an electronic control handle is used to achieve pilot signal control. Meanwhile, the output signal of the electronic control handle is converted to the target speed information of the main pump. The simulation process simulates a movement cycle of the boom cylinder of an 8-ton pure electric hydraulic excavator under typical cycle conditions. The output signal curve of the pilot handle is shown in Figure 12. The displacement curve of the actuator cylinder which is a typical movement cycle of the boom cylinder is shown in Figure 13. When the pilot signal output is 0, the motor to drive the main pump is in the idling stage and the cylinder does not move. At 1 s, the given boom-rise pilot output signal is 10 V. The boom cylinder extends at the highest speed with uniform speed. At 5.5 s, the boom-drop pilot output signal is linear to increase, and becomes constant at 6.5 s. The boom cylinder decreases at an accelerated speed first, and then decreases at a uniform speed. During the descent process, the shoveling and digging loading action is performed. After the shoveling action is executed, the boom cylinder is extended again. After the cylinder is fully extended, the slewing mechanism performed the revolving action and unloaded at the designated position.   Figure 14 shows the comparison curves of pump outlet flow and Figure 15 is the partial magnification curve of pump outlet flow. It can be seen that whether it is a step rise, a step drop or a ramp in the flow rate, the overshoot and responsiveness of the pump outlet flow under the fuzzy PI control are significantly better than that of the traditional PI control. When the signal is a ramp signal, the two control methods can effectively follow the target control signal and the flow fluctuation in the response process is smaller. When the system enters a stable state, the pump outlet flow pulsation under the fuzzy PI control is smaller. When fuzzy PI control is used, the pump outlet flow overshoot is smaller, the response is faster, and the stability is better.    Figure 14 shows the comparison curves of pump outlet flow and Figure 15 is the partial magnification curve of pump outlet flow. It can be seen that whether it is a step rise, a step drop or a ramp in the flow rate, the overshoot and responsiveness of the pump outlet flow under the fuzzy PI control are significantly better than that of the traditional PI control. When the signal is a ramp signal, the two control methods can effectively follow the target control signal and the flow fluctuation in the response process is smaller. When the system enters a stable state, the pump outlet flow pulsation under the fuzzy PI control is smaller. When fuzzy PI control is used, the pump outlet flow overshoot is smaller, the response is faster, and the stability is better.   Figure 14 shows the comparison curves of pump outlet flow and Figure 15 is the partial magnification curve of pump outlet flow. It can be seen that whether it is a step rise, a step drop or a ramp in the flow rate, the overshoot and responsiveness of the pump outlet flow under the fuzzy PI control are significantly better than that of the traditional PI control. When the signal is a ramp signal, the two control methods can effectively follow the target control signal and the flow fluctuation in the response process is smaller. When the system enters a stable state, the pump outlet flow pulsation under the fuzzy PI control is smaller. When fuzzy PI control is used, the pump outlet flow overshoot is smaller, the response is faster, and the stability is better.   Figure 14 shows the comparison curves of pump outlet flow and Figure 15 is the partial magnification curve of pump outlet flow. It can be seen that whether it is a step rise, a step drop or a ramp in the flow rate, the overshoot and responsiveness of the pump outlet flow under the fuzzy PI control are significantly better than that of the traditional PI control. When the signal is a ramp signal, the two control methods can effectively follow the target control signal and the flow fluctuation in the response process is smaller. When the system enters a stable state, the pump outlet flow pulsation under the fuzzy PI control is smaller. When fuzzy PI control is used, the pump outlet flow overshoot is smaller, the response is faster, and the stability is better.    Figure 16 is the cylinder speed curves and Figure 17 is the partial amplification curve of the cylinder speed. It can be seen from the partial amplification curve of the cylinder speed during shoveling that when the load is loaded during work, the cylinder speed fluctuates greatly, with large spikes and obvious jitter under the traditional PI control. While, under fuzzy PI control, the cylinder speed only fluctuates slightly, and the adjustment time is shorter. When the speed of the cylinder changes step by step, the cylinder speed has a large overshoot, the adjustment time is longer and the oscillation is obvious under the traditional PI control. While under the fuzzy PI control, cylinder speed is less overshoot, the adjustment time is shorter, and there is only a small oscillation. Therefore, when fuzzy PI control is used, the cylinder speed operation has better robustness and stability.   Figure 16 is the cylinder speed curves and Figure 17 is the partial amplification curve of the cylinder speed. It can be seen from the partial amplification curve of the cylinder speed during shoveling that when the load is loaded during work, the cylinder speed fluctuates greatly, with large spikes and obvious jitter under the traditional PI control. While, under fuzzy PI control, the cylinder speed only fluctuates slightly, and the adjustment time is shorter. When the speed of the cylinder changes step by step, the cylinder speed has a large overshoot, the adjustment time is longer and the oscillation is obvious under the traditional PI control. While under the fuzzy PI control, cylinder speed is less overshoot, the adjustment time is shorter, and there is only a small oscillation. Therefore, when fuzzy PI control is used, the cylinder speed operation has better robustness and stability.  Figure 16 is the cylinder speed curves and Figure 17 is the partial amplification curve of the cylinder speed. It can be seen from the partial amplification curve of the cylinder speed during shoveling that when the load is loaded during work, the cylinder speed fluctuates greatly, with large spikes and obvious jitter under the traditional PI control. While, under fuzzy PI control, the cylinder speed only fluctuates slightly, and the adjustment time is shorter. When the speed of the cylinder changes step by step, the cylinder speed has a large overshoot, the adjustment time is longer and the oscillation is obvious under the traditional PI control. While under the fuzzy PI control, cylinder speed is less overshoot, the adjustment time is shorter, and there is only a small oscillation. Therefore, when fuzzy PI control is used, the cylinder speed operation has better robustness and stability.   From the simulation analysis, when the fuzzy PI control system is employed, the outlet flow impact of the hydraulic pump and the pulsation are smaller. The responsiveness and robustness are better than that of traditional PI control.

Experimental Study
Experimental research were carried out further. A positive flow system test rig which matches the test motor power was built. The schematic diagram of the positive flow system test rig is shown in Figure 18 and the test rig layout is shown in Figure 19.  From the simulation analysis, when the fuzzy PI control system is employed, the outlet flow impact of the hydraulic pump and the pulsation are smaller. The responsiveness and robustness are better than that of traditional PI control.

Experimental Study
Experimental research were carried out further. A positive flow system test rig which matches the test motor power was built. The schematic diagram of the positive flow system test rig is shown in Figure 18 and the test rig layout is shown in Figure 19. From the simulation analysis, when the fuzzy PI control system is employed, the outlet flow impact of the hydraulic pump and the pulsation are smaller. The responsiveness and robustness are better than that of traditional PI control.

Experimental Study
Experimental research were carried out further. A positive flow system test rig which matches the test motor power was built. The schematic diagram of the positive flow system test rig is shown in Figure 18 and the test rig layout is shown in Figure 19.  The test rig consists of a power source and the hydraulic system. The power source mainly includes a motor controller, a PMSM, a torque sensor, and a gear pump. The hydraulic system mainly includes a cylinder, a displacement sensor, a pressure sensor, a directional control valve, and two proportional relief valves. The proportional relief valve is used to simulate load. The positive hydraulic system is realized by adjusting the electric motor speed.
The employed PMSM parameters are shown in Table 3.  The test rig consists of a power source and the hydraulic system. The power source mainly includes a motor controller, a PMSM, a torque sensor, and a gear pump. The hydraulic system mainly includes a cylinder, a displacement sensor, a pressure sensor, a directional control valve, and two proportional relief valves. The proportional relief valve is used to simulate load. The positive hydraulic system is realized by adjusting the electric motor speed.
The employed PMSM parameters are shown in Table 3.

Comparative Test Research on No-Load Variable Speed
The speed curves of the motor control system under the no-load variable speed based on traditional PI and fuzzy PI when a step signal is input are provided in Figures 20 and 21, respectively. The target speed change process is 1000-500-1200-800 (r/min). The two fragments of speed with the mutation from 0 to 1000 r/min and the mutation from 1200 to 800 r/min are studied for comparison. When the electric motor speed changes from 0 to 1000 r/min, the overshoot of the PI control and fuzzy PI control are 40 r/min and 20 r/min, respectively. Moreover, the times to steady state are 600 ms and 420 ms, respectively. When the electric motor speed changes from 1200 to 800 r/min, the overshoot of the PI control and fuzzy PI control are 35 r/min and 10 r/min, respectively. Moreover, the times to steady state are 350 ms and 260 ms, respectively. When the electric motor control system enters a steady state, the speed fluctuation of the PI control and fuzzy PI control are about 1.5/100 and 1/100, respectively. It can be seen that under the same operating conditions, the electric motor speed response and the overshoot are faster with fuzzy PI control. At the same time, the speed fluctuation is also significantly smaller after entering the steady state.

Comparative Test Research on No-Load Variable Speed
The speed curves of the motor control system under the no-load variable speed based on traditional PI and fuzzy PI when a step signal is input are provided in Figures 20 and  21, respectively. The target speed change process is 1000-500-1200-800 (r/min). The two fragments of speed with the mutation from 0 to 1000 r/min and the mutation from 1200 to 800 r/min are studied for comparison. When the electric motor speed changes from 0 to 1000 r/min, the overshoot of the PI control and fuzzy PI control are 40 r/min and 20 r/min, respectively. Moreover, the times to steady state are 600 ms and 420 ms, respectively. When the electric motor speed changes from 1200 to 800 r/min, the overshoot of the PI control and fuzzy PI control are 35 r/min and 10 r/min, respectively. Moreover, the times to steady state are 350 ms and 260 ms, respectively. When the electric motor control system enters a steady state, the speed fluctuation of the PI control and fuzzy PI control are about 1.5/100 and 1/100, respectively. It can be seen that under the same operating conditions, the electric motor speed response and the overshoot are faster with fuzzy PI control. At the same time, the speed fluctuation is also significantly smaller after entering the steady state.  The speed curves of the motor control system under the no-load variable speed based on traditional PI and fuzzy PI when a ramp signal is input are provided in Figure 22. It can be seen that two control methods can follow the target ramp input well. Between of them, the fuzzy PI control method is more ideal, although there is some overshoot. The traditional PI has a slow following response. The speed curves of the motor control system under the no-load variable speed based on traditional PI and fuzzy PI when a ramp signal is input are provided in Figure 22. It can be seen that two control methods can follow the target ramp input well. Between of them, the fuzzy PI control method is more ideal, although there is some overshoot. The traditional PI has a slow following response. The speed curves of the motor control system under the no-load variable speed based on traditional PI and fuzzy PI when a ramp signal is input are provided in Figure 22. It can be seen that two control methods can follow the target ramp input well. Between of them, the fuzzy PI control method is more ideal, although there is some overshoot. The traditional PI has a slow following response.

Figure 22.
Speed curve under no-load variable speed with a ramp signal input.

Comparative Test on Constant Speed Loading
The speed curves of the motor control system under the constant speed loading based on the traditional PI control and the fuzzy PI control are provided in Figures 23-26. The test target speed is 800 r/min, and the initial load is 1.5 N·m. When the electric motor starts, the overshoot of the PI control and fuzzy PI control are 38 r/min and 19 r/min, respectively. Moreover, the times to steady state are 600 ms and 420 ms, respectively. Under the traditional PI control, when the load is added to 3.3 N·m at 3 s, the speed jittered, and the fluctuation range is 17 r/min. Then it enters the steady state after 300 ms. Torque is released to 1.5 N·m at 11 s, and the speed jittered with a fluctuation range of 12 r/min. After 140 ms, it enters the steady state again. While under the fuzzy PI control, the load is suddenly added to 3.3 N·m at 3.4 s, and the speed fluctuation range is 12 r/min. Then it enters the steady state after 120 ms. Torque is released to 1.5 N·m at 10 s, and the speed jittered with a fluctuation range of 8 r/min. After 80 ms, it enters the steady state again. It can be seen that during the loading process, when fuzzy PI control is adopted, the speed jitter is smaller and the response is faster. Therefore, the system adopting fuzzy PI control has stronger anti-load disturbance ability, better robustness, and anti-interference performance.

Comparative Test on Constant Speed Loading
The speed curves of the motor control system under the constant speed loading based on the traditional PI control and the fuzzy PI control are provided in Figures 23-26. The test target speed is 800 r/min, and the initial load is 1.5 N·m. When the electric motor starts, the overshoot of the PI control and fuzzy PI control are 38 r/min and 19 r/min, respectively. Moreover, the times to steady state are 600 ms and 420 ms, respectively. Under the traditional PI control, when the load is added to 3.3 N·m at 3 s, the speed jittered, and the fluctuation range is 17 r/min. Then it enters the steady state after 300 ms. Torque is released to 1.5 N·m at 11 s, and the speed jittered with a fluctuation range of 12 r/min. After 140 ms, it enters the steady state again. While under the fuzzy PI control, the load is suddenly added to 3.3 N·m at 3.4 s, and the speed fluctuation range is 12 r/min. Then it enters the steady state after 120 ms. Torque is released to 1.5 N·m at 10 s, and the speed jittered with a fluctuation range of 8 r/min. After 80 ms, it enters the steady state again. It can be seen that during the loading process, when fuzzy PI control is adopted, the speed jitter is smaller and the response is faster. Therefore, the system adopting fuzzy PI control has stronger anti-load disturbance ability, better robustness, and antiinterference performance.     The d i and q i curves of the motor control system under the constant speed loading based on the traditional PI control and the fuzzy PI control are provided in Figures 27 and  28, respectively. It can be seen that after loading, the current of quadrature axis and direct axis are smaller when the fuzzy PI control is adopted. After entering the steady state, the current fluctuation is smaller, and the current stability is also better. The i d and i q curves of the motor control system under the constant speed loading based on the traditional PI control and the fuzzy PI control are provided in Figures 27 and 28, respectively. It can be seen that after loading, the current of quadrature axis and direct axis are smaller when the fuzzy PI control is adopted. After entering the steady state, the current fluctuation is smaller, and the current stability is also better.
The d i and q i curves of the motor control system under the constant speed loading based on the traditional PI control and the fuzzy PI control are provided in Figures 27 and  28, respectively. It can be seen that after loading, the current of quadrature axis and direct axis are smaller when the fuzzy PI control is adopted. After entering the steady state, the current fluctuation is smaller, and the current stability is also better.  The d i and q i curves of the motor control system under the constant speed loading based on the traditional PI control and the fuzzy PI control are provided in Figures 27 and  28, respectively. It can be seen that after loading, the current of quadrature axis and direct axis are smaller when the fuzzy PI control is adopted. After entering the steady state, the current fluctuation is smaller, and the current stability is also better.  It can be seen from the test results that the fuzzy PI control can make the electric motor control system not only has a faster response performance, but also has a smaller overshoot. In loading and unloading conditions, when fuzzy PI control is used, the electric motor speed fluctuation and the time to the steady state are significantly smaller.

Positive Flow System Test
To verify the performance of the designed controller, the variable speed, constant speed, loading and unloading tests are carried out during the cylinder extension and retraction process, shown in Figure 29. The AB and JL are the static stages of the cylinder, the pump outlet pressure is about 0 MPa, and the cylinder displacement is about 0 mm. At the time of B, the directional control valve is switched to the left position, the cylinder begins to extend without load. The target speed of the BC section is 700 r/min, and the pump outlet pressure is about 0.5 MPa. At the time of C, the electric motor speed changes to 1280 r/min. At this time, the pump outlet flow becomes larger, and the operating speed of the cylinder becomes larger too. The slope of the displacement curve corresponding to the CD segment becomes larger than that of the BC segment. At the time of D, the electric motor speed changes to 1000 r/min. At the time of E, the cylinder moves to the maximum stroke, until the directional control valve is switched to the right position at time G when the cylinder starts to retract. The EF section indicates that the cylinder is at the maximum stroke, the pump outlet hydraulic oil overflows through the main relief valve to the oil tank, and the pump outlet pressure is the relief valve which pressure is 2.7 MPa. The FG section is the directional control valve working in the neutral position. Pump outlet oil directly flows back to the oil tank through the check valve, and the pressure is close to 0 MPa. At the time of H, the relief valve on the side of the rodless cavity is adopted to load, the pump outlet pressure changes from 1.4 MPa to 2.4 MPa. At the time of I, the relief valve is unloaded, the cylinder is retracted without load, and the pump outlet pressure returns to 1.4 MPa. At the time of J, the cylinder is retracted to the minimum stroke, the pump outlet oil overflows from the main relief valve back to the tank. At this time the pump outlet pressure is the relief valve pressure which is 2.7 MPa.
of the cylinder becomes larger too. The slope of the displacement curve corresponding to the CD segment becomes larger than that of the BC segment. At the time of D, the electric motor speed changes to 1000 r/min. At the time of E, the cylinder moves to the maximum stroke, until the directional control valve is switched to the right position at time G when the cylinder starts to retract. The EF section indicates that the cylinder is at the maximum stroke, the pump outlet hydraulic oil overflows through the main relief valve to the oil tank, and the pump outlet pressure is the relief valve which pressure is 2.7 MPa. The FG section is the directional control valve working in the neutral position. Pump outlet oil directly flows back to the oil tank through the check valve, and the pressure is close to 0 MPa. At the time of H, the relief valve on the side of the rodless cavity is adopted to load, the pump outlet pressure changes from 1.4 MPa to 2.4 MPa. At the time of I, the relief valve is unloaded, the cylinder is retracted without load, and the pump outlet pressure returns to 1.4 MPa. At the time of J, the cylinder is retracted to the minimum stroke, the pump outlet oil overflows from the main relief valve back to the tank. At this time the pump outlet pressure is the relief valve pressure which is 2.7 MPa. Seen from Figure 29, when the motor speed changes, the slope of the cylinder displacement curve changes accordingly, and the responsiveness and following performance are superior. When the electric motor speed is constant, the displacement curve is stable, and the slope is consistent. The cylinder runs smoothly with no pressure shock.
A partial enlarged curve diagram of the loading and unloading process is provided in Figure 30. When the load fluctuates, the electric motor speed fluctuates to a certain extent. When loading and unloading, the load power is about 50% of the motor power, and the electric motor speed fluctuates within 1% of the target value. At the time of F and K when the pressure changes, the load power is about 70% of the motor power, and the  Figure 29, when the motor speed changes, the slope of the cylinder displacement curve changes accordingly, and the responsiveness and following performance are superior. When the electric motor speed is constant, the displacement curve is stable, and the slope is consistent. The cylinder runs smoothly with no pressure shock.

Seen from
A partial enlarged curve diagram of the loading and unloading process is provided in Figure 30. When the load fluctuates, the electric motor speed fluctuates to a certain extent. When loading and unloading, the load power is about 50% of the motor power, and the electric motor speed fluctuates within 1% of the target value. At the time of F and K when the pressure changes, the load power is about 70% of the motor power, and the electric motor speed fluctuates within 3.5% of the target value. When the load is stable, the electric motor speed is relatively stable, and the steady-state error is about 0.3%.
Appl. Sci. 2022, 12, 10072 22 of 24 electric motor speed fluctuates within 3.5% of the target value. When the load is stable, the electric motor speed is relatively stable, and the steady-state error is about 0.3%. According to test results of the positive flow system, when the vector control system based on fuzzy PI is used, not only the motor has good responsiveness, stable rotation speed, and good load disturbance resistance, but also the pressure shock caused by the hydraulic system can be reduced. When the load fluctuates severely, the electric motor speed fluctuation is small, the stability is fine, and the system has better maneuverability. The test results show that the vector control system based on fuzzy PI has better responsiveness, stability, and anti-load disturbance ability. It can better apply to electric CM under severe load fluctuations. According to test results of the positive flow system, when the vector control system based on fuzzy PI is used, not only the motor has good responsiveness, stable rotation speed, and good load disturbance resistance, but also the pressure shock caused by the hydraulic system can be reduced. When the load fluctuates severely, the electric motor speed fluctuation is small, the stability is fine, and the system has better maneuverability. The test results show that the vector control system based on fuzzy PI has better responsiveness, stability, and anti-load disturbance ability. It can better apply to electric CM under severe load fluctuations.

Conclusions
Aiming at the fact that the existing motor control system is not suitable for the working conditions of electric CM, a vector control strategy based on fuzzy PI of the PMSM is proposed and used in a positive flow system of a CM. Its feasibility was verified through simulation and test. The main conclusions are as follows: 1.
Compared with the traditional PI control, when using the fuzzy PI control, the motor speed output overshoot is smaller, the response is faster, the load disturbance has less affection, and the stability is higher; 2.
When the fuzzy PI control is used, the electric motor output torque overshoot is slightly increased, but the responsiveness and stability are significantly improved; 3.
The simulation results show that when the load is variable, the fluctuation of motor speed was approximately 1.5% with fuzzy PI, and 2.5% with traditional PI; 4.
The test results show that when the load fluctuates drastically, the electric motor speed fluctuation is within 3.5%, and the steady-state error is only approximately 0.3%.
CM has the characteristics of severe load fluctuation, so it is necessary to avoid the interference of fluctuation to CM mobility. The vector control system of permanent magnet synchronous motor based on fuzzy PI proposed in this paper is suitable for electric CM with large load fluctuation and complex working conditions. In the next step of work, it will be tested on the actual excavator under the actual working conditions to verify its responsiveness, stability, and anti-interference ability. In addition, the calculation burden caused by the fuzzy control algorithm will be studied in depth.