bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
pi_controller.h
Go to the documentation of this file.
1#ifndef BITSIM_CONTROL_PI_CONTROLLER_H
2#define BITSIM_CONTROL_PI_CONTROLLER_H
3
5
6namespace bitsim
7{
8namespace control
9{
10
23{
24 public:
31
35 real_t update(real_t error, real_t dt, real_t feedforward = 0.0);
36
40 void reset() { integral_ = 0.0; }
41
42 real_t kp() const noexcept { return kp_; }
43 real_t ki() const noexcept { return ki_; }
44 real_t limit() const noexcept { return limit_; }
45 real_t integral() const noexcept { return integral_; }
46
47 private:
48 real_t kp_;
49 real_t ki_;
50 real_t limit_;
51 real_t integral_{0.0};
52};
53
54} // namespace control
55} // namespace bitsim
56
57#endif // BITSIM_CONTROL_PI_CONTROLLER_H
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
PIController(real_t kp, real_t ki, real_t limit)
Definition pi_controller.cpp:11
void reset()
Forget the integral.
Definition pi_controller.h:40
real_t kp() const noexcept
Definition pi_controller.h:42
real_t limit() const noexcept
Definition pi_controller.h:44
real_t update(real_t error, real_t dt, real_t feedforward=0.0)
The output for the error after a step of dt [s].
Definition pi_controller.cpp:19
real_t ki() const noexcept
Definition pi_controller.h:43
real_t integral() const noexcept
Definition pi_controller.h:45
Controllers: PID controllers, line following, a quadrotor flight controller, a fixed wing autopilot,...
Definition control_module.h:18
Definition dc_motor_backend_base.h:9
double real_t
real_t
Definition bitsim_types.h:20