Ok I have one more question just to clarify something for me. The X-axis of the accelerometer should be in the rotational axis of the wheels. But should the axis from the gyro be a perpendicular axis to the X-axis of the accelerometer like an Y-axis?
Should i use the Gyro Y-axis on the IMU? I'm cute sure I should use the Y-axis...
I see to different things below, just to clarify this
// Main module K_bot angle angles in Quids, 10 bit ADC -----------------------------
// 5 - angle and rate calculation display ACC_Angle and GYRO_rate
#include <math.h>
#define GYR_Y 0 // Gyro Y (IMU pin #4)
#define ACC_Z 1 // Acc Z (IMU pin #7)
#define ACC_X 2 // Acc X (IMU pin #9)
The sensors values vs position should read as follow:
Horizontal ( 0° = 0 Quid ) ACC_X: 0 ACC_Z: XX GYR_X: 0
Left side (-90° = -256 Quid) ACC_X: XX ACC_Z: 0 GYR_X: 0
Right side (+90° = +256 Quid) ACC_X:-XX ACC_Z: 0 GYR_X: 0
Reversed (180° = +512 Quid) ACC_X: 0 ACC_Z:-XX GYR_X: 0