Peak/Hold Controller

This MotoHawk™ block defines a Peak/Hold Reaction Channel controller. Reaction Channel controllers are used to control circuits that utilize the microcontroller's Reaction Module so that they can perform load current modulation. When the modulation should occur is controlled by an independent block like a PWM. A single Reaction Module block will also need to exist in the model to use the controller. If a Peak/Hold With Off Time (PHWOT) style of control is to be used then a Reaction Module Off Time block will also need to exist in the model in order to fully define the controller. A Reaction PH Channel definition block for each output that will use this controller will also need to exist. This controller can also be used to drive loads that don't require load current modulation (a high impedance load for example).

Block ID

React PH Controller

Library

MotoHawk_lib/ModuleConfiguration

Description

Peak/Hold With Off Time (PHWOT) Circuit Principles

The Peak/Hold reaction channel controller that is using the Off Time style of control is intended for use with a circuit topology like the ones illustrated below.

This switched mode driver has a high side switch that is turned ON whilst the actuator is ON and the low side switch runs a high frequency PWM that will modulate the load current. The circuit is only able to sample load current while the low side switch is ON. Thus the OFF time needs to be an open loop parameter that switches the low side switch OFF for a set amount of time each time the low side current attains the specified current threshold. The PHWOT behavior supports a peak and a hold phase. Nominally the current threshold during peak is higher than what is used during the hold phase.

A high impedance load could be driven with either circuit. Typically the peak current and the hold current thresholds are set to values that won't be attained by the load and as such no modulation will occur.

Peak/Hold With Dual Threshold (PHWDT) Circuit Principles

The Peak/Hold reaction channel controller that is using the Dual Threshold style of control is intended for use with a circuit topology like the ones illustrated below.

The switched mode driver has a high side switch that is turned ON whilst the actuator is ON and the low side switch runs a high frequency PWM that will modulate the load current. Dual Threshold refers to the dual current thresholds that are used to specify the band that the load current will be controlled between. To support Dual Threshold control the circuit must support current sampling that is able to monitor the load current irrspective of whether the low side modulating switch is ON or OFF. Thus the load current sample circuit is located between the low side switch and the high side switch. The low side switch will turn OFF while the load current is above the upper threshold and will turn ON when the load current falls below the lower threshold. The low side switch will retain its current state when the current falls between the two thresholds.

An output with a circuit that can support Dual Threshold control can be used to implement an Off Time style of controller, but the converse is not true.

Peak/Hold Operation

Standard Peak/Hold Operation (single peak then hold)

Both the PHWOT and PHWDT circuits can be used with a behavior that implements a peak phase and a hold phase. When timed peak/hold is in use the time spent in peak is controlled by the referenced Timed Peak/Hold block. Note that the time spent in peak refers to the time spent controlling to the peak threshold once the detect threshold has been attained. If discrete peak/hold is in use then the appropriate mode is defined by the state currently specified by the Discrete Peak/Hold block.

The figure below illustrates an example load current profile that could be achieved with Standard Peak/Hold control when used with a low impedance load.

Looped Peak/Hold Operation

The controller also supports a looped mode of operation where the controller will periodically alternate between the peak and hold current thresholds. This style of control is only available when timed peak/hold is in use and is selected via the Loop Peak/Hold checkbox. The alternating period is controlled by the referenced Timed Peak/Hold block. This style of control would not be used when controlling an injector, but might be appropriate for controlling a valve.

The figure below illustrates an example load current profile that could be achieved with Looped Peak/Hold control.

Preventing Timer Allocation Errors

Timer Allocation Errors can result when using the Reaction Channel controller with timed peak/hold. These errors are not driver faults, but setup errors that are reported via the Reaction Channel Status block.

The reaction module supports a pool of internal timers that are shared by all of the reaction channels and is of a finite size. For example MPC564x cores support only 3 timers in this pool, where as the MPC5777C supports 5 timers. A Reaction Channel that is implementing Timed Peak needs to be able to acquire one of these timers. A Timer Allocation Error will result if too many Reaction Channels implementing Timed Peak assert at the same time since they each will require their own timer, which the underlying silicon can't provide. Other Reaction Channel behaviors may also draw upon these timers and would need to be considered too.

The Reaction Channel allows Timed Peak blocks to be shared by referencing the same block with the Timed Peak Name attribute of the mask. This is possible provided not too many of the channels have their peak phase overlap or the pool of timers is large enough to support each channel in use. Thus something like an injection behavior, which distributes when the various injectors assert, can successfully operate using a shared peak time because peak is only active on some of the channels at any instant in time.

Where overlap is difficult to prevent, such as where many PWMs are in use, the use of the Discrete Peak/Hold block should be considered as an alternative to Timed Peak.

Note that a channel using a controller that is configured for looped Peak/Hold operation will indefinetely consume a timer from the pool while modulation is enabled.

Fault Behavior

Diagnosis Principles

The reaction channel analyzes the duration of the switching events to detect whether the channel has experienced a fault condition. Specifically the reaction silicon observes whether switching events occur within the window defined by Min Switch Time and Max Switch Time.

An open circuit condition can be detected if the driver remains ON for longer than Max Switch Time without switching and a short circuit condition could be detected if the driver ever switched OFF before Min Switching Time had been observed with the drive being commanded to be ON. A short circuit condition can also be observed if the load current is detected exceeding the Max Current setting.

Short and Open circuit faults are combined into a fault status that can be recovered using the IO Fault Status block.

Sometimes the hardware supports other silicon to provide diagnosis. In such situations this circuitry will be used for fault diagnosis instead of using the reaction module.

The type of load (low impedance or high impedance) also impacts diagnosis. These impacts are detailed in the following sections.

Low Impedance Diagnosis Considerations

A load is considered to be low impedance if the load current will attain the hold current threshold during normal operation and will thus invoke switched mode control.

An open circuit condition can be detected for a low impedance load if the driver remains ON for longer than Max Switch Time without switching. Therefore, for a low impedance load, the Max Switch Time needs to be set to a value that is always going to be larger than the Time to first switch that is illustrated in the waveform figure above.

The time to reach a current threshold is driven by the load inductance and the battery voltage. Thus this value may need to be altered based upon runtime conditions and will need to be tuned based upon the connected load. Also note that Max Switch Time is global. All channels use the same setting.

A controller using the Off Time style of control with a low impedance load will naturally experience Min Switching Time events as the controller transitions from the peak current threshold to the hold current threshold. During this transition the driver will be turned ON after off time expiry, but then quickly turns OFF again since the load current is still decaying from the peak threshold (and is thus still above the hold threshold).

Therefore a channel configured to use a Low Impedance Load Type will ignore this style of short circuit condition because it will lead to false fault reporting. Instead the system is reliant upon Max Current event detection in combination with the hardware circuit implementing a driver shutdown when an overcurrent is experienced to detect short circuit faults. A driver shutdown eliminates switching, which presents like an open circuit because the drive is being commanded, yet is not switching. Open and short circuit faults are combined so the driver is still considered to be in fault.

It is still important that a non-zero value is assigned to Min Switching Time, even though the short circuit is masked. Setting the value to zero will disable the window detection, which then prevents the open circuit detection from occurring.

High Impedance Diagnosis Considerations

A load is considered to be high impedance if the load current will not attain the hold current threshold during normal operation. Thus it will never invoke switched mode control when operating normally.

A channel configured to use a High Impedance Load Type is able to detect a short circuit condition, unlike a low impedance load. Therefore the Min Switching Time must be appropriately configured. The time should be shorter than the time it takes to reach the detection threshold.

A high impedance load doesn't switch and so would always fail to switch before Max Switch Time had expired. Therefore a channel configured to use a high impedance load will ignore diagnosis based upon the Max Switch Time and instead flag a fault if the detection threshold is not attained. Such a condition implies that an open circuit condition has been observed.

Since a high impedance load shouldn't experience switching under normal conditions, a channel configured as having a high impedance load needs to have a hold current threshold that won't be attained during normal operation. False diagnosis may result if the hold current threshold is ever reached.

Other Detection Considerations

As has been discussed above, fault diagnosis is based upon observing the behavior of the drive when it is on. An observed condition is latched for subsequent recovery by an IO Fault Status block query. The latched condition is cleared once queried so that the circuit can detect a subsequent fault event. However, because the status is cleared, querying the fault status again before the circuit has had a chance to observe another event will result in a fault status of indeterminate being reported, even if the load was still in fault. Thus the rate of the fault query in combination with how the drive is being controlled will influence what is reported.

Consider an open load condition on a PH channel that was being driven by a 100Hz PWM at a 40% dutycycle. An IO Fault Status block query that occurred every 5ms would report indeterminate on every second query because the load is only turned on every 10ms and a fault event can only be observed and updated once the drive has been ON. The query could be slowed to every 10ms or even every 100ms and would then be reliable.

Thus the selected control behavior will influence what the IO Fault Status block will report, as will the rate of query. These should be considered when defining the diagnostic strategy of a PH reaction channel behavior.

A Fault Status of OK won't be reported

Reaction diagnostics are autonomous and independent of the CPU commands which leads to the following behavior.

Timed Detection Strategy

Often a slow rate of IO Fault Status block query is sufficient to allow for reliable fault detection. However, if quicker fault notification is required, then the use of a timed latching mechanism is recommended. Here observing a fault is recognized quickly, but the return to an OK status is slowed by requiring the absence of a fault condition to exist for some amount of time before it is recognized.

Peak/Hold With Off Time Signals

Peak Threshold (mA)

Defines the current threshold to use during the peak phase of operation. The peak phase timer does not start until the Detect Threshold is reached when the Timed Peak mode is in use. This is a little different to some other styles of peak/hold drivers supported by MotoHawk™, which are more open loop and start the timer when the driver is initially asserted.

Failure to attain the peak current may result in an open circuit condition being latched by the driver.

Hold Threshold (mA)

Defines the current threshold to use during the hold phase of operation.

Detect Threshold (mA)

Defines the current threshold that the load current must achieve when actuated for the load to be considered present. An open circuit condition is detected if this current threshold is not achieved. It is also used for short circuit detection per the diagnosis principles discussion earlier and to signal the peak timer to start in Timed Peak.

Peak/Hold With Dual Threshold Signals

Peak Threshold (mA)

Defines the lower bound load current threshold to use during the peak phase of operation. The low side switch will switch ON if the load current is less than this value.

Peak Ripple (mA)

Defines the amount of ripple current to allow in the load during the peak phase of operation. Must be non zero. The low side switch will switch OFF when the load current is above the sum of this value and the Peak Threshold.

Hold Threshold (mA)

Defines the current threshold to use during the hold phase of operation.

Hold Ripple (mA)

Defines the amount of ripple current to allow in the load during the hold phase of operation. Must be non zero. The low side switch will switch OFF when the load current is above the sum of this value and the Hold Threshold.

Detect Threshold (mA)

Defines the current threshold that the load current must achieve when actuated for the load to be considered present. An open circuit condition is detected if this current threshold is not achieved. It is also used for short circuit detection per the diagnosis principles discussion earlier.

Block Parameters

Parameter Field Values Comments/Description
Name Alpha-numeric text, single-quote enclosed This name will be used by associated blocks like the Reaction Channel Status block to reference this channel definition. No special characters, such as spaces, dashes and commas (underscore allowed)
Resource Drop-down list Module resource for this block (target module dependent).
Control Style Drop-down list Defines whether an "Off Time" or a "Dual Threshold" style of control is to be defined by this controller.
Reference Peak Phase Off Timer Name Alpha-numeric text, single-quote enclosed The name of the Reaction Module Off Timer that supplies the off time attribute to utilize during peak phase operation. This timer can be shared with others and can even be the same as the Hold Phase Timer. Only visible when Off Time control is in use.
Reference Hold Phase Off Timer Name Alpha-numeric text, single-quote enclosed The name of the Reaction Module Off Timer that supplies the off time attribute to utilize during hold phase operation. This timer can be shared with others and can even be the same as the Peak Phase Timer. Only visible when Off Time control is in use.
Peak/Hold Mode Drop Down Control is simplified to exclude a peak region when this option is not checked. Only available (and visible) when the Control Style is Dual Threshold. Peak control is assumed when Off Time control is in use.
Use Timed Peak/Hold Check Box Select if a Timed Peak/Hold block shall be used to specify how long the driver should remain in the peak phase before switching to the hold phase. A high impedance load that does not require load current modulation should not check this box.
Reference Timed Peak Hold Name Alpha-numeric text, single-quote enclosed The name of the Timed Peak/Hold block that will define the peak time. This timer can be (and often needs to be) shared by multiple reaction channel behaviors.
Loop Peak/Hold Checkbox The controller will use Looped Peak/Hold control when this option is checked. Only visible when the Use Timed Peak/Hold checkbox has been checked with a Supported Load Types of Low Impedance Only.
Supported Load Types Drop Down
Low Impedance Only
Low and High Impedance
Defines the type(s) of load that the controller will support. The load type can influence how the controller is configured and will influence diagnosios

Low Impedance Only: The controller only supports Low Impedance control and diagnosis

High and Low Impedance: The controller supports both Low Impedance and High Impedance control and diagnosis
Show Input Ports Checkbox If the accessor block is to be used then the definition block can hide the ports by checking this option.