Loading [MathJax]/extensions/tex2jax.js
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>

Public Member Functions

 JointPosPDController (uint dim)
 
const Eigen::VectorXd & update (const Eigen::VectorXd &ref_pos, const Eigen::VectorXd &ref_vel, const Eigen::VectorXd &pos)
 Compute velocity level control output.
 
const Eigen::VectorXd & update (const Eigen::VectorXd &ref_pos, const Eigen::VectorXd &ref_vel, const Eigen::VectorXd &ref_acc, const Eigen::VectorXd &pos, const Eigen::VectorXd &vel)
 Compute acceleration level control output.
 
void setPGain (const Eigen::VectorXd &gain)
 
const Eigen::VectorXd & pGain ()
 
void setDGain (const Eigen::VectorXd &gain)
 
const Eigen::VectorXd & dGain ()
 
void setMaxCtrlOutput (const Eigen::VectorXd &max_ctrl_out)
 
const Eigen::VectorXd & maxCtrlOutput ()
 
void applySaturation (const Eigen::VectorXd &in, const Eigen::VectorXd &max, Eigen::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.
 

Protected Attributes

uint dim_controller
 
Eigen::VectorXd p_gain
 
Eigen::VectorXd d_gain
 
Eigen::VectorXd u_max
 
Eigen::VectorXd u
 

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 ( uint dim)

Member Function Documentation

◆ applySaturation()

void wbc::JointPosPDController::applySaturation ( const Eigen::VectorXd & in,
const Eigen::VectorXd & max,
Eigen::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.

Parameters
inInput vector. Size has to be same as max.
maxMaximum allowed value for input vector. Size has to be same as in.
outOutput vector. Will be resized if out.size() != in.size()

◆ dGain()

const Eigen::VectorXd & wbc::JointPosPDController::dGain ( )
inline

Get derivative/velocity gain

◆ maxCtrlOutput()

const Eigen::VectorXd & wbc::JointPosPDController::maxCtrlOutput ( )
inline

Get controller saturation

◆ pGain()

const Eigen::VectorXd & wbc::JointPosPDController::pGain ( )
inline

Get proportional/position gain

◆ setDGain()

void wbc::JointPosPDController::setDGain ( const Eigen::VectorXd & gain)

Set derivative/velocity gain. Size has to be the same dimension of the controller

◆ setMaxCtrlOutput()

void wbc::JointPosPDController::setMaxCtrlOutput ( const Eigen::VectorXd & max_ctrl_out)

Set controller saturation. Size has to be the same dimension of the controller

◆ setPGain()

void wbc::JointPosPDController::setPGain ( const Eigen::VectorXd & gain)

Set proportional/position gain. Size has to be the same dimension of the controller

◆ update() [1/2]

const Eigen::VectorXd & wbc::JointPosPDController::update ( const Eigen::VectorXd & ref_pos,
const Eigen::VectorXd & ref_vel,
const Eigen::VectorXd & pos )

Compute velocity level control output.

◆ update() [2/2]

const Eigen::VectorXd & wbc::JointPosPDController::update ( const Eigen::VectorXd & ref_pos,
const Eigen::VectorXd & ref_vel,
const Eigen::VectorXd & ref_acc,
const Eigen::VectorXd & pos,
const Eigen::VectorXd & vel )

Compute acceleration level control output.

Member Data Documentation

◆ d_gain

Eigen::VectorXd wbc::JointPosPDController::d_gain
protected

◆ dim_controller

uint wbc::JointPosPDController::dim_controller
protected

◆ p_gain

Eigen::VectorXd wbc::JointPosPDController::p_gain
protected

◆ u

Eigen::VectorXd wbc::JointPosPDController::u
protected

◆ u_max

Eigen::VectorXd wbc::JointPosPDController::u_max
protected

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