Author Topic: Need to generate precise pulses; what device/micro?  (Read 3407 times)

0 Members and 2 Guests are viewing this topic.

Offline SteveThackery

  • Super Contributor
  • ***
  • Posts: 3408
  • Country: gb
  • 50 year novice
Re: Need to generate precise pulses; what device/micro?
« Reply #25 on: February 04, 2026, 12:34:31 am »
It sounds like you may have a lot of knowledge on this sort of topic Steve, that may prove to be useful, thanks!  :-+

Always a pleasure!

Just so you know where I'm coming from, I have a degree in Motorcycle Engineering, which is basically an Automotive Engineering degree but with modules on Chassis Dynamics, which for a motorcycle is scarily complicated! The degree included setting up a Megasquirt (or was it a Microsquirt? - I need to remind myself) to run a Honda CB500 twin cylinder engine. I also did a deep dive into the functioning of the ECU on a Royal Enfield by developing a comprehensive data logger, with added idle speed stabilisation and four analogue gauges for fun.

The engine I'm working on at the moment is a 60cc Centaur - a (relatively) low revving 60cc single cylinder engine first published in Model Engineering magazine back in the early '60s. The ECU - based on an Arduino Nano Every - currently controls the fuel injection system and has software control over the cooling system waterpump and radiator fan. The software can also control the power to the ignition system, but not control the ignition timing yet.

For such a simple system with only a fuel injector, throttle blade, and some timing pickups, I would like to build a system from scratch. This engine and alternator is going to be installed in a 4 foot RC boat, which itself is all scratch built. The diy and open source EFI systems are cool though.

First thing to say is that you won't need highly accurate ignition timing or FI timing to get it running. I've found that injection pulse durations rounded to the nearest millisecond (yes, really) are fine. That's because I'm using low pressure propane, so injection durations of up to 24ms are needed.

I would start by setting the ignition timing to 15 degree BTDC to begin with. Don't worry about controlling it - 15 degrees will be fine to start and run the engine. Then concentrate on the fuel injection system. As discussed earlier, get the engine running with a knob for manual control over the fuel injection pulse duration and build the map as I described earlier. After that you can go back and incorporate variable ignition timing.

I'm going to check my degree dissertation to remind myself of the fuel injection pulse duration range on the Enfield, as it will be fairly typical for a small petrol engine and give you an idea of where to start.

One last point: you won't be able to run the injector at a substantially lower pressure than it is designed to handle. This is because the fuel pressure is instrumental in forming an atomised mist of fuel. Reducing the fuel pressure too much will cause the injector to "dribble" or "hose" - that is, inject large droplets of fuel leading to very poor combustion.
 

Offline Alex_BakerTopic starter

  • Frequent Contributor
  • **
  • Posts: 403
  • Country: us
Re: Need to generate precise pulses; what device/micro?
« Reply #26 on: February 04, 2026, 01:51:59 am »
One last point: you won't be able to run the injector at a substantially lower pressure than it is designed to handle. This is because the fuel pressure is instrumental in forming an atomised mist of fuel. Reducing the fuel pressure too much will cause the injector to "dribble" or "hose" - that is, inject large droplets of fuel leading to very poor combustion.
This is one thing I was worried about, hence the reason I wanted an injector from a small simple engine the perhaps ran at lower pressure than modern cars. I suspect finding a low cost and efficient fuel pump will be a challenge.

Gasoline is cool, but I recognize the benefits of a gaseous fuel here as well, I need to give that some thought.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 12725
  • Country: nz
Re: Need to generate precise pulses; what device/micro?
« Reply #27 on: February 04, 2026, 02:30:12 am »
Some general thoughts.

You should consider if it will be easier for your application to use one timer with n channels or n timers with 1 channel. Or some combination to link timers together to create one big timer.
This will point you in a direction in terms of MCU type/model.
It's always nicer if you can get a timer with enough bits to do all you need, you really don't want to be trying to track timer overflow and create a larger timer in software.

Timer clock speed is important to consider too.  Some MCUs have a PLL that can run the timer at a higher clock than the system core runs. Which is useful in some situations. Mostly with older slower MCUs but still worth looking into.

If using multiple timers you may want to clock them from the same source to keep them in sync. So that is another thing to check.

If it has to run fast you want to put as much of your logic into hardware as possible. You don't really want to be using interrupts for fast pulse stuff if you can avoid it, as interrupts introduce jitter as the interrupt handler is not always run a fixed time after the event occurs.
You can use DMA to turn things on/off when a timer gets a capture event etc.. however you have to consider how many DMA channels/controllers you need.

For automotive stuff I tend to like the STM32 range with CAN bus, but i've not used others so i cant really say its the best.
« Last Edit: February 04, 2026, 02:36:03 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->