Skip to content
Markus Kovero edited this page Nov 24, 2018 · 5 revisions

7226ctrl

This document tries to describe internal design of the controller and guide in actual installation.

Design

In general design is split in several different "modules", one is responsible for user input and transmission variable input (input.cpp) which acts as trigger for core functions (core.cpp) with help of sensor data (sensors.cpp), some of end result is shown to enduser via UI (ui.cpp) while some of is actuated mechanically by transmission or by some other device.

input.cpp

Most important aspects of "input" module is to user input to figure out user requirements for determined action (pollstick, pollkeys, gearup/down, radioControl, adaptSPC) and manage general internal transmission changes regarding user input vs. sensor data aquired (polltrans, boostControl, fuelControl), also management of shift phases happen here with exception of start.

pollstick

Code is written for W202 electronic gearstick, W210 stick without tiptronic behaves in exactly similar fashion.

This is simple bit-read from digital input, usually five wires coming in PCB, four bits for stick position and one for switch position.

When stick is brought to P, gear state and shiftBlocker safeties are reset.

On every stick movement garageShift flag is updated accordingly, this only essential on PRND shifts.

There is a digital switch in gearstick unit, which can be used in simple commands like, turning stick control on/off, turning automatic shifting on/off and so.

End result of stick shuffle is updated wantedGear, which tells core functions to act accordingly.

gearUp

Simple function to up a gear with shiftBlocker safety to avoid shift during shift.

Asks core function gearchangeUp to initiate shift.

gearDown

As above, but in different direction.

pollkeys

Simple function to read manual input from microswitches used for manual shifting.

Reads input and simply asks functions above to do their job.

hornOn

Turns horn on.

hornOff

Turns horn off, reason why there are here is that in my project I have had to use original horn wiring for powering MCU, so I need to be able to trigger horn here.

boostControl

boost pressure control solenoid function, uses PID algorithm to determine proper opening of solenoid to maintain / to get into determined target, which is provided by sensors.curBoostLim, which is calculated by engine temp according to gear we are running on.

Also during the shifts this function is responsible for dropping boost target as defined in config.boostDrop.

fuelControl

this function controls fuel pumps, in this example they are turned on after determined RPM limit in config.fuelMaxRPM and also turned off when engine RPM is lower than defined limit.

polltrans

Main function of input-module, here are several fast paced responsibilities, basically taking care of switching shift phases, ending shift, garage shifts, modulating pressure during normal driving conditions, toggling TCC lock when conditions are met and setting calculated gear to logical gear if evalGear is used.

adaptSPC

is used to adaptive SPC, which is used to "teach" controller different pressure settings during the drive.

I haven't tested this for a while, but basically it should work in way that if you encouter too harsh shift, you press adaptSPC up/down and shift next gear which records the change for previous change into controllers EEPROM.

Hacky as fk, I would recommend editing maps.h for this just to be sure whats happening and where.

radioControl

function to read radio transmitted commands and triggering necessary external functions, I use this to read control from W220 steering wheel.

core.cpp

switchGearStart

Beginning of gear shift, sets environment accordingly and sets preShift-phase good to go.

doPreShift

First phase of actual shift, in here we can for example, retard ignition, or drop (and wait) boost pressure to drop to wanted target before continuing.

Flags next shift phase good to go.

doShift

Actuates solenoids based on calculated values in relation to engine load and atf oil temperature.

Flags post shift good to go.

doPostShift

Currently does not do anything but clears environment state, could be set to do anything needed after every shift.

switchGearStop

function for stopping main shift phase, resetting solenoid states.

gearchangeUp

function to handle gear number logic upwards and kicking switchGearStart to proceed with shifting.

sensor values are recorded here and set values from maps.h to actuate solenoids are passed towards.

gearchangeDown

function to handle gear number logic downwards and kicking switchGearStart to proceed with shifting.

decideGear

Automatic shifting logic, with or without evalGear

evaluateGear

Calculates actual true gear used in transmission by readin n2/n3 sensors and abs sensor to determine ratio and asking gear from gearFromRatio.

gearFromRatio

Determines gear based on given ratio

ratioFromGear

Determines ratio based on given gear

getGearSlip

Calculates max gear slippage by storing max/min ratios on each gear.

faultMon

Simple fault monitor skeleton to provide different fault scenarios.

sensors

ui

misc

Installation

Wiring

Testing

Tuning