1 Star 0 Fork 1

zx2591/AutoPID_C

forked from guangjieMVP/AutoPID_C 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
AutoPID.h 1.42 KB
一键复制 编辑 原始数据 按行查看 历史
guangjieMVP 提交于 2022-05-27 17:44 . add port
#ifndef __AUTOPID_H__
#define __AUTOPID_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef enum BOOL{
false = 0,
true = 1,
}bool;
struct AutoPID {
float _Kp;
float _Ki;
float _Kd;
float _integral;
float _previousError;
float _bangOn;
float _bangOff;
float *_input;
float *_setpoint;
float*_output;
float _outputMin;
float _outputMax;
unsigned long _timeStep;
float _lastStep;
bool _stopped;
};
struct AutoPIDRelay {
struct AutoPID ap;
bool * _relayState;
unsigned long _pulseWidth;
unsigned long _lastPulseTime;
float _pulseValue;
};
void AutoPID_AutoPID(struct AutoPID *ap, float *input, float *setpoint, float *output, float outputMin, float outputMax,
float Kp, float Ki, float Kd);
void AutoPID_run(struct AutoPID *ap);
void AutoPID_setGains(struct AutoPID *ap, float Kp, float Ki, float Kd);
void AutoPID_setBangBang(struct AutoPID *ap, float bangOn, float bangOff);
void AutoPID_setBangBangRange(struct AutoPID *ap, float bangRange);
void AutoPID_stop(struct AutoPID *ap);
void AutoPID_reset(struct AutoPID *ap);
bool AutoPID_isStopped(struct AutoPID *ap);
float AutoPID_getIntegral(struct AutoPID *ap);
void AutoPID_setIntegral(struct AutoPID *ap, float integral);
void AutoPIDRelay_run(struct AutoPIDRelay *apr);
float AutoPIDRelay_getPulseValue(struct AutoPIDRelay *apr);
#ifdef __cplusplus
}
#endif
#endif /* __AUTOPID_H__ */
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/zx2591/auto-pid_-c.git
[email protected]:zx2591/auto-pid_-c.git
zx2591
auto-pid_-c
AutoPID_C
master

搜索帮助