JMotor
Loading...
Searching...
No Matches
JControlLoop.h
Go to the documentation of this file.
1#ifndef J_CONTROL_LOOP_H
2#define J_CONTROL_LOOP_H
3class JMotorControllerClosed; //"forward declaration"
8protected:
9 float error;
11 float result;
12
13public:
14 virtual float calc(JMotorControllerClosed* controller) = 0;
15 virtual void resetTime() = 0;
20 float getError()
21 {
22 return error;
23 }
30 {
31 return result;
32 }
38 float getResult()
39 {
40 return result;
41 }
42};
44
45#include "JControlLoopBasic.h"
46
47#endif
interface for control loop used by JMotorControllerClosed
Definition JControlLoop.h:7
float getError()
setpoint-position
Definition JControlLoop.h:20
float error
Definition JControlLoop.h:9
float ctrlLoopOut
Definition JControlLoop.h:10
float result
Definition JControlLoop.h:11
float getResult()
most recent value returned by calc() overall output to motor
Definition JControlLoop.h:38
float getCtrlLoopOut()
most recent value calculated by control loop in response to error (but not including feedforward) For...
Definition JControlLoop.h:29
virtual void resetTime()=0
virtual float calc(JMotorControllerClosed *controller)=0
closed loop (uses encoder) motor controller
Definition JMotorControllerClosed.h:13