Commit Graph

117 Commits

Author SHA1 Message Date
Peter Barker 6a897f01d8 AP_InertialSensor: allow compilation with HAL_LOGGING_ENABLED false 2024-01-17 18:25:55 +11:00
Peter Barker 1051da5cb4 AP_InertialSensor: correct compilation when AP_AHRS_ENABLED is off
e.g. CubeOrange-periph-heavy
2024-01-16 16:14:04 +11:00
Andrew Tridgell 2688848cd1 AP_InertialSensor: fixed orientation of batch sampled data
we need to rotate the data so that FFT displays match the configured
orientation
2023-10-25 19:23:11 +11:00
Iampete1 3429276224 AP_InertialSensor: add INS_RAW_LOG_OPT to allow raw logging of post, and pre+post on primary or all gyros 2023-10-03 10:24:58 +11:00
Andy Piper c9382cd221 AP_InertialSensor: HAL_WITH_DSP -> HAL_GYROFFT_ENABLED 2023-03-29 20:49:40 +11:00
bugobliterator 10439cc42e AP_InertialSensor: add support for extra Aux IMUs 2023-03-21 10:04:16 +11:00
Andrew Tridgell 34a52142c8 AP_InertialSensor: added support using the 2nd IMU for heater control 2023-03-15 19:08:53 +11:00
Peter Barker e5c3dd871c AP_InertialSensor: create explicit define for AP_INERTIALSENSOR_BATCHSAMPLER_ENABLED
this allows the batch sampler to be removed for size reasons, or because you don't have logging enabled
2023-01-11 19:08:41 +11:00
Andy Piper 90cdc1aa52 AP_InertialSensor: allow FFT window to be captured post-filter
selectively apply filters twice to make sure that FFT is not tracking itself
clean-up notch disablement for non-DSP builds
use filter gyro data for FFT when analysing post-filter
always apply LPF after all of the notches
move to a phased application of window information for FFT
tap FFT gyro window at the appropriate place for downsampled FFTs
add accessor for FFT notch
document notch uses cases and flow
2022-12-28 18:14:56 +11:00
Andy Piper 221ab9752e AP_InertialSensor: synchronise fifo reads on the ICM42xxx 2022-08-12 20:53:36 +10:00
Peter Barker e4ce4ebed3 AP_InertialSensor: remove un-needed methods 2022-07-19 10:30:36 +10:00
Andrew Tridgell 9ac3472b47 AP_InertialSensor: add set_inactive() on notch filters 2022-06-30 20:58:37 +10:00
Andrew Tridgell a37f268dc6 Ap_Inertialsensor: by default only run harmonic notch on the active gyro
this should save quite a lot of CPU. Only the active gyro impacts
vehicle flight
2022-06-12 15:39:44 +10:00
Andrew Tridgell 19063a46a0 AP_InertialSensor: fixed build with logging disabled
fixes CubeOrange-periph build
2022-06-06 14:50:40 +10:00
Andrew Tridgell db14ba46dc AP_InertialSensor: call notch param update with semaphore held 2022-04-19 09:39:03 +10:00
Andrew Tridgell e2e1e74da5 AP_InertialSensor: switch to HarmonicNotch class
this makes the logic much easier to follow, without indexes into
arrays
2022-04-19 09:39:03 +10:00
Andrew Tridgell e67d9b4179 AP_InertialSensor: support two full harmonic notch filters 2022-04-19 09:39:03 +10:00
Iampete1 b77476caa1 AP_InertialSensor: remove custom orentations 2022-03-02 18:16:42 +11:00
Andy Piper c7a43f2a90 AP_InertialSensor: put some functions in fast ram
precisely split backend/frontend on Invensense for RAMFUNC allocation
allow building with no IMUs
2022-02-09 12:47:55 +00:00
Andrew Tridgell 662327f2ea AP_InertialSensor: added support for more ADIS IMUs
support 32 bit delta angles and velocities
2021-12-29 18:25:18 +11:00
Andy Piper 6e3b502110 AP_InertialSensor: inline vector ops for backends and temp cal 2021-12-22 18:23:33 +11:00
Peter Barker c6734ad825 AP_InertialSensor: correct logging of inertial-sensor reg-change logging 2021-12-18 21:25:27 +11:00
Andrew Tridgell 4fdc1ebc30 AP_InertialSensor: fixed locking issue in delta accumulation
this fixes a bug in calculating delta velocity and delta acceleration
between threads.
2021-08-31 10:10:18 +10:00
Siddharth Purohit 447935bf4c AP_InertialSensor: remove dependence on gcs for AP_Periph builds 2021-06-30 17:06:02 +10:00
Josh Henderson 2b20dcf128 AP_InertialSensor: move GYR & ACC logging functions to Logging.cpp 2021-05-01 14:15:58 +10:00
Andrew Tridgell 4cddf37984 AP_InertialSensor: log unexpected register changes
when the register checking code finds an error we will log what
register changed and to what value
2021-02-24 18:18:37 +11:00
Andrew Tridgell 3ff71c7814 AP_InertialSensor: changes from review feedback 2021-01-21 13:09:21 +11:00
Andrew Tridgell 8caea96ab1 AP_InertialSensor: start auto-learning at boot
This makes it easier to setup the params. The ENABLE=2 value only
takes effect at boot
2021-01-21 13:09:21 +11:00
Andrew Tridgell fc0f8b990a AP_InertialSensor: added online learning of temp cal
use INS_TCAL1_ENABLE=2 to start learning
2021-01-21 13:09:21 +11:00
Andrew Tridgell 7921e042f1 AP_InertialSensor: added IMU temperature calibration support
this adds parameters that can be setup by an external script for
compensating for temperature variation in gyros and accels using a 3rd
order polynomial
2021-01-21 13:09:21 +11:00
Andrew Tridgell b74e5c0e2f AP_InertialSensor: added ExternalAHRS backend 2021-01-05 21:13:12 +11:00
Peter Barker 2437cf8a24 AP_Logger: use instance number for IMU logging 2020-11-11 19:31:53 +11:00
Andy Piper faf9bbbf3a AP_InertialSensor: make the backend fast gyro rate configurable
raise gyro rate default on F7 and H7
clean up gyro rate docs and output startup banner
2020-07-10 16:45:29 +10:00
Andy Piper 61bb42cc0c AP_InertialSensor: allow up to four distinct notch center frequencies to be updated
apply the LPF after the notch filters to reduced notch-induced noise
2020-06-21 19:09:35 +10:00
Andy Piper 8ac79da643 AP_InertialSensor: FFT gyro window would overflow on windows >= 256
convert FFT buffers to ObjectBuffer<float> for lock-free access
push gyro samples directly into the FFT ring buffer from the gyro thread
2020-05-24 07:43:34 +10:00
Andrew Tridgell 5c6749ee54 AP_InertialSensor: use wait_pin() to wait for DRDY pin if available 2020-04-23 07:28:13 +10:00
Andy Piper 0e9b2a26c5 AP_InertialSensor: SITL the raw sample rate is not the same as the sensor rate
use regulated time for frequency noise to avoid spurious harmonics
SITL sensors must be true separate instances
don't compile in FFT structures if DSP disabled
2020-02-22 11:15:37 +11:00
Andy Piper 3d9776dd6d AP_InertialSensor: expose statically filtered gyro values for FFT analysis and allow sampling to gyro window for FFT analysis.
FFT windows can be dynamically allocated
add harmonic notch dynamic tracking mode
unwind gyro window allocation in the case of failure
allow access to harmonic notch harmonics
2020-02-22 11:15:37 +11:00
Andy Piper 143a071788 AP_InertialSensor: add rpm-based motor noise to gyros and accels
Remove sample time error in backend.
2019-12-17 10:07:06 +11:00
Andrew Tridgell 236ce28339 AP_InertialSensor: updated for heater changes 2019-11-02 16:31:04 +11:00
Andy Piper 8e385d7453 AP_InertialSensor: correct formatting 2019-09-11 18:41:05 +10:00
Andy Piper 5b7f9f6bea AP_InertialSensor: while sensors are converging update the filters sample rates. if gyro filtering produces invalid output, keep the previous value 2019-09-11 18:41:05 +10:00
Andy Piper 3261677e01 AP_InertialSensor: remove _ prefix from methods. use changed filter methods. 2019-09-11 18:41:05 +10:00
Andy Piper 50f7e50634 AP_InertialSensor: add harmonic notch filter to gyro filter chain
Allow dynamic updates to the calculated frequency. Convert bandwidth and frequency to floats.
backend variables do not need to be indexed per-backed
2019-09-11 18:41:05 +10:00
Andrew Tridgell 09d3392aee AP_InertialSensor: zero accumulators on time step
this zeros the delta angle and delta velocity accumulators when a
sensor is unavailable for a period of 0.1s. This prevents garbage
values being passed into the EKF when a sensor dies and then becomes
available again some time later
2019-07-07 19:03:01 +10:00
Andrew Tridgell 3444e82ef9 AP_InertialSensor: added RC switch for killing IMUs 2019-07-07 19:03:01 +10:00
Andy Piper fff81a2163 AP_InertialSensor: Make sure the LPF output is used by the notch input. 2019-06-06 17:09:17 +10:00
Andy Piper 18d403c3ac AP_InertialSensor: Rework notch filter allocation and sampling
https://github.com/ArduPilot/ardupilot/issues/11346

Allocate a notch filter per-IMU.
Update the notch filters in the backend at the sensor sample rate.
Allow raw logging of post-filtered gyro and accel values.
2019-06-06 17:09:17 +10:00
Peter Barker ef860db558 AP_InertialSensor: add floating point constant designators 2019-04-05 23:04:17 -07:00
Tom Pittenger 3eeaa2c8df AP_InertialSensor: rename dataflash to logger 2019-03-28 16:40:57 +11:00