With the continuous improvement of people's living standards and environmental awareness, new electric vehicles with the concept of "greening" development will be popular all over the world, and electric motorcycles will surely become one of the main means of transportation for humans. As a green and environmentally friendly vehicle, electric motorcycles using brushless DC motors have the advantages of simple operation, comfortable riding, convenient maintenance, low pollution and low noise.
The PIC series of microcontrollers are high-performance and cost-effective 8-bit embedded controllers (Embedded Controller) that use reduced instruction set RISC technology, Harvard bus and two-level instruction pipeline structure. The electric motorcycle control system studied here is a system with PIC16F737 microcontroller as the core and brushless DC motor as the control object.
1 Implementation of the control system
The principle block diagram of the control system is shown in Figure 1.
Main components:
1) Main control module: It is composed of PIC16F737 microcontroller, +5 V power supply and peripheral auxiliary circuits.
2) Input circuit: It is composed of position signal detection, current signal detection circuit, and handlebar brake signal acquisition circuit.
3) Output circuit: It is composed of drive circuit and inverter circuit with IR2110 as the core.
4) Protection circuit: It is composed of overcurrent protection circuit, overvoltage protection circuit and alarm circuit.
Working principle: The microcontroller, as the control core, processes the position detection and current detection signals and outputs the corresponding PWM wave through the driver chip to drive 6 power field effect transistors. The three-phase full-bridge drive circuit composed of it controls the motor, so the motor can be controlled by three closed loops of position loop, speed loop and current loop. When the brake signal appears or the motor is blocked and the current exceeds the limit, the microcontroller immediately cuts off the inverter circuit; when the battery voltage is lower than the setting, the motor drive circuit is automatically cut off to prevent the battery from being over-discharged and damaged.
1.1 System hardware design
1) The external interface circuit of the microcontroller of the main control module is shown in Figure 2. It mainly includes: current sampling, including instantaneous current sampling signal input connected to RA0 port, and average current sampling signal input connected to RA1 port; overcurrent protection interrupt request connected to RB0 port of the microcontroller; battery power detection signal connected to RB1 port, the acquisition voltage corresponding to 48 V voltage is 2.66 V, and the corresponding acquisition voltage is 2.1 V when it is lower than 40 V, and protection is required at this time; the throttle speed regulation analog input is connected to RB3 port, and the brake handle analog input is connected to RA2 port; additional function inputs include alarm and cruise, and the inputs are connected to RA5 port and RB2 port respectively; the three Hall rotor position sensor inputs Ha, Hb, and Hc signals are connected to RB7 port, RB6 port, and RB5 port respectively; the power switch tube drive output in the inverter circuit realizes electronic commutation and stepless speed regulation of the brushless motor.
2) Input circuit
① The Hall signal input
rotor position detection circuit has two functions in the system: detecting the relative position of the motor stator and rotor to provide the correct commutation signal for the inverter circuit; detecting the number of Hall pulse signals in a certain channel, calculating and converting them into speed signals to form a speed feedback link. The position signal sampling of this system is detected by the Hall element of the brushless DC motor itself. Since the Hall element is an open collector output, its output signal is passed through the pull-up resistor to obtain a position square wave signal, and then sent to the pins of the microcontroller (U2-29, U2-30, U2-31) through the isolation circuit to capture the position signal, as shown in Figure 3.
②Current detection circuit
This current detection circuit is composed of two LM358 operational amplifiers, as shown in Figure 4. One of them constitutes a voltage comparator, which compares the detected current signal with the known voltage to obtain an overcurrent output signal. When the overcurrent occurs, the comparator flips to trigger the microcontroller interrupt, and the power switch tube is turned off in time to form a protection circuit. The internal current loop current is obtained through another in-phase proportional amplifier circuit composed of an LM358 operational amplifier, and after amplification, it is converted into a voltage signal proportional to the current and sent to the PA2 port of the microcontroller. [page]
3) Output circuit
① Inverter circuit design
The motor rotation is controlled by the position of the motor rotor sensed by the Hall sensor, which determines the order of opening or closing the power transistors in the inverter. As shown in Figure 5, AH, BH, CH (upper arm power transistors) and AL, BL, CL (lower arm power transistors) in the inverter make the current flow through the motor coil in sequence, generating a forward or reverse rotating magnetic field, and interacting with the magnetic field generated by the rotor magnet to make the motor rotate forward or reverse. When the motor rotor rotates to the position where the Hall sensor senses another set of signals, the control part turns on the next set of power transistors again, and the motor can rotate in this cycle.
②IR2110 drive circuit
The IR2110 chip is a dual-channel, gate-driven, high-voltage and high-speed power device monolithic integrated drive module. As shown in Figure 6, it is a brushless DC motor drive circuit schematic (single bridge arm) composed of IR2110. This drive circuit uses a three-phase full-bridge inverter circuit composed of 6 N-channel MOSFET tubes with 3 IR2110 as the center. The upper bridge arm adopts PWM modulation control; the lower bridge arm adopts a fixed angle control method, thereby driving the brushless DC motor.
1.2 System software design
Software design is the core part of the entire control system design. It will directly determine the control quality and efficiency of the entire control system, and determine the characteristics of the system output signal, including current size and stability, harmonic content, protection function perfection, reliability, etc. The PIC chip is programmed and simulated in its special software development environment Mplab, which brings great convenience to developers in designing and debugging programs. The focus of the system software design is the main program and interrupt service program. The flow chart is shown in Figure 7. The main program realizes the initialization of various variables and chips, and the selection of two working modes: cruise mode and non-cruise mode; the interrupt service program includes over-current and under-voltage interrupt subroutines, A/D conversion interrupt service subroutines, and brake interrupt subroutines.
2 Conclusion The control system based on PIC16F737 designed in
the language has the characteristics of simple hardware structure, perfect protection function, modular software design, easy secondary development by users, strong system reliability, convenient debugging, etc. The innovation of this article is to realize the selection of two working modes of motor speed regulation and fixed speed, and realize the undervoltage protection and overcurrent protection of the system from two aspects of software and hardware. In actual application, the whole system starts smoothly, has strong load capacity, can realize fast and accurate speed regulation, and runs well on site.
Previous article:PIC microcontroller read/modify/write problems and solutions
Next article:Design of PIC16C72 single chip microcomputer in water level and temperature controller of solar water heater
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- CC2652LP driving Δ∑ ADC - ADS1261
- How to calculate the current after the voltage is stepped down by the Zener diode?
- EMC Compliant Single-Chip Resolver-to-Digital Converter (RDC) Reference Design
- TI C6000 Data Storage Processing and Performance Optimization
- Six tips for PCB layout design to make drawing easier!
- [Sipeed LicheeRV 86 Panel Review] 9- Flashing LED
- Watch the video to win a JD card | Highlights of Micron's keynote at Computex Taipei 2022
- Are there any step-down chips with lower quiescent current?
- Smallest BOM for Bluetooth Low Energy using STM32WB wireless MCU
- 0~500V DC voltage acquisition, is the circuit diagram in the post feasible?