From: Keith Packard Date: Thu, 16 Feb 2023 21:53:38 +0000 (-0800) Subject: altos: Reset TMega v6.0 BMI axes to not adjust any signs X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=refs%2Fheads%2Fbmi088;p=fw%2Faltos altos: Reset TMega v6.0 BMI axes to not adjust any signs Try to figure out why the data doesn't match the docs. Signed-off-by: Keith Packard --- diff --git a/src/drivers/ao_bmi088.c b/src/drivers/ao_bmi088.c index d03fceab..d25f17e0 100644 --- a/src/drivers/ao_bmi088.c +++ b/src/drivers/ao_bmi088.c @@ -297,6 +297,7 @@ ao_bmi088_show(void) ao_bmi088_pitch(&ao_bmi088_current), ao_bmi088_yaw(&ao_bmi088_current)); #else +#error BMI088 should only be used with normalized values printf ("Accel: %7d %7d %7d Gyro: %7d %7d %7d\n", ao_bmi088_current.acc.x, ao_bmi088_current.acc.y, diff --git a/src/easymega-v3.0/ao_pins.h b/src/easymega-v3.0/ao_pins.h index 863909d5..2fa4fd01 100644 --- a/src/easymega-v3.0/ao_pins.h +++ b/src/easymega-v3.0/ao_pins.h @@ -177,7 +177,7 @@ struct ao_adc { }; #define AO_ADC_DUMP(p) \ - printf("tick: %5u A: %5d B: %5d C: %5d D: %5d drogue: %5d main: %5d batt: %5d pbatt: %5d temp: %5d\n", \ + printf("tick: %5lu A: %5d B: %5d C: %5d D: %5d drogue: %5d main: %5d batt: %5d pbatt: %5d temp: %5d\n", \ (p)->tick, \ (p)->adc.sense[0], (p)->adc.sense[1], (p)->adc.sense[2], \ (p)->adc.sense[3], (p)->adc.sense[4], (p)->adc.sense[5], \ diff --git a/src/telemega-v5.0/ao_pins.h b/src/telemega-v5.0/ao_pins.h index 3f2c9ea4..03b9c142 100644 --- a/src/telemega-v5.0/ao_pins.h +++ b/src/telemega-v5.0/ao_pins.h @@ -344,7 +344,7 @@ struct ao_adc { * pin 1 NW corner of chip * * +along +Y +roll +Y - * +across -X +pitch -X + * +across +X +pitch +X * +through +Z +yaw +Z * */ @@ -358,11 +358,11 @@ struct ao_adc { #define HAS_IMU 1 #define ao_mpu6000_along(m) ((m)->accel_y) -#define ao_mpu6000_across(m) (-(m)->accel_x) +#define ao_mpu6000_across(m) ((m)->accel_x) #define ao_mpu6000_through(m) ((m)->accel_z) #define ao_mpu6000_roll(m) ((m)->gyro_y) -#define ao_mpu6000_pitch(m) (-(m)->gyro_x) +#define ao_mpu6000_pitch(m) ((m)->gyro_x) #define ao_mpu6000_yaw(m) ((m)->gyro_z) #define ao_data_along(packet) ao_mpu6000_along(&(packet)->mpu6000) diff --git a/src/telemega-v6.0/ao_pins.h b/src/telemega-v6.0/ao_pins.h index 89af7ed2..2d27314a 100644 --- a/src/telemega-v6.0/ao_pins.h +++ b/src/telemega-v6.0/ao_pins.h @@ -333,6 +333,20 @@ struct ao_adc { * +along north +roll left up * +across west +pitch nose down * +through up +yaw left turn + * + * 2023-2-16 -- keithp -- I think this is incorrect. Bdale + * measured all of the boards with the following results. + * + * +along nose up + * +across USB down + * +through TH down + * + * And, with the board aligned to have positive accel for the relevant axis, + * looking down from above we have: + * + * +roll counter clockwise (nose up) + * +pitch counter clockwise (USB down) + * +yaw counter clockwise (TH down) */ /*