修改参数

This commit is contained in:
ZHAISHUI04 2025-07-13 01:42:10 +08:00
parent 6cf2fb649b
commit bea23c3860
7 changed files with 30 additions and 10 deletions

View File

@ -200,6 +200,11 @@
<WinNumber>1</WinNumber>
<ItemText>\\R2\../User/task/chassis_task.c\chassis.param-&gt;M3508_param.d</ItemText>
</Ww>
<Ww>
<count>10</count>
<WinNumber>1</WinNumber>
<ItemText>\\R2\../User/task/nuc_task.c\cmd_fromnuc</ItemText>
</Ww>
</WatchWindow1>
<Tracepoint>
<THDelay>0</THDelay>

Binary file not shown.

View File

@ -42,9 +42,11 @@ int8_t Chassis_init(Chassis_t *c, const Chassis_Param_t *param, float target_fre
if (c == NULL) return CHASSIS_ERR_NULL;
c->param = param;
for (int i = 0; i < 4; i++) {
for (int i = 0; i < 3; i++) {
PID_init(&(c->pid.chassis_3508VecPID[i]), PID_POSITION_D, &(c->param->M3508_param));
}
PID_init(&(c->pid.chassis_3508VecPID[3]), PID_POSITION_D, &(c->param->M3508_param_other));
PID_init(&(c->pid.chassis_PICKWzPID_HIGN), PID_POSITION, &(c->param->chassis_PICKWzPID_HIGN_param));
PID_init(&(c->pid.chassis_PICKWzPID_LOW), PID_POSITION, &(c->param->chassis_PICKWzPID_LOW_param));
/*sick*/

View File

@ -72,7 +72,9 @@ typedef struct
/*该部分决定PID的参数整定在config中修改*/
pid_param_t M3508_param;
pid_param_t M3508_param;
pid_param_t M3508_param_other;
pid_param_t chassis_PICKWzPID_HIGN_param;
pid_param_t chassis_PICKWzPID_LOW_param;

View File

@ -75,11 +75,11 @@ static const ConfigParam_t param ={
/*投球*/
.LaunchCfg = {
.m2006_init = -130.0f, // M2006初始角度
.m2006_init = -140.0f, // M2006初始角度
.m2006_trig = 0.0f, // M2006触发角度
.go_pull_pos = -210.0f, // go上升去合并扳机扳机位置
.go_up_speed = 12.0f, // 上升速度
.go_down_speed = 10.0f, // 下降速度
.go_up_speed = 15.0f, // 上升速度
.go_down_speed = 12.0f, // 下降速度
.Pitch_angle = 58, //俯仰角
.go_init = -50
},
@ -117,7 +117,18 @@ static const ConfigParam_t param ={
// .i_limit = 200.0f,
// .out_limit =6000.0f,
.p = 20.5f,
.i = 0.00011f,
.i = 0.00005f,
.d = 3.2f,
.i_limit = 200.0f,
.out_limit =6000.0f,
},
.M3508_param_other= {
.p = 16.5f,
.i = 0.00001f,
.d = 3.2f,
.i_limit = 200.0f,
.out_limit =6000.0f,

View File

@ -132,7 +132,7 @@ int8_t ALL_Motor_Control(UP_t *u,CAN_Output_t *out)
{
/*目标值限位*/
abs_limit_min_max_fp(&u->motor_target.go_shoot ,-215.0f,0.0f);
abs_limit_min_max_fp(&u->motor_target.Pitch_angle ,48.0f,67.0f);
abs_limit_min_max_fp(&u->motor_target.Pitch_angle ,48.0f,71.5f);
@ -423,10 +423,10 @@ int8_t UP_AUTO_Control(UP_t *u,CAN_Output_t *out,CMD_t *c){
/*俯仰角度,力度转换,加数值限位*/
if(u->MID360Context.Curve==CURVE_58){
MID360Cfg->go_release_pos=CurveChange(LowPassFilter2p_Apply(&u->filled[0],c->cmd_MID360.dis)+0.1f,3.3,4.3,&u->MID360Context.Curve);
MID360Cfg->go_release_pos=CurveChange(LowPassFilter2p_Apply(&u->filled[0],c->cmd_MID360.dis)+0.25f,3.3,4.3,&u->MID360Context.Curve);
}
else {
MID360Cfg->go_release_pos=CurveChange(LowPassFilter2p_Apply(&u->filled[0],c->cmd_MID360.dis),3.3,4.3,&u->MID360Context.Curve);
MID360Cfg->go_release_pos=CurveChange(LowPassFilter2p_Apply(&u->filled[0],c->cmd_MID360.dis)+0.1f,3.3,4.3,&u->MID360Context.Curve);
}
if (u->MID360Context.Curve == CURVE_58) {

View File

@ -88,7 +88,7 @@ void CAN_Encoder_Decode(CAN_EncoderFeedback_t *feedback,
const uint8_t *raw) {
if (feedback == NULL || raw == NULL) return;
switch(raw[1])//判断编码器id
{
{
case 0x01:
switch(raw[2])//判断指令id