Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMU orientation issue #38

Open
ishanshah474 opened this issue Feb 29, 2024 · 0 comments
Open

IMU orientation issue #38

ishanshah474 opened this issue Feb 29, 2024 · 0 comments

Comments

@ishanshah474
Copy link

Hello,
Setup - Used Arduino Nano, MPU6050 and BMP085 as sensors. Using the Multiwii Version 2.4. Configured the config.h file to use QuadX, enabled GY521 and BMP085 from independent sensors. Selected PPMSumReceiver on pin D2 using an ESP32. So basically, ESP32 receives input over Wi-fi as IP data packets and pipes it to pin D2 of the Arduino. 4 motors are on default pins (3, 9, 10 and 11).
Now, so when I arm the drone all 4 motors start running/spinning. Then when I increase the throttle gradually, the motor has very erratic behavior. It starts to yaw, pitch and roll at the same time. I couldn't attach a video due to GitHub's video limit.
I've checked - the ESC, Motors and PWM are all looking error free. So my doubt comes to the MPU6050/GY521 I'm using. Does the Multiwii code calibrates the MPU6050 each time it powers on?
I calibrated the MPU6050/GY521 manually before uploading the drone code to the Arduino nano. Still behaves the same way. I tried a few different orientations of the IMU but with those, the drone doesn't even arm or at least the motors don't start spinning when armed. I was thinking to enable these 2 lines of code in my firmware -

//#define FORCE_ACC_ORIENTATION(X, Y, Z) {imu.accADC[ROLL] = Y; imu.accADC[PITCH] = -X; imu.accADC[YAW] = Z;}
//#define FORCE_GYRO_ORIENTATION(X, Y, Z) {imu.gyroADC[ROLL] = -Y; imu.gyroADC[PITCH] = X; imu.gyroADC[YAW] = Z;}

If I enable these 2 lines of code, what would be the orientation of the IMU? Also, is it possible there may be some other issue? If yes, what could it be?
Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant