For accurate calibration, some form of reference standard is required. The installed electricity meter can often be used for this purpose.
Most utility meters generate a stream of optical pulses to show the rate at which energy is being consumed. By clipping a CT around one of the incoming power cables, and running appropriate software on the hardware-under-test, a similar stream of optical pulses can be generated.
The pulse stream rate for the hardware-under-test can be adjusted by changing the relevant powerCal value. When the two streams of pulses are in synch, correct calibration has been achieved.
Calibrating the CT1 channel for grid power/energy
When calibrating a new set of hardware, the first stage is to calibrate the CT1 channel. For that purpose, the hardware-under-test should be running the program cal_CT1_v_meter.ino which is available from the Downloads page.
For every unit of energy that is measured at the grid-connection point via CT1, a pulse will be generated at the output port. The rate of the pulses can be varied by changing the value of powerCal_grid. A similar stream of pulses will be seen at the meter.
To advance one stream of pulses relative to the other, a second path for current will need to flow through CT1. The power drawn by any small appliance will do - just one of its live cores needs to pass through CT1 - and the current can flow in either direction. When the appliance is turned off, the extra wire will have no effect on the CT's performance because no current is flowing through it.
When the correct value has been found for powerCal_grid, that same value can be used with any Mk2 PV Router sketch which is to be run on the same hardware.
A video of this technique in operation can be seen at:
Calibrating the CT2 channel for diverted energy measurementHaving obtained the correct value for powerCal_grid, the "grid" channel can then be used to calibrate the "diverted power" channel which uses CT2. For that purpose, the hardware-under-test should be running the program cal_CT2_v_CT1.ino which is available from the Downloads page. The parameter powerCal_grid should be set to the correct value as previously determined in the first part of this process.
Both CTs should be mounted around the same current-carrying lead. If CT2 has been built-into a completed system, the override switch can be used to force power through that wiring. The CT2 channel of a free-standing board can be calibrated using just a modified extension cable which runs between any convenient mains socket and a suitable appliance.
A video of this latter technique can be seen at:
As shown in the video, the two streams of pulses can be synchronised by earthing R11 which is tracked to port A0/D14. It is then a simple matter to determine which stream of pulses is faster than the other, and to adjust the value of powerCal_diverted until both streams are in synch.
When the correct value has been found for powerCal_diverted, that same value can be used with any Mk2 PV Router sketch which is to be run on the same hardware.