foxBMS - Unit Tests
1.3.0
The foxBMS Unit Tests API Documentation
|
Driver for the insulation monitoring. More...
Go to the source code of this file.
Macros | |
#define | IR155_MAXIMUM_INSULATION_RESISTANCE_kOhm (106800u) |
#define | IR155_MINIMUM_INSULATION_RESISTANCE_kOhm (0u) |
#define | IR155_NORMAL_MODE_LOWER_DUTY_CYCLE_LIMIT_perc (4.0f) |
#define | IR155_NORMAL_MODE_UPPER_DUTY_CYCLE_LIMIT_perc (96.0f) |
#define | IR155_SPEED_START_ESTIMATION_GOOD_LOWER_DUTY_CYCLE_LIMIT_perc (4.0f) |
#define | IR155_SPEED_START_ESTIMATION_GOOD_UPPER_DUTY_CYCLE_LIMIT_perc (11.0f) |
#define | IR155_SPEED_START_ESTIMATION_BAD_LOWER_DUTY_CYCLE_LIMIT_perc (89.0f) |
#define | IR155_SPEED_START_ESTIMATION_BAD_UPPER_DUTY_CYCLE_LIMIT_perc (96.0f) |
#define | IR155_UNDERVOLTAGE_MODE_LOWER_DUTY_CYCLE_LIMIT_perc (4.0f) |
#define | IR155_UNDERVOLTAGE_MODE_UPPER_DUTY_CYCLE_LIMIT_perc (96.0f) |
#define | IR155_DEVICE_ERROR_LOWER_DUTY_CYCLE_LIMIT_perc (46.5f) |
#define | IR155_DEVICE_ERROR_UPPER_DUTY_CYCLE_LIMIT_perc (53.5f) |
#define | IR155_GROUND_ERROR_LOWER_DUTY_CYCLE_LIMIT_perc (46.5f) |
#define | IR155_GROUND_ERROR_UPPER_DUTY_CYCLE_LIMIT_perc (53.5f) |
Functions | |
static IR155_MEASUREMENT_MODE_e | IR155_GetMeasurementMode (float frequency_Hz) |
Determines frequency-dependent measurement state. More... | |
static uint32_t | IR155_CalculateResistance (float dutyCycle_perc) |
Calculate insulation resistance from measured dutycycle. More... | |
static bool | IR155_IsDutyCycleWithinInterval (float dutyCycle_perc, float lowerLimit_perc, float upperLimit_perc) |
Check if passed duty cycle is within interval limits. More... | |
void | IR155_Initialize (uint8_t triggerTime_ms) |
Software initialization of Timer-module. More... | |
void | IR155_Deinitialize (void) |
Software deinitialization of Timer-module. More... | |
IR155_MEASUREMENT_s | IR155_GetMeasurementValues (void) |
Interface function which delivers the actual signal measurement (duty cyle) and evaluation. Use of intervals because of measuring and signal inaccuracy. The evaluated results are finally written in the database. More... | |
Variables | |
IR155_STATE_s | ir155_state |
Driver for the insulation monitoring.
SPDX-License-Identifier: BSD-3-Clause
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:
Definition in file bender_ir155_helper.c.
#define IR155_DEVICE_ERROR_LOWER_DUTY_CYCLE_LIMIT_perc (46.5f) |
Definition at line 84 of file bender_ir155_helper.c.
#define IR155_DEVICE_ERROR_UPPER_DUTY_CYCLE_LIMIT_perc (53.5f) |
Definition at line 85 of file bender_ir155_helper.c.
#define IR155_GROUND_ERROR_LOWER_DUTY_CYCLE_LIMIT_perc (46.5f) |
Definition at line 88 of file bender_ir155_helper.c.
#define IR155_GROUND_ERROR_UPPER_DUTY_CYCLE_LIMIT_perc (53.5f) |
Definition at line 89 of file bender_ir155_helper.c.
#define IR155_MAXIMUM_INSULATION_RESISTANCE_kOhm (106800u) |
Maximum measurable resistance according to formula: ((90 * 1200kOhm) / (dc - 5) ) - 1200kOhm with dc ]5%,95%[
Definition at line 65 of file bender_ir155_helper.c.
#define IR155_MINIMUM_INSULATION_RESISTANCE_kOhm (0u) |
Definition at line 66 of file bender_ir155_helper.c.
#define IR155_NORMAL_MODE_LOWER_DUTY_CYCLE_LIMIT_perc (4.0f) |
Definition at line 69 of file bender_ir155_helper.c.
#define IR155_NORMAL_MODE_UPPER_DUTY_CYCLE_LIMIT_perc (96.0f) |
Definition at line 70 of file bender_ir155_helper.c.
#define IR155_SPEED_START_ESTIMATION_BAD_LOWER_DUTY_CYCLE_LIMIT_perc (89.0f) |
Definition at line 76 of file bender_ir155_helper.c.
#define IR155_SPEED_START_ESTIMATION_BAD_UPPER_DUTY_CYCLE_LIMIT_perc (96.0f) |
Definition at line 77 of file bender_ir155_helper.c.
#define IR155_SPEED_START_ESTIMATION_GOOD_LOWER_DUTY_CYCLE_LIMIT_perc (4.0f) |
Definition at line 73 of file bender_ir155_helper.c.
#define IR155_SPEED_START_ESTIMATION_GOOD_UPPER_DUTY_CYCLE_LIMIT_perc (11.0f) |
Definition at line 74 of file bender_ir155_helper.c.
#define IR155_UNDERVOLTAGE_MODE_LOWER_DUTY_CYCLE_LIMIT_perc (4.0f) |
Definition at line 80 of file bender_ir155_helper.c.
#define IR155_UNDERVOLTAGE_MODE_UPPER_DUTY_CYCLE_LIMIT_perc (96.0f) |
Definition at line 81 of file bender_ir155_helper.c.
|
static |
Calculate insulation resistance from measured dutycycle.
Function check, that passed duty-cycle lies within allowed range. Otherwise, the calculated resistance will be limited to the next reasonable value.
[in] | dutyCycle_perc | measured signal duty-cycle in percentage |
Definition at line 167 of file bender_ir155_helper.c.
void IR155_Deinitialize | ( | void | ) |
Software deinitialization of Timer-module.
Definition at line 216 of file bender_ir155_helper.c.
|
static |
Determines frequency-dependent measurement state.
Use of intervals because of measuring and signal inaccuracy. This interval is configurable via define IR155_MEASUREMENT_INTERVAL_RANGE_Hz
[in] | frequency_Hz | measured signal frequency in Hz |
Definition at line 137 of file bender_ir155_helper.c.
IR155_MEASUREMENT_s IR155_GetMeasurementValues | ( | void | ) |
Interface function which delivers the actual signal measurement (duty cyle) and evaluation. Use of intervals because of measuring and signal inaccuracy. The evaluated results are finally written in the database.
Definition at line 230 of file bender_ir155_helper.c.
void IR155_Initialize | ( | uint8_t | triggerTime_ms | ) |
Software initialization of Timer-module.
triggerTime_ms | cyclic call time of IR155_GetMeasurementValues function |
Definition at line 194 of file bender_ir155_helper.c.
|
static |
Check if passed duty cycle is within interval limits.
[in] | dutyCycle_perc | measured signal duty-cycle in percentage |
[in] | lowerLimit_perc | lower interval limit |
[in] | upperLimit_perc | upper interval limit |
Definition at line 182 of file bender_ir155_helper.c.
|
extern |