Comments (4)
Hello,
You cannot set to zero angleX
, angleY
and angleZ
since they are estimations from the raw data (accelerometer and gyro). If the calibration is done correctly these values should be close to zero just after start. They can suffer from raw data measurement noise, but there is nothing to do to solve this.
If your estimated values of angleX
(etc) are far from zero after calibration, you might have an issue in your calibration.
Kind regards,
Romain
from mpu6050_light.
Actually I was wondering if I can do second calibration. My initial purpose is to make my robot's front to point North which requires some additional steps because MPU6050 doesn't have magnetomer. They are as follow:
- Retrieve current gps coordinates.
- Move the robot x meters forward.
- Once again retrieve gps coordinates.
- Based on the two coordinates I use additional formula to calculate the current rotation around the z-axis (azimuth in degrees)
For example the result is 255° and the MPU6050 initially shows 0°. - I want the robot to face north (360°), so I call a function written by me: rotate(360-255);
After function execusion the robot is facing north but MPU6050 will show rotation around z : ≈0° + (360°-255°) ≈ 105°.
Is it possible to calibrate MPU6050 once again and zero its values (especially rotation around z-axis), because thus the MPU6050 output value for rotaton around z will correspond to compass values.
from mpu6050_light.
OK I understand better your problem now. Your GPS data give you the absolute heading angle (based on the recipe you explained), whereas MPU6050 only provides a relative one. Both are related by an offset, so you can compute the offset and apply it to the angleZ
value given by the library.
// compute offset only once
float heading_absolute = getHeadingFromGPS();
float heading_offset = heading_absolute - mpu.getAngleZ();
// now apply offset on all your measurements
float unbiased_heading = mpu.getAngleZ() + heading_offset;
You are then implicitly performing data fusion between GPS and MPU6050. Different devices provide measurements or estimates of the state of your robot, and you want to efficiently merge these data to get the "best" estimate of the state.
I might revise my opinion, but I don't think I would implement this directly inside the MPU6050 library, because it looks like data fusion with other components, that is out of the scope of the library. Its scope is only to provide the best estimate given internal data. Then the user can obviously decide to merge data as he/she likes in his/her Arduino script. I hope you understand my point.
Kind regards,
Romain
from mpu6050_light.
Quite helpful answer! Thank you for your quick response.
from mpu6050_light.
Related Issues (20)
- Suggest replacing use of math functions with float versions instead of double versions HOT 1
- GetAngle works fine alone but "hangs" up when embedded in other sketch HOT 2
- calcOffsets not working if being called outside of setup? HOT 3
- Fustion with magnetometer HOT 1
- Yaw angles are constantly drifting or increasing/decreasing rapidly HOT 2
- Pitch value changes with change in GyroZ HOT 2
- 5 MPU6050s HOT 1
- Trouble using 2 mpu HOT 1
- Using 2 MPU6050 HOT 1
- reset angle values to zero in void loop
- Angle Z gyro drifting HOT 3
- how to reset all for a status = writeData(MPU6050_PWR_MGMT_1_REGISTER, 0x01) = 0 again
- Angles problem
- Sensor in vertical position: would like to start the angle reading (0,0,0)
- question regarding the source code and the documentation
- Angle Z drifting HOT 1
- Interrupt capabilities
- Example plotting
- Library support for MPU9250? HOT 1
- The relationship between the offsets of the standard MPU6050 class from i2cdev and this library.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mpu6050_light.