Login Register

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ECU Simulator
#1
    Hi,

I have been reading your blog on Hacking the Ford ECU. for my OBD2 test bed or my Arduino. I am looking at creating a similar project but have a few differences and if you would be able to assist with the correct code and some technical info it would be great.

I need to recreate a signal to drive/trigger an ECU for an engine. I need to be able to test the ECU on a bench and without the correct cam and crank signal input this is not possible. The ECU uses inductive crank sensors runs along the flywheel which has 36 evenly spaced notches + 1 notch to indicate TDC (TDC Notch is between 36 and 1). The cam sensor picks up 12 evenly spaced peaks + 1 to indicate TDC (TDC peak between 12 and 1). The ECU will read this signal and convert it from an analog signal to a digital one. These sensors create voltages up to 50VAC depending on engine speed. I imagine that a voltage of 25-30V should be sufficient to power the ECU at all RPM ranges.

If i want to achieve an engine speed of 600RPM then I will need to programme arduino to send pulses at 360 Htz + 1. In other words one pulse every 10 degrees of engine rotation as well as one extra pulse at 5 degrees.

How would I write this code?

I am considering using something like the LM2577 DC-DC Adjustable Step-up Power Converter Module which will convert the 5V DC up to 35V DC which should be sufficient to power the ECU. I am not sure on the current requirements but will take some measurements next week. My only concern is if the ECU will recognise the generated wave and be able to trigger off it.

Below is a scope shot of the engine running at idle (600RPM) showing both crank(bottom) and cam(top) sensors.
Reply
#2
so are both cmp and ckp 2 wire sensors?
just coils. (not hall)
all you need is a transformer, to drive the ECU
and into the transformer the 4v-5v squarewave from the Arduino (5v) version outputs. (the transformers give you zero cross over sigs)
there is no need for 36 volt signals (in act the ECU probably clamps all sigs over 5v internally. so avoid over 5vdc is best.


most ECu can run with 1volt sensor inputs., (coils) when the crank turns slow, see how low the signals are?, and you will see it still works at 200 rpm. and 1v. pulses,
the ecu has zero crossing detectors for coil type sensors (not hall in this case)

and an AMP. and is very sensitive. (some cars even do 0.5v inputs,,! for starting say in very cold weather and very very slow cranking, like in Alaska) and a weak battery.

my project was just to get the PCM to spit out as many DTCs as possible. not to fully simulate all inputs to ecu and perfectly. (but can be done pretty easy)

in fact my cam to crank timing relationships, are so poor that the ECu spits (DTC;s) too. , but still injects..... and sparks. ok

some ECU will gen up spark with just with cam sigs. (suzuki G16'S)
others need crank sig. OR NOTHING GOOD HAPPENS.
and others need both. sigs, cKP + cmp

cheap audio transformer make wonderful. coil simulators.

as you can see the arduino saturates the trans former core. each hit. (flat tops is the clue.)
the ecu could care less about the tops of pulses.(shapes). only the cross over zero matters the timing of course.
my code is there. see it? its not hidden.... its very crude...
a more better way and lots of work is using the Arduino timers. one for cam, one for crank and synchronized. for me that was overkill. i just wanted it to inject and spark.




one plan of attack is see if it gens spark just with CKP. 1:36.

I USED A POT TO TELL arduino what RPM i wanted.

all this is not fact, just opinion
as doing bench characterization wins all bets.

one other way that might work
is the 5v out puts through a series cap. say 0.1uf. to the ecu, it might be enough to trip the cross over detectors in the ecu.
when the output goes to 5v, the cap charges, and you get the classic charging curve in to ECU, a pulse, then the output goes to zero and the input to the ECu may go neg just a bit.
the neg pulse, can be just enough to make ECU see zero crossed! for 10cents.(due to the charged cap now has the + side charged, but is now at ground potential.)

called a differentiators.

see spikes here, this is my cap trick, be fun to tray. and safe as 5v sigs are all safe for ECU.

http://evalidate.freehostia.com/RLC/rcDi...heory.html

for sure very very simple. the resistor is in the ECU.

if we had the ecu schematic, all this is so simple.... making it happy.

Ps: i see you're having way too much fun, LOL !~
http://www.fixkick.com
Reply
#3
(05-11-2015, 07:20 AM)fixkick Wrote: so are both cmp and ckp 2 wire sensors?
just coils. (not hall)
all you need is a transformer, to drive the ECU
and into the transformer the 4v-5v squarewave from the Arduino (5v) version outputs. (the transformers give you zero cross over sigs)
there is no need for 36 volt signals (in act the ECU probably clamps all sigs over 5v internally. so avoid over 5vdc is best.


most ECu can run with 1volt sensor inputs., (coils) when the crank turns slow, see how low the signals are?, and you will see it still works at 200 rpm. and 1v. pulses,
the ecu has zero crossing detectors for coil type sensors (not hall in this case)

and an AMP. and is very sensitive. (some cars even do 0.5v inputs,,! for starting say in very cold weather and very very slow cranking, like in Alaska) and a weak battery.

my project was just to get the PCM to spit out as many DTCs as possible. not to fully simulate all inputs to ecu and perfectly. (but can be done pretty easy)

in fact my cam to crank timing relationships, are so poor that the ECu spits (DTC;s) too. , but still injects..... and sparks. ok

some ECU will gen up spark with just with cam sigs. (suzuki G16'S)
others need crank sig. OR NOTHING GOOD HAPPENS.
and others need both. sigs, cKP + cmp

cheap audio transformer make wonderful. coil simulators.

as you can see the arduino saturates the trans former core. each hit. (flat tops is the clue.)
the ecu could care less about the tops of pulses.(shapes). only the cross over zero matters the timing of course.
my code is there. see it? its not hidden.... its very crude...
a more better way and lots of work is using the Arduino timers. one for cam, one for crank and synchronized. for me that was overkill. i just wanted it to inject and spark.




one plan of attack is see if it gens spark just with CKP. 1:36.

I USED A POT TO TELL arduino what RPM i wanted.

all this is not fact, just opinion
as doing bench characterization wins all bets.

one other way that might work
is the 5v out puts through a series cap. say 0.1uf. to the ecu, it might be enough to trip the cross over detectors in the ecu.
when the output goes to 5v, the cap charges, and you get the classic charging curve in to ECU, a pulse, then the output goes to zero and the input to the ECu may go neg just a bit.
the neg pulse, can be just enough to make ECU see zero crossed! for 10cents.(due to the charged cap now has the + side charged, but is now at ground potential.)

called a differentiators.

see spikes here, this is my cap trick, be fun to tray. and safe as 5v sigs are all safe for ECU.

http://evalidate.freehostia.com/RLC/rcDi...heory.html

for sure very very simple. the resistor is in the ECU.

if we had the ecu schematic, all this is so simple.... making it happy.

Ps: i see you're having way too much fun, LOL !~

Hi Fixkick,

Thanks so much for the help you managed to answer a whole lot of questions for me. I googled the "Arduino Timers" page and managed to write the correct code for the crank sensor and am now going to write the cam signal too. Pretty straight forward once guided in the right direction. I am yet to get a transformer to convert to AC for the crossover voltage but can't wait to give it a try. Will keep you posted on my progress!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)