开启底盘跟随,修改Peremeter.h中Yaw轴回正时编码器值以保证云台正确回中,由于抖动和严重发热,暂时关闭云台pitch轴控制

This commit is contained in:
2025-11-03 12:41:17 +08:00
parent 6504b5a614
commit 53a706d8f0
22 changed files with 665 additions and 652 deletions

View File

@@ -6,7 +6,7 @@
编译器使用Keil V5
目前正在调试,暂时关闭底盘跟随以防止疯转,云台急需调整
目前正在调试,暂时关闭云台pitch轴等待后续修复代码yaw轴皮带需调整
//Raw Code下的代码为被注释掉的源代码通常用于关闭某些异常或不需要的功能用于调试

View File

@@ -162,8 +162,6 @@ void Gimbal_PitchControl(void)
PID_PositionCalc(&Gimbal_PitchAnglePositionPID,AttitudeAlgorithms_DegRoll);
Gimbal_PitchAnglePositionPID.OUT=kalmanFilter(&kfp_PITCH,Gimbal_PitchAnglePositionPID.OUT);
Gimbal_PitchAngleSpeedPID.Need_Value=-Gimbal_PitchAnglePositionPID.OUT;
PID_PositionCalc(&Gimbal_PitchAngleSpeedPID,GM6020_MotorStatus[Gimbal_PitchMotor-0x205].Speed);
@@ -279,7 +277,7 @@ void Gimbal_Rammer(void)
*/
void Gimbal_MoveControl(void)
{
Gimbal_PitchControl();//云台Pitch轴控制
//Gimbal_PitchControl();//云台Pitch轴控制
Gimbal_YawControl();//云台Yaw轴控制
Gimbal_FiringMechanismControl();//摩擦轮控制

Binary file not shown.

View File

@@ -21,35 +21,35 @@ Target DLL: CMSIS_AGDI.dll V1.33.24.0
Dialog DLL: TCM.DLL V1.56.6.0
<h2>Project:</h2>
C:\Users\LSMushui\Desktop\RM\hero-test\Hero-C-Board-Legacy\<5C><>̨\<5C><>̨\Project.uvprojx
C:\Users\LSMushui\Desktop\RM\Hero-C-Board-Legacy\<5C><>̨\<5C><>̨\Project.uvprojx
Project File Date: 11/02/2025
<h2>Output:</h2>
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'C:\Users\LSMushui\AppData\Local\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'Target 1'
assembling startup_stm32f40_41xxx.s...
compiling stm32f4xx_adc.c...
compiling stm32f4xx_dac.c...
compiling stm32f4xx_dma.c...
compiling stm32f4xx_dcmi.c...
compiling misc.c...
compiling stm32f4xx_cryp_des.c...
compiling stm32f4xx_dfsdm.c...
compiling stm32f4xx_flash_ramfunc.c...
compiling system_stm32f4xx.c...
compiling stm32f4xx_dcmi.c...
compiling stm32f4xx_adc.c...
compiling stm32f4xx_fsmc.c...
compiling stm32f4xx_cryp_tdes.c...
compiling stm32f4xx_dsi.c...
compiling stm32f4xx_cryp.c...
compiling stm32f4xx_cec.c...
compiling stm32f4xx_fmpi2c.c...
compiling stm32f4xx_dma2d.c...
compiling stm32f4xx_cryp_des.c...
compiling stm32f4xx_dac.c...
compiling stm32f4xx_dbgmcu.c...
compiling stm32f4xx_exti.c...
compiling stm32f4xx_dfsdm.c...
compiling stm32f4xx_fmpi2c.c...
compiling stm32f4xx_flash_ramfunc.c...
compiling stm32f4xx_crc.c...
compiling stm32f4xx_gpio.c...
compiling stm32f4xx_can.c...
compiling stm32f4xx_fsmc.c...
compiling stm32f4xx_exti.c...
compiling stm32f4xx_cryp.c...
compiling stm32f4xx_dma2d.c...
compiling stm32f4xx_dma.c...
compiling stm32f4xx_flash.c...
compiling stm32f4xx_can.c...
compiling stm32f4xx_cryp_aes.c...
compiling stm32f4xx_hash.c...
compiling stm32f4xx_hash_md5.c...
@@ -61,23 +61,22 @@ compiling stm32f4xx_pwr.c...
compiling stm32f4xx_ltdc.c...
compiling stm32f4xx_qspi.c...
compiling stm32f4xx_rng.c...
compiling stm32f4xx_rcc.c...
compiling stm32f4xx_spdifrx.c...
compiling AHRS_middleware.c...
compiling stm32f4xx_sai.c...
compiling TIM.c...
compiling stm32f4xx_sdio.c...
compiling stm32f4xx_wwdg.c...
compiling stm32f4xx_usart.c...
compiling Delay.c...
compiling stm32f4xx_syscfg.c...
compiling stm32f4xx_sai.c...
compiling stm32f4xx_rcc.c...
compiling stm32f4xx_sdio.c...
compiling stm32f4xx_spi.c...
compiling user_lib.c...
compiling TIM.c...
compiling Delay.c...
compiling stm32f4xx_usart.c...
compiling AHRS_middleware.c...
compiling stm32f4xx_wwdg.c...
compiling stm32f4xx_rtc.c...
compiling UART.c...
compiling user_lib.c...
compiling stm32f4xx_tim.c...
compiling MyI2C.c...
compiling CAN.c...
compiling WaveFiltering_Kalman_Filtering.c...
Control\WaveFiltering_Kalman_Filtering.c(13): warning: #177-D: variable "pDst" was declared but never referenced
float pDst,pDst1=1.0f;
@@ -86,35 +85,36 @@ Control\WaveFiltering_Kalman_Filtering.c(13): warning: #177-D: variable "pDst1"
Control\WaveFiltering_Kalman_Filtering.c(32): warning: #1-D: last line of file ends without a newline
Control\WaveFiltering_Kalman_Filtering.c: 3 warnings, 0 errors
compiling CAN.c...
compiling LED.c...
compiling Buzzer.c...
compiling IST8310.c...
compiling Remote.c...
compiling Laser.c...
compiling BMI088.c...
compiling Laser.c...
compiling GM6020.c...
compiling M3508.c...
compiling LinkCheck.c...
compiling M2006.c...
compiling Warming.c...
compiling M3508.c...
compiling CToC.c...
compiling CloseLoopControl.c...
compiling AttitudeAlgorithms.c...
compiling CloseLoopControl.c...
compiling IMUTemperatureControl.c...
compiling PID.c...
compiling Keyboard.c...
compiling Gimbal.c...
compiling RefereeSystem.c...
compiling Visual.c...
CarBody\Visual.c(68): warning: #9-D: nested comment is not allowed
UART2_Printf("%f %f %f %f \n",Visual_Yaw,Visual_Pitch,Visual_GetRoll,Visual_GetDelay);//*0.0030518509475997f*/
CarBody\Visual.c(165): warning: #1-D: last line of file ends without a newline
}
CarBody\Visual.c: 2 warnings, 0 errors
compiling IMUTemperatureControl.c...
compiling RefereeSystem.c...
compiling Gimbal.c...
compiling Keyboard.c...
compiling main.c...
compiling stm32f4xx_it.c...
linking...
Program Size: Code=31544 RO-data=1236 RW-data=552 ZI-data=3520
Program Size: Code=31032 RO-data=1236 RW-data=552 ZI-data=3520
".\Objects\Project.axf" - 0 Error(s), 5 Warning(s).
<h2>Software Packages used:</h2>
@@ -127,7 +127,7 @@ Package Vendor: Keil
<h2>Collection of Component include folders:</h2>
<h2>Collection of Component Files used:</h2>
Build Time Elapsed: 00:00:04
Build Time Elapsed: 00:00:05
</pre>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -2273,7 +2273,7 @@ I (.\Library\stm32f4xx_dcmi.h)(0x64D03164)
I (.\Library\stm32f4xx_flash.h)(0x64D03164)
I (.\Library\stm32f4xx_gpio.h)(0x64D03164)
I (.\Library\stm32f4xx_i2c.h)(0x64D03164)
I (.\Library\stm32f4xx_iwdg.h)(0x64D03164)
I (.\Library\stm32f4xx_iwdg.h)(0x64D03164)
I (.\Library\stm32f4xx_pwr.h)(0x64D03164)
I (.\Library\stm32f4xx_rcc.h)(0x64D03164)
I (.\Library\stm32f4xx_rtc.h)(0x64D03164)
@@ -2442,7 +2442,7 @@ I (Control\WaveFiltering_Kalman_Filtering.h)(0x67B835FF)
I (.\User\stm32f4xx_conf.h)(0x64D03180)
I (.\Library\stm32f4xx_adc.h)(0x64D03164)
I (.\Library\stm32f4xx_crc.h)(0x64D03164)
I (.\Library\stm32f4xx_dbgmcu.h)(0x64D03164)
I (.\Library\stm32f4xx_dbgmcu.h)(0x64D03164)
I (.\Library\stm32f4xx_dma.h)(0x64D03164)
I (.\Library\stm32f4xx_exti.h)(0x64D03164)
I (.\Library\stm32f4xx_flash.h)(0x64D03164)
@@ -2477,7 +2477,7 @@ I (.\Library\stm32f4xx_can.h)(0x64D03164)
-o .\objects\m2006.o --omf_browse .\objects\m2006.crf --depend .\objects\m2006.d)
I (.\Start\stm32f4xx.h)(0x66256792)
I (.\Start\core_cm4.h)(0x64D03162)
I (.\Start\core_cm4.h)(0x64D03162)
I (C:\Users\LSMushui\AppData\Local\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5E8E3CC2)
I (.\Start\core_cmInstr.h)(0x64D03162)
I (.\Start\core_cmFunc.h)(0x64D03162)
@@ -2670,13 +2670,13 @@ I (.\Function\CToC.h)(0x669D31F6)
I (.\Start\system_stm32f4xx.h)(0x64D03132)
I (.\User\stm32f4xx_conf.h)(0x64D03180)
I (.\Library\stm32f4xx_adc.h)(0x64D03164)
I (.\Library\stm32f4xx_crc.h)(0x64D03164)
I (.\Library\stm32f4xx_crc.h)(0x64D03164)
I (.\Library\stm32f4xx_dbgmcu.h)(0x64D03164)
I (.\Library\stm32f4xx_dma.h)(0x64D03164)
I (.\Library\stm32f4xx_exti.h)(0x64D03164)
I (.\Library\stm32f4xx_flash.h)(0x64D03164)
I (.\Library\stm32f4xx_gpio.h)(0x64D03164)
I (.\Library\stm32f4xx_i2c.h)(0x64D03164)
I (.\Library\stm32f4xx_i2c.h)(0x64D03164)
I (.\Library\stm32f4xx_iwdg.h)(0x64D03164)
I (.\Library\stm32f4xx_pwr.h)(0x64D03164)
I (.\Library\stm32f4xx_rcc.h)(0x64D03164)

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -2098,7 +2098,7 @@
<Group>
<GroupName>CarBody</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>

View File

@@ -2,7 +2,7 @@
#define __PARAMETER_H
/*=============================================结构参数=============================================*/
#define Yaw_GM6020PositionValue 1000//Yaw轴编码器值4050
#define Yaw_GM6020PositionValue 6200////Yaw轴回正时编码器值
#define Pitch_GM6020PositionValue 3245//Pitch轴编码器值
#define Pitch_GM6020PositionLowerLinit 7363//Pitch轴编码器值下限7363
#define Pitch_GM6020PositionUpperLinit 8625//Pitch轴编码器值上限433 8625

View File

@@ -58,7 +58,7 @@ void Mecanum_Init(void)
//Raw Code//
//PID_PositionSetParameter(&Mecanum_TrackPID,0.007,0,0.8);
//Testing Code//
PID_PositionSetParameter(&Mecanum_TrackPID,0.00,0,0);
PID_PositionSetParameter(&Mecanum_TrackPID,0.01,0,01);//随便写的PID值勉强可以用
PID_PositionSetEkRange(&Mecanum_TrackPID,-1,1);
PID_PositionSetOUTRange(&Mecanum_TrackPID,-4,4);
@@ -172,9 +172,9 @@ void Mecanum_PowerMoveControl(void)
}
//Raw Code//
//int16_t Raw_Theta=Yaw_GM6020PositionValue-GM6020_MotorStatus[0].Angle;//获取底盘云台相对角度原始数据
int16_t Raw_Theta=Yaw_GM6020PositionValue-GM6020_MotorStatus[0].Angle;//获取底盘云台相对角度原始数据
//Testing Code//
int16_t Raw_Theta=0;//关闭云台角度,仅用于调试底盘
//int16_t Raw_Theta=0;//关闭云台角度,仅用于调试底盘
if(Raw_Theta<0)Raw_Theta+=8192;
//Mecanum_YawTheta=Raw_Theta/8192.0f*2.0f*3.141592653589793238462643383279f;

Binary file not shown.

View File

@@ -29,26 +29,26 @@ Project File Date: 11/02/2025
Rebuild target 'Target 1'
assembling startup_stm32f40_41xxx.s...
compiling system_stm32f4xx.c...
compiling stm32f4xx_cryp.c...
compiling stm32f4xx_adc.c...
compiling stm32f4xx_dcmi.c...
compiling stm32f4xx_cryp_des.c...
compiling stm32f4xx_dfsdm.c...
compiling stm32f4xx_cryp_tdes.c...
compiling stm32f4xx_crc.c...
compiling stm32f4xx_cec.c...
compiling stm32f4xx_dac.c...
compiling stm32f4xx_dbgmcu.c...
compiling stm32f4xx_dsi.c...
compiling stm32f4xx_dac.c...
compiling stm32f4xx_fmpi2c.c...
compiling stm32f4xx_dma2d.c...
compiling stm32f4xx_cec.c...
compiling stm32f4xx_can.c...
compiling stm32f4xx_dfsdm.c...
compiling stm32f4xx_cryp.c...
compiling stm32f4xx_crc.c...
compiling stm32f4xx_flash_ramfunc.c...
compiling stm32f4xx_dsi.c...
compiling stm32f4xx_exti.c...
compiling stm32f4xx_dcmi.c...
compiling misc.c...
compiling stm32f4xx_gpio.c...
compiling stm32f4xx_can.c...
compiling stm32f4xx_flash_ramfunc.c...
compiling stm32f4xx_exti.c...
compiling stm32f4xx_dma.c...
compiling stm32f4xx_dma2d.c...
compiling stm32f4xx_cryp_tdes.c...
compiling stm32f4xx_cryp_des.c...
compiling stm32f4xx_fsmc.c...
compiling stm32f4xx_dma.c...
compiling stm32f4xx_flash.c...
compiling stm32f4xx_cryp_aes.c...
compiling stm32f4xx_hash.c...
@@ -57,45 +57,45 @@ compiling stm32f4xx_hash_sha1.c...
compiling stm32f4xx_lptim.c...
compiling stm32f4xx_iwdg.c...
compiling stm32f4xx_i2c.c...
compiling stm32f4xx_pwr.c...
compiling stm32f4xx_ltdc.c...
compiling stm32f4xx_qspi.c...
compiling stm32f4xx_pwr.c...
compiling stm32f4xx_rng.c...
compiling TIM.c...
compiling stm32f4xx_sdio.c...
compiling stm32f4xx_ltdc.c...
compiling stm32f4xx_spdifrx.c...
compiling stm32f4xx_sai.c...
compiling stm32f4xx_rcc.c...
compiling Delay.c...
compiling stm32f4xx_wwdg.c...
compiling stm32f4xx_syscfg.c...
compiling stm32f4xx_sdio.c...
compiling stm32f4xx_spi.c...
compiling stm32f4xx_usart.c...
compiling stm32f4xx_syscfg.c...
compiling stm32f4xx_rtc.c...
compiling stm32f4xx_wwdg.c...
compiling stm32f4xx_usart.c...
compiling TIM.c...
compiling Delay.c...
compiling CAN.c...
compiling UART.c...
compiling stm32f4xx_tim.c...
compiling CAN.c...
compiling LED.c...
compiling Buzzer.c...
compiling Remote.c...
compiling LinkCheck.c...
compiling M3508.c...
compiling GM6020.c...
compiling Warming.c...
compiling LinkCheck.c...
compiling CToC.c...
compiling CloseLoopControl.c...
compiling Warming.c...
compiling PID.c...
compiling UI.c...
compiling CloseLoopControl.c...
compiling RefereeSystem_CRCTable.c...
compiling Ultra_CAP.c...
compiling RefereeSystem.c...
compiling stm32f4xx_it.c...
compiling UI_Base.c...
compiling Ultra_CAP.c...
compiling UI.c...
compiling Mecanum.c...
compiling main.c...
compiling UI_Base.c...
compiling UI_Library.c...
compiling stm32f4xx_it.c...
compiling main.c...
linking...
Program Size: Code=18624 RO-data=1224 RW-data=408 ZI-data=2496
Program Size: Code=18636 RO-data=1224 RW-data=408 ZI-data=2496
".\Objects\Project.axf" - 0 Error(s), 0 Warning(s).
<h2>Software Packages used:</h2>
@@ -108,7 +108,7 @@ Package Vendor: Keil
<h2>Collection of Component include folders:</h2>
<h2>Collection of Component Files used:</h2>
Build Time Elapsed: 00:00:04
Build Time Elapsed: 00:00:05
</pre>
</body>
</html>

View File

@@ -3,7 +3,7 @@
<title>Static Call Graph - [.\Objects\Project.axf]</title></head>
<body><HR>
<H1>Static Call Graph for image .\Objects\Project.axf</H1><HR>
<BR><P>#&#060CALLGRAPH&#062# ARM Linker, 5060960: Last Updated: Sun Nov 02 21:32:48 2025
<BR><P>#&#060CALLGRAPH&#062# ARM Linker, 5060960: Last Updated: Mon Nov 03 12:34:21 2025
<BR><P>
<H3>Maximum Stack Usage = 232 bytes + Unknown(Cycles, Untraceable Function Pointers)</H3><H3>
Call chain for Maximum Stack Depth:</H3>
@@ -934,7 +934,7 @@ Global Symbols
<BR>[Called By]<UL><LI><a href="#[96]">&gt;&gt;</a>&nbsp;&nbsp;&nbsp;CloseLoopControl_Init
</UL>
<P><STRONG><a name="[b0]"></a>Mecanum_PowerMoveControl</STRONG> (Thumb, 1994 bytes, Stack size 80 bytes, mecanum.o(i.Mecanum_PowerMoveControl))
<P><STRONG><a name="[b0]"></a>Mecanum_PowerMoveControl</STRONG> (Thumb, 2004 bytes, Stack size 80 bytes, mecanum.o(i.Mecanum_PowerMoveControl))
<BR><BR>[Stack]<UL><LI>Max Depth = 224<LI>Call Chain = Mecanum_PowerMoveControl &rArr; Mecanum_ControlSpeed &rArr; __aeabi_dadd &rArr; _double_epilogue &rArr; _double_round
</UL>
<BR>[Calls]<UL><LI><a href="#[b4]">&gt;&gt;</a>&nbsp;&nbsp;&nbsp;Ultra_CAP_SetPower

View File

@@ -2132,7 +2132,7 @@ I (.\Library\stm32f4xx_dcmi.h)(0x64D03164)
I (C:\Users\LSMushui\AppData\Local\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5E8E3CC2)
I (.\Start\core_cmInstr.h)(0x64D03162)
I (.\Start\core_cmFunc.h)(0x64D03162)
I (.\Start\core_cmSimd.h)(0x64D03162)
I (.\Start\core_cmSimd.h)(0x64D03162)
I (.\Start\system_stm32f4xx.h)(0x64D03132)
I (.\User\stm32f4xx_conf.h)(0x64D03180)
I (.\Library\stm32f4xx_adc.h)(0x64D03164)
@@ -2172,7 +2172,7 @@ I (.\Motor\M3508.h)(0x669D0F64)
-D__UVISION_VERSION="543" -DSTM32F407xx -DUSE_STDPERIPH_DRIVER -DSTM32F40_41xxx
-o .\objects\m3508.o --omf_browse .\objects\m3508.crf --depend .\objects\m3508.d)
I (.\Start\stm32f4xx.h)(0x64F48C00)
I (.\Start\stm32f4xx.h)(0x64F48C00)
I (.\Start\core_cm4.h)(0x64D03162)
I (C:\Users\LSMushui\AppData\Local\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5E8E3CC2)
I (.\Start\core_cmInstr.h)(0x64D03162)
@@ -2458,14 +2458,14 @@ I (.\Function\LinkCheck.h)(0x65F5DCF4)
I (.\Library\stm32f4xx_dma.h)(0x64D03164)
I (.\Library\stm32f4xx_exti.h)(0x64D03164)
I (.\Library\stm32f4xx_flash.h)(0x64D03164)
I (.\Library\stm32f4xx_gpio.h)(0x64D03164)
I (.\Library\stm32f4xx_gpio.h)(0x64D03164)
I (.\Library\stm32f4xx_i2c.h)(0x64D03164)
I (.\Library\stm32f4xx_iwdg.h)(0x64D03164)
I (.\Library\stm32f4xx_pwr.h)(0x64D03164)
I (.\Library\stm32f4xx_rcc.h)(0x64D03164)
I (.\Library\stm32f4xx_rtc.h)(0x64D03164)
I (.\Library\stm32f4xx_sdio.h)(0x64D03164)
I (.\Library\stm32f4xx_spi.h)(0x64D03164)
I (.\Library\stm32f4xx_spi.h)(0x64D03164)
I (.\Library\stm32f4xx_syscfg.h)(0x64D03164)
I (.\Library\stm32f4xx_tim.h)(0x64D03164)
I (.\Library\stm32f4xx_usart.h)(0x64D03164)

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -1767,7 +1767,7 @@
<Group>
<GroupName>Control</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -1799,7 +1799,7 @@
<Group>
<GroupName>CarBody</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -1975,7 +1975,7 @@
<Group>
<GroupName>User</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>

View File

@@ -2,7 +2,7 @@
#define __PARAMETER_H
/*=============================================结构参数=============================================*/
#define Yaw_GM6020PositionValue 4050//Yaw轴编码器值
#define Yaw_GM6020PositionValue 6200//Yaw轴回正时编码器值
/*=============================================麦轮参数=============================================*/
#define Mecanum_WheelRadius 7.0f//麦轮半径(单位cm)