Development of Custom-made Engine Control Unit for a Research Engine Jeeva Ba*, Swapnil Awateb, Rajesh Jc, Arindrajit Chowdhuryd, Sreedhara Sheshadrie Department of Mechanical Engineering, Indian Institute of Technology Bombay, Email*:
[email protected], Ph: +917022359860. Abstract In this paper, hardware development, software coding using embedded C programming language for an Arduino ATMEGA microcontroller, calibration of electronic control unit (ECU) was tested for a research engine to control the fuel injection flow rate with respect to the suction top dead center (TDC) of the engine. The system could control the fuel flow rate with a variable reluctance sensor, an Arduino microcontroller and a solenoid operated injector in a closed loop domain with a varying pulse width modulator controlled exclusively by the engine operator. The injection flow rates were measured and calibrated with the calculated fuel flow rates for different equivalence ratios (Ø) of the engine. The results showed a very close match between the measured fuel flow rates after calibration and the calculated fuel flow rates at 1500 RPM. The gasoline mass flow rate error was reduced from 40% to 3.25% by compensating the ON/OFF time of the pulse width. Keywords: Pulse width modulation (PWM), Arduino microcontroller, variable reluctance sensor, solenoid operated injector, equivalence ratio (Ø).
I. Introduction and Background All modern automotive engines are controlled by an ECU. ECU calibration or tune-up significantly affects the engine performance, combustion and emission characteristics. Hosoda et al., [1] utilizing microcomputers, developed a universal control unit (UCU), a data acquisition unit (DAU) and an engine simulation unit (ESU) for an overall engine control development system. The system was versatile for testing hardware and software of engine control units. Yoshida et al., [2] worked on the programming of ECU by C programming language by using 16 bit proprietary microprocessor. Only the software architecture was defined by four layers, consisting of hardware definition layer, input/output layer, interrupt layer and application layer. The basic structure with generalized algorithm was only published. While the programming algorithm and ECU calibrations were not discussed. Glielmo et al., [3] proposed a hierarchical structure for the tasks of the electronic control unit comprising driver interpreter, engine controller and actuator controller for a single cylinder engine designed
978-1-4799-6986-9/14/$31.00©2014 IEEE
according to the IEC1499 international standard. Gonzalez et al., [4] developed a simulation design of an ECU for an Otto cycle engine with electronic fuel injection using Simulink and state flow modules of MATLAB software. ECU functions were developed for the following functions like spark advance control, pulse width modulator (PWM) depending on throttle plate angle and engine speeds, PWM depending on ambient air temperature, closed loop control based on exhaust gas oxygen sensor, and fault tolerance for EGR sensor failure, cooling fan failure and fuel stoppage in case of failure of speed and throttle sensors. Similarly Vijay et al., [5] simulated an ECU for controlling the vehicle speed by actuating electronic fuel injector and provided safety to the driver by avoiding the collision using infrared sensor and deployment of the air bags using micro electro mechanical system (MEMS) accelerometer in the case of emergency using adaptive cruise control (ACC) system. Surapa et al., [6] explored the use of explicitstate model checker [mc] square to verify and analyze the embedded software for piezo controlled carburetor (PCC) system to improve the quality of the ECU software. Vong et al., [7] implemented case based reasoning (CBR) for calibrating ECUs. With case based reasoning (CBR) and case based adaptation (CBA), the calibration of ECUs were enhanced with low cost and lesser time for calibration instead of traditional methods with trial error approach. Sarkar et al., [8] developed an electronic control system for varying the fuel injection timing and fuel flow rate for a port injected gasoline 3cylinder engine for a 4-wheeler . However, many of the details like controller details, algorithms, calibration were not discussed. The carburetted 3- cylinder engine was converted to a port injection engine with increase in thermal and volumetric efficiencies and decrease in HC and CO emissions. Manivannan et al., [9] developed an ECU using dSPACE micro auto box controller with Simulink as a graphical programming language for a 2wheeler engine. The 2-wheeler engine was converted from carburettor design to a single cylinder port injection engine design with reductions in CO, HC, specific fuel consumption and NOx. A. Motivation Port-injection HCCI engines are in the developmental stages from last two decades. These
research engines require an efficient yet simple engine control unit for operation in the homogeeneous charge compression ignition (HCCI) mode. Manny researchers [10-24] demonstrated port- injection HCC CI for different fuels like gasoline, diesel, di methoxy metthane (DMM), n-heptane, hydrogen, liquefied petroleum m gas (LPG), ethanol, di ethyl ether (DEE), iso -octane, aacetylene, pure bioethanol, wet ethanol, etc. From the literature surveyed, it is cclear that none of the studies published the entire devellopment of an ECU from the initial stages to the final coompletion. The previous researchers [10-24] who workked on portinjection HCCI engines did not explain thee ECU system in detail. Additionally, it was evident thhat researchers were working exclusively on softwaree architecture, hierarchical architecture of ECU, univversal control system development, ECU programming using C with microprocessor, simulation of ECU using state flow and Simulink modules of MATLAB sofftware, ECU development using dSPACE controllerr for engine application without focusing specially on aany algorithms and details of ECU hardware componennts. Hence an integration of all activities of developmentt of ECU for a simple control system is required for better understanding of the control system. Although port-injection gasoline engines with w decades, the ECU have been used extensively in the few understanding of the development activitties of engine control unit is still not clear for the researcch community. ECU’s are typically used as black boxes inn practice with no coding available for any modificationns for research activities. For research activities, one has tto test the fuel injection duration, injection timing for new w design of fuel injection system, at different process condditions for the engine. In such cases the ECU has to be redesigned so that the changes can be incorporated foor preliminary testing and calibration in a laboratory. Heence a flexible control unit is required for research enginess. These factors motivated us to work in the direction of developing an engine contrrol unit for a gasoline port-injected HCCI engine. B. Present work ment of an ECU The present work involves developm for varying the fuel flow rate by pulse widdth modulation achieved by an Arduino micro-controllerr and the fuel injection timing is triggered by the variaable reluctance sensor connected to the engine camshaft. II. Experimental set up The ECU was tested and calibrated ussing a variable reluctance sensor attached to the engine annd the resultant injection behavior was tested independentlyy of the engine at 1500 RPM. The ECU development comprises of hardware design with the sensor- injectorr interface and PCB drawings, software algorithm aand complete
program, as well as pulse width calculation methodology for the specific engine. w sensor, solenoidA. ECU hardware design with injector interfaces w a missing gear tooth The camshaft was provided with (50-1 toothed gear) to trigger th he initiation of injection. To sense the longer delay perio od, a variable reluctance (VR) sensor was in front of the to oothed gear used. Figure 1 shows the schematic view of th he hardware components with the arduino controller. The AC output of 1.2 V to 4 nverted to a DC signal V from the VR-sensor was con using a LM741 preamplifier. Th he DC signal output with positive and negative cycles is further filtered by a LM324 quad-operational amplifier. Only positive DC uad-operational amplifier signal output cycles from the qu are fed to the microcontroller. A reference voltage of 2.2 nt trimmer potentiometer V was set through the PCB moun (trim pot) as voltage divider. The Arduino microcontrolleer requires a 5V supply for operation which was provideed from a laptop through a USB port. The output signal from the Arduino o the Darlington driver microcontroller is processed to which is a current amplifier that acts as a solenoid driver or. The other terminal of for the solenoid-operated injecto the solenoid injector is supplied with 12 V power supply from a regulated DC power source. Based on the different on times of off timees for the injector for achieving different equivalen nce ratios of engine condition, the root mean squaree (RMS) voltage varies across the injector. Figure 2 show ws the screen shot of the circuit drawing for the hardwaare system using Eagle software.
Figure 1 ECU hardware design with w sensor interfaces.
The Synchronization of injection setting timing and the quantity of fuel injection was peerformed after detecting the longer delay period due to thee missing tooth and the fuel was injected at the suctionn TDC of the engine cycle using Embedded C program foor the Arduino micro-controller, the specifications for whhich are shown in Table 1.
Figure 2 Circuit drawing for the hardware system
ii. Algorithm for code A. Detect the highest time delay in the system and n delay period is higher inject the gasoline when than the regular delay y period between two successive gear teeth. B. The total injection cyclee duration is 80 ms hence pulse width modulation n is incorporated in the code with ON time of 5 ms and OFF time of 75 ms. iii. Program for the microcontrolller Figure 3 shows the flow wchart for the program. When the voltage is low (0V) and when i>25 in the flowchart (higher delay period), the flag is set to 1. After V) at the raising edge of detection of the high voltage (5V the pulse width modulation, the flag f is checked for flag=1 and then injection starts. Figuree 4 shows the complete embedded C language program for the microcontroller. mand in the Arduino The void set up ( ) comm microcontroller ensures the entire while loop operates ng the fuel from the continuously, therefore injectin solenoid injector.
Table 1 Arduino AT mega microcontroller speecification Sl. No 1 2 3
Description
Deetails
4 5
Microcontroller Operating Voltage Input Voltage (recommended) Input Voltage (limits) Digital I/O Pins
ATmegga328 5V 7-12V
6 7 8 9
Analog Input Pins DC Current per I/O Pin DC Current for 3.3V Pin Flash Memory
10 11
Static rom access memory (SRAM) Electrically Erasable Programmable Read-Only Memory EEPROM
2 KB (ATmeega328) 1 KB (ATmeega328)
12
Clock Speed
16 MH Hz
6-20V 14 (of which 6 providde PWM M output) 6 40 mA A 50 mA A 32 KB
m B. Software algorithm, flowchart program i. Objective of the coding DC with signal A. To inject gasoline at suction TD from VR sensor (i.e. to sense thee point in time with higher time delay in the misssing gear tooth when the engine is in operation). B. 80 ms is the duration cycle at 15000 RPM, hence after detection of gasoline injection the injection should be ON for 5 ms and OFF for 75 ms for achieving an equivalence ratio of 00.1. C. Only gasoline flow variation and fixed point of injection is to be considered.
Figure 3 Flow chart forr the program
C. Pulse width calculation meth hodology for the engine. The fuel-air equivalence ratio is defined by ‘Ø’ and was calculated using (1) Ø
A S
(1)
The stoichiometric fuel to air ratio for gasoline is 14.7. With the mass flow rate of air (ma) beingg 7.2 *10-3kg/s and simulating the calculations for differennt equivalence ratio (Ø), actual air-fuel ratio was obtained. By converting the mass flow rate of air and ffuel to suction strokes of the 4-stroke engine, mass flow rrate of the fuel was obtained in (kg/suction strokes). With the mass flow rate of fuel in kg/s and mass flow rate of fuuel (kg/suction strokes) the ON time of the injection timingg was obtained in milliseconds. With the 4-stroke engine ruunning at 1500 rpm, 80 ms is the total duration of a singlee cycle. Hence ON/OFF time values were simulated for ddifferent fuel– air equivalence ratio (Ø) based on this concept. The ON/OFF time must be implemented maanually in the program for obtaining required operatinng range with respect to Ø for the research engine.
A. VR sensor output characteristiics Figure 5 shows the AC C signal output of the variable reluctance sensor from the 50-1 toothed gear. 4 om the sensor for 1500 V AC voltage was detected fro RPM speed of the engine.
Figure 5 Variable reluctancce sensor output (Voltage Vs. tiime)
B. Synchronization of signal cond ditioned VR sensor signal output and PWM signal off the microcontroller From the VR signal output, the AC signal is converted to a square pulse signal which has several square pulses separated by equaal delays, with a longer delay period in the signal whicch signifies the missing gear tooth. The pulse width modu ulation is a square pulsed signal from the microcontroller. Both the signals needed to be synchronized to initiate thee injection of the fuel at suction TDC. Hence the synchro onization has to be done from the end point of zero leveel voltage (longer delay period) of the signal condition ned VR signal with the rising edge of the PWM signal. This synchronization is gram. Figure 6 shows the done by using flag=1 in the prog synchronized signal of the PWM M output (top side) and VR sensor signal (below).
Figure 4 Embedded program for ECU devellopment
III. Results and discussion Based on the developments of the ECU, the results section consists of VR seensor output characteristics, synchronization between pulse width modulations provided to injector and signal conditioned VR sensor output, and calibration of ECU.
Figure 6 synchronization of signal condittioned VR sensor and PWM of microcontroller (Voltage Vs. time)
Table 3 Calibrated gasoline flow raate (ON/OFF) calculation
C. Calibration of ECU Gasoline fuel flow rate was measureed by filling a graduated cylinder up to 10 ml with a consttant voltage of 12 V supplied by a DC power supply byy operating the engine with diesel fuel at 1500 RPM. Onnly the suction TDC point was sensed and flow rate w was measured outside the engine, while being operated iin diesel mode of operation. Table 2 shows the gasolinne flow rates injected through ECU with the measured vaalues deviating significantly from the calculated values. The deviation was more severe for increasing equivalencce ratio. Hence the ON/OFF time was corrected to reduuce the error. Table 3 shows the gasoline flow ratte with ECU calibration. Table 2 and Table 3 show the voltage value available at the injector vary with respecct to the pulse width modulation ON/OFF time whichh is a very significant factor for calibration of ECU. F Figure 7 shows the flow rates comparison of measuredd (Meas.) and calculated (Cal.) cases, for both caalibrated and uncalibrated scenarios. It is evident that the calibrated ment with the mass flow rates are in good agreem calculated mass flow rates.
Ø
ON/ OFF duration
Injector Voltage (V)
Ca al. flo ow (E E-6* kg g/s)
Meas. flow (E-6* kg/s)
Error (%)
0.1
5/75
0.31
37 7
35.8
3.25
0.2
11/69
0.87
73.9
71.8
2.90
0.3
16/64
1.29
111
110
0.65
0.4
22/58
1.8
14 48
152
-2.66
0.5
27/53
2.22
18 85
183
1.03
IV. Conclusion gn of an ECU developed The hardware -based desig in this work is able to achieve fuel flow variation with f constant air flow rate fixed fuel injection timing and for conditions. An Arduino ATMEG GA microcontroller was used for pulse width modulation. This portable system is applied for research purpose. Thee ECU was calibrated by compensating the ON/OFF tim me of the pulse width modulation at 1500 RPM of th he engine within 3.25% error margin. Acknowledgements The present research work is funded by nology (DST), India. Department of Science and Techn The Authors are grateful to Mr Katta K Sudheer and Mr. R. Arumuga Nainar for their supporrt. References 1.
2.
Figure 7 ECU calibration for gasoline mass fflow rate
3.
Table 2 Gasoline flow rates without ECU caalibration ON/ OFF duration
Injector voltage (V)
Cal. flow (E-6* kg/s)
Meaas. flow (E-6* kg//s)
Error (%)
0.1
3/77
0.21
37
25.3
31.42
0.2
6/74
0.45
73.9
45.6
38.33
0.3
9/71
0.70
111
64.9
41.41
0.4
12/68
0.98
148
85.4
42.24
0.5
15/65
1.25
185
1004
43.49
Ø
4.
5.
H. Hosoda, K. Ohtsuka and H. Sh himomura, “A Microcomputerbased system for electronic engin ne control unit development”, IEEE Transactions on Industrial Electronics, E Vol. IE-30, No. 2, May 1983, PP 96-102. M. Yoshida, O. Tada, and J. Haashime, “Programming of the engine control unit by the c language”, SAE paper No. SAE960047, 1996, PP 1-6. L. Glielmo, F. Vasca and C. Rosssi, “Architecture for electronic control unit tasks in automotive en ngine control”, Proceedings of 2000 IEEE International Symposium m on Computer-Aided Control System Design, Anchorage, Alaska, USA, September 25-27, 2000, PP 42-47. G. Gonzalez, J. A. Florez and S. Arab, “Development of the management strategies of the ECU U for an internal combustion engine computer simulation”, Mechanical Systems and Signal Processing Vol22, 2008, PP 1356–1373. E .V. Vijay , C .V .R. Rao , E. V. Kumar and G. N. Swamy, "Electronic control unit for an adap ptive cruise control system and engine management system in a vehicle using electronic fuel injection", 2010 IEEE Internation nal Conference on Emerging Trends in Robotics Communication n Technologies (INTERACT), INSPEC Accession Number: 11822 2592, Chennai, India, 3-5 Dec. 2010, PP 143-146.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
R. Surapa and S. Grobosch, “Model checking and Verification Method of Engine Control Units”, 2011 5th Malaysian Conference in Software Engineering (MySEC), 13-14 Dec, 2011, PP 183-188. Vong and P. Wong, “Case-based adaptation for automotive engine electronic control unit calibration”, Expert Systems with Applications Vol 37, 2010, PP 3184–3194. S. K. Sarkar, P.V. Manivannan and A. Ramesh, “An Electronically controlled system for parametric studies on fuel injection in an automotive gasoline engine”, SAE INDIA 0301002, Proceedings of the First National Conference on Automotive Infotronics, 2003. P .V. Manivannan, C. Paul and A. Ramesh, “Development of a system for control of air fuel ratio in a small two wheeler engine”, SAE paper No. 2008 - 28 – 0054, 2008, PP 375-381. T. W. Ryan III and T.J. Callahan, “Homogeneous charge compression ignition of diesel fuel”, SAE Paper No. 961160, PP 928-937. C.S. Lee, K.H. Lee and D. S. Kim, “Experimental and numerical study on the combustion characteristics of partially premixed charge compression ignition engine with dual fuel”, Fuel, Vol 82, 2003, PP 553–560. J. Fang, Z. Huang, X. Qiao, Y.Z. Hong and J. Song, “Study on a pre-mixed charge compression ignition engine by dimethoxymethane port injection” Proceedings of the Institution of Mechanical Engineers, Part D: Journal of Automobile Engineering, Vol 218, 2004, PP 549-555. D.S. Kim, M.Y. Kim and C.S. Lee, “Combustion and emission characteristics of partial homogeneous charge compression ignition engine”, Combustion Science and Technology, Vol 177:1, 2005, PP 107-125. K. Yeom, J. Jang and C. Bae, “Homogeneous charge compression ignition of LPG and gasoline using variable valve timing in an engine”, Fuel, Vol 86, 2007, PP 494–503. J.M.G. Antunes, R. Mikalsen and A.P. Roskilly, “An investigation of hydrogen-fuelled HCCI engine performance and operation”, International Journal of Hydrogen Energy, Vol 33, 2008, PP 5823–5828. J. Ma, X. Lu, L. Ji, Z. Huang, “An experimental study of HCCI-DI combustion emissions in a diesel engine with dual fuel”, International Journal of Thermal Sciences, Vol 47, 2008, PP 1235–1242. Ganesh, G. Nagarajan and M.M. Ibrahim, “Study of performance, combustion and emission characteristics of diesel homogeneous charge compression ignition (HCCI) combustion with external mixture formation”, Fuel, Vol 87, 2008, PP 3497–3503. Cinar, O. Can, F. Sahin and H.S. Yucesu, “Effects of premixed diethyl ether (DEE) on combustion and exhaust emissions in a HCCI-DI diesel engine”, Applied Thermal Engineering, Vol 30, 2010, PP 360–365. Yang, Z. Wang, J.X. Wang and S.X. Shuai, “Experimental study of fuel stratification for HCCI high load extension”, Applied Energy, Vol 88, 2011, PP 2949–2954. B. Bahri, A.A. Aziz, M. Shahbakhti and M.F.M. Said, “Understanding and detecting misfire in an HCCI engine fuelled with ethanol”, Applied Energy Vol 108, 2013, PP 24–33.
21. Megaritis, D. Yap and M. L. Wyszynski, “Effect of water blending on bioethanol HCCI combustion with forced induction residual gas trapping”, Energy, Vol 32, 2007, PP 2396–2400. 22. J.H. Mack, S.M. Aceves and R.W. Dibble, “Demonstrating direct use of wet ethanol in a homogeneous charge compression ignition (HCCI) engine”, Energy Vol 34, 2009, PP 782–787. 23. S. Swami Nathan, J.M. Mallikarjuna and A. Ramesh, “Effects of charge temperature and exhaust gas re-circulation on combustion and emission characteristics of an acetylene fuelled HCCI engine”, Fuel, Vol 89, 2010, PP 515–521. 24. R.K. Maurya and A.K. Agarwal, “Experimental study of combustion and emission characteristics of ethanol fuelled port injected homogeneous charge compression ignition (HCCI) combustion engine”, Applied Energy Vol 88, 2011, PP 1169– 1180.