before changing to soft iic

This commit is contained in:
2025-11-17 15:48:49 +08:00
parent 6de9d53e1c
commit 47e90abcb1
5 changed files with 3608 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
#ifndef CONFIG_H #ifndef CONFIG_H
#define CONFIG_H #define CONFIG_H
#define DEBUG_ENABLED false #define DEBUG_ENABLED true
#define DEBUG_MT_ENABLED false #define DEBUG_MT_ENABLED false
#define DEBUG_DFOC_ENABLED false #define DEBUG_DFOC_ENABLED false
#endif #endif

View File

@@ -129,9 +129,9 @@ void Set_Angle(float Target)
{ {
printf("angle readback in dfoc.c is %f \n", langle); printf("angle readback in dfoc.c is %f \n", langle);
} }
volatile float Uq = PID_Controller(0.133, 0.01, 0, (Target - Dir * langle) * 180 / PI); volatile float Uq = PID_Controller(0.067, 0.01, 0, (Target - Dir * langle) * 180 / PI);
//volatile float Uq = PID_Controller(0.06, 0, 0, (Target - Dir * langle) * 180 / PI); //volatile float Uq = PID_Controller(0.06, 0, 0, (Target - Dir * langle) * 180 / PI);
if(DEBUG_ENABLED) if(DEBUG_ENABLED& DEBUG_DFOC_ENABLED)
{ {
printf("Uq is %f \n", Uq); printf("Uq is %f \n", Uq);
} }

View File

@@ -1,6 +1,6 @@
#include <stdint.h> #include <stdint.h>
#include <ti_msp_dl_config.h> #include <ti_msp_dl_config.h>
#define limit 6.3 #define limit 5.0
#define Output_ramp 10000 #define Output_ramp 10000
//限幅 //限幅

View File

@@ -54,13 +54,13 @@ volatile float Target = 0; //串口目标值
const int pp = 7; //电机极对数 const int pp = 7; //电机极对数
const int Dir = 1; //电机编码器方向 const int Dir = -1; //电机编码器方向
#define UART_PACKET_SIZE (4) #define UART_PACKET_SIZE (6)
/* Data received from UART */ /* Data received from UART */
volatile uint8_t gUartRxPacket[UART_PACKET_SIZE] ={'a','b','c','d'}; volatile uint8_t gUartRxPacket[UART_PACKET_SIZE] ={'a','b','c','d','e','f'};
volatile bool gCheckUART; volatile bool gCheckUART;
@@ -135,7 +135,7 @@ int main(void)
parse_uart_cmd(); parse_uart_cmd();
Set_Angle(Target); Set_Angle(Target);
} }
//delay_ms(10); delay_ms(10);
} }

3600
keil/JLinkLog.txt Normal file

File diff suppressed because it is too large Load Diff