Class for simulating the controller in a distributed plant - sensor - controller - actuator setting with simulated network connection.
Public Member Functions |
void | calc (int seq) |
| Function to execute the computation of a control sequence.
|
void | implementControl (int seq) |
| Function to execute the implementation of a computed control sequence on the process connected via the simulated network connection.
|
void | initialize () |
| Function to initialize the controller.
|
yane::Model::Model * | model () |
| Function to return the used class yane::Model::Model object.
|
int | mpcCallCounter () |
| Function to return the number of execute MPC calculations.
|
std::vector< std::vector
< double > > | mpcCallStates () |
| Function to return the state vectore used as initial values for each MPC computation executed.
|
std::vector< double > | mpcCallTimes () |
| Function to return the time instances upon which an MPC computation was executed.
|
| MPCController (yane::Model::Model *model_controller, yane::MPC::ModelShootingData *shootingdata, int horizon, int prediction, yane::MinProg::NLP *minimizer, yane::MPC::OdeManager *odemanager, IOInterfaceLocal *iface, yane::Utils::DebugMaster *debugmaster=0, yane::Utils::StatisticsMaster *statisticsmaster=0, yane::NetworkedControl::T_DISTANCEFUNC distancefunction=0, double statedistanceTolerance=0.0) |
| Constructor.
|
void | setMaximalOpenLoopIterations (int maximalOpenLoopIterations) |
| Function to set the maximal number of allowed open loop iterations.
|
void | setMaxIter (int seqmax) |
| Function to set the maximal number of MPC iterations to be computed.
|
void | setSaveMPCCallData (bool saveMPCCallData) |
| Function to set the decision variable to save the computed MPC data.
|
virtual void | start () |
| Function to start the controller.
|
| ~MPCController () |
| Destructor.
|
Protected Member Functions |
void | actuatorInputToController (yane::Utils::DebugMaster *debugmaster, yane::Utils::DebugClient *debugclient, yane::Utils::StatisticsMaster *statisticsmaster) |
| Function to handle actuator input data and provide it to be used by the MPC controller.
|
void | computePrediction (double *state, int from_seq, int to_seq, double *timesteps) |
| Function to predict the state vector using the internally buffered control sequences.
|
void | controllerOutputToActuator (int seq, yane::Utils::DebugMaster *debugmaster, yane::Utils::DebugClient *debugclient, yane::Utils::StatisticsMaster *statisticsmaster) |
| Function to handle the output data of the MPC controller and provide it to be used by the actuator.
|
void | initializeModelHandler () |
| Funtion to initialize the implementation connected components of the networked MPC controller scheme.
|
void | initializeMPCController () |
| Function to initialize the computing connected components of the networked MPC controller scheme.
|
void | initializeMPCControllerInput () |
| Function to initialize the input connected components of the networked MPC controller scheme.
|
void | initializeMPCControllerOutput () |
| Function to initialize the output connected components of the networked MPC controller scheme.
|
void | predictInternalState (double *state, int from_seq, int to_seq) |
| Function to compute/predict the state vector to the sampling instant used by the MPC controller.
|
void | predictSensorValues (double *peekedx, int to_seq) |
| Function to compute/predict the state vector to the next sampling instant.
|
void | sensorInputToController (int seq, yane::Utils::DebugMaster *debugmaster, yane::Utils::DebugClient *debugclient, yane::Utils::StatisticsMaster *statisticsmaster) |
| Function to handle sensor input data and provide it to be used by the MPC controller.
|
void | setActuatorErrorVariables (int lastnonerrorcycle, int currentcycle) |
| Function to set the actuator error variables .
|
void | setControllerOutputPacket (int preseq, int seq, int horizon, double *u) |
| Function to set the output packet of the MPC controller.
|
void | setNewState (double t, double *state) |
| Function to set the internal state vector of the MPC controller.
|
Protected Attributes |
yane::NetworkedControl::T_ACTORPACKET | _actuatorpacket |
| Controller packet.
|
yane::NetworkedControl::ControlClipboard * | _cb |
| Pointer of the used control clipboard of class yane::NetworkedControl::ControlClipboard.
|
yane::NetworkedControl::T_OUTPUTPACKET | _controllerpacket |
| Sensor input packet.
|
double * | _controllerpacket_data |
| Pointer of the output packet to be sent from the controller to the actuator.
|
int | _controllerpacket_horizon |
| Length of the control sequence to be sent.
|
yane::Utils::DebugClient * | _debugclient |
| Pointer of the debug client of class yane::Utils::DebugClient.
|
yane::Utils::DebugMaster * | _debugmaster |
| Pointer of the class yane::Utils::DebugMaster object used for debugging.
|
yane::NetworkedControl::T_DISTANCEFUNC | _distancefunction |
| Acutator packet.
|
bool | _error_received |
| Distance function.
|
bool | _has_actorpacket |
| Decision variable whether an actuator packet has been received.
|
int | _horizon |
| Length of the control sequence to be computed.
|
double * | _inputx |
| Pointer of the internal state vector.
|
bool | _inputxchanged |
| Decision variable whether the internal state vector has been updated.
|
double | _inputxtime |
| Time of the last sensor measurement.
|
yane::NetworkedControl::IOInterfaceLocal * | _interface |
| Pointer of the used network interface of class yane::NetworkedControl::IOInterfaceLocal.
|
int | _last_sensor_seq |
| Sampling instant following the time of the latest sensor measurement.
|
int | _last_seq |
| Sampling instant of the latest MPC calculation.
|
int | _maximalOpenLoopIterations |
| Maximal number of allowed open loop iterations.
|
yane::MinProg::NLP * | _minimizer |
| Pointer of the used minimizer of class yane::MinProgl::NLP.
|
yane::Model::Model * | _model |
| Pointer of the class yane::Model::Model object used for optimization and simulation.
|
yane::MPC::MPC * | _mpc |
| Pointer of the used controller of class yane::MPC::MPC.
|
std::vector< std::vector
< double > > | _mpcCallStates |
| Array of the initial state connected to the sampling times upon which the MPC routine was executed.
|
std::vector< double > | _mpcCallTimes |
| Array of the sampling times upon which the MPC routine was executed.
|
yane::MPC::OdeManager * | _odemanager |
| Pointer of the used odemanager of class yane::MPC::OdeManager.
|
int | _prediction |
| Length of the prediction between current time and the first time instant the computed control shall be valid.
|
int | _preseq |
| Value of , the sampling instant of the last correct control sequence upon which the sent control sequence was computed.
|
double | _samplingTime |
| Sampling time.
|
bool | _saveMPCCallData |
| Decision variable to save the computed MPC data.
|
yane::NetworkedControl::T_INPUTPACKET | _sensorpacket |
| Pointer of the timer of class yane::Utils::RTClock.
|
double * | _sensorvalues |
| Pointer of the sensor state vector.
|
int | _seqmax |
| Maximal number of MPC iterations to be computed.
|
yane::MPC::ModelShootingData * | _shootingdata |
| Pointer of the used shooting data of class yane::MPC::ModelShootingData.
|
int | _sigma_cor |
| Value of , the sampling instant of the last correct control sequence.
|
int | _sigma_err |
| Value of , the sampling instant of the latest error within the scheme.
|
yane::Model::Simulator * | _simulator_controller |
| Pointer of the used simulator of class yane::Model::Simulator.
|
bool | _skipMPC |
| Decision variable whether an MPC step is skipped.
|
yane::Utils::StatisticsClientIntCounter * | _stat_actuator_received |
| Statistics collector for received actuator sequences.
|
yane::Utils::StatisticsClientIntCounter * | _stat_mpc_alreadycomputed |
| Statistics collector for already computed control sequences.
|
yane::Utils::StatisticsClientAverage * | _stat_mpc_calcduration |
| Statistics collector for average computing time.
|
yane::Utils::StatisticsClientIntCounter * | _stat_mpc_computedseq |
| Statistics collector for computed control sequences.
|
yane::Utils::StatisticsClientIntCounter * | _stat_mpc_invalidateseq |
| Statistics collector for invalidated control sequences.
|
yane::Utils::StatisticsClientIntCounter * | _stat_mpc_skipseq |
| Statistics collector for skipped control sequences.
|
yane::Utils::StatisticsClientIntCounter * | _stat_mpcoutput_sent |
| Statistics collector for sent control sequences.
|
yane::Utils::StatisticsClientIntCounter * | _stat_sensorinput_sent |
| Statistics collector for received sensor input sequences.
|
double | _stateDistanceTolerance |
| Maximal tolerance of the state deviation to skip the MPC control computation.
|
yane::Utils::StatisticsMaster * | _statisticsmaster |
| Pointer of the class yane::Utils::StatisticsMaster object used for producing statistics.
|
double * | _t |
| Pointer of the time grid.
|
double * | _trajectory |
| Pointer of the state trajectory.
|
double * | _u |
| Pointer of the control sequence.
|
double * | _x |
| Pointer of the state vector.
|