add motor_task.c

This commit is contained in:
NeoZng
2022-10-20 21:14:17 +08:00
parent 78f85b7fda
commit a3a95768e6
12 changed files with 204 additions and 43 deletions

View File

@@ -3,6 +3,7 @@
#include "struct_typedef.h"
#include "bsp_can.h"
#include "controller.h"
#define HT_MOTOR_CNT 4
@@ -19,6 +20,8 @@ typedef struct //HT04
float ecd;
float speed_rpm;
float given_current;
PID_t pid;
can_instance motor_can_instace;
} joint_instance;
@@ -29,6 +32,7 @@ typedef enum
CMD_ZERO_POSITION = 0xfe
} joint_mode;
void HTMotorInit(joint_instance* _instance,CAN_HandleTypeDef* _hcan,uint8_t tx_id,uint8_t rx_id);
void JointControl(joint_instance* _instance,float current);