Brick
Toggle main menu visibility
Loading...
Searching...
No Matches
bang_bang.h
Go to the documentation of this file.
1
/**
2
* @file bang_bang.h
3
* @brief A control loop that utilizes only the positive error to get an output value
4
*
5
* This is a conventional pulse-width-modulation controller using the Feedback class as an
6
* interface. It calculates an output using only the current state and reference state
7
*/
8
9
#include "
core/math/controls/feedback.h
"
10
#include "core/math/units.h"
11
12
using namespace
units::literals
;
13
14
/// Feedback child class to create pulse-width-modulation loops
15
class
BangBang
:
public
Feedback
<double, bool> {
16
public
:
17
/// Resets the internal state of the BangBang controller
18
void
reset
()
override
;
19
20
/**
21
* @brief Updates the BangBang controller output
22
*
23
* @param state the current state the BangBand controller is at
24
* @param reference the target state for the BangBang controller
25
* @param dt the timestep since the last time this method was called
26
* @return the controller output
27
*/
28
virtual
bool
update
(
const
double
& state,
const
double
& reference,
29
const
units::Time& dt = 10_ms)
override
;
30
};
BangBang
Feedback child class to create pulse-width-modulation loops.
Definition
bang_bang.h:15
BangBang::reset
void reset() override
Resets the internal state of the BangBang controller.
BangBang::update
virtual bool update(const double &state, const double &reference, const units::Time &dt=10_ms) override
Updates the BangBang controller output.
Feedback
pure virtual class for generic feedback control loops.
Definition
feedback.h:21
feedback.h
A pure virual class to function as an interface for all feedback control loops.
units::literals
Definition
units.h:691
core
math
controls
bang_bang.h
Generated by
1.18.0