libstp
Robotics library for Botball
Loading...
Searching...
No Matches
velocity_controller.hpp
Go to the documentation of this file.
1//
2// Created by tobias on 9/8/25.
3//
4
5#pragma once
7
8namespace libstp::drive
9{
17 {
18 public:
21
24
27
28 const foundation::PidGains& gains() const { return g_; }
29 const foundation::Feedforward& ff() const { return ff_; }
30
41 double compute(double w_ref, double a_ref, double w_meas, double dt,
42 double u_max, bool* out_saturated = nullptr);
43
45 void reset();
46
47 private:
50
51 double i_{0.0};
52 double w_meas_prev_{0.0};
53 double d_filt_{0.0};
54
55 double d_alpha_{0.3};
56 double k_aw_{0.4};
57 };
58}
const foundation::PidGains & gains() const
void setFF(const foundation::Feedforward &ff)
const foundation::Feedforward & ff() const
VelocityController(foundation::PidGains g, foundation::Feedforward ff)
double compute(double w_ref, double a_ref, double w_meas, double dt, double u_max, bool *out_saturated=nullptr)
void setGains(const foundation::PidGains &g)
Feedforward terms for velocity and acceleration control.
Definition motor.hpp:24
Basic PID gains without integrator and output shaping parameters.
Definition motor.hpp:18