Repository navigation
Calibrating for Accuracy
This documentation is for software version 0.2.0 and earlier. Click here to see this page in the latest docs.
Calibrating for accuracy is an important process that will help you get the most out of your power monitor. There are no "one size fits all" calibration settings that will give you optimal accuracy. The physical environment of your kit, the construction of your current transformers, and the unique component tolerances on the circuit board will all slightly impact the accuracy.
The following steps should be done in order.
This is a relatively quick and easy process with its own dedicated page. Please see this Wiki page.
Note: If you change your 9V AC transformer out, you should repeat this step with the new voltage transformer.
Here is the procedure for phase correction for the individual current transformers. If you're interested in the theory behind this step, I wrote a separate page on it here.
Note: If you reverse the polarity of your 9V AC transformer... meaning, you plug it into the wall receptacle upside down... some of the calculated values will display negative readings. Changing the direction of the 9V AC transformer changes the phase of the voltage wave from the power monitor's perspective.
Now that you've setup your specific voltage and corrected for phase errors in all of the current transformers you intend to use, we can finally work on getting them accurate. We'll be using a process similar to the voltage tuning performed in step 1. Except this time, you'll need an AC clamp meter instead of a multimeter. This AC clamp meter lists an accuracy rating of +/-(1.5% + 5 digits).
The goal for this final calibration is to scale the CT amperage values that are displayed when running the software in terminal mode. In the perfect setup, you would calibrate using a conductor with a completely steady amperage flowing through it that matches the current rating of each CT. Unfortunately, most of us don't have that in the real world, so you'll just have to do your best. I recommend using the current multiplication technique demonstrated in the phase correction procedure with a power hungry device.
Unlike the phase correction procedure where you had to use a purely resistive load, you can use any power hungry device for this calibration step. The more power hungry, the better, as long as the simulated current doesn't exceed the rating of your CT. Also, the steadier the device's power consumption, the better.
Note: Calibrating a 100A CT using a small load, such as 5A, is naturally going to induce errors in your measurements at higher loads. Imagine trying to estimate a meter, and then using your estimated meter to mark out a kilometer. The error factor in your meter estimate will be significantly multiplied in your kilometer.
-
Place one of your CTs and your AC clamp meter around the same conductor, or group of conductors if you're using the looping trick. If you are using the loop trick, quickly double check that the number of loops in your CT and the AC clamp meter are the same.
Note: I do not recommend calibrating multiple CTs at once. The magnetic field from one CT can interfere with the other CT and influence the results.
-
Start the power monitor in
terminalmode:cd ~/rpi_power_monitor/rpi_power_monitor python3 power_monitor.py terminal -
Turn on your load and start comparing the
Currentvalue for the CT that you're calibrating in the Terminal output against the reading on your AC clamp meter. Monitor the reading from both sources for a few cycles to get an idea of the trend.Note: it's okay if your clamp meter is reading drastically different from the power monitor at this point. In fact, if you are using anything but a 100A CT, this is expected. The software can't tell what kind of CT you're using, so this part of the calibration is about telling the software how to scale the reading up or down. If you are using a 20A CT, your
accuracy_calibrationvalue for that CT will be around 0.20... if you're using a 30A CT, it will be around 0.30, and so on. A 100A CT will have an accuracy calibration value of around 1.0. -
Take the reading from the AC clamp meter and divide it by the
Currentvalue in the terminal output. Example:Suppose my AC clamp meter shows a reading of approximately: 32.34 and the terminal output for CT0 shows: 30.186 32.34 / 30.186 = 1.07136 -
Stop the power monitor software by pressing
Ctrl c. Editconfig.pyand add the value you calculated to the specific CT number inside theaccuracy_calibrationvariable. Example:nano ~/rpi_power_monitor/rpi_power_monitor/config.pyaccuracy_calibration = { 'ct1' : 1.07136, 'ct2' : 1, 'ct3' : 1, 'ct4' : 1, 'ct5' : 1, 'ct6' : 1, 'AC' : 1, }Note: Make sure you don't delete the comma at the end of each value! Also, make sure you are not changing the values for
ct_phase_correction! -
Save the file by pressing
Ctrl x, theny. Then, update the module's configuration by re-installing with pip, and then start the power monitor again in terminal mode:cd ~/rpi_power_monitor pip install . python3 ~/rpi_power_monitor/rpi_power_monitor/power_monitor.py terminal -
Compare the
Currentreading again to the value on your AC clamp meter. It should be much closer now. Watch if for several updates to get an idea of the trend.- If the terminal output reads higher than the clamp meter, reduce the value for the specific CT in
config.py. - If the terminal output reads consistently lower than the clamp meter, increase the value in
config.py. - If you change the values in
config.py, you'll need to restart the software.
- If the terminal output reads higher than the clamp meter, reduce the value for the specific CT in
-
Repeat steps 1-7 for each current transformer you are going to use in your final deployment.
-
Finally, re-install the module with pip so that the calibration values take effect when the software is started as a service:
cd ~/rpi_power_monitor pip install .