3.5.20 · D2 · HinglishGuidance, Navigation & Control (GNC)

Visual walkthroughSensor fusion — complementary filter (simple), Kalman filter (optimal)

2,362 words11 min read↑ Read in English

3.5.20 · D2 · Physics › Guidance, Navigation & Control (GNC) › Sensor fusion — complementary filter (simple), Kalman filter

Kisi bhi algebra se pehle, teen plain-English promises un words ke baare mein jo hum use karenge:


Step 1 — Guess ko dot nahi, hill ki tarah draw karo

KYA HAI. Apni guess ko number line par ek single point ki tarah draw karne ki jagah, hum ise ek bell-shaped hill ki tarah draw karte hain (ek Gaussian distribution). Peak hamaare estimate par hoti hai; hill ki width uncertainty hai.

KYUN. Ek single dot pretend karta hai ki hum answer exactly jaante hain — hum jaante nahi. Ek hill honestly kehti hai "peak ke paas probably, thoda idhar-udhar bhi shayad." Poora Kalman machinery tabhi kaam karta hai jab yeh poori hills ke baare mein reason kare, dots ke baare mein nahi. Yeh Bayesian estimation ki language hai.

PICTURE. Do hills: ek narrow tall (confident guess, chhota ) aur ek wide flat (unsure guess, bada ). Same peak location, bohot alag meaning.

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


Step 2 — Hamare paas DO hills hain, aur woh disagree karte hain

KYA HAI. Ab dono informants ko ek saath laao. Hill A hamaari prior guess hai (gyro ki prediction se): peak , width . Minus sign () matlab hai "naye measurement ko dekhne se pehle." Hill B measurement hill hai: peak , width .

KYUN. Fusion ka matlab hai do disagreeing hills ko ek behtar hill mein combine karna. Combine karne ke liye pehle unhe side by side dekhna hoga aur notice karna hoga ki woh overlap karte hain par coincide nahi karte — truth kahin overlap mein hai.

PICTURE. Blue prior hill aur orange measurement hill same axis par drawn, peaks apart, dono kaafi wide.

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

Yahan sirf shorthand hai "ek bell hill jo peak par centred hai is width ke saath."


Step 3 — Hills ko multiply karo → fused hill unke beech land karti hai

KYA HAI. Do independent hills ko fuse karne ke liye hum unhe point by point multiply karte hain aur re-normalise karte hain. Result ek teesri bell hill hai — dono parents se taller aur narrower, apना peak jis parent ki taraf khicha hua ho jo narrower thi.

KYUN multiply? Har hill ek statement hai ki "har value kitni believable hai." Jab do independent informants dono weigh in karte hain, believability multiply hoti hai (yeh independent evidence ke liye Bayes' rule hai). Aur do bells ko multiply karne se hamesha ek aur bell milti hai — yeh lucky fact hi reason hai ki Kalman filter simple rehta hai.

PICTURE. Blue aur orange parent hills, green fused hill unke peaks ke beech baith kar, clearly dono se taller aur thinner.

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

Step 4 — Fused peak ko "A se B ki taraf walk" ki tarah likho

KYA HAI. Messy product formula par seedha jump karne ki jagah, hum answer ko parameterise karte hain. Fused peak necessarily aur ke beech mein honi chahiye, toh ise prior se measurement ki taraf partial step ki tarah likho:

KYUN yeh shape. Yeh guarantee karta hai ki kisi bhi ke liye jo aur ke beech ho, answer do peaks ke beech hoga, aur yeh ek ek unknown ko isolate karta hai jis par humein actually care karna hai: kitna door walk karna hai, woh number . Humne ise gain ka naam diya.

PICTURE. Ek number line: (blue dot) se start karo, target (orange dot). length ka ek arrow humein green fused point par land karta hai. Gap ko innovation label kiya gaya hai — surprise, "measurement ne hamaari guess se kitna disagree kiya."

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

  • → move mat karo → measurement ignore karo, purani guess rakhho.
  • → poora walk karo → guess phenko, measurement maano.
  • beech mein → ek blend. Kaun sa best hai? Yahi Step 5 mein hai.

Step 5 — Hamare walk ki uncertainty mein ek parabola hai

KYA HAI. ki har choice ek fused guess produce karti hai kuch leftover uncertainty ke saath. Kyunki do error sources independent hain, unke variances weighting ke baad add hote hain:

KYUN yeh weights. Prior ka error se scale hoke survive karta hai (humne uska fraction rakha); measurement ka error se scale hoke enter karta hai (humne uska fraction andar aane diya). Square karne se "scaled error" "scaled variance" ban jaata hai. Koi cross term nahi, kyunki do noises independent hain.

PICTURE. ko ke against plot karo. Yeh ek muskurata hua parabola hai (ek valley). Far left (): , poori prior uncertainty. Far right (): , poori measurement uncertainty. Beech mein kahin lowest point hai — best .

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


Step 6 — Valley ke bottom par slide karo → gain formula

KYA HAI. Ek smooth valley ke bilkul bottom par, ground momentarily flat hoti hai: slope zero hai. ka slope ke respect mein likha jaata hai (ek derivative — yeh jawab deta hai "jab main ko thoda nudge karta hoon toh kitni tezi se change hoti hai?"). Us slope ko zero set karo.

KYUN derivative aur kuch aur nahi. Humein parabola ka turning point chahiye. Derivative exactly woh tool hai jo local slope report karta hai; jahan yeh zero hit karta hai wahi curve girna band karke upar jaana shuru karta hai — minimum. Koi aur tool bottom ko itni directly pinpoint nahi karta.

PICTURE. Wahi parabola, uske lowest point ko touch karta hua ek flat tangent line, aur -axis par mark karta hua ek dashed line.

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

ke liye solve karo (2 se divide karo, expand karo, gather karo):


Step 7 — Fused width, aur kyun "information add hoti hai"

KYA HAI. ko parabola mein wapas daalo. Algebra ke baad yeh clean bottom-value mein collapse ho jaata hai:

KYUN yeh beautiful hai. Har variance ko uske reciprocal mein flip karo — ise precision (certainty ki bigness) kaho. Aakhri equation kehti hai: precisions simply add hote hain. Do clues → unki information add karo → fused hill hamesha dono parents se sharper hoti hai.

PICTURE. Teen horizontal "certainty bars": prior precision , sensor precision , aur unka sum — fused bar literally do ko end-to-end stack kiya hua hai.

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


Step 8 — Edge cases (kuch bhi surprise nahi karna chahiye)

KYA HAI & KYUN. Jis formula par tum trust karte ho woh har extreme se survive karna chahiye. ke corners walk karo:

Situation ban jaata hai Meaning
Perfect sensor, Poora walk karo — measurement par poora believe karo. Fused .
Useless sensor, Mat hilo — purani guess rakhho. Fused .
Pehle se perfectly sure, Sensor ignore karo — certainty par improve nahi kar sakte.
Bilkul lost, Sensor ko dono haathon se pakdo.
(equal trust) Difference split karo — plain average.

PICTURE. Trust-fraction ko plot karo jab se large sweep karta hai, fixed ke liye: ek smooth curve jo se ki taraf girta hai, exactly se guzarta hai jahan ho.

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

Ek-picture summary

Upar sab kuch ek loop hai: Predict (guess drift karti hai, hill se wide hoti hai) → gain compute karo (valley ka bottom) → Update (measurement ki taraf walk karo, hill narrow hoti hai). Phir repeat.

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

add Q

next tick

Prior hill: xhat-minus, P-minus

Predict: hill widens

Measurement hill: z, R

Gain K = Pminus over Pminus plus R

Walk: xhat = xhat-minus + K times innovation

Fused hill: narrower, precisions add

Recall Feynman retelling — poora walk plain words mein

Socho drone ke angle ke baare mein tumhara belief ek line par ek hill hai: peak tumhari best guess hai, width tumhari unsureness hai. Tumhe ek sensor se doosri hill milti hai — alag peak, apni width. Do honest hills combine karne ke liye tum unhe multiply karte ho, jo magically ek teesri hill deta hai peaks ke beech baith kar, dono se narrower — kyunki do clues hamesha ek se behtar hote hain. Ab naya peak exactly kahan baithega? Ise "purani guess se shuru karo aur sensor ki taraf fraction walk karo" ki tarah likho. Har tumhe kuch leftover fuzziness deta hai, aur agar tum us fuzziness ko ke against plot karo toh tumhe ek valley milti hai. Best valley ka bottom hai, yeh poochh kar milta hai "ground flat kahan hai?" — wahi derivative equals zero hai. Nikalta hai : ek simple trust fraction jo sensor ki taraf lean karta hai jab tumhari apni guess shaky ho aur tumhari guess ki taraf jab sensor noisy ho. Widths ko "certainties" mein flip karo aur punchline saamne aata hai — certainties bas add hoti hain. Complementary filter (dekho Low-pass and High-pass filters) frozen ke saath wahi walk hai; Kalman filter har single tick mein perfect recompute karta hai. Yahi poora idea hai Attitude estimation (AHRS) aur Inertial Navigation Systems ke peeche, aur Extended Kalman Filter sirf yahi walk hai curved terrain par ki gayi.

Recall Quick self-check

Innovation words mein kya matlab hai? ::: "Surprise" — fresh measurement ne hamaari prediction se kitna disagree kiya. Fused hill hamesha dono parents se narrower kyun hoti hai? ::: Kyunki independent clues certainty add karte hain (precisions add hote hain), kabhi subtract nahi karte. Jab sensor noise badhti hai, toh gain rise karta hai ya fall? ::: Woh fall karta hai — hum ek shakier sensor par kam trust karte hain. Optimal geometrically kahan se aata hai? ::: Variance-vs- parabola ke bottom se, jahan slope ho.