3.5.20 · HinglishGuidance, Navigation & Control (GNC)

Sensor fusion — complementary filter (simple), Kalman filter (optimal)

1,939 words9 min readRead in English

3.5.20 · Physics › Guidance, Navigation & Control (GNC)


WHY sensor fusion exist karta hai


The Complementary Filter (the "simple" fuse)

HOW hum isse scratch se derive karte hain

Hum ek estimate chahte hain jo:

  1. low frequency pe accelerometer angle ke barabar ho (gyro drift remove kare),
  2. high frequency pe integrated gyro ke barabar ho (accel noise remove kare).

Sabse simple first-order low-pass lo . Tab complement force ho jaata hai:

Notice karo mein ek factor (ek derivative) hai. Gyro already deta hai, toh angle pe apply karna matlab rate pe apply karna hai — koi explicit differentiation nahi chahiye. Combine karo:

Discretize karo. replace karo (measured rate), pe sample karo. Bilinear/Euler discretization karne se famous update milta hai:

Yeh step kyun? Term gyro prediction hai (rate integrate karo). se multiply karna har step pe drift ko thoda bleed away karta hai; gently estimate ko absolute accel reading ki taraf pull karta hai. Yahi gentle pull accel noise ki low-pass filtering hai.


The Kalman Filter (the "optimal" fuse)

HOW hum scalar Kalman filter scratch se derive karte hain

1-D state model karo (jaise angle) process aur measurement ke saath:

Step 1 — Predict. Bina nayi measurement ke, hamara best guess wahi rehta hai, lekin uncertainty badhti hai: Kyun? Independent process noise add karna variances add karta hai.

Step 2 — Fuse two Gaussians. Hamare paas prior aur measurement hai. Do Gaussians ka product ek Gaussian hai; combined variance minimize karna fused mean deta hai. Posterior mean ko weighted average likhke derive karo aur weight choose karo jo posterior variance minimize kare.

Estimate ho . Iska error variance: ke upar minimize karo:

Figure — Sensor fusion — complementary filter (simple), Kalman filter (optimal)

Recall Feynman: ek 12-saal ke bachche ko samjhao

Tumhare paas do dost hain jo temperature guess kar rahe hain. Ek dost, "Gyro-Guy," changes pe super fast react karta hai lekin dheere dheere aur zyada jhooth bolne lagta hai. Doosra, "Accel-Anne," average pe honest hai lekin jumpy hai aur random galat numbers chillata hai. Agar tum unhe smart tarike se average karo — Gyro-Guy pe quick changes ke liye believe karo lekin hamesha honest Anne ki taraf nudge karo wapas — toh tumhe dono se behtar guess milti hai. Complementary filter ek fixed trust ratio use karta hai. Kalman filter zyada clever hai: yeh ek "main kitna sure hoon" number rakhta hai, aur har moment perfect trust ratio choose karta hai, us dost pe zyada sunta hai jo abhi zyada reliable hai.


Flashcards

Complementary filter mein do transfer functions ki kya condition honi chahiye?
Unhe unity tak sum karna chahiye, , jo unity DC gain deta hai (koi steady-state bias nahi).
Discrete complementary filter mein kya control karta hai?
Trust split: gyro pe trust karo (smooth, drift-prone), accelerometer pe trust karo (drift-free, noisy). .
Gyroscope ko accelerometer ki help kyun chahiye?
Gyro rate integrate karne se bias accumulate hota hai → unbounded slow drift; accelerometer ek absolute (drift-free) angle low frequency pe deta hai usse correct karne ke liye.
Scalar Kalman gain formula aur uska matlab likhiye.
; prior uncertainty ka total uncertainty se ratio — zyada prior doubt ya kam measurement noise ⇒ bada gain (measurement pe zyada trust karo).
Optimal Kalman gain derive karo.
ko ke upar minimize karo: .
Kalman update mein "precisions add" identity kya hai?
— do Gaussian sources fuse karne se unke inverse variances (information) add hote hain.
Kalman filter complementary filter se kaise related hai?
Complementary filter ek fixed gain wala Kalman filter hai; steady state pe converge karta hai aur constant ho jaata hai, toh Kalman complementary filter ban jaata hai.
Agar predict step mein drop kar do toh kya hota hai?
0 tak shrink ho jaata hai, gain , filter nayi measurements pe trust karna band kar deta hai → divergence.
Bada filter ko sensor pe zyada trust karata hai ya kam?
Kam — measurement-noise variance hai; bada ⇒ chhota .
Gyro (high-frequency) aur accel (low-frequency) achhe se fuse kyun hote hain?
Unki dominant errors alag frequency bands mein hain; complementary filtering har sensor ko sirf wahan rakhta hai jahan woh accurate hai.

Connections

  • Gyroscope — rate sensor, high-frequency term aur drift ka source
  • Accelerometer — gravity vector, low-frequency absolute reference
  • Low-pass and High-pass filters — complementary filter ke building blocks
  • Gaussian distribution — Gaussians ka product Kalman update ke neeche hai
  • Bayesian estimation — Kalman filter linear-Gaussian systems ke liye recursive Bayesian inference hai
  • State-space models pe predict/update
  • Extended Kalman Filter — real attitude/navigation ke liye nonlinear generalization
  • Attitude estimation (AHRS) — drone/aircraft application
  • Inertial Navigation Systems — jahan drift correction mission-critical hai

Concept Map

integrate

vibration

good at high freq

good at low freq

Hlp plus Hhp = 1

discretize

blend weight alpha

alpha near 1 trust gyro

alpha near 0 trust accel

optimal extension

Attitude estimate theta

Gyroscope rate

Accelerometer angle

Gyro drift slow error

Accel noise fast error

Complementary filter

Complementary transfer funcs

Discrete update rule

alpha = tau over tau+dt

Kalman filter