Inductance tester , continued

 I tried previously to measure the inductance of a coil using the same method as for capacitors :

take 2 points in the charge/discharge curve and compute the L value

After a pulse on the coil, the voltage across it is (1-exp(-t*R/L)), so if we have t, R and 2 points we can compute L.

The problem with inductance is the curve is very very small, like ~ 1us, way too fast for the ADC, and using very small R will give high current.

Recently i saw a youtube video from DiodeGoneWild,  he showed his own inductance meter

It's 100% pure analog, no MCU.

How does it work ?

It sends GND/VCC squares to the coil do trigger charges/discharges.

A schmidt trigger creates a nice square when coil voltage is between 1/3 and 2/3 vcc.

The duration of the square gives the inductance.

Measuring a small-ish duration is not easy to do with analog circuits so that's how it does it :

since a PWM is charging/discharging the coil and generates squares, the output squares are integrated though a 2nd order low pass filter.

The average voltage  = (duration of the square)/(duration of the PWM)


Ok, since we do software, how can we do ?

First, instead of selecting RC+inverters  as a PWM source we can use one timer of the MCU

That's for free and will give good accuracy ( max we need is ~ 100 kHz or so)

Second, we can do the same trick i.e. integrates the squares and measure the average value after integration. It would be all automati.  Maybe we can do better.

My idea is to have a timer counting the duration of the pulse. Even if the pulse is small (~ 1 us), if the MCU is fast enough that should give us something acceptable in terms of accuracy.

We can adjust the PWM until we are in the "ideal" spot to get good results.


The first try with my homemade square generator was not great for  several reasons :

  1. The square generator is too soft to raise/lower the output. That prevents the voltage across the coil to get high.
  2. The schmidt triggers i have are CD4050s , powered by 5v. They seem to be a bit slow for that usage.
Ideally, it would be a small mod on the STM32 component tester, just adding a few (inverting) schmidt trigger gate and that's it.
NB, the same principle can also be used for capacitors.




Comments

Popular posts from this blog

Component tester with STM32 : Part 1 ADC, Resistor

Fixing the INA3221

INA3221, weird wiring