fastcat 0.13.15
C++ EtherCAT Device Command & Control Library
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
fastcat::ThreeNodeThermalModel Class Reference

Class implementing a Three-Node Thermal Model for estimating internal motor temperatures, through fastcat. More...

#include "three_node_thermal_model.h"

Inheritance diagram for fastcat::ThreeNodeThermalModel:
Inheritance graph
[legend]
Collaboration diagram for fastcat::ThreeNodeThermalModel:
Collaboration graph
[legend]

Public Member Functions

 ThreeNodeThermalModel ()
 ThreeNodeThermalModel constructor.
 
bool ConfigFromYaml (const YAML::Node &node) override
 Parses input yaml file to set model constants and temperature limits.
 
bool Read () override
 Reads in most recent temperature and current signal values, and stores them for further calculations.
 
FaultType Process () override
 Performs one update step of the thermal prediction model, tracking the most recently predicted temperature values at each node, and reporting a fault if any of the limits are exceeded.
 
bool Write (DeviceCmd &cmd) override
 Commands device Currently, only the SEED_THERMAL_MODEL_TEMPERATURE_CMD, used to reseed the model is accepted.
 
- Public Member Functions inherited from fastcat::DeviceBase
virtual ~DeviceBase ()
 
virtual void Fault ()
 
virtual void Reset ()
 
virtual void SetInitializationTime (double time_sec, double monotonic_time_sec)
 
void RegisterCmdQueue (std::shared_ptr< ThreadSafeQueue< DeviceCmd > > cmd_queue)
 
std::string GetName ()
 
std::shared_ptr< DeviceState > GetState ()
 
void SetTime (double time, double monotonic_time)
 
void SetLoopPeriod (double loop_period)
 

Protected Attributes

double thermal_mass_node_1_on_ {0.0}
 
double thermal_mass_node_1_off_ {0.0}
 
double thermal_mass_node_2_ {0.0}
 
double thermal_res_nodes_1_to_2_
 thermal resistance from node 1 to 2 (deg C / W)
 
double thermal_res_nodes_2_to_3_
 thermal resistance from node 2 to 3 (deg C / W)
 
double winding_res_ {0.0}
 motor winding electrical resistance (ohms)
 
double winding_thermal_cor_ {0.0}
 coefficient of resistance
 
double k1_ {0.0}
 
double k2_ {0.0}
 
double k3_ {0.0}
 weights for T4 estimate
 
std::vector< doublemax_allowable_temps_ {0.0, 0.0, 0.0, 0.0}
 
uint32_t persistence_limit_
 be exceeded before throwing a fault
 
double ref_temp_ {0.0}
 
double exp_smoothing_alpha_ {1.0}
 
bool awaiting_seed_temp_ {false}
 
double motor_current_
 this value is retrieved from a motor controller measurement
 
bool motor_on_status_
 this value is retrieved from the motor controller status
 
double motor_res_ {0.0}
 
std::vector< doublenode_temps_
 
std::vector< size_tnode_overtemp_persistences_
 
- Protected Attributes inherited from fastcat::DeviceBase
std::string name_
 unique device name
 
double last_monotonic_time_ = 0.0
 
double loop_period_ = 0.0
 only some devices need
 
double initialization_time_sec_ = -1
 only some devices need
 
double monotonic_initialization_time_sec_ = -1
 only some devices need
 
bool device_fault_active_ = false
 device-level fault, manager also has fault status flag
 
std::shared_ptr< DeviceState > state_
 Fastcat state data.
 
std::shared_ptr< ThreadSafeQueue< DeviceCmd > > cmd_queue_
 for intra-device commands
 

Static Protected Attributes

static constexpr size_t FC_TNTM_NUM_SIGNALS = 3
 
static constexpr size_t NODE_3_TEMP_IDX = 0
 
static constexpr size_t MOTOR_CURRENT_IDX = 1
 
static constexpr size_t MOTOR_ON_STATUS_IDX = 2
 

Additional Inherited Members

- Public Attributes inherited from fastcat::DeviceBase
std::vector< Signal > signals_
 

Detailed Description

Class implementing a Three-Node Thermal Model for estimating internal motor temperatures, through fastcat.

Constructor & Destructor Documentation

◆ ThreeNodeThermalModel()

fastcat::ThreeNodeThermalModel::ThreeNodeThermalModel ( )

ThreeNodeThermalModel constructor.

Member Function Documentation

◆ ConfigFromYaml()

bool fastcat::ThreeNodeThermalModel::ConfigFromYaml ( const YAML::Node &  node)
overridevirtual

Parses input yaml file to set model constants and temperature limits.

Parameters
nodeThe portion of the yaml file corresponding to this device.
Returns
True if configuration completes without error; false otherwise.

Implements fastcat::DeviceBase.

Here is the call graph for this function:

◆ Process()

FaultType fastcat::ThreeNodeThermalModel::Process ( )
overridevirtual

Performs one update step of the thermal prediction model, tracking the most recently predicted temperature values at each node, and reporting a fault if any of the limits are exceeded.

Returns
FaultType enum value corresponding to appropriate fault state.

Reimplemented from fastcat::DeviceBase.

◆ Read()

bool fastcat::ThreeNodeThermalModel::Read ( )
overridevirtual

Reads in most recent temperature and current signal values, and stores them for further calculations.

Returns
True if device state is read without error; false otherwise.

Implements fastcat::DeviceBase.

Here is the call graph for this function:

◆ Write()

bool fastcat::ThreeNodeThermalModel::Write ( DeviceCmd cmd)
overridevirtual

Commands device Currently, only the SEED_THERMAL_MODEL_TEMPERATURE_CMD, used to reseed the model is accepted.

Parameters
cmdCommand provided to the device, of a type that is a subclass of DeviceCmd
Returns
boolean for if the command was accepted and successful or not

Reimplemented from fastcat::DeviceBase.

Member Data Documentation

◆ awaiting_seed_temp_

bool fastcat::ThreeNodeThermalModel::awaiting_seed_temp_ {false}
protected

this variable is used to delay setting initial temperatures until we read the first temperature for node 3 and sets all nodes to that starting temperature

◆ exp_smoothing_alpha_

double fastcat::ThreeNodeThermalModel::exp_smoothing_alpha_ {1.0}
protected

this parameter specifies the extent to which smoothing is applied to the temperature sensor value

◆ FC_TNTM_NUM_SIGNALS

constexpr size_t fastcat::ThreeNodeThermalModel::FC_TNTM_NUM_SIGNALS = 3
staticconstexprprotected

◆ k1_

double fastcat::ThreeNodeThermalModel::k1_ {0.0}
protected

◆ k2_

double fastcat::ThreeNodeThermalModel::k2_ {0.0}
protected

◆ k3_

double fastcat::ThreeNodeThermalModel::k3_ {0.0}
protected

weights for T4 estimate

◆ max_allowable_temps_

std::vector<double> fastcat::ThreeNodeThermalModel::max_allowable_temps_ {0.0, 0.0, 0.0, 0.0}
protected

◆ motor_current_

double fastcat::ThreeNodeThermalModel::motor_current_
protected
Initial value:
{
0.0}

this value is retrieved from a motor controller measurement

◆ MOTOR_CURRENT_IDX

constexpr size_t fastcat::ThreeNodeThermalModel::MOTOR_CURRENT_IDX = 1
staticconstexprprotected

◆ motor_on_status_

bool fastcat::ThreeNodeThermalModel::motor_on_status_
protected
Initial value:
{
false}

this value is retrieved from the motor controller status

◆ MOTOR_ON_STATUS_IDX

constexpr size_t fastcat::ThreeNodeThermalModel::MOTOR_ON_STATUS_IDX = 2
staticconstexprprotected

◆ motor_res_

double fastcat::ThreeNodeThermalModel::motor_res_ {0.0}
protected

this value is estimated based on the temp 1 estimate and represents the resistance of the motor, which is used for calculated power

◆ NODE_3_TEMP_IDX

constexpr size_t fastcat::ThreeNodeThermalModel::NODE_3_TEMP_IDX = 0
staticconstexprprotected

◆ node_overtemp_persistences_

std::vector<size_t> fastcat::ThreeNodeThermalModel::node_overtemp_persistences_
protected
Initial value:
{
0, 0, 0, 0}

this is used as a counter for how many cycles node 1 has been over the temperature limit

◆ node_temps_

std::vector<double> fastcat::ThreeNodeThermalModel::node_temps_
protected
Initial value:
{
0.0, 0.0, 0.0, 0.0}

this value is estimated from the model and represents winding temperature

◆ persistence_limit_

uint32_t fastcat::ThreeNodeThermalModel::persistence_limit_
protected
Initial value:
{
0}

be exceeded before throwing a fault

represents how many time cycles a temperature limit is able to

◆ ref_temp_

double fastcat::ThreeNodeThermalModel::ref_temp_ {0.0}
protected

the reference temperature for the winding resistance parameter, along with being used for calculating the dynamically varying resistance

◆ thermal_mass_node_1_off_

double fastcat::ThreeNodeThermalModel::thermal_mass_node_1_off_ {0.0}
protected

◆ thermal_mass_node_1_on_

double fastcat::ThreeNodeThermalModel::thermal_mass_node_1_on_ {0.0}
protected

◆ thermal_mass_node_2_

double fastcat::ThreeNodeThermalModel::thermal_mass_node_2_ {0.0}
protected

◆ thermal_res_nodes_1_to_2_

double fastcat::ThreeNodeThermalModel::thermal_res_nodes_1_to_2_
protected
Initial value:
{
0.0}

thermal resistance from node 1 to 2 (deg C / W)

◆ thermal_res_nodes_2_to_3_

double fastcat::ThreeNodeThermalModel::thermal_res_nodes_2_to_3_
protected
Initial value:
{
0.0}

thermal resistance from node 2 to 3 (deg C / W)

◆ winding_res_

double fastcat::ThreeNodeThermalModel::winding_res_ {0.0}
protected

motor winding electrical resistance (ohms)

◆ winding_thermal_cor_

double fastcat::ThreeNodeThermalModel::winding_thermal_cor_ {0.0}
protected

coefficient of resistance


The documentation for this class was generated from the following files: