Files
NeoECU-Hardware/Architecture/IO_MODULES/ENGINE_POSITION_INPUTS.md
T

156 lines
8.0 KiB
Markdown

# Engine-Position Inputs
## Purpose
This module defines the dedicated crank and cam position-input class for
NeoECU V1. It is separate from the generic digital-input module because engine
timing needs bounded edge delay, jitter, and false-trigger behaviour.
This is an architecture and schematic-design basis, not a released schematic.
Final component values and qualified fault ratings require the selected sensor,
harness, connector, and test results.
## V1 timing and signal assumptions
| Signal | V1 arrangement | Function |
| --- | --- | --- |
| Crank | Two events per crank revolution | 180-degree position events and speed estimation |
| Cam | One event per 720-degree cycle | Four-stroke phase identification |
The V1 speed limiter is 5,000 RPM. At that speed the interval between selected
crank events is 6 ms; a four-event-per-revolution trigger would instead have a
3 ms interval. V1 retains the two-event pattern. Moving to four events is a
future trigger-wheel and firmware change, not a reason to alter this input
class.
The intended interface is a three-wire, active-low Hall sensor: the output is
normally high and sinks current while active. Capture one defined edge per
event, normally the falling edge, in an STM32H747 timer channel. Do not use
both edges as independent position events unless firmware explicitly models
the Hall-window geometry.
`FEBI BILSTEIN 44421` is the selected cam sensor. It cross-references to EFI
Automotive 144321 and OE references 1920.6T and 9629684380. It is a three-wire
12 V Hall sensor with an open-drain output: supply it from `+12V_SENS`, connect
its return to `SENSOR_GND`, and pull its signal high at the ECU. Confirm the
physical connector pinout and output sink-current limit from the delivered part
or its manufacturer documentation before assigning the connector pins and
freezing `R_PULLUP`. The crank-sensor part number remains to be selected.
## Electrical interface
```text
ECU
+12V_SENS ------------------------+--------------------------> sensor supply
SENSOR_GND ---------------------------------------------------> sensor return
|
+12V_SENS -- R_PULLUP -- TRIG_x ---+-- connector -- sensor output
|
+-- connector-side transient protection
+-- R_DIV_TOP --+-- Schmitt buffer --> 3.3 V timer input
+-- R_DIV_BOTTOM -- SENSOR_GND
+-- C_FILTER ------ SENSOR_GND
```
- Supply the sensor from `+12V_SENS`; its rail generation, protection, current
limit, and diagnostics belong to `POWER_ARCHITECTURE.md`.
- Place the signal pull-up at the ECU, to `+12V_SENS`, rather than at the
sensor or 3.3 V domain. A 4.7 kOhm footprint is a starting provision only.
Select its value from the confirmed sensor sink-current rating, high/low
thresholds, cable capacitance, and required edge time.
- Protect the connector-side signal against the assigned positive and negative
harness transients. The completed clamp, series impedance, divider, and
Schmitt buffer must keep all intermediate nodes within their validated limits
without back-powering the 3.3 V rail while the ECU is off.
- Scale the high-level signal before the 3.3 V Schmitt buffer. The buffer
provides defined logic thresholds and hysteresis; the STM32 pin is never
exposed to the sensor-domain voltage.
- The divider also supplies the resistance for the RC filter. Connect the
configurable `C_FILTER` footprint from the divided signal to `SENSOR_GND`,
in parallel with `R_DIV_BOTTOM`. Its effective series resistance is
`R_DIV_TOP || R_DIV_BOTTOM`, so `tau = (R_DIV_TOP || R_DIV_BOTTOM) *
C_FILTER`. Do not add a separate RC series resistor by default. Add one only
if it has a separately demonstrated purpose, such as limiting residual-clamp
current.
- Populate 1 nF initially, with 470 pF and 2.2 nF alternatives available.
Validate the selected value with the final harness and ignition operating; it
must reject short interference without eroding legitimate-edge timing margin.
- Use the automotive-qualified `SN74LVC2G17QDCKRQ1`, powered from
`+3V3_MAIN`, as the two-channel non-inverting Schmitt buffer for crank and
cam. Its inputs must only receive the protected, divided signal, never the
raw 12 V harness node.
## Connector, harness, shield, and layout
Crank and cam use the dedicated **engine-sensors connector**, not the
power/actuator connector. This preserves physical separation from coil,
injector, starter, and other high-current wiring. The V1 connector plan is:
| Connector group | Carries |
| --- | --- |
| Power/actuators | Battery and power returns, ignition, injector, and high-current outputs |
| Engine sensors | Crank/cam supply, signals, sensor returns, thermistors, and analogue sensors |
| Vehicle I/O/CAN | CAN, deadman, generic digital inputs, and generic 5 V logic outputs |
Use a screened harness for each trigger sensor. Route the trigger signal as a
twisted pair with `SENSOR_GND`; route its `+12V_SENS` supply in the same
screened cable. The screen is an EMC structure, not a sensor return or circuit
ground conductor.
Terminate each screen at the ECU end only, at a dedicated `SHIELD_GND` bond
with a short, broad connection to the enclosure/chassis structure near the
power-entry region. Do not connect the screen to `SENSOR_GND`, `DGND`, or
`+3V3_ANA`, and do not connect it at the sensor end. Final backshell and case
bonding details depend on the selected connector and enclosure.
Place transient protection at the connector. Keep the divider, filter, Schmitt
buffer, and timer route on the quiet MCU side. Keep these paths away from the
ignition high-voltage node, injector switching loop, and regulator hot loops.
## False-trigger handling and validation
Hardware filtering is the first defence. Firmware provides a second,
independent plausibility check; it does not replace the hardware network.
For every selected crank edge, firmware shall:
1. timestamp the edge with the timer;
2. reject an edge whose interval since the previous accepted edge is below a
calibrated physical minimum; and
3. reject an interval that implies an implausible acceleration from the recent
accepted speed estimate.
The threshold shall be derived from the maximum measured engine acceleration,
the 5,000 RPM speed limit, timer resolution, and a conservative margin. It
shall not be a fixed arbitrary debounce time. A rejected edge shall not update
speed, position, dwell, injection scheduling, or the reference interval, so a
spark-induced pulse cannot displace the next accepted timing event.
Cam edges shall be checked against the expected crank phase. A missing or
inconsistent cam event removes phase synchronisation and must lead firmware to
the explicitly defined no-sync behaviour; it must never invent a phase from a
single unexpected edge.
Validate with the installed engine and final harness:
- no false accepted crank/cam events during worst-case dwell and spark;
- no missed genuine events at 5,000 RPM and during the maximum measured
acceleration;
- measured conditioning delay and jitter within the firmware timing budget;
- correct rejection of injected short glitches without corrupting the following
genuine event; and
- sensor unplug, signal open/short, and sensor-supply fault behaviour as
defined by the final selected parts.
## Remaining inputs before schematic freeze
1. Confirm the FEBI 44421 physical connector pinout and output sink-current
limit from the delivered part or manufacturer documentation.
2. Select and obtain the equivalent data for the crank sensor.
3. Confirm connector family, pin assignment, cable length/construction, and
enclosure/backshell method for the engine-sensors connector.
4. Select protection components and final pull-up, divider, and filter values
against the confirmed sensor and harness limits.
5. Measure maximum real engine acceleration and establish the timer-based
interval-plausibility limits in firmware.