Holy Hathaway Posted February 23, 2022 Report Share Posted February 23, 2022 I want to build an electronic level with MPU-6050 and Arduino. I have one of my MPU-6050’s mounted on a breadboard and started the example in the library but the numbers are drifting quiet a lot with the non-moving module? Today i maybe try it with an other MPU-6050. Quote Link to comment Share on other sites More sharing options...
HarryA Posted February 24, 2022 Report Share Posted February 24, 2022 I have for sometime now been dorking around with the MPU6050. I started out using Joop Brokking's code for a quadcopter but put it aside to educate myself on the PID software and the MPU6050 software. As you say there always seems to be problems with the MPU6060 code running away - the output of the formatted code seems to increase without limit. I am working with Joop Brokking's balancing beam code with and without the motors he uses to demonstrate using the MPU6050 and using the PID control software. That has the same problems. I migrated to Dejan_code.ino code because of its simplicity. That has stable 'raw' outputs of the MPU6050. And is well behaved; in that if you rotate the MPU6050 to some angle it shows some stable raw value and returns to the zeroed values on rotating it back to zero angle. The values around zero angle only vary by plus or minus 10 or less - I call that stable. That code contains a calibration functions that displays the values required to correct the raw outputs to near zero. These values are used later within the code for corrections. Manually updated. I am currently using this code to understand why the formatted code output is unstable by displaying the values at various stages in the program. I also looked the Digital_Level_v1.ino code (the yellow level) but had problems getting it to compile. I get an error "no 'uint8_t MPU6050_Base::dmpInitialize()' member function declared in class 'MPU6050_Base'" related to the MPU5060_6axis_MotionApp20.h file. This code is just to complex for me at this stage for what I want to do. The Dejan_code.ino code is perhaps the beat code to learn about the MPU6050 from. No PID! https://howtomechatronics.com/tutorials/arduino/arduino-and-mpu6050-accelerometer-and-gyroscope-tutorial/ Quote Link to comment Share on other sites More sharing options...
simon munyua Posted April 28, 2022 Report Share Posted April 28, 2022 Hello The best way to go about any electronic project is first to do simulations. There is nothing more that can be achieved in a better way without simulations. Simulating a circuit makes your job easy as you will have an idea of what should be attained and what should e did for the physical project to function. You can have a try on the KiCAD EDA and see the outcome. Thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.