iCub-main
|
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 |
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.
OnlineDCMotorEstimator::OnlineDCMotorEstimator | ( | ) |
Default constructor.
Definition at line 30 of file tuning.cpp.
Vector OnlineDCMotorEstimator::estimate | ( | const double | u, |
const double | y | ||
) |
Estimate the state vector given the current input and the current measurement.
u | Current input. |
y | Current measurement. |
Definition at line 84 of file tuning.cpp.
|
inline |
|
inline |
|
inline |
bool iCub::ctrl::OnlineDCMotorEstimator::init | ( | const double | P0, |
const yarp::sig::Vector & | x0 | ||
) |
Initialize the internal state.
P0 | Initial condition for estimated error covariance. |
x0 | A 4x1 vector containing respectively the initial conditions for position, velocity, \( \tau \) and \( K. \) |
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.
Ts | the estimator sample time given in seconds. |
Q | Process noise covariance. |
R | Measurement noise covariance. |
P0 | Initial condition for estimated error covariance. |
x0 | A 4x1 vector containing respectively the initial conditions for position, velocity, \( \tau \) and \( K. \) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |