rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions
test_engine.h File Reference

Detailed Description

Date
Nov 14, 2014
Author
Andrey Belomutskiy, (c) 2012-2020

Definition in file test_engine.h.

Functions

void setTestCamEngineConfiguration ()
 
void setTestCrankEngineConfiguration ()
 
void setTestVVTEngineConfiguration ()
 
void setTestDcWastegateConfiguration ()
 
void setTestEngineWithBoschQuickStartCam ()
 
void setTestEngineIssue366both ()
 
void setTestEngineIssue366rise ()
 
void setTestEngineBoschQuickStart ()
 
void setProteusAnalogPwmTest ()
 

Function Documentation

◆ setProteusAnalogPwmTest()

void setProteusAnalogPwmTest ( )

Definition at line 116 of file test_engine.cpp.

116 {
117 engineConfiguration->camInputs[0] = Gpio::E0; // a random unused pin needed for happy HW CI. Huh, why do we have cam stimulation?!
118
119 // lowest cpu trigger possible
121
122 // Disable trigger stim
123 engineConfiguration->triggerSimulatorPins[0] = Gpio::Unassigned;
124 engineConfiguration->triggerSimulatorPins[1] = Gpio::Unassigned;
125
126 // The idle control pin is connected to the default TPS input, analog volt 2
127 engineConfiguration->idle.solenoidPin = Gpio::PROTEUS_IGN_10;
128
129 // 5893hz is coprime with the analog sample rate, 500hz, so hopefully we get less aliasing
130 engineConfiguration->idle.solenoidFrequency = 5893;
131
132 // Test range is 20% to 80%
133 engineConfiguration->tpsMin = 200;
134 engineConfiguration->tpsMax = 800;
135}
@ Unassigned
static constexpr engine_configuration_s * engineConfiguration

Referenced by applyEngineType().

Here is the caller graph for this function:

◆ setTestCamEngineConfiguration()

void setTestCamEngineConfiguration ( )

Definition at line 28 of file test_engine.cpp.

28 {
31
32 engineConfiguration->mafAdcChannel = EFI_ADC_1;
33 engineConfiguration->tps1_1AdcChannel = EFI_ADC_2;
34 engineConfiguration->vbattAdcChannel = EFI_ADC_NONE;
35
37
38 // Many tests were written when the default target AFR was 14.0, so use that for tests by default.
39 engineConfiguration->stoichRatioPrimary = 14.0f;
40
41 engineConfiguration->ignitionMode = IM_ONE_COIL;
42 setConstantDwell(3); // 50% duty cycle @ 5000 rpm
43
44 engineConfiguration->malfunctionIndicatorPin = Gpio::Unassigned;
45
46 engineConfiguration->ignitionPins[0] = Gpio::C7; // #1
47 engineConfiguration->ignitionPins[1] = Gpio::Unassigned; // #2
48 engineConfiguration->ignitionPins[2] = Gpio::Unassigned; // #3
49 engineConfiguration->ignitionPins[3] = Gpio::Unassigned; // #4
50 engineConfiguration->ignitionPins[4] = Gpio::Unassigned; // #5
51 engineConfiguration->ignitionPins[5] = Gpio::Unassigned; // #6
52}
void setConstantDwell(floatms_t dwellMs)
Sets the same dwell time across the whole getRpm() range set dwell X.
void setCamOperationMode()
void setWholeIatCorrTimingTable(float value)

Referenced by applyEngineType(), setTestCrankEngineConfiguration(), and setTestEngineIssue366both().

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

◆ setTestCrankEngineConfiguration()

void setTestCrankEngineConfiguration ( )

Definition at line 54 of file test_engine.cpp.

54 {
56
58
60 // this is related to 'setDefaultBaseEngine' having 'skippedWheelOnCam = true' which is a weird fact by itself
61 engineConfiguration->skippedWheelOnCam = false;
62}
void setCrankOperationMode()
void setTestCamEngineConfiguration()

Referenced by applyEngineType().

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

◆ setTestDcWastegateConfiguration()

void setTestDcWastegateConfiguration ( )

Definition at line 64 of file test_engine.cpp.

64 {
65 engineConfiguration->isBoostControlEnabled = 1;
66 engineConfiguration->etbFunctions[0] = DC_Wastegate;
67 setTable(config->boostTableOpenLoop, 50);
68 engineConfiguration->tps1_1AdcChannel = EFI_ADC_1; // PA1
69
70 // PWM pin
71 engineConfiguration->etbIo[0].controlPin = Gpio::C0;
72 // DIR pin
73 engineConfiguration->etbIo[0].directionPin1 = Gpio::C1;
74 // Disable pin
75 engineConfiguration->etbIo[0].disablePin = Gpio::C2;
76 // we only have pwm/dir, no dira/dirb
77 engineConfiguration->etb_use_two_wires = false;
78}
static constexpr persistent_config_s * config
constexpr void setTable(TElement(&dest)[N][M], const VElement value)

Referenced by applyEngineType().

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

◆ setTestEngineBoschQuickStart()

void setTestEngineBoschQuickStart ( )

Definition at line 18 of file test_engine.cpp.

Referenced by applyEngineType().

Here is the caller graph for this function:

◆ setTestEngineIssue366both()

void setTestEngineIssue366both ( )

Definition at line 100 of file test_engine.cpp.

100 {
102
103 engineConfiguration->trigger.customTotalToothCount = 2;
104 engineConfiguration->trigger.customSkippedToothCount = 1;
105
107}

Referenced by applyEngineType(), and setTestEngineIssue366rise().

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

◆ setTestEngineIssue366rise()

void setTestEngineIssue366rise ( )

Definition at line 109 of file test_engine.cpp.

109 {
111}
void setTestEngineIssue366both()

Referenced by applyEngineType().

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

◆ setTestEngineWithBoschQuickStartCam()

void setTestEngineWithBoschQuickStartCam ( )

Definition at line 22 of file test_engine.cpp.

22 {
24 engineConfiguration->vvtMode[0] = VVT_BOSCH_QUICK_START;
25}

Referenced by applyEngineType().

Here is the caller graph for this function:

◆ setTestVVTEngineConfiguration()

void setTestVVTEngineConfiguration ( )

Definition at line 80 of file test_engine.cpp.

80 {
82
84 engineConfiguration->trigger.customTotalToothCount = 3;
85 engineConfiguration->trigger.customSkippedToothCount = 1;
86
87 // set algorithm 3
88 setAlgorithm(engine_load_mode_e::LM_SPEED_DENSITY);
89
90 engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
91 engineConfiguration->camInputs[0] = Gpio::A5;
92
93 // set global_trigger_offset_angle 0
94 engineConfiguration->globalTriggerAngleOffset = 0;
95
96 engineConfiguration->vvtMode[0] = VVT_SINGLE_TOOTH;
97}
void setAlgorithm(engine_load_mode_e algo)

Referenced by applyEngineType().

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

Go to the source code of this file.