![]() |
AC voltage and calibration - Printable Version +- Smart Home Automation Forum (https://www.kincony.com/forum) +-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20) +--- Forum: KC868-M16 / M1 / MB / M30 (https://www.kincony.com/forum/forumdisplay.php?fid=50) +--- Thread: AC voltage and calibration (/showthread.php?tid=3764) |
RE: AC voltage and calibration - nickdd - 12-19-2023 Hi, I'm sorry but I don't know how to perform a calibration when I have these values. What values am I supposed to use? I tried with different attenuation settings for the ADC but always end up with jumpy values: - no load connected: 'ai1': Sending state 1.03200 V with 3 decimals of accuracy - 100W light bulb: 1.0360V - 500W light bulb: 1.0310V So I don't really see sensible values. Power factor of test devices is 100. Jumper setting is set to V instead of A. Even tried switching them but don't see differences in the values. From code example I see: - calibrate_linear: # Measured value of 0 maps to 0A - 0 -> 0 # Known load: 4.0A # Value shown in logs: 0.1333A - 0.31749 -> 8.95608 => but I don't have input values for the mapping. They are all random and in the same range regardless if there is load connected or how heavy it is. Is something missing in the code/config? RE: AC voltage and calibration - admin - 12-19-2023 1. when AC cureent is 0A, then see your LOG what's RAW value "X". 2. use a large power AC load, use multi meter to test AC current value "Z". then see your LOG what's RAW value "Y". use these two value make the map. - X -> 0 - Y -> Z RE: AC voltage and calibration - nickdd - 12-19-2023 (12-19-2023, 11:12 AM)admin Wrote: 1. when AC cureent is 0A, then see your LOG what's RAW value "X". My apologies, but I was confused and thought the calibration was done with the voltages of the ADC. The "raw" amps in the output make more sense and are steady. So I was confused there. Will do the mappings like that and report back. RE: AC voltage and calibration - admin - 12-20-2023 you can try it, hope you work fine. RE: AC voltage and calibration - nickdd - 12-21-2023 Hi, While doing the calibration I see that for some measurements I have more samples. These measurements are much more accurate compared to these with for example only 50 SPS. Makes sense, and therefore I want to perform calibration with all higher settings since I'm using constant loads with power factor 100. But I don't find how I can configure esphome to have all measurements with higher SPS values. If've tried sample_interval for the ct_clamp sensor but that doesn't seem to have effect. I do see a lot of entries of "switch to input X" which follow eachother very quickly, maybe I need to delay that somehow? Line 638: [20:51:05][D][ct_clamp:041]: 'Measured Current-16' - Raw AC Value: 0.015A after 469 different samples (2345 SPS) Line 651: [20:51:05][D][ct_clamp:041]: 'Measured Current-8' - Raw AC Value: 0.014A after 324 different samples (1620 SPS) Line 702: [20:51:06][D][ct_clamp:041]: 'Measured Current-14' - Raw AC Value: 0.012A after 10 different samples (50 SPS) Line 704: [20:51:06][D][ct_clamp:041]: 'Measured Current-13' - Raw AC Value: 0.015A after 10 different samples (50 SPS) Line 706: [20:51:06][D][ct_clamp:041]: 'Measured Current-3' - Raw AC Value: 0.029A after 10 different samples (50 SPS) Line 708: [20:51:06][D][ct_clamp:041]: 'Measured Current-9' - Raw AC Value: 0.013A after 8 different samples (40 SPS) Line 715: [20:51:06][D][ct_clamp:041]: 'Measured Current-5' - Raw AC Value: 0.025A after 370 different samples (1850 SPS) Any tips on how to get high SPS values like clamp 16, 8 and 5 in example above? Regards, Nick RE: AC voltage and calibration - admin - 12-31-2023 sorry, M16v2 work at this level of accuracy, we are developing a higher precision board --M30. RE: AC voltage and calibration - nickdd - 01-02-2024 (12-31-2023, 02:03 PM)admin Wrote: sorry, M16v2 work at this level of accuracy, we are developing a higher precision board --M30. Hi, I do get more stable results when I only enable 4 or 5 CT's in the config. I don't know much about electronics but I guess it's more of a timing issue when the multiplexer switches between the 16 inputs. Maybe this could be improved in software by using some kind of manual iteration/control over which inputs are being read? Can you share some high level details about the future M30 board? What would essentially be different with this board? Now that I know this, I will try to finalize my setup and later report back on the results? Regards, Nick RE: AC voltage and calibration - admin - 01-03-2024 you can set some delay for multiplexer switches, not read too fast. M30 board will use BL0910 energy chip to read all data, integrate to home assistant by ESPHome. RE: AC voltage and calibration - nickdd - 01-07-2024 Hi again, I spent some time performing calibration and the results are quite ok in terms of accuracy. I understand with the M16v2 it cannot offer higher accuracy. This is what I did: - during calibration I only enabled 4 CT-clamps at a time with 10 second update interval => this gave me nice consistent readings. - used different stable loads and measured 4 values each => these were all very consistent (good!) - Sample entry for one of the clamps (a SCT003 1v 20A) Code: - platform: ct_clamp So values are ok and stable when I only enable a few CT's at a time. CT's 12/13/14/15/16 are enabled in example below. I get stable log entries like this: Code: [11:01:44][D][ct_clamp:049]: 'Measured Current-14' - Raw AC Value: 0.009A after 1098 different samples (2196 SPS) So just switching inputs one time and high enough SPS values. Variations in readings are ok. But when I enable additional CT's it seems it start flipping on switching between certain inputs. I get multiple "switch to input" lines at the same second. Code: [11:16:13][D][cd74hc4067:036]: switch to input 12 And this results in lower SPS values/less samples. [11:16:14][D][ct_clamp:049]: 'Measured Current-13' - Raw AC Value: 0.008A after 52 different samples (104 SPS) I guess this is a timing issue in esphome. I'm not a developer. So once you start using too many clamps at the same time you get this behavior and when you have lower samples/SPS you get fluctuating readings. Isn't there a way to control this switching? Regardless of the update_interval you get this. Maybe there is a way to poll each CT manually and define your own timings? Like with 16 CT's that you would poll each second that would give you good enough results I think. I guess this is a generic esphome timing issue, but hopefully somebody has any suggestions. Regards, Nick RE: AC voltage and calibration - admin - 01-07-2024 thanks for sharing your result. maybe you can also post this problem to ESPHome forum. |