fix: 修复蜂鸣器bug及日常更新
This commit is contained in:
@@ -22,7 +22,7 @@ float gy_Ki = 0.0f;
|
||||
float gy_Kd = 0.0f;
|
||||
float in_gyro;
|
||||
float out_gyro;
|
||||
//float set_gyro = 0.0f;
|
||||
// float set_gyro = 0.0f;
|
||||
|
||||
float po_Kp = 1.0f;
|
||||
float po_Ki = 0.0f;
|
||||
@@ -47,16 +47,18 @@ void sport_motion(void)
|
||||
{
|
||||
|
||||
cnt1++;
|
||||
in_gyro = imu660ra_gyro_z; // 陀螺仪输入
|
||||
in_angle = 0; // 图像远端输入
|
||||
in_pos = 0; // 图像近端输入
|
||||
in_speed = encoder_get_count(TIM5_ENCOEDER) / 1024 / 0.01 * 0.25; // 速度输入,m/s
|
||||
encoder_clear_count(TIM5_ENCOEDER); // 清除计数
|
||||
in_gyro = imu660ra_gyro_z; // 陀螺仪输入
|
||||
// in_angle = 0; // 图像远端输入
|
||||
// in_pos = 0; // 图像近端输入
|
||||
// 清除计数
|
||||
PID_Compute(&far_gyro_pid);
|
||||
|
||||
if (cnt1 >= 10) {
|
||||
PID_Compute(&far_angle_pid);
|
||||
PID_Compute(&speed_pid);
|
||||
in_speed = encoder_get_count(TIM5_ENCOEDER); // 速度输入,m/s
|
||||
// printf("rate:%d\r\n", (int16)in_speed);
|
||||
encoder_clear_count(TIM5_ENCOEDER);
|
||||
cnt1 = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user