Balancerator: angle-estimation reference
gyro prediction + accel correction; check the variance notation before copying the Kalman function
Ts = 0.004 from the example, still needs replacing. wondering how much loop-timer jitter alone shifts the estimate
inputs: angular velocity from the gyro and an angle estimate from accelerometer components. The Day 25 notes use a sample interval Ts = 0.004 s from an example and explicitly mark it for replacement; it is not a measured loop period for this device.

Gaussian prediction and measurement-update equations.
recorded prediction: angle[k] = angle[k-1] + rate[k] * Ts. The intended update combines the gyro prediction with accelerometer measurement M[k], weighted by a Kalman gain. The notes list an initial gyro-rate standard deviation of 4°/s and an accelerometer-angle standard deviation of 3°.
code pointers: Day 26 “Kalman Filtration Function”; KalmanAngleRoll, KalmanAnglePitch, KalmanUncertaintyAngleRoll, KalmanUncertaintyAnglePitch, and LoopTimer.
review flags: the prose uncertainty recurrence appears to multiply previous uncertainty by a time/noise term and the notation squares values described as variances. Re-derive the covariance update and settle whether each variable stores a variance or standard deviation before reusing it. Also distinguish pitch/roll estimates from yaw; the printed angle equations do not provide a yaw measurement.
saved explanations: Kalman introduction, implementation walkthrough.