Abstract

With the increase in tightening of carbon neutral policies, electric new energy vehicles have become a top priority in the development of the automotive industry. The integrated electric vehicle wheel (hub motor) can effectively optimize the vehicle structure and reduce the weight of the vehicle and reduce the energy consumption. At the same time, the feature that four tires can be driven separately is also conducive to the application of various new control algorithms. In this paper, a generalized adaptive PID control is experimented with the speed control of the hub motor, and a fuzzy control-based variable step method is proposed for the overshoot or even runaway problem caused by the inertia of the hub motor in the process of adaptive PID control. Experiments have demonstrated that this method can effectively reduce the amount of overshoot triggered by adaptive control and shorten the regulation time into a steady state.

1. Introduction

As environmental problems become increasingly serious, new energy vehicles powered by electricity are gradually taking over the market [1, 2]. The high torque, compact structure, and high power density of the wheel motor can effectively simplify the vehicle structure and extend the range [3]. At the same time, the feature of four-wheel independent rotation control can also facilitate the implementation of various types of autonomous driving algorithms. In this context, the precise control of motor speed and torque has gradually become a hot spot for research [4]. At this stage, PID control is still the most commonly used closed-loop motor control algorithm. However, conventional PIDs require parameter tuning before use, which is a process of extensive repetition and trial and error. The control effect of traditional PID control in the face of multiple disturbances and high-frequency noise is also unsatisfactory. With the rise of modern control theory, there has been tremendous progress in the control effectiveness of various types of improved algorithms based on PID algorithms [5, 6]. For example, adaptive PID control is designed for the ASPR characteristics of the SISO system using a parallel feedforward compensator [7]. Design of PID controller is based on ABC two-region nonlinear load frequency control [8]. ADRC self-anti-disturbance technique incorporates state observer technique based on conventional PID [9]. Adaptive PID controller is capable of combating actuator failures and unknown environments based on finite time error transform design [10]. With the rise of machine learning techniques, adaptive PID algorithms based on this were birthed [11]. A constrained genetic algorithm (GA) is used to control a nonfragile PID controller with optimal gain [12]. PID control system based on 6-DOF mathematical model combined with back propagation neural network algorithm [13] However, such algorithms require prior training and learning of the overall model, so a large amount of a priori knowledge must be acquired, and they are less applicable to different systems.

In this thesis, the system is downscaled using an internally and externally nested dual PID control scheme for a class of high-order multivariable nonlinear time-domain systems such as hub motors. The variable-step fuzzy control method is also designed to address the overshoot phenomenon caused by motor inertia and sampling uncertainty in the actual control of generalized adaptive PID control. By changing the time interval between each PID regulation of the system, the hysteresis of the motor control system is reduced and the regulation capability of the generalized adaptive PID control [14] is better utilized. The control algorithm was also tested in an actual hub motor control system, and good control results were obtained.

2. Hub Motor Model

2.1. Structural Composition

Hub motors, also known as in-wheel motors as shown in Figure 1, integrate the braking, driving, and transmission systems all in the wheel hub [15] (see Figure 1). Unlike conventional car structures, hub motors do not require complex mechanical structures such as transmissions, drive shafts, and differentials. Hub motors can transmit torque directly to the wheels, greatly improving overall transmission efficiency.

The rotor of a hub motor is fixed to the tire and is responsible for outputting torque. The support frame and the sealing ring wrap the capacitor ring, electronic control system, coil stator, and other precision components inside to form the stator of the in-wheel motor. The brake caliper is fixed on the outside of the support frame and forms the braking system with the brake disc fixed on the tire. The stator of the wheel motor is fixed to the frame through the suspension link to realize the suspension and steering of the wheels (the detailed structure of the wheel motor is shown in Figure 2). The motor communicates and gives feedback to the VCU (Vehicle Control Unit) through wires. When VCU sends a signal, the motor is energized and the rotor rotates relative to the stator. The electronic phase commutator in the electronic control system controls the sequence and timing of energizing the stator winding according to the signal from the position sensor, generating a rotating magnetic field that drives the rotor to keep rotating forward.

2.2. Physical Model

In order to make the control more stable and intelligent, mathematical modeling of hub motors is required. Most of the hub motors in practical applications are permanent magnet synchronous motors. The permanent magnet synchronous motor is developed from the three-phase synchronous motor [16], whose permanent magnet arrangement structure is shown in Figure 3. Its permanent magnets are embedded in the external rotor, while the coil windings are fixed to the central stator.

The DC power supply is transformed into three-phase electricity through a three-phase inverter to drive the rotor. The equivalent transformation and simplification leads to the physical model, as shown in Figure 4.

The three-phase corresponds to the three-phase; and correspond to the current and voltage on the three-phase winding, respectively; and poles correspond to the two poles of the permanent magnet; is the motor rotor magnetic chain; and correspond to the angle of the magnetic chain to the A-axis and the rotor angle of rotation, respectively.

The three-phase inverter is a very important component in realizing the control of a permanent magnet synchronous motor, which converts DC power from the battery into three-phase power for direct control of the motor. Its structure is shown in Figure 5.

2.3. Mathematical Model

The permanent magnet synchronous motor is a typical nonlinear system. It has the obvious characteristics of many variables, high order, and strong coupling, so much so that it is very difficult to build its accurate model. Therefore, in practical engineering control, certain reasonable assumptions need to be made on the motor model to ensure the maximum simplification of the model while satisfying the required accuracy.(1)The layout of the permanent magnets on the rotor is perfectly symmetrical and has the same parameters.(2)The layout structure and parameters of the motor stator winding are identical and symmetrical and the angle of the three phases is 120°.(3)The conductivity of the magnetic chain is zero.

With the above assumptions holding true, the following simplified mathematical model of a permanent magnet synchronous motor can be derived.Motor voltage equation is as follows:where indicates the instantaneous voltage value on the three phases of the permanent magnet synchronous motor . denotes the resistance on the stator winding. denotes the instantaneous current on the electronic stator windings, respectively. denotes the operator of this equation for time differentiation calculation. indicates the magnetic chain on the three phases of the motor stator winding, respectively.Motor magnetic chain equation is as follows:where represents the magnetic chain on the three phase windings of the motor stator, respectively. represents the mutual inductance between the phase and the phase. represents the magnetic chain on the rotor of this motor. represents the angle between the rotor magnetic chain and the axis is shown in Figure 4.Electromagnetic torque equation is as follows:where, indicates the output torque of the motor. represents the instantaneous voltage on the electronic stator winding, respectively. then represents the magnetic chain on the rotor of this motor.The equation of motion of the tire is shown below.The force analysis of the tire is shown in Figure 6.According to the wheel force analysis diagram, the wheel motion equation is as follows:where, is the output torque of the motor which is the drive torque. is the load torque. is the coefficient of viscous friction of the rotor shaft of the permanent magnet synchronous motor. is the angular velocity of the motor rotor. is the rotational inertia of the wheel motor rotor and tire, and the expression values are shown aswhere m is the total mass of the tire and the motor rotor and r is the radius of the tire.

3. Design of the Controller

3.1. Overall Design of the Controller

The speed control of PM synchronous motors in a DC environment is usually achieved indirectly by changing the loading voltage on the three-phase inverter using PWM modulated waves to control the wheel speed. It is clear from the mathematical modeling that the entire process from load voltage to output wheel speed is high order, strongly coupled, and multivariate. In the actual control we need to face the following situations:(1)Nonidealization of model constraints. In order for the modeling process to proceed smoothly, we formulated some assumptions about the model. However, the existence of unavoidable factors such as the manufacturing process and assembly errors in the actual control process makes it difficult to achieve the set model constraints perfectly.(2)The values of the variables are difficult to measure. During the high-speed operation of a hub motor, variables such as instantaneous voltage and instantaneous current on the coil are difficult to measure.(3)Constants present a strong time-domain [17]. As the motor continues to run, certain factory parameters of the motor will change as the motor runs over time. For example, the stator coil resistance value will gradually increase with the motor temperature. The maximum battery voltage decreases gradually as the battery SOC decreases.

The presence of many factors makes it difficult to establish an accurate mathematical model of the loading voltage to the output speed. In order to reduce the influence of the above factors on the motor control, a two-layer PID nested control structure is designed in this paper, as shown in Figure 7. The inner loop PID is the torque loop, whose main function is to control the load voltage loaded on the three-phase inverter so that the motor output torque is close to the target torque. The outer loop PID is the speed loop, whose function is to calculate the target torque of the inner loop PID control using the difference between the actual speed and the target speed, thus realizing the closed loop. In the design, the inner loop PID regulation frequency is significantly higher than the outer loop, allowing the torque loop to have enough regulation times to approximate the target torque derived from the speed loop. This design allows the system to well circumvent the problem of nonidealized motor parameters and reduces the system to a first-order nonlinear control problem between torque and speed.

When the actual output torque is very close to the target torque, the control structure can be simplified as shown in Figure 8, and the corresponding controlled model is simplified as shown in the following equation:

In the formula, m is the total mass of the motor rotor tire; r is the radius of the tire; is the first-order derivative of the actual output speed; B is the coefficient of viscosity of the electronic rotor; N is the actual output speed; and are the output torque and drag torque of the motor, respectively.

3.2. Conventional PID Control

PID algorithm is widely used in practical industrial control. It compares and analyzes the actual output of the controlled object with the set target quantity, and the difference between the two is adjusted by proportional link (P), integral link (I), and differential link (D) to derive the control quantity. The conventional PID control algorithm is shown aswhere is the output of the PID control, is the difference between the actual value of the controlled quantity and the target value, and , , is the proportionality, integration, and differentiation coefficients, respectively.

In the actual control, each observed quantity is not continuous, but discrete with a certain time interval. Therefore, we need to discretize the above traditional PID algorithm formula, and the discretized formula is shown as follows:

The control performance of the PID algorithm depends mainly on the value of , , and the greatest workload in designing the PID controller comes from the constant adjustment and trial and error of the three coefficients of , , [18].The role of the proportionality factor is to speed up the response of the control system. , the larger the coefficient, the faster the response of the system and the higher the accuracy of the system, but it will also cause the system to overshoot and even cause the system to be unstable. , the smaller it is, the lower the response speed of the system will be, thus prolonging the time for the system to reach the steady state and making the dynamic and static characteristics of the system both worse. The function of the integration factor is to eliminate the steady-state error of the system. , the larger the coefficient, the faster the system can eliminate the steady-state error, but when is too large, it will cause integration saturation at the beginning of the regulation process, resulting in a large overshoot. If is too small, it will make the steady-state error difficult to eliminate and affect the regulation accuracy of the system. At the same time, the measurement error will accumulate in the integration, and the accumulated error for a long time will make the regulation accuracy degrade. The differential coefficient can improve the dynamic performance of the system. It can suppress the deviation in any direction and prevent the overshoot phenomenon. However, an excessive amount of makes the regulation process brake earlier, which makes the regulation time longer and reduces the ability of the system to resist disturbances.

3.3. Adaptive PID Control

PID control algorithm has been widely used in the industry for its simple structure, good robustness, and easy implementation. But the actual control is mostly accompanied by changes in the control environment, the traditional PID control cannot change the proportional, integral, and differential coefficients in real time according to the changing environment, which makes the control effect is reduced or even out of control.

For the actual control situation, adaptive PID control algorithms have been developed rapidly, especially the generalized adaptive PID control algorithm without accurate mathematical model of the controlled object and without a priori knowledge. Since differential regulation has a large impact on the antidisturbance ability of the system, the first-order nonlinear PI control algorithm is used as an example in this paper [18]. The form of its generalized adaptive PI control algorithm is shown as follows:

Unlike traditional PI control which uses constant gain coefficients, the gain coefficients for adaptive PI control are divided into two parts, where is the proportional constant gain coefficient andis the integral constant gain coefficient. To simplify the debugging process, is set, where . and are time-varying gains that automatically adapt to environmental changes using the algorithm. and are determined by the following equations:where c is a dummy parameter, is an estimate of c, and are small constants of the designer’s choosing according to the actual situation, and . s is a filter variable with the expression. is determined by the following equation:

The equations and are positive numbers that need to be freely chosen by the designer depending on the actual situation of the control. is a scalar quantity used to describe the state of the system.

To prevent the system from going out of control in the event of a contingency, an upper limit Z needs to be set for . The expression is shown as

3.4. Fuzzy Control of the Step Size

In the actual control, the generalized adaptive PI control can increase the proportional and differential coefficients in real time, thus speeding up the response of the system. However, the hub motor has a large inertia and response time, and once the motor cannot respond in time, the adaptive control accumulates several iterations during which the proportionality coefficient is easily too large, thus making the system start to oscillate. When the system starts to oscillate, the adaptive algorithm will continue to increase the proportionality coefficient and form positive feedback, thus making the system completely out of control.

After the PID algorithm is discretized, the time between two regulation controls is called the step size. Extending the step length can make the motor respond in time, thus reducing the accumulation of errors during the motor response and preventing the system from going out of control. However, lengthening the step length will reduce the control accuracy of the system and increase the steady-state error of the system. In this paper, fuzzy control is used to change the step length of the system in real time according to the state of the motor, so that generalized adaptive PI control can perform better and get the optimal control effect.

The main components of fuzzy control are: fuzzy interface, fuzzy inference machine, and clear interface [19]. In this paper, the error and the amount of change of error are chosen as the input of fuzzy control to describe the state of the system, and the interval (step size) of system regulation is taken as the output of fuzzy control. The structure of the fuzzy controller is shown in Figure 9.

Fuzzy controller input variables and output variables are called linguistic variables. For example, bigger negative, medium negative, smaller negative, zero, bigger positive, medium positive, smaller positive (abbreviated as {NB, NM, NS, ZE, PS, PM, PB}), and other descriptors used to describe the size of linguistic variables are called linguistic variable values. The set of values of linguistic variables is called the fuzzy domain. The range of the actual input and output quantities of the fuzzy controller is called the fundamental domain, which is a continuous domain. The basic theoretical domain needs to be transformed into a discrete domain of finite integers in the fuzzification phase. Quantization factors are needed for domain transformation between the joint basic and discrete theoretical domains. The quantification factor is determined by the following equation. where K is the quantization factor; n is the number of discretized basic theoretical domains; a and b are the upper and lower limits of the basic theoretical domains, respectively.

The basic theoretical domain is discretized and transformed into a fuzzy domain using an affiliation function. The commonly used affiliation functions are triangular, trapezoidal, Gaussian, etc. In order to simplify the calculation of this paper, we choose the triangular affiliation function.

The input error e, the linguistic variables are taken as E, the fuzzy domain is bigger negative, medium negative, smaller negative, zero, smaller positive, medium positive, bigger positive, and smaller positive (abbreviated as {NB, NM, NS, ZE, PS, PM, PB}), the basic domain is [−300, 300], and the discrete domain is taken as [−3, 3]. The quantization factor is taken as 1/100.

The variation of the input error , the linguistic variables are taken as , the fuzzy domain is bigger negative, smaller negative, zero, smaller positive, and bigger positive (abbreviated as {NB, NS, ZE, PS, PB}), the basic domain is [−60, 60], the discrete domain is taken as [−3, 3], and the quantization factor is taken as 1/20.

The output quantity step s, the linguistic variables are taken as S. The fuzzy domains are small, relatively small, medium, relatively big, and big (abbreviated as {S, RS, M, RB, B}), the basic domain is [10, 50], and the discrete domain is [1, 5]. The quantization factor is 1/10.

The membership function of the error is shown in Figure 10.

A table of error membership functions is created from the error membership function diagram, as shown in the Table 1.

The membership function diagram and the function table of the change rate of the input error are shown in Figure 11 and Table 2.

The membership function diagram and the function table of the output step S are shown in Figure 12 and Table 3.

This paper summarizes 35 fuzzy control rules based on a large number of experiments that relate the error and the rate of change of the error to the actual control system step size. These control rules use the type of “if PB and PB then B.” These rules are summarized in a fuzzy rule control table, as shown in Table 4.

Finally the results of fuzzy inference are clarified using the center of the gravity method, and the specific clarification rules are shown below, where is the step size S the affiliation function of the fuzzy set the center of the covered area.

The final system control is shown in Figure 13. The error is calculated by the real-time feedback of the rotational speed, and the obtained error is used as the input of the system to obtain the proportionality coefficient by the generalized adaptive PID algorithm and integral coefficient ; the step size of this PID regulation is decided by the fuzzy controller, and the final outer-loop PID generates the control torque, which is input to the inner-loop PID and outputs the control voltage to control the wheel motor rotation.

4. Experiment and Analysis

This experimental platform is shown in Figure 14, the external STM32 microcontroller receives the feedback speed signal, the speed will be PID processing described above, the output target torque, through CAN communication to vehicle VCU. Vehicle VCU will receive the torque through the built-in PID conversion for the control of wheel motor rotation. The vehicle’s built-in speed controller feeds the actual speed to VCU, which then transmits the speed to the STM32 microcontroller via CAN communication to finally achieve a closed loop.

Experimentally, the proportionality coefficient and the integration coefficient were set as the optimal parameters for manual adjustment at 100 r/min. The state description quantity in generalized adaptive PI control is the sum of the absolute value of the system error and the absolute value of the speed acceleration. The three parameters of PID regulation are unchanged, and the target speed of the motor is set to 100 r/min and 300 r/min and record the actual control of tire speed by the system under three modes of generalized adaptive PID mode, fuzzy adaptive PID mode, and conventional PID mode. The experimental results are shown in Figures 15 and 16. The performance comparison between different algorithms is shown in Table 5.

In terms of time to approach the target speed, the generalized adaptive PID is the fastest, followed by the fuzzy adaptive PID and finally the conventional PID control. The adaptive PID algorithm automatically increases the factor according to the motor state to make the whole faster to approach the target speed. The fuzzy adaptive PID algorithm extends the regulation interval to reduce the number of iterations of the proportionality coefficient relatively slow, but also significantly faster than the traditional PID algorithm.

In terms of the time to reach a steady state, the fuzzy adaptive PID control is the best and generalized adaptive PID control has the longest time to enter a steady state. The system lag caused by motor inertia makes the adaptive PID control algorithm iterate the PID control coefficients rapidly even after approaching the target speed, instead prolonging the oscillation time. The addition of fuzzy control allows the system to adjust each PID control interval according to the state of the motor, allowing the motor to respond in sufficient time to reduce the generation of oscillations.

In terms of overshoot, the fuzzy adaptive PID algorithm is significantly smaller than the generalized adaptive PID control algorithm. The intelligently adjusted step size significantly reduces the transition accumulation of the proportional coefficient KP, effectively suppressing the control inertia of the system and reducing the generation of overshoot.

In terms of steady-state error, the three control methods do not differ much. Fuzzy adaptive PID control is slightly better than generalized adaptive PID control, and the effect is close to that of conventional PID control.

From the comparison between Figures 15 and 16, it can be concluded that the same PID parameters still play a role in the control of the system as a result of changing the target speed from 100 r/min to 300 r/min. However, the increase in speed makes the steady-state error of the system increase significantly, and the control effect is relatively reduced. The adaptive PID control algorithm with fuzzy adjustment step size still allows the system to regulate faster and enter the steady-state phase in less time than traditional PID algorithms.

Overall, fuzzy adaptive PID control retains the ability of generalized adaptive PID control to automatically adjust parameters and can have a fast approach to the target. At the same time, it can also effectively reduce the generation of overshoot and reduce the time to enter the steady state. It can not only approach the target quickly and effectively, but also ensure the lower limit of traditional PID control effect and provide a stable steady-state performance, which effectively increases the robustness of the system when facing different working conditions.

5. Conclusion

In view of the problem that the generalized adaptive PID control cannot respond to the lag caused by the inertia and error of the system in time, and is easy to produce overshoot and steady-state error, this paper designs the adaptive step size adjustment algorithm of fuzzy control according to a lot of control experience and summary. If the lag of the system is large, the step length between the two adjustments is lengthened, so that the system can have enough time to respond to the control command and eliminate the lag of the system. When the system lag is small, the PID adjustment can be performed with a small step size to deal with the sudden change of the system in time. Practical verifications at different speeds are carried out on hub motors. Experiments show that the algorithm has a good fast response ability and excellent adaptive ability in the control of the motor. However, good fuzzy control results need to be based on a lot of practical experience. Although the addition of fuzzy control effectively optimizes the effect of control inertia, it also limits the generalizability of the control method. Future research will address multiple factors of motor hysteresis by effective mathematical modeling and propose a generalized method for effective reduction of motor control system hysteresis using modern control theory.

Data Availability

The data in this paper are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This work was supported by the Science and Technology Research Projects of Colleges and Universities in Hebei, China (No. ZD2018207).