步进电机驱动程序提问
//步进电机unsignedcharflag1=0;//默认门打开//高四位unsignedcharphaseccw[4]={0x8f,0x4f,0x2f,0x1f};/...
//步进电机
unsigned char flag1=0;//默认门打开
//高四位
unsigned char phaseccw[4] ={0x8f,0x4f,0x2f,0x1f}; //正转 电机导通相序 D-DC-C-CB-B-BA-A-AD
unsigned char phasecw[4]={0x1f,0x2f,0x4f,0x8f}; //反转 电机导通相序 DA-A-AB-B-BC-C-CD-D
////低四位
//unsigned char phaseccw[8] ={0xf8,0xfc,0xf4,0xf6,0xf2,0xf3,0xf1,0xf9}; //正转 电机导通相序 D-DC-C-CB-B-BA-A-AD
//unsigned char phasecw[8]={0xf9,0xf1,0xf3,0xf2,0xf6,0xf4,0xfc,0xf8}; //反转 电机导通相序 AD-A-AB-B-BC-C-CD-D
unsigned int JIAODU=10;//对应180° 电机角度 越大转动角度越大
想问问大神们,为什么这个驱动电机要把低四位都设为f,这个高四位和低四位有什么区别呢 展开
unsigned char flag1=0;//默认门打开
//高四位
unsigned char phaseccw[4] ={0x8f,0x4f,0x2f,0x1f}; //正转 电机导通相序 D-DC-C-CB-B-BA-A-AD
unsigned char phasecw[4]={0x1f,0x2f,0x4f,0x8f}; //反转 电机导通相序 DA-A-AB-B-BC-C-CD-D
////低四位
//unsigned char phaseccw[8] ={0xf8,0xfc,0xf4,0xf6,0xf2,0xf3,0xf1,0xf9}; //正转 电机导通相序 D-DC-C-CB-B-BA-A-AD
//unsigned char phasecw[8]={0xf9,0xf1,0xf3,0xf2,0xf6,0xf4,0xfc,0xf8}; //反转 电机导通相序 AD-A-AB-B-BC-C-CD-D
unsigned int JIAODU=10;//对应180° 电机角度 越大转动角度越大
想问问大神们,为什么这个驱动电机要把低四位都设为f,这个高四位和低四位有什么区别呢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询