PID算法源码
#include <string h> #include <stdio h> PID Function The PID 比例 积分 微分 function is used in mainly control applications PIDCalc performs one iteration of the PID algorithm While the PID function works main is just a dummy program showing a typical usage typedef struct PID { double SetPoint; 设定目标 Desired Value double Proportion; 比例常数 Proportional Const double Integral; 积分常数 Integral Const double Derivative; 微分常数 Derivative Const double LastError; Error[ 1] double PrevError; Error[ 2] double SumError; Sums of Errors } PID; PID计算部分 double PIDCalc PID pp double NextPoint { double dError Error;">#include <string h> #include <stdio h> PID Function The PID 比例 积分 微分 function is used in mainly control applications PIDCalc performs one iteration of the PID [更多]
#include <stdio.h>
/*==========================================================================================
PID Function
The PID (比例、积分、微分) function is used in mainly
control applications. PIDCalc performs one iteration of the PID
algorithm.
While the PID function works, main is just a dummy program showing
a typical usage.
============================================================================================*/
typedef struct PID {
double SetPoint; // 设定目标 Desired Value
double Proportion; // 比例常数 Proportional Const
double Integral; // 积分常数 Integral Const
double Derivative; // 微分常数 Derivative Const
double LastError; // Error[-1]
double PrevError; // Error[-2]
double SumError; // Sums of Errors
} PID;
/*====================================================================================================
PID计算部分
=====================================================================================================*/
- sunsheng12342014-03-23without tunning part..but not bad!
- 天行无常2015-08-28没能运行起来,但还是有借鉴意义的 ,赞一个
- 粉丝: 1
- 资源: 3
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助