6.8.49. Spark (pan_Spark)

Update the requested schedule of spark pulses for one spark channel.

6.8.49.1. Supported targets

M220-000, M221-000, M250-000 and M670-000

6.8.49.2. Required license

None (Main library). (See Section 2.3, “Licensed Features”.)

6.8.49.3. Description

The pan_Spark block schedules a spark pulse for a cylinder. See Section 6.6, “Scheduling coil outputs” for an overview of driving coils. In short, the ECU monitors the angle clock and generates a spark pulse based on the schedule's on_angle and off_angle, relative to a cylinder's TDC-firing angle.

Note

The angle sense differs from most other angular blocks. A positive value denotes an angle before TDC-firing, and a negative value denotes an angle after TDC-firing. See Section 6.2.1, “Relative angles to TDC-firing” for more).

The generation of one or more spark pulses is based on the current engine synchronisation mode and the configuration applied by the application. See Section 6.1.9, “Engine synchronisation modes” for an overview of synchronisation modes.

  • In full engine synchronisation mode with the wasted spark option disabled, the ECU generates one pulse per engine cycle per spark output pin.

    Figure 6.18. Spark event relative to cylinder's TDC-firing angle

    Spark event relative to cylinder's TDC-firing angle

  • In full engine synchronisation mode with the wasted spark option enabled, the ECU generates two pulses per engine cycle per spark output pin. The wasted spark option can be used to run a four-stroke engine that have evenly spaced TDC-firing angles with half as many spark output pins.

    Figure 6.19. Spark event relative to cylinder's TDC-firing angle

    Spark event relative to cylinder's TDC-firing angle

  • In half engine synchronisation mode with the 360 degree spark option disabled, the ECU will generate no spark pulses.

  • In half engine synchronisation mode with the 360 degree spark option enabled and the wasted spark option disabled, the ECU will generate two pulses per engine cycle per spark output pin. The spark schedule is repeated every 360 degrees.

  • In half engine synchronisation mode with the 360 degree spark option enabled and the wasted spark option enabled, the ECU will generate two pulses per engine cycle per spark output pin. The spark schedule with the later angle is chosen to be repeated every 360 degrees.

    Note

    On an evenly spaced TDC-firing angle engine, there is unlikely to be much of a difference between the two cylinder spark schedule requests. But for an unevenly spaced TDC-firing angle engine, it isn't possible to know which of two cylinder schedules to use for a single spark output pin. So the ECU chooses the last of the two schedules as being too late in one cylinder will give poor-torque firing but being too early in other cylinder may result in backwards firing.

    For this reason, neither wasted spark nor 360 degree spark options are recommended for an asymmetrical engine.

In all cases, if the application requests a change to the spark schedule using the pan_Spark block, then the ECU takes one of two actions. If a spark pulse is being generated when the application makes the new schedule request, then the new request is buffered for the next cycle, but if a spark pulse is not being generated then the new request is used immediately. In the case where the new schedule is used immediately, this will result in a second spark pulse for the engine cycle if the new schedule starting angle is in the future.

If the application makes no further requests to update the spark schedule, then the ECU will repeat the schedule at most 4 times. Once the repeats are completed, the ECU clears the schedule and no further spark pulses are generated until the application requests a new spark schedule.

The spark functionality is active in half and full engine synchronisation mode only (see Section 6.1.9, “Engine synchronisation modes” for a description of modes). In any other mode, the ECU forces all spark outputs off.

Note

Unlike other angular functionality, when an application updates the spark schedule, the ECU will wait for the existing spark pulse to complete (if one is active) and then immediately schedule the update. If the update can be scheduled in the same cylinder cycle, then it will be, otherwise the update will be scheduled for the next cylinder cycle. For this reason, it may be preferable to update the spark schedule using the TDC-calculation trigger, rather than periodically.

Note

If the ECU has electrical monitoring and protection features, that can automatically turn off a spark output in the event of over-current (for example), then leaving the spark output on for too long may lead to advanced spark timing when the ECU turns the spark output off before the end angle has been reached to protect the electronics.

6.8.49.4. Inports

  • cylinder

    The cylinder on which to schedule the spark pulse.

    Range: [1, n] where n is the number of cylinders specified by the pan_EngineConfig block.

    Value type:Integer
  • on_angle

    The starting angle of the spark pulse, relative to TDC-firing (positive angle is before TDC-firing).

    Range: [-360, 360) ° crank, for a two-stroke engine Range: [-720, 720) ° crank, for a four-stroke engine

    Value type:Real
  • off_angle

    The ending angle of the spark pulse, relative to TDC-firing (positive angle is before TDC-firing).

    Range: [-360, 360] ° crank, for a two-stroke engine Range: [-720, 720] ° crank, for a four-stroke engine

    Value type:Real

6.8.49.5. Outports

None.

6.8.49.6. Mask parameters

6.8.49.7. Notes

None.