pid.h
来自「2802 步进电机控制器」· C头文件 代码 · 共 57 行
H
57 行
/* =================================================================================
File name: PID.H (IQ version)
Originator: ECS Development
Description:
Header file containing constants, data type definitions, and
function prototypes for the PID.
=====================================================================================
History:
-------------------------------------------------------------------------------------
04-15-2005 Version 3.20
------------------------------------------------------------------------------*/
#ifndef __PID_H__
#define __PID_H__
typedef struct { _iq Ref; // Input: Reference input
_iq Fdb; // Input: Feedback input
_iq Err; // Variable: Error
_iq Kp; // Parameter: Proportional gain
_iq Up; // Variable: Proportional output
_iq Ui; // Variable: Integral output
_iq OutPreSat; // Variable: Pre-saturated output
_iq OutMax; // Parameter: Maximum output
_iq OutMin; // Parameter: Minimum output
_iq Out; // Output: PID output
_iq SatErr; // Variable: Saturated difference
_iq Ki; // Parameter: Integral gain
_iq Kc; // Parameter: Integral correction gain
void (*calc)(); // Pointer to calculation function
} PID;
/*-----------------------------------------------------------------------------
Default initalizer for the PID object.
-----------------------------------------------------------------------------*/
#define PID_DEFAULTS { 0, \
0, \
0, \
_IQ(1.3), \
0, \
0, \
0, \
_IQ(1), \
_IQ(-1), \
0, \
0, \
_IQ(0.02), \
_IQ(0.5), \
(void (*)(unsigned long))pid_calc }
/*------------------------------------------------------------------------------
Prototypes for the functions in PID.C
------------------------------------------------------------------------------*/
void pid_calc(PID *);
#endif // __PID_H__
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?