This section covers programming the MS2 ECU to run the 13B rotary. Because there is such a difference between the setup of MS1 and MS2, each ECU is covered separately.
If you have not already done so using a Stimulator during the build/modding section the first step is to flash the appropriate firmware into the Megasquirt. For convenience I've reproduced those instructions here.
The stock Bowling & Grippo firmware loaded onto Megasquirt CPUs from the factory will run the rotary, but it will run fuel only and without a lot of the features we depend on (such as staged injection). It is therefore necessary to load the Megasquirt and Spark Extra (MSnSE) firmware.
Disconnect the ignition coils from the harness before proceeding! Failure to do this will burn out the coils! Instructions on how to configure Megatune to read your Megasquirt is found on the MegaTune website. The site contains full instructions on how to set up Megatune, what to do if your laptop doesn't have COM ports, and how to set Megatune to communicate with Megasquirts running various firmware versions. Configure Megatune and then plug the computer into the Megasquirt.
MSII users should see the MS2-Extra Software Manual for installation instructions for the latest version of MS2/Extra.
Don't bother following the instructions on the above websites to configure the Megasquirt to your engine. We'll do that later.
Note that when you use the Configurator to configure Megatune, you need to select the appropriate Lamda Sensor and Idle Controller. Set LAMBDA_SENSOR to "AEM_LINEAR -- AEM Gauge AEM-30-42xx" and IDLE_CONTROLLER to "PWM_GAUGE -- PWM Idle Valve (e.g., Ford or Bosch)".
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 it's outputs. The MS2 firmware is still being developed (unlike MS1 which is basically done) 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. Keep in mind that you don't have to be connected to the ECU to make these settings. You can open up Megatune, keep it offline, set everything up, then save it as an MSQ. You can then load that MSQ into the ECU when you are in the car. If 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 Megatune but not sent to the ECU.
I am not going to explain in detail every setting on this page. To do so would be a monumental task and simply repeat information in the Megasquirt manuals. With each screen I will give you the basic idea of what the settings do but if you want to know more, it is up to you to look it up.
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.
These settings are the basic characteristics of the engine. Note that the number of injectors is set to two. This is correct, because even though we have 4, the secondaries are staged and not always operating.
|
|
More engine constants allows you to set up multiple methods of determining engine load. For example, you could run Alpha-N (TPS vs. RPM) if you have a weak vacuum signal. For the stock rotary, we only need speed density of as our control method so secondary methods can be disabled.
|
|
These settings tell the Megasquirt how to control the injectors. The settings presented here are for high impedance injectors. For low impedance injectors, the PWM Current Limit and PWM Time Threshold settings need to be tuned however I have found that because only two injectors per driver circuit are used on the rotary, these settings seem to work fine for both high and low impedance injectors with no damage to the injectors or the Megasquirt.
|
|
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, Megatune 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 Megatune's table exchange .VEX format. To import it, download the file and then from the VE Table 1 dialog, select "File" and then "Table Import...". 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. |
|
The AFR table provides air/fuel ratio targets for the Megasquirt to follow when operating under closed loop. With a wideband sensor the Megasquirt is able to work to achieve a variety of AFRs, not just 14.7 as it would with a narrowband. The ratios presented in this table are a very good starting point. It is really only the cruise area we are concerned with (the area showing AFRs of around 15:1) as the Megasquirt is set to go open-loop everywhere else.
|
Thankfully, Megatune 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 Megatune's table exchange .VEX format. To import it, download the file and then from the AFR Table 1 dialog, select "File" and then "Table Import...". Browse to the downloaded file and open it up to start the import. This is a table is a good start for both NA and turbo 13Bs. |
|
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, Megatune 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 Megatune's table exchange .VEX format. To import it, download the file and then from the Spark Table 1 dialog, select "File" and then "Table Import...". 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. |
|
The general settings tell the Megasquirt whether to operate in single or dual table mode, how to correct for differences in atmospheric pressure and what kind of acceleration enrichment to use. We are only operating in single table mode and we are using standard AE for the moment. You may wish to play with Enhanced Accel Enrichment (EAE) later but for now it should be disabled to make tuning more straightforward. As for the lag factors, they tell the Megasquirt how log it takes each sensor to register a reading the time whatever it is measuring has changed. These can be left as default unless you experience issues (such as jittery sensor readings not caused by bad grounding).
|
|
There are several rev limiter options available but here we are using fuel cut. Since all fuel is cut, there is little risk. However if you are constantly bouncing off the rev limiter it will pay to set up a hard and soft limit by cutting spark as this will result in a much smoother feel.
|
|
These settings set the RPM points for high and low RPM when using EAE. Since we have disabled EAE, it really doesn't matter what these settings are so just set "Low RPM Threshold (rpm)" to "2500" and "High RPM Threshold (rpm)" to "5000". These are the default values. If you enable EAE, make sure to revisit these settings.
EGO control defines how the oxygen sensor is used in closed loop operation. The AFRs it seeks out have already been set in the AFR table so most of these settings just tell the Megasquirt that it has a wideband sensor and when to enter closed loop.
All other options are disabled. |
|
Once you have made the changes in EGO Control, go back and set the "Controller Authority" to 0 (zero) to disable closed loop operation. During the first startup and initial tuning, closed loop will get in the way so it is best to turn it off. Once you have your VE table reasonably well set, you can go back to these settings and set it to 30%.
These settings tell the Megasquirt where it is getting an RPM signal (toothed wheel) and how to use that signal. They also tell the Megasquirt how to fire the ignition coils (bring the output low) and that the engine is going to be firing both leadings on one coil (wasted spark). The one setting you may have to change here is Trigger Offset, but only if you have stabbed your CAS in a non-stock location.
|
|
The aptly named "More Ignition Settings" menu contains, surprisingly, more ignition settings. These are the secondary settings such as where to pull timing from, dwells and rotary mode. For now, ignition advance should come from the main timing table but during the initial startup we will revisit this screen and set a fixed advance so the CAS position can be adjusted.
|
|
You probably won't have to change any of these options past the initial setup. One which might end up getting tweaked is "Cranking Advance". 8 degrees may be too much in some applications and can cause the engine to kick back against the starter. I have found that in stock port setups, around 8 degrees provides a very snappy startup.
We already told the Megasquirt that it is getting it's tach input from a trigger wheel, so now it needs to be told how to read the pulses coming from that wheel. Once these options are set, they will not have to be readjusted.
|
|
The only setting relevant here is the cranking RPM. At this number and below, the Megasquirt knows the engine is cranking and not actually running. For most cars, 300RPM is fine as long as the battery and starter are healthy.
|
|
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.
|
|
The cranking pulse tells the Megasquirt how much to enrich the fuel mixture while the engine is cranking. Unlike the MS1 where this is specified as a fixed pulsewidth, the MS2 specifies it 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 should be considered quite rich.
|
|
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. However during the initial tuning, this can often confuse things. The engine may attempt to stall which will trigger the ASE, which will cause it to run unevenly then attempt to stall again, triggering the ASE. This can be very irritating. For now I suggest you disable ASE by setting all of the "Afterstart (%)" bins in this window to 0. Once some tuning on the car has been done and it is starting reliably, then ASE can be revisited.
ASE Taper is the number of engine cycles that ASE is applied. As ASE has been effectively disabled in the previous step then whatever is in this table is irrelevant. However in the beginning, when starting to tune ASE, it helps to set all of these bins to a fixed amount. So if you wish you can take this opportunity to set all of the "Taper (cycles)" bins to "250".
There is only one setting in Idle Control that we need to configure. Once it is selected, all other options are disabled. Set "Algorithm" to "PWM Warmup".
These settings tell the Megasquirt the basics of how to operate the BAC, as well as how to open it up during cranking. If you find your car shoots to some ridiculous RPM as soon as it starts, lower the "Cranking duty (%)".
|
|
The Idle PWM Duty Table specifies how long the BAC valve should be open at various coolant temperatures. Note that this is highly dependant on your final VE table and coolant temp enrichments so don't bother tuning this until the car is running well otherwise. These numbers are just a decent value to avoid the car stalling out at low temps while also keeping it from shooting to crazy RPMs.
|
|
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.
|
|
The Megasquirt has several outputs that are configurable to operate under a variety of conditions. The only one we are already using is FIDLE, for the BAC valve which leaves a bunch free. One of the IAC (idle stepper motor) control ports will be used to control the e-fan, which gets set up in this screen.
|
|
The "Threshold" is the value of the variable (in this case coolant) at which you want the output to trigger. "Hysteresis" is the changed required to turn that output off. Therefore, in these settings, the fan comes on at 195 degrees and switches off at 188 degrees. These switching temperatures work well in combination with the stock thermostat. The fan will cycle on and off during low speed driving, and remain totally off when there is enough airflow through the rad to keep the car cool.
Barometric correction will correct the reading of the MAP sensor for various atmospheric pressures. At the moment it is not necessary so just leave the settings at their defaults of all zeros. It really only is necessary if you are driving in an area where the pressure swings significantly, for example, in the mountains.
Cold advance allows you to add or remove timing based upon coolant temperature. This is most useful when a little bit more timing is necessary as the engine warms up to maintain smoothness. For now and during the initial tune, it won't be helpful. Only after all other major fuel and ignition tuning has taken place should these settings be used.
Manifold air temperature timing retard allows you to pull timing at high manifold temperatures. For the moment, just leave these settings at the default. Note: If you have high IATs and/or a stock top mount intercooler, you will probably want to tune this later. MAT ignition retard will allow you to pull timing if you are experiencing high intake temps that may be caused by an inefficient (like the stock) turbo and/or a stock top mount intercooler. If you are running more then 15 degrees of timing under boost and experiencing high intake temps you will want to start pulling out timing to avoid detonation.
MAT Correction allows you to fine tune the air density calculation as performed by the ECU relating to air temperature. You can use this to compensate for heat soak conditions or poorly placed IAT sensors. For the initial tune, this should be left at the default of zero across the board.
Unless you actually have a GM style Flex Fuel sensor installed, then set "Flex Fuel Sensor" to "Disabled". This is only used in flex fuel applications (E85) and even if you have such a thing installed on your RX-7, it is not covered in this writeup.
As there is no knock sensor installed, these settings can be left at defaults. They will not effect the operation or turning of the engine.
The over run settings tell the Megasquirt when fuel should be cut during over run (decel). With the TPS and manifold pressure below a certain threshold (set in this window) the Megasquirt knows the car is decelerating and will cut all fuel to prevent bucking, save fuel and stop from suffocating those drivers behind you. The settings I have provided here are probably going to be good for almost everyone. One thing you may want to increase is the RPM setting if you have a habit of engine braking to the very last second.
|
|
To properly run the RX-7s staged injection, the Megasquirt needs to be set up with the size of the staged injectors and when to actually stage them. This is done in the appropriately named "Staged Injection" window. Here the injectors are set to come on above 3500 RPM and 90 KpA of manifold pressure. This is approximately equal to stock settings though at a slightly lower RPM point. Note that this window shows 550CC injectors as installed in a stock TII. If your car is an NA, then you have 460CC injectors. Obviously, if you are running a different injector combination, these settings should be altered to reflect that.
|
|
The dash tach is triggered by the trailing coil so it's unnecessary for the Megasquirt to operate it. Disable tachometer output by setting "Tacho output enabled" to "Off", which is the default setting.
Disable launch control by setting "Launch control option" to "Off", which is the default setting. There is no need to have launch control enabled at this point or during tuning. If you wish to experiment with it later then do so only after the engine is fully tuned.
Dwell is already setup in "More Ignition Settings". This screen allows you to compensate for battery voltage changes by increasing or lowering dwell. For the time being, leave it at the defaults. It is unlikely you will have to change any of these options.
Set "False trigger method" to "Simple", which is the default and will disable all other options in this dialog box.
The trailing settings specify how many degrees after the leadings the trailing plugs fire. This is referred to as "split". The table presented here is safe and efficient for both turbo and NA cars. 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. The one thing you may want to do is dial in a few more degrees of split under boost for a bit more safety. Though 10 degrees is safe, many tuners run around 15 degrees.
|
Thankfully, Megatune 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 Megatune's table exchange .VEX format. To import it, download the file and then from the Rotary Split Table dialog, select "File" and then "Table Import...". 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. |
|
You will find this dialog by clicking the "Rotary Trailing Settings" menu in the "Rotary Split Table" dialog box, and then selecting "Rotary trailing settings" from the menu. Confusing enough?
|
|
You can ignore this menu option unless you already know what it means.
You can ignore this menu option unless you already know what it means.
The noise filter can help filter out ignition trigger noise by telling the ECU to ignore pulses of too low a duration at various RPM points. Leave this at the defaults for now but if you are experiencing noise that you cannot solve by fixing the hardware, you may need to tune the noise filter.
You're probably now asking yourself why I didn't just provide a base map that you can load into the ECU with all of those settings already in place. Well, what would you have learned then? If I had just provided a base map without explaining the key settings then you would have no basis of knowledge for possible troubleshooting.
Now that you've spend the better part of an hour entering those settings, it is time to power prepare the Megasquirt for first startup by setting the TPS and telling the Megasquirt how to interpret the wideband signal.
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 Megatune should come to life. The water temp and intake temp gauge should show ambient temperatures if the car is at room temperature.
From the from the "Tools" menu, select "Calibrate TPS..." to show the following screen:

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 OK button. Thus ends the TPS calibration.
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:

For "Sensor Type" select "AEM Linear AEM-30-4200" and then hit "OK". The processor will be programmed with the calibration table for that sensor.
When complete, power cycle the processor.
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.