chenged to 2 motor velocity-closed-loop; before testing

This commit is contained in:
2025-11-20 09:50:13 +08:00
parent dd8f7c006f
commit ed09f10c03
13 changed files with 276 additions and 261 deletions

View File

@@ -4,26 +4,31 @@
#include <stdint.h>
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
#define PI 3.14159265359f
#define _2PI 6.28318530718f
#define PI 3.14159265359f
#define _2PI 6.28318530718f
#define I2C_TX_PACKET_SIZE (1)
/*
* Number of bytes to received from target.
* This example uses FIFO with polling, and the maximum FIFO size is 8.
* Refer to interrupt examples to handle larger packets
*/
#define I2C_RX_PACKET_SIZE (2)
struct AS5600_Sensor {
int Mot_num;
float Angle;
float velocity;
float full_rotations;
float Last_Angle;
float Last_Vel_ts;
float Vel_Last_Angle;
};
void Set_Sensor(int Mot);
void MT6701_iic_read_angel(void);
void MT6701_get_angle_degree(void);
float GetAngle(void);
float GetAngle_NoTrack(void);
float GetVelocity(void);
float GetAngle(struct AS5600_Sensor *AS5600);
float GetAngle_NoTrack(struct AS5600_Sensor *AS5600);
float GetVelocity(struct AS5600_Sensor *AS5600_Vel);
#ifdef __cplusplus
}