Re: Arduino Based CDI

I could design and make the boards for somthing like this, but wouldn't be able to handle the code. Man, board fab is so cheap now it doesn't even make sence to make them myself anymore.....what a world

Esp32 could handle it easily....I'm kinda blown away that this doesn't this exist already.

Man I haven't made any digital projects for such a long time, basically just been focusing on my ham, radio and tv resurrections......might have to think about this

I kinda joked a few years ago that I was going to make a tube based kinda--cdi with low voltage Soviet pico-tubes...because why wouldn't you use a tube instead of a 30 cent transistor or diode, then make a filament supply just because....lol that was such a stupid idea.

Re: Arduino Based CDI

Dirty30 Dillon /

The last thing I want to complicate, is my 40 year old moped ignition.

That said, I applaud anyone who takes the time to build and code this out.

Re: Arduino Based CDI

๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ’ฆ Of the Loin /

Using RTOS would make it work in real-time for sure

And this wouldn't make it any more complicated than a CDI box already is

Re: Arduino Based CDI

it would be super cool to make this box work with a pietcard setup too!

Dillion it's not for old stockers. It's for blasters. And wanna be tuners like me.

Re: Arduino Based CDI

You don't even need a full RTOS, you could run it from a simple interrupt trigger.

Re: Arduino Based CDI

๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ’ฆ Of the Loin /

But I want an async web server to let me toggle curves on the fly from my smartphone

Re: Arduino Based CDI

Dirty30 Dillon /

> Jay Rivett Wrote:

> -------------------------------------------------------

> it would be super cool to make this box work with a pietcard setup too!

>

> Dillion it's not for old stockers. It's for blasters. And wanna be

> tuners like me.

I have plenty o blasters that didn't require me to do any board level work. Like I said, if you're a computer man, this is sick. I just don't have the technical aptitude to make this, and can't see a reason to trudge through programming if I can plop a MVT/Malossi/Parmakit/HPI CDI no there and jam out.

Re: Arduino Based CDI

yamaha tzr250 was doing stuff like this up till like 2005 iirc

Re: Arduino Based CDI

Rtos? Then why not do real time logging of head and exhaust temperature as well an make a universal-ish two stroke tuning and datalogging device. This could go so deep.

Best option would be ability to change curves on the fly with a wired handlebar control, so I dunno. But....Wired control or just a phone mount.... economically speaking, server and phone mount are the way to go.

also, a phone would be ideal for actually modifying the curves too....

web repository to download different curves other have made?

Is anyone actually looking into doing this because it sounds fun. I really don't think an atmega is the way forward tho..

Re: Arduino Based CDI

There is a chip called lm1815 that works well for debouncing/digitizing a reluctor signal. It's also got some good RF isolation built in. My buddy designs custom ECU/ignition systems for race teams, they use it quit a bit

Re: Arduino Based CDI

๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ’ฆ Of the Loin /

All this can be done with ESP32

2 core, up to like 200mhz processor, they have a few mb of flash usually, has WiFi and BLE and you can buy a devkit for 10 bucks

Like let's do it I have a bunch laying around

Re: Arduino Based CDI

> ๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ’ฆ Of the Loin Wrote:

> -------------------------------------------------------

> All this can be done with ESP32

>

> 2 core, up to like 200mhz processor, they have a few mb of flash

> usually, has WiFi and BLE and you can buy a devkit for 10 bucks

>

> Like let's do it I have a bunch laying around

If I can help with anything please let me know. I can volunteer to blow up a bike for testing purposes. I have a garelli NOI that i can put a pietcard setup on to test that.

Re: Arduino Based CDI

Thenggregy Cawilan /

> Mars โ€€ Wrote:

> -------------------------------------------------------

> Ryan, are you up for sharing your schematic? I'm a little electrotarded

> and looking for a good way of doing what it looks like you've done.

>

> I don't know how you are with C, but my firmware is coming along nice

> and maybe with your hardware and my software we could have some rockin'

> stuff.

Re: Arduino Based CDI

Thenggregy Cawilan /

Sir how to convert to the arduino uno this code instead of atmel IC thanks sir and more power!!!

Re: Arduino Based CDI

๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ’ฆ Of the Loin /

I would say that I don't have a testing setup at the moment, but I'll see if I can port this to ESP32 to start with

Re: Arduino Based CDI

Will your codes for this be available open source? I would like to see if I can get my son involved in this. He has a degree in programming and it would be nice to have it put to use a bit on the selfish side. Since we did pay for it.

Re: Arduino Based CDI

๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ’ฆ Of the Loin /

Yeah no this would def be open source, would be FreeRTOS if used as well

Re: Arduino Based CDI

Sounds like we should make a gitlab

Re: Arduino Based CDI

I ordered some esp32s and am pretty excited! It does indeed look like a great product for this. I've been out of microcontrollers for about a decade, and am amazed at how much these little guys can do.

My target project for this is based on a kinetic CDI, which triggers off of the inversion of the pulse rather than using an external trigger.

Re: Arduino Based CDI

Keep it up! Up! Up!

Re: Arduino Based CDI

๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ’ฆ Of the Loin /

I have a basic RTOS shell code that stays online, so if you figure out the CDI code it should slot right in....

Ok fine I'll make a git repo for this today too

Additionally, my RTOS code will post data to an MQTT broker so if you run testing near WiFi you could do some live data streaming at ~1second resolution

Re: Arduino Based CDI

> ๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ’ฆ Of the Loin Wrote:

> -------------------------------------------------------

> I have a basic RTOS shell code that stays online, so if you figure out

> the CDI code it should slot right in....

>

> Ok fine I'll make a git repo for this today too

>

> Additionally, my RTOS code will post data to an MQTT broker so if you

> run testing near WiFi you could do some live data streaming at ~1second

> resolution

Cant it then connect into your phone via wifi to display things? Or Bluetooth? And if it needs to connect to wifi prior to connecting to your device then I have one of those MiFi hot spots from my wireless carrier. Would something like that work? It is bike mounted wifi that runs off it's own battery.

Re: Arduino Based CDI

๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ’ฆ Of the Loin /

There's some sample code I found for setting the wifi information via the Bluetooth, but right now I just hard code the WiFi info

Re: Arduino Based CDI

๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ’ฆ Of the Loin /

https://github.com/Maitlandk/mopedCDI

its private rightnow I guess just request access?

Re: Arduino Based CDI

For my use case (kinetic coils/flywheel on a vespa motor), detecting the zero crossing of the coil voltage seems like the important thing? I won't really be sure until I rebuild the engine I'm planning on using as the test bed.

I'm tempted to use a little comparator circuit for that, it'll be very fast and I can use the edge as an interrupt trigger.

Re: Arduino Based CDI

Hmm, that link gives me a 404.

Re: Arduino Based CDI

๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ’ฆ Of the Loin /

yah I made it public now

will upload a bare bones RTOS skeleton later

Re: Arduino Based CDI

I think the CDI code will be pretty simple. The basics are:

On an interrupt (either from an ignition coil zero crossing or an external trigger), schedule the spark, either immediately (no curve) or after some delay (derived from a CDI curve).

In a separate task, compute the amount of time between interrupts, and use that to calculate the current RPM.

Re: Arduino Based CDI

๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ’ฆ Of the Loin /

Okay, I uploaded some example code that runs two tasks in FreeRTOS.

WiFi connection+MQTT and a memory check function

You'll need the hornbill AWS IoT library if you want to use MQTT, otherwise just comment that out

Re: Arduino Based CDI

I'm thinking about our resolution requirements and timer stuff. I wasn't sure if we'd have access to a high precision timer on FreeRTOS on an esp32, or if we need one.

For ease of math purposes, 200 Hz = 12,000 rpm, this seems like a reasonable ballpark.

To get 1ยฐ resolution, we'd need a timer capable of ticking on the scale of 14 ยตs.

Per this page, it looks like esp_timer has microsecond precision, so that should be plenty: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/esp_timer.html

So this seems OK to me.

« Go to Topics โ€” end of thread

Want to post in this forum? We'd love to have you join the discussion, but first:

Login or Create Account