This section outlies how the TCU interacts with physical inputs and outputs present on the PCB
The 722.6 has 2 speed sensors n2
and n3
. Both measure the rotational speed of the K1 and B1 clutches of the gearbox. Each clutch has 60 magnets on it, which means the TCU must see 60 pulses for a complete revolution of either clutch.
The software makes uses of the MCU's PCNT modules (Pulse Counter). Each speed sensor is assigned its own PCNT module. Each PCNT module is configured on TCU start up to filter any noise that might represent a pulse duration of 40µs (Or greater than 10000 pulses/sec).
When a pulse is detected by the PCNT module (Falling edge), the PCNT module fires an interrupt which logs the current timestamp (In µs) of the interrupt, and move the last interrupt time to a seperate variable. This gives 2 variables that can be used to calculate the current time period between pulses being detected by the PCNT module.
A timer interrupt is fired every 20ms is used to fetch the current interrupt time readings for both speed sensors, and update a moving average filter with the current pulse duration average. The moving average filter has a 200ms window (10 samples).
To obtain the actual input shaft speed, 2 methods of calculating the input speed are used.
When in gears 2,3 or 4, both N2 and N3 speed sensor should report the same speed. In gears 1 and 5, N3 will report 0 pulses, whilst N2 will report 64% of the real input shaft speed.
Method 1: In gears 1 or 5, or transitioning to/from 1 and 5
the
multiplier_ratio
variable is set on bootup by the Gearbox class since this number changes based on the gearbox type. Until this variable is set (0 by default), gearbox input RPM reading cannot be done.
Method 2: Running in gears 2, 3 or 4
In addition to this, there is a sanity check that is called by the RPM reading code. If in gears 2,3 and 4, both sensors readings are compared to eachother. If the speed sensors readings differ by more than 20, then the RPM reading has failed, and an error counter is increased on the TCU.
When in gears 2 3 or 4 (Or Neutral with 2nd being the starting gear), the RPM sensors are compared against eachother. If the difference between the RPM sensors is more than 100RPM, then the gearbox RPM calculation will fail.
The TCU controls 6 solenoids. 3 of which are on/off solenoids, 2 of which are constant current, and 1 of which is PWM.
Solenoid name | Type | Duty type |
TCC | PWM control | 100Hz-1000Hz variable PWM and frequency |
SPC | Constant current | 1000Hz variable PWM |
MPC | Constant current | 1000Hz variable PWM |
Y3 | On/Off | 1000Hz PWM |
Y4 | On/Off | 1000Hz PWM |
Y5 | On/Off | 1000Hz PWM |
Each solenoid in the gearbox valve-body is controlled via the following circuit:
Each solenoid has a MOSFET to control it, and a OpAmp with a shunt resistor to measure the current being drawn by the solenoid. The solenoids are all negatively switched.
The software constists of the the following main components:
The current monitoring system of all solenoids takes place using the MCU's I2S peripheral, which can capture all 6 channels of ADC1 at once in a DMA buffer, meaning all solenoids current can be monitored in parallel:
Each DMA buffer can hold 2048 bytes (~340 samples per solenoid), and the I2S peripheral is setup to read at 600KHz, So each solenoid is measured at a rate of 100Khz. This guarantees an accurate current measurement down to 1% PWM duty cycle.
Each DMA buffer is processed into a simple average for each solenoid. Note that this average only accounts for when current is detected. If the reading is 0 (No current), then the value is discarded. This is because the current measuring is only meant to account for when the solenoid is on.