I have a result:
It appears indeed to be an artefact in the Input processing, and it is affected by the order in which the calculations appear. I’ve yet to complete a full analysis, and no doubt further tests will be needed.
Test Setup: An emonTx4, with 3 c.t’s - 100, 50 & 25 A from The Shop, all three on my c.t. test rig, all on the same “cable” but each taking a different number of turns so as to read the same in mV output. The emonTx4 running my 12-inputs demo sketch for emonLibDB.
Logging in emonCMS:
The 3 powers P1, P2 & P3
The 6 differences P1-P2, P1-P3, P2-P1, P2-P3, P3-P1 & P3-P2 which appear in this order in the input processing and so presumably are processed in this order.
P1-P2 & P1-P3 are processed on P1 Input page.
P2-P1 & P2-P3 are processed on P2 Input page.
P3-P1 & P3-P2 are processed on P3 Input page.
The current is set to show approx. 1950 W, stepped up to 2350 W, then back to approx 1950 W.
The initial results:
And the raw data:
“Date-time string”, “emonTx4_17:P1”, “emonTx4_17:P2”, “emonTx4_17:P3”, “emonTx4_17:P1-P2”, “emonTx4_17:P2-P1”, “emonTx4_17:P1-P3”, “emonTx4_17:P3-P1”, “emonTx4_17:P2-P3”, “emonTx4_17:P3-P2”
2023-10-29 12:40:30, 1974, 1958, 1957, 19, -16, 20, -17, 4, -1
2023-10-29 12:40:40, 1976, 1960, 1960, 18, -16, 19, -16, 3, 0
2023-10-29 12:40:50, 1980, 1964, 1963, 20, -16, 20, -17, 4, -1
2023-10-29 12:41:00, 1971, 1955, 1954, 7, -16, 8, -17, -8, -1
2023-10-29 12:41:10, 1967, 1951, 1950, 12, -16, 13, -17, -3, -1
2023-10-29 12:41:20, 1965, 1949, 1949, 14, -16, 15, -16, -1, 0
2023-10-29 12:41:30, 1958, 1942, 1941, 9, -16, 9, -17, -7, -1
2023-10-29 12:41:40, 2012, 1997, 1996, 70, -15, 71, -16, 56, -1
2023-10-29 12:41:50, 2357, 2339, 2338, 360, -18, 361, -19, 343, -1
2023-10-29 12:42:00, 2359, 2341, 2340, 20, -18, 21, -19, 3, -1
2023-10-29 12:42:10, 2361, 2343, 2342, 20, -18, 21, -19, 3, -1
2023-10-29 12:42:20, 2358, 2339, 2338, 15, -19, 16, -20, -3, -1
2023-10-29 12:42:30, 2361, 2342, 2341, 24, -19, 25, -20, 6, -1
2023-10-29 12:42:40, 2375, 2356, 2355, 33, -19, 34, -20, 15, -1
2023-10-29 12:42:50, 2365, 2346, 2346, 9, -19, 10, -19, -9, 0
2023-10-29 12:43:00, 2361, 2343, 2342, 15, -18, 15, -19, -3, -1
2023-10-29 12:43:10, 2368, 2349, 2348, 25, -19, 26, -20, 7, -1
2023-10-29 12:43:20, 2364, 2345, 2344, 15, -19, 16, -20, -3, -1
2023-10-29 12:43:30, 2356, 2338, 2337, 11, -18, 12, -19, -6, -1
2023-10-29 12:43:40, 2110, 2094, 2093, -228, -16, -227, -17, -243, -1
2023-10-29 12:43:50, 1982, 1967, 1966, -112, -15, -111, -16, -126, -1
2023-10-29 12:44:00, 1978, 1963, 1962, 11, -15, 12, -16, -3, -1
2023-10-29 12:44:10, 1980, 1964, 1963, 17, -16, 18, -17, 2, -1
2023-10-29 12:44:20, 1976, 1960, 1959, 12, -16, 13, -17, -3, -1
2023-10-29 12:44:30, 1977, 1962, 1961, 17, -15, 18, -16, 3, -1
2023-10-29 12:44:40, 1972, 1957, 1956, 10, -15, 11, -16, -4, -1
2023-10-29 12:44:50, 1975, 1960, 1959, 18, -15, 19, -16, 4, -1
2023-10-29 12:45:00, 1980, 1964, 1964, 20, -16, 21, -16, 5, 0
2023-10-29 12:45:10, 1978, 1963, 1962, 14, -15, 14, -16, -1, -1
Despite all three inputs seeing exactly the same current, averaging over exactly the same period to within two samples in a set of 12 samples (around 100µs), and reporting in the same data packet by radio:
P1 - P2, P1 - P3 & P2 - P3 show a large positive spike with increasing power and a negative spike on decreasing power.
P2 - P1, P3 - P1 & P3 - P2 show no spike (on the same scale).
My initial conclusion appears to be that a power lower down the Inputs list does not have its present value known when it appears in a process step higher up the process list, so a “last known” value is used.
e.g., looking at the CSV file lines 8 & 9 (the heading is line 0):
P2 - P3 (= 343) = P2[9] (= 2339) - P3[8](= 1996) which is indeed correct maths.
@TrystanLea Sorry, but you appear to be wrong when you wrote