Single-gain proportional controller: output = K * (reference - u) + c.
More...
#include <Proportional_controller.h>
|
| | ProportionalController (const std::string &symbol, const vector< double > &value, int number_signals, std::vector< double > refs={ 0 }) |
| | Construct a P controller.
|
| |
| virtual Eigen::VectorXd | define_equations (const Eigen::VectorXd &x, const Eigen::VectorXd &u, const Eigen::VectorXd &c) override |
| | Vector P-controller dynamics.
|
| |
| virtual Eigen::VectorXd | define_equations (const double x, const double u, const double c) override |
| | Scalar P-controller dynamics.
|
| |
| virtual void | printValues () override |
| | Print controller type, gain K, and reference values.
|
| |
| double | getK () const |
| | Return the proportional gain K.
|
| |
| void | setK (double newK) |
| | Set the proportional gain K.
|
| |
| virtual vector< double > | getParameters () const override |
| | Return { K }.
|
| |
| virtual void | setParameters (const vector< double > ¶ms) override |
| | Set K from a single-element parameter vector.
|
| |
| | Controller (const std::string &symbol, const vector< double > &value, int number_signals, std::vector< double > refs={ 0 }) |
| | Construct a controller with reference setpoints.
|
| |
| void | setReference (const std::vector< double > &ref) |
| | Replace all reference setpoints.
|
| |
| void | setReference (const double ref, int i) |
| | Set one reference channel.
|
| |
| std::vector< double > | getReference () const |
| | Return a copy of the current reference vector.
|
| |
| std::string | getControllerSymbol () const |
| | Return the controller symbol/name.
|
| |
| int | getNumberOfSignals () const |
| | Return the number of control channels.
|
| |
| virtual | ~Controller ()=default |
| |
Single-gain proportional controller: output = K * (reference - u) + c.
◆ ProportionalController()
| ProportionalController::ProportionalController |
( |
const std::string & |
symbol, |
|
|
const vector< double > & |
value, |
|
|
int |
number_signals, |
|
|
std::vector< double > |
refs = { 0 } |
|
) |
| |
|
inline |
Construct a P controller.
- Parameters
-
| symbol | Controller symbol/name. |
| value | Gain vector containing Kp (exactly one element). |
| number_signals | Number of control channels. |
| refs | Reference values per channel (default zero). |
◆ define_equations() [1/2]
| Eigen::VectorXd ProportionalController::define_equations |
( |
const double |
x, |
|
|
const double |
u, |
|
|
const double |
c |
|
) |
| |
|
overridevirtual |
Scalar P-controller dynamics.
Defines the equations for a scalar P controller.
- Parameters
-
| x | Integrator state (unused for pure P). |
| u | Measured input value. |
| c | Feed-forward output value. |
- Returns
- Vector containing error state and controller output.
This function computes the error between the reference and input. The returned vector contains the state derivative and controller output.
- Parameters
-
| x | Integrator state (scalar). |
| u | Input (measured) value. Not used in proportional controller. |
| c | Constant/reference output signal. |
- Returns
- Eigen::VectorXd Vector containing states and controller output.
Reimplemented from Controller.
References Controller::reference.
◆ define_equations() [2/2]
| Eigen::VectorXd ProportionalController::define_equations |
( |
const Eigen::VectorXd & |
x, |
|
|
const Eigen::VectorXd & |
u, |
|
|
const Eigen::VectorXd & |
c |
|
) |
| |
|
overridevirtual |
Vector P-controller dynamics.
Defines the equations for a vector P controller.
- Parameters
-
| x | Integrator state vector (unused for pure P). |
| u | Measured input vector. |
| c | Feed-forward output vector. |
- Returns
- Concatenated error states and controller outputs.
This function computes the error between the reference and input. The returned vector concatenates the states and controller outputs.
- Parameters
-
| x | Input state vector. |
| u | Input (measured) vector. Left empty for proportional controller. |
| c | Constant/reference output signal vector. |
- Returns
- Eigen::VectorXd Concatenated vector of states and controller outputs.
Reimplemented from Controller.
References Controller::reference.
◆ getK()
| double ProportionalController::getK |
( |
| ) |
const |
|
inline |
Return the proportional gain K.
◆ getParameters()
| virtual vector< double > ProportionalController::getParameters |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ printValues()
| virtual void ProportionalController::printValues |
( |
| ) |
|
|
inlineoverridevirtual |
◆ setK()
| void ProportionalController::setK |
( |
double |
newK | ) |
|
|
inline |
Set the proportional gain K.
- Parameters
-
◆ setParameters()
| virtual void ProportionalController::setParameters |
( |
const vector< double > & |
params | ) |
|
|
inlineoverridevirtual |
Set K from a single-element parameter vector.
- Parameters
-
Reimplemented from Controller.
The documentation for this class was generated from the following files: