simple control loop for use with JMotorControllerClosed, can turn off motor if nothing has moved for a while
More...
#include <JControlLoopBasic.h>
simple control loop for use with JMotorControllerClosed, can turn off motor if nothing has moved for a while
◆ JControlLoopBasic()
JControlLoopBasic::JControlLoopBasic |
( |
float |
kP, |
|
|
unsigned long |
_timeout = 0 , |
|
|
bool |
_noReverseVoltage = false |
|
) |
| |
|
inline |
constructor for control loop for use with JMotorControllerClosed
- Parameters
-
kP | (float) proportional to error |
_timeout | (unsigned long) default: 0, set output to zero if there's been no movement for this many milliseconds. 0=never timeout |
_noReverseVoltage | (bool) default: false, if true, don't apply voltage in reverse direction to target velocity (recommended only for non-directional encoders) |
◆ calc()
◆ getKP()
float JControlLoopBasic::getKP |
( |
| ) |
|
|
inline |
◆ getTimeout()
unsigned long JControlLoopBasic::getTimeout |
( |
| ) |
|
|
inline |
◆ resetTime()
void JControlLoopBasic::resetTime |
( |
| ) |
|
|
inlinevirtual |
◆ setKP()
void JControlLoopBasic::setKP |
( |
float |
_p | ) |
|
|
inline |
◆ setTimeout()
void JControlLoopBasic::setTimeout |
( |
unsigned long |
_timeout | ) |
|
|
inline |
◆ lastMovedMillis
unsigned long JControlLoopBasic::lastMovedMillis |
|
protected |
◆ noReverseVoltage
bool JControlLoopBasic::noReverseVoltage |
|
protected |
float JControlLoopBasic::P |
|
protected |
◆ timeout
unsigned long JControlLoopBasic::timeout |
|
protected |
The documentation for this class was generated from the following file: