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

Calibration and IMU DLPF settings #8

Open
csebe12 opened this issue Apr 9, 2020 · 1 comment
Open

Calibration and IMU DLPF settings #8

csebe12 opened this issue Apr 9, 2020 · 1 comment

Comments

@csebe12
Copy link

csebe12 commented Apr 9, 2020

Dear Peter,

I am working on an off-road robot that uses a gps module and the MPU9250 to navigate between waypoints. I am using your library for the MPU9250 together with this library to get readings for heading, and I'm trying to set up a PID controller to get to the waypoints. I have a couple of questions regarding this setup.

  • Do I need to calibrate the MPU9250 separately, save the coefficients and then calibrate the Fuse object as well, or is it enough to only calibrate the Fuse?

  • I have a separate thread for the imu which is continuously updated. The Fusion algorithm is run at 1.5 kHz to get better convergence, and my PID loop runs at 300 Hz. Is this setup sensible?

  • Finally, I would like to ask if you have any guidance about which low pass filter I should use on the imu.

Best regards,
Ben

@peterhinch
Copy link
Contributor

The problem with calibration is the magnetometer. The accel and gyro will behave consistently over long periods of time. But the mag is a sensitive beast and you will need to calibrate it repeatedly - it will throw fusion way out if this isn't done.

The fusion calibrate method is intended to help you do this. You may need to go through the process each time you move the robot to a new location. In conjunction with the physical movement of the sensor around the axes it works out the local bias enabling the fusion algorithm to compensate. The physical position of the IMU is critical: don't locate it anywhere near high current wiring e.g. to the wheel motors.

Those rates sound high, but it all depends on the target hardware - what processor are you using? I'm surprised you've resorted to threading: can you not just query the fusion algorithm on demand, letting the PID run as fast as possible? Or use the asynchronous version?

Re the LPF I found a big issue is vibration. In my balancing robot (which is not off-road) I had to develop a mechanical LPF (a mass, rubber mounted) to stop vibration from overwhelming the PID. Filtering is something of a trial-and-error process. Especially for off-road work - something I've never tried. I can imagine distinguishing between vibration and off-road movement is difficult. See the notes in the doc about sampling theory.

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

2 participants