Here is some info I have learned from MSnS build(fuel + timing) my 94 probe with an 03 mazda protege motor in it, blew the probe motor #1 rod blew threw block due to fuel in oil rod bearing was going, I didn't do all these things but it is on my mind to create these circuits and have them work the way I want. I have the probe and a 03 Black Mica MSP #0374, I might megasquirt my protege when I get all these issues figured out.
here is it:
My cranking pulse widths stock injectors:
12.5 for -40
3.9 for 180
interpolate the rest (linear curve)
ASE -40 100*
ASE 160 35*
*these will be different for different warm up enrichment values(see below)
The FS motor likes 12.0 - 12.5 AFR when below 55 deg. Using warm up enrichment up to an idle AFR of 13.5 - 14.5, use an already warmed up wideband and see what it is when it starts, use cold starts sitting for more than 4 hours...
Use fixed MAP(30-40Kpa) during ASE, this is essential as your MAP at cranking is close to 85-100Kpa and will be using ve tables from higher on the map bad idea for timing and fueling.
Your going to want to figure a way to control the alternator with the PWM signal to the alternator control circuit, refer to MSP ECU wiring diagram, or else you will be stuck with full load at 14.1 volts, the alternator will be taking hp away from your motor,also most cranking trouble begins with this (when the engine cranks the stock ECU doesn't put the alternator at full load until the engine is started(2 seconds pwm 0-X [X being pwm duty cycle to output the 13.2 volts] tapper time) , mazda has it so that the pcm sends a pwm signal to control the coils on the alternator, so in part it isn't charging full blast when it doesnt have to, i think this helps with gas milage also.
And when you turn your lights on, blower fan on, or bypass your ac routed safety switch in the ecu ( ecu compares a/c pressure so that it isn't running without r134a, you can bypass this and take the a/c input switch wire and wire it directly to the relay for the a/c clutch, please use at least 80 amp solid state relay to trigger A/C relay the voltage shock could damage sensitive components) in theory this should trigger the A/C fan and A/C compressor at once.
With this variance in idle you will either need to run an independent air bypass module, to let a small amount of air in when a/c is on... or you can tune closed loop idle (your adders are going to be a pain because of all the load fluctuation at idle, but it's possible to do, remember you can adjust your Idle Bypass Screw when tuning the PWM closed loop control, whatever way works best just remember modifying this screw will change cranking air entering the engine independently of the MS closed loop cranking idle-DC.
Also on the MSP ECU the fuel rail on hot restarts is allowed to cycle most of the fuel back to the tank, since on hot restarts the fuel will get close to boiling and no good for injection, this is accomplished by one of the vacuum solenoids attached to the FPR lasts for about 20 seconds after start I think its CLT temp > 175 the drop in static pressure should be minor as to not affect AFR too much. Minor code modification MSII (CLT temp>175, run time < 20 seconds).
Also you may want to still control the EGR valve with some kind of stepper motor controller at first i thought it was vacuum solenoid actuated I was thinking of my stock probe engine, the EGR in these cars is as follows
Lean Decel (I mean engine breaking) : Closed (0 duty cycle) Vac 20-38 (KPa 28-0)
Idle : Closed (0 duty cycle)
Full Throttle : Closed (0 duty cycle)
Mid Throttle : Open (5-60 duty cycle)
Low Throttle : Open (60-95 duty cycle)
The closer you are to full throttle(>99Kpa TPS>(DC 10 - max tps dc) the more closed the EGR gets, also it's closed underboost)
This would be a stepper motor circuit based off of the MAP output using an additional circuit on MSII.
So maybe Kpa 40-70 open, the rest closed.
or Kpa 40-90 for forced induction open, the rest closed.
This cools the combustion so it isn't to hot when you go to pound on the throttle this system is very important to preventing detonation in the FS engine, without it you EGT will skyrocket and not be good, possible predetonation/detonation.
In addition I would use knock sense module, or MSII knock detection circuit with the stock knock sensor and adjust it so that it just turns off, only monitor for knock at 1500<RPM<4500 because the valve train noise in these engines will cause it to go off above that... stock ecu takes this into account.
Also the coils used on the MSP, the nippon denso ignitor built in will need to be controlled with I believe spark output not inverted. I believe these (2)coils are similar to the ones on the mazdaspeed miata.You can still use the power transistors used on direct drive coils(Ford EDIS coilpack) with some minor modification.
I believe we have a 36-1 and a Nippondenso CAS sensor so dual wheel would be good to get accurate cranking RPM's, use the map sensor that way you dont have to worry about the crappy MAF getting clogged or going bad, the interpolation equations in megasquirt make a MAP work well for this engine, EAE (fuel wall wetting) in megasquirt I would take advantage of also and use TPSdot based accel enrichment.
Also make sure your cranking fuel pulse numbers are dead on, a back fire when cranking could cause your timing belt to skip teeth, break your starter, or crack your flywheel teeth, use conservative timing for cranking and you should be ok, 6-8 advance for cranking, GM cars have used as low as 5 advance on high compression motors.
Also I think the use of sequential injection (using the sequencer daughter card, router board) would work well on the MSP, more consistent fueling throughout the rev range.
Also on the MSP once you get the alternator to run correctly using a PWM signal to the very odd alternator we have, or install an alternator the doesn't use this method.. but since mazda designed this for ease of start and better fuel milage it may be worth it, I would get your battery voltage correction to a good value(lower your battery voltage and see how much AFR change, if they change too much adjust your correction factor, and also your injector opening time (use the alternation / sequential injection idle AFR change method see MS tuning guide). Use the temperature calibration tool(Easy Therm) and use the stock sensor except for intake air temp use GM sensor with pigtails, also I would move the intake air temp sensor to the high pressure side of the piping after the intercooler (weld a bung and use GM IAT sensor), that way MS gets a good value to make correction with(remember meagsquirts fueling equation), also you could retard timing based on intake temp and save your motor from unnecessary detonation.
Get rid of the ecu all together you'll be happier, use solid state relays for fan control like 80 amp for cooling fan(stock fan turn on at 201 i believe(use hyteries and have it turn off at 190) & a 100amp one for A/C clutch and a/c radiator Fan switching.
MSII extra custom Code addition, to add to the IDLE DC value when (power steering switch is activated - like when navigating a parking lot) for a set time and taper back down to original value, also to add an idle dc adder value for an A/C on input.
Also, the alternator uses a 400Hz pulse width, the duty cycle determines how much load the alternator can create, mazda did this to create a soft start so that electronic are gradually ramped up the 13.2 volts and also to lessen the load on the starter for easier engine cranking and starting. This control circuit would not be difficult to create.
Also would use VICS & VTCS control from 3 outputs from MS II, and open them based on RPM, as this increases low end torque.
#1 VICS solenoid Engine speed < 4,750 rpm: ON
#2 VICS (VICS solenoid valve) Vehicle speed >4,750 rpm: ON
and have the VTCS open as soon as after start enrichment are complete..
That is all I have right now.