Public Member Functions | Protected Attributes | List of all members
ethercat_hardware::MotorHeatingModel Class Reference

#include <motor_heating_model.h>

Inheritance diagram for ethercat_hardware::MotorHeatingModel:
Inheritance graph
[legend]

Public Member Functions

double calculateMotorHeatPower (const ethercat_hardware::MotorTraceSample &sample, const ethercat_hardware::ActuatorInfo &actuator_info)
 
void diagnostics (diagnostic_updater::DiagnosticStatusWrapper &d)
 Appends heating diagnostic data to status wrapper. More...
 
double getHousingTemperature ()
 Gets current winding temperature estimate (for testing) More...
 
double getWindingTemperature ()
 Gets current winding temperature estimate (for testing) More...
 
bool hasOverheated () const
 Not thread save, should be called by same thread that calls update() More...
 
bool loadTemperatureState ()
 Load saved temperature estimate from directory. More...
 
 MotorHeatingModel (const MotorHeatingModelParameters &motor_params, const std::string &actuator_name, const std::string &hwid, const std::string &save_directory)
 Constructor. More...
 
void reset ()
 Resets motor overheat flag. More...
 
bool saveTemperatureState ()
 
bool startTemperaturePublisher ()
 
bool update (double heating_power, double ambient_temperature, double duration)
 Updates motor temperature estimate. More...
 
bool update (const ethercat_hardware::MotorTraceSample &sample, const ethercat_hardware::ActuatorInfo &actuator_info, double ambient_temperature, double duration)
 
void updateFromDowntime (double downtime, double saved_ambient_temperature)
 Updates estimated motor temperature for long period of off-time. More...
 
double updateFromDowntimeWithInterval (double downtime, double saved_ambient_temperature, double interval, unsigned cycles)
 Updates estimated motor temperature for certain amount of downtime. More...
 

Protected Attributes

std::string actuator_name_
 name of actuator (ex. fl_caster_rotation_motor) More...
 
double ambient_temperature_
 Last recorded ambient temperature : in Celcius. More...
 
double ambient_temperature_sum_
 Sum of (abient heat * time) over last sample interval. More...
 
double duration_since_last_sample_
 Time (in seconds) since late sample interval occurred. More...
 
double heating_energy_sum_
 Sum of heat energy for last sample interval. More...
 
double housing_temperature_
 Temperature estimate of motor housing : in Celcius. More...
 
double housing_thermal_mass_inverse_
 Inverse of thermal mass for motor housing : in Joules/C. More...
 
double housing_to_ambient_thermal_conductance_
 Thermal conductance between motor housing and ambient : in Watt/C. More...
 
std::string hwid_
 Hardware ID of device (ex. 680500501000) More...
 
MotorHeatingModelParameters motor_params_
 
boost::mutex mutex_
 mutex protects values updates by realtime thread and used by diagnostics thread More...
 
bool overheat_
 True if most has overheat, once set, will only clear when reset() is called. More...
 
realtime_tools::RealtimePublisher< ethercat_hardware::MotorTemperature > * publisher_
 Sample interval for trace (in seconds) More...
 
std::string save_filename_
 path to file where temperature data will be saved More...
 
double winding_temperature_
 Temperature estimate of motor winding : in Celcius. More...
 
double winding_thermal_mass_inverse_
 Inverse of thermal mass for motor winding : in Joules/C. More...
 
double winding_to_housing_thermal_conductance_
 Thermal conductance between motor winding and housing : in Watt/C. More...
 

Detailed Description

Definition at line 154 of file motor_heating_model.h.

Constructor & Destructor Documentation

◆ MotorHeatingModel()

ethercat_hardware::MotorHeatingModel::MotorHeatingModel ( const MotorHeatingModelParameters motor_params,
const std::string &  actuator_name,
const std::string &  hwid,
const std::string &  save_directory 
)

Constructor.

Parameters
motor_paramsHeating parameters used by motor heating model
actuator_nameName of actuator (ex: fl_caster_roataion_motor)
save_directoryDirectory where motor temperature will be routinely saved
device_positionPosition of device on EtherCAT chain. Used to prevent multiple motor models from saving at same time

Definition at line 216 of file motor_heating_model.cpp.

Member Function Documentation

◆ calculateMotorHeatPower()

double ethercat_hardware::MotorHeatingModel::calculateMotorHeatPower ( const ethercat_hardware::MotorTraceSample &  sample,
const ethercat_hardware::ActuatorInfo &  actuator_info 
)

Determines power being put into motor as heat (in Watts)

Definition at line 274 of file motor_heating_model.cpp.

◆ diagnostics()

void ethercat_hardware::MotorHeatingModel::diagnostics ( diagnostic_updater::DiagnosticStatusWrapper d)

Appends heating diagnostic data to status wrapper.

Definition at line 399 of file motor_heating_model.cpp.

◆ getHousingTemperature()

double ethercat_hardware::MotorHeatingModel::getHousingTemperature ( )
inline

Gets current winding temperature estimate (for testing)

Definition at line 190 of file motor_heating_model.h.

◆ getWindingTemperature()

double ethercat_hardware::MotorHeatingModel::getWindingTemperature ( )
inline

Gets current winding temperature estimate (for testing)

Definition at line 188 of file motor_heating_model.h.

◆ hasOverheated()

bool ethercat_hardware::MotorHeatingModel::hasOverheated ( ) const
inline

Not thread save, should be called by same thread that calls update()

Definition at line 186 of file motor_heating_model.h.

◆ loadTemperatureState()

bool ethercat_hardware::MotorHeatingModel::loadTemperatureState ( )

Load saved temperature estimate from directory.

Definition at line 557 of file motor_heating_model.cpp.

◆ reset()

void ethercat_hardware::MotorHeatingModel::reset ( )

Resets motor overheat flag.

Definition at line 390 of file motor_heating_model.cpp.

◆ saveTemperatureState()

bool ethercat_hardware::MotorHeatingModel::saveTemperatureState ( )

Saves current temperature estimate to file given directory.

Filename will be named : <actuator_name>_motor_temp Update of file should be atomic.

Definition at line 671 of file motor_heating_model.cpp.

◆ startTemperaturePublisher()

bool ethercat_hardware::MotorHeatingModel::startTemperaturePublisher ( )

Definition at line 256 of file motor_heating_model.cpp.

◆ update() [1/2]

bool ethercat_hardware::MotorHeatingModel::update ( double  heating_power,
double  ambient_temperature,
double  duration 
)

Updates motor temperature estimate.

This uses motor data to determine how much heat power was put into motor over last control cycle. The control cycle is assumed to be relatively short so the update is done as a linear estimation of differential equation

Returns true if motor winding temperature is below acceptable limit, false if motor has overheated and halting enabled.

Definition at line 311 of file motor_heating_model.cpp.

◆ update() [2/2]

bool ethercat_hardware::MotorHeatingModel::update ( const ethercat_hardware::MotorTraceSample &  sample,
const ethercat_hardware::ActuatorInfo &  actuator_info,
double  ambient_temperature,
double  duration 
)
inline

Definition at line 177 of file motor_heating_model.h.

◆ updateFromDowntime()

void ethercat_hardware::MotorHeatingModel::updateFromDowntime ( double  downtime,
double  saved_ambient_temperature 
)

Updates estimated motor temperature for long period of off-time.

Between runs of this program the motor temperature estimate is stored to a file. When the program is run again this saved temperature estimate needs to be updated base on time between runs. This function makes the assumption that no power was being put into motor between runs.

Because the motor may have been disabled for a long time, this function does not always use a interative approach to calculate new temperature

Definition at line 363 of file motor_heating_model.cpp.

◆ updateFromDowntimeWithInterval()

double ethercat_hardware::MotorHeatingModel::updateFromDowntimeWithInterval ( double  downtime,
double  saved_ambient_temperature,
double  interval,
unsigned  cycles 
)

Updates estimated motor temperature for certain amount of downtime.

Runs motor temperture simulation with a certain step interval and for a given number of cycles. Will stop early if downtime reaches 0. Returns remaining downtime

Definition at line 339 of file motor_heating_model.cpp.

Member Data Documentation

◆ actuator_name_

std::string ethercat_hardware::MotorHeatingModel::actuator_name_
protected

name of actuator (ex. fl_caster_rotation_motor)

Definition at line 297 of file motor_heating_model.h.

◆ ambient_temperature_

double ethercat_hardware::MotorHeatingModel::ambient_temperature_
protected

Last recorded ambient temperature : in Celcius.

Definition at line 277 of file motor_heating_model.h.

◆ ambient_temperature_sum_

double ethercat_hardware::MotorHeatingModel::ambient_temperature_sum_
protected

Sum of (abient heat * time) over last sample interval.

Definition at line 288 of file motor_heating_model.h.

◆ duration_since_last_sample_

double ethercat_hardware::MotorHeatingModel::duration_since_last_sample_
protected

Time (in seconds) since late sample interval occurred.

Definition at line 290 of file motor_heating_model.h.

◆ heating_energy_sum_

double ethercat_hardware::MotorHeatingModel::heating_energy_sum_
protected

Sum of heat energy for last sample interval.

Definition at line 286 of file motor_heating_model.h.

◆ housing_temperature_

double ethercat_hardware::MotorHeatingModel::housing_temperature_
protected

Temperature estimate of motor housing : in Celcius.

Definition at line 275 of file motor_heating_model.h.

◆ housing_thermal_mass_inverse_

double ethercat_hardware::MotorHeatingModel::housing_thermal_mass_inverse_
protected

Inverse of thermal mass for motor housing : in Joules/C.

Definition at line 269 of file motor_heating_model.h.

◆ housing_to_ambient_thermal_conductance_

double ethercat_hardware::MotorHeatingModel::housing_to_ambient_thermal_conductance_
protected

Thermal conductance between motor housing and ambient : in Watt/C.

Definition at line 265 of file motor_heating_model.h.

◆ hwid_

std::string ethercat_hardware::MotorHeatingModel::hwid_
protected

Hardware ID of device (ex. 680500501000)

Definition at line 299 of file motor_heating_model.h.

◆ motor_params_

MotorHeatingModelParameters ethercat_hardware::MotorHeatingModel::motor_params_
protected

Definition at line 296 of file motor_heating_model.h.

◆ mutex_

boost::mutex ethercat_hardware::MotorHeatingModel::mutex_
protected

mutex protects values updates by realtime thread and used by diagnostics thread

Definition at line 280 of file motor_heating_model.h.

◆ overheat_

bool ethercat_hardware::MotorHeatingModel::overheat_
protected

True if most has overheat, once set, will only clear when reset() is called.

Definition at line 283 of file motor_heating_model.h.

◆ publisher_

realtime_tools::RealtimePublisher<ethercat_hardware::MotorTemperature>* ethercat_hardware::MotorHeatingModel::publisher_
protected

Sample interval for trace (in seconds)

realtime publisher for MotorHeatingSample

Definition at line 294 of file motor_heating_model.h.

◆ save_filename_

std::string ethercat_hardware::MotorHeatingModel::save_filename_
protected

path to file where temperature data will be saved

Definition at line 298 of file motor_heating_model.h.

◆ winding_temperature_

double ethercat_hardware::MotorHeatingModel::winding_temperature_
protected

Temperature estimate of motor winding : in Celcius.

Definition at line 273 of file motor_heating_model.h.

◆ winding_thermal_mass_inverse_

double ethercat_hardware::MotorHeatingModel::winding_thermal_mass_inverse_
protected

Inverse of thermal mass for motor winding : in Joules/C.

Definition at line 267 of file motor_heating_model.h.

◆ winding_to_housing_thermal_conductance_

double ethercat_hardware::MotorHeatingModel::winding_to_housing_thermal_conductance_
protected

Thermal conductance between motor winding and housing : in Watt/C.

Definition at line 263 of file motor_heating_model.h.


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


ethercat_hardware
Author(s): Rob Wheeler , Derek King
autogenerated on Tue Mar 28 2023 02:10:20