#include <hidef.h> /*
common defines and macros */
#include "derivative.h" /*
derivative-specific definitions */
#include <mc9s12xs128.h>
//定义PID参数
#define VV_KPVALUE 3 //比例
#define VV_KIVALUE 40 //积分
#define VV_KDVALUE 3 //微分
#define VV_MAX 10000 //返回的最大值,是pwm的周期值
#define VV_MIN 0
#define VV_DEADLINE 0X08 //速度PID,设置死区范围
typedef struct PID //定义数法核心数据
{
signed int vi_Ref; //速度PID,速度设定值
signed int vi_FeedBack; //速度PID,速度反馈值