Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/bringup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ generate_config_tmux_run_script(CONFIG bringup-api-system)
generate_config_tmux_run_script(CONFIG bringup-DZG)
generate_config_tmux_run_script(CONFIG bringup-LEM)
generate_config_tmux_run_script(CONFIG bringup-bender-isocha)
generate_config_tmux_run_script(CONFIG bringup-dold-rn5893)
generate_config_tmux_run_script(CONFIG bringup-huawei)
generate_config_tmux_run_script(CONFIG bringup-isolation-monitor-sil)
generate_config_tmux_run_script(CONFIG bringup-nxpnfcfrontend-token-provider)
Expand Down
25 changes: 25 additions & 0 deletions config/bringup/config-bringup-dold-rn5893.yaml
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
1 change: 1 addition & 0 deletions modules/HardwareDrivers/IsolationMonitors/CMakeLists.txt
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

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L15

Include file: <generated/interfaces/isolation_monitor/Implementation.hpp> not found. Please note: Cppcheck does not need standard library headers to get proper results.

// 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

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L18

Include file: <generated/interfaces/serial_communication_hub/Interface.hpp> not found. Please note: Cppcheck does not need standard library headers to get proper results.

// 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;

Check warning on line 27 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L27

struct member 'Conf::device_id' is never used.
int self_test_timeout_s;

Check warning on line 28 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L28

struct member 'Conf::self_test_timeout_s' is never used.
bool keep_measurement_active;

Check warning on line 29 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L29

struct member 'Conf::keep_measurement_active' is never used.
bool always_publish_measurements;

Check warning on line 30 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L30

struct member 'Conf::always_publish_measurements' is never used.
bool timeout_release;

Check warning on line 31 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L31

struct member 'Conf::timeout_release' is never used.
double timeout_s;

Check warning on line 32 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L32

struct member 'Conf::timeout_s' is never used.
std::string broken_wire_detect;

Check warning on line 33 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L33

struct member 'Conf::broken_wire_detect' is never used.
bool storing_insulation_fault;

Check warning on line 34 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L34

struct member 'Conf::storing_insulation_fault' is never used.
std::string switching_mode_indicator_relay;

Check warning on line 35 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L35

struct member 'Conf::switching_mode_indicator_relay' is never used.
std::string power_supply_type;

Check warning on line 36 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L36

struct member 'Conf::power_supply_type' is never used.
int response_value_alarm_kohm;

Check warning on line 37 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L37

struct member 'Conf::response_value_alarm_kohm' is never used.
int response_value_pre_alarm_kohm;

Check warning on line 38 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L38

struct member 'Conf::response_value_pre_alarm_kohm' is never used.
std::string coupling_device;

Check warning on line 39 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L39

struct member 'Conf::coupling_device' is never used.
std::string indicator_relay_k1_function;

Check warning on line 40 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L40

struct member 'Conf::indicator_relay_k1_function' is never used.
std::string indicator_relay_k2_function;

Check warning on line 41 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L41

struct member 'Conf::indicator_relay_k2_function' is never used.
bool automatic_self_test;

Check warning on line 42 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/DoldRN5893.hpp#L42

struct member 'Conf::automatic_self_test' is never used.
};

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
48 changes: 48 additions & 0 deletions modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md
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

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L1

Expected: [None]; Actual: # Dold RN5893 IMD with UL 2231 approval - especially for DC charging stations

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).

Check notice on line 3 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L3

Expected: 80; Actual: 226
Dold has developed a smart insulation monitoring solution for DC charging stations that also fulfils the requirements of UL 2231.

Check notice on line 4 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L4

Expected: 80; Actual: 129
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.

Check notice on line 5 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L5

Expected: 80; Actual: 180

- 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.

Check notice on line 13 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L13

Expected: 80; Actual: 98
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.

Check notice on line 16 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L16

Expected: 80; Actual: 113
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.

Check notice on line 17 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L17

Expected: 80; Actual: 127
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.

Check notice on line 18 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L18

Expected: 80; Actual: 139

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.

Check notice on line 20 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L20

Expected: 80; Actual: 202

## Timeout

The device supports a communication timeout, which raises a device fault if no communication is possible for a certain time.

Check notice on line 24 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L24

Expected: 80; Actual: 124

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.

Check notice on line 26 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L26

Expected: 80; Actual: 187

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.

Check notice on line 28 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L28

Expected: 80; Actual: 185

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.

Check notice on line 30 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L30

Expected: 80; Actual: 243

The driver will try to write the device reset command every cycle until the device fault is cleared.

Check notice on line 32 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L32

Expected: 80; Actual: 100

## 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

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L37

Expected: 80; Actual: 139

Check notice on line 37 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L37

Lists should be surrounded by blank lines
- **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

Check notice on line 38 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L38

Expected: 80; Actual: 348
- 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

Check notice on line 40 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L40

Expected: 80; Actual: 290
- This mode is enabled by setting both `always_publish_measurements` and `keep_measurement_active` to `true`

Check notice on line 41 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L41

Expected: 80; Actual: 110

## Device instructions

- For applications following UL 2231 the parameter `automatic_self_test` has to be disabled (i.e. set to `false`)

Check notice on line 45 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L45

Expected: 80; Actual: 113
- 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

Check notice on line 46 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L46

Expected: 80; Actual: 207
- 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

Check notice on line 47 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L47

Expected: 80; Actual: 330
- If a modbus communication timeout occurs, the device only responds to modbus requests that either read data or write a reset command

Check notice on line 48 in modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/HardwareDrivers/IsolationMonitors/DoldRN5893/README.md#L48

Expected: 80; Actual: 134
Loading
Loading