4.21. Contactor
4.21.1. Module Files
4.21.1.1. Driver
src/app/driver/contactor/contactor.csrc/app/driver/contactor/contactor.h
4.21.1.2. Configuration
src/app/driver/config/contactor_cfg.csrc/app/driver/config/contactor_cfg.h
A how-to for the configuration of the contactor module can be found in How to use the Contactor module.
4.21.1.3. Unit Test
tests/unit/app/driver/contactor/test_contactor.ctests/unit/app/driver/config/test_contactor_cfg.c
4.21.2. Description
The contactor module provides a high-level interface to control configured contactors and to evaluate their feedback state.
The runtime state of all contactors is stored in the central configuration
registry cont_contactorStates (configured in contactor_cfg.c).
Each entry contains:
requested/set state,
feedback state,
feedback type,
string assignment,
contactor type (plus, minus, precharge),
SPS channel mapping,
preferred current-breaking direction.
4.21.2.1. Switching Interface
The module offers per-string switching functions:
CONT_CloseContactor()/CONT_OpenContactor()for explicit contactor types,CONT_ClosePrecharge()/CONT_OpenPrecharge()for precharge handling,CONT_OpenAllPrechargeContactors()andCONT_OpenAllContactors()for global safe-state opening.
Requests are forwarded to the SPS driver through
SPS_RequestContactorState() while the set state in the registry is
updated accordingly.
4.21.2.2. Feedback Handling and Diagnostics
CONT_CheckFeedback() updates feedback for all configured contactors and
checks set state versus feedback state.
Depending on the configured feedback type, feedback is derived from:
no dedicated feedback (assume requested state),
SPS current-based feedback,
SPS digital feedback via normally-open pin logic,
SPS digital feedback via normally-closed pin logic.
For each configured contactor type, corresponding DIAG events are reported based on match/mismatch between set and feedback state.
4.21.2.3. Initialization
CONT_Initialize() validates configuration consistency, including SPS channel
range checks and channel affiliation checks for all registered contactors.