How To Megasquirt Your 2nd Gen RX-7: Programming The ECU (MS3X / MS3-Pro)


Home > RX-7 > Tech/Mods > Mods > Megasquirt > Programming The ECU (MS3X / MS3-Pro) Buy Me A Coffee

This section covers programming the MS3X / MS3-Pro ECU to run the 13B rotary. Because there is such a difference between the setup of the various MegaSquirt versions, each ECU has it's own configuration page. Make sure you are reading the correct page for your ECU version.

Flash The Firmware

If you have not already done so using a Stimulator the first step is to flash the newest firmware into the MS3X. This not only upgrades the ECU to the newest release firmware but also blanks out all the settings so you can start with a fresh tune. The same goes for MS3-Pro, but as there is no Stimulator for that ECU, we just need to wait until it's wired and can be fired up.

Disconnect the ignition coils from the harness before proceeding! Failure to do this will burn out the coils! Until you have set up the ECU and rebooted it, the coils must remain disconnected.

At this point, if you have not already downloaded TunerStudio MS, do so now and install it. The free version will suffice for now however you may want to upgrade to the paid version when you start tuning as only the paid version can autotune the VE table.

Depending on whether you are connecting your MegaSquirt via USB or serial, there are different steps. Please follow the instructions on the MS3 Serial Connection Setup page to set up your serial port or install the USB drivers if necessary.

Now proceed to load the newest firmware for the MS3 / MS3-Pro. Follow the instructions on the Megasquirt 3 - Loading Firmware to load the newest release firmware onto the ECU. Make sure to choose the correct firmware version during install as both MS3 and MS3-Pro firmwares are included in the installer. When the firmware utility asks you "Preserve sensor calibrations, and I/O pin states (y,n, default: y)?" answer "n". This resets the sensor calibrations and all input/output to the factory state, giving a common starting point on which to build a map. If you are unsure as to which firmware file to download, look up the latest firmware here.

Finally follow the MS3 TunerStudioMS Setup instructions to set up a TunerStudio project for your tuning sessions. The options in the "Settings" tab can be left as defaults.

Configure The MS3X / MS3-Pro ECU To Run The Rotary Engine

Basic parameters need to be set up in the ECU to tell it the displacement of the engine, how many injectors it has, the trigger and ignition setup and what to do with its outputs. The MS3 firmware development is on going so it is possible that some of the screens you see here may not exactly match the firmware you are running. Each settings page will be shown with a chart of the settings, and a screenshot of what they look like. Any settings that are not mentioned can just be left default. In fact, that's why we loaded the firmware and blanked out all calibrations and I/O; to assure these settings are defaulted.

This setup should be performed with TunerStudio connected to the ECU. Please do not start with a blank tune! A blank tune will leave invalid values everywhere in the map which will cause you no end of grief as you try to sort them out. If you must program the ECU offline (maybe it's -30C in your shop and you don't want to freeze your butt off) then connect to the ECU, save out the settings as an .MSQ, and work from that .MSQ file as you perform initial setup. Then the .MSQ can be loaded into the ECU when you are done. When you are programming the ECU live, make sure to press "Burn To ECU" before closing each window. Otherwise the changes are made to the map in TunerStudio but will not take effect, are lost when that settings screen is closed, or lost when the ECU is powered off (exact behaviour depends on the setting).

By popular demand I will include a base map for download at the bottom of this page. It will contain all of the basic settings and with a few minor changes, should start and run the car. Please do not just skip to the end, download the map and go on your way. I explain most of the setting in that map on this page and you will have to adjust a few of them depending on your car. Additionally, this map is only to start the car and while the car may run acceptably on it, the map will need to be tuned to your car. This is especially true for turbo RX-7s as if you just load this map then run up into boost, it's likely your next task will be rebuilding the blown engine.

I am going to cover the basic settings needed, skipping over the screens we won't be touching. On many of the settings screens you can click the question mark (?) beside a setting to learn what it means or see the MS3 documentation. Another important point is that MS3 firmware is in continuous development. Therefore, some of the settings you see may be slightly different from what is shown here. Usually they translate but if there is any confusion, check the documentation.

MS3X / MS3-Pro Settings For 2nd Gen 13B

The settings are presented below in a list with the title of each item representing the menu choices needed to open up those settings. We start with the most basic characteristics of the engine.

Basic/Load Settings: Engine and sequential settings

These settings are the basic characteristics of the engine including type, number of injectors, etc. Most of them are self explanatory. Note that Required Fuel needs to be adjusted based on your primary injector size. For 460CC NA injectors, use 9.5ms. For 550cc TII injectors, use 8ms. Required Fuel is the amount of injector opening time that the engine would theoretically need to maintain 14.7:1 at 100% VE. Having this correct becomes important if you intend to use Enhanced Acceleration Enrichment. Setting the main fuel outputs to "MS3X fuel" tells the ECU to use sequential outputs INJECTOR A - H, we set sequential to "Fully sequential" and tell the ECU that the injection angle (set elsewhere) is the end of the injection cycle. Note that "Firing order" specifies the firing order shown in software, not the order the ECU fires in. That is hard coded based on cylinder/rotor count. For now, individual injector trim (adjustment) can be turned off. Note that for MS3-Pro, "Main fuel outputs" gets set to "Inj A,B..".

Setting Value
Required Fuel9.5 or 8 (see text)
Control AlgorithmSpeed Density
Squirts Per Engine Cycle2
Injector StagingAlternating
Engine Stroke/RotaryRotary
No. Cylinders/Rotors2
Number Of Injectors2
Engine TypeEven fire
Engine size(cc)2600
Injector size each(cc)550 (TII) or 460 (NA)
Main fuel outputsMS3X fuel (MS3) or Inj A,B.. (MS3-Pro)
Sequential OnFully Sequential
Angle specifies:End of squirt
Injector TrimOff
Firing Order A.1
Firing Order B.3
Firing Order C.4
Firing Order D.2
MS3X 13B Engine and Sequential settings

Basic/Load Settings: General settings

Most of the settings here can be left as default because we are using the default control method of speed density for fuel and ignition, the default barometric correction (the ECU takes an initial reading from the MAP sensor at bootup then uses that value) and using the default built in MAP sensor. Lag settings refer to the lag between the time a condition changes and the sensor recognizes the change. For the specified sensors, defaults are usually fine. The group of settings you will likely be adjusting are the "Over Run Fuel Cut" settings. These govern how fuel is cut off when you decel with a closed throttle in high vacuum. Specifically, you will need to tweak the KPA and TPS values to suit your vehicle. MS3-Pro users need to make one minor change from the MS3 settings shown here. Make sure to set the "Voltage input port" to "MAP" if you have an MS3-Pro.

Setting Value
Barometric CorrectionUse Initial MAP Reading
Realtime baro port(disabled)
Upper limit(kPa)105.0
Lower limit(kPa)80.0
Default baro(kPa)100
MAP Sensor typeVoltage
Voltage input portMainboard (MS3) or MAP (MS3-Pro)
Frequency input port(disabled)
Low frequency(Hz)(disabled)
High frequency(Hz)(disabled)
2nd MAP portOff
MegaView Temp. UnitsCoolant/MAT Tables in F
MAP Averaging Lag Factor50
MAF Averaging Lag Factor50
RPM Averaging Lag Factor50
TPS Averaging Lag Factor50
Lambda Averaging Lag Factor60
CLT/MAT/Battery Lag Factor50
Auto-zero TPSOff
Primary Fuel LoadSpeed Density
Secondary Fuel LoadDisabled
Secondary Fuel(disabled)
Multiply MAP (VE1/3)multiply
Multiply MAP (VE2/4)(disabled)
Incorporate AFRTargetinclude AFRtarget
Stoichiometric AFR14.7
Primary Ignition LoadSpeed Density
Secondary Ignition LoadDisabled
Secondary Ignition(disabled)
AFR table loadUse primary load (Algorithm)
EAE curve loadUse primary load (Algorithm)
Over Run Fuel CutOn
RPM greater than:(rpm)1700
and KPa lower than: (kPa)40
and TPS lower than: (%)5.0
and coolant greater than:(F)150
After delay(s)1
Delay EGO after fuel return:(seconds)0
Return fuel when RPM less than:(rpm)1500
MS3X 13B General Settings

Basic/Load Settings: Rev Limiter

Various rev limiter options are available but for the basic setup we'll just use a hard spark cut at 8500 RPM. This number would be adjusted of course based on your engine mods (S5 engines are redlined at 9000 RPM). That setting is adjusted by "Spark cut above(RPM)" which is simply the RPM at which spark is cut. Below it, the settings are a little confusing. "Cut x sparks from y events" simply means that we are cutting X number of sparks from Y number of possible ignition events. In this case, 1 and 1 means every spark from every event...no ignition. A softer cut can be made by cutting 3 from 5, for example. Finally, below that we set a hard fuel cut (all fuel gone) at 9000 RPM, with fuel returning 200 RPM below. Coolant based rev limiting allows engine speed to be limited during warmup to avoid the user damaging the engine. You can experiment later, but for now we leave it turned off.

Setting Value
Spark Retard ModeOff
Retard above(RPM)(disabled)
Maximum Retard(deg)(disabled)
Retard to(deg)(disabled)
Spark Cut -Enable spark cut limitingOn
Spark cut above(RPM)8500
Cut X sparks1
from Y events1
Hard Fuel cut limit9000
Hysteresis(RPM)(disabled)
2nd MAP portOff
Rev Limiter CLT basedNormal
Rev Limit Adder(RPM)(disabled)
Rev Limit TPS bypass(TPS %)(disabled)
RPM when in TPS bypass(RPM)(disabled)
MS3X 13B Rev Limiter Settings

Basic/Load Settings: Fan Control

The fan control options are fairly simple and for our base map we are just concerned with the output used to switch the fan (spare injector output H) and the temperature at which to turn the fan on and off. The fan is also set to turn off at more than 90% throttle (because at wide open throttle you want the power going to the wheels, not the alternator) and then return on if the throttle is below 80%. There are various options to idle up using the BAC valve while the fan is on but for now we're leaving those alone. I've never found them necessary as the BAC will keep the idle from dropping and if the charging system is in good shape, the extra alternator speed won't be needed. There's an option to allow the fan to run with the engine off. This can be useful at the track for example, to combat heat soak. Enable, then shut the car off and key it back on without starting it up. The fan will run and convection will circulate the coolant.

Setting Value
Fan Control OnOn
Fan Control Idles up?No
Output PinInj H
Idleup Delay(ms)(disabled)
Idleup Duty(%)(disabled)
Idleup Steps(steps)(disabled)
Idleup target increase(rpm)(disabled)
Fan On Temperature(F)195
Fan Off Temperature(F)188
Allow fan when engine offNo
Fan on with AC on?(disabled)
TPS shutoff(%)90
TPS hysteresis(%)10
VSS shutoff(KPH)(disabled)
VSS hyst(KPH)(disabled)
MS3X 13B Fan Control Settings

Basic/Load Settings: Injector Dead Time, Injector Small Pulsewidths, Injector Timing tables
Of these three settings screens, which we are going to leave as default for now, Injector Dead Time and the Injector Timing tables are the most important. Injector dead time is the time in mS it takes for the valve in the injector to react and begin injecting fuel during the pulse. Setting this correctly requires measurement of each individual injector (it is configurable per injector). So unless you have this data available, leave it at the default 1mS. You can still tune the car but if you intend to refine your tune to the absolute finest degree, knowing each injectors dead time becomes important. For most people though, the defaults are fine. The Injector Timing table literally defines the degree of eccentric shaft position at which the injection cycle stops. This is the "sequential" in "sequential injection". Most useful at low loads and low engine speeds, it is beyond the scope of this base map to fully tune injector timing. For now, leave it at the default of 360 across the board. Later, once the VE table is tuned, you can read up on tuning injector timing if you want to further refine the tune.

Make no mistake, tuning injector timing properly to your engine will result in a far better tune which will return a smoother idle, higher fuel economy and less emissions as well as more power and engine response. But until the VE table is tuned and the rest of the settings dialed in, playing with injector timing is just going to complicate things. Here's a hint though: things are rarely most efficient when injecting fuel into an open port. OEMs try to inject fuel on the back of a valve or into a closed port to form a perfect cloud ready for the intake even tot take place.

Fuel Settings: Staged Injection

This is where we define the parameters of the injector staging; how the ECU transitions from the primaries to the secondaries. We're making use of table based staging which not only involves far fewer settings, but results in a seamless injector stage without any of the effects of the older method of just ramping the primary injectors in over a certain number of engine cycles. The table shown here is going to be smooth and workable for almost every injector combination unless there is a massive difference between primary and secondary (ie. 550cc/1680cc). The settings are pretty easy. We tell the ECU to use the Table for staging, define the primary and secondary injector sizes, tell the ECU to use both the primaries and secondaries after the stage point, and use the MS3X outputs (InjC and InjD) for the secondaries. You'll notice the table jumps directly from 0 to some value. This is to prevent the secondary pulsewidth from starting too low in the unstable region. Not the slight difference in "Secondary outputs" from MS3 to MS3-Pro.

Setting Value
Staged injection first parameterTable
Primary injector size(cc)460 (NA) or 550 (TII)
Secondary injector size(cc)460 (NA) or 550 (TII)
Transition fully to secondariesOff
Secondary outputsUse MS3x (if possible) (MS3) or Use InjA-H (if possible) (MS3-Pro)
Secondary v3 alternate(disabled)
Gradual transition(disabled)
Transition events(ign events)(disabled)
Primary reduction delay(ign events)(disabled)
Secondary enrichment(ms)(disabled)
Primary staging threshold(units)(disabled)
Primary staging hysteresis(units)(disabled)
Secondary parameter(disabled)
Secondary staging threshold(units(disabled)
Secondary staging hysteresis(units)(disabled)
Secondary staging logic(disabled)
Download Table: Download the table and unzip. Then right click on the table in the settings window and select "import". Find your unzipped file and select it.Download 13B Base Injector Stage Table
MS3X 13B Secondary Injector Staging Settings

Fuel Settings: AFR/EGO Control

These settings define how the oxygen sensor (wideband) is used. I'm not going to go over every setting. For those details, see the MS3 documentation on AFR/EGO Control. The basics of it are that we set the EGO Sensor Type to "Wide band". It is installed on the Normal EGO port (pink wire) and applies to all injectors as the rotary doesn't have "banks" like a V piston engine. The algorithm that is used to control the AFR mixture from wideband feedback is the PID algorithm, which adjusts its response based on how far out the input is from the desired output. It makes these adjustments every 25 ignition events (Ignition Events per Step) with a maximum change of 15% (Controller Auth) and is active above AFR 9.0:1 (Only correct above) but below 20:1 (and correct below). The next bunch of settings set some parameters as to when closed loop is entered regarding minimum coolant temp, maximum TPS (throttle) value, maximum engine load (as on the left side of the VE table), etc. Most of these can be left alone for most cars however some might need to be tweaked. Radical porting will mean vacuum is low so the load value may need to be increased. S4 cars with narrow range TPSs may need to increase the TPS percent as those TPSs go to 100& at 1/4 throttle. In that case, both TPS and Load should be used to define closed loop. Finally, at the bottom are the actual PID algorithm parameters; the proportional gain, integral and derivative. The values I have supplied should result in smooth control in 99% of applications. But if you need to adjust, read the documentation first.

Setting Value
AlgorithmPID
Ignition Events per Step25
Controller Step Size(%)(disabled)
Controller Auth +/-(%)15
Only correct above:(AFR)9.0
and correct below:(AFR)20.0
Active Above Coolant(F)160
Active Above RPM1500
Active Below TPS(%)50
Active Below Load(%)80
Active Above Load(%)20
EGO delay after start(sec)40
PID Proportional Gain(%)30
PID Integral(%)5
PID Derivative(%)0
EGO Sensor TypeWide Band
Number of sensors1
EGO 1 portNormal EGO
EGO 1 port - EGO 8 port(disabled)
MS3X inj A - V3 inj 2EGO1
MS3X 13B EGO/AFR Settings

Fuel Settings: AFR Table 1

This table defines the AFR ratios (referenced by RPM and load) that the closed loop algorithm actually seeks. It is also the table used by the AutoTune feature if used. AutoTune will tune your VE table while you drive to match the ratios defined on this table. For most cars this is a good table to start with though rather rich in the non-cruise areas of the map. Many of the 13.8s on the right and left of that 15.2 island could actually be stoich (14.7) or close to it. But for now, this table represents a good starting point that when used with either/both of the closed loop or AutoTune will result in a smooth and safe tune with good fuel economy under cruise.

Thankfully, TunerStudio doesn't require you to type that mess into the table manually. Tables can be imported and exported. Below is a link to this table TunerStudio's table exchange .VEX format. To import it, download and unzip the file. From the AFR Table 1 window, right click the table and select "Import Table". Browse to the downloaded file and open it up to start the import.

This is a table for a 13B turbo engine but will work equally well for an NA. If tuning an NA, all the bins above 100% can be discarded and that side of the table rescaled with more resolution available from 0-110% or so. Set your last bin to 110% because atmospheric pressure varies.

Download 13BT AFR Table For MS3X (.ZIP, 1K)

MS3X 13B AFR Table 1 settings

Fuel Settings: Fuel VE Table 1

The VE (volumetric efficiency) table represents the main fuel map for the engine and is where you will be doing most of your tuning. Each engine combination is going to need a wildly different VE table and even two engines configured exactly the same will end up with a different table when tuned. Therefore, this table is only suited as a first startup and limp to the dyno map. It should start the car and run it reasonably well but is by far not ideal for your engine. It will give you a good place to start tuning. Do not just load this table, start the car and run the engine into boost. While this table should be safely rich everywhere, there is no guarantee. Carefully approach boost and judge for your self how much you have to richen up that area of the map before getting throttle happy.

Thankfully, TunerStudio doesn't require you to type that mess into the table manually. Tables can be imported and exported. Below is a link to this table TunerStudio's table exchange .VEX format. To import it, download and unzip the file. From the AFR Table 1 window, right click the table and select "Import Table". Browse to the downloaded file and open it up to start the import.

This is a table for a 13B turbo engine but will work equally well for an NA. If tuning an NA, all the bins above 100% can be discarded and that side of the table rescaled with more resolution available from 0-110% or so. Set your last bin to 110% because atmospheric pressure varies.

Download 13B Base VE Table For MS3X (.ZIP, 1K)

Fuel VE Table 1, MS3X, 13B Rotary

Fuel Settings: Remaining Menu Items

All the remaining fuel menu items can be left as their defaults, which will disable many of them. Most of them won't be used for the typical RX-7 installation. Once you have completed the tune you may want to explore several of them however. Injector Trim will allow you to fine tune each injector to balance fuel delivery variances caused by slight injector flow differences. Cylinder Trim allows individual adjustment of fuel delivery to each rotor (cylinder) due to airflow, compression or other differences. Note that tuning any of these requires more advanced instrumentation than a wideband. A dual channel EGT with one probe per rotor is very useful here to balance out both sides of the engine.

Ignition Settings: Ignition Options/Wheel Decoder

Ignition Options/Wheel Decoder defines the type of crank position sensor(s) needed to determine the engine position, a few basic parameters of ignition timing, and how to fire the coils. The ECU gets set to a toothed wheel (the CAS) with a 24 tooth main (NE) wheel and a 2nd 2 tooth "cam" wheel (G). The main wheel is read via the VR conditioner on the main board while the second wheel is read via the MS3X Cam input. Spark type is "wasted spark" for the dual post leading coil and spark outputs are the SPARK wires on the MS3X board. We capture the ignition signal on the first (rising) edge of the wheel. Finally, the average dwell is set at 3ms, a typical value for 2nd gen coils. The ECU will adjust the dwell based on engine speed and battery voltage. Lower voltages require higher dwell, and higher engine speeds allow less time for coil charging, so lower dwell. Note the "Fixed Advance" setting is set to "Use Table". This tells the ECU to read timing values from the main timing table. MS3-Pro users need to set "Spark hardware in use" to "Spark" and "Cam input" to "CMP". MS3-Pro uses more generic names for I/O than MS3.

Setting Value
Spark mode(dizzy, EDIS, wheel)Toothed wheel
Trigger Angle/Offset(deg)(disabled)
Angle between main and return(deg)(disabled)
Oddfire first angle(disabled)
GM HEI/DIS options(disabled)
Ford TFI options(disabled)
Oddfire phasing(disabled)
Skip Pulses3
Ignition Input CaptureRising Edge
Spark OutputGoing High
Number of coilsWasted Spark
Spark hardware in useMS3X spark (MS3) or Spark (MS3-Pro)
Cam input (if used)MS3X Cam in (MS3) or CMP (MS3-Pro)
Tertiary tach input(disabled)
Flip polarity on high-res tach(disabled)
Trigger wheel arrangementDual wheel
Trigger Wheel Teeth(teeth)24
Missing Teeth(teeth)(disabled)
Tooth #1 Angle(deg BTDC)0
Main wheel speedCam wheel
Second trigger active onRising edge
Level for phase 1(disabled)
and every rotation of...Crank
Fixed AdvanceUse Table
Use Prediction1st Deriv Prediction
Timing For Fixed Advance(degrees)(disabled)
Cranking Dwell(ms)6
Cranking Advance(degrees)5
Toyota MultiplexOff
Dwell typeStandard Dwell
Use dwell vs rpm curve(disabled)
Nominal Dwell(ms)3.0
Spark Duration(ms)1
Dwell time(ms)(disabled)
Dwell duty(%)(disabled)
Spark Hardware Latency(usec)0
middle LED indicator(disabled)
Spark trimOff
Custom oddfire angles in sequence...(all disabled)
Ignition Options/Wheel Decoder, MS3X, 13B Rotary

Ignition Settings: Ignition Table 1

This is the main timing table referenced anytime the engine is running. The only period during which this table is not used is when the engine is cranking. This table should run most rotary engines quite well and you will probably only have to make minor adjustments. It is safe to run in boost as well as in NA applications.

Thankfully, TunerStudio doesn't require you to type that mess into the table manually. Tables can be imported and exported. Below is a link to this table TunerStudio's table exchange .VEX format. To import it, download and unzip the file. From the AFR Table 1 window, right click the table and select "Import Table". Browse to the downloaded file and open it up to start the import.

This is a table for a 13B turbo engine but will work equally well for an NA. If tuning an NA, all the bins above 100% can be discarded and that side of the table rescaled with more resolution available from 0-110% or so. Set your last bin to 110% because atmospheric pressure varies.

Download 13B Base Timing Table, MS3X (.ZIP, 1K)

MS3X Ignition Timing Table, 13B Rotary

Ignition Settings: Rotary Settings

The "Rotary Settings" dialog defines some rotary specific ignition settings. There are only a few options here. Output mode gets set to use FC coils (wasted spark leading and individual toggle-style trailing). Negative split is set to disabled for now but this is an option you may wish to explore later. Using negative split (firing trailing before leading) at idle and light load can result in emissions and fuel economy increases. Finally, trailing dwell is set the same as leading: 3ms.

Setting Value
Output modeFC mode
Allow negative split?Not Allowed
Trailing Dwell time(ms)3.0
Rotary Settings, MS3X, 13B

Ignition Settings: Rotary Split Table

The rotary split settings specify how many degrees after the leadings the trailing plugs fire. This is referred to as "split". As tuning split is a bit of a black art and rather hotly debated, leave this table alone unless you have an idea of what you are doing. This table is conservative and safe for both NA and turbo applications. Though if you have an NA, you may want to alter it to end up at zero split around atmospheric as that is usually best for power. For turbo applications, split is kept safe in boost to prevent firing the trailing too early.

Thankfully, TunerStudio doesn't require you to type that mess into the table manually. Tables can be imported and exported. Below is a link to this table TunerStudio's table exchange .VEX format. To import it, download and unzip the file. From the AFR Table 1 window, right click the table and select "Import Table". Browse to the downloaded file and open it up to start the import.

Download 13B Base Timing Table, MS3X (.ZIP, 1K)

MS3X Rotary Split Table, 13B Rotary

Startup/Idle: Cranking/Startup settings

These settings define parameters used during cranking and startup. For example, the "Cranking RPM" defines the engine speed below which the engine is considered to be cranking. "Flood clear TPS (%)" sets the TPS value above which the injectors are disabled during cranking. This is very useful to clear a flooded engine by simply flooring the pedal and cranking the car. The rest of the settings aren't really anything which will have to be changed for our setup.

Setting Value
Cranking RPM300
Flood clear TPS(%)97.0
Cranking fuel pulse rateEvery event
Blended cranking curvesOff
Priming pulse delay(s)0.0
Ignore MAT correction during ASEOff
ASE count unitsCycles
Cranking and Startup Settings, MX3X, 13B Rotary

Startup/Idle: Priming Pulse

The priming pulse is the initial injector opening time which occurs just after the Megasquirt is powered on. It is there to "prime" the injectors with fuel and to set up a slight vapour cloud in the intake ports to help with starting. These numbers are not really critical as long as they are in the ballpark so it's unlikely you will be spending much time tuning them. The table presented here will work for most setups. Of far more importance is the cranking table which will be covered next.

Setting Value
10.010.0
30.010.0
50.010.0
70.010.0
90.010.0
110.010.0
130.010.0
150.010.0
170.010.0
180.010.0
Priming Pulsewidth, MS3X, 13B Rotary

Startup/Idle: Cranking Pulse

The cranking pulse tells the Megasquirt how much to enrich the fuel mixture while the engine is cranking. The cranking pulse is represented as a percentage of the main fuel map, thus your final settings will depend on your VE table. These settings should get you going but depending on many factors including injector size, fuel pressure and porting considerable adjustment may be required.

Setting Value
10.0172
30.0167
50.0162
70.0157
90.0152
110.0145
130.0137
150.0129
170.0124
180.0123
Cranking Pulsewidths, MS3X, 13B Rotary

Startup/Idle: ASE Percentage

After Start Enrichment (ASE) increases fuel supply to the engine just after starting, for a specified number of engine cycles. This helps with both a hot start condition (heat soaked) and a cold start condition (fuel tends to collect on the intake runners) as the engine typically runs lean for a few seconds directly after startup. It is expressed as a percentage added to the VE table so like the other enrichment tables, final values will depend on the final tune. These numbers should get you started. If you find that when you start the car the engine stalls after a second, ASE needs to be increased. If it runs poorly for a second then clears up, ASE may be too rich.

Setting Value
10.045
30.043
50.039
70.037
90.035
110.034
130.032
150.030
170.029
180.028
Afterstart Enrichment Percent Adder, MS3X, 13B Rotary

Startup/Idle: Afterstart (ASE) Taper

ASE Taper is the number of engine cycles through which ASE is applied. Typically the colder the engine is the longer afterstart needs to be, while when warm fuel is more easily atomized so afterstart can be shorter. This is expressed in number of engine cycles.

Setting Value
10.0400
30.0400
50.0400
70.0400
90.0400
110.0375
130.0350
150.0350
170.0350
180.0350
Afterstart Enrichment Taper, MS3X, 13B Rotary

Startup/Idle: Warmup Enrichment

The warmup enrichment is probably the startup setting you will spend most of your time on. Warmup enrichment increases fuel supply to the engine while it is warming up. This is necessary because fuel atomizes less efficiently and tends to cling to runner walls when the engine is cold. These numbers, like the cranking table, depend on the main VE table so don't spend much time here until the VE table is workable. You'll find yourself revisiting this table as your VE table evolves. For now, these numbers are a good starting point. Remember, this table modifies your VE table so there's no point trying to tune the VE table until you are out of warmup (160F in this case).

Setting Value
-40.0180
-20.0180
0.0167
20.0158
40.0153
60.0147
80.0141
100.0135
130.0123
160.0100
Warmup Enrichment Percent Multiplier, MS3X, 13B Rotary

Startup/Idle: Idle Control

The idle control dialog sets the basic setting for the idle valve. Most of the settings on this screen relate to other methods of idle control so once we set the algorithm to "PWM Closed-loop" they become disabled. The most important settings are the Valve mode, Output port and Frequency. Normal mode means that more duty cycle opens the valve more, outputting the signal on "Idle" refers to the MS3X idle circuit, and we will use 99Hz as the PWM frequency. Note there is a lot of discussion as to the appropriate PWM frequency. Anywhere from 100 - 200Hz is typical operating range for the 2nd gen BAC.

Setting Value
AlgorithmPWM Closed-loop
Time Step Size(ms)(disabled)
Initial Time Step Size(ms)(disabled)
Minimum # steps to move(steps)(disabled)
Start Value(disabled)
Crank-t-Run Taper Time(sec)(disabled)
Hysteresis(F)(disabled)
Cold Temperature(F)(disabled)
Cold Position(steps)(disabled)
Cold Taper Time(sec)(disabled)
Fast Idle Temperature(F)(disabled)
Crank-to-Run Taper Time(S)1
Valve modeNormal, 0%=off
Output portIdle
3 wire modeOff
Frequency99Hz
Idle Control, MS3X, 13B Rotary

Startup/Idle: PWM idle cranking duty

PWM idle cranking duty sets the duty cycle (opening amount) of the idle valve during cranking. This is based on the temperature of the coolant. Opening up the idle valve a little during cranking lets a bit more air into the engine and basically simulates the old school technique of a little bit of throttle while cranking. You may find that cooler temperatures need more idle valve during cranking to prevent a stall after starting, operating temperature requires less, while heat soak once again can benefit from more air. For now everything is set to 65% which will suit most cases without causing the engine RPM to spike after starting.

Setting Value
3065.1
10065.1
13065.1
17565.1
PWM Idle Cranking Duty, MS3X, 13B Rotary

Startup/Idle: Closed loop-idle settings

There are a lot of closed loop idle settings because getting a stable idle control involves a lot of different factors. I'll give some basic explanation here however if you want the full details you should see the idle control documentation in the MS3 software manual. Many of the settings overlap and effect one another. Idle open and closed duty reflect the duty cycles where the valve is fully open and fully close. Note that these can be adjusted to limit the operational range of the valve. Dashpot adder is the percentage of duty cycle added briefly to the valve as the engine RPM drops. This prevents RPM from plummeting below idle and stalling the engine. The dashpot duty is reduced over the decay factor. The next three settings configure how the valve is closed once the throttle is opened again. Below that we have the main PID loop settings which define how the PID algorithm actually seeks the desired idle. Details to set this are in the documentation. Below, the parameters Idle Activation RPM adder and Idle Activation TPS threshold define when we enter PWM idle control. And finally over on the top right, the minimum closed loop duty is set (min duty for PID). Below that we tell the algorithm the idle RPM if the valve is fully closed (the idle RPM set by the hard idle stop screw) and the RPM with the valve fully open. Note that the 2nd gen BAC can produce about 4000 RPM when fully open but we set this a little low to increase the sensitivity of the algorithm. We next have a set of delays relating to how long to wait to enter PID idle control, and below that the control interval. The PID Control Interval sets how often the PID control loop runs.

Setting Value
Idle Open Duty(%)100
Idle Open Steps(steps)(disabled)
Idle Valve Closed Duty(%)0
Idle Valve Closed Steps(steps)(disabled)
Dashpot adder(%)3.9
Dashpot adder(steps)(disabled)
Dashpot decay factor2
Use last value or tableUse last value
Use CLT or MAT in table lookup(disabled)
Close delay(sec)1
Leave valve closed above:(rpm)2000
For this number of seconds:(sec)2
Proportional Gain(%)15.0
Integral Gain(%)8
Derivative Gain(%)0
Use VSS to activate PIDStandard
Idle Activation RPM adder(rpm)300
Idle Activation TPS threshold(%)2.3
Min Duty for PID(%)10.2
Min Steps for PID(steps)(disabled)
RPM with valve closed(rpm)1000
RPM with valve open(rpm)3000
PID delay(sec)2
Crank to run delay(s)1
PID ram to target time(sec)1
PID Control Interval(ms)200
PID disable RPMdot500
PID lockout RPMdot threshold(rpm/sec)600
PID lockout max decel load(%)30
Closed Loop Idle Settings, MS3X, 13B Rotary

Startup/Idle: Closed-loop idle target curve

This curve sets the idle speed, according to temperature, that the PID idle control algorithm will seek. This allows a higher idle when cold (when fuel atomization is poor, the alternator is refilling the battery after cranking, and we want the engine to heat up to operating temperature quickly) which will gradually taper down to a lower final idle speed as the engine reaches operating temperature. This is especially important if the vehicle has catalytic converters as the higher exhaust temps created by higher engine speed will light them off quickly, dramatically reducing cold start emissions.

Setting Value
701500
801500
901500
1001500
1101300
1201200
1301100
1401000
PWM Closed Loop Idle Target Curve, MS3X, 13B Rotary

Startup/Idle: Remaining settings

The remaining settings in the Startup/Idle menu can be left at default. They can be explored later once your tune is reaching the more refined stages. There are settings for A/C control if your car is equipped with air conditioning that allow things like compressor control, idle up and fan control. The Idle VE and Idle Advance tables are tiny VE and spark tables that apply only to idle which can be a great asset to obtaining a stable idle. But during initial tuning these tables can be a little confusing so they are best left until the main tuning tasks are complete.

Accel Enrich: Accel Enrich Settings

The basic acceleration enrichment settings simply define with method of accel enrichment is used. For now, just the basic method of "accel pump" is used to simplify tuning. The more advanced settings involving wall wetting can provide a much smoother throttle response and tune but will significantly complicate tuning the other areas of the map. These methods are best applied after the tune has been refined.

Setting Value
Use Time-based or Accel-pump AccelAccel-pump AE
Wall-wetting AE (EAE-Xtau)Off
TPSdot uses %WOTOff
Accel Enrich Settings, MS3X, 13B Rotary

Accel Enrich: Accel pump accel enrichment settings

These curves set the amount of fuel added by the accel pump when the throttle is pressed down. This is expressed by percentage of the VE table over TPSdot. That is, the quicker the TPS voltage increases over a period of one second, the more fuel that is injected during that movement. These are basic settings which suit a full range TPS. The problem is, S4 cars have a 1/4 range TPS which is reading 100% at about 1/4 throttle. In this case, the best method for accel enrichment would be to blend MAPdot and TPSdot. But give these settings a try. You may find that by simply decreasing the fuel addition at the top of TPS range and fattening up the midrange, TPSdot works pretty well.

Setting Value
TPSdot -5000
TPSdot -2000
TPSdot -1000
TPSdot -502.5
TPSdot 508.5
TPSdot 20029.7
TPSdot 50092.1
TPSdot 1000125.5
AQccel enrichment TPSdot <->
MAPdot blend. Percent TPS driven(%)
100
Accel MAPdot Threshold(kpa/sec)(disabled)
Accel TPSdot Threshold(%/sec)50
Cold Accel Multiplier(%)100
Full Accel below:(rpm)6000
Zero Accel Above:(rpm)6000
Accel pump accel enrichment settings, MS3X, 13B rotary

Downloadable Base Maps

Now that you're familiar with the basic settings needed to run a 2nd gen 13B with MS3X, you can save some time of having to type them in manually by using the base map below. Please keep in mind that MS3X firmware is in continuous development. While an MSQ map file for a previous firmware can be used with a newer firmware, be sure to investigate any errors generated upon loading and confirm the settings with the documentation above. Remember to adjust your injector sizing in this map after loading it. Assuming stock, NAs are 460CC and TIIs are 550CC. And don't forget the required fuel value as noted earlier.

Download MS3X FC 13B Base Map (20KB, .ZIP)

Now that the MS3X has been set up, it is time to power prepare the Megasquirt for first startup by calibrating the TPS and telling the Megasquirt how to interpret the wideband signal.

Calibrating The TPS

Before we can start the car, the Megasquirt needs to know what value on the TPS represents closed throttle and what value represents wide open throttle.

With the laptop connected, power on the car but do not attempt to start it. If you entered the map correctly the fuel pump should prime for a few seconds and then shut off. All the gauges in TunerStudio should come to life. The water temp and intake temp gauge should show ambient temperatures within a few degrees of each other if the car is at room temperature.

From the from the "Tools" menu, select "Calibrate TPS..." to show the following screen:

TPS calibration window, MS3X, 13B rotary

With the throttle fully closed, press the top "Get Current" button. A number will now show up beside "Closed throttle ADC count".

Now floor the throttle and press the bottom "Get Current" button. A number will now show up beside "Full throttle ADC count". If this number is smaller then "Closed throttle ADC count", your TPS is connected backwards.

Click the Accept button. Thus ends the TPS calibration.

Calibrating the AFR Table

The wideband outputs a voltage corresponding to the air fuel ratio it is reading. Not every wideband outputs the same voltage per AFR so the Megasquirt must be calibrated so that the AFR tables accurately represent wideband output. From the "Tools" menu, select "Calibrate AFR Table..." to show the following calibration screen:

Calibrate AFR Table, MS3X, 13B Rotary

For "EGO Sensor" select "AEM Linear AEM-30-42xx" and then hit "Write to Controller". The processor will be programmed with the calibration table for that sensor. Of course if you are using a wideband other than the AEM unit specified in this writeup, substitute the sensor type appropriately.

When complete, power cycle the processor.

The Moment Of Truth! Time For The First Startup

It's all been building to this and now the time has come. The next section of this writeup covers how to start the car, set the base timing and get something resembling an idle.

Navigation
<< Programming The ECU (MS2)

How To Megasquirt Your 2nd Gen RX-7
Prerequisites And Requirements
Parts List
Building and/or Modding The Megasquirt MS1/MS2
Modding And Setting Up Megasquirt MS3X
Remove Stock Wiring and ECU
Modify Stock Wiring
Mount The Megasquirt ECU
Install CLT and IAT Sensors
Wire The Megasquirt MS1/MS2 Harness Into The Car
Wire The Megasquirt MS3/MS3-Pro Harness Into The Car
Wire The ECU Panel, Wideband and Fuel Pump
Reassemble The Engine Bay
Programming The ECU (MS1)
Programming The ECU (MS2)
Programming The ECU (MS3X / MS3-Pro)
Starting The Car For The First Time
Basic Tuning
Installation Video and Resources
Starting The Car For The First Time >>

Back To Mods Page | Mail Me | Search | Buy Me A Coffee