Bye bye Wii Motion Plus, hello MPU6050. Also, increase control loop

to 200Hz, add SD card logging, and a number of other changes.
This commit is contained in:
2014-05-06 21:03:48 +00:00
parent b482b85ffd
commit e8adff93c1
25 changed files with 1725 additions and 581 deletions

View File

@@ -5,6 +5,7 @@
#include "dcm.h"
#include "uart.h"
#include "status.h"
#include "log.h"
float integral[3] = {0.0f, 0.0f, 0.0f};
float last[3];
@@ -33,7 +34,7 @@ void motor_pid_update(float troll, float mroll,
{
float derivative[3];
float out[3];
float motor[3];
float motor[4];
float roll, pitch, yaw;
float error, max_error;
float min_motor;
@@ -145,6 +146,11 @@ void motor_pid_update(float troll, float mroll,
set_thrust(1, motor[1]);
set_thrust(2, motor[2]);
set_thrust(3, motor[3]);
log_put_uint16((unsigned int) (motor[0] * 65535));
log_put_uint16((unsigned int) (motor[1] * 65535));
log_put_uint16((unsigned int) (motor[2] * 65535));
log_put_uint16((unsigned int) (motor[3] * 65535));
}
void motor_kill(void) {