gcjr:
it's obviously not clear enough. can you explain some more
Okay.
The machine consists of 9 outlets, the sensors, the solid state relays (SSRs), and the Arduino.
Initially (and obviously), the current readings from the sensors read 0 amperes (all we care about is the current, disregard voltage and power).
When there are loads plugged into the outlets (appliances, tools, anything that plugs into an outlet), they draw a certain amount of current. Each outlet has 3 SSRs, and each SSR is connected to one of three branch circuits. The purpose of the SSRs are to change what branch circuit the outlet is connected to.
The power analyzers (sensors) read the current in each outlet via a current transformer and sends it to the Arduino as a number (in amperes).
Using some code (which I need help with), the Arduino figures out which branch circuit each outlet needs to connect to in order to evenly distribute the current.
For example, across the 9 outlets, there are four 5 ampere loads, three 3 ampere loads, and two 8 ampere loads.
The code iterates the best way to connect the outlets to one of three branch circuits, so that the loads are evenly distributed across the three branch circuits.
In this case,
Branch Ckt 1: BC2: BC3:
2 - 8A 1 - 3A 2 - 3A
2 - 5A 2 - 5A
Total: BC1: 16A, BC2: 13A, and BC3: 16A
There may be some other combination, but this was the best that I could came up with.
Then the process is complete and the circuit will then be rebalanced once there is a noticeable change in current in at least one outlet.
johnwasser:
For each load:
if moving that load from its current branch circuit to one of the other branch circuits would make the total load on each of those two branches more similar, move that load to the other branch.
For example if Branch1 is providing 5 amps, Branch2 is providing 8 Amps, and Branch3 is providing 6 Amps you would move a 2 Amp load from Branch 2 to Branch 1 to make the totals 7, 6, and 6 but if there were only two 4-Amp load on Branch2 you would not move either of them to Branch1 because that would make them 9,4,6 an the difference between 9 and 4 is greater than the difference between 5 and 8.
I think you hit the nail on the head, there. But please try to read my above explanation to see if it matches with your understanding. Thanks!
6v6gt:
Can you now draw a diagram of the network topology?
If by network topology you mean the circuit diagram, I have attached a somewhat complete circuit diagram.
NOTE: The wiring from the convenience outlet to the BCs are incorrect, the correct one is that each row of SSRs connect to a BC, so row 1 connects to BC1, 2 to 2, and 3 to 3. Also, the L terminal for the outlets are all connected. Only the N terminal is the one that jumps from BC to BC.