Need help building a diesel fuel injector controller for flow bench testing. - Page 1
Forum section: electronics / beginners

author: mspiess
author_rank: Contributor
timestamp: November 18, 2015, 08:58:20 pm
content: Hi,Can someone help me select a 12vDC square wave function generator? Square waves will be in the neighborhood of 1.72 milliseconds in length. I also need a burst function so I can transmit 1000 waves then stop. I might need two channels with the other square wave longer in length. Any help will be greatly appreciated. Thank you!Matthew,

author: Ian.M
author_rank: Super Contributor
timestamp: November 18, 2015, 09:05:34 pm
content: You got a budget for real test equipment or do you need this done on a shoestring?If the latter, an Arduino + a MOSFET low side gate driver chip could get the job done with a bit of code.

author: mspiess
author_rank: Contributor
timestamp: November 19, 2015, 12:10:57 am
content: PM sent.

author: mspiess
author_rank: Contributor
timestamp: November 22, 2015, 02:48:42 pm
content: I'm trying to drive HEUI diesel injectors so I can test flow them on a bench. The solenoid that controls the injector is fed a 120vDC sine wave Pwm signal from the injector controller, and the injector controller is fed a 12vDC square wave signal from the computer. I'm thinking it would be more cost effective to generate the 12vDC square wave from the PCM to the IDM then the 120vDC sine wave from the IDM to injectors. I have no idea how to accomplish any of this. I have been looking for help everywhere.Swamps has some photos on the waveforms associated with this projecthttps://swampsdiesel.com/IDM/Injector%20Waveforms.htm.

author: Andreas
author_rank: Super Contributor
timestamp: November 22, 2015, 03:12:01 pm
content: Quote from: mspiess on November 22, 2015, 02:48:42 pmUsually those injectors are current controlled.(to get rid of temperature dependant effects).I do not see any current clamp measurement in the link.With best regardsAndreas

author: mspiess
author_rank: Contributor
timestamp: November 22, 2015, 08:11:38 pm
content: The 7.3 powerstroke injectors are all powered by 120vDC. I believe the pulse width determines how the injector deliverers the injector fuel capacity. Here's an example or a DIY injector controller.

author: Seekonk
author_rank: Super Contributor
timestamp: November 22, 2015, 10:12:10 pm
content: That article brings back memories. Look up a LM1949, an injector driver, and that explains the waveforms. I'm still confused about the 120VDC on a powerstroke. Be a nice little project for an arduino.

author: mspiess
author_rank: Contributor
timestamp: November 22, 2015, 10:29:02 pm
content: The Power Control Module is powered by 12vDC which in turn powers the Injector Drive Module. The IDM is sent two separate 12vDC square wave signals which causes the IDM to output a 120vDC sine wave signal to control the injector solenoid.

author: Seekonk
author_rank: Super Contributor
timestamp: November 22, 2015, 10:37:51 pm
content: I'll just have to check with my own sources on that.

author: Chris Wilson
author_rank: Super Contributor
timestamp: November 22, 2015, 10:39:39 pm
content: The feedback signal is part emissions and part safety. A direct injection diesel, as you will know, uses huge rail pressures for best atomisation, if an injector sticks open, or partly open, it will fill that cylinder in moments to the point of a hydraulic lock. This can (and does....) happen, so in my opinion it's 90% safety, but will have emissions implications, too. For test bench usage I would imagine you can ignore that unless feedback to the stock management system is part of the bench set up. I am not qualified to advise on the electronics needed, but I am watching with interest as I want to build a simple, none direct rail, petrol engine injector and coil on plug tester myself. Good luck!

author: y.sh
author_rank: Newbie
timestamp: November 22, 2015, 10:43:34 pm
content: 555 is the best for low & medium frequncy square wave signal generation and its easy for use, you can change signal duty with a single potentiometer, for creating 1000 waves you need to design mono stable and astable combination 555 circuit (google it) . just connect a power mosfet to the output and drive what you want, I find a simple injector driver circuit which working with 555 I hope it can help you.

author: mspiess
author_rank: Contributor
timestamp: November 22, 2015, 10:46:19 pm
content: This link has some good oscope photos of the PCM>IDM>Communicationhttps://swampsdiesel.com/IDM/Injector%20Waveforms.htm. I also believe I can skip the feedback signal. If we can translate the square wave signals from the PCM and plug those into a PC for duplication to IDM for what engine variables we want to test at seems a way to accomplish.

author: mspiess
author_rank: Contributor
timestamp: November 23, 2015, 12:17:31 am
content: I'm looking to order an arduino and mosfet. Seems I can control two separate square waves with the board. Can I buy a cheap PC based oscilloscope from Amazon that will read the IDM/PCM signals referenced in this linkhttps://swampsdiesel.com/IDM/Injector%20Waveforms.htm?

author: Ian.M
author_rank: Super Contributor
timestamp: November 23, 2015, 07:32:19 am
content: You'd need the right Arduino for the job. It needs to have a 16 bit timer with output compare to generate accurately timed pulses. Its more common to use the timer and output compare for PWM, so you need one with 16 bit PWM. Some models only offer 8 bit PWM which wont give you the timing accuracy you need. You are going to have to control the hardware registers of the Atmel MCU directly, + provide an interrupt routine that after each transition, loads the compare registers with the time of the next transition (in terms of the 16 bit timer count), so its not so simple to code. Its unlikely you will find a sketch for this, so you are going to have to write the low level code yourself.I don't develop on the Arduino platforms so wont be much help. If I was tackling this for my own use, I'd probably use a fast PIC18 MCU as I am familiar with background arbitrary pulse generation on that platform, but the toolchain has a fairly steep learning curve and isn't cheap to get into, so you probably don't want to go down that route.I didn't suggest a MOSFET, I suggested a low side gate driver chip intended for driving a MOSFET. They convert a logic level signal into a higher voltage signal - typically 9 to 15V depending on the supply voltage, that is used to control the MOSFET gate. As a MOSFET gate behaves much like a capacitor, to switch the MOSFET cleanly, the gate driver has to be able to supply a large output current for a short time. However it isn't designed to supply such a current continuously. I'd pick a gate driver rated for 30V supply. There are other methods of going from a logic signal to a nominally 12V pulse, but if you want a pulse width resolution of 10us, (to get 2 digits after the decimal point when specifying the pulse length in ms), you need something that can switch faster than 200KHz, which rules out cheap pre-built H-bridge shields or modules, and most of the simpler remaining methods of level shifting don't have much output drive capability so will be very sensitive to the IDM's input characteristics.

author: mspiess
author_rank: Contributor
timestamp: November 23, 2015, 01:40:04 pm
content: I'm trying to replicate the blue and the red square waves on this attachment. The IDM will output the PWM sine waves if I get the two square waves figured out.

author: mspiess
author_rank: Contributor
timestamp: November 23, 2015, 01:59:06 pm
content: Thank you Ian. The Arduino UNO has three timers:Timer0 - An 8 bit timer used by Arduino functions delay(), millis() and micros().Timer1 - A 16 bit timer used by the Servo() libraryTimer2 - An 8 bit timer used by the Tone() librarySo I should get a low side gate to control the mosfet?

author: Ian.M
author_rank: Super Contributor
timestamp: November 23, 2015, 02:27:01 pm
content: I'd use the low side gate driver chip to drive the IDM directly. It will step up from the Arduino's logic level pulse output to a 12V pulse. No MOSFET wanted or needed.I've checked what's actually available in 30V rated gate drivers (less probably wont survive spikes on your 12V bus), in a PDIP package so you can stick it straight on an Arduino protoshield, and it looks like the best bet is the Texas InstrumentsUC3708N. However its a bit pricey and doesn't drive high as close to the supply rail as I'd like, so you may want to wait for alternative suggestions before ordering.

author: mspiess
author_rank: Contributor
timestamp: November 23, 2015, 02:35:29 pm
content: Can you recommend a low side gate driver on amazon? Will the features of the arduino uno be able to output two square wave signals? One being around 500 hertz and the other 1000 hertz or more?

author: Seekonk
author_rank: Super Contributor
timestamp: November 23, 2015, 02:52:22 pm
content: Swampers blows a lot of smoke. They want you to think they know a lot without telling you anything.. The waveform you want to copy is the green one. That can only be done by YOU if a LM1949 is used. I've built high speed solenoid drivers. For 6V coils we used 60-80V to slam it open and then allow current PWM to keep the current at a set point. That compares with your 12V coil (3A X 4 ohms) that is hit with 120V. The PWM runs at its natural frequency 15KHZ and increases 50KHZ with shorted turns. This feature needs to be kept and not programmed. The LM1949 will do this for you and component selection is a lookup. The timing pulse and counter is simple ten lines of code in a uno. Then a 120V supply is needed. Quite simple but you face a massive learning curve. Not a matter of how smart you are but how determined.

author: Ian.M
author_rank: Super Contributor
timestamp: November 23, 2015, 02:59:31 pm
content: It should be able to as it has two output compare modules associated with timer 1. Dig into the servo library code to see how it generates variable duty cycle 50Hz Futaba servo signal pulses, and hack it to make the pulses variable frequency and extend the range of permissible pulse widths it can handle.If you want to find gate driver chips, in a package you can actually hand-solder, you'll need a real electronic component distributor. e.g. Digikey, Farnell, Mouser, RS Components etc.Drill down through their product trees till you find the gate drivers then do a parametric search for in-stock, supply voltage >=30V, Low side, non-inverting, through-hole.STUDY THE DATA SHEET BEFORE ORDERING!@Seekonk: I think the aim is to avoid the complexities of driving the injector solonoid directly by using an off-the-shelf IDM, and feeding it appropriate control signals.

author: mspiess
author_rank: Contributor
timestamp: November 23, 2015, 04:37:31 pm
content: Yes, Ian is right. This is a budget build. I ordered the Texas Instruments UC3708N.

author: mspiess
author_rank: Contributor
timestamp: November 23, 2015, 07:22:35 pm
content: I'm very determined.

author: mspiess
author_rank: Contributor
timestamp: November 26, 2015, 10:13:10 pm
content: I'm having trouble wiring the Texas Instruments UC3708N. Could someone look over the pinout and help me out? Thank you!

author: Ian.M
author_rank: Super Contributor
timestamp: November 27, 2015, 02:46:23 am
content: What's the problem? The only slightly tricky thing you need to know is that 'NC' means 'Do *NOT* connect to anything'.It looks like its permissible to leave the enable pin floating, but I'd tie it to the 5V logic supply. Vin is the 12V supply from the battery, which should have 47uF electrolytic and 0.1uF ceramic decoupling caps as close to the chip as you can reasonably get them. The input A and B pins are logic level and can be controlled directly from your Arduino.You must not apply input signals without power to Vin. If you power the Arduino from the same 12V supply as the UC3708, this will never be a problem. Dont forget a 1A fuse in an inline holder near the battery terminal for your own safety.

author: mspiess
author_rank: Contributor
timestamp: November 27, 2015, 03:03:24 am
content: Ok, thank you Ian. I think I got it figured out.

author: pmbrunelle
author_rank: Regular Contributor
timestamp: November 27, 2015, 03:46:48 am
content: Quote from: Ian.M on November 23, 2015, 07:32:19 amQuote from: mspiess on November 23, 2015, 01:40:04 pmFrom your oscilloscope trace, you have ~25 us between transitions. So for a microcontroller that doesn't have anything else to do besides toggle one output with hardware help, Ian's suggestion to load the timer with the next edge actually doesn't seem hard at all. Should be more than enough time to get ready for the next transition.

author: Ian.M
author_rank: Super Contributor
timestamp: November 27, 2015, 04:04:57 am
content: It simple enough if you've got a background in realtime MCU programming, but for someone starting out?Also, sooner or later, the O.P. is going to need some method of adjusting simulated RPM and injection pulse width without reprogramming. He'll also need a way of selecting the 1000 pulse count mode and starting it. (I think he wants that to squirt into a measuring cylinder to enable the injection volume per pulse to be calculated.) So the code is going to grow a bit and if not properly structured to begin with, is likely to be quite a mess.