FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate average voltage?

I am using FP-1000 with FP-AI-110, FP-DO-403 and FP-DI-330. I have a voltage coming in thru FP-AI-110. How do I calculate the average voltage within a 5 minute period.
0 Kudos
Message 1 of 2
(3,427 Views)
Hi Yan Sim,

The easiest way is to sum all the voltages read during the 5 minute period of time and divide by the number of readings. This will only work if you are reading your voltage periodically. Therefore, if you read a voltage every minute and you read the following voltages 1, 5, 8, 3, 5 in your 5 minute period of time, your average is (1+5+8+3+3)/5 = 4V.

It becomes slightly more complicated if your voltage readings are not periodic. If this is the case you will have to establish a timebase as a reference and you will have to fill the empty gaps with average values. For example let's assume the following readings where the "?" symbol means you didn't get a reading at that time:
0seconds = 5V
30seconds = ?
60seconds = ?
90seconds = 3V
120se
conds = 2V
150seoncds = ?
180seconds = 1V
210seconds = 6V
240seconds = ?
270seconds = 0V

What you have to do is fill the gaps with the average on either side (easiest method), or you can use a curve of best fit to find what the "gap" elements are (or any fitting algorithm). Let's just take the averages of each side:
0seconds = 5V
30seconds = 4V
60seconds = 4V
90seconds = 3V
120seconds = 2V
150seoncds = 3V
180seconds = 4V
210seconds = 6V
240seconds = 3V
270seconds = 0V

Then your average will be 34/10 = 3.4V in this 5 minute interval.

The key is to establish a timebase (30seconds in the example) and make sure all your readings have timestamps associated with them.

Anyway, I hope I understood the question correctly. Let me know if I didn't. Have a good day.

Ron
0 Kudos
Message 2 of 2
(3,427 Views)