Created
June 16, 2018 14:05
-
-
Save oseiskar/9965370acf2e9232a80c32d0989a97d6 to your computer and use it in GitHub Desktop.
RC discharge simulation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got the below expressions for the intervals.
Note that log of capacitor voltage VC divided by starting voltage V0 is always negative (we can assume even with error bounds that this is true (it is because VC drops so much per 5us)).
I assumed [ta, tb] = [t, t] because the clock is very high precision in this context, at 20ppm, resulting in only 100 picoseconds of error per 5 us interval that I'm using. According to my previous formulas, its effect in the total error is absolutely invisible (I did take into account that this error is cumulative).
Fwiw the formula for error caused by time (using 5us steps) is E_t(t) = (E_t_meas * t/(5e-6)) * (-1)/(C*log(VC(t)/V0)) with E_t_meas 100e-12 being the measurement error (20ppm of 5us)