When a vehicle is driving on a turning road or lane, a traditional fuel vehicle ensures that the wheels on both sides can rotate at different speeds through a mechanical differential between the left and right wheels. Although this meets the requirements of vehicle kinematics, it also increases the complexity of the shock absorption suspension system and reduces the efficiency of the system. The electric vehicle studied in this paper adopts an independent wheel drive mode, that is, each wheel has a direct drive motor. In this way, the two rear wheels of the vehicle can independently provide driving power and can independently distribute power according to the operating conditions. The electronic differential controller distributes the driving torque of the two wheels with the goal of equal adhesion coefficients of the two driving wheels, thereby minimizing the possibility of vehicle slippage. It has the advantages of flexible operation and stable operation, and is the main direction of future electric vehicle development. In addition to considering good stability, the design of the electric vehicle differential controller must also consider easy maintenance and upgrading at the industrial site. There are many inconveniences in reprogramming the CPU using traditional methods, so the controller system is designed using in-system programming (ISP technology).
2 Introduction to development mode and chip selection
The application system introduced in this paper adopts a new development mode (similar to the programmer development mode). Since the in-system programming (ISP) function of the chip is utilized, there is no need to move the chip. When designing the software, it is designed that once the code file is re-edited, it will be automatically downloaded to the chip and automatically reset to run, which is the real "what you program is what you get".
At present, many single-chip microcomputers support in-system programming. There are also many 8051 series single-chip microcomputers that support in-system programming, but most of them support programming the single-chip microcomputer through the serial port of the PC. There are four inconveniences in this way: first, it is inconvenient for the project itself to communicate with the PC serially; second, it is necessary to add a MAX232 level conversion chip; third, some chips need to enter the download mode according to specific steps, and the programming process requires manual intervention; fourth, some chips require the support of firmware (customized program). If the firmware is accidentally damaged, the chip's in-system programming function will also be lost.
After comparison, the ATmega16L produced by ATMEL is a relatively ideal chip. It integrates a large capacity memory and rich and powerful hardware interface circuits. It has all the performance and characteristics of the MEGE series of AVR high-end single-chip microcomputers, which is suitable for the development of this system.
Among AVR products, ATmega16L has outstanding features:
(1) High-performance, low-power 8bAVR microcontroller, advanced RISC reduced instruction set structure, can be programmed in the system through the SPI interface and is compatible with 8051.
(2) A large capacity of non-volatile program and data memory is integrated on the chip. 16KB Flash program memory, erasable life of up to 10,000 times; 512B EEPROM, erasable life of up to 100,000 times; support for in-circuit programming (ISP) and application programmable (IAP); programmable program encryption bit.
(3) Rich and powerful external interface performance. Four-channel PWM, can achieve any PWM pulse width modulation output within 16b, with adjustable phase and frequency, providing conditions for the realization of advanced motor control methods; 8-channel A/D conversion; 32 programmable I/O ports.
(4) Special microcontroller performance. Controllable power-on reset and programmable undervoltage detection circuit; there is an automatic erase cycle during serial programming, which can be downloaded in segments when debugging large programs to save time.
3 ATmega16 microcontroller in system programming mode
When the chip's RESET pin is grounded, the Flash program memory, EEPROM data memory, fuse bits and encryption lock bits can be programmed through the SPI bus interface [SCK, MOSI (input), MISO (output)]. When the RESET pin is low, a programming enable command must be sent before the programming/erase operation. In serial programming mode, the chip automatically inserts an erase cycle before byte programming. Therefore, unless the chip's code protection bit is programmed, it is not necessary to execute a full chip erase command before programming. The chip erase instruction changes every unit of the program and data memory to 0xFF. According to the different system clock sources, the serial programming clock SCK must be coordinated with the system clock. The minimum time of the low level and high level of SCK is defined as follows: Low: greater than 2 MCU clock cycles (fck<12MHz); High: greater than 2 MCU clock cycles (fck<12MHz).
4 Application of system programming technology in automotive electronic differential control
4.1 System composition
The entire vehicle control system is divided into two layers. The outer layer is the differential control layer. According to the speed collected from the DC motor, it is fed back to the CPU. After A/D conversion and CPU internal differential algorithm calculation, the ideal torque value Td is generated. The inner layer is the motor torque control layer. According to the current collected from the DC motor, it is fed back to the CPU. After A/D conversion and CPU internal PID algorithm adjustment, the actual control current Io is generated. The CPU calculates the PWM duty cycle by looking up the table. This signal is transmitted to the DC motor through the power conversion circuit. Once the motor power conversion circuit is found to have abnormal conditions such as overcurrent, overvoltage, and overtemperature, the protection circuit will promptly notify the CPU and make corresponding adjustments. The system operation status is displayed by the external status indicator. RS-485 output is used to communicate with other on-board electronic devices. The system block diagram is shown in Figure 1:
Figure 1 Structure diagram of automotive electronic differential control system [page]
Figure 2 Online download ISP hardware schematic
(1) Steps for serial programming of Atmega16L in system
● Connect an 8MHz crystal between XTAL1 and XTAL2; add power between VCC and GND, and set RST and SCK to low level at the same time.
● Wait for at least 20ms, and send the serial programming enable command through the MOSI pin.
● Flash is programmed by page, and one operation corresponds to one page programming. Send write/read/erase commands and data, with the high bit of serial data in front and the low bit in the back, and the data is locked at the rising edge of the clock.
● If the previous step is a write command, wait at least 4.5ms.
● Repeat steps ③ and ④ when necessary.
● Set the RESET pin to high level, and the chip starts to execute the program.
(2) Atmega16L serial programming command
The Atmega16L serial programming command table is shown in the attached table.
Appendix Atmega16L serial programming command
Note: a = high address, b = low address, H = 0 (low byte) / L (high byte), o = data output, i = data input, x = any
(3) Atmega16L serial programming timing diagram
Atmega16L serial programming timing diagram is shown in Figure 3:
Figure 3 Atmega16L serial programming timing diagram
The application of ISP technology has provided convenience for the development of automotive electronic differential control systems, the maintenance and upgrade process of industrial sites, and significantly reduced the system cost. This system abandons the previous mode of programming the microcontroller through the serial port of the PC, and instead uses the computer parallel port to connect with the microcontroller SPI port, which improves the data transmission speed and system reliability. (end)
Previous article:Design of reversing radar based on ultrasonic detection
Next article:Automobile electronic combination instrument based on single chip microcomputer
Recommended ReadingLatest update time:2024-11-16 19:40
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- The pain of vias, isn’t it just a window opened in the via, how can it cause a short circuit?
- About TAS5805M Stereo Class-D Amplifier
- 【GD32L233C-START Review】9. CRC Check
- Why is millimeter wave so important to 5G networks? How do 5G networks use millimeter wave?
- Problems with IC amplifiers
- [Flower carving DIY] Interesting and fun music visualization series of small projects (04) --- WS2812 strip light
- Bluetooth SoC
- CMD file analysis in CCS
- GD32E231 incense machine control board
- SPI interface oled screen driver based on pic18f25k22 microcontroller