dlktdr / HeadTracker

This project is built to record the orientation a FPV headset to allow the camera on your RC to follow your head movements.
GNU General Public License v3.0
378 stars 90 forks source link

Increase sensor rates to 166Hz #105

Closed dlktdr closed 2 years ago

dlktdr commented 2 years ago

Mag reading at 158Hz (LSM9DS1 Maximum.. I think)

Increase the sensor update rates from 60Hz

gcmcnutt commented 2 years ago

ok, is the intent here to 1) increase the sampling to reduce inter-sample aliasing (e.g. for the folks reporting drift)? and 2) change the controller to be a lower pass filter?

looks pretty good -- but i wonder about the constants here -- keep in mind, i'm not quite clear on the model here yet.

dlktdr commented 2 years ago

ok, is the intent here to 1) increase the sampling to reduce inter-sample aliasing (e.g. for the folks reporting drift)? and 2) change the controller to be a lower pass filter?

looks pretty good -- but i wonder about the constants here -- keep in mind, i'm not quite clear on the model here yet.

That was the thought If I can get more samples, will be able to remove the noise better. Also wondering if the integration of the GYRO was affected by the low number of samples. Didn't notice a lot of difference, could bring the beta up to 0.08 and didn't have too much vibration on the output, so yes a bit better. Still some overshoot on the gyro vs the mag settle point

On RGC I was contacted by someone who is looking into the filter, to see if there is a better option :) So hope to hear back soon.

gcmcnutt commented 2 years ago

oops, hit the wrong button, sorry. yeah, drift with magnetometer there seems unusual, prob the idea of adding some debug vector and filter displays to see if it is a severely drifting magnetometer, or low signal.

i have seen the system get into a state where IMU isn't running and a slow drift occurs, a hard reset seems to clear. i figure this is a case of the power-up init state isn't captured very well. if we can reproduce this reliably, we can prob reset the rig without reset. do we have an issue filed on this particular concern? #75 ? #92 ?

dlktdr commented 2 years ago

oops, hit the wrong button, sorry. yeah, drift with magnetometer there seems unusual, prob the idea of adding some debug vector and filter displays to see if it is a severely drifting magnetometer, or low signal.

All good.. have a few issues that have that closed..opened in them.

i have seen the system get into a state where imu isn't running and a slow drift occurs, a hard reset seems to clear. i figure this is a case of the power-up init state isn't captured very well. if we can reproduce this reliably we can prob reset the rig without reset. do we have an issue filed on this particular concern? #92 ?

Edit: Probably #92, is a good one to track that with.

I don't know If I've noticed that where it's not running at all. Would be good to see when this happens if in debug there are still values being send. Maybe one of the tasks is crashing. I wonder if it's a good idea to incorporate a watchdog if that is what's going on.

Your idea of showing the vectors is a good one, I just started this yesterday, an OpenGL viewer we can look at the Accelerometer and Mag vectors visually. image

Just got the origin drawn so far :) image

https://github.com/dlktdr/HeadTracker/tree/GUI_VisualizeVectors