Extended Kalman Filter Implementation for Sensor Fusion | STM32 C Tutorial

Added:

Setup
Firmware Base
Sensor Driver
Main Loop
Preprocess
Filter Design
EKF Theory
Initialize
Predict Code
Update Code

Setup

0:00
Playing Section
  • 1

    Introduces the extended Kalman filter implementation on an STM32 microcontroller in C.

  • 2

    Outlines prerequisites and the overall structure for the real-time sensor fusion project.

  • 3

    Mentions the use of a specific board and the steps for firmware development.

Fundamental understanding of the standard Linear Kalman Filter, including state estimation, covariance matrices, and the predict-update cycle.
Basic multivariate calculus and linear algebra, specifically matrix multiplication, inversion, and calculating Jacobian matrices for linearization.
Physics of Inertial Measurement Units (IMUs), including how accelerometers and gyroscopes function, and their respective noise and drift characteristics.
Proficiency in C programming for embedded systems, including structures, pointers, and basic peripheral communication (I2C/SPI) on STM32 microcontrollers.
Exploring the Unscented Kalman Filter (UKF) to handle highly non-linear system dynamics without calculating analytical Jacobians.
Integrating a 3-axis magnetometer into the state vector to create a 9-DOF Attitude and Heading Reference System (AHRS) to resolve heading drift.
Studying multi-sensor fusion architectures, such as coupling GPS/GNSS data with the IMU EKF for robust inertial navigation (INS).
Optimizing EKF execution on resource-constrained microcontrollers using hardware floating-point units (FPU) and the ARM CMSIS-DSP library.
72.2K views1.8Klikes28:56@PhilsLabOriginal Release: 2022-08-22

This video demonstrates how to implement an Extended Kalman Filter (EKF) in real-time on an STM32 microcontroller for sensor fusion, covering the complete workflow from low-level firmware setup (including MPU6050 driver, DMA, and USB logging) through axis remapping, sensor calibration, and low-pass filtering, to the EKF algorithm itself which involves initialization, prediction using Euler integration and Jacobian matrices, and update steps with Kalman gain calculation. The implementation uses symbolic computation in Octave to derive matrix operations and shows practical considerations like parameter tuning (Q and R matrices), sample time selection, and trade-offs between filtering effectiveness and system lag.