Hackaday Prize Entry: Engine Control Units And Arduinos

The modern internal combustion engine is an engineering marvel. We’re light-years ahead of simple big blocks and carburetors, and now there are very fast, very capable computers sensing adjusting the spark timing, monitoring the throttle position, and providing a specific amount of power to the wheels at any one time. For the last few years [Josh] has been building a fully-featured engine management system, and now he’s entered it in the Hackaday Prize.

The Speeduino project is, as the name would suggest, built around the Arduino platform. In this case, an Arduino Mega. The number of pins and PWMs is important — the Speeduino is capable of running the fuel and ignition for eight cylinder engines.

The Speeduino is designed to do everything an engine control unit can do, including rev limiting (although if you’re building your own ECU, why?), and reading ethanol sensors. Right now [Josh] is working on a beta run of the Speeduino designed for the 1.6L Miata. That’s an excellent platform for firmware performance tuning, and there’s still a lot of work to be done on the firmware side of things before everything’s all set to go. Still, this is a great project and sure to impress the bros at track day, bro.

66 thoughts on “Hackaday Prize Entry: Engine Control Units And Arduinos

  1. “The Speeduino is designed to do everything an engine control unit can do, including rev limiting (although if you’re building your own ECU, why?)”

    1: Engines can only rotate at a certain maximum RPM. Beyond that you’ll get all kinds of unwanted things, like valve float. This means your valves won’t close, because the mass of the valves and the spring need a certain time to move. If the valves close too late, some of the air/fuel mixture is going to be expelled back through the intake during the compression stroke and some of the exhaust gas will be sucked back in during the intake stroke.

    2: Launch control. This is why 2-stage rev limiters exist. First stage is LC, revs your engine to the perfect rpm at which you can dump the clutch to make the car start as quickly as possible without putting too much strain on your drivetrain or causing your driven wheels to slip. Note: Of course, if you have wheel speed sensors you could just implement traction control. But the rev limiter will still be required for LC.

    3: Engine protection. If the ECU detects a fault serious enough – “danger to manifold” – it should limit engine speed to a level that is safe enough to get the car to the next shop or home by its own power. This is usually called limp mode, most modern cars have that coming out of the factory. There are many things that may cause an ECU to go into limp mode. Too low oil pressure, too high oil/coolant temps etc.

    1. I was gonna say something similar, but you nailed it. I assume the writer of this article has minimal automotive experience and mistakenly thought a rev limiter was some sort of “power limiter” so to say.

      1. Mr. Benchoff has an outstanding reputation for minimal restraint against (or considerable skill in?) writing trolling comments that encourage additional comments to be submitted at the end of his articles. ????

        1. That’s his job isn’t it?

          I am grateful for the time anyone writing articles on here puts into trawling through the tons and tons of crap on the Internet in order to post here things that we may find interesting to read, that alone gives them the right to write what they want in their article. :)

      2. And yet is a topic for a nice discussion:

        1. If you’re adding a different ECU, probably you’ve changed also the valve train, including springs. This doesn’t avoid valve floating, but you´re having fun with the engine. So who cares of the valves float (it’s part of the fun, take the engine to the limit).

        2. Launch control didn’t matter in the times prior to ECUs eg old muscle cars. It’s mostly related to a comfort thing. However if we a modified engine, a modified power train and a modified ECU, the become parts of the same toy: a tuned car, and the last thing to care is about not burning tires…

        3. On engine protection, I totally agree. Modified or not, an ECU is also the engines’ watchdog for those hidden details that may risk the engine

          1. If the piston and valves meet, the first thought would be a timing problem. Second, if the math between engine speed, piston speed, and springs expansion timing suggest they may “kiss each other”, you use harder springs, or double springs. In some cases you can make a rework in the engine stroke and rods, and carve deeper valve marks, and use an asymmetric profile cam. And finally, most of the floating valves problems are due to resonance in the springs. An elegant solution for this has been the use of dual or triple springs, and is not for providing more strength to the assembly, but to work as mechanical snubbers and suppress resonance and valve floating. At the end, engine and ECU should be modified accordingly to achieve the desired performance.

        1. “a tuned car, and the last thing to care is about not burning tires…”

          Actually that’s one of the main things i’d care about on a tuned car. While wheel slippage may look and sound cool, it doesn’t get you far. Slipping wheels do hinder acceleration, i’d rather put the power into going fast than into a cloud of smoke. Plus oversteer is also not that good of a thing to have.

          1. You’re absolutely right!!! Slipping wheels is not necessarily a sign of engine performance. On the other hand that’s why a good tuning or modification must be made in accordance to every available component. My point was in the sense that with old “ECU-less” engines, this was a minor concern and yet you got all the fun of having a tuned car!!!

        2. Well, launch control did matter back then when. The only difference was that people had to do it manually. Well…with their feet that is. Which was a tad unreliable because it’s not that easy to hit the perfect rpm by just using the throttle. I’ve seen LC used in rally(x), drag racing and more.

          1. The product was developed to be used together with a very cheap, accessible and well known platform. This allows people to quickly adapt the product to other cars and uses. That sounds like a smart thing to do to me, as having some proprietary or lesser known microcontroller is not going to contribute to the success of the endeavour.

            I really don’t see how this is advertisement for Arduino. They certainly don’t need this product to cement their name as a ubiquitous development platform. It also doesn’t reek of the kind of product placement Intel bombarded the community with.

            Your consistent use of ‘Tarduino’ instead of the actual Arduino suggests you have a strong dislike for the platform or product, which may have coloured your perception of this ECU product.

          1. Moryc: Ah. Didn’t catch that. It’s kind of stupid – if you’re going to design a PCB, putting the microcontroller and the few associated discrete components on it is no more difficult than putting the connectors for mating with the Arduino board.

            I’ve bought only one “Arduino”, and that was a clone. Now if I want to build an AVR-powered project I just build the whole board. I don’t even use the Arduino IDE any more, now that I have a Makefile that lets me use the GNU gcc compiler directly (thanks, Adafruit).

    2. to add to your #1:

      Valve overlap is a good thing sometimes and while you may loose some of your air fuel mixture down the exhaust port, the overlap in vales can help evacuate all of the exhaust gases. then again the overlap is controlled by the cam lobes them selves. Controlling valve float is super important not for the overlap but because most modern motors are interference motors which means that the valves will collide with the pistons if they are held open for too long, which is why doing your timing belt at regular intervals is important lest the cam skip a tooth and the valves hit the pistons.

      1. Or better still avoid cars that use elastic bands to drive the cams. :)

        If you want to take an engine to such high revs then you have to go with Desmodromic valves in order to remove all the problems of valve bounce and float.

          1. yup, any crank to cam motion transfer through belts or chains are entirely dependent on the tensioning mechanism. For example some Audi S4’s have a really bad flaw in their plastic timing chain mechanism which causes lots of horrible crunching noises when they fail. The repair is even more fun considering the timing chain is on the back of the engine which means almost a full drive-line removal.

            One way to solve this issue is to switch to a gear driven solution which can be very costly but sometimes necessary in racing applications

    1. Is there a difference significant enough to complain about? Four is less than eight, so if it can run an eight cylinder engine, the hardware is obviously capable of running a four cylinder engine. I bet it could run a one cylinder weed wacker engine too, do you want that explicitly listed?

        1. Different story, but same concept: firing injectors for two or more cylinders simultaneously. The term most commonly used for that is “batch fire”. It actually works quite well and has been done by OEMs. The main impetus for not doing so is reducing emissions.

          1. You’re right, I saw that concept in and old Camaro (or was it a Corvette??). At first it made me think something was wrong with the design, then I learned the performance benefits of a highly enriched mixture, but also the consequences in emissions.

      1. For those who know more about computers/electronics than engines, clarifications of capabilities help. I’m an engine noob so saying ‘up to 8’ takes the capability question from a ‘maybe’ response to a ‘yep’ response – and makes it much more interesting to me as I don’t need to assume.,, and we all know what assuming makes us – future entrants to HaD’s fail of the week.

    1. Hmmm. That one has an STM32 (Cortex M4) chip. That seems like a chip with more legs for an ECU application. ie- faster, bigger, 32 bit and with an FPU. The speeduino guys have #ifdef STM32 in their code, but it’s all stubs at the moment.

      1. Currently Speeduino also runs on Kinesis ARM MCUs (Think Teensy 3.5/3.6) and stm32 is experimental. Most of the core is working for stm32, but not the aux stuff like boost, idle etc.

        The idea is for a single codebase to support multiple families, depending on user preference etc.

      2. What part of controlling the ignition and injection on an engine do you think benefits from a 32-bit CPU and floating-point hardware? This is the sort of stuff 8-bit microcontrollers were MADE for. It’s only when you add a touch-screen LCD panel to handle the user interface for on-the-fly parameter changes and real-time performance analysis that you actually need some computing power.

        1. Can you do an ECU with an 8 bit microcontroller? Of course. Should you choose an 8 bit microcontroller for new designs? No. Cortex M designs are just as cheap and much more powerful. People pick the Arduino/AVR designs because they are familiar with them, as a microcontroller they are behind the curve. Ultimately the 32 bit, FPU and higher clock rate is going to let you add more features without blowing out the real time requirements of the processing loop.

    2. Whilst there wasn’t much time between the 2, I think I started Speeduino a couple of months before rusEFI became a thing (mid-2012ish?). I’ve been doing regular monthly firmware releases for the last 2.5 years or so, no plans on abandoning things now that it’s actually picking up a user base :)

    3. Whilst there wasn’t much time between the 2, I think I started Speeduino a couple of months before rusEFI became a thing (mid-2012ish?). I’ve been doing regular monthly firmware releases for the last 2.5 years or so, no plans on abandoning things now that it’s actually picking up a user base :)

    1. There’s also this “pre-alpha” closed-source thing called nanoEFI… I was originally looking at it with hope as they only recently announced being closed… but basically speeduino is too big to fit in a tiny motorcycle (without a hardware reimplementation).

  2. Corsa 1.7dti
    Model (1999)
    It is a very nice car when driving it but I stuck on the road last month due to the ejector diesel stopped. I then contacted someone in jhb and said it could be ECU comes behind the diesel pump.
    I took that ECU out and send it ,they send it back and the car started but with no enough power when driving it ,black smoke would come out and ended up stuck again.please help me .

    1. Diesel cars ECU’s usually need some reprogramming or “calibration” to match each injector with the ECU, otherwise the stoichiometric mix is never achieved and you get little power or black smoke. Investigate about that or talk to a mechanic with a good scanner.

  3. I wonder, how often it will fail in a noisy environment of engine compartment. I’d imagine users will have to bring lots of replacement Arduinos due to limited EMI protection. And let’s not forget vibration and G forces. Imagine an engine failure because Arduino board vibrated out of its socket and now is an electronic roadkill. And how about water, oils, fuel, dirt, extreeme temperature variations? There is a reason ECUs are packed in metal shelds and often coated with polyurethane or other protective resin. There is also reason manufacturers often write in datasheets and on their sites which of their devices are suitable to use in automotive or medical industries…

    1. There’s also a reason why ECUs rarely are to be found in engine compartments. They’re mostly hidden somewhere under your passengers feet.
      This would keep the dirt and stuff away from the ECU, yes.

      But you’re right on the noisiness of the whole thing. Yes, there is a reason why some parts are explicitly marked to be suited for automotive. An Arduino is probably not one of them.

      1. Atmel do AEC / Automotive ‘rated’ MCUs, but literally the only difference is their max temperature. There’s no difference in terms of EMI etc. Speeduino isn’t designed to be located in an engine bay, so temperature really isn’t a major consideration.

        In terms of electrical noise etc, feel free to checkout and critique the schematic to see the work that has been done here: https://github.com/noisymime/speeduino/raw/master/reference/hardware/v0.4/schematic%20v0.4.3_schem.png
        Every input is voltage protected and has multiple signal filters etc. The power supply is reverse protected and has been tested against voltage spikes of 120v without knocking anything offline. To the best of my knowledge, no one has lost an arduino yet on a running engine, certainly I haven’t in the 3 years I’ve been driving with one :)

      2. I’ve seen some ECUs on the engine bays, BMW and Mercedes have them, I’ll tell you more, some Mercedes engine’s have the ECUs right on top of the engine, on the intake manifold, surrounded by the air filters housing. French cars do that a lot too, the ECU in the engine bay, next to the Battery, some times with no (or really poor) ventilation. Nissan does it a lot too, 200*’s Quests have them… It’s not so rare.

Leave a Reply to DavidCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.