- 3.0.2 core module.
|
A linear state feedback controller. More...
#include <StateFeedbackController.h>
Public Types | |
typedef DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR > | DiscreteBase |
typedef DiscreteBase::state_vector_t | state_vector_t |
typedef DiscreteBase::control_vector_t | control_vector_t |
typedef StateVectorArray< STATE_DIM, SCALAR > | state_vector_array_t |
typedef ControlVectorArray< CONTROL_DIM, SCALAR > | control_vector_array_t |
typedef FeedbackArray< STATE_DIM, CONTROL_DIM, SCALAR > | feedback_array_t |
Public Types inherited from ct::core::DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR > | |
typedef ControlVector< CONTROL_DIM, SCALAR > | control_vector_t |
Public Member Functions | |
StateFeedbackController () | |
default constructor More... | |
StateFeedbackController (const StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR > &other) | |
copy constructor More... | |
StateFeedbackController (const state_vector_array_t &x_ref, const control_vector_array_t &uff, const feedback_array_t &K, const SCALAR deltaT, const SCALAR t0=0.0, const InterpolationType &intType=ZOH) | |
constructor More... | |
virtual | ~StateFeedbackController () |
destructor More... | |
StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR > * | clone () const override |
deep cloning More... | |
virtual void | computeControl (const state_vector_t &state, const SCALAR &t, control_vector_t &controlAction) override |
computes the control action in the continuous case More... | |
virtual void | computeControl (const state_vector_t &state, const int n, control_vector_t &controlAction) override |
computes the control action in the discrete case More... | |
void | update (const DiscreteArray< state_vector_t > &x_ref, const DiscreteArray< control_vector_t > &uff, const DiscreteArray< FeedbackMatrix< STATE_DIM, CONTROL_DIM, SCALAR >> &K, const tpl::TimeArray< SCALAR > &t) |
updates the controller More... | |
const DiscreteArray< state_vector_t > & | x_ref () const |
get reference state vector array (without timings) More... | |
const DiscreteArray< control_vector_t > & | uff () const |
get feedforward array (without timings) More... | |
const DiscreteArray< FeedbackMatrix< STATE_DIM, CONTROL_DIM, SCALAR > > & | K () const |
get feedback array (without timings) More... | |
const tpl::TimeArray< SCALAR > & | time () const |
get time array More... | |
StateTrajectory< STATE_DIM, SCALAR > & | getReferenceStateTrajectory () |
get a reference to the feedforward trajectory More... | |
const StateTrajectory< STATE_DIM, SCALAR > & | getReferenceStateTrajectory () const |
get a reference to the feedforward trajectory More... | |
ControlTrajectory< CONTROL_DIM, SCALAR > & | getFeedforwardTrajectory () |
get a reference to the feedforward trajectory More... | |
const ControlTrajectory< CONTROL_DIM, SCALAR > & | getFeedforwardTrajectory () const |
get a reference to the feedforward trajectory More... | |
FeedbackTrajectory< STATE_DIM, CONTROL_DIM, SCALAR > & | getFeedbackTrajectory () |
get a reference to the feedback trajectory More... | |
const FeedbackTrajectory< STATE_DIM, CONTROL_DIM, SCALAR > & | getFeedbackTrajectory () const |
get a reference to the feedback trajectory More... | |
void | extractControlTrajectory (const StateTrajectory< STATE_DIM, SCALAR > &x_traj, ControlTrajectory< CONTROL_DIM, SCALAR > &u_traj) |
extracts a physically meaningful control trajectory from the given state-feedback law and a reference state trajectory More... | |
Public Member Functions inherited from ct::core::Controller< STATE_DIM, CONTROL_DIM, SCALAR > | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | Controller () |
Default constructor. More... | |
Controller (const Controller &other) | |
Copy constructor. More... | |
virtual | ~Controller () |
Destructor. More... | |
virtual void | computeControl (const StateVector< STATE_DIM, SCALAR > &state, const SCALAR &t, ControlVector< CONTROL_DIM, SCALAR > &controlAction)=0 |
Compute control signal. More... | |
virtual ControlMatrix< CONTROL_DIM, SCALAR > | getDerivativeU0 (const StateVector< STATE_DIM, SCALAR > &state, const SCALAR time) |
Returns the the derivative of the control with respect to the initial control input u0. More... | |
virtual ControlMatrix< CONTROL_DIM, SCALAR > | getDerivativeUf (const StateVector< STATE_DIM, SCALAR > &state, const SCALAR time) |
Returns the the derivative of the control with respect to the final control input uF. More... | |
Public Member Functions inherited from ct::core::DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR > | |
DiscreteController () | |
Default constructor. More... | |
DiscreteController (const DiscreteController &other) | |
Copy constructor. More... | |
virtual | ~DiscreteController () |
Destructor. More... | |
virtual void | computeControl (const state_vector_t &state, const int n, control_vector_t &controlAction)=0 |
Compute control signal. More... | |
Public Attributes | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef Controller< STATE_DIM, CONTROL_DIM, SCALAR > | ContinuousBase |
Public Attributes inherited from ct::core::DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR > | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef StateVector< STATE_DIM, SCALAR > | state_vector_t |
Protected Attributes | |
StateTrajectory< STATE_DIM, SCALAR > | x_ref_ |
ControlTrajectory< CONTROL_DIM, SCALAR > | uff_ |
state reference trajectory More... | |
FeedbackTrajectory< STATE_DIM, CONTROL_DIM, SCALAR > | K_ |
feedforward control trajectory More... | |
A linear state feedback controller.
A general, time-varying linear state feedback controller with feedforward action of type. It supports both continuous and discrete time.
or
where is a time varying feedforward and a time-varying linear feedback controller.
STATE_DIM | state vector size |
CONTROL_DIM | control vector size |
SCALAR | primitive type |
typedef DiscreteController<STATE_DIM, CONTROL_DIM, SCALAR> ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::DiscreteBase |
typedef DiscreteBase::state_vector_t ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::state_vector_t |
typedef DiscreteBase::control_vector_t ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::control_vector_t |
typedef StateVectorArray<STATE_DIM, SCALAR> ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::state_vector_array_t |
typedef ControlVectorArray<CONTROL_DIM, SCALAR> ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::control_vector_array_t |
typedef FeedbackArray<STATE_DIM, CONTROL_DIM, SCALAR> ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::feedback_array_t |
|
inline |
default constructor
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::K(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::uff(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::x_ref(), and ct::core::ZOH.
Referenced by ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::StateFeedbackController().
ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::StateFeedbackController | ( | const StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR > & | other | ) |
copy constructor
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::K(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::K_, ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::StateFeedbackController(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::uff(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::uff_, ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::x_ref(), and ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::x_ref_.
ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::StateFeedbackController | ( | const state_vector_array_t & | x_ref, |
const control_vector_array_t & | uff, | ||
const feedback_array_t & | K, | ||
const SCALAR | deltaT, | ||
const SCALAR | t0 = 0.0 , |
||
const InterpolationType & | intType = ZOH |
||
) |
constructor
Constructs a state feedback controller. The feedforward and feedback parts get interpolated where required.
Note: in the discrete setting, the initial time step is always assumed to be n=0
uff | feedforward controller. |
K | feedback controller. |
deltaT | discretization step |
t0 | initial time. |
intType | interpolation type |
|
inlinevirtual |
destructor
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::clone(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::computeControl(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::extractControlTrajectory(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::getFeedbackTrajectory(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::getFeedforwardTrajectory(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::getReferenceStateTrajectory(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::K(), n, t, ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::time(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::uff(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::update(), and ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::x_ref().
|
overridevirtual |
deep cloning
Implements ct::core::Controller< STATE_DIM, CONTROL_DIM, SCALAR >.
Referenced by ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::~StateFeedbackController().
|
overridevirtual |
computes the control action in the continuous case
evaluates the controller using interpolation where required using interpolation
state | current state |
t | current time |
controlAction | resulting control action |
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::K_, ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::uff_, and ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::x_ref_.
Referenced by ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::~StateFeedbackController().
|
overridevirtual |
computes the control action in the discrete case
Evaluate the given controller for a given state and time index returns the computed control action.
state | current state of the system |
n | current time index of the system |
controlAction | the corresponding control action |
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::K_, n, ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::uff_, and ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::x_ref_.
void ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::update | ( | const DiscreteArray< state_vector_t > & | x_ref, |
const DiscreteArray< control_vector_t > & | uff, | ||
const DiscreteArray< FeedbackMatrix< STATE_DIM, CONTROL_DIM, SCALAR >> & | K, | ||
const tpl::TimeArray< SCALAR > & | t | ||
) |
updates the controller
sets a new feedforward and feedback controller
uff | feedforward control action |
K | feedback controller |
times | discretization times |
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::K_, ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::uff_, and ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::x_ref_.
Referenced by ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::~StateFeedbackController().
const DiscreteArray< typename StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::state_vector_t > & ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::x_ref | ( | ) | const |
get reference state vector array (without timings)
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::x_ref_.
Referenced by ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::StateFeedbackController(), and ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::~StateFeedbackController().
const DiscreteArray< typename StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::control_vector_t > & ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::uff | ( | ) | const |
get feedforward array (without timings)
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::uff_.
Referenced by ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::StateFeedbackController(), and ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::~StateFeedbackController().
const DiscreteArray< FeedbackMatrix< STATE_DIM, CONTROL_DIM, SCALAR > > & ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::K | ( | ) | const |
get feedback array (without timings)
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::K_.
Referenced by ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::StateFeedbackController(), and ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::~StateFeedbackController().
const tpl::TimeArray< SCALAR > & ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::time | ( | ) | const |
get time array
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::x_ref_.
Referenced by ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::~StateFeedbackController().
StateTrajectory< STATE_DIM, SCALAR > & ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::getReferenceStateTrajectory | ( | ) |
get a reference to the feedforward trajectory
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::x_ref_.
Referenced by ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::~StateFeedbackController().
const StateTrajectory< STATE_DIM, SCALAR > & ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::getReferenceStateTrajectory | ( | ) | const |
get a reference to the feedforward trajectory
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::x_ref_.
ControlTrajectory< CONTROL_DIM, SCALAR > & ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::getFeedforwardTrajectory | ( | ) |
get a reference to the feedforward trajectory
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::uff_.
Referenced by ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::~StateFeedbackController().
const ControlTrajectory< CONTROL_DIM, SCALAR > & ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::getFeedforwardTrajectory | ( | ) | const |
get a reference to the feedforward trajectory
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::uff_.
FeedbackTrajectory< STATE_DIM, CONTROL_DIM, SCALAR > & ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::getFeedbackTrajectory | ( | ) |
get a reference to the feedback trajectory
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::K_.
Referenced by ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::~StateFeedbackController().
const FeedbackTrajectory< STATE_DIM, CONTROL_DIM, SCALAR > & ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::getFeedbackTrajectory | ( | ) | const |
get a reference to the feedback trajectory
References ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::K_.
void ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::extractControlTrajectory | ( | const StateTrajectory< STATE_DIM, SCALAR > & | x_traj, |
ControlTrajectory< CONTROL_DIM, SCALAR > & | u_traj | ||
) |
extracts a physically meaningful control trajectory from the given state-feedback law and a reference state trajectory
References ct::core::DiscreteTrajectoryBase< T, Alloc, SCALAR >::clear(), ct::core::DiscreteTrajectoryBase< T, Alloc, SCALAR >::getTimeFromIndex(), i, ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::K_, ct::core::DiscreteTrajectoryBase< T, Alloc, SCALAR >::push_back(), ct::core::DiscreteTrajectoryBase< T, Alloc, SCALAR >::size(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::uff_, and ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::x_ref_.
Referenced by ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::~StateFeedbackController().
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef Controller<STATE_DIM, CONTROL_DIM, SCALAR> ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::ContinuousBase |
|
protected |
Referenced by ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::computeControl(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::extractControlTrajectory(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::getReferenceStateTrajectory(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::StateFeedbackController(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::time(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::update(), and ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::x_ref().
|
protected |
state reference trajectory
Referenced by ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::computeControl(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::extractControlTrajectory(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::getFeedforwardTrajectory(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::StateFeedbackController(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::uff(), and ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::update().
|
protected |
feedforward control trajectory
Referenced by ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::computeControl(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::extractControlTrajectory(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::getFeedbackTrajectory(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::K(), ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::StateFeedbackController(), and ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR >::update().