Search Docs
一个PID实现的集合。
更多示例在 examples
#include "pid/pid.h" #include <stdbool.h> void unknown_control(float thrust); float unknown_sensor(); int main() { struct Pid pid = pid_new(1, 0, 0); float target = 0; while (true) { float actual = unknown_sensor(); float thrust = pid_update(&pid, target, actual, 0.1); unknown_control(thrust); } }
推荐直接从 GitHub Release 下载 pid (移除了example test simulate 文件夹) 并解压到项目目录下, 将 pid 下的代码文件添加到项目中就可以使用了。
example
test
simulate
pid
也可以使用 git clone 到项目目录下。
git clone
$ git clone https://github.com/xj63/PID -o pid # clone to local