Classes | Public Member Functions | Protected Attributes | List of all members
MotorModel Class Reference

#include <motor_model.h>

Inheritance diagram for MotorModel:
Inheritance graph
[legend]

Classes

class  Filter
 
class  SimpleFilter
 

Public Member Functions

void checkPublish ()
 Publishes motor trace if delay time is up. More...
 
void diagnostics (diagnostic_updater::DiagnosticStatusWrapper &d)
 Collects and publishes device diagnostics. More...
 
void flagPublish (const std::string &reason, int level, int delay)
 flags delayed publish of motor trace. More...
 
bool initialize (const ethercat_hardware::ActuatorInfo &actuator_info, const ethercat_hardware::BoardInfo &board_info)
 Initializes motor trace publisher. More...
 
 MotorModel (unsigned trace_size)
 
void reset ()
 
void sample (const ethercat_hardware::MotorTraceSample &s)
 Call for each update. More...
 
bool verify ()
 Check for errors between sample data and motor model. More...
 

Protected Attributes

Filter abs_board_voltage_
 
Filter abs_current_error_
 
Filter abs_measured_current_
 
Filter abs_measured_voltage_error_
 
Filter abs_motor_voltage_error_
 
Filter abs_position_delta_
 
Filter abs_velocity_
 
ethercat_hardware::ActuatorInfo actuator_info_
 
double backemf_constant_
 
ethercat_hardware::BoardInfo board_info_
 
Filter current_error_
 
double current_error_limit_
 
int diagnostics_level_
 
boost::mutex diagnostics_mutex_
 
std::string diagnostics_reason_
 
Filter measured_voltage_error_
 
SimpleFilter motor_resistance_
 
Filter motor_voltage_error_
 
bool previous_pwm_saturated_
 
int publish_delay_
 
int publish_level_
 
std::string publish_reason_
 
unsigned published_traces_
 
realtime_tools::RealtimePublisher< ethercat_hardware::MotorTrace > * publisher_
 
std::vector< ethercat_hardware::MotorTraceSample > trace_buffer_
 
unsigned trace_index_
 
unsigned trace_size_
 

Detailed Description

Definition at line 20 of file motor_model.h.

Constructor & Destructor Documentation

MotorModel::MotorModel ( unsigned  trace_size)

Definition at line 6 of file motor_model.cpp.

Member Function Documentation

void MotorModel::checkPublish ( )

Publishes motor trace if delay time is up.

Definition at line 87 of file motor_model.cpp.

void MotorModel::diagnostics ( diagnostic_updater::DiagnosticStatusWrapper d)

Collects and publishes device diagnostics.

Definition at line 143 of file motor_model.cpp.

void MotorModel::flagPublish ( const std::string &  reason,
int  level,
int  delay 
)

flags delayed publish of motor trace.

New publish will only take precedence of previous publish iff level is higher than previous level

Definition at line 125 of file motor_model.cpp.

bool MotorModel::initialize ( const ethercat_hardware::ActuatorInfo &  actuator_info,
const ethercat_hardware::BoardInfo &  board_info 
)

Initializes motor trace publisher.

Definition at line 53 of file motor_model.cpp.

void MotorModel::reset ( )

Definition at line 27 of file motor_model.cpp.

void MotorModel::sample ( const ethercat_hardware::MotorTraceSample &  s)

Call for each update.

Adds sample to motor model. Also, adds sample to motor trace.

Definition at line 198 of file motor_model.cpp.

bool MotorModel::verify ( )

Check for errors between sample data and motor model.

Parameters
reasonstring is filled in when error or warning occurs
levelfilled in with 2 (ERROR) or 1 (WARN).
Returns
returns false if motor should halt

Definition at line 313 of file motor_model.cpp.

Member Data Documentation

Filter MotorModel::abs_board_voltage_
protected

Definition at line 89 of file motor_model.h.

Filter MotorModel::abs_current_error_
protected

Definition at line 83 of file motor_model.h.

Filter MotorModel::abs_measured_current_
protected

Definition at line 88 of file motor_model.h.

Filter MotorModel::abs_measured_voltage_error_
protected

Definition at line 81 of file motor_model.h.

Filter MotorModel::abs_motor_voltage_error_
protected

Definition at line 79 of file motor_model.h.

Filter MotorModel::abs_position_delta_
protected

Definition at line 90 of file motor_model.h.

Filter MotorModel::abs_velocity_
protected

Definition at line 87 of file motor_model.h.

ethercat_hardware::ActuatorInfo MotorModel::actuator_info_
protected

Definition at line 36 of file motor_model.h.

double MotorModel::backemf_constant_
protected

Definition at line 38 of file motor_model.h.

ethercat_hardware::BoardInfo MotorModel::board_info_
protected

Definition at line 37 of file motor_model.h.

Filter MotorModel::current_error_
protected

Definition at line 82 of file motor_model.h.

double MotorModel::current_error_limit_
protected

Definition at line 42 of file motor_model.h.

int MotorModel::diagnostics_level_
protected

Definition at line 48 of file motor_model.h.

boost::mutex MotorModel::diagnostics_mutex_
protected

Definition at line 77 of file motor_model.h.

std::string MotorModel::diagnostics_reason_
protected

Definition at line 49 of file motor_model.h.

Filter MotorModel::measured_voltage_error_
protected

Definition at line 80 of file motor_model.h.

SimpleFilter MotorModel::motor_resistance_
protected

Definition at line 84 of file motor_model.h.

Filter MotorModel::motor_voltage_error_
protected

Definition at line 78 of file motor_model.h.

bool MotorModel::previous_pwm_saturated_
protected

Definition at line 39 of file motor_model.h.

int MotorModel::publish_delay_
protected

Definition at line 43 of file motor_model.h.

int MotorModel::publish_level_
protected

Definition at line 44 of file motor_model.h.

std::string MotorModel::publish_reason_
protected

Definition at line 45 of file motor_model.h.

unsigned MotorModel::published_traces_
protected

Definition at line 35 of file motor_model.h.

realtime_tools::RealtimePublisher<ethercat_hardware::MotorTrace>* MotorModel::publisher_
protected

Definition at line 41 of file motor_model.h.

std::vector<ethercat_hardware::MotorTraceSample> MotorModel::trace_buffer_
protected

Definition at line 40 of file motor_model.h.

unsigned MotorModel::trace_index_
protected

Definition at line 34 of file motor_model.h.

unsigned MotorModel::trace_size_
protected

Definition at line 33 of file motor_model.h.


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


ethercat_hardware
Author(s): Rob Wheeler , Derek King
autogenerated on Thu Mar 4 2021 03:10:21