Bar Logo 4kW dsPIC33C PSFB DC-DC DA (Part-No. )
 
Content
     
Loading...
Searching...
No Matches
Generic Fault Driver

Contains generic fault functions. More...

+ Collaboration diagram for Generic Fault Driver:

Files

file  fault_common.h
 Contains fault generic public functions.
 
file  fault_typedef.h
 Contains fault data types.
 

Data Structures

struct  FAULT_OBJ_T
 The Fault object data structure contains a list of elements/variables that are used to detect/check a fault. More...
 
struct  FAULT_s
 Collection of faults to be monitored. More...
 

Functions

void FAULT_Init (FAULT_OBJ_T *faultInput, int16_t threshold, int16_t hysLimit, uint16_t thresholdCnt, uint32_t hysCnt)
 This function initializes the fault object data structure with the values that required to detect a fault.

 
void FAULT_InitRange (FAULT_OBJ_T *faultInput, int16_t thresholdMin, int16_t hysLimitMin, int16_t thresholdMax, int16_t hysLimitMax, uint16_t thresholdCnt, uint32_t hysCnt)
 This function initializes the fault object data structure with the values that required to detect a fault at a particular range.

 
void FAULT_SetCounters (FAULT_OBJ_T *faultInput, uint16_t fltThresholdCnt, uint32_t fltHysCnt)
 This function initializes/sets the fault structure with the counter limits.
 
void FAULT_SetThresholds (FAULT_OBJ_T *faultInput, int16_t fltThreshold, int16_t fltHysLimit)
 This function initializes/sets the fault structure with the threshold limits.
 
bool FAULT_CheckMax (FAULT_OBJ_T *faultInput, int16_t faultSource, FAULT_CALLBACK callback)
 This function compares the fault source value with the threshold limits and sets (or) resets the fault active state accordingly.
 
bool FAULT_CheckMin (FAULT_OBJ_T *faultInput, int16_t faultSource, FAULT_CALLBACK callback)
 This function compares the fault source value with the threshold limits and sets (or) resets the fault active state accordingly.
 
bool FAULT_CheckBit (FAULT_OBJ_T *faultInput, bool faultBit, FAULT_CALLBACK callback)
 
bool FAULT_CheckRange (FAULT_OBJ_T *faultInput, int16_t inputValue, FAULT_CALLBACK callback)
 

Detailed Description

This document contains fault functions that handles different fault conditions and threshold.

Function Documentation

◆ FAULT_CheckBit()

bool FAULT_CheckBit ( FAULT_OBJ_T * faultInput,
bool faultBit,
FAULT_CALLBACK callback )
Parameters
faultInputPointer to a fault data object of type FAULT_OBJ_T
faultBitbit being checked by fault function
callbackfunction executed when fault trips
Returns
1 when fault is active
0 when fault is not active

This function returns fault active state to TRUE, if the fault bit is set for a time equivalent to set_counter value. Also, after the fault active state becomes TRUE, if callback function pointer is non-null, then the routine will call the callback function which quickly shutdown the system, If needed. Also the function returns fault active state to FALSE, if the fault bit is reset for a time equivalent to reset_counter value.

Definition at line 236 of file fault_common.c.

◆ FAULT_CheckMax()

bool FAULT_CheckMax ( FAULT_OBJ_T * faultInput,
int16_t faultSource,
FAULT_CALLBACK callback )
Parameters
faultInputPointer to a fault data object of type FAULT_OBJ_T
faultSourcevalue being evaluated for fault limits
callbackfunction executed when fault trips
Returns
1 when fault is active
0 when fault is not active

This function returns fault active state to TRUE, if input fault source is greater than the set threshold limit for a time equivalent to set_counter value. Also, after the fault active state becomes TRUE, if callback function pointer is non-null, then the routine will call the callback function which quickly shutdown the system, if needed. Also the function returns fault active state to FALSE, if input fault source is less than the hysteresis limit value for a time equivalent to reset_counter value.

Definition at line 126 of file fault_common.c.

+ Here is the caller graph for this function:

◆ FAULT_CheckMin()

bool FAULT_CheckMin ( FAULT_OBJ_T * faultInput,
int16_t faultSource,
FAULT_CALLBACK callback )
Parameters
faultInputPointer to a fault data object of type FAULT_OBJ_T
faultSourcevalue being evaluated for fault limits
callbackfunction executed when fault trips
Returns
1 when fault is active
0 when fault is not active

This function returns fault active state to TRUE, if input fault source is less than the set threshold limit for a time equivalent to set_counter value. Also, after the fault active state becomes TRUE, if callback function pointer is non-null, then the routine will call the callback function which quickly shutdown the system, if needed. Also the function returns fault active state to FALSE, if input fault source is greater than the hysteresis limit value for a time equivalent to reset_counter value.

Definition at line 184 of file fault_common.c.

+ Here is the caller graph for this function:

◆ FAULT_CheckRange()

bool FAULT_CheckRange ( FAULT_OBJ_T * faultInput,
int16_t inputValue,
FAULT_CALLBACK callback )
Parameters
faultInputPointer to a fault data object of type FAULT_OBJ_T
inputValuevalue being evaluated by the function
callbackfunction executed when fault trips
Returns
1 when fault is active
0 when fault is not active

This function returns fault active state to TRUE, if the input value is out of threshold limits range for a time equivalent to set_counter value. Also, after the fault active state becomes TRUE, if callback function pointer is non-null, then the routine will call the callback function which quickly shutdown the system, If needed. Also the function returns fault active state to FALSE, if the input value is within the hysteresis limits range for a time equivalent to reset_counter value.

Definition at line 287 of file fault_common.c.

◆ FAULT_Init()

void FAULT_Init ( FAULT_OBJ_T * faultInput,
int16_t threshold,
int16_t hysLimit,
uint16_t thresholdCnt,
uint32_t hysCnt )
Parameters
faultInputPointer to a fault data object of type FAULT_OBJ_T
thresholdsets the fault allowed limit
hysLimithysteresis limit values
thresholdCntthreshold counter (increments when threshold limit is reached)
hysCnthysteresis counter increments when hysteresis limit is reached
Returns
void


This function initializes the fault structure with the thresholds and counter limits which are required to detect a fault.

Definition at line 27 of file fault_common.c.

+ Here is the caller graph for this function:

◆ FAULT_InitRange()

void FAULT_InitRange ( FAULT_OBJ_T * faultInput,
int16_t thresholdMin,
int16_t hysLimitMin,
int16_t thresholdMax,
int16_t hysLimitMax,
uint16_t thresholdCnt,
uint32_t hysCnt )
Parameters
faultInputPointer to a fault data object of type FAULT_OBJ_T
thresholdMinsets the fault allowed minimum limit
thresholdMaxsets the fault allowed maximum limit
hysLimitMinminimum hysteresis limit value
hysLimitMaxmaximum hysteresis limit values
thresholdCntthreshold counter (increments when threshold limit is reached)
hysCnthysteresis counter increments when hysteresis limit is reached
Returns
void

This function initializes the fault structure with the thresholds
and counter limits which are required to detect a fault.

Definition at line 55 of file fault_common.c.

◆ FAULT_SetCounters()

void FAULT_SetCounters ( FAULT_OBJ_T * faultInput,
uint16_t fltThresholdCnt,
uint32_t fltHysCnt )
Parameters
faultInputPointer to a fault data object of type FAULT_OBJ_T
fltThresholdCntthreshold counter (increments when threshold limit is reached)
fltHysCnthysteresis counter increments when hysteresis limit is reached
Returns
void

This function initializes the CounterSet, CounterReset variables of the fault object data structure. These counter values together with thresholds are used to set and reset the fault.

Definition at line 83 of file fault_common.c.

◆ FAULT_SetThresholds()

void FAULT_SetThresholds ( FAULT_OBJ_T * faultInput,
int16_t fltThreshold,
int16_t fltHysLimit )
Parameters
faultInputPointer to a fault data object of type FAULT_OBJ_T
fltThresholdsets the fault allowed limit
fltHysLimithysteresis limit values
Returns
void

This function initializes/sets the val1_Threshold, val1_Hysteresis variables of the fault object data structure. These threshold values together with counter limits are used to set and reset the fault.

Definition at line 101 of file fault_common.c.