Test bench: implement injector test for dead time calculation (#3960)

* Add output channel for TestBench iter counter

* Update testBenchIter from runBench

* rusefi.input: testBenchIter gauge

* rusefi.input: initial Injector test dialog
This commit is contained in:
Andrey G 2022-03-09 04:25:58 +03:00 committed by GitHub
parent 7229387a73
commit bca63957b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View File

@ -287,7 +287,8 @@ uint16_t rpmAcceleration;dRPM;"RPM/s",1, 0, 0, 0, 0
int luaInvocationCounter;;"count",1, 0, 0, 0, 0
int luaLastCycleDuration;;"nt",1, 0, 0, 0, 0
uint8_t[80 iterate] unusedAtTheEnd;;"",1, 0, 0, 0, 0
uint8_t testBenchIter;;"count",1, 0, 0, 0, 0
uint8_t[79 iterate] unusedAtTheEnd;;"",1, 0, 0, 0, 0
bit launchSpeedCondition
bit launchRpmCondition

View File

@ -99,6 +99,7 @@ static void runBench(brain_pin_e brainPin, OutputPin *output, float startDelayMs
isRunningBench = true;
for (int i = 0; i < count; i++) {
engine->outputChannels.testBenchIter = i;
efitick_t nowNt = getTimeNowNt();
// start in a short time so the scheduler can precisely schedule the start event
efitick_t startTime = nowNt + US2NT(50);
@ -111,7 +112,8 @@ static void runBench(brain_pin_e brainPin, OutputPin *output, float startDelayMs
// Wait one full cycle time for the event + delay to happen
chThdSleepMicroseconds(onTimeUs + offTimeUs);
}
/* last */
engine->outputChannels.testBenchIter++;
efiPrintf("Done!");
isRunningBench = false;

View File

@ -986,6 +986,7 @@ triggerVvtFallGauge = triggerVvtFall,"triggerVvtFall", "", -10000.0,10000.0, -10
triggerVvtRiseGauge = triggerVvtRise,"triggerVvtRise", "", -10000.0,10000.0, -10000.0,10000.0, -10000.0,10000.0, 3,3
luaInvocationCounterGauge = luaInvocationCounter,"luaInvocationCounter", "count", 0.0,0.0, 0.0,0.0, 0.0,0.0, 0,0
luaLastCycleDurationGauge = luaLastCycleDuration,"luaLastCycleDuration", "nt", 0.0,0.0, 0.0,0.0, 0.0,0.0, 0,0
testBenchIterGauge = testBenchIter, "Test Bench Iterations", "count", -10, {benchTestCount + 10}, -5, 0, {benchTestCount}, {benchTestCount + 5}, 1, 1
gaugeCategory = PIDs
alternatorStatus_iTermGauge = alternatorStatus_iTerm,"alternatorStatus_ iTerm", "", -10000.0,10000.0, -10000.0,10000.0, -10000.0,10000.0, 3,3
@ -1554,6 +1555,7 @@ menuDialog = main
subMenu = ecuStimulator, "ECU stimulator"
subMenu = datalogSettings, "Datalogging"
subMenu = ioTest, "Bench test"
subMenu = injTest, "Injector test"
subMenu = engineTypeDialog, "Popular vehicles"
subMenu = std_separator
@ -3561,6 +3563,20 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
panel = testFsio
panel = testMisc
; Injectors test
dialog = injTest_l, "Output test modes", yAxis
field = "Iterations", benchTestCount
field = "ON time", benchTestOffTime
field = "OFF time", benchTestOnTime
dialog = injTest_r, "Reference gauges", yAxis
gauge = VBattGauge,North
gauge = testBenchIterGauge,South
dialog = injTest, "", xAxis
panel = injTest_l
panel = injTest_r
dialog = widebandConfig, "rusEFI Wideband Config"
field = "!Please connect exactly one wideband controller before pressing these buttons!"
commandButton = "Update Firmware", cmd_wideband_firmare_update