Soviet generator, UD-25 engine, ignition using arduino

hello,
i built gasifier a year ago ,but could not use it otherwise than just burning flare and heating workshop, because engine of the generator was missing magneto.

as solution i tried to use an arduino hooked to hall sensor and two ASIC ignition coil drivers.
now the generator is putting out 2.5 - 3.5 kw of power, depending on gas quality.

here is link to the video of the generator running ))

21 Likes

Hello Andris,
This looks very good to me. I also want to build an ignition system. I have an old Briggs and Stratton generator. I want to be able to control the ignition timing. You told us about the Arduino, Hall switch, and ASIC coil drivers. That tells me a lot. But I would still be interested in in any more information you can tell us.
Rindert

10 Likes

hi Rindert ))

here is link to code, it is far from optimal, i guess, because i just took solar tracker control program i wrote earlier as base.

it was convenient, because tracker program contained sort of user interface using rotary encoder and OLED display and provided easy way to change all sorts of parameters.

the hall sensor is latching type and there are two magnets embedded in aluminum fan on the crankshaft,
one magnet at TDC turns hall sensor output to high state, second magnet which is placed 90 degrees prior to TDC turns hall sensor output to low state.

for driving the coils, i did use MOSFETS first, but they did not last long, because coils are creating terrible voltage spikes of all sorts in primary windings, IGBTs can handle them, but then again they need gate drivers to operate properly and that gate driver died when i tried to use IGBT. ))

the ASIC i use now is called VB525SP-E, it can be driven by arduino pin directly though 1k resistor, but i drive it through an optoisolator, because of voltage spikes mentioned above.

if you have more specific questions, i will be glad to answer ))

9 Likes

Do you know a good place to buy VB525SP-E? It says STM doesn’t make them anymore.
Rindert

3 Likes

i bought mine on Aliexpress.

4 Likes

It looks like Mouser has the ST VB325SPTR-E which i think is similar but I didn’t compare datasheets.

It looks like the ONSemi/Fairchild ISL9V2040S3ST might be similar and only $2.50.

6 Likes

Thanks Guys,
I have some really good info now. I think I’m going to try using a Raspberry Pi, just because I have one. And I want to use C language, just because I took a course in it.
Rindert

5 Likes

the raspberry pi is an applications processor, the Pi Pico is a microcontroller. You are best served to use the microcontroller for timing specific applications. It is basically all about scheduling.

The .ino files he has posted are from the arduino IDE which are C/C++ and you can use the arduino IDE with the Pi Pico as well as many other microcontrollers. `
That being said you might be able to get away with it on a newer pi and dedicate a single core to the application. Then the scheduler isn’t bumping the process to time share with something else. There is also real-time linux kernel, that you can use.

4 Likes

yep, MCU is more suitable than Linux system when exact timing is critical.

and one can write in good old C in arduino IDE.

just put your code into int main() instead of void setup() and void loop().

manipulating registers and timers directly instead of using arduino functions results in faster and more effective code.

3 Likes

I would change that to ‘MAY result in faster code’. Optimizers have improved considerably over the last decade. I don’t know if that has all filtered back to arduino, which uses an older version of the gnu compiler. but I suspect a lot of it has.

5 Likes

Wheew! Now I have a lot of studying to do. Thanks.

5 Likes

Most microcontrollers, including the Arduino, have hardware timers with interrupts. An interrupt allows you to “interrupt” the main program loop and run specific subroutines with precise timing. This is exactly what you would want for engine control. Programming an MCU is close to “bare metal” so you have the advantage of directing things exactly but at the cost of having to know exactly what should happen and how.

Raspberry pi is much easier to program but generally speaking, software timing is less precise especially with an operating system like linux doing its own work in the background. That said, an ARM chip like the rpi has is a beast compared with a typical micro controller. The overhead from Linux may be low enough it doesn’t matter.

3 Likes

I will eventually want to control timing based on knock sensor feedback, like OBD2 systems. Will this Pi Pico allow me to do this? Maybe the Pi Pico H is better?

https://www.sparkfun.com/products/17829

1 Like

Would this be a good optoisolator?
https://www.sparkfun.com/products/15105

1 Like

Browsing Sparkfun.com I found CO, H2, CH4 sensors. I could build a fuel gas analyzer. But some other time. :slight_smile:

1 Like

i think any opto coupler will do, i use sharp pc817.

also i forgot to mention flyback diode on ignition coil that helps to mitigate negative voltage spike, i use BYQ28E-200 fast diode.

3 Likes

I think the pico and pico H are essentially the same except the soldered on male pins on the H. They mention something about the debugging port but that is a hardware debugger so it is really low-level debugger to the point it is irrelevant for 99% of the pico audience. the W adds wireless networking.

How are you going to add a knock sensor or are you looking at a larger engine in the future? Are you looking at adding CANBus like ODB2 has as well? you can buy boards with the canbus chip on them, and they will connect either via spi or i2c buses to the chip. There are some development boards that have the canbus chip already on them which is why I asked.

I am asking in part because the arduino had issues with multiple cylinder engines, and the pico is faster but the m0+ series isn’t the fastest series of arm microcontrollers either. It is about the lowest budget controller with the current ARM designs. It is a good one for small projects and good to get your feet wet with. It isn’t really that hard to jump to a faster chip either even low level stuff should work on the m4 or m7/h7 series arm microcontrollers. They just add features like FPUs and faster/more clocks.

1 Like

greetings ))

a new video of generator at work, charging solar battery bank
intercooler is used for heat extraction from exhaust gases,
also i installed an oxygen sensor, although it is just connected to
a multimeter for now.
it seems that this sensor is very well suited for ATMega 328 MCU, its
output is between .02 and .85 volts, so it can be connected directly to an
ADC pin, using MCU’s internal 1.1 volt reference voltage.

i drilled a 2mm hole in the lowest point of intercooler in order to drain condensed water.
it is squirting in bowl, as you can see in the video. ))

10 Likes

For those interested in open source Arduino -based engine controllers, check out this guy.
Google “Josh Stewart Speeduino” or:

Pete Stanaitis

6 Likes