wbc
wbc::JointPosPDController Class Reference

The JointPosPDController class implements a PD Controller with feed forward on the base-Joints type. The following control schemes are available: More...

#include <JointPosPDController.hpp>

Inheritance diagram for wbc::JointPosPDController:
wbc::PosPDController

Public Member Functions

 JointPosPDController (const std::vector< std::string > &joint_names)
 
const base::commands::Joints & update (const base::commands::Joints &setpoint, const base::samples::Joints &feedback)
 
- Public Member Functions inherited from wbc::PosPDController
 PosPDController (size_t dim_controller)
 
void update ()
 
void setPGain (const base::VectorXd &gain)
 
const base::VectorXd & pGain ()
 
void setDGain (const base::VectorXd &gain)
 
const base::VectorXd & dGain ()
 
void setFFGain (const base::VectorXd &gain)
 
const base::VectorXd & ffGain ()
 
void setMaxCtrlOutput (const base::VectorXd &max_ctrl_out)
 
const base::VectorXd & maxCtrlOutput ()
 
void setDeadZone (const base::VectorXd &dz)
 
const base::VectorXd & deadZone ()
 
base::VectorXd getControlError ()
 
void applySaturation (const base::VectorXd &in, const base::VectorXd &max, base::VectorXd &out)
 Apply Saturation on the control output. If one or more values of <in> are bigger than the Corrresponding entry of <max>, all values will be scaled down according to the biggest ratio eta = in_i / max,i.
 
void applyDeadZone (const base::VectorXd &in, const base::VectorXd &min, base::VectorXd &out)
 Apply dead zone, i.e. minimum position control error. If one of the input value falls below minimum, it will be set to zero. Otherwise dead zone will be subtracted from the input value, to get a smooth transition:
 

Protected Member Functions

void extractFeedback (const base::samples::Joints &feedback)
 
void extractSetpoint (const base::commands::Joints &setpoint)
 

Protected Attributes

base::commands::Joints control_output
 
std::vector< std::string > joint_names
 
- Protected Attributes inherited from wbc::PosPDController
size_t dim_controller
 
base::VectorXd p_gain
 
base::VectorXd d_gain
 
base::VectorXd ff_gain
 
base::VectorXd dead_zone
 
base::VectorXd max_control_output
 
base::VectorXd ref_pos
 
base::VectorXd ref_vel
 
base::VectorXd ref_acc
 
base::VectorXd pos
 
base::VectorXd vel
 
base::VectorXd acc
 
base::VectorXd pos_diff
 
base::VectorXd vel_diff
 
base::VectorXd control_out_vel
 
base::VectorXd control_out_acc
 

Detailed Description

The JointPosPDController class implements a PD Controller with feed forward on the base-Joints type. The following control schemes are available:

  1. Velocity Output: \(\dot{\mathbf{q}}_d = \mathbf{K}_d\dot{\mathbf{q}}_r + \mathbf{K}_pe\)
  2. Acceleration Output: \(\ddot{\mathbf{q}}_d = \mathbf{K}_{ff}\ddot{\mathbf{e}} + \mathbf{K}_d\dot{\mathbf{e}} + \mathbf{K}_p\mathbf{e}\),

where \( \mathbf{e} = \mathbf{q}_r-\mathbf{q} \), \( \dot{\mathbf{e}} = \dot{\mathbf{q}}_r-\dot{\mathbf{q}} \) and \( \ddot{\mathbf{e}} = \ddot{\mathbf{q}}_r-\ddot{\mathbf{q}} \)

\( \mathbf{q},\mathbf{q}_r \) - Actual and reference joint position
\( \dot{\mathbf{q}},\dot{\mathbf{q}}_r \) - Actual and reference joint velocity
\( \ddot{\mathbf{q}},\ddot{\mathbf{q}}_r \) - Actual and reference joint acceleration
\( \mathbf{K}_d,\mathbf{K}_p \) - Derivative and proportial gain matrices
\( \mathbf{K}_{ff} \) - Feed forward gain matrix
\( \ddot{\mathbf{q}}_d,\dot{\mathbf{q}}_d \) - Control output, desired acceleration or velocity

Note: If an input is NaN, it might be ignored by the controller. E.g. if the reference or actual velocity is none, the velocity error will be set to zero in the controller

Constructor & Destructor Documentation

◆ JointPosPDController()

wbc::JointPosPDController::JointPosPDController ( const std::vector< std::string > & joint_names)

Member Function Documentation

◆ extractFeedback()

void wbc::JointPosPDController::extractFeedback ( const base::samples::Joints & feedback)
protected

◆ extractSetpoint()

void wbc::JointPosPDController::extractSetpoint ( const base::commands::Joints & setpoint)
protected

◆ update()

const base::commands::Joints & wbc::JointPosPDController::update ( const base::commands::Joints & setpoint,
const base::samples::Joints & feedback )

Convert typed to raw input data and call PosPDController::update()

Member Data Documentation

◆ control_output

base::commands::Joints wbc::JointPosPDController::control_output
protected

◆ joint_names

std::vector<std::string> wbc::JointPosPDController::joint_names
protected

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