增加所有文件,修改为零度电机

This commit is contained in:
2025-11-30 22:12:14 +08:00
parent 97bc808489
commit 90dd43f3f9
151 changed files with 748 additions and 22945 deletions

View File

@@ -65,14 +65,15 @@
// 接收电机控制器输入
typedef struct _StrMotorInput
{
//-----接收数据0x101或者0x201----------------------------------------------
unsigned int speed : 16; // 转速 偏移量 -30000
unsigned int bus_voltage : 16; // 母线电压 系数 0.1 偏移量 -3000
unsigned int torque : 16; // 扭矩 系数 0.01 偏移量 -300 实际物理量=数据×系数+偏移量
unsigned int fault_code : 8; // 故障码
unsigned int heartbeat : 8; // 心跳
//-----接收数据0x589或者0x189----------------------------------------------
uint8_t MotCon_1Signal1 ;
uint8_t MotCon_1Signal2 ;
uint16_t MotCon_1Signal3 ;
uint16_t MotCon_1Signal4 ;
uint16_t MotCon_1Signal5 ;
} StrMotorInput;
} StrMotorInput;
typedef union _UnMotorInput
{
StrMotorInput bit_data; // 使用定义的结构体变量名
@@ -80,7 +81,6 @@ typedef union _UnMotorInput
} UnMotorInput;
// 接收电机控制器输入
typedef struct _StrCanDebugOutput
{
@@ -334,18 +334,19 @@ typedef union _UnSwSample
// 输出到电机控制器
typedef struct _StrMotorOutput
{
//-----发送数据0x201或者0x202----------------------------------------------
unsigned int mode : 8; // 模式 0x1恒速模式0x2恒扭模式其他无效
unsigned int gear : 8; // 档位 0x0空挡模式0x1前进挡0x2倒退档其他无效
unsigned int set_torque : 16; // 给定扭矩 系数 0.01 偏移量 -300 实际物理量=数据×系数+偏移量
unsigned int set_rotation_speed : 16; // 给定转速 偏移量 -30000
unsigned int fault_code : 8; // 故障码
unsigned int heartbeat : 8; // 心跳
//-----发送数据0x401或者0x402----------------------------------------------
unsigned int feed_power : 16; // 馈电功率 单位为 W 最大为10KW
unsigned int discharge_power : 16; // 放电功率 单位为 W 最大为15kW
unsigned int reserve1 : 16; // 保留
unsigned int reserve2 : 16; // 保留
//-----发送数据0x609或者0x209----------------------------------------------
uint8_t MotCon_1Signal1 ;
uint8_t MotCon_1Signal2 ;
uint16_t MotCon_1Signal3 ;
uint16_t MotCon_1Signal4 ;
uint16_t MotCon_1Signal5 ;
//-----接收数据0x589或者0x189----------------------------------------------
uint8_t MotCon_1Signal6 ;
uint8_t MotCon_1Signal7 ;
uint16_t MotCon_1Signal8 ;
uint16_t MotCon_1Signal9 ;
uint16_t MotCon_1Signal10 ;
} StrMotorOutput;
typedef union _UnMotorOutput
@@ -356,6 +357,7 @@ typedef union _UnMotorOutput
// canoe协议输出
typedef struct _StrSdoOutput
{
@@ -972,7 +974,7 @@ extern UnCanDebugOutput un_can_debug_output;//调试输出
//函数
void canSendAll(void *signal_id);
void ethernetSendAll(void *signal_id);
float constrain(float value, float min_val, float max_val);
#pragma pack()
#endif /* _INTERFACE_H_ */