Here is a sketch that will enable a precise measurement of the difference in phase errors of the a.c. adapter and current transformer. This is the value for phaseCal that is used by emonLibCM to compensate for the combined effect of the phase errors of the two transformers.
It works in a completely different way to the standard sketch, so unfortunately there is no realistic possibility of combining the two sketches, not least because of memory constraints.
You must be prepared to compile and upload this sketch (ideally using the Arduino IDE – I cannot support platformio) to test and record the values that the “working” sketch needs, and afterwards to download from Github the “default” or working sketch that was in your emonTx when you received it, compile and upload that and then calibrate it using the values you have measured.
The zip file contains the sketch and documentation. Unzip the contents into your Arduino sketchbook directory, then configure the sketch according to the documentation.
The User Documentation PDF file can be moved or copied to a convenient location of your choosing.
emonTx_Phase_Calibrator.zip (83.0 KB)
|emonTx Phase Calibrator User Doc.pdf:||078d2fd0c25d3ade24fe7162e692aad1|
Any future updates will be published here.