27 double weightingCtrlOut,
28 double weightingOvershot);
30 [[nodiscard]]
double calcError(
double w,
double y)
const;
36 double weighting_ctrl_out_;
37 double weighting_overshot_;
54 std::vector<double>
optimize(
double limitMinParams,
55 double limitMaxParams,
62 double weightingCtrlOut,
63 double weightingOvershot,
64 std::uint32_t seed = 0xC0FFEEu);
74 double weightingCtrlOut,
75 double weightingOvershot);
78 static constexpr int kNumTimeSteps = 5000;
80 double evaluate(
const std::vector<double>& params,
88 double step_height_{0};
92 bool have_error_{
false};
93 ControlOptimizationError calc_error_;
Abstract base for every control element (P, I, D, PT1, ...).
Closed unity-feedback loop: controller in series with plant. Port of ControlLoop.ts.
double calcError(double w, double y) const
ControlOptimizationError(const ControlLoop &controlLoop, double stepHeight, double maxOvershot, double weightingCtrlOut, double weightingOvershot)
double rateCandidate(const std::vector< double > ¶mList) override
void setStep(double stepHeight, double stepTime, double endTime, double maxOvershot, double weightingCtrlOut, double weightingOvershot)
ControllerOptimizationDifferentialEvolution(ControlLoop &controlLoop, ControlElement &controlOptimization)
std::vector< double > optimize(double limitMinParams, double limitMaxParams, bool dither, int maxNumSteps, double stepHeight, double stepTime, double endTime, double maxOvershot, double weightingCtrlOut, double weightingOvershot, std::uint32_t seed=0xC0FFEEu)
Cost function to minimise. Port of IDifferentialEvolutionRating.