Close

Input Captures vs. Analog Inputs with D-DAQ & a DS2072

A project log for D-DAQ

automotive parameter & performance monitor & logger

michael-obrienMichael O'Brien 05/02/2014 at 23:280 Comments

I happen to be lucky enough to own a Rigol DS2072. Thank you to the kinda folks over on the EEVBlog Forums, I decided that this scope would be my first oscilloscope. I've used them in the past but have not owned one. The UI is a bit quirky and not organized well imho, but for what you get in terms of price, it's simply a pleasure to use. Anyhow, back to that in a second...

D-DAQ has 3 interfaces for observing metrics: analog inputs, I2C bus for digital sensors, and 2 input capture pins. The analog inputs are decently spec'd at 10-bit, 1 Msps. Theoretically, I can sample a waveform as quickly as 100 MHz. Why does this matter? There are 2 very particular sensors on my car I want to monitor: Crank Position Sensor and Lift Needle Sensor. First a little background on what they are and why they're needed.

The former is a simple Hal Effect sensor as there is a plate bolted to the crankshaft with 4 gaps in it spaced at 0˚ Top Dead Center, 90˚ TDC, 180˚, and 270˚. Using the output of this sensor the ECU can determine, approximately, where the engine is currently, but also what it's RPM is. I have a 4 cylinder turbo diesel that uses a rotary vane pump and the car is from '97. It's simple, but also quite powerful. In order to properly regulate fuel going into the engine, the ECU needs to know where the crank is so it doesn't inject fuel too early or too late. There is mechanical control, but also electronic adaption as well. The CPS is responsible for reporting back where the crank is.

Now, the lift needle sensor is a bit of an odd ball. It is embedded in the 3rd injector, btw all of the injectors are completely passive and mechanized with 2-stage injection, and consists of a powered coil wrapping around the needle inside the injector. If you'd like to read up more on VE TDIs and their injectors, there is quite a bit of information out there. This particular sensor is responsible to for detecting movement in the lift needle, which indicates when the injector "pops" open and fires fuel into the cylinder. In combination with the CPS, the lift needle sensor is responsible for reporting back when fuel injection occurs, thus what the timing is.

Anyhow, this particular sensor isn't characterized in any documentation online that anyone is aware of aside from one PDF from VW. As a result, a bit of online research pointed to the closest equivalent sensor type, an eddy current sensor. From what I read online, I was expecting that this sensor has a modulated AC signal being sent to it and the ECU had a hardware/software combination for identifying when a peak occurred, i.e. the needle moved. I've been in the TDI community for ~7 yrs, and have been learning about the car(s) for the better part of 3. Everyone I talked to has said that the lift needle sensor is only good for determining when injection starts, thus it cannot be used to determine injection duration.

Why does this all matter? I want D-DAQ to be able to monitor this information and report back timing, SOI (start of injection), and even duration if I can. Here is the technical catch, at 900 RPM the engine is spinning at 15 Hz. Injection occurs in only 2 cylinders during that time, 30 Hz. Though since the lift needle sensor is in only 1 injector and they "alternate" between which cylinder fires (look up 4-stroke engine), I get a pulse once every 7.5Hz. Injection duration is also a very short time, a couple orders of magnitude shorter. When at redline of 5000 RPM, I still only get a pulse from the injector at ~42 Hz. Now, if I were using the analog inputs, I'd have to blindly record values from both the CPS and the lift needle in order to figure out when injection occurs. Doing this for just 1 pulse for detecting what, a +20 KHz signal leads to a lot of trashed data. This is where Input Capture comes into play.

Very simply Input Capture allows to left the bit just sit there until something happens and then it generates an interrupt. This can be from a rising edge, falling edge, or even a pulse. Either way there is a latency of 2-3 clock cycles for the interrupt to be triggered. At D-DAQ's operating freq. of ~65 MHz, this allows me to see ~21,000,000 pulses a second, theoretically. Anyhow, polling for interrupts is horridly wasteful, but if I pass the CPS signal into the the other Input Capture, I can use it as a trigger.

I mentioned earlier that I want to observe fuel injection. As a side note, I know each type of car is different and the ones I have at hand are turbo diesels. D-DAQ is designed to be modular that way if the same type of input is needed, but the characteristics of the sensors differ wildly, only software parameters need to be changed, not hardware. Anyhow, I decided to plug the scope into the car and see if I could characterize the output of the lift needle sensor. I was really curious as to how clean the signal would be and how detailed it was. You may recall that I mentioned that injection is 2-staged. Initially the injector opens with a pilot injection once the fuel pressure is high enough, and then there is the main injection that is then responsible for the remainder of the fuel delivery. Here is what I saw:

It took me a bit to adjust the scope to be able to pick up the waveform due to how far apart they occur, as I explained earlier. However, when I had this come across my screen, I was ecstatic!!! The first peak is when pilot injection occurred. The second mean, main injection! Finally, the lowest valley you see if when injection ceased, thus end of injection. This is at ~900 RPM at idle on a warm engine.

Delay between pilot and main injection:

Injection Duration:

I have a screen capture of the lift needle sensor here at 2000 RPM with cursors turned on, but I did not record the waveform so I cannot pull specifics from it like you see above:

The last detail that I am leaving with is the that this doesn't appear to be a eddy current sensor. Constant DC voltage is applied to the coil accounting for the 3.7 V offset. Other sensors on this car run from a 5 V supply. I'm assuming that the pilot ignition peak approaches 4.5-5 V when the car is under load. Now, looks like I need to build an amplifier/buffer to remove the offset and scale everything into a 0-3.3V range or some such...

Discussions