同步最新代码,pitch、yaw正常开启,等待单发限位代码

This commit is contained in:
2026-03-23 19:28:52 +08:00
parent 1bc3278657
commit d56e5c6d8c
162 changed files with 12753 additions and 5456 deletions

View File

@@ -60,7 +60,7 @@ void Gimbal_Init(void)
PID_PositionSetOUTRange(&Gimbal_PitchAngleSpeedPID,-30000,30000);
*/
PID_PositionStructureInit(&Gimbal_YawAnglePositionPID,0);//Yaw轴陀螺仪闭环
PID_PositionSetParameter(&Gimbal_YawAnglePositionPID,5,0,0.1);
PID_PositionSetParameter(&Gimbal_YawAnglePositionPID,10,0,650);
PID_PositionSetEkRange(&Gimbal_YawAnglePositionPID,-1,1);
PID_PositionSetOUTRange(&Gimbal_YawAnglePositionPID,-200,200);
PID_PositionStructureInit(&Gimbal_YawAngleSpeedPID,200);
@@ -69,32 +69,32 @@ void Gimbal_Init(void)
PID_PositionSetOUTRange(&Gimbal_YawAngleSpeedPID,-50000,50000);
PID_PositionStructureInit(&Gimbal_PitchAnglePositionPID,0);//Pitch轴陀螺仪闭环
PID_PositionSetParameter(&Gimbal_PitchAnglePositionPID,5,0,0);
PID_PositionSetEkRange(&Gimbal_PitchAnglePositionPID,-1,1);
PID_PositionSetOUTRange(&Gimbal_PitchAnglePositionPID,-150,150);
PID_PositionSetParameter(&Gimbal_PitchAnglePositionPID,40,0,700);
PID_PositionSetEkRange(&Gimbal_PitchAnglePositionPID,-0.1,0.1);
PID_PositionSetOUTRange(&Gimbal_PitchAnglePositionPID,-200,200);
PID_PositionStructureInit(&Gimbal_PitchAngleSpeedPID,150);
PID_PositionSetParameter(&Gimbal_PitchAngleSpeedPID,200,0,10);
PID_PositionSetEkRange(&Gimbal_PitchAngleSpeedPID,-0,0);
PID_PositionSetOUTRange(&Gimbal_PitchAngleSpeedPID,-30000,30000);
PID_PositionSetParameter(&Gimbal_PitchAngleSpeedPID,150,0.001,7);
PID_PositionSetEkRange(&Gimbal_PitchAngleSpeedPID,-0.1,0.1);
PID_PositionSetOUTRange(&Gimbal_PitchAngleSpeedPID,-50000,50000);
PID_PositionStructureInit(&Gimbal_L1_FrictionWheelPID,0);//左摩擦轮
PID_PositionSetParameter(&Gimbal_L1_FrictionWheelPID,0.1,0,0);
PID_PositionSetEkRange(&Gimbal_L1_FrictionWheelPID,-5,5);
PID_PositionSetParameter(&Gimbal_L1_FrictionWheelPID,15,0,0);
PID_PositionSetEkRange(&Gimbal_L1_FrictionWheelPID,-1,1);
PID_PositionSetOUTRange(&Gimbal_L1_FrictionWheelPID,-15000,15000);
PID_PositionStructureInit(&Gimbal_R1_FrictionWheelPID,0);//右摩擦轮
PID_PositionSetParameter(&Gimbal_R1_FrictionWheelPID,0.1,0,0);
PID_PositionSetEkRange(&Gimbal_R1_FrictionWheelPID,-5,5);
PID_PositionSetParameter(&Gimbal_R1_FrictionWheelPID,15,0,0);
PID_PositionSetEkRange(&Gimbal_R1_FrictionWheelPID,-1,1);
PID_PositionSetOUTRange(&Gimbal_R1_FrictionWheelPID,-15000,15000);
PID_PositionStructureInit(&Gimbal_L2_FrictionWheelPID,0);//左摩擦轮
PID_PositionSetParameter(&Gimbal_L2_FrictionWheelPID,0.1,0,0);
PID_PositionSetEkRange(&Gimbal_L2_FrictionWheelPID,-5,5);
PID_PositionSetParameter(&Gimbal_L2_FrictionWheelPID,15,0,0);
PID_PositionSetEkRange(&Gimbal_L2_FrictionWheelPID,-1,1);
PID_PositionSetOUTRange(&Gimbal_L2_FrictionWheelPID,-15000,15000);
PID_PositionStructureInit(&Gimbal_R2_FrictionWheelPID,0);//右摩擦轮
PID_PositionSetParameter(&Gimbal_R2_FrictionWheelPID,0.1,0,0);
PID_PositionSetEkRange(&Gimbal_R2_FrictionWheelPID,-5,5);
PID_PositionSetParameter(&Gimbal_R2_FrictionWheelPID,15,0,0);
PID_PositionSetEkRange(&Gimbal_R2_FrictionWheelPID,-1,1);
PID_PositionSetOUTRange(&Gimbal_R2_FrictionWheelPID,-15000,15000);
PID_PositionStructureInit(&Gimbal_RammerSpinSpeedPID,Gimbal_RammerSpeed);//拨弹盘
@@ -160,7 +160,7 @@ void Gimbal_PitchControl(void)
//串级PID闭环Pitch角
PID_PositionCalc(&Gimbal_PitchAnglePositionPID,AttitudeAlgorithms_DegRoll);
Gimbal_PitchAnglePositionPID.OUT=kalmanFilter(&kfp_PITCH,Gimbal_PitchAnglePositionPID.OUT);
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);

View File

@@ -12,6 +12,32 @@ KFP kfp={0.02,0,0,0,0.01,0.543};//卡尔曼滤波器结构体
float AttitudeAlgorithms_q[4];//姿态解算四元数
float AttitudeAlgorithms_RadYaw,AttitudeAlgorithms_RadPitch,AttitudeAlgorithms_RadRoll;//弧度制角度
float AttitudeAlgorithms_DegYaw,AttitudeAlgorithms_DegPitch,AttitudeAlgorithms_DegRoll;//角度制角度
float BMI088_GyroZeroOffset[3];//陀螺仪初始零偏
float BMI088_GyroWithoutOffset[3];//消除零偏后的陀螺仪数据
/*
*函数简介:BMI088清除零偏
*参数说明:无
*返回类型:无
*备注:采集前100次数据取平均值消除零偏
*/
void ZeroOffset_Calibration(void)
{
uint16_t BMI088_CountFlag;
for (BMI088_CountFlag=0; BMI088_CountFlag < 1000; BMI088_CountFlag++)
{
BMI088_GyroZeroOffset[0]=BMI088_GyroZeroOffset[0]+BMI088_Gyro[0];
}
BMI088_GyroZeroOffset[0]=BMI088_GyroZeroOffset[0]/1000;
for (BMI088_CountFlag=0; BMI088_CountFlag < 1000; BMI088_CountFlag++)
{
BMI088_GyroZeroOffset[1]=BMI088_GyroZeroOffset[1]+BMI088_Gyro[1];
}
BMI088_GyroZeroOffset[1]=BMI088_GyroZeroOffset[1]/1000;
}
/*
*函数简介:姿态解算初始化

View File

@@ -842,16 +842,16 @@ ARM Macro Assembler Page 13
00000000
Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M4.fp.sp --apcs=
interwork --depend=.\objects\startup_stm32f40_41xxx.d -o.\objects\startup_stm32
f40_41xxx.o -IC:\Users\LSMushui\AppData\Local\Arm\Packs\Keil\STM32F4xx_DFP\3.1.
f40_41xxx.o -ID:\useless\ARM\PACK\Keil\STM32F4xx_DFP\3.0.0\Drivers\CMSIS\Device
ARM Macro Assembler Page 14
1\Drivers\CMSIS\Device\ST\STM32F4xx\Include --predefine="__MICROLIB SETA 1" --p
redefine="__UVISION_VERSION SETA 543" --predefine="STM32F407xx SETA 1" --list=.
\listings\startup_stm32f40_41xxx.lst Start\startup_stm32f40_41xxx.s
\ST\STM32F4xx\Include --predefine="__MICROLIB SETA 1" --predefine="__UVISION_VE
RSION SETA 539" --predefine="STM32F407xx SETA 1" --list=.\listings\startup_stm3
2f40_41xxx.lst Start\startup_stm32f40_41xxx.s

Binary file not shown.

View File

@@ -3,131 +3,43 @@
<pre>
<h1><EFBFBD>Vision Build Log</h1>
<h2>Tool Versions:</h2>
IDE-Version: <20><>Vision V5.43.1.0
Copyright (C) 2025 ARM Ltd and ARM Germany GmbH. All rights reserved.
License Information: LS Mushui, 1, LIC=NQQMA-1N3GT-30GNC-71PK8-06QJT-WGQ3X
IDE-Version: <20><>Vision V5.39.0.0
Copyright (C) 2023 ARM Ltd and ARM Germany GmbH. All rights reserved.
License Information: sun JXF, sun, LIC=HN0AE-5SW5I-PCIJ8-3MDKX-KLD28-41CF7
Tool Versions:
Toolchain: MDK-ARM Plus Version: 5.43.0.0
Toolchain Path: C:\Users\LSMushui\AppData\Local\Keil_v5\ARM\ARMCC\Bin
Toolchain: MDK-ARM Plus Version: 5.39.0.0
Toolchain Path: D:\useless\ARM\ARM_Compiler_5.06u7\Bin
C Compiler: Armcc.exe V5.06 update 7 (build 960)
Assembler: Armasm.exe V5.06 update 7 (build 960)
Linker/Locator: ArmLink.exe V5.06 update 7 (build 960)
Library Manager: ArmAr.exe V5.06 update 7 (build 960)
Hex Converter: FromElf.exe V5.06 update 7 (build 960)
CPU DLL: SARMCM3.DLL V5.43.0.0
CPU DLL: SARMCM3.DLL V5.39.0.0
Dialog DLL: DCM.DLL V1.17.5.0
Target DLL: CMSIS_AGDI.dll V1.33.24.0
Dialog DLL: TCM.DLL V1.56.6.0
Target DLL: CMSIS_AGDI.dll V1.33.16.0
Dialog DLL: TCM.DLL V1.56.4.0
<h2>Project:</h2>
C:\Users\LSMushui\Desktop\RM\Hero-C-Board-Legacy\<5C><>̨\<5C><>̨\Project.uvprojx
Project File Date: 11/02/2025
D:\robomaster\Hero-C-Board-Legacy-main\hero-c-board-legacy\<5C><>̨\<5C><>̨\Project.uvprojx
Project File Date: 03/14/2026
<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 system_stm32f4xx.c...
compiling stm32f4xx_cec.c...
compiling stm32f4xx_can.c...
compiling stm32f4xx_crc.c...
compiling stm32f4xx_dsi.c...
compiling misc.c...
compiling stm32f4xx_cryp_des.c...
compiling stm32f4xx_adc.c...
compiling stm32f4xx_cryp.c...
compiling stm32f4xx_flash_ramfunc.c...
compiling stm32f4xx_dcmi.c...
compiling stm32f4xx_cryp_aes.c...
compiling stm32f4xx_dbgmcu.c...
compiling stm32f4xx_dfsdm.c...
compiling stm32f4xx_fmpi2c.c...
compiling stm32f4xx_dma.c...
compiling stm32f4xx_dma2d.c...
compiling stm32f4xx_cryp_tdes.c...
compiling stm32f4xx_gpio.c...
compiling stm32f4xx_dac.c...
compiling stm32f4xx_exti.c...
compiling stm32f4xx_flash.c...
compiling stm32f4xx_fsmc.c...
compiling stm32f4xx_hash_md5.c...
compiling stm32f4xx_hash_sha1.c...
compiling stm32f4xx_iwdg.c...
compiling stm32f4xx_hash.c...
compiling stm32f4xx_lptim.c...
compiling stm32f4xx_rng.c...
compiling stm32f4xx_i2c.c...
compiling stm32f4xx_qspi.c...
compiling stm32f4xx_pwr.c...
compiling stm32f4xx_spdifrx.c...
compiling stm32f4xx_sdio.c...
compiling stm32f4xx_ltdc.c...
compiling stm32f4xx_syscfg.c...
compiling stm32f4xx_spi.c...
compiling stm32f4xx_sai.c...
compiling stm32f4xx_rtc.c...
compiling stm32f4xx_rcc.c...
compiling Delay.c...
compiling stm32f4xx_wwdg.c...
compiling stm32f4xx_usart.c...
compiling stm32f4xx_tim.c...
compiling TIM.c...
compiling UART.c...
compiling AHRS_middleware.c...
compiling user_lib.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;
Control\WaveFiltering_Kalman_Filtering.c(13): warning: #177-D: variable "pDst1" was declared but never referenced
float pDst,pDst1=1.0f;
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 MyI2C.c...
compiling CAN.c...
compiling Buzzer.c...
compiling LED.c...
compiling IST8310.c...
compiling Remote.c...
compiling BMI088.c...
compiling Laser.c...
compiling CloseLoopControl.c...
compiling LinkCheck.c...
compiling Warming.c...
compiling M3508.c...
compiling M2006.c...
compiling GM6020.c...
compiling AttitudeAlgorithms.c...
compiling CToC.c...
compiling IMUTemperatureControl.c...
compiling PID.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 Gimbal.c...
compiling RefereeSystem.c...
compiling Keyboard.c...
compiling main.c...
compiling stm32f4xx_it.c...
linking...
Program Size: Code=31636 RO-data=1236 RW-data=552 ZI-data=3520
".\Objects\Project.axf" - 0 Error(s), 5 Warning(s).
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\useless\ARM\ARM_Compiler_5.06u7\Bin'
Build target 'Target 1'
".\Objects\Project.axf" - 0 Error(s), 0 Warning(s).
<h2>Software Packages used:</h2>
Package Vendor: Keil
https://www.keil.com/pack/Keil.STM32F4xx_DFP.3.1.1.pack
Keil::STM32F4xx_DFP@3.1.1
https://www.keil.com/pack/Keil.STM32F4xx_DFP.3.0.0.pack
Keil::STM32F4xx_DFP@3.0.0
STMicroelectronics STM32F4 Series Device Support
<h2>Collection of Component include folders:</h2>
<h2>Collection of Component Files used:</h2>
Build Time Elapsed: 00:00:05
Build Time Elapsed: 00:00:00
</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: Sat Mar 14 13:25:17 2026
<BR><P>#&#060CALLGRAPH&#062# ARM Linker, 5060960: Last Updated: Sat Mar 21 13:37:53 2026
<BR><P>
<H3>Maximum Stack Usage = 280 bytes + Unknown(Cycles, Untraceable Function Pointers)</H3><H3>
Call chain for Maximum Stack Depth:</H3>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,16 @@
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x08000000 0x00100000 { ; load region size_region
ER_IROM1 0x08000000 0x00100000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM1 0x20000000 0x00020000 { ; RW data
.ANY (+RW +ZI)
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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

@@ -103,7 +103,7 @@
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>3</nTsel>
<nTsel>2</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
@@ -120,7 +120,7 @@
<SetRegEntry>
<Number>0</Number>
<Key>CMSIS_AGDI</Key>
<Name>-X"CMSIS-DAP_LU" -ULU_2022_8888 -O206 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407IGHx$CMSIS\Flash\STM32F4xx_1024.FLM)</Name>
<Name>-X"CMSIS-DAP_LU" -ULU_2022_8888 -O206 -S8 -C0 -P00000000 -N00("") -D00(00000000) -L00(0) -TO65554 -TC10000000 -TT10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407IGHx$CMSIS\Flash\STM32F4xx_1024.FLM)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>

View File

@@ -10,14 +10,14 @@
<TargetName>Target 1</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pArmCC>5060960::V5.06 update 7 (build 960)::.\ARMCC</pArmCC>
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
<pArmCC>5060960::V5.06 update 7 (build 960)::.\ARM_Compiler_5.06u7</pArmCC>
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARM_Compiler_5.06u7</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STM32F407IGHx</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32F4xx_DFP.3.1.1</PackID>
<PackID>Keil.STM32F4xx_DFP.3.0.0</PackID>
<PackURL>https://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x00020000) IRAM2(0x10000000,0x00010000) IROM(0x08000000,0x00100000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>