Jump to content
Electronics-Lab.com Community

One problem about building an electronic level with Arduino


Holy Hathaway

Recommended Posts


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/

 

 

Link to comment
Share on other sites

  • 2 months later...

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
  • Create New...