Outputs

Overview

The ECU has a number of electrical outputs that can be used to control various devices through the wiring loom. These outputs may be assigned to different functions by setting options in the calibration.

Outputs are typically either PWM or digital outputs. PWM outputs are used to control devices that require a proportional control signal, such as a valve or a motor. Digital outputs are used for devices that require a simple on/off control signal.

See also Output Pins.

Output Types

Tip

Oil Feed outputs may also be repurposed and used as slow pulse width modulated (PWM) outputs, or low resolution user signals.

Subsections of Outputs

Digital Outputs

Overview

The ECU has a number of digital outputs (ON / OFF) that can be used to control various devices through the wiring loom. These outputs may be assigned to different functions by setting options in the calibration.

Some digital outputs may be switched to other functions such as PWM or timed outputs. For devices that require a proportional control signal, use a PWM output channel instead.

PWM Outputs

Overview

The ECU has a number of Pulse Width Modulated (PWM) outputs that can be used to control various devices. These outputs may be assigned to different functions such as VV control, Idle valve, Wastegate, Servo.

Some PWM outputs may be claimed by specific functions. For instance, if Active Throttle is enabled, it owns a bridge driver and prevents others attempting to use the output, unless e.g. option iconAct T 1 No Drive is set to ON.

Note

Some PWM channels have usage / precision restrictions - see the specific PWM channel documentation for details.

Duty Cycle

The duty cycle of a PWM signal is the ratio of the ‘on’ time to the total period of the signal. The frequency of the PWM signal is the rate at which the signal repeats. Over time, this produces a proportional control signal with low power loss.

For devices that require a simple on/off control signal, use a digital output channel instead.

Configuration

PWM outputs must be enabled using options in the calibration and are typically routed to from ECU functions using additional calibration options.

Some PWM outputs are used for specific features such as active throttle, so some care is required to avoid conflicts.

Restrictions

PWM1-16 are fixed to individual pins, however, PWM17 onwards are assignable to any simple output pin. In the pin-outs diagram/table, these fixed PWMs have a code of ‘Pnn’, where ‘nn’ is 01-16.

PWM Output Pin Assignment

For PWMs that may be assigned to output pins, pin assignment options are available in the calibration.

e.g. option iconOut PWM17

As with any other output pin assignment, using a negative value will invert the output signal.

Note

Note that output pin assignments differ to PWM numbers. For example, option iconOut PWM17 is a pin number. option iconOut Oil Feed 1 PWM is a PWM number (which may be further routed to a pin).

Oil Feeds

See Oil Feed Outputs for details on the Oil Feed channels - which can either use PWM outputs or generate low-speed PWMs in software on simple digital outputs.

Timed Outputs

Overview

Timed output pins are used for precisely timed pulses for functions such as Ignition, Injection, High Pressure Pump, etc.

On the EM80, there 8 x 8bit PWM output pins that can be PWM outputs 1 to 8, injector outputs 1 to 8 or simple low-side outputs.

Timed outputs allow the processor to schedule asynchronous events like ignition in response to crank tooth interrupts, with high precision timing and are enable features like variable ignition advance / retard to work.

Oil Feed Outputs

Overview

GEMS ECUs typically provide 4 Oil Feed output controllers for controlling solenoid pumps. This section discusses Oil Feed 1, but the same principles apply to the other Oil Feed output controllers.

Tip

Oil Feed outputs may also be repurposed and used as slow pulse width modulated (PWM) outputs, or low resolution user signals.

It is recommended that the behaviour of the oil outputs is tested following configuration. Monitoring the associated output pin channel using a Scope View or a physical oscilloscope is recommended.

Oil Feed Configuration

Each oil feed controller has a set of configuration options. Considering Oil Feed 1:

Option Description
option iconOil Feed 1 Source Selects an input channel for varying the duty cycle. The MSB of the raw input value is displayed by the channel iconOil Feed 1 raw channel.
option iconOil Feed 1 Source Bigend Specifies upper/lower byte of the input channel, if it is 16bit. This is usually set to OFF. In some cases (e.g. Little Endian data coming via CAN bus) the bytes of the raw input channel may require swapping.
option iconOil Feed 1 Mul Multiplier for re-scaling the raw input value, saturates at 100% duty cycle in case of overflow. The result is stored in channel iconOil Feed 1 Duty
option iconOil Feed 1 PWM Out
option iconOut Oil Feed 1 PWM
PWM channel number for high rate / precision PWM, using PWM output settings with duty cycle channel iconOil Feed 1 Duty. Note: PWM numbers are not the same as output pin numbers.
option iconOil Feed 1 Out
option iconOut Oil Feed 1
Digital output pin for low rate PWM, only used if option iconOil Feed 1 PWM Out = 0. If a negative value is supplied for the pin number here (e.g. ‘-5’), the signal is inverted (on e.g. pin ‘5’). In this case there are additional Oil Feed options to control the software PWM.
Warning

Changing the output pin (option iconOil Feed 1 PWM Out or option iconOil Feed 1 Out) may leave the prior output in an undefined state. It is recommended to store the calibration and power-cycle the ECU following output pin changes.

Digital Output Configuration

If the Oil Feed output is using a digital output instead of a PWM output, a low frequency / low precision PWM is generated by software.

The following common options are effective in this mode:

Option Description
option iconOil Feed 1 Stop Duty If ON then when channel iconStat Running is OFF, option iconOil Feed 1 Duty Stopped will be used for the duty cycle of the output, unless option iconOil Feed 1 Stopped OFF is ON (in which case the output would be switched ‘OFF’).
option iconOil Feed 1 Duty Stopped Duty cycle to use when engine is not running (channel iconStat Running is OFF), depending upon option iconOil Feed 1 Stop Duty and option iconOil Feed 1 Stopped OFF options
option iconOil Feed 1 Fixed On Use a fixed-length ON pulse, with the duty cycle affecting the duration of the space between ON pulses.
option iconOil Feed 1 Stopped OFF If ON then the output will be switched off when the engine is not running (channel iconStat Running is OFF), otherwise the output will be set to option iconOil Feed 1 Duty Stopped.

Fixed Mode

Enabled when option iconOil Feed 1 Fixed On = ON.

This mode uses a fixed duration ON pulse and variable duration OFF interval.

Option Description
option iconOil Feed 1 Fixed On ON
option iconOil Feed 1 Fixed T.B. Maximum duration of variable part of OFF period, in milliseconds (added to option iconOil Feed 1 OFF min).
option iconOil Feed 1 Fixed comp If set, changes the type of complement operation performed on channel iconOil Feed 1 Duty prior to scaling option iconOil Feed 1 Fixed T.B.. If ON then a 1’s complement (logical NOT) is used instead of 2’s complement (arithmetic negation). It is recommended to set this to ON for new calibrations and can give better results at higher frequencies.
option iconOil Feed 1 OFF min Minimum duration of OFF period, in milliseconds.
option iconOil Feed 1 Fixed ON Duty Fixed duration of ON pulse, in milliseconds.
channel iconOil Feed 1 Period Reports current period of signal.
channel iconOil Feed 1 T Count Count-up timer, used for signal generation.

The duration of the ‘OFF’ interval is calculated by scaling option option iconOil Feed 1 Fixed T.B. by the (inverted) duty cycle percentage shown by channel iconOil Feed 1 Duty.

The OFF interval can’t ever be 0 and will have a lower limit of 1ms. The lower limit may be clamped to a higher value by setting the option iconOil Feed 1 OFF min option.

option iconOil Feed 1 Fixed ON Duty option defines the duration of the ON pulse. This added to the calculated OFF duration to give the total period of the PWM signal and is placed in channel iconOil Feed 1 Period.

channel iconOil Feed 1 T Count counts up every millisecond.

When channel iconOil Feed 1 T Count exceeds the value of channel iconOil Feed 1 Period, the output is switched on and channel iconOil Feed 1 T Count is reset to 0.

When channel iconOil Feed 1 T Count reaches option iconOil Feed 1 Fixed ON Duty, the output is switched off.

Proportional Mode

Enabled when option iconOil Feed 1 Fixed On = OFF.

Proportional mode has a fixed period and varies the duty cycle of the signal over that period. Additionally this mode can limit the total number of pulses delivered to the output after ECU reset.

Option Description
option iconOil Feed 1 Fixed On OFF
option iconOil Feed 1 Duty Max Maximum ON period
option iconOil Feed 1 Fixed comp If set, changes the type of complement operation performed on channel iconOil Feed 1 Duty prior to scaling option iconOil Feed 1 Duty Max. If ON then a 1’s complement (logical NOT) is used instead of 2’s complement (arithmetic negation). It is recommended to set this to ON for new calibrations and can give better results at higher frequencies.
option iconOil Feed 1 Time base Total period of the PWM signal, in milliseconds.
option iconOil Feed 1 P Max Maximum number of pulses to deliver to the output before ECU reset. If 0, then no limit is applied.
channel iconOil Feed 1 P Count Reports the number of pulses delivered to the output when option iconOil Feed 1 P Max is non-zero.
channel iconOil Feed 1 Duty Time Stores the result of scaling option iconOil Feed 1 Duty Max by channel iconOil Feed 1 Duty.
channel iconOil Feed 1 T Count Count-down timer, used for signal generation.

New calibrations may prefer to use option iconOil Feed 1 Fixed On = ON.

Warning

In Proportional Mode, some ECUs will have an initial 65 second delay before the output PWM becomes operational.

Low values in channel iconOil Feed 1 Duty result in higher duty cycles (effectively inverted).

channel iconOil Feed 1 T Count is decremented every millisecond. When channel iconOil Feed 1 T Count reaches zero, the output is switched off.

When the output is switched off, channel iconOil Feed 1 T Count is reset to option iconOil Feed 1 Time base. Additionally the result of scaling option iconOil Feed 1 Duty Max by channel iconOil Feed 1 Duty is stored in channel iconOil Feed 1 Duty Time. Note that this does not happen in ‘Fixed Mode’.

When channel iconOil Feed 1 T Count reaches the value of option iconOil Feed 1 Duty Time, the output is switched ON.

When switching on the output, if option iconOil Feed 1 P Max option is non-zero then the channel iconOil Feed 1 P Count will count up to this value, and the output will cease to be switched on again until the ECU is reset when option iconOil Feed 1 P Max pulses have been delivered to the output.

Note

option iconOil Feed 1 Duty Max should be less than or equal to option iconOil Feed 1 Time base. The sense of channel iconOil Feed 1 Duty is inverted, so that a value of 0 is really 100% duty cycle. This can be inverted by setting a negative output pin number in option iconOil Feed 1 Out.

Mapped Control

The ECU provides user tables and maps that may be used to control the Oil Feed outputs.

See ECU Internal Routing for details on how to route these user maps to the Oil Feed outputs.

Peak & Hold Injector Outputs

Overview

Some GEMS ECUs provide dedicated on-board “Peak & Hold” injector outputs that provide a specially shaped pulse to drive injector solenoids.

Tip

Fuel Injector settings need either the manufacturer’s data (often restricted) or flow bench test results. GEMS may be able to provide Calibration Aspect files for specific injectors or the layout may include selectors for common injector types.

Peak and Hold Injector Drive

Instead of a simple ON/OFF signal driving an injector solenoid, the drive transistor is first driven hard on for a specified time to ensure opening, then the current is dropped to a holding current, minimising heat dissipation in both injector and transistor. When the injector is closed, the driver circuit recirculates energy from the collapsing magnetic field of the injector coil, preventing abrupt closure of the injector which can lead to physical injector damage (fuel leakage) and unpredictable fuel delivery due to pintle bounce.

The peak & hold injectors are active if option iconInjector Peak & Hold = ON.

Note

Note if injector outputs 4 to 8 are not used as injectors their recirculation diodes may be turned on, to reduce currents when used as PWM outputs, so these outputs must not connect to permanently powered devices. Active if not an injector drive when e.g. option iconFuel 1 Recirculate = ON.

Peak

The table iconInjector Peak Time table specifies the time that the drive transistor is fully ON for, prior to entering hold mode. The peak time is dependent on battery voltage, since this directly affects the rate at which the magnetic field within the injector builds.

Some ECUs may include table table iconInjector Peak Decay Time, which is currently unused, future versions may implement this as a smoother transition from peak to hold.

Hold

The frequency and duty of hold signal is given by option option iconInjector Hold Frequency, and table table iconInjector Hold Duty.

Recirculation

The recirculation diode is controlled per injector driver by options option iconFuel 1 Recirculateoption iconFuel 8 Recirculate. Recirculation manages the current flow when the injector is turned off to smooth the closing.

Compensations

Tables table iconInjector Volts comp and table iconInjector Volts comp Secondary allow for additional compensation in response to battery voltage changes.

Compensations are displayed by channels channel iconInjector Comp Fuel Primary and channel iconInjector Comp Fuel Secondary.