The unified diff between revisions [64de686d..] and [9142f333..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'thrust.c'
# # old_revision [64de686d701acb9539dc52fe0bff299405612ab0] # new_revision [9142f3330490a5aa00c1686475633b620c2ef5e7] # # add_file "thrust.c" # content [cd4c74340b2aaabdc4543f6334d5c44f287e0965] # ============================================================ --- /dev/null +++ thrust.c cd4c74340b2aaabdc4543f6334d5c44f287e0965 @@ -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)); +} +