试了离合,卡不上,不调odrive了

This commit is contained in:
ws 2025-03-16 15:26:21 +08:00
parent f50817a218
commit 33f343eadb
9 changed files with 37 additions and 22 deletions

View File

@ -58,3 +58,5 @@
[info] Log at : 2025/3/14|20:12:19|GMT+0800
[info] Log at : 2025/3/16|15:24:31|GMT+0800

View File

@ -1,3 +1,4 @@
Load "mycode1\\mycode1.axf"
Erase Done.Programming Done.Verify OK.Application running ...
Flash Load finished at 22:03:22
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\keil\ARM\ARMCC\Bin'
Build target 'mycode1'
"mycode1\mycode1.axf" - 0 Error(s), 0 Warning(s).
Build Time Elapsed: 00:00:00

View File

@ -1 +1 @@
2025/3/14 22:03:23
2025/3/16 13:26:53

View File

@ -230,6 +230,11 @@
<WinNumber>1</WinNumber>
<ItemText>trigger_angle_o</ItemText>
</Ww>
<Ww>
<count>16</count>
<WinNumber>1</WinNumber>
<ItemText>shoot</ItemText>
</Ww>
</WatchWindow1>
<WatchWindow2>
<Ww>

View File

@ -33,7 +33,7 @@ const motor_measure_t *trigger_motor_data;//3508电机数据
pid_type_def t_speed_pid;//2006速度环pid结构体
pid_type_def t_angle_pid;//2006位置环pid结构体
fp32 M2006_speed_PID[3]={5.0,0.3,0.0}; //P,I,D(速度环)
fp32 M2006_speed_PID[3]={15.0,0.3,0.0}; //P,I,D(速度环)
fp32 M2006_angle_PID[3]={25.0,0.0,1.5}; //P,I,D(角度环)
//速度环pid参数
fp32 M2006_PID[3]={4.9,0.01,0.0};

View File

@ -69,24 +69,22 @@ extern volatile uint16_t last_angle ;
void shoot_odrive(int angle)
{
// if(ball)
// {
// if(multi_turn_angle==8)
// {
// //di
// odrive_accel_cmd(AXIS0_NODE,200,200);
// odrive_pos_cmd(AXIS0_NODE,0);
// }
// else if(multi_turn_angle==0)
// {
// }
// }
odrive_accel_cmd(AXIS0_NODE,200,200);
odrive_accel_cmd(AXIS0_NODE,500,500);
osDelay(2);
odrive_pos_cmd(AXIS0_NODE,angle);
}
void shoot_back(int angle)
{
odrive_accel_cmd(AXIS0_NODE,100,100);
osDelay(2);
odrive_pos_cmd(AXIS0_NODE,angle);
}
#endif

View File

@ -23,5 +23,6 @@ typedef struct
void shooterInit(void);
void shoot_ball(int key);
void shoot_odrive(int angle);
void shoot_back(int angle);
#endif

View File

@ -43,12 +43,19 @@ void Task_Motor(void *argument)
// 更新编码器数据
Update_Encoder(&encoder);
m=trigger_angle_o*(8191/360);
trigger_angle_o=-2.5;//
if( mode == THREE )
{
//当最高点时进入离合
if(encoder.round_cnt>=8)
if(encoder.round_cnt>=6)
{
trigger_angle_o=2;
trigger_angle_o=-2.5;
trigger_pos(m);
}
else
{
trigger_angle_o=0;
trigger_pos(m);
}

View File

@ -41,6 +41,7 @@ void Task_Shoot(void *argument)
shoot_ball(0);
#elif ODRIVE_SHOOT == 1
if(mode == THREE)
{
shoot_odrive(SHOOT3);
@ -49,7 +50,7 @@ void Task_Shoot(void *argument)
{
if(trigger_motor_data->total_angle ==0)//扳机已闭合
{
shoot_odrive(BOTTOM);
shoot_back(DZ);
}
}