File control/src/Controller/LinearSMCimproved.hpp

Go to the source code of this file

General interface to define an actuator.

Typedefs

typedef std11::shared_ptr<boost::circular_buffer<SP::SiconosVector>> BufferOfVectors
class LinearSMCimproved : public LinearSMC

Public Functions

LinearSMCimproved(SP::ControlSensor sensor)

Constructor.

Parameters

LinearSMCimproved(SP::ControlSensor sensor, SP::SimpleMatrix B, SP::SimpleMatrix D = std11::shared_ptr<SimpleMatrix>())

Constructor with all the data.

Parameters
  • sensor: the ControlSensor feeding the Actuator
  • B: the B matrix in the FirstOrderLinearR
  • D: the D matrix in the FirstOrderLinearR

virtual ~LinearSMCimproved()

destructor

virtual void actuate()

Compute the new control law at each event Here we are using the following formula: TODO.

virtual void initialize(const NonSmoothDynamicalSystem &nsds, const Simulation &s)

Initialize Controller.

Parameters
  • nsds: current nonsmooth dynamical system
  • s: current simulation setup

void setPerturbationPrediction(double ub = std::numeric_limits<double>::quiet_NaN())

Enable perturbation prediction.

void setPredictionOrder(unsigned int order)

Set the order of the prediction.

  • 0 -> the predicted value is the same as the one we measured
  • 1 -> \(\widetilde{Cp_{k+1}} = 2Cp_k - Cp_{k-1}\)
  • 2 -> \(\widetilde{Cp_{k+1}} = 3Cp_k - 3Cp_{k-1} + Cp_{k-2}\)
    Parameters
    • order: the order of the prediction

const SiconosVector &up() const

Get the control input _up, acting against matched perturbations.

Return
a reference to _up

Protected Functions

void predictionPerturbation(const SiconosVector &xTk, SimpleMatrix &CBstar)

Predict the effect of the perturnation during the next timestep.

Parameters
  • xTk: available state at the current time instant
  • CBstar: matrix \(CB^{*}\)

Protected Attributes

bool _inDisceteTimeSlidingPhase

boolean to determine if we are in the discrete-time sliding phase

BufferOfVectors _measuredPert

Vector to store previous values of the perturbation.

BufferOfVectors _predictedPert

Vector of predicted values for the perturbation.

bool _predictionPerturbation

try to predict the perturbation

double _ubPerturbation

Upper bound on the norm2 of the perturbation.

SP::SiconosVector _up

Control input to counteract the effect of the perturbation.

Private Functions

LinearSMCimproved()

default constructor

ACCEPT_SERIALIZATION(LinearSMCimproved)

serialization hooks