iCub-main
Public Member Functions | Protected Attributes | List of all members
iCub::ctrl::OnlineDCMotorEstimator Class Reference

Online DC Motor Parameters Estimator. More...

#include <tuning.h>

Public Member Functions

 OnlineDCMotorEstimator ()
 Default constructor. More...
 
bool init (const double Ts, const double Q, const double R, const double P0, const yarp::sig::Vector &x0)
 Initialize the estimation. More...
 
bool init (const double P0, const yarp::sig::Vector &x0)
 Initialize the internal state. More...
 
yarp::sig::Vector estimate (const double u, const double y)
 Estimate the state vector given the current input and the current measurement. More...
 
yarp::sig::Vector get_x () const
 Return the estimated state. More...
 
yarp::sig::Matrix get_P () const
 Return the estimated error covariance. More...
 
yarp::sig::Vector get_parameters () const
 Return the system parameters. More...
 

Protected Attributes

yarp::sig::Matrix A
 
yarp::sig::Matrix F
 
yarp::sig::Vector B
 
yarp::sig::Matrix C
 
yarp::sig::Matrix Ct
 
yarp::sig::Matrix Q
 
yarp::sig::Matrix P
 
yarp::sig::Vector x
 
yarp::sig::Vector _x
 
double uOld
 
double Ts
 
double R
 

Detailed Description

Online DC Motor Parameters Estimator.

Estimate the gain \( K \) and the mechanical time constant \( \tau \) of the following DC motor second order transfer function with voltage \( V \) as input and angular position \( \theta \) as output:

\( \theta/V=K/\left(1+s\tau\right) \cdot 1/s. \)

The employed algorithm makes use of an online Extended Kalman Filter.

Definition at line 60 of file tuning.h.

Constructor & Destructor Documentation

◆ OnlineDCMotorEstimator()

OnlineDCMotorEstimator::OnlineDCMotorEstimator ( )

Default constructor.

Definition at line 30 of file tuning.cpp.

Member Function Documentation

◆ estimate()

Vector OnlineDCMotorEstimator::estimate ( const double  u,
const double  y 
)

Estimate the state vector given the current input and the current measurement.

Parameters
uCurrent input.
yCurrent measurement.
Returns
Estimated state vector composed of position, velocity, \( \tau \) and \( K. \)

Definition at line 84 of file tuning.cpp.

◆ get_P()

yarp::sig::Matrix iCub::ctrl::OnlineDCMotorEstimator::get_P ( ) const
inline

Return the estimated error covariance.

Returns
Estimated error covariance.

Definition at line 133 of file tuning.h.

◆ get_parameters()

yarp::sig::Vector iCub::ctrl::OnlineDCMotorEstimator::get_parameters ( ) const
inline

Return the system parameters.

Returns
vector containing \( \tau \) and \( K. \)

Definition at line 140 of file tuning.h.

◆ get_x()

yarp::sig::Vector iCub::ctrl::OnlineDCMotorEstimator::get_x ( ) const
inline

Return the estimated state.

Returns
Estimated state vector composed of position, velocity, \( \tau \) and \( K. \)

Definition at line 126 of file tuning.h.

◆ init() [1/2]

bool iCub::ctrl::OnlineDCMotorEstimator::init ( const double  P0,
const yarp::sig::Vector &  x0 
)

Initialize the internal state.

Parameters
P0Initial condition for estimated error covariance.
x0A 4x1 vector containing respectively the initial conditions for position, velocity, \( \tau \) and \( K. \)

◆ init() [2/2]

bool iCub::ctrl::OnlineDCMotorEstimator::init ( const double  Ts,
const double  Q,
const double  R,
const double  P0,
const yarp::sig::Vector &  x0 
)

Initialize the estimation.

Parameters
Tsthe estimator sample time given in seconds.
QProcess noise covariance.
RMeasurement noise covariance.
P0Initial condition for estimated error covariance.
x0A 4x1 vector containing respectively the initial conditions for position, velocity, \( \tau \) and \( K. \)
Returns
true/false on success/failure.

Member Data Documentation

◆ _x

yarp::sig::Vector iCub::ctrl::OnlineDCMotorEstimator::_x
protected

Definition at line 71 of file tuning.h.

◆ A

yarp::sig::Matrix iCub::ctrl::OnlineDCMotorEstimator::A
protected

Definition at line 63 of file tuning.h.

◆ B

yarp::sig::Vector iCub::ctrl::OnlineDCMotorEstimator::B
protected

Definition at line 65 of file tuning.h.

◆ C

yarp::sig::Matrix iCub::ctrl::OnlineDCMotorEstimator::C
protected

Definition at line 66 of file tuning.h.

◆ Ct

yarp::sig::Matrix iCub::ctrl::OnlineDCMotorEstimator::Ct
protected

Definition at line 67 of file tuning.h.

◆ F

yarp::sig::Matrix iCub::ctrl::OnlineDCMotorEstimator::F
protected

Definition at line 64 of file tuning.h.

◆ P

yarp::sig::Matrix iCub::ctrl::OnlineDCMotorEstimator::P
protected

Definition at line 69 of file tuning.h.

◆ Q

yarp::sig::Matrix iCub::ctrl::OnlineDCMotorEstimator::Q
protected

Definition at line 68 of file tuning.h.

◆ R

double iCub::ctrl::OnlineDCMotorEstimator::R
protected

Definition at line 74 of file tuning.h.

◆ Ts

double iCub::ctrl::OnlineDCMotorEstimator::Ts
protected

Definition at line 73 of file tuning.h.

◆ uOld

double iCub::ctrl::OnlineDCMotorEstimator::uOld
protected

Definition at line 72 of file tuning.h.

◆ x

yarp::sig::Vector iCub::ctrl::OnlineDCMotorEstimator::x
protected

Definition at line 70 of file tuning.h.


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