I am working on custom harware for Ardupilot flight controller. I am consfuse at IMU and compass IC orientation on PCB. need help for finding correct orientation for sensor ic.
which axis for Front = ?, Right= ?, Top = ? for Compass
and axis for Front = ?, Right= ?, Top = ? for Accel+Gyro
What lines shoud be included in hwdef.dat, if there needs to be rotation.
I am Using following sensors
Compass - MMC5983MA - I2C (As Z axis is showing down. Do I need to keep compass ic at back side of PCB)
Accel + Gryro - BMI088 - SPI
Accel + Gryro - ICM20649 - SPI
Accel + Gryro - ICM42688-p - SPI
Axis images from datasheet.
On the Kakute H7 Mini that I’m using right now, pin 1 of the BMI270 is the left/rear pin with respect to the board’s intended orientation. The BMI270 datasheet shows:
So to get the correct orientation, the hwdef includes: IMU BMI270 SPI:bmi270 ROTATION_PITCH_180_YAW_90
hello @Yuri_Rage thanx for your help. I come up with this orientation for Acell and Gyro IC. please give your suggestion. is this ok or placement is wrong.
I am still confuse about compass IC as its z axis is already down facing. How I can place and rotate axis or I dont need to care for z axis in compass IC.
You are agonizing over the least important part of the circuit design. There are orientation definitions in the source code for nearly every permutation at 45 and 90 degree increments. Place them on the board where interference and resonance is least likely. Same for compass (whose z axis matters but can also be adjusted in hwdef).
@Yuri_Rage thanks for guidance and help.
I have arrange all sensor ic as X axis matach front direction of flight controller.
this is my hwdef.dat file hwdef.txt (3.8 KB)
I have used this ROTATIONS IMU BMI088 SPI:bmi088_a SPI:bmi088_g ROTATION_ROLL_180 IMU Invensensev2 SPI:icm20649 ROTATION_ROLL_180 IMU Invensensev3 SPI:icm42688 ROTATION_ROLL_180 COMPASS MMC5XX3 I2C:0:0x30 false ROTATION_ROLL_180
As compass’s Z axis goes UP side I have to add some changes to its driver make Z Down. I have made Z axis negative in all code snippet. at file