remove debug prints
This commit is contained in:
parent
e9511eb8ce
commit
107a142ef6
|
@ -24,8 +24,6 @@ compute_pid(float *integral, float *prev_error, car_struct_t *car_struct)
|
||||||
float error = car_struct->p_left_motor->speed.distance_cm
|
float error = car_struct->p_left_motor->speed.distance_cm
|
||||||
- car_struct->p_right_motor->speed.distance_cm;
|
- car_struct->p_right_motor->speed.distance_cm;
|
||||||
|
|
||||||
printf("%f\n", error);
|
|
||||||
|
|
||||||
*integral += error;
|
*integral += error;
|
||||||
|
|
||||||
float derivative = error - *prev_error;
|
float derivative = error - *prev_error;
|
||||||
|
@ -55,8 +53,6 @@ repeating_pid_handler(struct repeating_timer *t)
|
||||||
|
|
||||||
float control_signal = compute_pid(&integral, &prev_error, car_strut);
|
float control_signal = compute_pid(&integral, &prev_error, car_strut);
|
||||||
|
|
||||||
printf("control: %f\n", control_signal);
|
|
||||||
|
|
||||||
float temp
|
float temp
|
||||||
= (float)car_strut->p_right_motor->pwm.level + control_signal * 0.05f;
|
= (float)car_strut->p_right_motor->pwm.level + control_signal * 0.05f;
|
||||||
|
|
||||||
|
@ -70,13 +66,8 @@ repeating_pid_handler(struct repeating_timer *t)
|
||||||
temp = MIN_PWM_LEVEL + 1u;
|
temp = MIN_PWM_LEVEL + 1u;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("temp: %f\n", temp);
|
|
||||||
|
|
||||||
set_wheel_speed((uint32_t)temp, car_strut->p_right_motor);
|
set_wheel_speed((uint32_t)temp, car_strut->p_right_motor);
|
||||||
|
|
||||||
printf("speed: %f cm/s\n", car_strut->p_right_motor->speed.current_cms);
|
|
||||||
printf("distance: %f cm\n", car_strut->p_right_motor->speed.distance_cm);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue