The demand for energy saving and noise reduction in the transmission system of electric bicycle is increasing day by day. Compared with the traditional brushless DC motor driven by 120 degree square wave with two or two conductors, the permanent magnet synchronous motor driven by vector control has the advantages of low noise and low energy efficiency. On the premise of satisfying the basic functions, a set of low-cost controller hardware is designed, and the basic principles of seven-segment space vector pulse width modulation (SVPWM), single-resistance sampling stator current reconstruction and software implementation of basic functions of electric bicycle are described. Finally, the experimental platform based on STM32F031C6T6 is validated. The experimental results show that the vector control system improves the performance of the electric bicycle transmission system greatly, and has higher cost performance than the square wave controller. Nowadays, living air pollution is getting worse and worse. As a green vehicle, electric bicycle has the advantages of flexibility, lightness, zero emission, low price, and so on. It has a large quantity in our market and has a very broad prospect [1]. Up to now, brushless DC motors are mostly used in electric bicycle motors. This motor has simple control structure and low production cost, but its stator current and air gap flux are square wave or trapezoidal wave, which have the disadvantages of high torque ripple and poor silence effect [2?3]. With the increasing demand for electric bicycle transmission system, permanent magnet synchronous motor (PMSM) based on vector control has been applied to replace brushless DC motor (BLDCM) in recent years to overcome the above problems. The stator current and air gap flux of permanent magnet synchronous motor are close to sinusoidal wave. Torque ripple and noise can be significantly improved by using vector controller. This paper focuses on the seven-segment vector pulse width modulation (SVPWM) algorithm, the basic principle of single-resistance sampling current reconstruction, and designs a vector controller based on STM32F031C6T6 without additional cost. The electric bicycle controller system is shown in Figure 1. The controller can be divided into power supply circuit and control signal circuit. The power supply circuit includes 48 V battery power supply, switching power supply, driving circuit and inverting circuit. The control signal circuit includes the main control circuit based on STM32F031C6T6, bus current sampling and amplification circuit, Hall signal circuit, switch and brake signal circuit. In the control system of electric bicycle, the analog signal is transferred to the A/D input port of MCU, which is analyzed by MCU, and then the speed is controlled. The analog signals such as brake and boost are directly converted to high and low levels and transmitted to MCU for analysis. The current sampling circuit is connected to the A/D input port of the main control chip, and the sampling point is set to collect the current according to the real-time rotor position. Each time the Hall signal changes represents the 60 degree electric angle of the rotor. MCU estimates the speed and acceleration through Hall feedback information and calculates the real-time position of the rotor. Vector control algorithm is loaded according to the real-time current and rotor position to realize the vector operation of the motor. The ultimate goal of vector control is to decouple the torque and excitation components of the stator current to realize the independent control of the motor’s torque and flux by imitating the DC motor. But the way of choosing the reference value of stator current under different control objects is different [6?8]. Aiming at the characteristics of meter-mounted hub motor for electric bicycle, Id= 0 control method is adopted to simplify the control strategy.
The electromagnetic torque of ideal permanent magnet synchronous motor is mainly composed of three parts: permanent magnet flux and quadrature axis current produce torque T1, straight axis flux and quadrature axis current produce torque T2, quadrature axis flux and quadrature axis current produce torque T3. The combined electromagnetic torque of these three parts is Te, which can be expressed as follows: From the above formula, the electromagnetic torque of the express hub motor is direct. Accept current control, so adopting = 0 control can simplify the control strategy. The speed is estimated according to the change of Hall signal. The estimated speed signal is compared with the given speed signal. The reference value of stator current q axis is calculated by PI controller, and the reference value of d axis is set to 0. The collected stator currents Ia, Ib and Ic are equivalent to the current Ia and Ibeta in two-phase static coordinate system by Clark transformation, thermostatic element and then the DC currents Id and Iq in rotating coordinate system by Park transformation. Ia is equivalent to the excitation current of DC motor and Iq is equivalent to the torque current of DC motor. Next, by comparing with their reference values, the control variables Ua and Uq can be obtained through PI regulator. These two control variables are transformed into Ua and Ubeta by Park inverse transformation. Finally, the required vectors are synthesized according to the synthesis method of SVPWM to achieve the purpose of vector control. The vector control block diagram is shown in Figure 2. The hardware of vector controller includes power supply and signal control. Current sampling in signal control part and power tube driving in power supply part are the core parts of vector control. Current sampling generally includes three methods: current sensor sampling, single resistance sampling and three resistance sampling. Among them, the cost of current sensor is too high to meet the cost requirement. Three resistance sampling method needs to add three sampling resistors in the circuit to make the hardware design more complex. Considering the single resistance sampling method, the cost can be controlled and the design can be simplified. Considering the cost factor, the driving part of the power transistor is constructed by separating devices. The current sampling and power transistor drive circuit diagram is shown in Figure 3. Sampling resistance will affect the system balance and circuit efficiency, so the size of the selected sampling resistance should be controlled at milliohm level, with over-current capacity of dozens of amperes. The change of voltage at the zero point of the input end of the operational amplifier can be caused by the change of current, and the A/D input can be completed with the amplifier circuit. Current sampling in vector controller is realized by parallel connection of two 5 m_constantan wires. It is a resistance alloy composed of copper and nickel. It has low temperature coefficient, wide working temperature range, simple production and processing. It can adjust the welding length to adjust the resistance value during welding. Low-speed operational amplifier can no longer meet the current sampling requirements of vector control, so the average current and phase current are sampled by rail-to-rail high-speed operational amplifier packaged with SGM8632 and SOP?8. Because the sampling voltage at the input end of the operational amplifier may overflow, the sampling value is offset by voltage rise through R79, R48 and R36, R69 to ensure the sampling efficiency. U3A amplifies the sampling value by 8.78 times and passes it to the A/D port of MCU to control the average current. U3B removes the RC filter circuit at the input end and increases the amplification factor to 22 times for real-time acquisition. Sample phase current. In order to meet the cost requirement, the drive part is constructed with separate devices. Take W phase as an example, when Q17 of upper arm input low-level transistor is turned on, Q2 is turned on after Q17 is turned on, and V7 of MOS is turned on through D14, D4, R98 and R10. On the contrary, when Q17 of upper arm input high-level is turned off, Q2 is also turned off, and the energy stored in C15 is released and V7 is turned off. The W-phase lower arm drive adopts a fully symmetrical structure with the upper arm to open and close the MOS transistor.
SVPWM is a pulse width modulation wave generated by a specific switching mode consisting of six power switching elements of three-phase power inverters, which can make the output current waveform as close as possible to the ideal sinusoidal wavefront. Space voltage vector PWM is different from traditional sinusoidal PWM. It is based on the overall effect of three-phase output voltage. It focuses on how to obtain ideal circular flux trajectory. Compared with SPWM technology, the harmonic component of winding current waveform is smaller, the motor torque ripple is smaller, the rotating magnetic field is closer to circular, and the utilization ratio of DC bus voltage is higher. Six switches of three-phase inverter bridge can generate eight different basic voltage vectors according to different on-state. Seven-segment SVPWM algorithm can be obtained by different combinations of two adjacent non-zero vectors and zero vectors in the applied time when the voltage vector rotates to a region at a certain time. The action time of two non-zero vectors and two zero vectors is applied several times in a sampling period, so that the action time of four voltage vectors is controlled and the voltage space vector is rotated close to the circular trajectory.
According to the inverter circuit in Figure 1, six VT1-VT6 switches are divided into eight voltage vectors, which can be expressed as U0, U1, U2, U3, U4, U5, U6, U7 respectively. Among them, U0 and U7 are zero vectors and do not produce torque output. The equivalent reference flux circle of PWM can be obtained by tracing the ideal flux circle of the stator when the three-phase symmetric sinusoidal wave power supply is supplied by the actual flux linkage formed by eight different working vectors. As shown in Figure 4, the whole space is divided into six sectors. Firstly, the sector number of the current rotor is determined based on Hall feedback information. The duty cycle of each modulation wave can be obtained by formula (6)~formula (10). In order to reduce the switching loss, only one phase of the state is changed during each switching state transition, and the time of zero vector is equally allocated to make the generated PWM symmetrical, thus effectively reducing the harmonic component of the PWM. Still take sector I as an example, the sequence of basic vectors switching is: U0, U1, U2, U7, U2, U1, U0, which guarantees that each vector switching only changes one phase of switching state. It is the best way to achieve seven-stage SVPWM. The three-phase PWM load value is shown in Figure 5. Seven-segment SVPWM has six switching times in each cycle. The output waveform of PWM is completely symmetrical, which can suppress harmonics well, reduce motor torque ripple and improve bus voltage utilization. The relationship between phase current and bus current needs to be determined according to the switching state and the corresponding conducting phase of the power transistor. For different voltage space vectors, the corresponding relationship between phase current and DC bus current is shown in Table 1. Table 1 illustrates the corresponding relationship between bus current and phase current. Sampling is done at the middle point of the corresponding switch state. As shown in Figure 5, Ishunt line collects two current values Ia and -Ic at the midpoint of U1 and U2, respectively. This method can realize the normal sampling and reconstruction of current at most locations as long as the window opening time is long enough. In adjacent space vector boundaries or low modulation ratio states, the windowing time can not be satisfied, so it is necessary to realize the normal sampling and reconstruction of phase current by inserting effective vectors. Taking the boundary of the first and second sector space vectors as an example, the duty cycle of the PWM with two arms is almost the same.
As shown in Figure 6, only one phase current-Ic can be sampled in one switching cycle, and current reconstruction can not be completed. Therefore, it is necessary to insert an effective vector in the boundary region to complete another phase current sampling. As shown in Figure 6, an effective vector is inserted in U7 to satisfy the sampling time and keep the whole duty cycle unchanged. After inserting the vector, there is enough window opening time to collect current-Ia.
This method has little influence on the whole system and can realize the current acquisition and reconstruction of the rotor in the boundary or low modulation ratio region. Based on the above modulation algorithm and hardware design, a platform with STM32F031C6T6 as the core is built for experiment. The selected test motor data are as follows: rated voltage 48 V, rated output power 500 W, rated speed 460 r/min, MOS transistor ST100N8, 80 V, on-state current 70 A at 100 C, and discrete device for driver. The physical object is shown in Figure 7. When changing the given value of the turning handle, the speed of the motor can be observed to change with the change of the motor load. The motor speed keeps constant. The current waveforms under two loads can be observed, as shown in Fig. 8a and Fig. 8C. Meanwhile, the current waveforms of the square wave controller under two loads can be measured as shown in Fig. 8b and Fig. 8d.) It can be seen that the current waveform and torque ripple of vector control system have been greatly improved. The noise parameters of the two controllers at 400 r/min are measured by decibel meter. The noise peak value of the vector controller is 53 dB, the average value is 49 dB, the noise peak value of the square wave controller is 65 dB and the average value is 59 dB. It is known that the vector control system also improves the noise greatly. According to the need of upgrading the transmission system of electric bicycle, a low cost vector control system for permanent magnet synchronous motor (PMSM) is designed based on STM32F031C6T6. Firstly, the overall framework of vector system is introduced, and then the core is introduced.