-
Notifications
You must be signed in to change notification settings - Fork 123
feat: Dold RN5893 IMD Hardware Driver #1579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| active_modules: | ||
| im_cli: | ||
| standalone: true | ||
| module: BUIsolationMonitor | ||
| connections: | ||
| imd: | ||
| - implementation_id: main | ||
| module_id: dold_rn5893 | ||
|
|
||
| serial_comm_hub: | ||
| module: SerialCommHub | ||
| config_implementation: | ||
| main: | ||
| serial_port: /dev/ttyUSB0 | ||
| baudrate: 115200 | ||
|
|
||
| dold_rn5893: | ||
| module: DoldRN5893 | ||
| connections: | ||
| serial_comm_hub: | ||
| - module_id: serial_comm_hub | ||
| implementation_id: main | ||
| config_module: | ||
| device_id: 1 | ||
| power_supply_type: DC |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| ev_add_module(Bender_isoCHA425HV) | ||
| ev_add_module(DoldRN5893) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # | ||
| # AUTO GENERATED - MARKED REGIONS WILL BE KEPT | ||
| # template version 3 | ||
| # | ||
|
|
||
| # module setup: | ||
| # - ${MODULE_NAME}: module name | ||
| ev_setup_cpp_module() | ||
|
|
||
| # ev@bcc62523-e22b-41d7-ba2f-825b493a3c97:v1 | ||
| # insert your custom targets and additional config variables here | ||
| # ev@bcc62523-e22b-41d7-ba2f-825b493a3c97:v1 | ||
|
|
||
| target_sources(${MODULE_NAME} | ||
| PRIVATE | ||
| "main/isolation_monitorImpl.cpp" | ||
| ) | ||
|
|
||
| # ev@c55432ab-152c-45a9-9d2e-7281d50c69c3:v1 | ||
| target_sources(${MODULE_NAME} PRIVATE | ||
| "main/registers.cpp" | ||
| ) | ||
| # ev@c55432ab-152c-45a9-9d2e-7281d50c69c3:v1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // Copyright Frickly Systems GmbH | ||
| // Copyright Pionix GmbH and Contributors to EVerest | ||
| #include "DoldRN5893.hpp" | ||
|
|
||
| namespace module { | ||
|
|
||
| void DoldRN5893::init() { | ||
| invoke_init(*p_main); | ||
| } | ||
|
|
||
| void DoldRN5893::ready() { | ||
| invoke_ready(*p_main); | ||
| } | ||
|
|
||
| } // namespace module |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // Copyright Frickly Systems GmbH | ||
| // Copyright Pionix GmbH and Contributors to EVerest | ||
| #ifndef DOLD_RN5893_HPP | ||
| #define DOLD_RN5893_HPP | ||
|
|
||
| // | ||
| // AUTO GENERATED - MARKED REGIONS WILL BE KEPT | ||
| // template version 2 | ||
| // | ||
|
|
||
| #include "ld-ev.hpp" | ||
|
|
||
| // headers for provided interface implementations | ||
| #include <generated/interfaces/isolation_monitor/Implementation.hpp> | ||
|
Check warning on line 15 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
|
|
||
| // headers for required interface implementations | ||
| #include <generated/interfaces/serial_communication_hub/Interface.hpp> | ||
|
Check warning on line 18 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
|
|
||
| // ev@4bf81b14-a215-475c-a1d3-0a484ae48918:v1 | ||
| // insert your custom include headers here | ||
| // ev@4bf81b14-a215-475c-a1d3-0a484ae48918:v1 | ||
|
|
||
| namespace module { | ||
|
|
||
| struct Conf { | ||
| int device_id; | ||
| int self_test_timeout_s; | ||
|
Check warning on line 28 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
| bool keep_measurement_active; | ||
|
Check warning on line 29 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
| bool always_publish_measurements; | ||
|
Check warning on line 30 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
| bool timeout_release; | ||
|
Check warning on line 31 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
| double timeout_s; | ||
| std::string broken_wire_detect; | ||
|
Check warning on line 33 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
| bool storing_insulation_fault; | ||
|
Check warning on line 34 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
| std::string switching_mode_indicator_relay; | ||
|
Check warning on line 35 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
| std::string power_supply_type; | ||
|
Check warning on line 36 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
| int response_value_alarm_kohm; | ||
|
Check warning on line 37 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
| int response_value_pre_alarm_kohm; | ||
|
Check warning on line 38 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
| std::string coupling_device; | ||
|
Check warning on line 39 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
| std::string indicator_relay_k1_function; | ||
|
Check warning on line 40 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
| std::string indicator_relay_k2_function; | ||
|
Check warning on line 41 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
| bool automatic_self_test; | ||
|
Check warning on line 42 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp
|
||
| }; | ||
|
|
||
| class DoldRN5893 : public Everest::ModuleBase { | ||
| public: | ||
| DoldRN5893() = delete; | ||
| DoldRN5893(const ModuleInfo& info, std::unique_ptr<isolation_monitorImplBase> p_main, | ||
| std::unique_ptr<serial_communication_hubIntf> r_serial_comm_hub, Conf& config) : | ||
| ModuleBase(info), p_main(std::move(p_main)), r_serial_comm_hub(std::move(r_serial_comm_hub)), config(config){}; | ||
|
|
||
| const std::unique_ptr<isolation_monitorImplBase> p_main; | ||
| const std::unique_ptr<serial_communication_hubIntf> r_serial_comm_hub; | ||
| const Conf& config; | ||
|
|
||
| // ev@1fce4c5e-0ab8-41bb-90f7-14277703d2ac:v1 | ||
| // insert your public definitions here | ||
| // ev@1fce4c5e-0ab8-41bb-90f7-14277703d2ac:v1 | ||
|
|
||
| protected: | ||
| // ev@4714b2ab-a24f-4b95-ab81-36439e1478de:v1 | ||
| // insert your protected definitions here | ||
| // ev@4714b2ab-a24f-4b95-ab81-36439e1478de:v1 | ||
|
|
||
| private: | ||
| friend class LdEverest; | ||
| void init(); | ||
| void ready(); | ||
|
|
||
| // ev@211cfdbe-f69a-4cd6-a4ec-f8aaa3d1b6c8:v1 | ||
| // insert your private definitions here | ||
| // ev@211cfdbe-f69a-4cd6-a4ec-f8aaa3d1b6c8:v1 | ||
| }; | ||
|
|
||
| // ev@087e516b-124c-48df-94fb-109508c7cda9:v1 | ||
| // insert other definitions here | ||
| // ev@087e516b-124c-48df-94fb-109508c7cda9:v1 | ||
|
|
||
| } // namespace module | ||
|
|
||
| #endif // DOLD_RN5893_HPP | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Dold RN5893 IMD with UL 2231 approval - especially for DC charging stations | ||
|
Check notice on line 1 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md
|
||
|
|
||
| Electrical safety must be guaranteed during the charging process. For this purpose, an unearthed DC power supply system (IT system) with insulation monitoring is set up and monitored with an insulation monitoring device (IMD). | ||
| Dold has developed a smart insulation monitoring solution for DC charging stations that also fulfils the requirements of UL 2231. | ||
| The insulation monitor RN 5893 from the VARIMETER IMD family monitors the charging process from the charging station to the vehicle in combination with the coupling device RP 5898. | ||
|
|
||
| - Response delay < 10 s | ||
| - Nominal voltage up to DC 1000 V | ||
| - Manipulation protection due to sealable transparent cover | ||
|
|
||
| ## Self test | ||
|
|
||
| The Dold RN5893 supports two types of self tests: the normal self test and the extended self test. | ||
| This module only supports the "normal" self tests, not the extended self test. | ||
|
|
||
| When a self test is started via the IMD interface, bit 4 of the "control word 1" register (address 40001) is set. | ||
| The device will then perform a self test. If a device fault is present while the self test is running, the self test will fail. | ||
| If the device reports a state that is not "self test running" anymore and there is no device fault, the self test is considered successful. | ||
|
|
||
| Changes of the device state, including self tests, are reported with a short delay via Modbus. This is handled internally using the `self_test_running` and `self_test_triggered` variables of the driver. | ||
|
|
||
| ## Timeout | ||
|
|
||
| The device supports a communication timeout, which raises a device fault if no communication is possible for a certain time. | ||
|
|
||
| This module supports this timeout. It is enabled by setting `timeout_release` to `true` and optionally configuring the timeout duration in seconds using `timeout_s`, which defaults to 3s. | ||
|
|
||
| This value should not be smaller than 2s, as the driver updates the *Timeout* register only once per second (or slightly less frequently), which would otherwise lead to false positives. | ||
|
|
||
| If the device reports *Communication Fault Modbus* in the *device fault* register, the driver will try to reset the device by writing `1` to the *control word 1* register. After that, the driver resets the control word 1 to the previous value. | ||
|
|
||
| The driver will try to write the device reset command every cycle until the device fault is cleared. | ||
|
|
||
| ## Measurement and publishing modes | ||
|
|
||
| This driver supports three modes of operation: | ||
| - **Standard mode**: The device pauses measurements upon startup and when `stop()` is called. Measurements are started by calling `start()` | ||
|
Check notice on line 37 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md
|
||
| - **Continous measurement mode**: The device continuously performs measurements, bit 8 of the "control word 1" register (address 40001) is not set at any time. This is useful if the device should always alarm on isolation faults, even when no EV is connected. Measurements are still only published when `start()` is called, until `stop()` is called | ||
| - This mode is enabled by setting `keep_measurement_active` to `true` | ||
| - **Always publish mode**: Like in continous measurement mode, the device continuously performs measurements. Additionally, all measurements are published, even when `stop()` is called. This is only useful in very specific scenarios, e.g. if a special module needs measurements all the time | ||
| - This mode is enabled by setting both `always_publish_measurements` and `keep_measurement_active` to `true` | ||
|
|
||
| ## Device instructions | ||
|
|
||
| - For applications following UL 2231 the parameter `automatic_self_test` has to be disabled (i.e. set to `false`) | ||
| - Changes to modbus registers triggered by modbus messages may have a short delay before they can be read back over the bus. The device's internal reaction is faster than what is reported via Modbus, however | ||
| - The device state may not always report "Error" when a device fault is present (i.e. the device has an internal fault or the device fault register reports a fault), because of internal prioritization of faults. Because of this, we only check the device fault register to determine if a fault is present and report that to Everest | ||
| - If a modbus communication timeout occurs, the device only responds to modbus requests that either read data or write a reset command | ||
Uh oh!
There was an error while loading. Please reload this page.