sot-torque-control  1.5.3
Collection of dynamic-graph entities aimed at implementing torque control on different robots.
CurrentController Class Reference

#include <sot/torque_control/current-controller.hh>

Inheritance diagram for CurrentController:
Collaboration diagram for CurrentController:

Public Member Functions

 CurrentController (const std::string &name)
 
 DECLARE_SIGNAL_IN (bemf_factor, dynamicgraph::Vector)
 Joint velocities; used to compensate for BEMF effect on low level current loop. More...
 
 DECLARE_SIGNAL_IN (dead_zone_offsets, dynamicgraph::Vector)
 
 DECLARE_SIGNAL_IN (dq, dynamicgraph::Vector)
 gain from input to output control values More...
 
 DECLARE_SIGNAL_IN (i_des, dynamicgraph::Vector)
 
 DECLARE_SIGNAL_IN (i_max, dynamicgraph::Vector)
 proportional current feedback gain More...
 
 DECLARE_SIGNAL_IN (i_max_dead_zone_compensation, dynamicgraph::Vector)
 
 DECLARE_SIGNAL_IN (i_measured, dynamicgraph::Vector)
 desired motor currents More...
 
 DECLARE_SIGNAL_IN (i_sens_gains, dynamicgraph::Vector)
 motor currents More...
 
 DECLARE_SIGNAL_IN (i_sensor_offsets_low_level, dynamicgraph::Vector)
 value of current tracking error at which deadzone is completely compensated More...
 
 DECLARE_SIGNAL_IN (i_sensor_offsets_real_in, dynamicgraph::Vector)
 offset of the current sensors seen by the low level More...
 
 DECLARE_SIGNAL_IN (in_out_gain, dynamicgraph::Vector)
 values at which to saturate the control (in bits) More...
 
 DECLARE_SIGNAL_IN (ki_current, dynamicgraph::Vector)
 proportional current feedback gain More...
 
 DECLARE_SIGNAL_IN (kp_current, dynamicgraph::Vector)
 gains of current sensors More...
 
 DECLARE_SIGNAL_IN (percentage_bemf_compensation, dynamicgraph::Vector)
 
 DECLARE_SIGNAL_IN (percentage_dead_zone_compensation, dynamicgraph::Vector)
 current control dead zone offsets More...
 
 DECLARE_SIGNAL_IN (u_max, dynamicgraph::Vector)
 max current allowed before stopping the controller (in Ampers) More...
 
 DECLARE_SIGNAL_IN (u_saturation, dynamicgraph::Vector)
 max desired current allowed before stopping the controller (in Ampers) More...
 
 DECLARE_SIGNAL_OUT (dead_zone_compensation, dynamicgraph::Vector)
 real offset of the current sensors More...
 
 DECLARE_SIGNAL_OUT (i_errors, dynamicgraph::Vector)
 dead-zone compensation current applied by the controller More...
 
 DECLARE_SIGNAL_OUT (i_errors_ll_wo_bemf, dynamicgraph::Vector)
 current tracking error More...
 
 DECLARE_SIGNAL_OUT (i_low_level, dynamicgraph::Vector)
 current measurements after gain and offset compensation More...
 
 DECLARE_SIGNAL_OUT (i_real, dynamicgraph::Vector)
 same as u when everything is fine, 0 otherwise More...
 
 DECLARE_SIGNAL_OUT (i_sensor_offsets_real_out, dynamicgraph::Vector)
 current measurements as seen by low-level ctrl More...
 
 DECLARE_SIGNAL_OUT (u, dynamicgraph::Vector)
 real offset of the current sensors More...
 
 DECLARE_SIGNAL_OUT (u_safe, dynamicgraph::Vector)
 
virtual void display (std::ostream &os) const
 
void init (const double &dt, const std::string &robotRef, const unsigned int &currentOffsetIters)
 
void reset_integral ()
 current tracking error without BEMF effect More...
 
void sendMsg (const std::string &msg, MsgType t=MSG_TYPE_INFO, const char *="", int=0)
 

Protected Attributes

dynamicgraph::Vector m_avg_i_err_neg
 
dynamicgraph::Vector m_avg_i_err_pos
 
unsigned int m_currentOffsetIters
 time to sleep at every iteration (to slow down simulation) More...
 
double m_dt
 
dynamicgraph::Vector m_dz_coeff
 
bool m_emergency_stop_triggered
 true if the entity has been successfully initialized More...
 
dynamicgraph::Vector m_i_err_integr
 
dynamicgraph::Vector m_i_offsets_real
 
bool m_initSucceeded
 
bool m_is_first_iter
 control loop time period More...
 
int m_iter
 true at the first iteration, false otherwise More...
 
RobotUtilShrPtr m_robot_util
 
double m_sleep_time
 

Detailed Description

Definition at line 47 of file current-controller.hh.

Constructor & Destructor Documentation

◆ CurrentController()

CurrentController ( const std::string &  name)

Definition at line 44 of file current-controller.cpp.

Member Function Documentation

◆ DECLARE_SIGNAL_IN() [1/17]

DECLARE_SIGNAL_IN ( bemf_factor  ,
dynamicgraph::Vector   
)

Joint velocities; used to compensate for BEMF effect on low level current loop.

◆ DECLARE_SIGNAL_IN() [2/17]

DECLARE_SIGNAL_IN ( dead_zone_offsets  ,
dynamicgraph::Vector   
)

percentage in [0;1] of the motor back-EMF that we should compensate 0 is none, 1 is all of it

◆ DECLARE_SIGNAL_IN() [3/17]

DECLARE_SIGNAL_IN ( dq  ,
dynamicgraph::Vector   
)

gain from input to output control values

◆ DECLARE_SIGNAL_IN() [4/17]

DECLARE_SIGNAL_IN ( i_des  ,
dynamicgraph::Vector   
)

◆ DECLARE_SIGNAL_IN() [5/17]

DECLARE_SIGNAL_IN ( i_max  ,
dynamicgraph::Vector   
)

proportional current feedback gain

◆ DECLARE_SIGNAL_IN() [6/17]

DECLARE_SIGNAL_IN ( i_max_dead_zone_compensation  ,
dynamicgraph::Vector   
)

percentage in [0;1] of the motor driver dead zone that we should compensate 0 is none, 1 is all of it

◆ DECLARE_SIGNAL_IN() [7/17]

DECLARE_SIGNAL_IN ( i_measured  ,
dynamicgraph::Vector   
)

desired motor currents

◆ DECLARE_SIGNAL_IN() [8/17]

DECLARE_SIGNAL_IN ( i_sens_gains  ,
dynamicgraph::Vector   
)

motor currents

◆ DECLARE_SIGNAL_IN() [9/17]

DECLARE_SIGNAL_IN ( i_sensor_offsets_low_level  ,
dynamicgraph::Vector   
)

value of current tracking error at which deadzone is completely compensated

◆ DECLARE_SIGNAL_IN() [10/17]

DECLARE_SIGNAL_IN ( i_sensor_offsets_real_in  ,
dynamicgraph::Vector   
)

offset of the current sensors seen by the low level

◆ DECLARE_SIGNAL_IN() [11/17]

DECLARE_SIGNAL_IN ( in_out_gain  ,
dynamicgraph::Vector   
)

values at which to saturate the control (in bits)

◆ DECLARE_SIGNAL_IN() [12/17]

DECLARE_SIGNAL_IN ( ki_current  ,
dynamicgraph::Vector   
)

proportional current feedback gain

◆ DECLARE_SIGNAL_IN() [13/17]

DECLARE_SIGNAL_IN ( kp_current  ,
dynamicgraph::Vector   
)

gains of current sensors

◆ DECLARE_SIGNAL_IN() [14/17]

DECLARE_SIGNAL_IN ( percentage_bemf_compensation  ,
dynamicgraph::Vector   
)

Link between velocity and current; to compensate for BEMF effect on low level current loop (in A/rad.s-1)

◆ DECLARE_SIGNAL_IN() [15/17]

DECLARE_SIGNAL_IN ( percentage_dead_zone_compensation  ,
dynamicgraph::Vector   
)

current control dead zone offsets

◆ DECLARE_SIGNAL_IN() [16/17]

DECLARE_SIGNAL_IN ( u_max  ,
dynamicgraph::Vector   
)

max current allowed before stopping the controller (in Ampers)

◆ DECLARE_SIGNAL_IN() [17/17]

DECLARE_SIGNAL_IN ( u_saturation  ,
dynamicgraph::Vector   
)

max desired current allowed before stopping the controller (in Ampers)

◆ DECLARE_SIGNAL_OUT() [1/8]

DECLARE_SIGNAL_OUT ( dead_zone_compensation  ,
dynamicgraph::Vector   
)

real offset of the current sensors

◆ DECLARE_SIGNAL_OUT() [2/8]

DECLARE_SIGNAL_OUT ( i_errors  ,
dynamicgraph::Vector   
)

dead-zone compensation current applied by the controller

◆ DECLARE_SIGNAL_OUT() [3/8]

DECLARE_SIGNAL_OUT ( i_errors_ll_wo_bemf  ,
dynamicgraph::Vector   
)

current tracking error

◆ DECLARE_SIGNAL_OUT() [4/8]

DECLARE_SIGNAL_OUT ( i_low_level  ,
dynamicgraph::Vector   
)

current measurements after gain and offset compensation

◆ DECLARE_SIGNAL_OUT() [5/8]

DECLARE_SIGNAL_OUT ( i_real  ,
dynamicgraph::Vector   
)

same as u when everything is fine, 0 otherwise

◆ DECLARE_SIGNAL_OUT() [6/8]

DECLARE_SIGNAL_OUT ( i_sensor_offsets_real_out  ,
dynamicgraph::Vector   
)

current measurements as seen by low-level ctrl

◆ DECLARE_SIGNAL_OUT() [7/8]

DECLARE_SIGNAL_OUT ( ,
dynamicgraph::Vector   
)

real offset of the current sensors

◆ DECLARE_SIGNAL_OUT() [8/8]

DECLARE_SIGNAL_OUT ( u_safe  ,
dynamicgraph::Vector   
)

◆ display()

void display ( std::ostream &  os) const
virtual

Definition at line 337 of file current-controller.cpp.

◆ init()

void init ( const double &  dt,
const std::string &  robotRef,
const unsigned int &  currentOffsetIters 
)

Initialize

Parameters
dtcontrol interval
currentOffsetItersnumber of iterations while control is disabled to calibrate current sensors. The recommended way is to use the signal max_current.

Definition at line 96 of file current-controller.cpp.

◆ reset_integral()

void reset_integral ( )

current tracking error without BEMF effect

Definition at line 331 of file current-controller.cpp.

◆ sendMsg()

void sendMsg ( const std::string &  msg,
MsgType  t = MSG_TYPE_INFO,
const char *  = "",
int  = 0 
)
inline

Definition at line 109 of file current-controller.hh.

Member Data Documentation

◆ m_avg_i_err_neg

dynamicgraph::Vector m_avg_i_err_neg
protected

Definition at line 129 of file current-controller.hh.

◆ m_avg_i_err_pos

dynamicgraph::Vector m_avg_i_err_pos
protected

Definition at line 128 of file current-controller.hh.

◆ m_currentOffsetIters

unsigned int m_currentOffsetIters
protected

time to sleep at every iteration (to slow down simulation)

Definition at line 122 of file current-controller.hh.

◆ m_dt

double m_dt
protected

Definition at line 117 of file current-controller.hh.

◆ m_dz_coeff

dynamicgraph::Vector m_dz_coeff
protected

Definition at line 126 of file current-controller.hh.

◆ m_emergency_stop_triggered

bool m_emergency_stop_triggered
protected

true if the entity has been successfully initialized

Definition at line 116 of file current-controller.hh.

◆ m_i_err_integr

dynamicgraph::Vector m_i_err_integr
protected

Definition at line 124 of file current-controller.hh.

◆ m_i_offsets_real

dynamicgraph::Vector m_i_offsets_real
protected

Definition at line 123 of file current-controller.hh.

◆ m_initSucceeded

bool m_initSucceeded
protected

Definition at line 115 of file current-controller.hh.

◆ m_is_first_iter

bool m_is_first_iter
protected

control loop time period

Definition at line 118 of file current-controller.hh.

◆ m_iter

int m_iter
protected

true at the first iteration, false otherwise

Definition at line 119 of file current-controller.hh.

◆ m_robot_util

RobotUtilShrPtr m_robot_util
protected

Definition at line 114 of file current-controller.hh.

◆ m_sleep_time

double m_sleep_time
protected

Definition at line 120 of file current-controller.hh.


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