Simulation of cam crankshaft speed based on C8051F310 single pump control system

Foreword

In the design and testing of the unit pump common rail diesel engine ECU, it is essential to excite the camshaft (or crankshaft) speed signal. Instead of using an actual engine, a speed sensor can be replaced to generate and output the required frequency signal. However, the speed signal is not standardized—its phase, number of cylinders, and amplitude vary significantly, making it impossible to use off-the-shelf products. While dSPACE simulation can be useful for generating the camshaft speed signal, it requires a large instrument, a computer for display, and is both expensive and inconvenient to operate. Therefore, developing a compact, portable, and cost-effective diesel engine speed generator is highly necessary. The camshaft speed sensor typically outputs a square wave from a Hall effect sensor or a sine wave from a magnetic sensor. Regardless of the input type, the CPU’s front-end processing circuit can convert it into a square wave that the CPU can recognize. Hence, designing the system to output a versatile square wave signal is practical and efficient. The ECU is usually powered by 12V or 24V, so the power supply circuit is designed to accept 12–24V input. The C8051F310 microcontroller was selected due to its built-in timer, ADC, and sufficient I/O ports to meet system requirements. The speed signal is designed to be continuously adjustable, allowing simulation of various operating conditions such as starting, idling, and speed control. To support developers during testing, the device includes a character LCD module to display engine speed and toothed disc information. Since the amount of displayed data is limited, a cost-effective LCM1602 module was chosen. Additionally, the system stores different toothed disc structures in memory, enabling users to select the desired configuration and output the corresponding waveform, making the device suitable for various ECU software development tasks.

Hardware Design

The hardware architecture of the camshaft speed simulation device is shown in Figure 1. It consists of a microcontroller system, a liquid crystal display (LCD) circuit, a speed reference circuit, a parameter storage circuit, and a power supply circuit. The C8051F310 serves as the central processing unit. It features an internal watchdog for power-on reset and program monitoring. The device is powered by a 12–24V DC supply and uses two-stage voltage regulation to produce 5V and 3.3V power supplies. An IO port expansion button on the CPU allows selection of the gear plate structure serial number, which is stored in E2PROM. The speed reference potentiometer’s output is sampled by the CPU’s onboard ADC and converted into a digital signal proportional to the speed. Two IO ports are used to adjust the output frequency of the camshaft square wave signal. The LCM1602 character LCD module is used to display the rotation speed and the toothed disc structure, operating in an 8-bit bus mode. The housing is made from a standard plastic case with minor modifications.


Figure 1: System Hardware Structure Diagram

1. **C8051F310 Microcontroller** The high-performance embedded microcontroller C8051F310 was selected for its fast instruction execution, high integration, and support for online debugging. It includes 16KB FLASH memory, 25 I/O ports, four 16-bit timers, and a 10-bit ADC. Operating at 2.7–3.6V, it comes in a 32-pin LQFP package, making it ideal for small embedded systems. 2. **LCM1602 Liquid Crystal Display Circuit** The LCM1602 character LCD module is used for displaying parameters. It supports 5×7 dot matrix characters and a cursor, and uses an 8-bit data transmission mode. Data lines are extended via the P1 port, while P2.0 and P2.1 control read/write commands, and P2.2 selects the register. The LCD runs on 5V, while the CPU operates at 3.3V, requiring level conversion. P2.3 controls the backlight, which can be programmed to switch between light and dark modes. 3. **Power Circuit** The power supply is compatible with the 12V or 24V DC used by the ECU. It first regulates to 5V using LM7805 for the LCD and storage circuits, then further steps down to 3.3V using ASM1117-3.3V for the microcontroller and other circuits. 4. **Parameter Storage Circuit** The AT93C46 E2PROM is used to store parameters. P0.0 is used for serial input, P0.1 for serial output, P0.5 for the clock signal, and P0.6 for chip select. Memory allocation details are described in the software design section.

In-wall Shower Set

In-Wall Shower Set,Brass In-Wall Shower Set,Contemporary Brass Shower Set,High End Brass In-Wall Shower Set

Kaiping Rainparty Sanitary Ware Technology Co.,Ltd. , https://www.rpshower.com

Posted on