69 #define IR155_MAXIMUM_INSULATION_RESISTANCE_kOhm (106800u)
70 #define IR155_MINIMUM_INSULATION_RESISTANCE_kOhm (0u)
73 #define IR155_NORMAL_MODE_LOWER_DUTY_CYCLE_LIMIT_perc (4.0f)
74 #define IR155_NORMAL_MODE_UPPER_DUTY_CYCLE_LIMIT_perc (96.0f)
77 #define IR155_SPEED_START_ESTIMATION_GOOD_LOWER_DUTY_CYCLE_LIMIT_perc (4.0f)
78 #define IR155_SPEED_START_ESTIMATION_GOOD_UPPER_DUTY_CYCLE_LIMIT_perc (11.0f)
80 #define IR155_SPEED_START_ESTIMATION_BAD_LOWER_DUTY_CYCLE_LIMIT_perc (89.0f)
81 #define IR155_SPEED_START_ESTIMATION_BAD_UPPER_DUTY_CYCLE_LIMIT_perc (96.0f)
84 #define IR155_UNDERVOLTAGE_MODE_LOWER_DUTY_CYCLE_LIMIT_perc (4.0f)
85 #define IR155_UNDERVOLTAGE_MODE_UPPER_DUTY_CYCLE_LIMIT_perc (96.0f)
88 #define IR155_DEVICE_ERROR_LOWER_DUTY_CYCLE_LIMIT_perc (46.5f)
89 #define IR155_DEVICE_ERROR_UPPER_DUTY_CYCLE_LIMIT_perc (53.5f)
92 #define IR155_GROUND_ERROR_LOWER_DUTY_CYCLE_LIMIT_perc (46.5f)
93 #define IR155_GROUND_ERROR_UPPER_DUTY_CYCLE_LIMIT_perc (53.5f)
100 .measurement.isMeasurementValid =
false,
101 .measurement.isUndervoltageDetected =
false,
105 .measurement.resistance_kOhm = 0,
106 .measurement.pwmSignal.dutyCycle_perc = 0.0f,
107 .measurement.pwmSignal.frequency_Hz = 0.0f,
175 float_t insulationResistance_kOhm = 0.0f;
176 if (dutyCycle_perc <= 5.0f) {
178 }
else if (dutyCycle_perc > 95.0f) {
181 insulationResistance_kOhm = ((90.0f * 1200.0f) / (dutyCycle_perc - 5.0f)) - 1200.0f;
183 return (uint32_t)insulationResistance_kOhm;
188 if ((lowerLimit_perc < dutyCycle_perc) && (upperLimit_perc > dutyCycle_perc)) {
238 .isUndervoltageDetected =
true,
239 .pwmSignal.dutyCycle_perc = 0.0f,
240 .pwmSignal.frequency_Hz = 0.0f,
241 .resistance_kOhm = 0u,
254 bool isPwmMeasurementValid =
true;
255 if (isPwmMeasurementValid ==
true) {
257 isPwmMeasurementValid =
true;
262 isPwmMeasurementValid =
false;
266 if (isPwmMeasurementValid ==
true) {
379 return measurementResult;
383 #ifdef UNITY_UNIT_TEST
Headers for the configuration for the insulation monitoring.
#define IR155_SPEEDSTART_LOWER_FREQUENCY_Hz
#define IR155_GROUND_ERROR_UPPER_FREQUENCY_Hz
#define IR155_UNDERVOLTAGE_LOWER_FREQUENCY_Hz
#define IR155_MINIMUM_FREQUENCY_Hz
#define IR155_STARTUP_TIME_ms
#define IR155_SPEEDSTART_UPPER_FREQUENCY_Hz
#define IR155_IMD_DEVICE_ERROR_LOWER_FREQUENCY_Hz
#define IR155_UNDERVOLTAGE_UPPER_FREQUENCY_Hz
#define IR155_IMD_DEVICE_ERROR_UPPER_FREQUENCY_Hz
#define IR155_WAIT_TIME_AFTER_GROUND_ERROR_ms
#define IR155_GROUND_ERROR_LOWER_FREQUENCY_Hz
#define IR155_NORMAL_CONDITION_UPPER_FREQUENCY_Hz
#define IR155_NORMAL_CONDITION_LOWER_FREQUENCY_Hz
#define IR155_DEVICE_ERROR_LOWER_DUTY_CYCLE_LIMIT_perc
static bool IR155_IsDutyCycleWithinInterval(float_t dutyCycle_perc, float_t lowerLimit_perc, float_t upperLimit_perc)
Check if passed duty cycle is within interval limits.
#define IR155_MAXIMUM_INSULATION_RESISTANCE_kOhm
#define IR155_SPEED_START_ESTIMATION_GOOD_UPPER_DUTY_CYCLE_LIMIT_perc
#define IR155_MINIMUM_INSULATION_RESISTANCE_kOhm
#define IR155_GROUND_ERROR_UPPER_DUTY_CYCLE_LIMIT_perc
#define IR155_NORMAL_MODE_LOWER_DUTY_CYCLE_LIMIT_perc
#define IR155_SPEED_START_ESTIMATION_BAD_UPPER_DUTY_CYCLE_LIMIT_perc
#define IR155_UNDERVOLTAGE_MODE_LOWER_DUTY_CYCLE_LIMIT_perc
#define IR155_SPEED_START_ESTIMATION_BAD_LOWER_DUTY_CYCLE_LIMIT_perc
#define IR155_DEVICE_ERROR_UPPER_DUTY_CYCLE_LIMIT_perc
void IR155_Initialize(uint8_t triggerTime_ms)
Software initialization of Timer-module.
void IR155_Deinitialize(void)
Software deinitialization of Timer-module.
static uint32_t IR155_CalculateResistance(float_t dutyCycle_perc)
Calculate insulation resistance from measured dutycycle.
#define IR155_GROUND_ERROR_LOWER_DUTY_CYCLE_LIMIT_perc
IR155_MEASUREMENT_s IR155_GetMeasurementValues(void)
Interface function which delivers the actual signal measurement (duty cyle) and evaluation....
#define IR155_NORMAL_MODE_UPPER_DUTY_CYCLE_LIMIT_perc
IR155_STATE_s ir155_state
#define IR155_UNDERVOLTAGE_MODE_UPPER_DUTY_CYCLE_LIMIT_perc
#define IR155_SPEED_START_ESTIMATION_GOOD_LOWER_DUTY_CYCLE_LIMIT_perc
static IR155_MEASUREMENT_MODE_e IR155_GetMeasurementMode(float_t frequency_Hz)
Determines frequency-dependent measurement state.
Headers for the configuration for the insulation monitoring.
@ IR155_UNDEFINED_FREQUENCY
@ IR155_UNDERVOLTAGE_MODE
@ IR155_GROUND_ERROR_MODE_UNKNOWN
@ IR155_IMD_ERROR_MEASUREMENT_UNKNOWN
@ IR155_UNDERVOLTAGE_MEASUREMENT_UNKNOWN
@ IR155_IMD_ERROR_MEASUREMENT
@ IR155_RESISTANCE_MEASUREMENT
@ IR155_RESISTANCE_ESTIMATION_UNKNOWN
@ IR155_RESISTANCE_ESTIMATION
@ IR155_MEASUREMENT_NOT_VALID
@ IR155_RESISTANCE_MEASUREMENT_UNKNOWN
@ IR155_UNDERVOLTAGE_MEASUREMENT
@ IR155_GROUND_ERROR_MODE
#define IR155_GET_DIGITAL_STATUS_PIN_STATE()
enum IR155_MEASUREMENT_MODE IR155_MEASUREMENT_MODE_e
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
FRAM_RETURN_TYPE_e FRAM_ReadData(FRAM_BLOCK_ID_e blockId)
Reads a variable from the FRAM.
Header for the driver for the FRAM module.
FRAM_INSULATION_FLAG_s fram_insulationFlags
@ FRAM_BLOCK_ID_INSULATION_FLAG
#define IMD_PERIODIC_CALL_TIME_ms
void PWM_Initialize(void)
Initializes the ETPWM and the ECAP module.
PWM_SIGNAL_s PWM_GetPwmData(void)
Get dutycycle and frequency of input PWM signal.
bool PWM_IsEcapModuleInitialized(void)
Get initialization state of ecap module.
bool isUndervoltageDetected
IR155_MEASUREMENT_MODE_e measurementMode
STD_PIN_STATE_e digitalStatusPin
IR155_MEASUREMENT_STATE_e measurementState
uint16_t periodTriggerTime_ms
IR155_MEASUREMENT_s measurement
uint32_t timeUntilValidMeasurement_ms