📄 var_vhz_wx.c
字号:
/*---------------------------------------------------------------------------------
Constants and variables definition for VHz_wx.c
----------------------------------------------------------------------------------*/
#define T_pwm 0x7D0 //载波频率period register of full PWM module, for 40M Tosc, 100uS period, the T_pwm=(100e-6/(1/40e9))/2=2000=0x7d0
#define k_theta 0xF83D //载波频率变化则修改此值refer to freq_theta.c
#define sincos_inv_step 0xB4 //refer to sincos.asm
#define sincos_k_cos 90 //refer to sincos.asm
//#define vHz_slope_init 0x49D //刘和平:虎溪--恒压频比系数 380V65HZ=slope=2^12*vref/frequence=2^12*0x1000/0x3777=0x49D
//65HZ;最高频率300HZ
//#define vHz_slope_init 0x449 //slope between voltage and frequence in the VHz control
//for rating voltage, vref=0x1000, and rating freuqence=0x3BBB(70hz)
// slope=2^12*vref/frequence=2^12*0x1000/0x3BBB=0x449
//70HZ;最高频率300HZ
//#define vHz_slope_init 0x600 //slope between voltage and frequence in the VHz control
//for rating voltage, vref=0x1000, and rating freuqence=0x2AAA(50hz)
//50HZ;最高频率300HZ // slope=2^12*vref/frequence=2^12*0x1000/0x2AAA=0X600
#define vHz_slope_init 0x500 //slope between voltage and frequence in the VHz control
//for rating voltage, vref=0x1000, and rating freuqence=0x3333(60hz)
// slope=2^12*vref/frequence=2^12*0x1000/0x3333=0x500 // 50=5ms speed control period 10=1ms
//60HZ;最高频率300HZ //
#define frequence_min 0x1111 // 2^16*f/300=0X1111 minimum frequence saturation, 20Hz
// minimum frequence saturation, 20Hz
#define mailbox3_refresh 1000 // 100ms period for refreshing maibox3.A
#define speed_period 10 // 50=5ms speed control period 10=1ms
freq_theta_struct freq_theta_out;
polar_rect polar_rect_out;
sincos_struct sincos_out;
softsvpwm svpwm_out;
vhz_volt vhz_volt_out;
typedef struct
{ unsigned int freq_ref_max; //maximum of frequence reference
unsigned int freq_ref; //frequence reference
}freq_ref_struct;
freq_ref_struct freq_ref_out;
typedef struct
{
unsigned int freq_ref_slope;
}freq_ref_slope_struct;
freq_ref_slope_struct freq_ref_slope_out;
typedef struct
{ unsigned int timer; //software timer
unsigned int can_timer; //timer for mailbox3A refreshing
unsigned int speed_timer; //timer for speed control
unsigned int key_timer; //按键去抖动定时器2005-10-21
}softtimer; //structure for software timers
softtimer soft_timer;
unsigned int speed=0; //motor speed
unsigned int ipmfault=0;
unsigned int flagflag=0;
unsigned int flagspeedchang=0;
float fspeed=0.0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -