Skip to content

Commit

Permalink
feature: PlugPresent as spot value for drive inhibit functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
uhi22 committed Sep 17, 2024
1 parent 755255c commit 073988f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ccs/acOBC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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. */

}

Expand Down
3 changes: 2 additions & 1 deletion include/param_prj.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) \
Expand Down Expand Up @@ -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 ) \
Expand Down

0 comments on commit 073988f

Please sign in to comment.