fastcat 0.13.15
C++ EtherCAT Device Command & Control Library
Loading...
Searching...
No Matches
three_node_thermal_model.h
Go to the documentation of this file.
1#ifndef FASTCAT_THREE_NODE_THERMAL_MODEL_H_
2#define FASTCAT_THREE_NODE_THERMAL_MODEL_H_
3
4// Include external then project includes
5#include "fastcat/device_base.h"
6
7// Include c then c++ libraries
8#include <cmath>
9
10// Include external then project includes
11#include "fastcat/signal_handling.h"
12#include "fastcat/yaml_parser.h"
13#include "jsd/jsd_print.h"
14#include "jsd/jsd_time.h"
15
16namespace fastcat
17{
23{
24 public:
26
33 bool ConfigFromYaml(const YAML::Node& node) override;
34
40 bool Read() override;
41
48 FaultType Process() override;
49
58 bool Write(DeviceCmd& cmd) override;
59
60 protected:
61 // declare motor parameters
66 0.0};
68 0.0};
69 double winding_res_{0.0};
71 double k1_{0.0}, k2_{0.0}, k3_{0.0};
72
73 // declare fault protection parameters
74 std::vector<double> max_allowable_temps_{0.0, 0.0, 0.0, 0.0};
78 double ref_temp_{0.0};
84 bool awaiting_seed_temp_{false};
88
89 // declare variables for storing signal data and estimates
91 0.0};
93 false};
94 double motor_res_{0.0};
97 std::vector<double> node_temps_{
98 0.0, 0.0, 0.0, 0.0};
100 std::vector<size_t> node_overtemp_persistences_{
101 0, 0, 0, 0};
103
104 // constants
105 // the required number of signals for this device
106 static constexpr size_t FC_TNTM_NUM_SIGNALS = 3;
107 // signal index for node 3 temperature
108 static constexpr size_t NODE_3_TEMP_IDX = 0;
109 // signal index for motor current
110 static constexpr size_t MOTOR_CURRENT_IDX = 1;
111 // signal index for motor on status (from the actuator state)
112 static constexpr size_t MOTOR_ON_STATUS_IDX = 2;
113};
114} // namespace fastcat
115
116#endif
Definition device_base.h:20
Class implementing a Three-Node Thermal Model for estimating internal motor temperatures,...
Definition three_node_thermal_model.h:23
double motor_current_
this value is retrieved from a motor controller measurement
Definition three_node_thermal_model.h:90
uint32_t persistence_limit_
be exceeded before throwing a fault
Definition three_node_thermal_model.h:75
bool Write(DeviceCmd &cmd) override
Commands device Currently, only the SEED_THERMAL_MODEL_TEMPERATURE_CMD, used to reseed the model is a...
Definition three_node_thermal_model.cc:175
static constexpr size_t MOTOR_ON_STATUS_IDX
Definition three_node_thermal_model.h:112
std::vector< double > max_allowable_temps_
Definition three_node_thermal_model.h:74
static constexpr size_t FC_TNTM_NUM_SIGNALS
Definition three_node_thermal_model.h:106
double exp_smoothing_alpha_
Definition three_node_thermal_model.h:81
double ref_temp_
Definition three_node_thermal_model.h:78
double k1_
Definition three_node_thermal_model.h:71
double thermal_res_nodes_2_to_3_
thermal resistance from node 2 to 3 (deg C / W)
Definition three_node_thermal_model.h:67
bool motor_on_status_
this value is retrieved from the motor controller status
Definition three_node_thermal_model.h:92
double thermal_mass_node_2_
Definition three_node_thermal_model.h:64
double thermal_mass_node_1_on_
Definition three_node_thermal_model.h:62
double winding_thermal_cor_
coefficient of resistance
Definition three_node_thermal_model.h:70
ThreeNodeThermalModel()
ThreeNodeThermalModel constructor.
Definition three_node_thermal_model.cc:6
double thermal_mass_node_1_off_
Definition three_node_thermal_model.h:63
bool ConfigFromYaml(const YAML::Node &node) override
Parses input yaml file to set model constants and temperature limits.
Definition three_node_thermal_model.cc:12
std::vector< size_t > node_overtemp_persistences_
Definition three_node_thermal_model.h:100
double k2_
Definition three_node_thermal_model.h:71
double thermal_res_nodes_1_to_2_
thermal resistance from node 1 to 2 (deg C / W)
Definition three_node_thermal_model.h:65
static constexpr size_t NODE_3_TEMP_IDX
Definition three_node_thermal_model.h:108
bool awaiting_seed_temp_
Definition three_node_thermal_model.h:84
double k3_
weights for T4 estimate
Definition three_node_thermal_model.h:71
bool Read() override
Reads in most recent temperature and current signal values, and stores them for further calculations.
Definition three_node_thermal_model.cc:106
double motor_res_
Definition three_node_thermal_model.h:94
std::vector< double > node_temps_
Definition three_node_thermal_model.h:97
static constexpr size_t MOTOR_CURRENT_IDX
Definition three_node_thermal_model.h:110
double winding_res_
motor winding electrical resistance (ohms)
Definition three_node_thermal_model.h:69
FaultType Process() override
Performs one update step of the thermal prediction model, tracking the most recently predicted temper...
Definition three_node_thermal_model.cc:132
Definition device_base.h:18