Compare commits

...

2 Commits

Author SHA1 Message Date
RB
695262bcd1 修改recy模式 2025-03-18 17:56:31 +08:00
RB
6d581c4c04 修改热量控制 2025-03-16 22:40:45 +08:00
6 changed files with 8717 additions and 8701 deletions

View File

@ -397,7 +397,30 @@
<WinNumber>1</WinNumber>
<ItemText>for_cap</ItemText>
</Ww>
<Ww>
<count>8</count>
<WinNumber>1</WinNumber>
<ItemText>ref</ItemText>
</Ww>
<Ww>
<count>9</count>
<WinNumber>1</WinNumber>
<ItemText>param_default</ItemText>
</Ww>
<Ww>
<count>10</count>
<WinNumber>1</WinNumber>
<ItemText>shoot</ItemText>
</Ww>
</WatchWindow1>
<MemoryWindow4>
<Mm>
<WinNumber>4</WinNumber>
<SubType>0</SubType>
<ItemText>for_chassis</ItemText>
<AccSizeX>0</AccSizeX>
</Mm>
</MemoryWindow4>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
@ -1796,7 +1819,7 @@
<GroupNumber>12</GroupNumber>
<FileNumber>105</FileNumber>
<FileType>1</FileType>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\User\module\shoot.c</PathWithFileName>

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -103,6 +103,7 @@ inline float CalculateRpm(float bullet_speed, float fric_radius, bool is17mm) {
if (is17mm) {
if (bullet_speed == 15.0f) return 4670.f;
if (bullet_speed == 18.0f) return 5200.f;
if (bullet_speed == 25.0f) return 6600.f;
if (bullet_speed == 30.0f) return 7350.f;
} else {
if (bullet_speed == 10.0f) return 4450.f;

View File

@ -188,7 +188,7 @@ static const Config_RobotParam_t param_default = {
.cover_open_duty = 0.10f,
.cover_close_duty = 0.050f,
.model = SHOOT_MODEL_17MM,
.bullet_speed = 30.f,
.bullet_speed = 25.f,
.min_shoot_delay = (uint32_t)(1000.0f / 10.0f),
}, /* shoot */

View File

@ -15,7 +15,7 @@
#define HEAT_INCREASE_17MM (10.f) /* 每发射一颗17mm弹丸增加10热量 */
#define BULLET_SPEED_LIMIT_42MM (16.0)
#define BULLET_SPEED_LIMIT_17MM (30.0)
#define BULLET_SPEED_LIMIT_17MM (25.0)
/* Private macro ------------------------------------------------------------ */
/* Private variables -------------------------------------------------------- */
@ -84,7 +84,7 @@ static int8_t Shoot_HeatLimit(Shoot_t *s, Referee_ForShoot_t *s_ref) {
/* 检测热量更新后,计算可发射弹丸 */
if ((hc->heat != hc->last_heat) || (hc->heat == 0)) {
hc->available_shot =
(uint32_t)floorf((hc->heat_limit - hc->heat) / hc->heat_increase);
(uint32_t)floorf((hc->heat_limit - hc->heat) / hc->heat_increase) - 2;
hc->last_heat = hc->heat;
}
/* 计算已发射弹丸 */
@ -222,10 +222,11 @@ int8_t Shoot_Control(Shoot_t *s, CMD_ShootCmd_t *s_cmd,
}
break;
}
case FIRE_MODE_CONT: { /* 持续开火模式 */
float shoot_freq = HeatLimit_ShootFreq(
s->heat_ctrl.heat, s->heat_ctrl.heat_limit, s->heat_ctrl.cooling_rate,
s->heat_ctrl.heat_increase, s->param->model == SHOOT_MODEL_17MM);
case FIRE_MODE_CONT: { /* Recy模式 */
// float shoot_freq = HeatLimit_ShootFreq(
// s->heat_ctrl.heat, s->heat_ctrl.heat_limit, s->heat_ctrl.cooling_rate,
// s->heat_ctrl.heat_increase, s->param->model == SHOOT_MODEL_17MM);
float shoot_freq = 20.0f; //射频
s->fire_ctrl.period_ms =
(shoot_freq == 0.0f) ? UINT32_MAX : (uint32_t)(1000.f / shoot_freq);
break;