libstp
Robotics library for Botball
Loading...
Searching...
No Matches
libstp::autotune::control::ControlPathParamEstimation Class Referencefinal

Plant system identification via DE. Port of ControlPathParamEstimation.ts. More...

#include <control_path_param_estimation.hpp>

Inheritance diagram for libstp::autotune::control::ControlPathParamEstimation:
[legend]
Collaboration diagram for libstp::autotune::control::ControlPathParamEstimation:
[legend]

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 > &paramList) 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

Detailed Description

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.

Member Typedef Documentation

◆ MeasPoint

Definition at line 27 of file control_path_param_estimation.hpp.

Constructor & Destructor Documentation

◆ ControlPathParamEstimation()

libstp::autotune::control::ControlPathParamEstimation::ControlPathParamEstimation ( ControlPath & controlPath,
const std::vector< MeasPoint > & measData )

Member Function Documentation

◆ dt()

double libstp::autotune::control::ControlPathParamEstimation::dt ( ) const
inlinenodiscard

Mean sample time derived from the measurement timestamps.

Definition at line 48 of file control_path_param_estimation.hpp.

◆ optimize()

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.

Returns
best-fit parameter vector.

◆ rateCandidate()

double libstp::autotune::control::ControlPathParamEstimation::rateCandidate ( const std::vector< double > & paramList)
overridevirtual

DE cost callback: squared error of the simulated vs. measured response.

Implements libstp::autotune::control::IDifferentialEvolutionRating.

◆ setStep()

void libstp::autotune::control::ControlPathParamEstimation::setStep ( double stepHeight,
double stepTime )
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.


The documentation for this class was generated from the following file: