pid_reg3.h

来自「TI公司的DSP(LF2407A)编写的有霍尔位置传感器的无刷直流电机控制程序,」· C头文件 代码 · 共 61 行

H
61
字号
/* =================================================================================
File name:       PID_REG3.H  (IQ version)                    
Description: 
Header file containing constants, data type definitions, and 
function prototypes for the PIDREG3.
=====================================================================================
 History:
-------------------------------------------------------------------------------------
 05-15-2007	Version 3.20
------------------------------------------------------------------------------*/
#ifndef __PIDREG3_H__
#define __PIDREG3_H__

typedef struct {  int  Ref;   			// Input: Reference input 
				  int  Fdb;   			// Input: Feedback input 
				  int  Err;				// Variable: Error
				  int  Kp;				// Parameter: Proportional gain
				  int  Up;				// Variable: Proportional output 
				  int  Ui;				// Variable: Integral output 
				  int  Ud;				// Variable: Derivative output 	
				  int  OutPreSat; 		// Variable: Pre-saturated output
				  int  OutMax;		    // Parameter: Maximum output 
				  int  OutMin;	    	// Parameter: Minimum output
				  int  Out;   			// Output: PID output 
				  int  SatErr;			// Variable: Saturated difference
				  int  Ki;			    // Parameter: Integral gain
				  int  Kc;		     	// Parameter: Integral correction gain
				  int  Kd; 		        // Parameter: Derivative gain
				  int  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, \
                           0, \
                           0, \
                           0, \
                           0, \
                           0, \
                           0, \
                           0, \
                           0, \
                           0, \
                           0, \
                           0, \
                           0, \
                           0, \
              			  (void (*)(int))pid_reg3_calc }

/*------------------------------------------------------------------------------
Prototypes for the functions in PIDREG3.C
------------------------------------------------------------------------------*/
void pid_reg3_calc(PIDREG3_handle);

#endif // __PIDREG3_H__

⌨️ 快捷键说明

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