Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
babyeatingpsychopath
Oct 28, 2000
Forum Veteran


I just want to throw this link I found to a product by Freescale/NXP. It's a reference design ECU for a single/two-cylinder engine with fuel injection. I think the only things you'd need to supply electronics-wise are the actual IGBTs for driving the coils (and of course the engine sensors).

I'm reading through the manual now, and it's very interesting. Hopefully they go into PCB design for isolation of noise and whatnot.

In even more fun news, the reference design kit (board + dvd + usb dongle) is for sale at mouser for $212.51.

Adbot
ADBOT LOVES YOU

noisymime
Oct 6, 2015

I tame lightning and transmute Arduinos into ECUs

babyeatingpsychopath posted:

I just want to throw this link I found to a product by Freescale/NXP. It's a reference design ECU for a single/two-cylinder engine with fuel injection. I think the only things you'd need to supply electronics-wise are the actual IGBTs for driving the coils (and of course the engine sensors).

NXP do some amazing automotive ICs. Whenever a SMT version of Speeduino is done, it will likely use some of there integrated chips for injectors, power and ignition. Hopefully for quite a bit less than ~$200 though.

That board appears to have the ignition IGBT included on it too, so good to go assuming you have some firmware.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


noisymime posted:

NXP do some amazing automotive ICs. Whenever a SMT version of Speeduino is done, it will likely use some of there integrated chips for injectors, power and ignition. Hopefully for quite a bit less than ~$200 though.

That board appears to have the ignition IGBT included on it too, so good to go assuming you have some firmware.

In your professional opinion, does the atmega328 have enough horsepower to run a 4-cylinder engine with the following parameters:
2 coils, wasted spark
2 injectors, each pointed towards two cylinders
11,000RPM rev limit.

It's basically equivalent to a 2-stroke, at that point, right? One injection and one spark event per rotation.

As I understand it, the bare minimum sensors needed (for open-loop only) are: TPS, MAP, crank angle (toothed wheel, whatever), and electrical system voltage. Essential sensors for closed loop are o2/lambda, engine temp, air temp.

My basic math sez that 11,000rpm is 4.28ms/rev, so all the math and everything would have to be absolutely done in less than 2ms/cycle, to set up dwell times and whatnot, right? The reason I ask is I have a PILE of 328s and 16MHz crystals from a drunken night on mouser, and it'd be awesome to make a few ECUs for motorcycles (for friends) using through-hole parts. The ECUs would be replacing carbs and points-based spark on pre-90s bikes, so high-strung engines are not really in the sights.

noisymime
Oct 6, 2015

I tame lightning and transmute Arduinos into ECUs

babyeatingpsychopath posted:

In your professional opinion, does the atmega328 have enough horsepower to run a 4-cylinder engine with the following parameters:
2 coils, wasted spark
2 injectors, each pointed towards two cylinders
11,000RPM rev limit.

Yes, it can be done, but you're going to be writing a lot of code to do it, Speeduino wouldn't run on it currently. I've run a 4 cylinder engine on a 32u processor (though not at 11k rpm), but it was very early code and the current stuff won't fit within the SRAM or EEPROM limits on the 328.


babyeatingpsychopath posted:

As I understand it, the bare minimum sensors needed (for open-loop only) are: TPS, MAP, crank angle (toothed wheel, whatever), and electrical system voltage. Essential sensors for closed loop are o2/lambda, engine temp, air temp.

Truly bare minimum is power, TPS and crank signal, but there's a reason ECUs have more inputs than that. It will be very difficult to tune across all conditions and will probably end up being a bit of a disappointment.

FatCow
Apr 22, 2002
I MAP THE FUCK OUT OF PEOPLE
You don't need TPS. Accel enrichment can be done off delta MAP. (TPS is optional on Megasquirt)

noisymime
Oct 6, 2015

I tame lightning and transmute Arduinos into ECUs

FatCow posted:

You don't need TPS. Accel enrichment can be done off delta MAP. (TPS is optional on Megasquirt)

TPS or MAP, you need one of the 2 for load (In addition to power and crank signal). Personally I don't like pure MAP accel enrichment as its usually a bit too slow to react in my experience, but it can work.
It's a bit of a moot point as any system that is so basic is never going to run that well, not on a car anyway.

CommieGIR
Aug 22, 2006

The blue glow is a feature, not a bug


Pillbug

babyeatingpsychopath posted:

In your professional opinion, does the atmega328 have enough horsepower to run a 4-cylinder engine with the following parameters:
2 coils, wasted spark
2 injectors, each pointed towards two cylinders
11,000RPM rev limit.

It's basically equivalent to a 2-stroke, at that point, right? One injection and one spark event per rotation.

As I understand it, the bare minimum sensors needed (for open-loop only) are: TPS, MAP, crank angle (toothed wheel, whatever), and electrical system voltage. Essential sensors for closed loop are o2/lambda, engine temp, air temp.

My basic math sez that 11,000rpm is 4.28ms/rev, so all the math and everything would have to be absolutely done in less than 2ms/cycle, to set up dwell times and whatnot, right? The reason I ask is I have a PILE of 328s and 16MHz crystals from a drunken night on mouser, and it'd be awesome to make a few ECUs for motorcycles (for friends) using through-hole parts. The ECUs would be replacing carbs and points-based spark on pre-90s bikes, so high-strung engines are not really in the sights.

I'd really REALLY recommend the Teensy 2.0/3.0 for this.

CommieGIR fucked around with this message at 15:37 on Jan 11, 2016

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


FatCow posted:

You don't need TPS. Accel enrichment can be done off delta MAP. (TPS is optional on Megasquirt)

Isn't another name for "open loop control with accel enrichment from delta MAP" just "carburetor?"

So what does the thread recommend as a good set of sensors for closed loop?
  • Oxygen sensor, obviously, otherwise there's no sensor for feedback.
  • TPS
  • MAP
  • Coolant/head temp
  • Crank angle
  • Ambient temperature/IAT

I've got all of those readily available except MAP.
Is an idle air control valve required?

CommieGIR posted:

I'd really REALLY recommend the Teensy 2.0/3.0 for this.

Well, yeah, but I literally have thirty ATMEGA328-PUs in a tube; might as well use them for something.

Hunter2 Thompson
Feb 3, 2005

Ramrod XTreme

babyeatingpsychopath posted:

Isn't another name for "open loop control with accel enrichment from delta MAP" just "carburetor?"

Some carbs have accelerator pumps!

Somebody correct me if I'm wrong but if you're doing TBI or dogshit-tier MPEFI you don't actually *need* crank angle for fuel injection, just the RPM. Things are better with it, of course.

Idle air control valves are usually optional, but are a nice refinement. You can add it later once you get your engine tuned, but you might have to put up with setting a fast idle until then. This is based on my experience poorly adding Megasquirt to a formerly carb'd car.

noisymime
Oct 6, 2015

I tame lightning and transmute Arduinos into ECUs

babyeatingpsychopath posted:

Isn't another name for "open loop control with accel enrichment from delta MAP" just "carburetor?"

As mentioned, many carbs have accelerator pumps that use the throttle movement speed for short bursts of extra fuel. The other big difference is that when you use MAP based accel. enrichment, it's based on the delta MAP readings over time, not just the current MAP value. In other words its taking previous MAP readings into account as well, which a carb can't do.

quote:

So what does the thread recommend as a good set of sensors for closed loop?
  • WIDEBAND! Oxygen sensor, obviously, otherwise there's no sensor for feedback.
  • TPS
  • MAP
  • Coolant/head temp
  • Crank angle
  • Ambient temperature/IAT

I've got all of those readily available except MAP.

That's pretty much the standard set of inputs, so you should be right to go with those. Keep in mind that 'closed loop' doesn't mean that the O2 readings (And you REALLY do need a wideband) are the main input to calculating the pulse width. Your primary load indicator will still be either TPS or MAP, the O2 just provides minor adjusts (<15%) from the base tune.


quote:

Is an idle air control valve required?

Not a necessity by any means. I've seen very few engines that really NEED an idle valve, but they do make life simpler.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


noisymime posted:

As mentioned, many carbs have accelerator pumps that use the throttle movement speed for short bursts of extra fuel. The other big difference is that when you use MAP based accel. enrichment, it's based on the delta MAP readings over time, not just the current MAP value. In other words its taking previous MAP readings into account as well, which a carb can't do.


That's pretty much the standard set of inputs, so you should be right to go with those. Keep in mind that 'closed loop' doesn't mean that the O2 readings (And you REALLY do need a wideband) are the main input to calculating the pulse width. Your primary load indicator will still be either TPS or MAP, the O2 just provides minor adjusts (<15%) from the base tune.


Not a necessity by any means. I've seen very few engines that really NEED an idle valve, but they do make life simpler.

All great info.

Yeah, I know the necessity for wideband O2, and what it's for. Right now, I have to either re-jet the carb in the winter or tape over the airbox to get the mixture right. This recent spate of 70F then 20F plays unholy hell with carburetion, and I just want something that Always Works, without jiggling the choke and cranking and letting it warm up and maybe having to manually half-choke the stupid thing.

FatCow
Apr 22, 2002
I MAP THE FUCK OUT OF PEOPLE
w/r/t not needing a TPS, for some reason I read that as TPS & MAP needed.

Do you need a cam sensor to be able to separate intake from compression for the injector timing? I suppose you could shoot 1/2 as much each time and have one of the shots hit the valve. Seems... mediocre.

noisymime
Oct 6, 2015

I tame lightning and transmute Arduinos into ECUs

FatCow posted:

Do you need a cam sensor to be able to separate intake from compression for the injector timing? I suppose you could shoot 1/2 as much each time and have one of the shots hit the valve. Seems... mediocre.

Non-sequential 2 squirt systems like this were the OEM standard throughout the 90's and even well into the 00's. There are surprisingly few disadvantages to it, though sequential can aid with things like fuel economy and idling. In some cases it can even be preferential to have 2 squirts as opposed to 1.

scuz
Aug 29, 2003

You can't be angry ALL the time!




Fun Shoe
The link is being sneaky on me but Dose Vader or one of the other MCM guys on Facebook provided a link to a video series from the High Performance Academy. The idea is giving 6 free videos that give you the bare minimum of what you know to tune an engine and I'm wondering whether anyone else has seen this? It seems okay so far but I 1.) know nothing about any of this, and 2.) am not too far in yet.

edit: some lightweight googleing got me here: https://www.hpacademy.com/ there's a pop-up that tells you bout your free lessons etc.

scuz fucked around with this message at 16:56 on Feb 17, 2016

CommieGIR
Aug 22, 2006

The blue glow is a feature, not a bug


Pillbug
Let's talk knock sensing. I'm running fuel only Megasquirt on a turbo 5 cylinder using the stock Bosch ignition. Ideas for knock sensing and retarding timing?

atomicthumbs
Dec 26, 2010


We're in the business of extending man's senses.

CommieGIR posted:

Let's talk knock sensing. I'm running fuel only Megasquirt on a turbo 5 cylinder using the stock Bosch ignition. Ideas for knock sensing and retarding timing?

how about knocksense

CommieGIR
Aug 22, 2006

The blue glow is a feature, not a bug


Pillbug

Wonderful. But will knocksense actually do any timing changes?

noisymime
Oct 6, 2015

I tame lightning and transmute Arduinos into ECUs

CommieGIR posted:

Wonderful. But will knocksense actually do any timing changes?

Knocksense does the required analysing of the raw knock sensor and feeds a signal to the Megasquirt (or other EMS) to tell it when it detects knock. It's the up to the EMS to retard the timing based on that signal

CommieGIR
Aug 22, 2006

The blue glow is a feature, not a bug


Pillbug

noisymime posted:

Knocksense does the required analysing of the raw knock sensor and feeds a signal to the Megasquirt (or other EMS) to tell it when it detects knock. It's the up to the EMS to retard the timing based on that signal

So is it based on Megasquirt handling the Ignition versus the Bosch ignition module?

Crap. That might ruin my plan to run fuel only Megasquirt.

Noisymime: Question. Possibility of Speeduino handling a spark and knock only configuration?

CommieGIR fucked around with this message at 14:28 on Apr 1, 2016

noisymime
Oct 6, 2015

I tame lightning and transmute Arduinos into ECUs

CommieGIR posted:

So is it based on Megasquirt handling the Ignition versus the Bosch ignition module?
Yep. It's the Megasquirt that makes the actual timing adjustment based on the feed from knocksenseMS

CommieGIR posted:

Noisymime: Question. Possibility of Speeduino handling a spark and knock only configuration?
Pretty good chance when combined with an external knock controller such as the KnockSense. I'll have to look into it a little more, but seems straightforward enough. Ignition only definitely isn't an issue.

CommieGIR
Aug 22, 2006

The blue glow is a feature, not a bug


Pillbug

noisymime posted:

Pretty good chance when combined with an external knock controller such as the KnockSense. I'll have to look into it a little more, but seems straightforward enough. Ignition only definitely isn't an issue.

I specifically built the distributor to make it easy to run: Instead of the stock single window Hall it has 5 window hall, so one per cylinder for easier timing without having to also have a crank sense. I just have to integrate knock sense/adjustment somehow.

5 window is how the JT block that came out of the car handled timing, the 3B turbo that went in utilize two sensors on the crank, one for TDC and a wheel for timing. I didn't want to be that complicated.

meatpotato posted:

Idle air control valves are usually optional, but are a nice refinement. You can add it later once you get your engine tuned, but you might have to put up with setting a fast idle until then. This is based on my experience poorly adding Megasquirt to a formerly carb'd car.

The Bosch model IACs are incredibly easy to wire up and just need a feed from the intake to the filter, most of the ones I've run into are two pin: 12v and Ground.

Knock Equation:

quote:

The reverberation resonance generated by detonation generally lies in the range between 2 and 12KHz. The following equation can be used to estimate the detonation resonant frequency for a specific engine.

Detonation resonant frequency = 900 / (3.14 x cylinder radius)
Where the resonant frequency is measured in Hertz and the cylinder radius in metres.

CommieGIR fucked around with this message at 14:55 on Apr 1, 2016

atomicthumbs
Dec 26, 2010


We're in the business of extending man's senses.

CommieGIR posted:

So is it based on Megasquirt handling the Ignition versus the Bosch ignition module?

Crap. That might ruin my plan to run fuel only Megasquirt.

I assume it's EZK and not Motronic. Have you considered seeing if you can switch to a later EZK box that does knock sensing, if yours doesn't?

um excuse me
Jan 1, 2016

by Fluffdaddy
Quick question. If I wanted to learn this stuff, could I get a tiller motor and a small turbo and cobble it together to work? I definitely want to learn how to do this, but I don't want to spend a ton of money doing it to an actual car the first time.

CommieGIR
Aug 22, 2006

The blue glow is a feature, not a bug


Pillbug

um excuse me posted:

Quick question. If I wanted to learn this stuff, could I get a tiller motor and a small turbo and cobble it together to work? I definitely want to learn how to do this, but I don't want to spend a ton of money doing it to an actual car the first time.

Yes. You can do this with Speeduino as well if you want to learn from scratch. Noisymime can fill you in there.

atomicthumbs posted:

I assume it's EZK and not Motronic. Have you considered seeing if you can switch to a later EZK box that does knock sensing, if yours doesn't?

I think its Motronic. But the actual ignition controller is a Bosch unit with only a hall input and an output.

I wish the Bosch Ignition module supported a Knock sensor naively.

Might have found one: 811 907 397 F is a Knock Controller that hooks up to the Ignition Controller, Coil, and Distributor only. Was built for CIS, so this is perfect. The only issue: It was made for the 1.8. I don't know if it'll work with the 2.2 Audi motor.

CommieGIR fucked around with this message at 19:56 on Apr 1, 2016

ionn
Jan 23, 2004

Din morsa.
Grimey Drawer
I got a racecar for the Swedish equivalent of 24hr of Lemons that needs some "custom experimental tuning", and I think I shall give Speeduino a shot. It's a Mazda 323 BG, basically same engine as 1.8 NA Miatas except with single coil ignition and the older 1.6-style barn-door AFM (which we'll replace with speed-density sensors anyway). This will be a fun adventure!

Seat Safety Switch
May 27, 2008

MY RELIGION IS THE SMALL BLOCK V8 AND COMMANDMENTS ONE THROUGH TEN ARE NEVER LIFT.

Pillbug
You should post a thread about that project, because I'm really curious what it takes to get Speeduino working on an existing-wiring OEM car.

My buddy has a 1.6 Miata with a very decked head that he's currently messing with overclocking the stock ECU to get power from, but a $100 or so Speeduino setup would be a lot safer.

ionn
Jan 23, 2004

Din morsa.
Grimey Drawer
I most certainly will if I get anywhere. I have a stock ECU box from an identical car that I can take apart to easily plug into the factory harness (and just run some separate leads for IAT, MAF and whatever might be needed). Will get some kind of decent wideband O2 to go with it as well, probably an Innovate as I've used those before.

Does Speeduino do any kind of CAN bus (yet)? I have a sensor box (that does 4 channels of EGT thermocouples + whatever 8 analog sensors I feel like hooking up) that sends over CAN, a shift light that reads RPM, and I'm building a logging+alerting panel (warning lights + lcd display). Mainly to put in my Miata that's getting Megasquirted, but it would be cool to be able to do something similar with this one too. It's pretty simple to hook up an MCP2515 over SPI and just broadcast stuff, and if Speeduino doesn't have the logic for it I might even give that a go.

Also, how much "CPU headroom" is there in the Arduino Mega for a regular 4-cylinder car engine for adding extra poo poo like that?

ionn
Jan 23, 2004

Din morsa.
Grimey Drawer
One more question! If I were to etch my own pcb and assemble a Speeduino ECU for a 4-cyl engine, which would be the most appropriate pcb version at present? (0.3.3/0.4/0.5)

noisymime
Oct 6, 2015

I tame lightning and transmute Arduinos into ECUs

ionn posted:

One more question! If I were to etch my own pcb and assemble a Speeduino ECU for a 4-cyl engine, which would be the most appropriate pcb version at present? (0.3.3/0.4/0.5)

0.3.3 is the latest production level board and what I would highly recommend using. 0.4 was a testing design that was designed for use with interface boards and unless you have a specific need for it, the v0.3.3 will be easier to etch and is a more mature design.

(Yes, in hindsight I really shouldn't have used a higher number on the testing board, I have learned my lesson here)

CommieGIR
Aug 22, 2006

The blue glow is a feature, not a bug


Pillbug
Almost done with my Megasquirt install. Pro-tio: Double check your wires before labelling...mixed up the TPS and Idle Valve wiring.

Now I can't seem to get a good tach from the Coil -, it sees the first pulse then ignores the rest...

CommieGIR fucked around with this message at 02:03 on Apr 4, 2016

CommieGIR
Aug 22, 2006

The blue glow is a feature, not a bug


Pillbug
https://www.youtube.com/watch?v=aKVKs6Pc4WI

Megasquirt 1 install complete.

The tach issue was: I needed to make an internal mod by adding a Zener diode in reverse where the hall sense diode was. Victory is sweet.

mekilljoydammit
Jan 28, 2016

Me have motors that scream to 10,000rpm. Me have more cars than Pick and Pull
Oh hey, neat, Speeduino talk. I've been meaning to mess with one of those; is there any provision for rotary ignition timing?

I've been thinking of using one so I have a codebase I can modify to do weird things like antilag or closed loop no-lift-shift.

noisymime
Oct 6, 2015

I tame lightning and transmute Arduinos into ECUs

mekilljoydammit posted:

Oh hey, neat, Speeduino talk. I've been meaning to mess with one of those; is there any provision for rotary ignition timing?

A few people have asked about his recently. With simple fixed timing between the primary and secondary sparks it should be relatively simple. I'm not too familiar with rotaries, but from what I've seen most builds used a fixed angle/time between the two rather than making it dynamic.

mekilljoydammit
Jan 28, 2016

Me have motors that scream to 10,000rpm. Me have more cars than Pick and Pull

noisymime posted:

A few people have asked about his recently. With simple fixed timing between the primary and secondary sparks it should be relatively simple. I'm not too familiar with rotaries, but from what I've seen most builds used a fixed angle/time between the two rather than making it dynamic.

That's one of those "it depends" things; OEM, on the EFI ones anyway, the split (difference between timing between the two) varies around and supposedly helps part throttle efficiency or something. I've never messed with it in-depth because I've been saddled with carbed ones running distributors and usually completely fixed timing, which makes starting a bit interesting.

Pomp and Circumcized
Dec 23, 2006

If there's one thing I love more than GruntKilla420, it's the Queen! Also bacon.
Is there a possibility for the Speeduino to ever support up to 6 injector drivers, or is 4 due to a hardware limit?

noisymime
Oct 6, 2015

I tame lightning and transmute Arduinos into ECUs

ShittyPostmakerPro posted:

Is there a possibility for the Speeduino to ever support up to 6 injector drivers, or is 4 due to a hardware limit?

Yep, its coming. 6 cylinder support is there, but obviously in semi-sequential/wasted spark mode only.

Pomp and Circumcized
Dec 23, 2006

If there's one thing I love more than GruntKilla420, it's the Queen! Also bacon.
Yep, was hoping for full sequential, so good to hear it's coming.

Is it possible to add a CAN shield to the same arduino to allow users to output CAN data for rpm, temperature, etc?

Pomp and Circumcized fucked around with this message at 17:41 on Apr 13, 2016

CommieGIR
Aug 22, 2006

The blue glow is a feature, not a bug


Pillbug
So, I'd like to talk about how easy it was to add bluetooth to the Megasquirt and how you can possibly add it to your Arduino for remote flashing/monitoring/etc.

Seat Safety Switch
May 27, 2008

MY RELIGION IS THE SMALL BLOCK V8 AND COMMANDMENTS ONE THROUGH TEN ARE NEVER LIFT.

Pillbug

CommieGIR posted:

So, I'd like to talk about how easy it was to add bluetooth to the Megasquirt and how you can possibly add it to your Arduino for remote flashing/monitoring/etc.

Is the Bluetooth module just a serial terminal? Probably would be easier than finding a non-cloned FTDI chip these days.

Seem to remember Bluetooth modules are still relatively pricey though.

Adbot
ADBOT LOVES YOU

CommieGIR
Aug 22, 2006

The blue glow is a feature, not a bug


Pillbug

Seat Safety Switch posted:

Is the Bluetooth module just a serial terminal? Probably would be easier than finding a non-cloned FTDI chip these days.

Seem to remember Bluetooth modules are still relatively pricey though.

http://www.amazon.com/JBtek-Wireless-Bluetooth-Transceiver-Arduino/dp/B00L083QAC/ref=pd_bxgy_147_img_3?ie=UTF8&refRID=1FBRRDE6FRJWS1S3EWWS

This is what I'm running, supports many different baud rates (defaults to 9600) and supports passkey. Its basically a wireless UART module.

It SAYS it takes 3.3v, but the board its mounted to has a 5V regulator.

  • Locked thread