diff --git a/ccs/acOBC.cpp b/ccs/acOBC.cpp index 88040c3..99e617d 100644 --- a/ccs/acOBC.cpp +++ b/ccs/acOBC.cpp @@ -55,6 +55,7 @@ static void evaluateProximityPilot(void) float temp = AnaIn::pp.Get(); float U_refAdc, U_pull, U_meas, Rv, R; float iLimit; + uint8_t blPlugPresent; /* Step 1: Provide the raw AD value (0 to 4095) for analysis purposes. */ Param::SetFloat(Param::AdcProximityPilot, temp); @@ -131,6 +132,10 @@ static void evaluateProximityPilot(void) iLimit = 63; /* 100ohm is 63A */ } Param::SetFloat(Param::CableCurrentLimit, iLimit); + + /* Step 4: Provide the PlugPresent (e.g. for the feature "driveInhibit") */ + blPlugPresent = R < 5000; /* Design decision: The plug is considered as present if the PP resistance is below 5kohms. */ + Param::SetInt(Param::PlugPresent, blPlugPresent); /* 0: no plug present. 1: plug detected. */ } diff --git a/include/param_prj.h b/include/param_prj.h index a53c359..22beca2 100644 --- a/include/param_prj.h +++ b/include/param_prj.h @@ -44,7 +44,7 @@ #include "myLogging.h" //Next param id (increase when adding new parameter!): 33 -//Next value Id: 2033 +//Next value Id: 2035 /* category name unit min max default id */ #define PARAM_LIST \ PARAM_ENTRY(CAT_HARDWARE,UdcDivider, "dig/V", 0, 100, 10, 1 ) \ @@ -99,6 +99,7 @@ VALUE_ENTRY(ResistanceProxPilot,"ohm", 2019 ) \ VALUE_ENTRY(CableCurrentLimit, "A", 2020 ) \ VALUE_ENTRY(EvseAcCurrentLimit, "A", 2021 ) \ + VALUE_ENTRY(PlugPresent, "", 2034 ) \ VALUE_ENTRY(AdcHwVariant, "", 2022 ) \ VALUE_ENTRY(HardwareVariant, "", 2025 ) \ VALUE_ENTRY(AdcIpropi, "", 2023 ) \