Speeduino is now on Github Sponsors (Rather than Patreon): https://github.com/sponsors/noisymime
For any discussion not specifically related to your project
#20974
Hi,

After my adventure getting my NB Miata running on Speeduino, I thought I'd compile everything I've learned into one thread. I'll be posting board layouts soon for a plug-in adapter board for the 0.4, but for now, this is simply a rough guide on how to make everything work.

Info is subject to change. My car is a 1998 (early UK-model) NB. Others may be different.


Gratuitous shot of the setup for my car. Right now I've built a little harness to break out the 64 pin connector to a DB25 plug for ease of wiring.
Image

What you will need
- A Miata
- A Speeduino - this post is specific to the v0.4.3 board but I'm sure it could be useful to 0.3 users as well, although the wiring to the board will be different
- A ULN2803 chip for the low-current outputs
- A 64-pin connector - this is a TE CONNECTIVITY .040/.070 MULTILOCK, part number 174518-7

Speeduino build and jumper settings
- Build your board as per the BOM for a 2-channel setup.
- I substituted R39 and R40 pullups for 2.2k (reason: a commonly available input noise filter circuit for NB miatas for another well-known aftermarket ECU uses 2.2k pullups); this may not be necessary.
- Unless your setup specifically requires it (i.e for water/meth, nitrous), you do not need to populate the 3rd and 4th high current outputs, so you can omit: R55, R56, R57, R58, Q5, Q6.
- Do the ULN2803 mod as described here (picture below, but read the linked post) - you will need this to drive low current outputs such as the fan and fuel pump relays and the tachometer.
Image
- For the tachometer output, solder a 2.2k pullup resistor to IDC40 pin 16 (ULN2803 pin 14) and connect the other end to +12v. (Forthcoming adapter board will have this resistor built in).

Jumpers:
Set JP2 and JP3 to 'Hall'
JP4 and JP5 (pullups for cam/crank inputs) should be installed
Set JP1 (ignitor out voltage) to 5v

Firmware loading and Configuration in TunerStudio

(Base map will be posted as soon as I'm happy with it)

You will need the latest development firmware from Github to get the new decoder [thanks Noisymime!] (as of 01/09/17, I'm sure this will find its way into the "stable" build very soon).

In Trigger Setup: select decoder "Miata 99-05"
Set Trigger Edge and Secondary Trigger Edge both to "Trailing" (edited 3/9/17 - leading edge seems to cause extra timing jitter)
Trigger Filter set to 'Weak'
Trigger Angle: 5 degrees seems good for my car (TBC), you may/will need to adjust this using a timing light once the car is running.

IGNITION SETTINGS:
Wasted spark
Spark outputs trigger on: Going Low (very important, get this wrong and your coils will fry)


IDLE VALVE:
It seems to like a 400hz PWM frequency for the idle valve (lower frequencies make the valve buzz loudly) but this means the usable range is somewhere between 70 and 100% modulation, anything below that is 'off'. I have not yet managed to get closed loop working yet but open loop is OK-ish.


PIN SETTINGS:
Fuel pump: pin 43
Thermo Fan: board default
Tach Output: pin 45


Wiring of 64-pin connector to board

The 64-pin connector is pinned as below. (Found this image over on Miataturbo wiki, hopefully it's OK to reproduce here).
miataturbo.jpg
miataturbo.jpg (27.12 KiB) Viewed 12423 times
Ignore the labels on the diagram, this is just to show how the pin numbers correspond to actual positions on the connector.

And here is how I've wired it on my car. Warning: others may vary. If in doubt, trace the wires through with a multimeter!

The fuel pump relay (marked red) definitely needs checking before you wire it up, on my car it was 3P but according to the wiring diagram it should be 3N. I can confirm that this pin has been 3P on two '98 year, UK model mk2 cars, so it might be either a 98 thing or a UK model thing :)

As also previously mentioned, I'll be coming through with a board layout for an adapter board very soon, but if you're a masochist and want to wire this up yourself, hopefully this will help.

CORRECTION 14/01/18: ALSO WIRE 2I (5V REF) TO IDC PIN 28
conns_nb.jpeg
conns_nb.jpeg (368.64 KiB) Viewed 12423 times

Alternator Control
These cars have an externally regulated alternator. You need to build an alternator control circuit. Again, this will be on the adapter board, but if you want to build it now, you can use my Eagle schematic/board layout (attached). This is designed to be etched on a single sided 100mm wide PCB that will fit in the case above the Speeduino.

VR1 is a TL431. Set the trimpot to 48.7k. You can bench test this board by connecting the +12v and gnd to a bench supply and watching the output wire with a multimeter; increase the bench supply voltage until the output goes low and that's the voltage that your alternator will regulate at (ish). When wiring it up, connect PAD1 ('FIELD') to the 1O terminal on the ecu connector. Be careful with this circuit, get it wrong and you could cause expensive damage to your car's electrical system (and the batteries aren't cheap either). I am honestly not sure where this circuit first originated and whose it is, so if it's your circuit please feel free to tell me so I can update this :)

Note about VICS
While the VICS is wired to the high-current 2 output (ordinarily for boost control) I haven't yet figured out a simple way to trigger it. Ideally it would be nice to add a simple RPM dependent switch into the code. I will look at doing this soon.


That's it for now. I will add more info as I remember and will update this post as I go. Hopefully this is useful to someone :)
Attachments
(473.05 KiB) Downloaded 262 times
Last edited by tbj on Sun Jan 14, 2018 11:14 am, edited 4 times in total.
#21371
tbj wrote:
Fri Sep 01, 2017 10:25 pm

Note about VICS
While the VICS is wired to the high-current 2 output (ordinarily for boost control) I haven't yet figured out a simple way to trigger it. Ideally it would be nice to add a simple RPM dependent switch into the code. I will look at doing this soon.



This is of great interest to me as I want to be able to use VIS, currently I was trying to use the VVT output but this is causing problems because its in Hz and not a simple on/off. I did make a post on the Facebook page.

https://www.facebook.com/groups/1919187 ... 794724970/
#21386
martysport wrote:
Sun Oct 01, 2017 10:30 am
... I was trying to use the VVT output but this is causing problems because its in Hz and not a simple on/off. ...
You can use VVT as a switch by changing switch-point rpm columns in the VVT table, and entering cells from 0 to 100 (fully off to fully on) at that rpm. In the example below, the switch-point is 3000 rpm, at any TPS. Hope that helps.

David
VVT as Switch.jpg
VVT as Switch.jpg (18.37 KiB) Viewed 12132 times
#21388
PSIG wrote:
Mon Oct 02, 2017 9:41 am
martysport wrote:
Sun Oct 01, 2017 10:30 am
... I was trying to use the VVT output but this is causing problems because its in Hz and not a simple on/off. ...
You can use VVT as a switch by changing switch-point rpm columns in the VVT table, and entering cells from 0 to 100 (fully off to fully on) at that rpm. In the example below, the switch-point is 3000 rpm, at any TPS. Hope that helps.

David

VVT as Switch.jpg
Why 3001 rpm activation instead of 3000 rpm David ?
#21973
Hi I followed this guide and got my MX5 NB running to today, brilliant instructions. I do still have problems making it idle, it doesn't appear to be getting controlled by the idle valve. I put a scope onto the signal pin and get a pulse @ 390 HZ when the engines running but I dont' really understand how this is being controlled and where to possibly adjust in tuner studio can any one help me and explain the Idle control in simple terms ?
#22011
evo_lucian wrote:
Mon Oct 02, 2017 12:40 pm
Why 3001 rpm activation instead of 3000 rpm David ?
I think @noisymime has changed the code now; but it is to create a hard switch-point. If tables are interpolated (like VE), a 0-100% change from 2000 to 3000 rpm cells will give 50% at 2500 rpm. I just change it so the ramp is 0-100 in 1 rpm. ;)

David
  • 1
  • 2
  • 3
  • 4
  • 5
  • 16
Knock Sensor working on Speeduino

What knock sensor are you using? The stoc[…]

CLT sensor wrong reading

Thx for quick response, ill check it other day ;[…]

Hi, the original Novitec controller was much more […]

Another type1 Beetle motor

If you have crossbar linkage, you'll need a shorte[…]

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