Abstract
To improve the control precision of the closed-loop speed regulation of the brushless DC motor (Brushless DC motor, BLDCM) used in hybrid vehicles, the paper established a fuzzy controller for closed loop control of speed, taking the speed difference and the conversion rate of the speed difference as the inputs, and the increment of the supply voltage as the output, and proposed a method of optimizing fuzzy control rules based on genetic algorithm. Established the mathematical model of BLDCM in MATLAB/Simulink, simulated the traditional PID controller, the fuzzy controller and the fuzzy controller optimized by genetic algorithm. Then the hardware-in-the-loop motor control system is constructed based on dSPACE. The simulation and experiment prove that the optimization of fuzzy rules by genetic algorithm is an effective method to improve the accuracy of speed control, and it has good tracking performance for frequently changing speed requirements in hybrid vehicle.
Introduction
In response to “Made in China 2025”, new energy vehicles as a national strategy have strong development potential [1]. Hybrid electric vehicles (HEVs) are powered by engines and motors, which require high speed, strong overload capacity, high power density, good controllability and steady-state performance. Permanent magnet motor (PMM) has the advantages of high power density and high speed, so it shows promising potentials in the field of electric vehicles and hybrid electric vehicles. Among them, the trapezoidal permanent magnet brushless DC motor (BLDCM) not only maintains the characteristics of good speed regulation performance and high operation efficiency of the brush motor, but also has the advantages of long life, maintenance-free, high reliability and large output torque, so it is widely used in the field of electric vehicles and hybrid electric vehicles [2]. But the BLDCM is a strong coupling, multi-variable and time-varying nonlinear system. The torque ripple during the operation will affect the reliability of the motor drive system, reduce its control characteristics, which cause the decrease of hybrid electric vehicle power performance and increase of fuel consumption. The unstable speed regulation of motor also makes the vehicle jitter during operation.
In order to solve the problem of speed control of BLDCM, many scholars at home and abroad have done a lot of research on the control method, and put forward a variety of control strategies [3, 4]. The strategy based on traditional PID control is simple and easy to operate. The introduction of double closed loop control method in BLDCM control can achieve the goal of speed regulation and speed stabilization [5]. Nevertheless, the traditional PID parameters remain unchanged in the case of motor speed changes frequently, which makes the requirements of performance and control accuracy of hybrid electric vehicles difficult to meet. Fuzzy control strategy does not need to establish an accurate mathematical model of the system. The fuzzy control applied in the closed loop control method shows that the overshoot of the current and speed of the system is obviously reduced and the rise time is shorter [6]. However, the design of fuzzy rules relies on experience and is too subjective [7, 8, 9]. Some scholars combine fuzzy control with PID, using fuzzy rules by the means of the relationship between error and error rate of change to find out the relationship among the proportion, integral and differential of PID controller. Thus three control parameters of PID are modified to make the fuzzy PID based speed control system have better dynamic and static response. But it also fails to solve the problem of subjectivity of fuzzy rules [10, 11, 12, 13, 14, 15, 16, 17]. To solve this problem, some scholars combine artificial neural network with fuzzy control. However, artificial neural network and other similar optimization methods require a large number of training samples and are not suitable for real vehicle applications.
The aim of this work is, by obtaining the mathematical model of BLDCM using Laplace transform based on the voltage equation and the torque equation of BLDCM, to establish a BLDCM speed closed-loop control system; by taking the speed difference and the speed difference rate as the inputs of the fuzzy controller, and the increment of armature voltage as the output of the fuzzy controller, establish the fuzzy controller of the motor speed regulation; use the genetic optimization algorithm to optimize the fuzzy control rules based on the minimum BLDCM rotation error; build the motor speed control system model in MATLAB/Simulink to simulate the control strategies of traditional PID control, fuzzy controller and optimized fuzzy controller; by constructing the motor control system based on the hardware-in-the-loop simulation system with dSPACE, verify the proposed control strategy experimentally by using the Rapid Prototype Function. At the same time, according to the designed hybrid electric vehicle, experiments are carried out to verify the effectiveness of the control strategy in the case of different driving cycles.
Mathematical model of BLDCM
The model of BLDCM is simplified based on the following assumptions: the three-phase winding of the motor is an absolutely symmetrical structure; the change of rotor position does not affect its magneto resistance value; the effects of commutation process, armature reaction, cogging, eddy current, hysteresis loss, etc. are not considered; hardware parameters are fixed values [18].
Voltage equation and its transfer function
According to the basic law of the circuit, the voltage-balanced equation of the BLDCM armature circuit is as follows:
Where,
By implementing the Laplace transformation on the Eq. (1), the transfer function of the armature voltage
The BLDCM back electromotive force
Where,
The Laplace transformation is implemented on the Eq. (3) to obtain a transfer function of the back electromotive force
Put Eq. (4) into Eq. (2) obtains:
According to the principle of electromechanical energy, ignoring the viscous friction, the torque-balanced equation for the drive shaft of BLDCM is as follows:
Where,
Implementing the Laplace transformation on Eq. (6) to obtain the dynamic equilibrium equation of BLDCM as follows:
The mathematical model of the motor is established according to Eqs (5) and (7), and the dynamic structure of the BLDCM is shown in Fig. 1.
Dynamic structure block diagram of BLDCM.
The fuzzy control strategy controlling the motor adopts a method of adjusting the armature voltage of the motor, aims to make the motor to reach the reference speed quickly and stably. In order to avoid the fuzzy control rules of complication, make the control algorithm easy to implement, ensure the stability of the system and weak the system oscillation, the widely used two-dimensional fuzzy controller is applied [19]. The structure of fuzzy control strategy is shown in Fig. 2. The error and error rate of motor speed are selected as the two-dimensional inputs of the fuzzy control strategy. The output of the fuzzy control strategy is in the form of voltage increment. By adjusting the voltage increment to the armature of BLDCM, the speed of the BLDCM is adjusted. The core of the entire control strategy is the fuzzy controller.
The block diagram of fuzzy control strategy.
In this paper, the maximum speed of the motor is 2700 r/min. Usually, when establishing the membership function of the input variable of fuzzy control, the membership function of the linguistic values on both sides of the variable set adopts symmetrical. So the basic domain of the fuzzy controller input speed error
Fuzzy control rules as the core of the whole fuzzy controller, which is usually based on operational control experience and expert knowledge, have certain subjectivity. The collection of logic rules consists of several control rules represented by multiple fuzzy conditional statements. According to the two inputs speed error
The fuzzy rules in the rules table are converted to fuzzy control languages as follows:
If
In order to observe the relationship between the input and output of the fuzzy controller more intuitively, a control surface observer can be utilized, as shown in Fig. 3.
Fuzzy control rules
Fuzzy logic controller surface.
The optimization of fuzzy control rules is essentially a combinatorial optimization problem, which is intended to seek the best combination of input and output fuzzy variables of the fuzzy controller. In this paper, the genetic algorithm is introduced into the optimization of fuzzy rules, the application process is as follows: determine the coding method of the genetic individual, create the initial population, determine the evaluation function of the individual fitness, determine the basic genetic operations of genetic operators such as selection, crossover and mutation, and determine the parameters of the genetic algorithm such as population size, crossover rate and mutation rate [20].
Genetic individual coding and decoding methods
The output variable of the existing fuzzy controller is encoded in binary form. The linguistic variable of the output voltage increment
Because the fuzzy control rules are written in the form of M file, and the minimum subscript of variables is 1 in the M file, so the fuzzy rules correspond to 1 to 8, the conversion function from the encoding bit string to the parameter space in this paper is as follows:
Where,
Equation (8) is used to convert the encoding bit string into real language variables. Because each row of chromosome contains seven real codes, the 21-bit row data encoding each row need to be disconnected into seven 3-bit long binary coding strings, and then each coding string is corresponding to the decimal form, that is, the corresponding output of each linguistic variable. For example, for a 21-bit row data 000100101001010101110, which is decomposed into seven segments of 000, 100, 101, 001, 010, 101, 110, then the results are treated with Eq. (8) by adding 1 to them, the corresponding decimal forms are 1, 5, 6, 2, 3, 6, and 7. According to this method, a code table of the fuzzy control using output value of 1 to 8 can be obtained.
The quality and quantity of the initial population have a great influence on the complexity of genetic algorithm calculation and whether it can be quickly converged. Since there is no expert experience for the creation of the initial population, the method of selection is to randomly select 80 7
Determination of the individual fitness evaluation function
In order to measure the quality of individuals, the individual fitness is used as an indicator. Fitness refers to the degree to which individual individuals are likely to reach or approach the optimal solution in the optimized computational population. Individuals with higher fitness are better, and the probability of inheriting to the next generation is greater, and vice versa. The control objective of the control system in this paper is that the motor achieves the specified speed and the error is minimal. Therefore, when designing the optimization algorithm, take the motor to achieve the specified speed as the optimization goal. Thus, the optimization goal is to minimize the speed error, that is, the difference between the target speed and the actual speed is minimal. The absolute cumulative sum of errors is selected as the objective function of optimization, that is
The goal of genetic algorithm optimization is to minimize the value of the objective function, that is, to maximize the value of the fitness function. The individual with the greater fitness value is the optimal individual. According to the coding and decoding methods above, the obtained optimal individual is decoded, and the optimized fuzzy rule code table is obtained. The code table is a 7
The basic operations of genetic algorithms include selection, crossover and mutation.
(1) Selection, also known as replication. Using the fitness function to obtain the adaptation value of each individual, and then obtain the replication probability of each individual. Those with higher replication probability will have more descendants in the next generation, and vice versa.
For the group
(2) Crossover, recombining two chromosomes. Crossover operation is a combination of two chromosomes, which is a new method of generating new chromosomes in genetic manipulation. The crossover probability is generally taking from 0.4 to 0.99, expressed by
(3) Mutation, a gene in a chromosome is randomly changed from 1 to 0 or from 0 to 1 according to a certain probability. Mutation enables genetic algorithm to search the optimal solution outside the initial genome combination, to avoid local optimal solution in the early evolution that affect the quality of the solution in the process of termination. Mutation probability is generally 0.0001
In the process of optimization of fuzzy control rules, mutation operations will lead to larger changes in fuzzy rules, for example, 010 represents NS, if the first bit mutates from 0 to 1, the code becomes 110, and the corresponding control rule becomes PM. It is obviously that the rules changes considerably. In order to ensure that the initial generation of optimization has enough exploration scope and avoid falling into precocity, a larger mutation probability should be selected. In the later generation of the algorithm, a smaller mutation probability should be selected to avoid damaging the optimization results. Therefore, this paper adopts the method of decreasing with generation, which is the probability of mutation in this paper should be reduced with the increase of evolutionary generation. This paper, on the basis of determining the initial mutation probability, uses equation
to calculate the probability of mutation, where
The basic parameters of genetic algorithm are as follows: the population size is 80, the terminated evolutionary generations are 100, the crossover probability is 0.6, the initial mutation probability is 0.001, and the adaptive mutation probability is used.
Simulation models and simulation results
Simulation model of BLDCM
The BLDCM simulation model is built according to the BLDCM mathematical model and dynamic structure block diagram established in Section 2. The rating power of the motor is 0.2 kW, the rating voltage is 36 V, the rating speed is 2700 r/min, and the rating torque is 0.637 Nm. And remaining parameters selected in the control system are shown in Table 2.
Key parameters of BLDCM
Key parameters of BLDCM
Referring to the parameters in Table 2, the simulation model of the motor in the Simulink environment is obtained, as shown in Fig. 4.
Simulation model of BLDCM.
The traditional PID algorithm uses the single-loop control method to regulate the speed. The PID control parameters are set to K
Speed response curve of traditional PID.
It can be clearly seen from Fig. 5 that using the traditional PID algorithm to regulate the BLDCM speed, the speed is basically stable when the simulation time reaches 0.3 s after the BLDCM started. The actual speed is 1011 r/min, and there is an error of 11 r/min compared with the reference speed of 1000 r/min, that is, the speed error is 1.1%. In the PID speed simulation, the BLDCM can reach the specified speed faster, but it has large overshoot. The peak speed is 1050 r/min and the overshoot is 5%. Moreover, there is no certain rule for the PID algorithm parameter adjustment. In the engineering practice, the trial and error method is usually used to adjust the three parameters, and the response overshoot is likely to occur in the speed regulation.
Model the fuzzy control strategy in Fig. 3 in MATLAB/Simulink. The fuzzy control rules are set according to the control rules in Table 1. Then the fuzzy controller is established in the Simulink environment. The simulation model of the fuzzy controller is shown in Fig. 6.
Simulation model of fuzzy controller.
Use this fuzzy controller simulation model to simulate the BLDCM speed regulation and the same simulation parameters are selected as the PID control, that is, the simulation adopts a fixed step size of 0.001 s. The speed response curve based on fuzzy logic controller is shown in Fig. 7.
Speed response curve of fuzzy logic controller.
It can be clearly seen from Fig. 7 that using the fuzzy controller for BLDCM speed regulation makes the BLDCM speed basically stable at the simulation time 0.16 s. The actual speed is 1003.7 r/min, and there is an error of 3.7 r/min with the reference speed of 1000 r/min, that is, the speed error is 0.37%. The peak speed is 1006 r/min and the overshoot is 0.6%. Compared with the PID control algorithm, the BLDCM reaches a stable speed with a short rise time and the overshoot is smaller by the fuzzy controller based the BLDCM speed regulation.
According to the parameters and operation method of genetic algorithm designed in Section 4, M file of genetic algorithm is compiled in MATLAB to optimize the fuzzy control rules. This controller called GA-fuzzy controller. After optimization, the optimization process of objective function
Optimization of object function J.
The optimal chromosome individuals optimized by genetic algorithm are decoded to get the code table of fuzzy rules, as shown in Table 3. The numbers in the table represents the coding of the fuzzy variable by genetic algorithm, and the corresponding numbers in the code table can be converted into the fuzzy language variables to get the fuzzy rules table.
Fuzzy control code rules after optimization
In the results, the number 1 corresponds to the linguistic variable NB in the fuzzy rules, 2 corresponds to NM, 3 corresponds to NS, 4 corresponds to NO, 5 corresponds to PO, 6 corresponds to PS, 7 corresponds to PM and 8 corresponds to PB. By converting them into fuzzy linguistic variables, the fuzzy rules table optimized by the genetic algorithm can be obtained as shown in Table 4.
Fuzzy control rules after optimization
Optimization of fitness F.
Compared with the fuzzy control rules in Table 1, the control rules that change after optimization are marked in Table 4. After optimization, a total of seven control rules have been changed. Take one of them as an example: before optimization, if the speed error is PS and the speed error rate is NB, the output will be PB. After optimization, if the speed error is PS and the speed error rate is NB, the output turns into PM. In genetic algorithm, the binary coding of PB is 111, and that of PM is 110. That is to say, the corresponding bit of optimized chromosome is changed from 7 to 6 after decoding. Since the entire rules table is optimized as a whole during optimization, the optimized form is a combination form of global optimized, and any rule needs to play a role in the entire fuzzy control rules table regardless of whether it changes or not.
The fuzzy controller is redesigned according to the optimized fuzzy rules table, and the optimized fuzzy controller simulation model is used to re-simulate the BLDCM speed regulation to obtain the speed response as shown in Fig. 10.
It can be obtained from Fig. 10 that the optimized fuzzy controller is used for BLDCM speed regulation. The motor speed is basically stable at the simulation time 0.14 s, while the premise of the same sampling step and simulation time. The actual speed is 1002.1 r/min and the reference speed is 1000 r/min. There is an error of 2.1 r/min, that is, the speed error is 0.21%. The peak speed is 1004 r/min and the overshoot is 0.4%. Which indicates that the fuzzy controller optimized by genetic algorithm has faster adjustment time in BLDCM speed regulation, smaller overshoot and the speed adjustment effect is better.
Comparison results of proposed controller
Speed response curve of fuzzy logic controller after optimization.
The comparison results of PID control strategy and fuzzy control strategy before and after optimization are put in the Table 5. The results show that the optimized fuzzy rules are effective in rise time, overshoot and steady-state error when they are applied to BLDCM speed regulation.
This paper builds a BLDCM control experimental platform based on the hardware and software environment of the hardware-in-the-loop simulation platform of dSPACE. For the simulation model established in MATLAB/Simulink above, the input interface of speed detection and output of voltage regulation are replaced with RTI modules, the real-time code of the model is generated after compiling, and the code to the dSPACE hardware is download into MicroAutoBox II. Combined with the peripheral control circuit, a motor control system based on dSPACE hardware-in-the-loop simulation system is constructed, and the proposed control strategy experimentally is verified by using the Rapid Prototype Function of dSPACE.
In this experiment, the control board model of MicroAutoBox II is DS1401, and the input and output interface board is DS1511 I/O Connector. The experimental platform of BLDCM control system based on dSPACE is shown in Fig. 11.
In order to observe the stability performance and fast response performance of the motor, the experiment of constant speed control and the experiment of motor speed control for a hybrid electric vehicle are carried out to verify the validity the control strategy of the motor speed.
Experiment platform of control system for BLDCM based on dSPACE.
Utilize the fuzzy rules before optimization to control the BLDCM, the target speed is set to 1000 r/min while the motor is idle. The actual speed is shown in Fig. 12. It can be seen from the figure that using the fuzzy controller before optimization, the speed reaches steady state in about 0.16 s. After stabilization, the speed is 1012 r/min, compared with the reference speed is 1000 r/min, there is a 12 r/min error, that is, the speed error is 1.2%. The peak speed is 1022 r/min and the overshoot is 2.2%.
Speed curve based on fuzzy controller before optimized.
Utilize the fuzzy rules after optimization to control the BLDCM, the target speed is set to 1000 r/min while the motor is idle. The actual speed is shown in Fig. 13. It can be seen from the figure that the optimized fuzzy controller achieves steady state in about 0.12 s and there is no obvious overshoot in the control process. After stabilization, the speed is about 1012 r/min. and there is an error of 12 r/min compared with the reference speed of 1000 r/min, that is, the speed error is 1.2%. The peak speed is 1015 r/min and the overshoot is 1.5%. Compared with the fuzzy rules before optimization, the optimized fuzzy controller applied to the motor control system has faster response and smaller overshoot error.
Speed curve based on fuzzy controller after optimized.
The experimental results show that the optimized fuzzy rules have good effect on the speed control of motor at specified speed, it have higher steady-state accuracy and shorter response time and smaller overshoot.
This project originates from a cooperative research and development project with a company: the development of a certain type of hybrid electric vehicle, the original vehicle is a diesel engine bus, now the vehicle is improved to a hybrid electric bus. The remodelled hybrid vehicle adopts the parallel connection of engine and motor and can work under three driving modes: engine drive alone, engine and motor drive in coordination and motor drive alone. The designed vehicle has a maximum speed of 95 km/h and a pure electric mileage of 85 km. The basic parameters of vehicle are shown in Table 6.
Basic parameters of vehicle
Basic parameters of vehicle
The vehicle is simulated under UDDS and typical urban cycle in China, the speed curves of vehicle in ADVISOR are shown in Fig. 14. Then the demanded speed curves of motor under these cycles are obtained respectively, as shown in Fig. 15. It can be seen from the figure that the vehicle drives under the actual driving cycle and the demanded speed of the motor fluctuates frequently, which requires the real-time tracking of the motor speed.
Vehicle speed under UDDS and Chinaurban.
Required motor speed under UDDS and Chinaurban.
Measured motor speed under UDDS and Chinaurban.
Using the dSPACE experimental platform, the required motor speed under two driving cycles are introduced as the target speed and the optimized fuzzy control strategy is used to control the motor. The measured motor speed is shown in Fig. 16.
From Fig. 16, it can be seen that the optimized fuzzy control strategy can still follow the motor speed requirement with frequent changes in speed. The experimental results show that the optimized fuzzy rules are applicable not only to the specified speed, but also to the speed control of the real vehicle motor. It can meet the performance requirements of the whole vehicle for different driving cycles.
The speed following curves before and after the optimization of fuzzy rules is compared and the results are shown in Fig. 17. Figure 17a and b are UDDS cycles and Chinaurban cycles respectively. In Fig. 17a, by enlarging the speed curves at 100 s, 380 s, 500 s, 930 s and 1215 s, it can be clearly seen that the fluctuation of speed before optimization is obvious and the optimized speed curve can better follow the demanded speed, respond faster and fluctuate less, which is consistent with the control strategy designed by genetic algorithm with the objective of minimizing errors. In Fig. 17b, also enlarging the speed curves at 80 s, 160 s, 250 s, 360 s, 490 s, 620 s, 850 s, 975 s, 1080 s and 1190 s, it is the same as Fig. 17a. Therefore, under different driving cycles, the optimized fuzzy rule has better control effect.
Contrast of measured motor speed before and after optimization of fuzzy rules.
By establishing BLDCM mathematical model in the environment of MATLAB/Simulink, the speed control fuzzy controller is designed and simulated. The simulation results show that the fuzzy control optimized by genetic algorithm has better performance, which enables the motor to reach the specified speed quickly and steadily and the steady-state error is reduced. The time to reach steady state is shorten by 0.02 s, the steady-state error and overshoot is reduced 0.16% and 0.2% respectively. The hardware-in-the-loop experimental platform of dSPACE is built and the optimized fuzzy controller is utilized to BLDCM speed control system. The experimental results show that the optimized fuzzy controller can significantly reduce the time for the speed control system to achieve stable speed and the steady-state error is smaller. The time to reach steady state is shorten by 0.04 s and the overshoot is reduced 0.7%. The ADVISOR is used to simulate the remodelled hybrid electric vehicle under specified driving cycles and the experiment is carried out to verify the control strategy of the motor under specified driving cycles. The results show that the BLDCM speed control system based on fuzzy controller optimized by genetic algorithm has higher speed control accuracy and can be applied to the motor control system for new energy vehicles. It has certain engineering application value.
Footnotes
Acknowledgments
This work was support by Major Scientific and Technological Achievements Conversion Project in Hebei Province (18042211Z) and Hebei Science and Technology Project (18212201D).
