With the pollution of the environment and the shortage of energy, electric bicycles are more and more popular with the advantages of no exhaust gas pollution, no noise, and the use of electric energy and convenient use. They have become a means of transport in life. This article describes a brushless DC motor speed control system designed using a high-speed SoC C8051F313 microcontroller from the American company SILICon laboratories (Silabs). The system makes full use of the on-chip resources of the C8051F313. The circuit of the design scheme is simple, the required external components are small, the overall cost of the controller is low, and the performance is good.

C8051F313

C8051F313 belongs to Silabs' high-speed SOC type single-chip microcomputer C8051F series. The C8051F series microcontrollers are highly integrated, fully compatible with the traditional 8051 microcontroller core and instruction system, but its performance in all aspects far exceeds the traditional 8051 microcontroller. Due to the "pipelined" architecture for processing instructions, 70% of the instruction execution time is 1 or 2 system clocks, which breaks through the weaknesses of the traditional 8051 microcontroller's low operating efficiency, especially as it executes multiplication instructions as long as 4 system clocks. The execution of the divide instruction requires only 8 system clocks. In addition, the C8051F series microcontrollers integrate a wealth of peripherals on the chip, greatly reducing the demand for peripheral components: analog multiplexer, programmable gain amplifier, ADC, DAC, voltage comparator, voltage reference, temperature sensor, SMBus ( I2C), Enhanced UART, SPI, Programmable Count/Timer Array (PCA), Power Monitor, Watchdog Timer (WDT), Clock Oscillator, etc. There is also on-chip FLASH program memory, RAM, and XRAM. In programming languages, assembly and C programming are supported.

System hardware design

The entire control system mainly includes a rotor position detection circuit, a speed measurement circuit, a speed control circuit, a MOSFET full bridge drive circuit, and a current limiting circuit. FIG. 1 is a block diagram of a control system. DC power supply through the MOSFET circuit to the motor stator windings; rotor position detection circuit detects the position of the rotor, and according to the position of the rotor signal to control the MOSFET turn-on and turn-off, in order to achieve electronic commutation; speed circuit detection motor speed, speed The circuit dynamically adjusts the motor speed (speed regulation) based on the test results of the speed measurement circuit. The design can be designed for 60o or 120o electrical angle commutation as needed.

Detection of Rotor Position of Brushless DC Motor Based on C8051F313

Rotor position detection circuit and speed measuring circuit

The brushless DC motor in this design is a three-phase brushless DC motor, and the space spacing of three Hall position sensors is 120o. The three Hall sensor outputs H1, H2, and H3 are directly connected to the three capture/compare modules of the PCA (programmable counter/timer array) of the C8051F313: CEX0, CEX1, and CEX2. The capture/compare module can capture the rising and falling edges of the Hall signal and generate an interrupt. This method of detecting the rotor position of a brushless motor is more advantageous than the method using A/D conversion or using a comparator. The peripheral circuit is simple, almost no external components are required, and the real-time performance is very high. The Hall signal can be captured reliably and quickly. A timer is also used to time the interrupt interval. This time reflects the rotation speed of the motor. The software can process the rotation speed of the motor through a certain algorithm. The motor speed obtained by this method more truly reflects the actual speed of the motor.

MOSFET full-bridge drive circuit

This part of the circuit actually completes the motor commutation drive and speed control functions. C8051F313 based on the rotor position detection circuit detection results, brushless DC motor real-time commutation drive, while speed detection circuit detects the speed of the brushless DC motor speed control. This design adopts PWM method to control the armature voltage and achieve speed regulation.

Detection of Rotor Position of Brushless DC Motor Based on C8051F313

Ua in Fig. 2 is the voltage across the armature of the brushless DC motor. The period of the PWM is T (is a fixed value). Changing the duty cycle of the PWM, ie changing the time of T1, then the ends of the armature of the brushless DC motor The average voltage changes, the motor speed has changed, and the purpose of speed control has been achieved. Ua's formula is:

Ua = (T1/(T1 + T2))&TImes; Ud

This is the formula for the PWM speed regulation of the armature voltage of the brushless DC motor. By applying power to the DC brushless motor in the reverse order, the reversal of the brushless DC motor can be used.

In this design, a capture/compare module CEX3 of the PCA (Programmable Counter/Timer Array) of the C8051F313 is used to generate PWM, and according to the actual needs of commutation and speed regulation, the Crossbar (digital crossbar) dynamically PWM PWM wavelengths are sent to the three lower tubes of the MOSFET full bridge for speed regulation.

software design

Because C8051F313 is compatible with the traditional 8051 microcontroller, the assembly instructions are the same as the traditional 8051 microcontroller instruction, and at the same time support the most widely used domestic Keil C simulation software. As long as there are 51 microcontroller programming experience or used Keil C people, you can easily The C8051F313's programming work, without having to invest a lot of time in advance to learn.

This design uses C language programming, program portability. The program flow chart shown in Figure 3.

Detection of Rotor Position of Brushless DC Motor Based on C8051F313

Conclusion

This design makes full use of the on-chip resources of C8051F313, especially the resources of PCA. The use of PCA's 3 capture/compare modules intelligently realizes the detection of the rotor position of a brushless DC motor; a capture/compare module generates a PWM wave that is dynamically distributed to the three lower tubes of the MOSFET bridge in real time for speed regulation, as well as realizing Accurate measurement of the speed of the brushless DC motor. The entire system has strong real-time performance, high reliability, and good performance. Because C8051F series one-chip computer has integrated abundant peripherals on the slice, have reduced the demand for the peripheral component greatly, the overall system cost is relatively low.

Armor Phone Case

Armor Phone Case,Back Cover Phone Case For Iphone,Phone Case For Tecno For Ifinix,Shockproof Tpu Phone Case

Guangzhou Jiaqi International Trade Co., Ltd , https://www.make-case.com

Posted on