Engine electronic ignition system based on MC9S12 chip
[Copy link]
[Abstract] This paper introduces the structure, characteristics and advantages of Motorola's 16-bit MCU MC9S12DP256 compared with other MCUs. Through the actual application in a three-cylinder gasoline engine ECU that we participated in developing, this paper introduces the application method of MC9S12 series chips in control systems. [Keywords] MC9S12DP256, engine electronic control unit (ECU), electronic ignition The MC9S12 series is a high-performance 16-bit microcontroller (MCU) developed by MOTOROLA. It has rich input and output interface functions, strong numerical and logical computing capabilities, and especially strong timing control functions, making it suitable for applications in complex timing control technology. The characteristics of the MC9S12DP256 make it suitable for the gasoline engine electronic control unit ECU we developed. 1. System structure of MC9S12DP256: MC9S12DP256 microcontroller is a mid-range chip based on 16-bit HCS12 CPU and 0.25μm microelectronic technology, high-speed, high-performance 5.0V FLASH memory products. Its high performance-price ratio makes it very suitable for some mid-to-high-end automotive electronic control systems. At the same time, its simple background development mode (BDM) will further reduce development costs, and also make on-site development and system upgrades more convenient. The main frequency of MC9S12DP256 is as high as 25MHz. At the same time, many standard modules are integrated on the chip, including 2 asynchronous serial communication ports SCI, 3 synchronous serial communication ports SPI, 8-channel input capture/output compare timer, 2 10-bit 8-channel A/D conversion modules, 1 8-channel pulse width modulation module, 49 independent digital I/O ports (20 of which have external interrupt and wake-up functions), 5 CAN modules compatible with CAN2.0A/B protocol and an internal IC bus module; the chip has 256kB Flash EEPROM, 12kB RAM and 4kB EEPROM①.
2. Functional features of MC9S12DP256: MC9S series microcontrollers have three main features: 1. 256kB flash memory (Flash) is integrated on the chip. The main advantages of Flash are simple structure, high integration density and low cost. After the system is powered off, the content in Flash can still remain unchanged reliably. 2. The application of phase-locked loop technology improves the electromagnetic compatibility of the system. When an external crystal oscillator of tens of kilohertz is connected, a system clock of several megahertz can be generated through software programming, thereby reducing external radiation interference and improving system stability. 3. The simple background development mode (BDM) further reduces the development cost and makes on-site development and system upgrades more convenient. In addition, although it has a 16-bit bus structure, the external bus of MC9S12 can work in 8-bit and 16-bit modes according to different system requirements, so it can greatly adapt to system requirements at different prices. 3. Application of MC9S12DP256 in ECU electronic ignition: 1. Introduction to microcomputer-controlled electronic ignition system: In addition to the advantages of ordinary electronic ignition systems, the most important features of gasoline engine microcomputer-controlled electronic ignition system are: it can provide the required ignition voltage and ignition duration at a fixed value within various speed ranges; it can provide the best ignition front angle under different load and speed conditions; it can advance the ignition time to the range where the gasoline engine just does not have knocking; it saves more fuel and has less exhaust pollution than ordinary electronic ignition systems. ② From the beginning to the end of high-voltage electric ignition, the angle of the engine crankshaft is dynamically controlled by the ECU according to the pre-set program, according to the engine speed and power supply voltage, so that the engine can obtain a fixed ignition voltage and ignition duration under various speed conditions. The microcomputer-controlled electronic ignition system controls the ignition advance angle of the engine under different working conditions as follows: A Starting condition In the starting condition, the ECU cannot correctly set the ignition advance angle due to the large change in engine speed. Therefore, the ECU corrects the original ignition advance angle according to the water temperature and speed signals provided by the engine water temperature sensor and the speed sensor. B Idle condition The idle basic ignition advance angle is determined according to the engine speed and water temperature and stored in the memory of the ECU. In the idle condition, the ECU selects the idle basic ignition advance angle in the memory and corrects the idle basic ignition advance angle according to the engine speed and water temperature signals provided by the engine speed sensor and the water temperature sensor. C Normal driving condition (large, medium and small load conditions) After leaving the idle, the engine begins to enter the normal driving condition. In this condition: ignition advance angle = F (basic ignition advance angle, water temperature correction coefficient). Among them, the basic ignition advance angle is determined by experiment based on the engine speed and load; the water temperature correction coefficient is determined by experiment based on the engine temperature. The basic ignition advance angle and water temperature correction coefficient are stored in the ECU's memory respectively. 2. Hardware structure design: The MC9S12DP256 microcontroller uses a high-performance 16-bit processor HCS12, which can provide a rich instruction system and has strong numerical and logical operation capabilities; its internal 256K bytes of FLASH memory has online programming capabilities, and 4K bytes of EEPROM and 12K bytes of RAM can store various control parameters. The low-power crystal oscillator, reset control, watchdog and real-time interrupt configurations and functions of the MC9S12DP256 are more conducive to the reliable operation of the electronic ignition system. Figure 1 Electronic ignition control block diagram
(1) ECU input signal A top dead center reference position signal: its period corresponds to a crankshaft angle of 240 degrees corresponding to the working interval of each cylinder of the engine, and the corresponding crankshaft position has a certain angle with the top dead center position of each group of pistons. B engine crankshaft speed signal: each pulse of the engine crankshaft speed signal indicates that the engine crankshaft rotates a fixed angle. The system uses a 60-tooth crankshaft, so the signal period is the time corresponding to the shaft rotating 6 degrees. (2) ECU output signal A ignition control signal: in fact, it is the on-off control signal of the power transistor in the igniter. It is the ignition command signal output by the ECU to the ignition component, and it is also the reference signal for the ignition component to calculate the closing angle. After the signal is output, the signal disappears when the piston position reaches the optimal ignition time memorized in the memory, that is, the ignition command is issued. B cylinder judgment signal: multiple top dead center reference position signals will be generated for each rotation of the crankshaft, and the corresponding relationship between each top dead center reference position signal and the ignition cylinder should be fixed and unchanged. The top dead center reference position signal alone cannot determine the specific ignition cylinder, so a cylinder judgment signal is added to the ECU output signal to determine the cylinder that needs to be ignited together with the top dead center reference position signal. 3. Software design: The control of the ignition sequence is based on the engine crankshaft position signal. Each time the camshaft rotates one circle, three pulse signals are generated. According to the engine ignition sequence, they are evenly arranged in the order of cylinder numbers 1, 3, and 2. The timing diagram is as follows: Figure 2 Ignition timing diagram MCU uses the cooperation of the timer input capture and output comparison functions, and adopts the delay counting method to control the power on and off timing of the primary circuit of the ignition coil. The rising edge of each cylinder reference signal triggers an interrupt through the MCU input capture timer channel, and this interrupt signal is used as the start of a control cycle and the reference for ignition timing control. The time between each adjacent reference signal is taken as a control cycle (corresponding to a crankshaft rotation angle of 240°). The control cycle time is equal to the product of the clock cycle of the main counter and the count value difference between the two references. The former is a constant preset by the MCU, recorded as TC; the latter can be measured through the input capture channel, recorded as NG. If the ignition advance angle is θ at this time, then when the reference signal appears, the cylinder should be ignited as long as (40°-θ) passes. This angle is called the ignition delay angle, and the corresponding time is called the ignition delay. The corresponding counter count value Nd. can be calculated according to NG. The value is as follows: The ignition control program consists of multiple modules such as the main program and the interrupt service subroutine. The main function of the main program is to determine the optimal ignition advance angle and the primary circuit conduction time through logical operations according to the engine operating conditions; the interrupt service subroutine is responsible for the collection and processing of the system input signal, and the input capture and output comparison interrupt programs are the key to realizing the ignition timing control. After the ECU is powered on, the main program first performs the initialization operation of the MCU, sets the timer counting cycle, each input and output function and each interrupt. After the initialization is completed, the main program enters the loop running state, waits for each interrupt service program to occur, detects each input parameter, and performs fault query and processing. If the system state is normal, the optimal ignition advance angle and primary circuit conduction time are determined according to the engine operating conditions. Since the ignition timing of each cylinder is adjusted by program control, it is necessary to establish an ignition map inside the CPU. In this way, the ignition advance angle can be obtained by checking the ignition map according to the engine load and speed signal, and can be corrected according to different working conditions. In this way, the engine can provide the best ignition timing under any working condition. Figure 3 Electronic ignition control flow chart
4. Summary: The engine high-energy direct ignition system with MC9S12DP256 microcontroller as the core can achieve the optimal adjustment of ignition timing according to engine working conditions. On the other hand, the enhanced capture timer of MCU can be used to realize independent channel control of ignition of three-cylinder engine. Moreover, the input capture and output comparison functions are combined to meet the complex timing control requirements of the primary circuit of three ignition coils. The test results show that reliable ignition can be obtained under various speed conditions within its working range without misfire. References: 1. MC9S12DP256 Software Development Using Metrowerks Codewarrior, Motorola Inc.USA 2. "Engine Electronic Gasoline Injection System and Its Maintenance Technology" edited by Li Dongjiang and Song Liangyu; Machinery Industry Press, 1998; Chinese Library Classification Number U464.136; ISBN Number 7-111-06017-2
|