Vai al contenuto

How to acquire AC signal, voltage and RMS

Home Forum Controllori SlimLine e Netsyst (LogicLab) How to acquire AC signal, voltage and RMS

Stai visualizzando 1 post (di 1 totali)
  • Autore
    Post
  • #35363
    Sergio Bertana
    Amministratore del forum

    A customer asks to me if is it possible to acquire AC signal, voltage and RMS using a SlimLine Compact CPU. The answer is yes, the Compact CPU has 2 analog input channels with DC range from 0 to 10 volts, the inputs are capable to acquire with 10 bits resolution with acquisition time of 5 uS.

    Due the possibility to fast acquire the voltage, I have developed a simply program, executed in the fast task at every 500 uS, it reads an AC signal, please remember that the analog input can read only the positive half-wave. Assuming an AC voltage at 50 Hz, the signal is sampled 20 times.

    The program wait the zero-crossing of the signal, then acquires the input voltage and saves the peak value, it is used to calculate the voltage V=VPeak/1.4142.

    To calculate the RMS the signal must be sampled as many times is possible (In my program it is sampled 20 times) and then it’s possible to calculate the RMS. It’s the square root of the squared samples average value. Here the program printout and the source download.

Stai visualizzando 1 post (di 1 totali)
  • Devi essere connesso per rispondere a questo topic.