GaussianProcessGuider

Search for usage in LXR

GaussianProcessGuider Class Reference

#include <gaussian_process_guider.h>

Classes

struct  guide_parameters
 

Public Member Functions

 GaussianProcessGuider (guide_parameters parameters)
 
void add_one_point ()
 
double deduceResult (double time_step, double prediction_point=-1.0)
 
void DirectMoveApplied (double amt, double rate)
 
data_point & get_last_point () const
 
size_t get_number_of_measurements () const
 
data_point & get_second_last_point () const
 
bool GetBoolComputePeriod () const
 
double GetControlGain () const
 
std::vector< double > GetGPHyperparameters () const
 
double GetMinMove () const
 
int GetNumPointsForApproximation () const
 
double GetPeriodLengthsInference () const
 
double GetPeriodLengthsPeriodEstimation () const
 
double getPredictionContribution ()
 
double GetPredictionGain () const
 
void GuidingDithered (double amt, double rate)
 
void GuidingDitherSettleDone (bool success)
 
void inject_data_point (double timestamp, double input, double SNR, double control)
 
Eigen::MatrixXd regularize_dataset (const Eigen::VectorXd &timestamps, const Eigen::VectorXd &gear_error, const Eigen::VectorXd &variances)
 
void reset ()
 
double result (double input, double SNR, double time_step, double prediction_point=-1.0)
 
void save_gp_data () const
 
bool SetBoolComputePeriod (bool active)
 
bool SetControlGain (double control_gain)
 
bool SetGPHyperparameters (const std::vector< double > &hyperparameters)
 
void SetLearningRate (double learning_rate)
 
bool SetMinMove (double min_move)
 
bool SetNumPointsForApproximation (int num_points)
 
bool SetPeriodLengthsInference (double num_periods)
 
bool SetPeriodLengthsPeriodEstimation (double num_periods)
 
bool SetPredictionGain (double)
 
void UpdateGP (double prediction_point=std::numeric_limits< double >::quiet_NaN())
 
void UpdatePeriodLength (double period_length)
 

Detailed Description

This class provides a guiding algorithm for the right ascension axis that learns and predicts the periodic gear error with a Gaussian process.

This prediction helps reducing periodic error components in the residual tracking error. Further it is able to perform tracking without measurement to increase robustness of the overall guiding system.

Definition at line 47 of file gaussian_process_guider.h.

Constructor & Destructor Documentation

◆ GaussianProcessGuider()

GaussianProcessGuider::GaussianProcessGuider ( guide_parameters parameters)

Definition at line 43 of file gaussian_process_guider.cpp.

◆ ~GaussianProcessGuider()

GaussianProcessGuider::~GaussianProcessGuider ( )

Definition at line 92 of file gaussian_process_guider.cpp.

Member Function Documentation

◆ add_one_point()

void GaussianProcessGuider::add_one_point ( )
inline

Definition at line 347 of file gaussian_process_guider.h.

◆ deduceResult()

double GaussianProcessGuider::deduceResult ( double time_step,
double prediction_point = -1.0 )

This method provides predictive control if no measurement could be made.

A zero measurement is stored with high uncertainty, and then the GP prediction is used for control.

Definition at line 387 of file gaussian_process_guider.cpp.

◆ DirectMoveApplied()

void GaussianProcessGuider::DirectMoveApplied ( double amt,
double rate )

This method tells the guider that a direct move was issued.

This has the opposite effect of a dither on the dither offset.

Definition at line 466 of file gaussian_process_guider.cpp.

◆ get_last_point()

data_point & GaussianProcessGuider::get_last_point ( ) const
inline

Definition at line 332 of file gaussian_process_guider.h.

◆ get_number_of_measurements()

size_t GaussianProcessGuider::get_number_of_measurements ( ) const
inline

Definition at line 342 of file gaussian_process_guider.h.

◆ get_second_last_point()

data_point & GaussianProcessGuider::get_second_last_point ( ) const
inline

Definition at line 337 of file gaussian_process_guider.h.

◆ GetBoolComputePeriod()

bool GaussianProcessGuider::GetBoolComputePeriod ( ) const

Definition at line 486 of file gaussian_process_guider.cpp.

◆ GetControlGain()

double GaussianProcessGuider::GetControlGain ( void ) const

Definition at line 475 of file gaussian_process_guider.cpp.

◆ GetGPHyperparameters()

std::vector< double > GaussianProcessGuider::GetGPHyperparameters ( ) const

Definition at line 497 of file gaussian_process_guider.cpp.

◆ GetMinMove()

double GaussianProcessGuider::GetMinMove ( ) const

Definition at line 537 of file gaussian_process_guider.cpp.

◆ GetNumPointsForApproximation()

int GaussianProcessGuider::GetNumPointsForApproximation ( ) const

Definition at line 548 of file gaussian_process_guider.cpp.

◆ GetPeriodLengthsInference()

double GaussianProcessGuider::GetPeriodLengthsInference ( ) const

Definition at line 559 of file gaussian_process_guider.cpp.

◆ GetPeriodLengthsPeriodEstimation()

double GaussianProcessGuider::GetPeriodLengthsPeriodEstimation ( ) const

Definition at line 570 of file gaussian_process_guider.cpp.

◆ getPredictionContribution()

double GaussianProcessGuider::getPredictionContribution ( )
inline

Returns the weight of the prediction on the output control value.

Definition at line 253 of file gaussian_process_guider.h.

◆ GetPredictionGain()

double GaussianProcessGuider::GetPredictionGain ( ) const

Definition at line 581 of file gaussian_process_guider.cpp.

◆ GuidingDithered()

void GaussianProcessGuider::GuidingDithered ( double amt,
double rate )

This method tells the guider that a dither command was issued.

The guider will stop collecting measurements and uses predictions instead, to keep the FFT and the GP working.

Definition at line 443 of file gaussian_process_guider.cpp.

◆ GuidingDitherSettleDone()

void GaussianProcessGuider::GuidingDitherSettleDone ( bool success)

This method tells the guider that dithering is finished.

The guider will resume normal operation.

Definition at line 455 of file gaussian_process_guider.cpp.

◆ inject_data_point()

void GaussianProcessGuider::inject_data_point ( double timestamp,
double input,
double SNR,
double control )

This method is needed for automated testing.

It can inject data points.

Definition at line 592 of file gaussian_process_guider.cpp.

◆ regularize_dataset()

Eigen::MatrixXd GaussianProcessGuider::regularize_dataset ( const Eigen::VectorXd & timestamps,
const Eigen::VectorXd & gear_error,
const Eigen::VectorXd & variances )

Takes timestamps, measurements and SNRs and returns them regularized in a matrix.

Definition at line 709 of file gaussian_process_guider.cpp.

◆ reset()

void GaussianProcessGuider::reset ( )

Clears the data from the circular buffer and clears the GP data.

Definition at line 423 of file gaussian_process_guider.cpp.

◆ result()

double GaussianProcessGuider::result ( double input,
double SNR,
double time_step,
double prediction_point = -1.0 )

Calculates the control value based on the current input.

  1. The input is stored, 2. the GP is updated with the new data point, 3. the prediction is calculated to compensate the gear error and 4. the controller is calculated, consisting of feedback and prediction parts.

Definition at line 269 of file gaussian_process_guider.cpp.

◆ save_gp_data()

void GaussianProcessGuider::save_gp_data ( ) const

Saves the GP data to a csv file for external analysis.

Expensive!

Definition at line 776 of file gaussian_process_guider.cpp.

◆ SetBoolComputePeriod()

bool GaussianProcessGuider::SetBoolComputePeriod ( bool active)

Definition at line 491 of file gaussian_process_guider.cpp.

◆ SetControlGain()

bool GaussianProcessGuider::SetControlGain ( double control_gain)

Definition at line 480 of file gaussian_process_guider.cpp.

◆ SetGPHyperparameters()

bool GaussianProcessGuider::SetGPHyperparameters ( const std::vector< double > & hyperparameters)

Definition at line 512 of file gaussian_process_guider.cpp.

◆ SetLearningRate()

void GaussianProcessGuider::SetLearningRate ( double learning_rate)

Sets the learning rate.

Useful for disabling it for testing.

Definition at line 851 of file gaussian_process_guider.cpp.

◆ SetMinMove()

bool GaussianProcessGuider::SetMinMove ( double min_move)

Definition at line 542 of file gaussian_process_guider.cpp.

◆ SetNumPointsForApproximation()

bool GaussianProcessGuider::SetNumPointsForApproximation ( int num_points)

Definition at line 553 of file gaussian_process_guider.cpp.

◆ SetPeriodLengthsInference()

bool GaussianProcessGuider::SetPeriodLengthsInference ( double num_periods)

Definition at line 564 of file gaussian_process_guider.cpp.

◆ SetPeriodLengthsPeriodEstimation()

bool GaussianProcessGuider::SetPeriodLengthsPeriodEstimation ( double num_periods)

Definition at line 575 of file gaussian_process_guider.cpp.

◆ SetPredictionGain()

bool GaussianProcessGuider::SetPredictionGain ( double prediction_gain)

Definition at line 586 of file gaussian_process_guider.cpp.

◆ UpdateGP()

void GaussianProcessGuider::UpdateGP ( double prediction_point = std::numeric_limits<double>::quiet_NaN())

Runs the inference machinery on the GP.

Gets the measurement data from the circular buffer and stores it in Eigen::Vectors. Detrends the data with linear regression. Calculates the main frequency with an FFT. Updates the GP accordingly with new data and parameter.

Definition at line 140 of file gaussian_process_guider.cpp.

◆ UpdatePeriodLength()

void GaussianProcessGuider::UpdatePeriodLength ( double period_length)

Does filtering and sets the period length of the GPGuider.

Definition at line 690 of file gaussian_process_guider.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.