1- .. safety_controller .rst:
1+ .. _ safety_controller .rst :
22
3- *****************
43Safety Controller
5- *****************
4+ =================
65
76Overview
8- ========
7+ --------
98
109The Charge Control Y is equipped with an additional MCU (aka Safety Controller) which is responsible for
1110managing all low-level aspects which are critical for electrical safety. The firmware for this MCU is
@@ -33,38 +32,39 @@ in the following table.
3332
3433
3534System Architecture
36- ===================
35+ -------------------
36+
3737.. figure :: _static/images/system_architecture_ccy.svg
3838 :width: 1000pt
3939
40- Figure: Simplified system architecture for the safety controller on the Charge Control Y
40+ Simplified System Architecture for the Safety Controller on the Charge Control Y
4141
4242The safety controller manages the Charge Enable (CE) line, acting as a critical interface for monitoring
4343Insertion Detection (ID) as well as Emergency Input and temperature sensors and therefore controlling the
44- HV ready switch in accordance with EV safety standards. Its core function is to ** enforce safe operating states **
45- based on system diagnostics and environmental conditions.
44+ HV ready switch in accordance with EV safety standards.
45+ Its core function is to ** enforce safe operating states ** based on system diagnostics and environmental conditions.
4646
4747
4848Fault Detection & Safety Response
4949---------------------------------
5050
5151When an error is detected — such as a fault in the system, a triggered emergency input, or a thermal violation — the
52- controller transitions to **State F **, a fail-safe state that prevents further system operation to protect both
52+ controller transitions to **State EC **, a fail-safe state that prevents further system operation to protect both
5353the hardware and the user.
5454
5555
5656HV Ready Enablement
5757-------------------
5858
59- The controller verifies that **no system errors are present ** and that the CE line is in **State C **. Only under
60- these safe conditions it does enable the HV Ready signal, which may be used to energize the HV interlock or
59+ The controller verifies that **no system errors are present ** and that the CE line is in **State C **.
60+ Only under these safe conditions it does enable the HV Ready signal, which may be used to energize the HV interlock or
6161permit charging/operation.
6262
6363
64- Emergency Inputs
65- -----------------
64+ Emergency Input
65+ ---------------
6666
67- The inputs are active-low. This means an emergency stop needs to pull the input to Gnd EVSE.
67+ The input is active-low. This means an emergency stop needs to pull the input to Gnd ( EVSE) .
6868
6969
7070Temperature Monitoring
@@ -75,96 +75,19 @@ temperature measurement circuits for PT1000 sensors. The safety software monitor
7575hardware errors and for overtemperaure. The temperature threshold can be parameterized.
7676
7777
78- Reset Behaviour and Controller states
79- =====================================
78+ Reset Behaviour and Controller States
79+ -------------------------------------
8080
81- The safety controller starts in an initialization state, to give the peripherals time to reach an defined state.
81+ The safety controller starts in an initialization state, to give the peripherals time to reach a defined state.
8282It leaves the initialization state to a running state, after the reception of the first UART message from the host.
83- Only periodic messages leaves the init state. With the reception of inquiriy messages, the safety controller stays in
84- initialization. This gives the option to fetch version information in an init state. In running state, it monitors the
83+ Only periodic messages leave the init state. With the reception of inquiry messages, the safety controller stays in
84+ initialization. This gives the option to fetch version information in the init state. In running state, it monitors the
8585peripherals and sends out UART messages. If any error occurs, the system goes into safe state.
8686This state can only be left by a reset.
8787
8888.. figure :: _static/images/safety_controller_states.svg
8989 :width: 1000pt
9090
91+ .. include :: safety_controller_uart.rst
9192
92- Safety Controller Communication Protocol
93- ========================================
94-
95- Packet Format Descriptions
96- --------------------------
97-
98- Data packet format
99-
100- Data packets contain payload and can be sent out from host to safety controller or vice versa. Data packets from safety
101- controller to host can be transmitted periodically or by request via an inquiry packet.
102- Only one inquiry packet can be requested before requesting the next one.
103-
104- +--------+--------+--------+-------------------+
105- | Symbol | Size | Code | Description |
106- +========+========+========+===================+
107- | SOF | 1 byte | 0xA5 | Start of frame |
108- +--------+--------+--------+-------------------+
109- | ID | 1 byte | | Packet Identifier |
110- +--------+--------+--------+-------------------+
111- | Data | 8 byte | | Payload |
112- +--------+--------+--------+-------------------+
113- | CRC | 1 byte | | CRC checksum |
114- +--------+--------+--------+-------------------+
115- | EOF | 1 byte | 0x03 | End of frame |
116- +--------+--------+--------+-------------------+
117-
118-
119- Packet Identifier (ID)
120- ----------------------
121-
122- The values of the packet identifier (PacketId) are mapped to the messages as summarized below.
123-
124- +----------+---------------------------+---------------------+-------------------------------------------------------------+----------------------+
125- | PacketId | Description | Communication Dir. | Periodicity | Triggered by Inquiry |
126- +==========+===========================+=====================+=============================================================+======================+
127- | 0x06 | Charge Control | Host → Safety | periodically, every 100ms OR immediately if changes occur | No |
128- +----------+---------------------------+---------------------+-------------------------------------------------------------+----------------------+
129- | 0x07 | Charge State | Safety → Host | periodically, every 100ms | No |
130- +----------+---------------------------+---------------------+-------------------------------------------------------------+----------------------+
131- | 0x08 | PT1000 State | Safety → Host | periodically, every 100ms | No |
132- +----------+---------------------------+---------------------+-------------------------------------------------------------+----------------------+
133- | 0x0A | Firmware Version | Safety → Host | no, only upon request via inquiry packet | Yes |
134- +----------+---------------------------+---------------------+-------------------------------------------------------------+----------------------+
135- | 0x0B | GIT Hash | Safety → Host | no, only upon request via inquiry packet | Yes |
136- +----------+---------------------------+---------------------+-------------------------------------------------------------+----------------------+
137- | 0xFF | Inquiry packet | Host → Safety | no, only to trigger inquiries | No |
138- +----------+---------------------------+---------------------+-------------------------------------------------------------+----------------------+
139-
140- CRC Checksum Field
141- ------------------
142-
143- The checksum is defined over:
144-
145- ::
146-
147- Width = 8
148- Poly = 0x1d
149- XorIn = 0xff
150- ReflectIn = False
151- XorOut = 0xff
152- ReflectOut = False
153- Algorithm = table-driven
154- Name = CRC8 SAE J1850
155-
156- .. include :: safety_protocol.rst
157-
158-
159- EVerest Board Support Package Module
160- ====================================
161-
162- chargebyte developed a comprehensive hardware abstraction module (HAL, or also called BSP module - board support package)
163- for EVerest charging stack to support the Charge Control Y. The module is called ``CbParsleyDriver `` and is
164- available in chargebyte's public EVerest repository as open-source code:
165- https://github.com/chargebyte/everest-chargebyte/tree/main/modules/CbParsleyDriver
166-
167- This module already implements the required communication protocol to interact with the safety controller.
168-
169- All Charge Control Y boards ship with a Linux system preinstalled on eMMC, which also includes EVerest, the mentioned
170- BSP module and example configuration files.
93+ .. include :: everest_bsp.rst
0 commit comments