Quadrotor from scratch
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
232 B

/* 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));
}