//系统运行状态定义
#define UP 1
#define DOWN 2
#define STOP 0
#define NORMAL 0x10
#define RESET 0x11
#define ERROR 0x12
//电机控制命令定义
#define CmdNull 0x00 //无任何命令
#define CmdUp 0x20 //向上运动命令
#define CmdDown 0x21 //向下运动命令
#define CmdStop 0x22
#define CmdSave 0x23 //存储命令
#define CmdToPreseting 0x24 //运动到预设的位置命令
#define CmdHealthModeOn 0x25 //开启健康模式
#define CmdHealthModeOFF 0x26 //关闭健康模式
//系统错误定义
#define Err_TimeEnd 0x0001 //运行时间到(连续运行2分钟)
#define Err_Overheating 0x0002 //电机过热
#define Err_M1Overcurrent 0x0003 //电机1过流
#define Err_M2Overcurrent 0x0004 //电机2过流
#define Err_M1Position 0x0005 //电机1位置故障
#define Err_M2Position 0x0006 //电机2位置故障
#define Err_M1OneHall 0x0007 //电机1单个HALL故障
#define Err_M2OneHall 0x0008 //电机2单个HALL故障
#define Err_M1TwoHall 0x0014 //电机1两个HALL全故障
#define Err_M2TwoHall 0x0015 //电机2两个HALL全故障
#define Err_M1AllWire 0x0016 //电机1HALL线和电源线全部故障
#define Err_M2AllWire 0x0017 //电机2HALL线和电源线全部故障
#define Err_LSM6DSL 0x001E //三轴传感器故障
#define Err_Unbalance 0x0009 //桌面不平衡
#define Err_RESET 0xffff //复位状态时错误代码
#define Err_Fall 0xfffe //结构下滑
电机驱动软件学习笔记——定义
最新推荐文章于 2021-09-12 12:53:44 发布