The Supervisor firmware shall poll the analog inputs and perform the mathematical and logical algorithms needed to model and operate the engine. It shall directly control outputs to maintain idle speed and engine temperature, as well as perform non-standard functions defined at compile time. Characteristics of the injector and ignition outputs shall be communicated to the Coordinator for signal generation.
The Coordinator firmware shall monitor the state of the two engine position inputs and generate signals on 24 output pins to control the operation of a 12 (maximum) fuel injectors and 12 (maximum) ignition coils. It shall receive and follow instructions via data bus from the Supervisor to change the characteristics of the control signals in real time. Upon lack of instruction from the Supervisor, the Coordinator firmware shall modulate the outputs in a "limp-home" mode using defaults programmed at tuning-time.
The firmware shall include a Decoder Object that handles decoding of speed and position information from input signals.
Depending on the engine configuration, the Decoder Object shall monitor one or both inputs TRIG_0 and TRIG_1.
Depending on the engine configuration, the Decoder Object shall start a maximum of 2 Cogs to decode the pattern.
The firmware shall be designed to facilitate selection and inclusion of the correct Decoder Object at compile-time. Only one Decoder Object shall be present in the firmware image.
Multiple Decoder Objects shall be authored to support the following common setups:
The Decoder Object shall implement logic to ignore false triggers caused by interference noise.
The Decoder Object shall implement logic to determine when:
The Decoder Object shall update a Hub variable called LAST_KNOWN_POSITION. This variable shall be in the form of a 16-bit unsigned integer. Each increment shall represent 1/65536th of two revolutions of the crank shaft (720 deg). The object shall update this variable whenever a valid tooth is decoded successfully, and shall indicate the presence of a new value by setting a 1-bit flag called NEW_KNOWN_POSITION in Hub RAM.
LAST_KNOWN_POSITION has an angular resolution of approximately 0.011 deg.
LAST_KNOWN_POSITION | Engine Position |
---|---|
0 | 0.00 deg |
91 | 1.00 deg |
46784 | 513.98 deg |
65535 | 719.99 |
The Decoder Object shall update a Hub variable called LAST_TOOTH_ERROR. This variable shall be in the form of a 8-bit unsigned integer. Each discrete value shall represent 1 of 256 predefined tooth error types. The object shall update this variable whenever a tooth is invalid, and shall indicate the presence of a new value by setting a 1-bit flag called NEW_TOOTH_ERROR in Hub RAM.
The Decoder Object shall update a Hub variable called LAST_KNOWN_SPEED. This variable shall be in the form of a 8-bit unsigned integer. Each value shall represent the number of increments of 1/32768th of an engine revolution per 25us. No status flag is required for this variable.
LAST_KNOWN_SPEED has a resolution of approximately 73.24 rpm.
LAST_KNOWN_SPEED | Engine Speed |
---|---|
0 | 0.0000 rpm |
46 | 3369.1 rpm |
91 | 6665.0 rpm |
255 | 18676 rpm |
The Decoder Object shall set a 1-bit flag called WHEEL_DATA_PRESENT in Port B when it senses a tooth. The object shall clear the WHEEL_DATA_PRESENT flag when no teeth have been sensed for a defined period of time.
The Decoder Object shall set a 1-bit flag called WHEEL_DATA_GOOD in Port B when it successfully decodes a tooth. The object shall clear the WHEEL_DATA_GOOD flag when a tooth is invalid.
The firmware shall include a Simulator Object that handles simulation of the engine position.
The Simulator Object shall not monitor any input pins.
The Simulator Object shall start one Cog to update and increment the engine position.
The Simulator Object shall be universally used in all configurations of the firmware.
The Simulator Object may implement logic to prevent negative or substantial instantaneous position changes of the simulated engine position. Mathematical filtering may also be performed to better match the accelerations of the engine within one revolution.
The Simulator Object shall read and write the following flags in Hub RAM:
The Simulator Object shall read the following values from Hub RAM:
The Simulator Object shall read the following values from Port B:
The Simulator Object shall write the following value to Port B:
Register | Bit | Variable/Flag |
---|---|---|
Port B | 31 | (reserved) |
30 | (reserved) | |
29 | ENGINE_PHASE_B | |
28 | ENGINE_PHASE_A | |
27 | CURRENT_POSITION | |
26 | ||
25 | ||
24 | ||
23 | ||
22 | ||
21 | ||
20 | ||
19 | ||
18 | ||
17 | ||
16 | ||
15 | CURRENT_SPEED | |
14 | ||
13 | ||
12 | ||
11 | ||
10 | ||
9 | ||
8 | ||
7 | ||
6 | ||
5 | ||
4 | ||
3 | ||
2 | ||
1 | ||
0 |
Description: Crankshaft position at last successful tooth decode.
Allocated by: Coordinator firmware
Location: Hub
Size: 12 bits
Type: Unsigned Integer
Range: 0 to 4095
Represents: 0 to 359.91 deg crank rotation after top dead center cylinder #1
Resolution: 0.09 deg
Written by: Decoder Object
Read by: Simulator Object when NEW_KNOWN_POSITION flag SET
Pattern: positive or negative change at every successful tooth decode
Nature: usually positive jump at every write, unpredictable upon resync
Description: Crankshaft speed at last successful tooth decode.
Allocated by: Coordinator firmware
Location: Port B
Size: 16 bits
Type: Unsigned Integer
Range: 1 to 65535
Represents: 1 to 65535 clock cycles delay between +1 increments of CURRENT_POSITION
Resolution: 17.9 rpm
Written by: Decoder Object
Read by: Main Object, Simulator Object
Pattern: positive or negative change at every successful tooth decode
Nature: see above
Description: An accurate prediction of crankshaft position.
Allocated by: Coordinator firmware
Location: Port B
Size: 12 bits
Type: Unsigned Integer
Range: 0 to 4095
Represents: 0 to 359.91 deg crank rotation after top dead center cylinder #1
Resolution: 0.09 deg
Written by: Simulator Object every x clock cycles
Read by: All
Pattern: increment by 1 every x clock cycles; increment by x once
Nature: increments regularly, occasional positive jumps due to error correction
Description:
Allocated by:
Location:
Size: x bits
Type:
Range:
Represents:
Resolution:
Written by:
Read by:
Pattern:
Nature: