Speeduino is now on Github Sponsors (Rather than Patreon): https://github.com/sponsors/noisymime
Any general discussion around the firmware, what is does, how it does it etc.
#20116
Hi guys,

Fist of all I want to extend a massive thanks and well done to everyone in this community and especially Josh for all the hard work bringing this project to the world.

I got into Megasquirt 10 years or so ago and street-tuned a couple of cars with it, and loved MS and what it represents. then it got weird - a bunch of commercial offshoots started up and the original MS didn't get much love, beyond the awesome documentation, it just ended. The DIYer got left behind. I think this project picks up where MS left off really nicely - updating and simplifying the hardware, and allowing the community to create amazing custom designs :D

Onto my question!

"Is it possible to use a Speeduino as a datalogger to log RPM vs MAP/TPS vs Ignition advance?".
My scenario is - I'm Speeduino-ing an already running EFI engine, and my aim is to increase the ignition advance and not much else. I want to establish the current ignition advance table without hacking the current ECU by datalogging the RPM vs MAP/TPS vs Ignition advance, and finally replicate this table into the Speeduino and advance it by a few degrees where necessary. I'll then run it solely on the Speeduino.

I don't plan on taking it to a dyno, because it's just not worth the £££. This is a single cylinder 125cc engine (Yamaha YZF-R125) and i'm only trying to extract another 1-2hp from this motor :lol: :oops:

I did consider building an Arduino/STM32 device for this purpose, but trying to get my head around how to log the missing tooth on the VR input hurts my brain.

All the Speeduino would need is to log an extra external input (a nicely conditioned logic level spark input) and record it in a custom channel in the datalog somehow. From this data, an ignition table could be built.

Does this functionality exist/is it achievable?
Last edited by Aivaras Seduika on Thu Jul 27, 2017 8:16 am, edited 1 time in total.
#20135
Hello, Aivaras Seduika! 8-) Certainly, you can use Speeduino to collect data and then control the ignition. Step back, and consider Speeduino as simply a collection of inputs and outputs. You can connect it to the existing VR and TPS signal outputs, and route the tube for MAP, and log those. You can also connect your ignition logic signal to an open input (example, CLT) and log that. Note you will have to delete the bias resistor in that circuit for this purpose, ground both units solidly together in order to get a safe, clean, and usable 5V TPS signal, and route the VR signals through a suitable VR conditioner. In TunerStudio, you can see the signals and log them, then view and plot them in MegaLogViewer or Excel or whatever.
Aivaras Seduika wrote:
Wed Jul 26, 2017 12:31 pm
... and finally replicate this table into the Speeduino and advance it by a few degrees where necessary.
My confusion from this is — if you somehow know where a few degrees of adjustment is necessary, you don't need to go through the collection hassle, and just set your timing everywhere in the table properly using that knowledge. If you can determine the best ignition advance to correct the OEM data; why do you need to collect the incorrect OEM data at all?

David
#20153
Perfect, so it's not all that difficult on the hardware side :D.

Going one step further: I know I need to study the code but do you think it would be possible to create a new variable in the firmware and pass it into TunerStudio as a loggable, graphable channel? I'm thinking either counting the teeth after the missing tooth until the ignition event (coming in via a spare input channel), from which I can work out the ignition advance angle. Or starting a timer between the missing tooth and the ignition event, and working out the advance by taking into account current RPM.
#20160
Aivaras Seduika wrote:
Thu Jul 27, 2017 5:44 am
Perfect, so it's not all that difficult on the hardware side :D.
Not that difficult, but much more work than skipping the exercise completely. ;)
Aivaras Seduika wrote:
Thu Jul 27, 2017 5:44 am
Going one step further: I know I need to study the code but do you think it would be possible to create a new variable in the firmware and pass it into TunerStudio as a loggable, graphable channel? I'm thinking either counting the teeth after the missing tooth until the ignition event (coming in via a spare input channel), from which I can work out the ignition advance angle. Or starting a timer between the missing tooth and the ignition event, and working out the advance by taking into account current RPM.
There are much easier options than reinventing the process and likely the best one is to use a 2-channel oscilloscope. Lacking one of those or if you are on a (really) tight budget, you might get one of the 8-channel USB logic analyzers (under $10 everywhere online) to pull the same info (tooth counts from the ECM and ignition logic pulses) and also have free graphing software available from Saleae. Or, you could hook-up Speeduino and tune the ignition, so you would know the best timing instead of the OEM timing.

David
#20164
You are right, using a scope would be much easier. I do have a 2 channel scope but it doesn't datalog.

Ideally I would do logging while driving, putting the engine to all the extremes of map/tps/rpm and analyse the log later to get the reference ignition map.
Having a scope hooked up on the road sounds a little sketchy! Doing this on the bench would be fine, but I don't have a brake dyno so no way to load the engine on the bench :| .

I suppose I could get the Speedy working alongside my ECM, make Speeduino fire it's ignition output on the missing tooth, and knock up a spare arduino that uses the missing tooth trigger from the Speeduino and the ignition signal from the ECM and logs the time difference vs RPM.

But I've gone full circle and made it even more complicated :shock: :lol:
#48786
Hi guys,
Sorry to bump such an old thead - I parked this project 3 years ago but now i'm looking to pick it back up again :D
I haven't managed to find any solutions to this.
Has anyone new to the forum managed to achieve this?

I have thought a little more about it: it might be possible to modify a speedy to do logging.
There would have to be some minor hardware mods, and it would have to run a custom firmware that purely logs data and not interfaces to TunerStudio.

Hardware:
If your OEM trigger is 0-5v, it could be tapped and input into speedy's trigger input (just making sure to remove any pullup or pulldown on the input).
If it's a multi-cop engine, one of the coil trigger wires could be tapped and in input into a speedy spare input via a voltage divider (12v>5v or 3v3).
One of the injector signals could be tapped and input via a voltage divider into a spare speedy input.
TPS signal into speedy TPS input, making sure no pullup/pulldown exists.
SD card module added.

Software:
Every crank trigger event would fire an interrupt routine which checks the states of the above inputs and milliseconds since powering up, and appends the array to a CSV file on the SD card.
This might not be enough resolution for the ignition advance calculation, so might just have to be timed
The spark angle, injection pw and tps can be calculated from the raw data (python script?)
I think a single cylinder coil input is enough to figure out the advance angle from.

Depending on how many teeth on your trigger and how many RPMs, there's quite a lot of write access to the SD card, not done any calculations to figure out if this is possible yet :lol:

Or all of the calculations could be done on the MCU and the data saved to the SD card is more processed - actual ignition angle/tps/injector pw, but not sure if the Atmega is quick enough to do all that. STM32 definitely.

What do you guys think to the above? Possible? Too much work? Worth it or no :lol: ?
#48831
theonewithin wrote:Is there a reason why you want to log this info?

None of it will be useful if you switch to aftermarket ECU.
Its to log a factory tune, and replicate it onto a speeduino as a base reference tune to work from.
Basically trying to avoid dyno time, which is expensive.

Mostly ignition advance vs rpm & injector pw/map vs rpm.

Using a cts you can get an idea of how much warm up enrichment is being used
#48832
What engine are we talking about? A base map to start with is nice to have, but not essential.
Why don´t you read out the current tunes file, find the ignition map and start from there. You can use free versions of chip tuning software to find such maps in a few seconds.
With ignition systems I was unable to read out (Marelli Digiplex) I took the workshop manual and copied the diagrams printed there into a basic map.

Usually, factory tunes are made to limit power in high rpm, so the engines last longer. This is made with both, ignition timing and fueling. So, in the end you will run something quite different, for optimized performance.
Injector dead time tester

The only way to maybe do it correctly without me[…]

Yes, but voltage is limited one some, such as the […]

Second injector bank

there's a section on staged injection in the wik[…]

EMI while cranking

Well in a last ditch effort and using scrap parts […]

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