The unified diff between revisions [08a35a66..] and [dc88787e..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'motor.c'
# # old_revision [08a35a6680cdf8985cfb16fa6779ee6db7202a9c] # new_revision [dc88787ecd1d574feba045763baed2a7651ff33d] # # patch "motor.c" # from [38218e6c4dee3f736912d3f16e65339741b2e36b] # to [9f90df05166bf056393d18108f1b25d0fd34da52] # ============================================================ --- motor.c 38218e6c4dee3f736912d3f16e65339741b2e36b +++ motor.c 9f90df05166bf056393d18108f1b25d0fd34da52 @@ -6,12 +6,14 @@ #include "uart.h" #include "status.h" #include "log.h" +#include "config.h" float integral[3] = {0.0f, 0.0f, 0.0f}; float last[3]; float throttle = 0.0f; +#if 0 #define Kp 0.2 #define Ki 0.04 #define Kd 0.08 @@ -22,7 +24,20 @@ float throttle = 0.0f; #define Kd_y 0.00 #define Ka_y 0.0 +#else +#define Kp config.pid.rollpitch.p +#define Ki config.pid.rollpitch.i +#define Kd config.pid.rollpitch.d +#define Ka config.pid.rollpitch.a + +#define Kp_y config.pid.yaw.p +#define Ki_y config.pid.yaw.i +#define Kd_y config.pid.yaw.d +#define Ka_y config.pid.yaw.a +#endif + + /* * Perform a PID loop iteration. * roll and pitch are absolute values