Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/pidctrl.h
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
#define PIDCTRL_KPD 3 /* Default proportional divisor. */ | #define PIDCTRL_KPD 3 /* Default proportional divisor. */ | ||||
#define PIDCTRL_KID 4 /* Default integral divisor. */ | #define PIDCTRL_KID 4 /* Default integral divisor. */ | ||||
#define PIDCTRL_KDD 8 /* Default derivative divisor. */ | #define PIDCTRL_KDD 8 /* Default derivative divisor. */ | ||||
#define PIDCTRL_BOUND 4 /* Bound factor, setpoint multiple. */ | #define PIDCTRL_BOUND 4 /* Bound factor, setpoint multiple. */ | ||||
struct sysctl_oid_list; | struct sysctl_oid_list; | ||||
int pidctrl_error(struct pidctrl *pc, int input); | |||||
void pidctrl_init(struct pidctrl *pc, int interval, int setpoint, | void pidctrl_init(struct pidctrl *pc, int interval, int setpoint, | ||||
int bound, int Kpd, int Kid, int Kdd); | int bound, int Kpd, int Kid, int Kdd); | ||||
void pidctrl_init_sysctl(struct pidctrl *pc, struct sysctl_oid_list *parent); | void pidctrl_init_sysctl(struct pidctrl *pc, struct sysctl_oid_list *parent); | ||||
/* | /* | ||||
* This is the classic PID controller where the interval is clamped to | * This is the classic PID controller where the interval is clamped to | ||||
* [-bound, bound] and the output may be negative. This should be used | * [-bound, bound] and the output may be negative. This should be used | ||||
* in continuous control loops that can adjust a process variable in | * in continuous control loops that can adjust a process variable in | ||||
Show All 23 Lines |