http://www.megasquirt.info/
MegaSquirt & Rotary Engines
This is an overview for using MegaSquirt on a Mazda rotary engine. It is not intended
to be a primer on Wankel rotary engines themselves, only how to use MegaSquirt with
them. To find out more about Wankel rotary engines, go to Blake Qualley's excellent
Rotary Engine Illustrated web site.
To understand how a rotary engine works with MegaSquirt, we need to figure out how
MegaSquirt will 'see' the rotary in terms of injection cycles.
In 720° of crank rotation, a four-stroke cycle piston engine (two revolutions = 4
strokes) ingests its rated displacement (ignoring volumetric efficiency issues and
the like) of air. In the same 720°, the rotary swallows twice its rated displacement
(somewhat like a 2 stroke cycle engine).
To understand this, recall that a Wankel rotary engine has three faces on each rotor,
evenly spaced at 120° apart. The rotors rotate at 1/3 the eccentric shaft speed, so
we see an ignition event every 120°×3 = 360 degrees, and all three faces require
3×360° = 1080° of eccentric shaft rotation.
(Note that all of these factors are determined by the geometry of the case, housing,
and gears, and are the same for all Wankel rotary engines.)
In the 13B, there are two rotors, however, and they are phased 180° apart, giving an
ignition event every 180°, alternating between the rotors.
Crank Degrees Piston Engine
Cylinder Firing Wankel
Rotor Firing
0° 1 1 (face 1)
180° 3 2 (face 1)
360° 4 1 (face 2)
540° 2 2 (face 2)
720° 1 - back where we started 1 (face 3)
900° 3 2 (face 3)
1080° 4 1 (face 1) - back where we started
So to MegaSquirt, the Mazda 13B rotary looks just like a 4 cylinder engine, except
for having a 2nd set of plugs delayed by a few degrees. Each rotor has 3 chambers and
executes an Otto cycle (intake-compression-power-exhaust) in 1080° of eccentric shaft
rotation.
Therefore, setting up a rotary as a 4 stroke cycle, 4-cylinder (since it gives 4 tach
pulses per 720°), and 2600cc (displacement x 2), works out fine. The number of
squirts per cycle may need some experimentation for your specific installation, as
with any MegaSquirt installation.
Throttle Body Issues
The stock Mazda throttle body is progressive in nature, so injection must be as well
if the stock EFI hardware is to be used without modification. This requires that
MegaSquirt fire primaries only until the secondary throttle plates have opened
adequately. This can be achieved by using a version of MegaSquirt code called 'Dual
Table' which allows one to tune the two injector banks separately.
Ignition
Note: You may need to add a 50K Ohm resistor to the coil signal from the OEM ignition
to prevent rpm spikes, etc.
You have a few choices for ignition for a rotary engine:
* use a distributor from an older pre-'86 RX-7 to control ignition,
* use the stock ECU to control the ignition,
* use a MegaSquirt derived ignition controller and non-stock modules (such as EDIS)
* use an aftermarket ignition controller.
Many different ignition solutions have been spawned from the base MegaSquirt, such as
MSnS. The rotary engine ignition requirements, with trailing firing after the
leading, has not yet been achieved using MegaSquirt or its derivatives. Some users
are running a modified version of MSnEDIS, which uses a crank-mounted 36-1 wheel for
timing, and fires four individual coils one per plug. They usually have it configured
to fire the leading and trailing plugs together with zero split, and have noticed no
complications in doing so. There may be issues when running boosted engines in this
configuration, although much conflicting information exists on this topic.
Mike Robert spent some time on a dyno last year and was able to test what happened in
the case of stock 'spilt' spark timing, trailing only, leading and trailing firing
simultaneously (no split) timing and leading only timing.
The results were:
* Leading and trailing spark in a roughly stock timing split configuration gave
~164 RWHP @ 8500.
* Trailing spark only only ran very badly (as expected) and power was way down,
EGT was high enough to make the exhaust medium red; that run was aborted.
* Leading and trailing spark firing simultaneously were no different form stock
split until after 6500 rpm or so; even then the difference was almost negligible.
* Running leading only spark produced about the same power as well, within error
margins.
All of these tests were run with 26 degrees leading advance max on 87 octane pump gas.
However, idle and low load emissions might be better running both Leading & Trailing
spark with split timing.
Setting the Parameters in MegaTune
For example, the 13B rotary consumes twice its rated displacement every two
revolutions, acting effectively a 2600cc 4-cylinder 4-stroke. If you had 460 cc/min
injectors, you would calculate Req_Fuel in MegaTune as follows:
* Displacement: 2600 cc
* Injector Size: 460 cc/min
* # of Cylinders: 4
* # of injectors: 2
* Squirts per cycle: 2
* Injector Staging: Simultaneous
* Engine: 4-stroke
The end result is a calculated Req_Fuel of 9.4 milliseconds.
Here is an example of a full rotary set-up:
* Car: 1985 Mazda RX-7 GSL-SE
* Motor: Stock 13B, 2×720cc/min Mazda Injectors
* Current MegaSquirt Parameters:
o REQ_FUEL: 8.0
o INJ Open: 1.0
o PWM Current: 75%
o PWM Time: 2.5
+ 1 squirt,
+ Simultaneous,
+ 4 stroke,
+ 4 cyl,
+ MPI,
+ 2x inj,
+ 250kPa
+ Baro,
+ Even fire
Here's an .msq file for a 1986 stock-port 13B running staged injection code from
Roger Enns:
79-6port-July27.msq
And these are the settings as they appear in MegaTune:
and here is the megasquirt-I.ini file Roger uses:
megasquirt-I.ini
Injector Specifications
Typical injector flow rates for Mazda rotary engines are:
Motor Injector Info cc/min
12A Turbo Blue 720
Green 800
13B 6-Port 2x injector 720
4x injector 430
13B Turbo Series 4 / 5 red, purple, pink 550
13B Turbo Series 6 Primary 550
Secondary 850
20B Turbo Primary and Secondary 550
As long as both primary and secondary are the same flow rate you can use 'Kurt
Staging'. You fire primaries and secondaries in alternate mode, with the maximum
squirt time being equal to 2 inlet periods. At high RPMs and WOT the injection
periods will overlap, giving the same effect as staging. (Primaries in parallel on
one injector bank, secondaries on other.)
Mazda RX-7 Air and Coolant Temperature Sensors
Stock Mazda sensors can be used by updating the firmware with new lookup tables using
EasyTherm, and changing one bias resistor on the MegaSquirt board.
The coolant temperature sensor is close in spec to the GM unit, so no change in bias
resistor is needed. The air temperature thermistor on the other hand, is VERY
different from GM sensor, which requires a bias resistor change. This is resistor R4
on the MegaSquirt printed circuit board, and is 2.49K Ohm by default. For the Mazda
sensor, use a 47K Ohm resistor, although any resistor in the 30K-50K Ohm range should
work.
Use EasyTherm or equivalent to create and download the new thermistor tables.
The specs from the factory service manual (84-85 GSL-SE, 86-88 all models, likely 89+
as well) are as follows:
Coolant Temp:
* -20°C = 16200 Ohm
* 20°C = 2450 Ohm
* 80°C = 320 Ohm
Air Temp:
* 20°C = 41500 Ohm
* 50°C = 11850 Ohm
* 85°C = 3500 Ohm
You use EasyTherm to generate the .INC files, which you use to recompile the code to
match your sensors. You can find more on compiling code in the Assembly Language
Tutorial.
Here are some 'pre-built' files (using the above values and resistors):
* rot_airdenfactor.inc
* rot_matfactor.inc
* rot_megasquirtDTmod.s19 (Dual table code with sensor modifications)
* rot_thermfactor.inc
Note that to use these files, you generally have to rename them to remove the 'rot_'
prefix, which is added to prevent mixing them up with the original MegaSquirt files.
Don't forget to copy the modified files to the MegaTune directory.
Loading the code to MegaSquirt is covered in the appendices: Embedded Software
Upgrade Instructions .
You also need to copy the .INC files to the MegaTune directory.
Kurt Staging
Those of you wanting to do staged injection you have also got an alternative way,
using the standard MegaSquirt hardware and code. 'Kurt staging' (named after the
originator, Kurt Heintz) is a method of improving the dynamic range of a set of
injectors. It takes advantage of the fact that the injectors timers are independent,
and thus they can overlap. This means that one injection event does not have to
finish before the next starts.
To implement Kurt staging, you can use a second set of identical injectors that feed
each cylinder and hook the INJ driver #1 to the first set and INJ driver #2 to the
second set. What will happen is at idle the injectors will alternate their pulses but
as your VE values increase they will start to overlap pulses and allow full flow from
both injectors at the same time. In essence, you progress from alternating to
simultaneous as pulse widths increase.
The available time, in seconds, to inject (for a 4 stroke cycle) is:
time = 120/RPM * duty_cycle
Whenever the pulse width is greater than ½ of this, Kurt staging will be in effect.
For example, at 6,000 RPM on a with port injection you have a maximum of 85% of 720°
to inject, or 17 milliseconds. If you change this to 2 squirts you have 8.5ms per
squirt (ignore inj_on). For example, if you had two 19lb injectors per cylinder and
suppose VE=100 when the pulswidth was 8.5ms. Up to this point each injector is on
separately, i.e. one squirts for 8.5ms, then the other squirts for 8.5 ms. Above this
they start overlapping, up to the point that, at VE=200 you have 17ms of injection at
38Lbs. Kurt staging gives twice the dynamic range of a single large injector on
standard code.
The main criteria is that the engine must be set up so that it could conceivably run
on either bank. For port injection, you must use two injectors per cylinder. For
throttle body injection, you don't have any special hardware requirements. All
injectors must have the same flow rating. They are then wired up, half to INJ1 bank,
and the other half to INJ2 bank.
The injectors are set up to run alternately with the 'injector staging' parameter in
MegaTune. For example, on an independent runner 4 cylinder engine you set the
MegaSquirt to 1 squirt/alternating. Each runner will have 1 injector from each bank
squirting into it. This will in effect squirt once per cycle into each runner, first
from one injector, then from the other on the next cycle. But, these squirts can
overlap, so at higher revs, you can have both injectors squirting during the same
cycle, injecting more fuel than one injector could.
Kurt staging works with the MegaSquirt as is, requiring no additional coding. You
will need to have all the same size injectors placed as close as you can get them to
each other and might need to alternate the injector banks for each INJ driver to get
a smooth idle (IE. INJ driver #1 drives "A" injector for cyl #1, drives B injector
for cyl #2, drives A injector for cyl #3 and drives B injector for cyl #4; INJ driver
#2 would drive the opposite injector as the first INJ driver).
So if you have two equal injectors feeding the same cylinder you can use the above
mentioned method, if you are running an extra set of different injectors or up stream
injector/injectors you will need to use the dual table code, rather than Kurt staging.
Kurt staging is useful for turbos and also for high revving motors, as well as when
it is more convenient to get another set of small injectors to get desired fuel flow
(i.e., doubled up 19 lb/hr injectors on a high powered 351W might be more cost
effective than a set of 40 lb/hr injectors'ers).
Thanks to Roger Enns, Bill Shurvinton, and Mike Robert for the information used in
preparing this page.
If you have a question, comment, or suggestion for this FAQ, e-mail the editor.
Last Updated: Wed, 28 Sep 2005 22:27:29 GMT©2004, 2005 Bruce Bowling and Al Grippo.
All rights reserved.
The Rotary Engine NewsLetter. Powered by Linux.
ACRE NL web site.
http://www.rotaryeng.net
Copyright 1998-2005 All world wide rights reserved.