rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes
Generic4TransmissionController Class Reference

#include <tc_4.h>

Inheritance diagram for Generic4TransmissionController:
Inheritance graph
[legend]
Collaboration diagram for Generic4TransmissionController:
Collaboration graph
[legend]

Public Member Functions

void update (gear_e)
 
void init ()
 
TransmissionControllerMode getMode () const
 
- Public Member Functions inherited from SimpleTransmissionController
void update (gear_e)
 
void init ()
 
TransmissionControllerMode getMode () const
 
- Public Member Functions inherited from TransmissionControllerBase
virtual gear_e getCurrentGear () const
 

Private Member Functions

void setTccState (gear_e gear)
 
void setPcState (gear_e gear)
 

Private Attributes

gear_e shiftingFrom
 

Additional Inherited Members

- Data Fields inherited from tcu_controller_s
int8_t tcuCurrentGear = (int8_t)0
 
uint8_t alignmentFill_at_1 [1] = {}
 
scaled_channel< uint16_t, 100, 1 > tcRatio = (uint16_t)0
 
float lastShiftTime = (float)0
 
uint8_t tcu_currentRange = (uint8_t)0
 
int8_t pressureControlDuty = (int8_t)0
 
int8_t torqueConverterDuty = (int8_t)0
 
uint8_t alignmentFill_at_11 [1] = {}
 
bool isShifting: 1 {}
 
bool unusedBit_9_1: 1 {}
 
bool unusedBit_9_2: 1 {}
 
bool unusedBit_9_3: 1 {}
 
bool unusedBit_9_4: 1 {}
 
bool unusedBit_9_5: 1 {}
 
bool unusedBit_9_6: 1 {}
 
bool unusedBit_9_7: 1 {}
 
bool unusedBit_9_8: 1 {}
 
bool unusedBit_9_9: 1 {}
 
bool unusedBit_9_10: 1 {}
 
bool unusedBit_9_11: 1 {}
 
bool unusedBit_9_12: 1 {}
 
bool unusedBit_9_13: 1 {}
 
bool unusedBit_9_14: 1 {}
 
bool unusedBit_9_15: 1 {}
 
bool unusedBit_9_16: 1 {}
 
bool unusedBit_9_17: 1 {}
 
bool unusedBit_9_18: 1 {}
 
bool unusedBit_9_19: 1 {}
 
bool unusedBit_9_20: 1 {}
 
bool unusedBit_9_21: 1 {}
 
bool unusedBit_9_22: 1 {}
 
bool unusedBit_9_23: 1 {}
 
bool unusedBit_9_24: 1 {}
 
bool unusedBit_9_25: 1 {}
 
bool unusedBit_9_26: 1 {}
 
bool unusedBit_9_27: 1 {}
 
bool unusedBit_9_28: 1 {}
 
bool unusedBit_9_29: 1 {}
 
bool unusedBit_9_30: 1 {}
 
bool unusedBit_9_31: 1 {}
 
- Protected Member Functions inherited from TransmissionControllerBase
virtual gear_e setCurrentGear (gear_e)
 
void postState ()
 
void measureShiftTime (gear_e)
 
float isShiftCompleted ()
 
- Protected Attributes inherited from TransmissionControllerBase
gear_e currentGear = NEUTRAL
 

Detailed Description

Definition at line 6 of file tc_4.h.

Member Function Documentation

◆ getMode()

TransmissionControllerMode Generic4TransmissionController::getMode ( ) const
inlinevirtual

Reimplemented from TransmissionControllerBase.

Reimplemented in Gm4l6xTransmissionController.

Definition at line 10 of file tc_4.h.

◆ init()

void Generic4TransmissionController::init ( )
virtual

Reimplemented from TransmissionControllerBase.

Reimplemented in Gm4l6xTransmissionController.

Definition at line 9 of file tc_4.cpp.

9 {
11
13
16 "Line Pressure",
20 0);
21}
SingleTimerExecutor scheduler
Definition engine.h:271
OutputPin tcuPcSolenoid
Definition efi_gpio.h:135
OutputPin tcuTccOnoffSolenoid
Definition efi_gpio.h:133
void initPin(const char *msg, brain_pin_e brainPin, pin_output_mode_e outputMode, bool forceInitWithFatalError=false)
Definition efi_gpio.cpp:711
EnginePins enginePins
Definition efi_gpio.cpp:24
static EngineAccessor engine
Definition engine.h:413
static constexpr engine_configuration_s * engineConfiguration
void startSimplePwm(SimplePwm *state, const char *msg, Scheduler *executor, OutputPin *output, float frequency, float dutyCycle, pwm_gen_callback *callback)
static SimplePwm pcPwm("Pressure Control")

Referenced by Gm4l6xTransmissionController::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPcState()

void Generic4TransmissionController::setPcState ( gear_e  gear)
private

Definition at line 76 of file tc_4.cpp.

76 {
77 uint8_t (*pcts)[efi::size(config->tcu_pcAirmassBins)];
78
79 switch (gear) {
80 case REVERSE:
81 pcts = &config->tcu_pcValsR;
82 break;
83 case NEUTRAL:
84 pcts = &config->tcu_pcValsN;
85 break;
86 case GEAR_1:
87 if (isShifting && shiftingFrom == GEAR_2) {
88 pcts = &config->tcu_pcVals21;
89 } else {
90 pcts = &config->tcu_pcVals1;
91 }
92 break;
93 case GEAR_2:
94 if (isShifting && shiftingFrom == GEAR_1) {
95 pcts = &config->tcu_pcVals12;
96 } else if (isShifting && shiftingFrom == GEAR_3) {
97 pcts = &config->tcu_pcVals32;
98 } else {
99 pcts = &config->tcu_pcVals2;
100 }
101 break;
102 case GEAR_3:
103 if (isShifting && shiftingFrom == GEAR_2) {
104 pcts = &config->tcu_pcVals23;
105 } else if (isShifting && shiftingFrom == GEAR_4) {
106 pcts = &config->tcu_pcVals43;
107 } else {
108 pcts = &config->tcu_pcVals3;
109 }
110 break;
111 case GEAR_4:
112 if (isShifting && shiftingFrom == GEAR_3) {
113 pcts = &config->tcu_pcVals34;
114 } else {
115 pcts = &config->tcu_pcVals4;
116 }
117 break;
118 default:
119 break;
120 }
121
122 if (pcts) {
125 }
126}
EngineState engineState
Definition engine.h:344
float airflowEstimate
void setSimplePwmDutyCycle(float dutyCycle) override
static constexpr persistent_config_s * config
@ GEAR_2
@ REVERSE
@ GEAR_1
@ GEAR_4
@ NEUTRAL
@ GEAR_3
scaled_channel< uint8_t, 1, 5 > tcu_pcAirmassBins[TCU_TABLE_WIDTH]

Referenced by update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTccState()

void Generic4TransmissionController::setTccState ( gear_e  gear)
private

Definition at line 46 of file tc_4.cpp.

46 {
47 // disable if shifting
48 if (isShifting) {
50 return;
51 }
52
55 if (!tps.Valid || !vss.Valid) {
56 return;
57 }
58 // only enable TC in gear 4
59 if (gear == GEAR_4) {
60 int lockSpeed = interpolate2d(tps.Value, config->tcu_tccTpsBins, config->tcu_tccLockSpeed);
61 int unlockSpeed = interpolate2d(tps.Value, config->tcu_tccTpsBins, config->tcu_tccUnlockSpeed);
62 if (vss.Value > lockSpeed) {
63 // torqueConverterDuty is only used for a gauge
66 } else if (vss.Value < unlockSpeed) {
69 }
70 } else {
73 }
74}
void setValue(const char *msg, int logicValue, bool isForce=false)
Definition efi_gpio.cpp:604
virtual SensorResult get() const =0
@ DriverThrottleIntent

Referenced by update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

void Generic4TransmissionController::update ( gear_e  gear)
virtual

Reimplemented from TransmissionControllerBase.

Reimplemented in Gm4l6xTransmissionController.

Definition at line 23 of file tc_4.cpp.

23 {
24 if (gear != getCurrentGear()) {
26 isShifting = true;
27 measureShiftTime(gear);
28 }
29
30 // set torque converter and pressure control state
31 setTccState(gear);
32 setPcState(gear);
33
34 setCurrentGear(gear);
35
37
38 float time = isShiftCompleted();
39 // 0 means shift is not completed
40 if (time != 0) {
41 lastShiftTime = time;
42 isShifting = false;
43 }
44}
void setTccState(gear_e gear)
Definition tc_4.cpp:46
void setPcState(gear_e gear)
Definition tc_4.cpp:76
virtual gear_e getCurrentGear() const
Definition tcu.cpp:26
void measureShiftTime(gear_e)
Definition tcu.cpp:42
virtual gear_e setCurrentGear(gear_e)
Definition tcu.cpp:21

Referenced by Gm4l6xTransmissionController::update().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ shiftingFrom

gear_e Generic4TransmissionController::shiftingFrom
private

Definition at line 16 of file tc_4.h.

Referenced by setPcState(), and update().


The documentation for this class was generated from the following files: