Class LinearSMC#

Defined in Program listing for file control/src/Controller/LinearSMC.hpp

class LinearSMC : public CommonSMC#

Linear sliding mode controller.

This controller implements the following sliding mode control strategy:

\[\begin{split} \begin{equation} u = u_{\mathrm{eq}} + u_s\qquad\text{where}\begin{cases} u_{\mathrm{eq}} \text{is the equivalent control input}\\u_s = -sgn(\sigma)\end{cases},\end{equation} \end{split}\]

where \( \sigma = Cx \) is the user-defined sliding variable.

Subclassed by LinearSMCimproved

Public Functions

LinearSMC(SP::ControlSensor sensor, unsigned int type = LINEAR_SMC)#

Constructor for the ActuatorFactory.

Parameters:
  • sensor – the ControlSensor feeding the Actuator

  • type – do not set this yourself ! this is used in derived classes

LinearSMC(SP::ControlSensor sensor, SP::SimpleMatrix B, SP::SimpleMatrix D = std::shared_ptr<SimpleMatrix>(), unsigned int type = LINEAR_SMC)#

Constructor with all the data.

Parameters:
  • sensor – the ControlSensor feeding the Actuator

  • B – the matrix

  • D – the D matrix in the FirstOrderLinearR

  • type – do not set this yourself ! this is used in derived classes

virtual ~LinearSMC()#

destructor

virtual void actuate()#

Compute the new control law at each event Here we are using the following formula: \( u = u_{\mathrm{eq}} + u_s \).

inline void setDPtr(SP::SimpleMatrix D)#

Set the D matrix.

Parameters:

D – the new D matrix