Proteus analog input ci (#2271)
* test vbatt * test proteus vbatt * tolerance * these don't work on proteus * new engine type * test analog input * more test points, less tolerance * console build needs this file generated * only include for hw ci builds * wiring info Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
parent
449ff446e2
commit
9f0ebaac49
|
@ -941,6 +941,8 @@ case PROMETHEUS_DEFAULTS:
|
|||
return "PROMETHEUS_DEFAULTS";
|
||||
case PROTEUS_DEFAULTS:
|
||||
return "PROTEUS_DEFAULTS";
|
||||
case PROTEUS_ANALOG_PWM_TEST:
|
||||
return "PROTEUS_ANALOG_PWM_TEST";
|
||||
case PROTEUS_MIATA_NB2:
|
||||
return "PROTEUS_MIATA_NB2";
|
||||
case PROTEUS_QC_TEST_BOARD:
|
||||
|
|
|
@ -737,6 +737,8 @@ case PROMETHEUS_DEFAULTS:
|
|||
return "PROMETHEUS_DEFAULTS";
|
||||
case PROTEUS_DEFAULTS:
|
||||
return "PROTEUS_DEFAULTS";
|
||||
case PROTEUS_ANALOG_PWM_TEST:
|
||||
return "PROTEUS_ANALOG_PWM_TEST";
|
||||
case PROTEUS_MIATA_NB2:
|
||||
return "PROTEUS_MIATA_NB2";
|
||||
case PROTEUS_QC_TEST_BOARD:
|
||||
|
|
|
@ -99,3 +99,23 @@ void setTestEngineIssue366rise(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
}
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
|
||||
#ifdef HARDWARE_CI
|
||||
void setProteusAnalogPwmTest(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||
// lowest cpu trigger possible
|
||||
engineConfiguration->trigger.type = TT_ONE;
|
||||
|
||||
// Disable trigger stim
|
||||
engineConfiguration->triggerSimulatorPins[0] = GPIO_UNASSIGNED;
|
||||
engineConfiguration->triggerSimulatorPins[1] = GPIO_UNASSIGNED;
|
||||
engineConfiguration->triggerSimulatorPins[2] = GPIO_UNASSIGNED;
|
||||
|
||||
// The idle control pin is connected to the default TPS input, analog volt 2
|
||||
engineConfiguration->idle.solenoidPin = GPIOG_4;
|
||||
engineConfiguration->idle.solenoidFrequency = 5000;
|
||||
|
||||
// Test range is 20% to 80%
|
||||
engineConfiguration->tpsMin = 200;
|
||||
engineConfiguration->tpsMax = 800;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -14,4 +14,4 @@ void setTestVVTEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
|||
|
||||
void setTestEngineIssue366both(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||
void setTestEngineIssue366rise(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||
|
||||
void setProteusAnalogPwmTest(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||
|
|
|
@ -441,7 +441,12 @@ static percent_t automaticIdleController(float tpsPos, float rpm, int targetRpm,
|
|||
}
|
||||
|
||||
float IdleController::getIdlePosition() {
|
||||
efiAssert(OBD_PCM_Processor_Fault, engineConfiguration != NULL, "engineConfiguration pointer", 0);
|
||||
// Simplify hardware CI: we borrow the idle valve controller as a PWM source for various stimulation tasks
|
||||
// The logic in this function is solidly unit tested, so it's not necessary to re-test the particulars on real hardware.
|
||||
#ifdef HARDWARE_CI
|
||||
return CONFIG(manIdlePosition);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Here we have idle logic thread - actual stepper movement is implemented in a separate
|
||||
* working thread,
|
||||
|
|
|
@ -915,6 +915,8 @@ case PROMETHEUS_DEFAULTS:
|
|||
return "PROMETHEUS_DEFAULTS";
|
||||
case PROTEUS_DEFAULTS:
|
||||
return "PROTEUS_DEFAULTS";
|
||||
case PROTEUS_ANALOG_PWM_TEST:
|
||||
return "PROTEUS_ANALOG_PWM_TEST";
|
||||
case PROTEUS_MIATA_NB2:
|
||||
return "PROTEUS_MIATA_NB2";
|
||||
case PROTEUS_QC_TEST_BOARD:
|
||||
|
|
|
@ -1230,6 +1230,11 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
|
|||
case PROTEUS_MIATA_NB2:
|
||||
setMiataNB2_ProteusEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
#ifdef HARDWARE_CI
|
||||
case PROTEUS_ANALOG_PWM_TEST:
|
||||
setProteusAnalogPwmTest(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
#endif // HARDWARE_CI
|
||||
#endif // HW_PROTEUS
|
||||
#if HW_HELLEN
|
||||
case HELLEN_NB2:
|
||||
|
|
|
@ -176,6 +176,8 @@ typedef enum {
|
|||
|
||||
PROTEUS_DEFAULTS = 61,
|
||||
|
||||
PROTEUS_ANALOG_PWM_TEST = ET_PROTEUS_ANALOG_PWM_TEST,
|
||||
|
||||
VW_B6 = ET_VW_B6,
|
||||
|
||||
BMW_M73_PROTEUS = ET_PROTEUS_BMW_M73,
|
||||
|
|
|
@ -479,6 +479,7 @@ end_struct
|
|||
#define ET_MIATA_TCU_PROTEUS 1
|
||||
#define ET_CITROEN_TU3JP 65
|
||||
#define ET_PROTEUS_QC_TEST_BOARD 42
|
||||
#define ET_PROTEUS_ANALOG_PWM_TEST 106
|
||||
|
||||
|
||||
custom engine_type_e 4 bits, S32, @OFFSET@, [0:6], @@engine_type_e_auto_enum@@
|
||||
|
|
|
@ -5,8 +5,17 @@ import com.rusefi.core.Sensor;
|
|||
import com.rusefi.core.SensorCentral;
|
||||
import org.junit.Test;
|
||||
|
||||
import static com.rusefi.config.generated.Fields.*;
|
||||
import static com.rusefi.IoUtil.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/*
|
||||
This test requires a particular hardware setup connected to a Proteus board.
|
||||
- External power supplied to the 12v_IGN pin, nominal 12 volts (but 11-13 will work, see testVbatt).
|
||||
Go buy some cheapie $8 12v power supply, cut the barrel jack off, and crimp pins on.
|
||||
- A jumper wire from Ignition output 10 to Analog volt 2 (TPS, see testTpsAnalogInput)
|
||||
*/
|
||||
public class ProteusAnalogTest extends RusefiTestBase {
|
||||
@Test
|
||||
public void testVbatt() {
|
||||
|
@ -16,4 +25,37 @@ public class ProteusAnalogTest extends RusefiTestBase {
|
|||
assertTrue(vbatt > 11);
|
||||
assertTrue(vbatt < 13);
|
||||
}
|
||||
|
||||
void setIdlePositionAndAssertTps(int idle, int expectedTps) {
|
||||
ecu.sendCommand("set idle_position " + idle);
|
||||
|
||||
// wait a sec for sensors to update
|
||||
sleepSeconds(1);
|
||||
|
||||
double actualTps = SensorCentral.getInstance().getValue(Sensor.TPS);
|
||||
|
||||
// Accept up to 2% error - the PWM is a bit noisy, but it should be at least close
|
||||
assertEquals(expectedTps, actualTps, 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTpsAnalogInput() {
|
||||
ecu.setEngineType(ET_PROTEUS_ANALOG_PWM_TEST); // proteus analog input PWM tester
|
||||
ecu.changeRpm(1000);
|
||||
// engine has to be spinning for idle valve to work
|
||||
ecu.sendCommand(getEnableCommand(CMD_SELF_STIMULATION));
|
||||
|
||||
// 0% duty -> failed TPS (voltage too low)
|
||||
setIdlePositionAndAssertTps(2, 0);
|
||||
|
||||
// These should all be valid points
|
||||
setIdlePositionAndAssertTps(20, 0);
|
||||
setIdlePositionAndAssertTps(35, 25);
|
||||
setIdlePositionAndAssertTps(50, 50);
|
||||
setIdlePositionAndAssertTps(65, 75);
|
||||
setIdlePositionAndAssertTps(80, 100);
|
||||
|
||||
// 100% duty -> failed TPS (voltage too high)
|
||||
setIdlePositionAndAssertTps(98, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.rusefi.config.generated;
|
||||
|
||||
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Tue Feb 02 14:16:48 UTC 2021
|
||||
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Wed Feb 03 10:46:27 PST 2021
|
||||
|
||||
// by class com.rusefi.output.FileJavaFieldsConsumer
|
||||
import com.rusefi.config.*;
|
||||
|
@ -422,6 +422,7 @@ public class Fields {
|
|||
public static final int ET_MRE_NEW_TEST_BOARD = 31;
|
||||
public static final int ET_MRE_OLD_TEST_BOARD = 30;
|
||||
public static final int ET_MRE_SUBARU_EJ18 = 37;
|
||||
public static final int ET_PROTEUS_ANALOG_PWM_TEST = 106;
|
||||
public static final int ET_PROTEUS_BMW_M73 = 63;
|
||||
public static final int ET_PROTEUS_MIATA_NB2 = 67;
|
||||
public static final int ET_PROTEUS_QC_TEST_BOARD = 42;
|
||||
|
@ -1208,7 +1209,7 @@ public class Fields {
|
|||
public static final int servoOutputPins8_offset = 3147;
|
||||
public static final int showHumanReadableWarning_offset = 976;
|
||||
public static final int showSdCardWarning_offset = 76;
|
||||
public static final int SIGNATURE_HASH = 937064025;
|
||||
public static final int SIGNATURE_HASH = 920683779;
|
||||
public static final int silentTriggerError_offset = 1464;
|
||||
public static final int slowAdcAlpha_offset = 2088;
|
||||
public static final int sparkDwellRpmBins_offset = 332;
|
||||
|
@ -1492,7 +1493,7 @@ public class Fields {
|
|||
public static final char TS_SD_R_COMMAND = 'r';
|
||||
public static final char TS_SD_W_COMMAND = 'w';
|
||||
public static final char TS_SET_LOGGER_SWITCH = 'l';
|
||||
public static final String TS_SIGNATURE = "rusEFI 2021.02.02.all.937064025";
|
||||
public static final String TS_SIGNATURE = "rusEFI 2021.02.03.all.920683779";
|
||||
public static final char TS_SINGLE_WRITE_COMMAND = 'W';
|
||||
public static final int TT_TT_1_16 = 50;
|
||||
public static final int TT_TT_2JZ_1_12 = 29;
|
||||
|
|
Loading…
Reference in New Issue