Skip to main content

FeedForward

Constructors

FeedForward()

Create a FeedForward object for the fiven constants.

FeedForward(const double _kv, const double _ks, const double _ka);
Parameters
_kvThe velocity constant.
_ks The Friction constant.
_ka Acceleration control.

FeedForward() copy

Copy constructor.

FeedForward(const FeedForward &other);
Parameters
otherFeedForward object to copy.

Functions

update()

Updates the controller.

info

You should put this function inside of while loop to update the input to the current reading.

  void update(const double input);
Parameters
inputThe actual input of the controller. "The current reading"

Setters

set_kv()

Sets the kv constant.

void set_kv(const double kv); 
Parameters
kvThe kv constant.

set_ks()

Sets the ks constant.

void set_ks(const double ks); 
Parameters
ksThe friction constant.

set_ka()

Sets the ka constant.

void set_ka(const double ka); 
Parameters
kaThe acceleration constant.

Getters

get_kv()

Get the kv constant.

  double get_kv(void) const;

Returns: The kv constant.

get_ks()

Get the friction constant

  double get_ks(void) const;

Returns: The ks constant.

get_ka()

Gets the acceleration constant.

  double get_ka(void) const;

Returns: The Ka constant.

get_output

Gets the current output of the controller.

note

You should put this output to your motors. Sending as voltage.

  double get_output(void) const;

Returns: The current output.