|
libstp
Robotics library for Botball
|
Plant system identification via DE. Port of ControlPathParamEstimation.ts. More...
#include <control_path_param_estimation.hpp>
Public Types | |
| using | MeasPoint = std::pair<double, double> |
Public Member Functions | |
| ControlPathParamEstimation (ControlPath &controlPath, const std::vector< MeasPoint > &measData) | |
| std::vector< double > | optimize (double limitMinParams, double limitMaxParams, bool dither, int maxNumSteps, double stepHeight, double stepTime, std::uint32_t seed=0xC0FFEEu) |
| Run DE to fit the control path to the measured data. | |
| double | rateCandidate (const std::vector< double > ¶mList) override |
| DE cost callback: squared error of the simulated vs. measured response. | |
| double | dt () const |
| Mean sample time derived from the measurement timestamps. | |
| void | setStep (double stepHeight, double stepTime) |
| Public Member Functions inherited from libstp::autotune::control::IDifferentialEvolutionRating | |
| virtual | ~IDifferentialEvolutionRating ()=default |
Plant system identification via DE. Port of ControlPathParamEstimation.ts.
Given measured step-response data (time, value) pairs, finds the control-path parameters that minimise the squared error between the simulated and measured output. The sample time dt is derived as the mean spacing of the measurement timestamps, exactly as in the TypeScript.
Implements IDifferentialEvolutionRating so the DE optimizer can rate candidate parameter vectors.
Definition at line 24 of file control_path_param_estimation.hpp.
| using libstp::autotune::control::ControlPathParamEstimation::MeasPoint = std::pair<double, double> |
Definition at line 27 of file control_path_param_estimation.hpp.
| libstp::autotune::control::ControlPathParamEstimation::ControlPathParamEstimation | ( | ControlPath & | controlPath, |
| const std::vector< MeasPoint > & | measData ) |
|
inlinenodiscard |
Mean sample time derived from the measurement timestamps.
Definition at line 48 of file control_path_param_estimation.hpp.
| std::vector< double > libstp::autotune::control::ControlPathParamEstimation::optimize | ( | double | limitMinParams, |
| double | limitMaxParams, | ||
| bool | dither, | ||
| int | maxNumSteps, | ||
| double | stepHeight, | ||
| double | stepTime, | ||
| std::uint32_t | seed = 0xC0FFEEu ) |
Run DE to fit the control path to the measured data.
|
overridevirtual |
DE cost callback: squared error of the simulated vs. measured response.
Implements libstp::autotune::control::IDifferentialEvolutionRating.
|
inline |
Set the step parameters that rateCandidate() uses (normally set by optimize()). Exposed for direct cost-function testing.
Definition at line 52 of file control_path_param_estimation.hpp.