pid.h

来自「智能小车导航」· C头文件 代码 · 共 55 行

H
55
字号
// PID.h: interface for the CPID class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PID_H__AC3243F0_9280_4C3A_BA24_EE695334CB23__INCLUDED_)
#define AFX_PID_H__AC3243F0_9280_4C3A_BA24_EE695334CB23__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CPID  
{
public:
	CPID();
	virtual ~CPID();
private:
	int ThetaFB;
	int ThetaExp;
	float integral;
	float Kp;
	float Ki;
	float Kd;
	int DeadBand;
	int LastError;
public:
	void ClearHistory();
	//pid参数的确省值
	void pid_tune(float m_Kp=0.5,float m_Ki=0.001,float m_Kd=0.001,int m_DeadBand=2);
	float pid_calc(int g_phei);
};

#endif // !defined(AFX_PID_H__AC3243F0_9280_4C3A_BA24_EE695334CB23__INCLUDED_)





















⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?