Home > RX-7 > Tech/Mods > Mods > Megasquirt > Programming The ECU (MS3X / MS3-Pro) |
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.
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.
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.
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 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..".
|
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.
|
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.
|
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.
|
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.
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.
|
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.
|
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. |
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. |
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 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.
|
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. |
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.
|
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. |
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.
|
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. 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.
|
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.
|
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.
|
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).
|
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.
|
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.
|
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.
|
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.
|
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.
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.
|
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.
|
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.
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:
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.
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 "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.
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.
Back To Mods Page | Mail Me | Search |