Megasquirt-3 MS3 Variable valve timing
Note! This feature requires firmware 1.1.x or later
On/Off mode -
Test mode -
Setting up -
Many engines now feature variable valve timing. This allows a balance between engine performance and economy with the ECU automatically adjusting the
valve timing to suit operating conditions (rpm/load.) The particular implementation varies with engine and manufacturer. The first systems available
are of the "on/off" variety where the cam is moved by a fixed angle only and there is no feedback systems. More advanced systems use continuously
variable cam controls - typically an oil solenoid valve is controlled by a PWM signal from the ECU and the position of the cam is detected using the existing or additional cam position sensors.
Most continuously variable VVT systems are of a continuosly variable design where a duty near 50% holds the cam in position. More than 50% causes it to advance or retard. Less than 50% moves it in the opposite direction.
The most complex system currently supported is the BMW vanos system with four cams being controlled individually. The first cam sensor is used for engine phase information and cam position. The other three cam sensors are used to monitor cam position only.
Be aware that some electronics DIY will be required by the end user or system builder to utilise this many cam inputs.
The VVT settings and tables are found on the Advanced Engine menu.
On/Off mode requires a small number of settings and will be convered later here
No. VVTs - the number of VVT cams to be controlled
Cam Decoder - if required an application specific decoder. Not required for most installs.
Frequency - the PWM output frequency. Adjust to suit your valves.
On/Off or PID - the mode of operation. Full variable systems should use PID.
Adjust inj. timing based on - whether the Injector Timing for sequential injection should be adjusted as the cams are moved.
Commanded vs Actual - should the commanded target angle or the current actual cam angle be used for the injection timing adjustment.
Inj. Timing Adjustment - for on/off mode this specifies the Injector Timing adjustment when VVT is on.
Test output - during initial setup the test mode is used to confirm solenoid operation and learn the cam range of movement. The output specifies which cam should be altered.
Test duty - the PWM duty cycle to be applied to the chosen VVT output under test.
Control Interval - typically VVTs are adjusted as often as possible for best response. This is achieved with the synced to cam option. Alternatively a timed adjustment interval can be chosen.
Control Interval Time - the time interval in milliseconds for adjustments in timed mode.
PID Parameters - there is a set of settings for intake and exhaust cams if required.
More duty means - whether more PWM duty on the solenoid causes the cam to advance or retard.
Hold/neutral duty - the duty at which the cam stays still.
Proportional gain - the 'P' term for control.
Integral gain - the 'I' term for control.
Difference gain - the 'D' term for control.
Cam parameters - settings for each cam
Input - the position sensor input for this cam. (Cam 1 always uses the main cam sensor input set in Ignition Settings.) See the wiring section on how to connect these inputs.
Polarity - The capture polarity of the cam input. (Cam 1 typically follows the main settings.)
No. teeth - How many capture teeth on the cam wheel. May be application specific.
Output - where the PWM solenoid valve is connected.
Minimum - the minimum absolute angle from the cam sensor. See setting up.
Maximum - the maximum absolute angle from the cam sensor.
Int./Exh. - is this cam an intake or exhaust cam. This determines the PID parameters, direction and target table to be used.
Tooth 1 - only used by BMW V10 at present. Look for the cam tooth edge after this crank tooth no.
Tooth 2 - same again, but for second crank revolution.
On / Off mode
For on/off mode, no feedback of cam position is used and most settings on the VVT settings screen are unused and greyed out.
The output value, frequency and injector timing adjustment are set through
the main settings screen.
In place of the angle target table, an on/off table is used. In this table, set 100 for cells where VVT should be active and 0 for cell where it should be inactive. Do not use other values.
The first cam sensor should be wired up as per normal ignition wiring. Typically this would be to the MS3X cam input.
Second, third and fourth cam sensors will require creativity and DIY as the MS3/MS3X setup was not originally designed for more than a single cam input. A conditioning/protective circuit is required to interface the cam sensors to the CPU. Remember that the CPU itself must never be exposed to voltages outside 0-5V.
JS10 - this is a 0-5V input on the V3 mainboard.
PT4 - this is a 0-5V input on the MS3X connector.
Datalog/PT6 - this is a 0-12V input on the MS3X connector. A ground switching hall/geartooth sensor could be directly connected. You will likely need to remove C12 from the MS3X card and replace with a smaller value. The standard 0.1uF is fine for its original purpose, but is too large for a cam input. Try 0.01uF. The MS3X card has a pullup to 12V. Check the schematics if required.
The 'PWM' outputs from the MS3X can be directly used to drive most PWM valves.
The test mode allows the user to force a VVT output to a specific PWM duty cycle. Typically this used during initial setup only.
The most basic setup is to make the wiring connections for inputs and outputs. Most engines will run safely with VVT inactive, ensure this is the case on your engine.
Having completed the wiring it is necessary to set the basic configuration reflecting the wiring choices you made, the control type and the number of teeth on the cam wheels. Leave the min/max cam angles as zero for now.
On your TunerStudio dashboard, enable the gauges vvt_angle (1,2,3,4 as required)
Start the engine and observe the vvt angle gauges.
Use the test mode for each VVT with 0 and 100% duty and observe the swing of the cam angles. You will hear the engine tone change as the cam angle changes. It is important that the vvt angles you observe are stable and vary evenly. With continuously variable cam timing the vvt angle will normally swing from fully retarded to fully advanced (and vice versa) quite quickly with any duty beyond the hold/neutral duty so it will be unlikely that any angle other than the extremes will be observed.
Double check that the cam min/max angles are presently set to zero. For each cam record the minimum and maximum angles you observe as the test duty is varied. Enter these into the min/max fields. Note that the maximum MUST be larger than the minimum. (In the instance where the angles cross 720 degrees, add 720 to the maximum angle. e.g. if minimum was 700 and maximum was 40 degrees, enter 700 and 760.)
At this stage you should also be able to determine if more duty is retarding or advancing each cam.
Having configured the inputs and outputs proceed with PID tuning. Take datalogs and observe the vvt actual angle compared to the target angle.
If you have a question, comment, or
suggestion for this FAQ please post it on the forum.
No part of this manual may be reproduced or changed without written permission from James Murray and Ken Culver.