26 lines
416 B
C
26 lines
416 B
C
/*
|
|
* Copyright 2022 Oleg Borodin <borodin@unix7.org>
|
|
*
|
|
*/
|
|
|
|
|
|
#ifndef PIDCONT_H_QWERTY
|
|
#define PIDCONT_H_QWERTY
|
|
|
|
|
|
typedef struct {
|
|
double perror;
|
|
double integ;
|
|
|
|
double kp;
|
|
double ki;
|
|
double kd;
|
|
} pidcont_t;
|
|
|
|
|
|
void pidcont_init(pidcont_t* p);
|
|
void pidcont_setup(pidcont_t* p, double kp, double ki, double kd);
|
|
double pidcont_apply(pidcont_t* p, double target, double actual, double dt);
|
|
|
|
#endif
|