[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tuner23] ion sensing ignition tuning



----------------------------------------------------------------------
----------
Page 1 DIY ion sensing ignition subsystemVille VartiovaaraVille.Vartiovaara@hut.fiJuly 3, 2002
----------------------------------------------------------------------
----------
Page 2 Contents1 Preface21.1 Disclaimer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.21.2 General (Important) . . . . . . . . . . . . . . . . . . . . . . . . .31.3 What is ion sensing (in this document)? . . . . . . . . . . . . . .31.3.1 Simple.. . . . . . . . . . . . . . . . . . . . . . . . . . . . .31.3.2
..and efficient . . . . . . . . . . . . . . . . . . . . . . . . .31.4 Benefits (to mention a few) . . . . . . . . . . . . . . . . . . . . .32 Theory of operation52.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52.2 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52.3 My version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 First implementation, laptop-based test bench73.1 Detailed hardware . . . . . . . . . . . . . . . . . . . . . . . . . .73.1.1 High voltage side . . . . . . . . . . . . . . . . . . . . . . .73.1.2 Isolation . . . . . . . . . . . . . . . . . . . . . . . . . . . .73.1.
3 Noise reduction and signal conditioning . . . . . . . . . .83.1.4 Analog-to-Digital conversion . . . . . . . . . . . . . . . .83.1.5 Crank angle sender . . . . . . . . . . . . . . . . . . . . . .83.2 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.83.2.1 Basic structure . . . . . . . . . . . . . . . . . . . . . . . .94 Second implementation, MSP430 microcontroller101
----------------------------------------------------------------------
----------
Page 3 Chapter 1Preface1.1 DisclaimerThis document is a description of how the author has built an ignition timingfeedback subsystem that uses ion sensing. The system is being used solely forhis private experiments.If you intend to use this information in any way, you should find out whatyou are allowed to do, since some companies have patented this technology. Theauthor has nothing to do with these companies, and gives no guarantee for theauthenticity or correctness of any information presented in this document.All information in this document is for informational purposes only; to givean idea of how a simplified ion sensing feedback system can be built. If youuse this information for anything, you do it at YOUR OWN RISK, the authortakes NO RESPONSIBILITY for any harm or damage caused by doing so.Neither can the author be blamed for using bad English.2
----------------------------------------------------------------------
----------
Page 4 CHAPTER 1. PREFACE31.2 General (Important)This is a PRELIMINARY version of a project description and not complete atall; it is even missing several chapters. This version is published to inform thereaders of the existence of the project and give some basic information about it,while more complete version is to come when the writer has time to make one..1.3 What is ion sensing (in this document)?1.3.1 Simple..A method to get to know whether ignition is too early or too late, on a cycle-to-cycle basis. No extra intrusive sensors, no engine modifications. The technologycan be applied to any internal combustion engine that is ignited by a spark plug(or has a similar pair of electrodes installed ;), independent of the engine layoutand fuel.1.3.2 ..and efficientWe get to know the crank angle where the pressure is at its maximum. If thisPPP (Peak Pressure Position) is kept constant (depends only on motor design)under all conditions, we can suppose to have the ignition "perfectly tuned" allthe time. The same could be achieved by installing a high pressure sensor inthe cylinder head next to the spark plug, but it is seldom possible due to bothlimited space in the block and also the high mechanical stress applied to theassembly. Ion sensing uses the spark plug as an intrusive sensor. We apply avoltage of 100-400Volts across the spark gap just after the ignition, and as boththe combustion flame and also ionized resultants conduct a little electricity, wecan measure the current via the spark gap, and get a curve, where we can extractseveral parameters such as PPP.1.4 Benefits (to mention a few)
Traditional ignition control relies on predetermined rules (tables of factors).These rules are coded in the control system (electronic or mechanical) uponmanufacture. The correctness of ignition timing in road conditions depend onhow well the designer has been able to reckon with all the parameters that affectthe burn rate and thus the 'ideal' advance. Not to mention the effect of agingof the engine.Usually the timing can be estimated quite well (with a modern ECU) duringmedium or high load, and when air humidity is relatively low, as in the proto-typing lab. But, as these high load conditions in dry air are quite infrequent innormal use, the correct timing at light load (lean mixture) and varying humidityis of the highest importance, especially when economy, smooth operation, highinstantaneous power, low emissions and durability are important factors. Thisis the case in all normal cars.When an ignition control system uses ion sensing, it can, after every singlecombustion, "see", if the ignition was too early or too late. The predetermined
----------------------------------------------------------------------
----------
Page 5 CHAPTER 1. PREFACE4tables, which can be substantially simpler than with traditional predictive con-trol, are then updated to reflect the current conditions. So a simple table maystill be used, but if a fast enough feedback system is used, the table is only usedupon cranking and similar conditions, where no reasonable ionization currentmay be present after ignition.The ignition control system is simplified a lot, asthe amount of discrete sensors is reduced to a minimum of a crank positionsender (TDC sensor or better).Due to the quite demanding nature of the ion current signal (the shape ofthe current that flows across the spark gap during combustion) it is reasonableto use ion sensing only as a correction factor. It may be difficult to get reliabledata after every combustion, so the system may be altered in a way that thefeedback unit spits out an averaged error angle (how much the ignition is toolate or early, in degrees) of e.g. ten revolutions, and the original control unitmay then tune the overall ignition table, being able to do this after every cycle.With this technique the ignition tuning steps are 'blurred' to minimize the effectof a erroneous error angle, still maintaining short response delays to changingconditions such as mixture enrichment during acceleration.
----------------------------------------------------------------------
----------
Page 6 Chapter 2Theory of operation2.1 PrerequisitesPrior to trying to understand the issues covered in this document it is advisedthat you spend a little time e.g. searching the web and finding general informa-tion about ion sensing in ignition control, especially if you are not familiar withthis kind of technology. I could give a bunch of URLs here, but they would,sooner or later, become outdated. For your convenience, please use a searchengine instead.2.2 GeneralWe can learn from deeply studying the nature of an internal combustion engine,that the signal we get from the spark plug can be approximated as a sum of twoGaussian curves [1], the first of which is due to the charge carried by particlesin the flame (a.k.a flame ionization). The second presents the pressure in thecylinder (Fig. 2.1). This is because the voltage we apply across the spark plugelectrodes ionize the results (not-yet-escaped exhaust gas), and the amount ofcharge carried by these ionized particles is proportional to the gas pressurearound the electrodes. And as we are interested in the point (crank angle)where pressure reaches its maximum, it is the peak position of the latter term.The difficulty is to extract that position, and the first method that comes tomind is brute curve fitting. Gaussian curve is of type ae-b(x-c)2, so the wholecurve in this model is a sum of two exponential functions. This leads to hugeamount of calculations in curve fitting, so we either have to reduce resolutionto an unusable amount, or simplify the process in some way. This is becausethe calculations have to be done approx. 50 times per second per cylinder at aresolution of one degree.2.3 My versionThe curve fitting method can be simplified mathematically to make it possibleto do the calculations in real-time with moderate computing power (an ordinarymicrocontroller). Despite this I thought that it would be nice to be able to build5
----------------------------------------------------------------------
----------
Page 7 CHAPTER 2. THEORY OF OPERATION6[ht]Figure 2.1: The measured signal and its componentsa functional system without first having to bury oneself in maths. So I decidedto try a simplified version of curve fitting, something similar to what I do myselfwhen trying to approximate the peak position from a curve that is printed onpaper. The model is:* find the highest peak of the whole signal (giving approx. the peak of theflame term)* do a primitive curve fit to find a Gaussian curve that fits to the first peak'srising slope* extract that curve from the original signal* find the highest peak of the remainders* trust in the resultThis method gives surprisingly correct results, at least so correct that I couldn'tsay them to be incorrect when visually comparing to the original signal. So itis time to put it to work. Oh, and of course, when the system is ready (allthe hardware built), the software can always be enhanced to give more accurateresults. The point here is to get a good enough algorithm to start with.
----------------------------------------------------------------------
----------
Page 8 Chapter 3First implementation,laptop-based test benchHaving written the algorithm in C on Linux I wrote a program that read signalfrom an 8-bit ADC attached to a laptop's parallel port, extracts the PPP andshows the result on screen. When the engine was idling, the laptop, that wason top of it, had a meter on its screen showing PPP that was varying fromsomewhere near 15 degrees to over 40 degs occasionally. The engine is not inperfect tune..;) All the time I had an oscilloscope attached to the signal cableto be able to verify the results, which seemed to be correct. When the enginewas loaded a bit, the PPP got more stable, so the system was working. Theproblem was that as I only had an 8-bit ADC, and the dynamic range of thesignal is much wider, I had to manually re-tune the preamplifier not to get thesignal clipped during conversion at a higher load. Anyway, the algorithm wasproofed to work as expected.3.1 Detailed hardware3.1.1 High voltage sideTo be able to get the signal from the spark plug, you have to apply a relativelyhigh voltage to it after ignition, and measure the resulting current, which is oforder 1mA. For this purpose I built a simple switching flyback inverter basedon the 555 timer and a 10A mosfet (high rating to allow for bad design withoutsmoke :) Some systems use a plain zener diode and a capacitor in place, butthis is only possible when the car is fitted with four terminal coils or similarwith entirely isolated secondary side, which are not quite common. At least mycar doesn't have one..:)3.1.2 IsolationThe 400V must be applied to the spark plug, which means that we do not wantto get any current (especially at 15kV) from the plug during spark. So we musthave a diode that has reverse breakdown voltage substantially higher than theignition system's spark voltage. I put 24 1kV avalanche diodes in series to get7
----------------------------------------------------------------------
----------
Page 9 CHAPTER 3. FIRST IMPLEMENTATION, LAPTOP-BASED TEST BENCH8Vr of 20kV, which is enough for my old coil ignition. The installation must bePlugsignal(-)400(+)Coil4.7kFigure3.1:High voltageassembly tothesparkplugdone with great caution, to make sure that no one gets hurt by either the highignition voltage (> 10kV) or the ion sensing voltage (400V) when the engine isrunning. I used silicone tube to cover the diode chain.3.1.3 Noise reduction and signal conditioningAs the operation environment is quite demanding in the sense of protection fromelectromagnetic interference (EMI), the signal present across the resistor nearthe spark plug is transferred in a coaxial (microphone) cable to the filtering andpreamp unit. I use a 4700 resistor as the current sensor, so the amplitudeof the signal is somewhere between 3 and 5 Volts at its highest. The filteringmust be minimal, because the useful band of the signal goes up to 30kHz, so Iuse a simple RC low-pass filter with -3dB point somewhere around 50kHz. Alsominimal distortion is of utmost importance, as any phase shift in the majorcomponents result directly in wrong PPP estimate. The filter is built into atwo-stage amplifier consisting of a unity-
gain inverter and an adjustable-gainamplifier. This is because the signal present on the resistor leads is from 0 to-5V. To make the signal usable, it must first be inverted, and this is carried outat its simplest by constructing an op-amp-inverter with one half of a LM358.This design also provides us with a substantially high input impedance, whichis important due to the nonlinear nature of the signal source. Then the otherhalf is used to create the amplifier. The resulting signal is positive-up, 0-to-5Vsignal, which can be directly fed to the ADC.3.1.4 Analog-to-Digital conversionIn the first version I used a 8 bit ADC from Texas Instruments they offered meas a sample. It was chosen because I wanted to get easy interface via the parallelport. The ADC was of parallel-out type, so I just needed to put wires betweenthe parallel port pins and the pins on the ADC. The return path (ground) fromthe parallel port was blocked with a low-drop diode to prevent burning the portdriver if some of the data pins were mistakenly pulled low while the ADC wassending high.3.1.5 Crank angle senderTo make the sampled signal useful, we also need some timing information. I usea simple aluminum plate mounted to the generator belt pulley at the end of thecrank angle.The rotation of the plate is encoded with an optical switch and sent to apin in the parallel port. The design of this sender is not robust at all; it is justsimple to make, whereas the final version must have a hall effect detector andan appropriate metal plate. But for a prototype this is good enough.20Figure3.2:Crank angletiming plate3.2 SoftwareI have no knowledge of an existing system that would be using this technology.When writing software for the laptop implementation, I tried to make things
----------------------------------------------------------------------
----------
Page 10 CHAPTER 3. FIRST IMPLEMENTATION, LAPTOP-BASED TEST BENCH9as simple as possible, and, first of all, fast. The goal was to keep the amountof instructions per two engine revolutions (four-stroke) under 5000, and theresult was approx 3000. This means that if the engine runs at 6000RPM, youneed a processor capable of doing 150000 instructions per second for the signalinterpretation. So my 100MHz 486 was really fast enough..;) So I put a niceanalog meter on screen instead of a plain ASCII output.I don't provide any sources at this point, as this first version was really aprototype in all respects. All I say is that it was coded in C with Linux gccand basic X11 libs, with optional real-
time scheduling. As soon as I saw thatthe algorithm was working, and didn't need all too much computing power tokeep real-time, I moved forward to the next implementation. Anyway, the basicstructure of the software is as follows:3.2.1 Basic structureData logging cycle:* keep discarding samples until a high spike due to spark occurs in the signal* when the spark peak goes down, start logging sampled data for furtherprocessing* log data until 120ATDC (approximated from the amount of samples col-lected during signal from timing plate encoder is active (from TDC toTDC+20 degrees)* when ready, hand over the logged data for PPP extractionPPP extraction routine:* find the first peak location* fit a Gaussian curve to that peak's rising slope* extract that curve from the original data* find the remaining signal's peak position* transform the peak coordinate (sample number) into degrees ATDC withthe help of knowing from which sample to which sample the timing platesignal was active (from TDC to TDC+20 degrees again)* put the PPP on the screen ;)* adjust sampling speed if the amount of samples was too small or too high(adapt sample rate to changing RPM)* pass control to the sampling routineAnd that's it. The routines can be enhanced in many ways, such as controllingthe sampling with a PLL (Phase Locked Loop) so that no software RPM sensingneeds to be done, adding automatic signal level control (when used with a 12-bitDAC) etc.. But it works.As it became obvious that the algorithm is promising, and that I neededmore resolution to the A/D conversion, it was time for the next implementationwith Texas Instruments 16-bit RISC microcontroller MSP430.
----------------------------------------------------------------------
----------
Page 11 Chapter 4Second implementation,MSP430 microcontrollerOk, now I'm working on an integrated version that is based on MSP430F149,the Texas Instruments' 16-bit RISC Flash microcontroller. The chip operates atclock frequencies of up to 8MHz and has many very powerful features that bene-fit this project. It has a 12-bit ADC (8 MUXed inputs), 2 timers and a hardwaremultiplier module on chip along with many other integrated peripherals. All theperipherals share the same 2048byte memory, so the API is very simple. F149has 60kB of Flash memory with serial (in-system) reprogramming capability.The application code can also update the flash memory autonomously. Theseare the main points why I decided to use just this chip in my project.The software is mostly assembler, but there are still some lines of C wherespeed isn't important. The program structure is roughly the same as in thelaptop version, only the sampling routines are entirely different. The timing isdone by having two IRQs sent by the timer and the ADC. So it's a bit more'multi'tasking..;) Anyway, to keep this document preliminary, I won't writeabout this any more.. Hope I'll find the time to finish this document soon.. Justnow I'm too busy debugging the new system that has all the basic functionality
(sampling, PPP extraction, PPP sending via RS232 interface (gives correctnumbers..:)) but needs more..10




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Looking for a more powerful website? Try GeoCities for $8.95 per month.
Register your domain name (http://your-name.com). More storage! No ads!
http://geocities.yahoo.com/ps/info
http://us.click.yahoo.com/aHOo4D/KJoEAA/MVfIAA/IliolB/TM
---------------------------------------------------------------------~->

to post: tuner23@yahoogroups.com
to unsubscribe: tuner23-unsubscribe@yahoogroups.com
to change email delivery settings: http://groups.yahoo.com/group/tuner23
to share a file: http://groups.yahoo.com/files/tuner23/


Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/