大佬们救救孩纸吧,这下面的我一直理解不了=.=
#ifndef __PIDREG3_H__
#define __PIDREG3_H__
#define __PIDREG3_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 Ud; // Variable: Derivative 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
_iq Kd; // Parameter: Derivative gain
_iq Up1; // History: Previous proportional output
void (*calc)(); // Pointer to calculation function
} PIDREG3;
_iq Kp; // Parameter: Proportional gain
_iq Up; // Variable: Proportional output _iq Ui; // Variable: Integral output _iq Ud; // Variable: Derivative 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
_iq Kd; // Parameter: Derivative gain
_iq Up1; // History: Previous proportional output
void (*calc)(); // Pointer to calculation function
} PIDREG3;
typedef PIDREG3 *PIDREG3_handle;
/*—————————————————————————–
Default initalizer for the PIDREG3 object.
—————————————————————————–*/ #define PIDREG3_DEFAULTS { 0, \
0, \
0, \
_IQ(1.3), \
0, \
0, \
0, \
0, \
_IQ(1), \
_IQ(-1), \
0, \
0, \
_IQ(0.02), \
_IQ(0.5), \
_IQ(1.05), \
0, \
(void (*)(Uint32))pid_reg3_calc }
/*—————————————————————————–
Default initalizer for the PIDREG3 object.
—————————————————————————–*/ #define PIDREG3_DEFAULTS { 0, \
0, \
0, \
_IQ(1.3), \
0, \
0, \
0, \
0, \
_IQ(1), \
_IQ(-1), \
0, \
0, \
_IQ(0.02), \
_IQ(0.5), \
_IQ(1.05), \
0, \
(void (*)(Uint32))pid_reg3_calc }
/*——————————————————————————
Prototypes for the functions in PIDREG3.C
——————————————————————————*/
void pid_reg3_calc(PIDREG3_handle);
Prototypes for the functions in PIDREG3.C
——————————————————————————*/
void pid_reg3_calc(PIDREG3_handle);
#endif // __PIDREG3_H__
大佬们,我有几个问题如下:
1:_iq Fdb和_IQ(1.3)这类的语句是什么意思呢,我知道是IQMATH里定义的奈何百度了几天都不清楚,头文件IQmath.h里几千行语句看到我眼花缭乱,头大如斗=.=;
2:(void (*)(Uint32))pid_reg3_calc请问大佬们这句是什么意思呢;
3:PIDREG3_DEFAULTS为什么这样定义呢?每行之间的 \ 是什么作用呢?
谢谢各位大佬的帮助,小弟在此拜谢!!!
user6007383:
回复 Susan Yang:
十分感谢您的帮助
大佬们救救孩纸吧,这下面的我一直理解不了=.=
#ifndef __PIDREG3_H__
#define __PIDREG3_H__
#define __PIDREG3_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 Ud; // Variable: Derivative 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
_iq Kd; // Parameter: Derivative gain
_iq Up1; // History: Previous proportional output
void (*calc)(); // Pointer to calculation function
} PIDREG3;
_iq Kp; // Parameter: Proportional gain
_iq Up; // Variable: Proportional output _iq Ui; // Variable: Integral output _iq Ud; // Variable: Derivative 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
_iq Kd; // Parameter: Derivative gain
_iq Up1; // History: Previous proportional output
void (*calc)(); // Pointer to calculation function
} PIDREG3;
typedef PIDREG3 *PIDREG3_handle;
/*—————————————————————————–
Default initalizer for the PIDREG3 object.
—————————————————————————–*/ #define PIDREG3_DEFAULTS { 0, \
0, \
0, \
_IQ(1.3), \
0, \
0, \
0, \
0, \
_IQ(1), \
_IQ(-1), \
0, \
0, \
_IQ(0.02), \
_IQ(0.5), \
_IQ(1.05), \
0, \
(void (*)(Uint32))pid_reg3_calc }
/*—————————————————————————–
Default initalizer for the PIDREG3 object.
—————————————————————————–*/ #define PIDREG3_DEFAULTS { 0, \
0, \
0, \
_IQ(1.3), \
0, \
0, \
0, \
0, \
_IQ(1), \
_IQ(-1), \
0, \
0, \
_IQ(0.02), \
_IQ(0.5), \
_IQ(1.05), \
0, \
(void (*)(Uint32))pid_reg3_calc }
/*——————————————————————————
Prototypes for the functions in PIDREG3.C
——————————————————————————*/
void pid_reg3_calc(PIDREG3_handle);
Prototypes for the functions in PIDREG3.C
——————————————————————————*/
void pid_reg3_calc(PIDREG3_handle);
#endif // __PIDREG3_H__
大佬们,我有几个问题如下:
1:_iq Fdb和_IQ(1.3)这类的语句是什么意思呢,我知道是IQMATH里定义的奈何百度了几天都不清楚,头文件IQmath.h里几千行语句看到我眼花缭乱,头大如斗=.=;
2:(void (*)(Uint32))pid_reg3_calc请问大佬们这句是什么意思呢;
3:PIDREG3_DEFAULTS为什么这样定义呢?每行之间的 \ 是什么作用呢?
谢谢各位大佬的帮助,小弟在此拜谢!!!
Susan Yang:
回复 user6007383:
很高兴能帮到您