Limit integral windup, some new PID values and linearise thrust.

This commit is contained in:
2012-12-08 12:31:17 +00:00
parent 999e129e2c
commit 274805c2a0
5 changed files with 75 additions and 23 deletions

15
thrust.c Normal file
View File

@@ -0,0 +1,15 @@
/* thrust.c */
#include "fisqrt.h"
#include "timer.h"
float linearise_thrust(float x)
{
return fisqrt(fisqrt(x*x*x));
}
void set_thrust(int motor, float x)
{
timer_set_pwm_value(motor, (int)(linearise_thrust(x) * PWM_MAX));
}