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

#include <gc_auto.h>

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

Public Member Functions

 AutomaticGearController ()
 
void update ()
 
void findDesiredGear ()
 
GearControllerMode getMode () const
 
- Public Member Functions inherited from GearControllerBase
virtual gear_e getDesiredGear () const
 
virtual void init ()
 

Private Member Functions

void shift (float speed, float throttle, uint8_t(*curve)[TCU_TABLE_WIDTH], gear_e gear)
 
void shift (float speed, float throttle, uint8_t(*curve)[TCU_TABLE_WIDTH], gear_e gear, bool down)
 

Additional Inherited Members

- Data Fields inherited from GearControllerBase
TransmissionControllerBasetransmissionController
 
- Protected Member Functions inherited from GearControllerBase
virtual gear_e setDesiredGear (gear_e)
 
void initTransmissionController ()
 
floatgetRangeStateArray (int)
 

Detailed Description

Definition at line 6 of file gc_auto.h.

Constructor & Destructor Documentation

◆ AutomaticGearController()

AutomaticGearController::AutomaticGearController ( )

Definition at line 8 of file gc_auto.cpp.

8 {
9}

Member Function Documentation

◆ findDesiredGear()

void AutomaticGearController::findDesiredGear ( )

◆ getMode()

GearControllerMode AutomaticGearController::getMode ( ) const
inlinevirtual

Reimplemented from GearControllerBase.

Reimplemented in GenericGearController.

Definition at line 12 of file gc_auto.h.

◆ shift() [1/2]

void AutomaticGearController::shift ( float  speed,
float  throttle,
uint8_t(*)  curve[TCU_TABLE_WIDTH],
gear_e  gear 
)
private

Definition at line 43 of file gc_auto.cpp.

43 {
44 shift(speed, throttle, curve, gear, false);
45}
void shift(float speed, float throttle, uint8_t(*curve)[TCU_TABLE_WIDTH], gear_e gear)
Definition gc_auto.cpp:43

Referenced by shift(), and update().

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

◆ shift() [2/2]

void AutomaticGearController::shift ( float  speed,
float  throttle,
uint8_t(*)  curve[TCU_TABLE_WIDTH],
gear_e  gear,
bool  down 
)
private

Definition at line 47 of file gc_auto.cpp.

47 {
48 int curveSpeed = interpolate2d(throttle, config->tcu_shiftTpsBins, *curve);
49
50 if ((down && speed < curveSpeed) || (!down && speed > curveSpeed)) {
51 setDesiredGear(gear);
52 }
53}
virtual gear_e setDesiredGear(gear_e)
static constexpr persistent_config_s * config
scaled_channel< uint8_t, 1, 1 > tcu_shiftTpsBins[TCU_TABLE_WIDTH]
Here is the call graph for this function:

◆ update()

void AutomaticGearController::update ( )
virtual

Reimplemented from GearControllerBase.

Reimplemented in GenericGearController.

Definition at line 11 of file gc_auto.cpp.

11 {
14
15 if (getDesiredGear() == NEUTRAL) {
17 }
18
19 if (tps.Valid && vss.Valid) {
20 switch (getDesiredGear()) {
21 case GEAR_1 :
22 shift(vss.Value, tps.Value, &config->tcu_shiftSpeed12, GEAR_2);
23 break;
24 case GEAR_2 :
25 shift(vss.Value, tps.Value, &config->tcu_shiftSpeed21, GEAR_1, true);
26 shift(vss.Value, tps.Value, &config->tcu_shiftSpeed23, GEAR_3);
27 break;
28 case GEAR_3 :
29 shift(vss.Value, tps.Value, &config->tcu_shiftSpeed32, GEAR_2, true);
30 shift(vss.Value, tps.Value, &config->tcu_shiftSpeed34, GEAR_4);
31 break;
32 case GEAR_4 :
33 shift(vss.Value, tps.Value, &config->tcu_shiftSpeed43, GEAR_3, true);
34 break;
35 default :
36 break;
37 }
38 }
39
41}
virtual void update()
virtual gear_e getDesiredGear() const
virtual SensorResult get() const =0
@ GEAR_2
@ GEAR_1
@ GEAR_4
@ NEUTRAL
@ GEAR_3
@ DriverThrottleIntent

Referenced by GenericGearController::update().

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

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