Speeduino is now on Github Sponsors (Rather than Patreon): https://github.com/sponsors/noisymime
Help with building your Speeduino, installing it, getting it to run etc.
#44170
Hi all,

I introduced myself in the General Forum. I have an Alfa Romeo 156 JTS 2004 model year 2.0L.

[0] Introduction
I was told that Speeduino doesn't do direct injection - the post has had 200 views. Therefore: let me be the first to do this. I have ordered parts and will make it work. I am starting with a 0.4.3c board. I will document my work here and any suggestions will be very welcome. This is my first try at a custom ECU.

I have been reading about Speeduino for weeks now and figuring out where exactly it would need work. The good news is I don't think there are any major reasons why it can't. I'm going to number what I say so it's easier to keep track of things as I expect this thread to get very long and to maybe end with a guide for anyone who wants to run gasoline direct injection (GDI) engines with Speeduino. But I might do smaller questions throughout the forum. Feel free to contribute, tell me where I'm wrong or give ideas.

[1] Car features:
  • 4 cylinder
    fully sequential fuel and spark
    COP ignition with igniters
    2 cats
    4 lambda sensors across two banks/cats: 1 wideband before each cat and 1 NBO2 after each to monitor cat performance
    drive by wire throttle
    5 bar fuel pump and 50-120 bar high pressure mechanical pump driven by exhaust cam
    dual speed radiator fan
    ABS/Traction Control/Brake Force Distribution/Vehicle Dynamic Control all controlled by a separate ABS ECU
    Cruise Control/Immobiliser/Alarm controlled by stock ECU - I don't really need these functions.
    Usual sensors and switches: CKP/CPS/CLT/IAT/TPS/Knock/VSS/MAF/Steering angle/several temperature sensors/spark event/etc etc
    Engine has been rebuilt recently
[2] Why I think it will work
[a] Speeduino supports high-Z injectors natively and low-Z with resistors added. Luckily my car uses high-Z injectors at 16 ohms - so no resistors needed.
(b) My COP ignition is compatible as far as I can tell. I smashed a spare one to pieces to see what looks like the igniter.
[c] My tank fuel pump has an internal mechanical diaphragm regulator at 4.5 bar - so I only have to power it. It primes on KOEOff.
[d] My mechanical high pressure pump is regulated by PID in the stock ECU to maintain 50 bar via a PWM solenoid valve on the fuel rail. I need to figure out how to control this. I have logged voltages and opening position and pressure with the stock ECU to help. It is returnless so I probably do need PWM on the electrical pump.
[e] Provided I can regulate the fuel pressure, I think everything else is a bonus.

[3] Things I want to do:
[a] Figure out my fuel pressure regulator method (PWM) - I think I can just use the boost control since the car is NA. If I boost it later, I would need to replicate that circuit on another I/O channel.
{b) I can use my stock ECU for the fly by wire throttle because it works KOEOff
[c] I can run with a MAP or Alpha-n only. I might look into running a MAF but I know that is controversial.
[d] I will use one of my NB02 at first. I will later go custom on a wideband controller.
[e] I have a VR CKP which I aim to condition using an optoisolator and op-amp/other-basic-IC with two resistors to set duty cycle. I need to know the duty cycle that Speeduino expects and how the VR conditioner triggers/ends a pulse - by integration or just level crossing?
[f] I will use the stock missing tooth wheel (at flywheel) for the CKP and adjust the code if needed to accept this.
[g] Make sure I still get warning lights on my dash and to use the stock dashboard Tach and Speedo. I will add a display for TunerStudio.
[h] I will add logging for all my O2 sensors so I can see if there is a problem, I haven't figured out if the AFR can be changed per cylinder or pair of cylinders. The stock ECU does this per pair, and a lot of other interesting compensations for misfires/blocked fuel/etc.
Extract information from my stock ECU maps and apply them in TunerStudio to get close to stock before I do real tuning.

[4] Things I'm not sure about
[a] What are the failure modes?
(b) If the TPS fails, is there some kind of fallback? Does it default to running off O2 sensors?
[c] A lot of failure-mode and fallback thoughts.
[d] Is there anything like error codes you get with OBD or we just look at raw data?
[e] What is the point of using Teensy? I like the hardware itself, but the Mega seems to have enough resources to do the job well. You need a separate tablet/laptop for TunerStudio anyway.
[f] Can this be run as a piggy-back? I suspect diodes on any shared wires would be needed.
[g] How many and which of the Arduino Mega pins are unused by Speeduino and free to be used for other tasks? Is this advisable or has every clock cycle been squeezed/optimised to the max already?
[h] Based on that, I wonder if I should just add a second Arduino Mega for any extra functions I need - if it can't be incorporated into the first.

Thanks for reading this far and wish me luck!
Last edited by DeeeeC on Sat Jul 11, 2020 12:56 pm, edited 1 time in total.
#44172
Direct injection injectors use high voltage 60+ volts. you can't trigger them with grounding mosfets, You will need a power multiplier to get the higher voltage.
Timing of the injection points have to be EXACT timing.
There are some guys on RUSEFI working on the project of direct injection, maybe check that out first to see how they are doing it (or not doing).
#44175
You say you have been reading but have you read the wiki?
A fair few of your questions are explained in there and it will clear up your understanding too!
#44178
DeeeeC, very cool that someone is having a go at this. I've long been wanting to try but am so time-poor that it just never happens.

Have you considered using an external controller for the fuel rail PWM control. This is very easy to implement as you can buy off the shelf PWM controllers for common control schema (0-5v / 0-10v / 4-20mA / etc). Might be good as an interim solution.
NickZ wrote:
Fri Jul 10, 2020 4:12 am
Direct injection injectors use high voltage 60+ volts. you can't trigger them with grounding mosfets, You will need a power multiplier to get the higher voltage.
You should easily be able to do this with a simple DC-DC converter and changing the existing STP75NS04Z's for higher voltage versions (they are only max 33v). As long as the 0V is tied between the Speeduino and the DC-DC converter it should work.
NickZ wrote:
Fri Jul 10, 2020 4:12 am
Timing of the injection points have to be EXACT timing.
There are some guys on RUSEFI working on the project of direct injection, maybe check that out first to see how they are doing it (or not doing).
Timing should really not be an issue. If the Speeduino can accurately control the spark event, then it will have no issue controlling the injector event. Besides, the rod angle & piston position at or near to TDC do not really change much, so if anything the window for the injector event is a LOT wider than that for the spark event. Speeduino should easily be able to handle it

/DM
#44184
justthetim wrote:
Fri Jul 10, 2020 1:16 am
This is way beyond me, so I'm just here to wish you luck.

btw what car do you have?
Thanks, encouragement helps a lot! Alfa Romeo 156 JTS 2.0 2004.
DeeEmm wrote:
Fri Jul 10, 2020 10:51 am
@DeeeeC Is the Alfa 156 JTS 2004 factory DI?
Yes. Alfa were really ahead of the curve with direct injection but this engine was much-hated for general GDI issues like coking of the inlet valves and high oil consumption. I think I have one of the last 100 or so JTS models still running.
dazq wrote:
Fri Jul 10, 2020 6:14 am
You say you have been reading but have you read the wiki?
A fair few of your questions are explained in there and it will clear up your understanding too!
Yes but a lot of it was late at night so I need another crack at it with some coffee!
NickZ wrote:
Fri Jul 10, 2020 4:12 am
Direct injection injectors use high voltage 60+ volts. you can't trigger them with grounding mosfets, You will need a power multiplier to get the higher voltage.
Timing of the injection points have to be EXACT timing.
There are some guys on RUSEFI working on the project of direct injection, maybe check that out first to see how they are doing it (or not doing).
I can test this. I think these injectors were kept simple back in 2004 at 12V but I can test this fairly easily. I checked all of the mosfets and controllers in the stock ECU and read all the datasheets - none were rated to voltages that high but I can double check those and use a multimeter to be sure. They use IGBTs as well as MOSFETs.
DeeEmm wrote:
Fri Jul 10, 2020 10:44 am
DeeeeC, very cool that someone is having a go at this. I've long been wanting to try but am so time-poor that it just never happens.

Have you considered using an external controller for the fuel rail PWM control. This is very easy to implement as you can buy off the shelf PWM controllers for common control schema (0-5v / 0-10v / 4-20mA / etc). Might be good as an interim solution.

You should easily be able to do this with a simple DC-DC converter and changing the existing STP75NS04Z's for higher voltage versions (they are only max 33v). As long as the 0V is tied between the Speeduino and the DC-DC converter it should work.

Timing should really not be an issue. If the Speeduino can accurately control the spark event, then it will have no issue controlling the injector event. Besides, the rod angle & piston position at or near to TDC do not really change much, so if anything the window for the injector event is a LOT wider than that for the spark event. Speeduino should easily be able to handle it

/DM
I agree with the timing resolution. There is more tolerance for fuel timing and there is already very precise control over that. The timing wheel is also accurate as this level of precision was built in from the factory. i.e. the missing tooth is small enough and the CKP sensor responsive enough. This is tunable.
About the voltage and current requirements - my thoughts are either change the stock MOSFET or just use it to switch a bigger MOSFET! You can daisy chain MOSFETs because, in a simple sense, they are just like a solid state relay. My theory is my Injector runs at 12V but MOSFETs are cheap and easy to use so not a problem to replace. The voltage source can be from DC-DC converter as you say and tied to common ground.

[5] I/O limits
I have read up a bit more on this and there are enough pins from the Arduino Mega to give me all the functionality I want. Testing if it introduces any lag though is something I guess has to be done in practise. There are port expanders over I2C that give another 16 pins through multiplexing but I don't need those yet - also I read I2C messes with the code.

My PCB has arrived and I have most of the parts so I should be soldering all weekend! Also retrofitting this into a spare ECU casing. At 200mA max current use, cooling is not even an issue. But I like the thick aluminium shielding of the stock case. I will 3D print an internal bracket.
Last edited by DeeeeC on Sat Jul 11, 2020 12:57 pm, edited 1 time in total.
#44187
A mockup of where the PCB will sit in my ECU case. I cut off the old PCB where the harness connectors are soldered. I might just desolder that remaining bit of PCB.

I saw some amazing user boards that have been designed to solder directly to a 154 pin Bosch connector. However, I'm not using those designs as I have weird shapes in this case for integrated heatsinks and I wouldn't be able to clear all components so I'm doing it this way.

Image
#44194
DeeeeC wrote:
Fri Jul 10, 2020 5:57 pm
Yes. Alfa were really ahead of the curve with direct injection but this engine was much-hated for general GDI issues like coking of the inlet valves and high oil consumption. I think I have one of the last 100 or so JTS models still running.
I loved my 156 JTS, even being FWD it was such a nice drivers car. Of course it had coking problems, the soft cam issue and eventually put a hole in a piston, but it was great other than that :D
DeeeeC wrote:
Fri Jul 10, 2020 5:57 pm
I can test this. I think these injectors were kept simple back in 2004 at 12V but I can test this fairly easily. I checked all of the mosfets and controllers in the stock ECU and read all the datasheets - none were rated to voltages that high but I can double check those and use a multimeter to be sure. They use IGBTs as well as MOSFETs.
These absolutely run at higher than 12v in the JTS engines. They're piezo injectors and will not open against the piston at 12v. I haven't looked closely, but I believe the ECU in these actually controls the injector voltage and varies it at different RPM. Form memory they're specced up to 200v via the DC/DC output stage.
#44205
Wow Josh, glad you said that! :)

I also have to put in a new cam!

That's great insight on the injectors. I will have to capture some live data from a running engine and try to use that to replicate the functionality. :shock:
L TWIN ducati vr signal need help

As above a tooth log would be useful. Which condi[…]

Modified 3 cylinder

You would still need to remove the intake setup of[…]

In my experience the problem only usually occurs[…]

3rz-fe turbo. help with iac valve

READ THE WIKI. https://wiki.speeduino.com/en/conf[…]

Still can't find what you're looking for?