Discrete power calculations for Microcontroller

Thread Starter

badgers

Joined Oct 9, 2012
14
I can't attach my spreadsheet so I am pasting the "inputs" below.
I would like to ask how to calculate power meter results in a spreadsheet so I can then program my Microcontroller.
my system will measure voltage and current in discreet (A to D) points.

I need to calculate the Real Power, VARs, VA, PF and frequency, and then total energy consumption(real power * time)

I have Real Power as the average of the Volt x Amp column
(1/418) x ∑V(n) * I(n) n= 1 to 418

I expect in the code this will be a running window of 418 samples(about 1 cycle at 60 hz) about 25khz sample rate that is NOT synced to zero crossings. this will ultimately be 3 phase but right now I am only doing a single phase system.

Below is the sample "input" data(sorry for the long list)
Code:
Sam
ple                             
#   , Voltage ,     Current ,   Volt*Amps 
1   ,  0.0000   ,  -50.9117   ,  0.0000
2   ,  2.5590   ,  -49.8823   ,  -127.6490
3   ,  5.1174   ,  -48.8416   ,  -249.9431
4   ,  7.6747   ,  -47.7897   ,  -366.7710
5   ,  10.2302   ,  -46.7270   ,  -478.0266
6   ,  12.7834   ,  -45.6537   ,  -583.6086
7   ,  15.3337   ,  -44.5700   ,  -683.4210
8   ,  17.8805   ,  -43.4761   ,  -777.3730
9   ,  20.4232   ,  -42.3724   ,  -865.3792
10   ,  22.9613   ,  -41.2590   ,  -947.3595
11   ,  25.4941   ,  -40.1363   ,  -1,023.2394
12   ,  28.0212   ,  -39.0044   ,  -1,092.9498
13   ,  30.5419   ,  -37.8637   ,  -1,156.4274
14   ,  33.0556   ,  -36.7143   ,  -1,213.6144
15   ,  35.5619   ,  -35.5566   ,  -1,264.4588
16   ,  38.0600   ,  -34.3908   ,  -1,308.9144
17   ,  40.5495   ,  -33.2172   ,  -1,346.9406
18   ,  43.0298   ,  -32.0360   ,  -1,378.5031
19   ,  45.5003   ,  -30.8476   ,  -1,403.5729
20   ,  47.9604   ,  -29.6521   ,  -1,422.1274
21   ,  50.4096   ,  -28.4499   ,  -1,434.1496
22   ,  52.8474   ,  -27.2412   ,  -1,439.6287
23   ,  55.2732   ,  -26.0264   ,  -1,438.5596
24   ,  57.6863   ,  -24.8056   ,  -1,430.9433
25   ,  60.0864   ,  -23.5792   ,  -1,416.7867
26   ,  62.4728   ,  -22.3474   ,  -1,396.1028
27   ,  64.8450   ,  -21.1105   ,  -1,368.9103
28   ,  67.2025   ,  -19.8688   ,  -1,335.2339
29   ,  69.5446   ,  -18.6226   ,  -1,295.1044
30   ,  71.8710   ,  -17.3722   ,  -1,248.5581
31   ,  74.1810   ,  -16.1178   ,  -1,195.6374
32   ,  76.4742   ,  -14.8598   ,  -1,136.3905
33   ,  78.7499   ,  -13.5984   ,  -1,070.8712
34   ,  81.0078   ,  -12.3339   ,  -999.1392
35   ,  83.2472   ,  -11.0666   ,  -921.2596
36   ,  85.4677   ,  -9.7967   ,  -837.3033
37   ,  87.6688   ,  -8.5247   ,  -747.3467
38   ,  89.8499   ,  -7.2507   ,  -651.4716
39   ,  92.0106   ,  -5.9750   ,  -549.7651
40   ,  94.1504   ,  -4.6980   ,  -442.3198
41   ,  96.2687   ,  -3.4199   ,  -329.2335
42   ,  98.3652   ,  -2.1411   ,  -210.6088
43   ,  100.4393   ,  -0.8618   ,  -86.5539
44   ,  102.4906   ,  0.4178   ,  42.8186
45   ,  104.5186   ,  1.6972   ,  177.3909
46   ,  106.5228   ,  2.9763   ,  317.0407
47   ,  108.5027   ,  4.2546   ,  461.6410
48   ,  110.4580   ,  5.5321   ,  611.0602
49   ,  112.3882   ,  6.8082   ,  765.1624
50   ,  114.2929   ,  8.0828   ,  923.8075
51   ,  116.1715   ,  9.3556   ,  1,086.8511
52   ,  118.0237   ,  10.6262   ,  1,254.1451
53   ,  119.8491   ,  11.8944   ,  1,425.5372
54   ,  121.6472   ,  13.1599   ,  1,600.8715
55   ,  123.4177   ,  14.4225   ,  1,779.9887
56   ,  125.1601   ,  15.6817   ,  1,962.7257
57   ,  126.8741   ,  16.9374   ,  2,148.9164
58   ,  128.5592   ,  18.1892   ,  2,338.3914
59   ,  130.2150   ,  19.4369   ,  2,530.9784
60   ,  131.8413   ,  20.6802   ,  2,726.5023
61   ,  133.4376   ,  21.9188   ,  2,924.7851
62   ,  135.0035   ,  23.1523   ,  3,125.6467
63   ,  136.5387   ,  24.3807   ,  3,328.9042
64   ,  138.0429   ,  25.6034   ,  3,534.3728
65   ,  139.5157   ,  26.8204   ,  3,741.8657
66   ,  140.9568   ,  28.0312   ,  3,951.1940
67   ,  142.3658   ,  29.2357   ,  4,162.1676
68   ,  143.7425   ,  30.4336   ,  4,374.5943
69   ,  145.0864   ,  31.6245   ,  4,588.2812
70   ,  146.3974   ,  32.8082   ,  4,803.0337
71   ,  147.6751   ,  33.9845   ,  5,018.6565
72   ,  148.9192   ,  35.1530   ,  5,234.9537
73   ,  150.1294   ,  36.3135   ,  5,451.7284
74   ,  151.3055   ,  37.4658   ,  5,668.7834
75   ,  152.4472   ,  38.6096   ,  5,885.9215
76   ,  153.5542   ,  39.7446   ,  6,102.9450
77   ,  154.6264   ,  40.8705   ,  6,319.6565
78   ,  155.6633   ,  41.9872   ,  6,535.8591
79   ,  156.6649   ,  43.0943   ,  6,751.3560
80   ,  157.6308   ,  44.1916   ,  6,965.9513
81   ,  158.5609   ,  45.2788   ,  7,179.4497
82   ,  159.4549   ,  46.3558   ,  7,391.6571
83   ,  160.3127   ,  47.4222   ,  7,602.3806
84   ,  161.1340   ,  48.4778   ,  7,811.4283
85   ,  161.9187   ,  49.5225   ,  8,018.6102
86   ,  162.6665   ,  50.5558   ,  8,223.7379
87   ,  163.3774   ,  51.5777   ,  8,426.6248
88   ,  164.0511   ,  52.5878   ,  8,627.0864
89   ,  164.6875   ,  53.5860   ,  8,824.9403
90   ,  165.2865   ,  54.5719   ,  9,020.0066
91   ,  165.8479   ,  55.5455   ,  9,212.1079
92   ,  166.3716   ,  56.5065   ,  9,401.0694
93   ,  166.8574   ,  57.4546   ,  9,586.7194
94   ,  167.3053   ,  58.3896   ,  9,768.8888
95   ,  167.7152   ,  59.3113   ,  9,947.4122
96   ,  168.0869   ,  60.2196   ,  10,122.1270
97   ,  168.4204   ,  61.1142   ,  10,292.8744
98   ,  168.7156   ,  61.9949   ,  10,459.4991
99   ,  168.9724   ,  62.8614   ,  10,621.8496
100   ,  169.1908   ,  63.7137   ,  10,779.7781
101   ,  169.3708   ,  64.5515   ,  10,933.1411
102   ,  169.5122   ,  65.3746   ,  11,081.7990
103   ,  169.6151   ,  66.1829   ,  11,225.6167
104   ,  169.6794   ,  66.9761   ,  11,364.4633
105   ,  169.7051   ,  67.7541   ,  11,498.2126
106   ,  169.6922   ,  68.5166   ,  11,626.7429
107   ,  169.6408   ,  69.2636   ,  11,749.9374
108   ,  169.5508   ,  69.9949   ,  11,867.6838
109   ,  169.4222   ,  70.7102   ,  11,979.8753
110   ,  169.2551   ,  71.4094   ,  12,086.4097
111   ,  169.0495   ,  72.0924   ,  12,187.1902
112   ,  168.8054   ,  72.7591   ,  12,282.1250
113   ,  168.5230   ,  73.4091   ,  12,371.1279
114   ,  168.2023   ,  74.0425   ,  12,454.1178
115   ,  167.8433   ,  74.6590   ,  12,531.0194
116   ,  167.4462   ,  75.2586   ,  12,601.7626
117   ,  167.0109   ,  75.8410   ,  12,666.2832
118   ,  166.5377   ,  76.4062   ,  12,724.5224
119   ,  166.0267   ,  76.9541   ,  12,776.4272
120   ,  165.4778   ,  77.4844   ,  12,821.9506
121   ,  164.8914   ,  77.9971   ,  12,861.0509
122   ,  164.2674   ,  78.4921   ,  12,893.6928
123   ,  163.6061   ,  78.9692   ,  12,919.8465
124   ,  162.9076   ,  79.4284   ,  12,939.4882
125   ,  162.1721   ,  79.8695   ,  12,952.6001
126   ,  161.3996   ,  80.2924   ,  12,959.1702
127   ,  160.5905   ,  80.6971   ,  12,959.1925
128   ,  159.7449   ,  81.0835   ,  12,952.6671
129   ,  158.8629   ,  81.4514   ,  12,939.5999
130   ,  157.9448   ,  81.8007   ,  12,920.0027
131   ,  156.9908   ,  82.1315   ,  12,893.8934
132   ,  156.0011   ,  82.4436   ,  12,861.2957
133   ,  154.9759   ,  82.7370   ,  12,822.2393
134   ,  153.9155   ,  83.0115   ,  12,776.7597
135   ,  152.8201   ,  83.2672   ,  12,724.8982
136   ,  151.6899   ,  83.5039   ,  12,666.7021
137   ,  150.5253   ,  83.7217   ,  12,602.2242
138   ,  149.3264   ,  83.9204   ,  12,531.5232
139   ,  148.0935   ,  84.1000   ,  12,454.6635
140   ,  146.8270   ,  84.2605   ,  12,371.7148
141   ,  145.5271   ,  84.4018   ,  12,282.7527
142   ,  144.1941   ,  84.5240   ,  12,187.8581
143   ,  142.8283   ,  84.6269   ,  12,087.1173
144   ,  141.4300   ,  84.7106   ,  11,980.6218
145   ,  139.9996   ,  84.7750   ,  11,868.4686
146   ,  138.5374   ,  84.8201   ,  11,750.7597
147   ,  137.0436   ,  84.8460   ,  11,627.6021
148   ,  135.5187   ,  84.8526   ,  11,499.1078
149   ,  133.9629   ,  84.8398   ,  11,365.3937
150   ,  132.3767   ,  84.8078   ,  11,226.5815
151   ,  130.7604   ,  84.7565   ,  11,082.7973
152   ,  129.1144   ,  84.6859   ,  10,934.1720
153   ,  127.4390   ,  84.5961   ,  10,780.8406
154   ,  125.7346   ,  84.4870   ,  10,622.9428
155   ,  124.0017   ,  84.3587   ,  10,460.6220
156   ,  122.2405   ,  84.2113   ,  10,294.0260
157   ,  120.4515   ,  84.0446   ,  10,123.3062
158   ,  118.6352   ,  83.8589   ,  9,948.6179
159   ,  116.7919   ,  83.6541   ,  9,770.1200
160   ,  114.9220   ,  83.4303   ,  9,587.9748
161   ,  113.0260   ,  83.1875   ,  9,402.3481
162   ,  111.1042   ,  82.9258   ,  9,213.4086
163   ,  109.1573   ,  82.6452   ,  9,021.3281
164   ,  107.1855   ,  82.3459   ,  8,826.2815
165   ,  105.1893   ,  82.0278   ,  8,628.4460
166   ,  103.1692   ,  81.6911   ,  8,428.0016
167   ,  101.1256   ,  81.3358   ,  8,225.1306
168   ,  99.0591   ,  80.9620   ,  8,020.0176
169   ,  96.9700   ,  80.5697   ,  7,812.8491
170   ,  94.8589   ,  80.1592   ,  7,603.8134
171   ,  92.7262   ,  79.7304   ,  7,393.1008
172   ,  90.5724   ,  79.2836   ,  7,180.9029
173   ,  88.3980   ,  78.8186   ,  6,967.4126
174   ,  86.2036   ,  78.3358   ,  6,752.8241
175   ,  83.9895   ,  77.8351   ,  6,537.3327
176   ,  81.7563   ,  77.3168   ,  6,321.1343
177   ,  79.5045   ,  76.7808   ,  6,104.4255
178   ,  77.2347   ,  76.2274   ,  5,887.4035
179   ,  74.9473   ,  75.6567   ,  5,670.2656
180   ,  72.6428   ,  75.0688   ,  5,453.2093
181   ,  70.3219   ,  74.4638   ,  5,236.4320
182   ,  67.9849   ,  73.8418   ,  5,020.1309
183   ,  65.6325   ,  73.2031   ,  4,804.5028
184   ,  63.2651   ,  72.5477   ,  4,589.7437
185   ,  60.8834   ,  71.8759   ,  4,376.0489
186   ,  58.4878   ,  71.1877   ,  4,163.6129
187   ,  56.0790   ,  70.4833   ,  3,952.6288
188   ,  53.6573   ,  69.7628   ,  3,743.2885
189   ,  51.2235   ,  69.0265   ,  3,535.7825
190   ,  48.7780   ,  68.2746   ,  3,330.2994
191   ,  46.3215   ,  67.5070   ,  3,127.0262
192   ,  43.8544   ,  66.7242   ,  2,926.1477
193   ,  41.3773   ,  65.9261   ,  2,727.8466
194   ,  38.8908   ,  65.1131   ,  2,532.3033
195   ,  36.3955   ,  64.2853   ,  2,339.6956
196   ,  33.8919   ,  63.4428   ,  2,150.1988
197   ,  31.3806   ,  62.5860   ,  1,963.9851
198   ,  28.8622   ,  61.7149   ,  1,781.2240
199   ,  26.3372   ,  60.8297   ,  1,602.0816
200   ,  23.8062   ,  59.9307   ,  1,426.7208
201   ,  21.2698   ,  59.0181   ,  1,255.3013
202   ,  18.7285   ,  58.0921   ,  1,087.9789
203   ,  16.1830   ,  57.1529   ,  924.9057
204   ,  13.6338   ,  56.2007   ,  766.2301
205   ,  11.0815   ,  55.2356   ,  612.0964
206   ,  8.5267   ,  54.2581   ,  462.6448
207   ,  5.9700   ,  53.2682   ,  318.0112
208   ,  3.4119   ,  52.2662   ,  178.3271
209   ,  0.8530   ,  51.2523   ,  43.7197
210   ,  -1.7060   ,  50.2267   ,  -85.6887
211   ,  -4.2647   ,  49.1897   ,  -209.7803
212   ,  -6.8224   ,  48.1416   ,  -328.4424
213   ,  -9.3786   ,  47.0824   ,  -441.5669
214   ,  -11.9326   ,  46.0126   ,  -549.0510
215   ,  -14.4839   ,  44.9324   ,  -650.7970
216   ,  -17.0319   ,  43.8419   ,  -746.7122
217   ,  -19.5761   ,  42.7414   ,  -836.7095
218   ,  -22.1158   ,  41.6312   ,  -920.7070
219   ,  -24.6505   ,  40.5116   ,  -998.6283
220   ,  -27.1795   ,  39.3827   ,  -1,070.4026
221   ,  -29.7024   ,  38.2449   ,  -1,135.9645
222   ,  -32.2185   ,  37.0984   ,  -1,195.2544
223   ,  -34.7273   ,  35.9434   ,  -1,248.2184
224   ,  -37.2282   ,  34.7803   ,  -1,294.8083
225   ,  -39.7207   ,  33.6093   ,  -1,334.9818
226   ,  -42.2041   ,  32.4306   ,  -1,368.7024
227   ,  -44.6779   ,  31.2445   ,  -1,395.9392
228   ,  -47.1415   ,  30.0514   ,  -1,416.6677
229   ,  -49.5945   ,  28.8514   ,  -1,430.8688
230   ,  -52.0361   ,  27.6448   ,  -1,438.5298
231   ,  -54.4659   ,  26.4320   ,  -1,439.6436
232   ,  -56.8834   ,  25.2132   ,  -1,434.2092
233   ,  -59.2879   ,  23.9886   ,  -1,422.2316
234   ,  -61.6789   ,  22.7585   ,  -1,403.7217
235   ,  -64.0559   ,  21.5233   ,  -1,378.6962
236   ,  -66.4183   ,  20.2832   ,  -1,347.1780
237   ,  -68.7656   ,  19.0385   ,  -1,309.1958
238   ,  -71.0973   ,  17.7895   ,  -1,264.7840
239   ,  -73.4128   ,  16.5364   ,  -1,213.9830
240   ,  -75.7117   ,  15.2795   ,  -1,156.8392
241   ,  -77.9933   ,  14.0192   ,  -1,093.4043
242   ,  -80.2572   ,  12.7557   ,  -1,023.7362
243   ,  -82.5028   ,  11.4893   ,  -947.8982
244   ,  -84.7297   ,  10.2203   ,  -865.9593
245   ,  -86.9373   ,  8.9489   ,  -777.9940
246   ,  -89.1251   ,  7.6755   ,  -684.0823
247   ,  -91.2927   ,  6.4004   ,  -584.3096
248   ,  -93.4395   ,  5.1238   ,  -478.7666
249   ,  -95.5650   ,  3.8461   ,  -367.5495
250   ,  -97.6688   ,  2.5674   ,  -250.7592
251   ,  -99.7505   ,  1.2882   ,  -128.5020
252   ,  -101.8094   ,  0.0087   ,  -0.8892
253   ,  -103.8452   ,  -1.2708   ,  131.9632
254   ,  -105.8574   ,  -2.5500   ,  269.9344
255   ,  -107.8455   ,  -3.8286   ,  412.8989
256   ,  -109.8090   ,  -5.1064   ,  560.7266
257   ,  -111.7476   ,  -6.3830   ,  713.2832
258   ,  -113.6608   ,  -7.6581   ,  870.4298
259   ,  -115.5482   ,  -8.9315   ,  1,032.0236
260   ,  -117.4093   ,  -10.2029   ,  1,197.9175
261   ,  -119.2437   ,  -11.4720   ,  1,367.9607
262   ,  -121.0509   ,  -12.7384   ,  1,541.9985
263   ,  -122.8307   ,  -14.0020   ,  1,719.8726
264   ,  -124.5825   ,  -15.2624   ,  1,901.4213
265   ,  -126.3059   ,  -16.5192   ,  2,086.4795
266   ,  -128.0007   ,  -17.7724   ,  2,274.8787
267   ,  -129.6664   ,  -19.0215   ,  2,466.4477
268   ,  -131.3025   ,  -20.2663   ,  2,661.0123
269   ,  -132.9088   ,  -21.5064   ,  2,858.3954
270   ,  -134.4849   ,  -22.7417   ,  3,058.4175
271   ,  -136.0304   ,  -23.9718   ,  3,260.8968
272   ,  -137.5450   ,  -25.1965   ,  3,465.6491
273   ,  -139.0283   ,  -26.4154   ,  3,672.4881
274   ,  -140.4800   ,  -27.6283   ,  3,881.2257
275   ,  -141.8997   ,  -28.8350   ,  4,091.6721
276   ,  -143.2872   ,  -30.0350   ,  4,303.6358
277   ,  -144.6421   ,  -31.2283   ,  4,516.9242
278   ,  -145.9641   ,  -32.4144   ,  4,731.3431
279   ,  -147.2529   ,  -33.5932   ,  4,946.6976
280   ,  -148.5082   ,  -34.7643   ,  5,162.7919
281   ,  -149.7298   ,  -35.9276   ,  5,379.4293
282   ,  -150.9173   ,  -37.0826   ,  5,596.4128
283   ,  -152.0705   ,  -38.2293   ,  5,813.5451
284   ,  -153.1891   ,  -39.3672   ,  6,030.6287
285   ,  -154.2729   ,  -40.4962   ,  6,247.4662
286   ,  -155.3216   ,  -41.6160   ,  6,463.8603
287   ,  -156.3350   ,  -42.7263   ,  6,679.6142
288   ,  -157.3128   ,  -43.8269   ,  6,894.5318
289   ,  -158.2548   ,  -44.9175   ,  7,108.4175
290   ,  -159.1609   ,  -45.9980   ,  7,321.0767
291   ,  -160.0308   ,  -47.0679   ,  7,532.3162
292   ,  -160.8643   ,  -48.1272   ,  7,741.9437
293   ,  -161.6612   ,  -49.1755   ,  7,949.7686
294   ,  -162.4214   ,  -50.2126   ,  8,155.6018
295   ,  -163.1446   ,  -51.2383   ,  8,359.2563
296   ,  -163.8307   ,  -52.2524   ,  8,560.5466
297   ,  -164.4796   ,  -53.2546   ,  8,759.2899
298   ,  -165.0910   ,  -54.2447   ,  8,955.3052
299   ,  -165.6650   ,  -55.2224   ,  9,148.4144
300   ,  -166.2012   ,  -56.1876   ,  9,338.4418
301   ,  -166.6997   ,  -57.1400   ,  9,525.2145
302   ,  -167.1602   ,  -58.0794   ,  9,708.5627
303   ,  -167.5828   ,  -59.0056   ,  9,888.3196
304   ,  -167.9672   ,  -59.9184   ,  10,064.3218
305   ,  -168.3135   ,  -60.8175   ,  10,236.4091
306   ,  -168.6214   ,  -61.7029   ,  10,404.4251
307   ,  -168.8911   ,  -62.5742   ,  10,568.2169
308   ,  -169.1223   ,  -63.4312   ,  10,727.6356
309   ,  -169.3151   ,  -64.2739   ,  10,882.5361
310   ,  -169.4693   ,  -65.1019   ,  11,032.7776
311   ,  -169.5850   ,  -65.9151   ,  11,178.2235
312   ,  -169.6622   ,  -66.7134   ,  11,318.7414
313   ,  -169.7008   ,  -67.4965   ,  11,454.2035
314   ,  -169.7008   ,  -68.2642   ,  11,584.4867
315   ,  -169.6622   ,  -69.0164   ,  11,709.4724
316   ,  -169.5850   ,  -69.7529   ,  11,829.0471
317   ,  -169.4693   ,  -70.4735   ,  11,943.1018
318   ,  -169.3151   ,  -71.1782   ,  12,051.5329
319   ,  -169.1223   ,  -71.8666   ,  12,154.2418
320   ,  -168.8911   ,  -72.5387   ,  12,251.1350
321   ,  -168.6214   ,  -73.1943   ,  12,342.1245
322   ,  -168.3135   ,  -73.8332   ,  12,427.1274
323   ,  -167.9672   ,  -74.4554   ,  12,506.0665
324   ,  -167.5828   ,  -75.0606   ,  12,578.8699
325   ,  -167.1602   ,  -75.6488   ,  12,645.4715
326   ,  -166.6997   ,  -76.2198   ,  12,705.8106
327   ,  -166.2012   ,  -76.7734   ,  12,759.8325
328   ,  -165.6650   ,  -77.3096   ,  12,807.4878
329   ,  -165.0910   ,  -77.8282   ,  12,848.7335
330   ,  -164.4796   ,  -78.3291   ,  12,883.5318
331   ,  -163.8307   ,  -78.8122   ,  12,911.8511
332   ,  -163.1446   ,  -79.2773   ,  12,933.6658
333   ,  -162.4214   ,  -79.7245   ,  12,948.9559
334   ,  -161.6612   ,  -80.1535   ,  12,957.7075
335   ,  -160.8643   ,  -80.5643   ,  12,959.9127
336   ,  -160.0308   ,  -80.9567   ,  12,955.5695
337   ,  -159.1609   ,  -81.3308   ,  12,944.6819
338   ,  -158.2548   ,  -81.6863   ,  12,927.2596
339   ,  -157.3128   ,  -82.0233   ,  12,903.3187
340   ,  -156.3350   ,  -82.3417   ,  12,872.8808
341   ,  -155.3216   ,  -82.6413   ,  12,835.9736
342   ,  -154.2729   ,  -82.9221   ,  12,792.6308
343   ,  -153.1891   ,  -83.1841   ,  12,742.8917
344   ,  -152.0705   ,  -83.4271   ,  12,686.8015
345   ,  -150.9173   ,  -83.6512   ,  12,624.4113
346   ,  -149.7298   ,  -83.8562   ,  12,555.7778
347   ,  -148.5082   ,  -84.0422   ,  12,480.9635
348   ,  -147.2529   ,  -84.2091   ,  12,400.0364
349   ,  -145.9641   ,  -84.3568   ,  12,313.0701
350   ,  -144.6421   ,  -84.4854   ,  12,220.1436
351   ,  -143.2872   ,  -84.5947   ,  12,121.3416
352   ,  -141.8997   ,  -84.6848   ,  12,016.7538
353   ,  -140.4800   ,  -84.7557   ,  11,906.4755
354   ,  -139.0283   ,  -84.8072   ,  11,790.6068
355   ,  -137.5450   ,  -84.8395   ,  11,669.2532
356   ,  -136.0304   ,  -84.8525   ,  11,542.5251
357   ,  -134.4849   ,  -84.8462   ,  11,410.5377
358   ,  -132.9088   ,  -84.8206   ,  11,273.4110
359   ,  -131.3025   ,  -84.7757   ,  11,131.2698
360   ,  -129.6664   ,  -84.7116   ,  10,984.2434
361   ,  -128.0007   ,  -84.6282   ,  10,832.4654
362   ,  -126.3059   ,  -84.5255   ,  10,676.0740
363   ,  -124.5825   ,  -84.4036   ,  10,515.2113
364   ,  -122.8307   ,  -84.2625   ,  10,350.0237
365   ,  -121.0509   ,  -84.1023   ,  10,180.6615
366   ,  -119.2437   ,  -83.9229   ,  10,007.2785
367   ,  -117.4093   ,  -83.7245   ,  9,830.0326
368   ,  -115.5482   ,  -83.5070   ,  9,649.0850
369   ,  -113.6608   ,  -83.2705   ,  9,464.6002
370   ,  -111.7476   ,  -83.0151   ,  9,276.7459
371   ,  -109.8090   ,  -82.7409   ,  9,085.6932
372   ,  -107.8455   ,  -82.4478   ,  8,891.6157
373   ,  -105.8574   ,  -82.1359   ,  8,694.6900
374   ,  -103.8452   ,  -81.8054   ,  8,495.0951
375   ,  -101.8094   ,  -81.4563   ,  8,293.0126
376   ,  -99.7505   ,  -81.0886   ,  8,088.6263
377   ,  -97.6688   ,  -80.7025   ,  7,882.1220
378   ,  -95.5650   ,  -80.2981   ,  7,673.6877
379   ,  -93.4395   ,  -79.8754   ,  7,463.5129
380   ,  -91.2927   ,  -79.4345   ,  7,251.7887
381   ,  -89.1251   ,  -78.9756   ,  7,038.7076
382   ,  -86.9373   ,  -78.4987   ,  6,824.4636
383   ,  -84.7297   ,  -78.0040   ,  6,609.2514
384   ,  -82.5028   ,  -77.4915   ,  6,393.2669
385   ,  -80.2572   ,  -76.9614   ,  6,176.7063
386   ,  -77.9933   ,  -76.4138   ,  5,959.7668
387   ,  -75.7117   ,  -75.8489   ,  5,742.6456
388   ,  -73.4128   ,  -75.2667   ,  5,525.5401
389   ,  -71.0973   ,  -74.6673   ,  5,308.6479
390   ,  -68.7656   ,  -74.0510   ,  5,092.1662
391   ,  -66.4183   ,  -73.4179   ,  4,876.2919
392   ,  -64.0559   ,  -72.7680   ,  4,661.2214
393   ,  -61.6789   ,  -72.1017   ,  4,447.1502
394   ,  -59.2879   ,  -71.4189   ,  4,234.2731
395   ,  -56.8834   ,  -70.7199   ,  4,022.7836
396   ,  -54.4659   ,  -70.0047   ,  3,812.8742
397   ,  -52.0361   ,  -69.2737   ,  3,604.7357
398   ,  -49.5945   ,  -68.5270   ,  3,398.5574
399   ,  -47.1415   ,  -67.7646   ,  3,194.5269
400   ,  -44.6779   ,  -66.9868   ,  2,992.8298
401   ,  -42.2041   ,  -66.1938   ,  2,793.6494
402   ,  -39.7207   ,  -65.3858   ,  2,597.1670
403   ,  -37.2282   ,  -64.5629   ,  2,403.5611
404   ,  -34.7273   ,  -63.7253   ,  2,213.0081
405   ,  -32.2185   ,  -62.8732   ,  2,025.6810
406   ,  -29.7024   ,  -62.0068   ,  1,841.7504
407   ,  -27.1795   ,  -61.1263   ,  1,661.3835
408   ,  -24.6505   ,  -60.2319   ,  1,484.7443
409   ,  -22.1158   ,  -59.3238   ,  1,311.9935
410   ,  -19.5761   ,  -58.4023   ,  1,143.2883
411   ,  -17.0319   ,  -57.4674   ,  978.7820
412   ,  -14.4839   ,  -56.5195   ,  818.6243
413   ,  -11.9326   ,  -55.5587   ,  662.9609
414   ,  -9.3786   ,  -54.5853   ,  511.9332
415   ,  -6.8224   ,  -53.5995   ,  365.6788
416   ,  -4.2647   ,  -52.6015   ,  224.3306
417   ,  -1.7060   ,  -51.5915   ,  88.0171
418   ,  0.8530   ,  -50.5698   ,  -43.1376
419   ,  3.4119   ,  -49.5366   ,  -169.0143
Moderators note: changed spoiler to code tags
 
Last edited by a moderator:

Thread Starter

badgers

Joined Oct 9, 2012
14
thank you for changing that, it seems like it lines up much better now.

PS to calculate VARs I would generally take the derivative of the voltage times the current and average those values like the power
Also, the voltage wave form is not always a true sinusoidal wave. There can be harmonics that distort the wave form, so I do not want to estimate power factor by timing zero crossings of voltage and current. PF calcs based on time delay of zero crossing really falls apart with harmonics.
I am hoping to increase accuracy with harmonics by calculating Watt and VAR and then computing VA. with that I can calc PF.
I do imagine that I need to record zero crossing of the voltage to estimate frequency unless there is a better way.
thank you
 
Last edited:

Thread Starter

badgers

Joined Oct 9, 2012
14
I have found that computing the RMS of the voltage and current over half a cycle and using those to compute VA has been more accurate and wont require the deriviate. Then with power and VA I calculate VAR and Power Factor.

I am looking for opinions to evaluate how this would work with harmonic content.
V(n) * I(n) = instantaneous power
Average instantaneous power over a cycle gives me real power
V(n)^2 and then I(n)^2 averaged over the cycle gives me RMS values.
Vrms * Irms gives me VA
Watt/VA = PF
VAR = √VA^2-KW^2
any thoughts on this math sequence and how to improve it?
 

Thread Starter

badgers

Joined Oct 9, 2012
14
ok so simulation in excel with just 3rd harmonic current shows Irms had significant changes
Average of the voltage deriviative * current held much better across harmonic challenges to what I THINK should still be the same power and VARS.

however I am not sure if with significant harmonic contribution I would be seeing a change in power or VARS delivered.
 
Top