Change double numbers to float in order to prevent unwanted double to float conversion
This commit is contained in:
		@@ -73,13 +73,13 @@ float pid_sample(struct pid_controller *pid, float deviation)
 | 
			
		||||
	float output;
 | 
			
		||||
 | 
			
		||||
	if (!pid)
 | 
			
		||||
		return 0.0;
 | 
			
		||||
		return 0.0f;
 | 
			
		||||
 | 
			
		||||
	output = deviation * pid->k_p;
 | 
			
		||||
 | 
			
		||||
	/* PID runaway compensation */
 | 
			
		||||
	if (!(deviation > 0.0f && pid->control_output > pid->output_sat_max - 0.5) &&
 | 
			
		||||
	    !(deviation < 0.0f && pid->control_output < pid->output_sat_min + 0.5)) {
 | 
			
		||||
	if (!(deviation > 0.0f && pid->control_output > pid->output_sat_max - 0.5f) &&
 | 
			
		||||
	    !(deviation < 0.0f && pid->control_output < pid->output_sat_min + 0.5f)) {
 | 
			
		||||
		calculate_integral(pid, deviation);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user