Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AC voltage and calibration
#21
(01-07-2024, 11:10 AM)admin Wrote: thanks for sharing your result. maybe you can also post this problem to ESPHome forum.

Some feedback.
I was able to solve my "low SPS" problem as described above, by doing the following:

- set update interval to never for all sensors
- use interval and loop through sensors and add delay manually

This fixes the issue that it switches inputs on the multiplexer in an uncontrolled matter.

Code:
interval:
  - interval: 10s
    then:
      - lambda: |-
          id(Measured_Current_01).update();
#         #  ESP_LOGD("custom", "Measured Current-1: %f", id(ai1).state);
      - delay: 625ms
      - lambda: |-
          id(Measured_Current_02).update();
#         # ESP_LOGD("custom", "Measured Current-2: %f", id(Measured_Current_2).state);
      - delay: 625ms   
      - lambda: |-
          id(Measured_Current_03).update();
#        # ESP_LOGD("custom", "Measured Current-3: %f", id(Measured_Current_3).state);
      - delay: 625ms
      - lambda: |-
          id(Measured_Current_04).update();
#         # ESP_LOGD("custom", "Measured Current-4: %f", id(Measured_Current_4).state);
      - delay: 625ms   

=> I update my values every 10 seconds, in sequence.

I also have better results when using calibrate_linear with method "exact" instead of the default least_squares.
Used a bunch of devices and combinations with power factor 1 (resistive loads) for callibration.

sample duration of 500ms works well for me.

Code:
  - platform: ct_clamp
    sensor: ai16
    id: Measured_Current_16
    name: "Measured Current-16"
    sample_duration: 500ms
    update_interval: never
    accuracy_decimals: 5       
    filters:
    - calibrate_linear:
        method: exact
        datapoints:
        - 0 -> 0
        - 0.00231 -> 0
        - 0.00348 -> 0.063
        - 0.00603 -> 0.170
        - 0.00642 -> 0.180
        - 0.00858 -> 0.252
        - 0.01343 -> 0.407
        - 0.02111 -> 0.653
        - 0.02277 -> 0.713
        - 0.05721 -> 1.775
        - 0.07191 -> 2.243
        - 0.07719 -> 2.398
        - 0.14918 -> 4.650
        - 0.19534 -> 6.100
        - 0.28517 -> 8.960
        - 0.47080 -> 14.550 

Did this for all 16 clamps by putting them all on the same wire when doing the measurements.


It's much less jumpy then before. Still struggle to really measure low power, but that must be because of the overall accuracy.
Reply


Messages In This Thread
AC voltage and calibration - by nickdd - 12-04-2023, 06:25 PM
RE: AC voltage and calibration - by nickdd - 12-04-2023, 10:03 PM
RE: AC voltage and calibration - by admin - 12-06-2023, 06:24 AM
RE: AC voltage and calibration - by admin - 12-09-2023, 01:26 PM
RE: AC voltage and calibration - by nickdd - 12-17-2023, 10:52 PM
RE: AC voltage and calibration - by admin - 12-18-2023, 12:36 AM
RE: AC voltage and calibration - by nickdd - 12-18-2023, 02:17 PM
RE: AC voltage and calibration - by admin - 12-18-2023, 11:05 PM
RE: AC voltage and calibration - by nickdd - 12-18-2023, 11:11 PM
RE: AC voltage and calibration - by admin - 12-18-2023, 11:33 PM
RE: AC voltage and calibration - by nickdd - 12-19-2023, 09:54 AM
RE: AC voltage and calibration - by admin - 12-19-2023, 11:12 AM
RE: AC voltage and calibration - by nickdd - 12-19-2023, 03:19 PM
RE: AC voltage and calibration - by admin - 12-20-2023, 12:15 AM
RE: AC voltage and calibration - by nickdd - 12-21-2023, 09:05 PM
RE: AC voltage and calibration - by admin - 12-31-2023, 02:03 PM
RE: AC voltage and calibration - by nickdd - 01-02-2024, 04:59 PM
RE: AC voltage and calibration - by admin - 01-03-2024, 12:42 AM
RE: AC voltage and calibration - by nickdd - 01-07-2024, 10:29 AM
RE: AC voltage and calibration - by admin - 01-07-2024, 11:10 AM
RE: AC voltage and calibration - by nickdd - 01-21-2024, 11:36 PM
RE: AC voltage and calibration - by admin - 01-22-2024, 12:32 AM
RE: AC voltage and calibration - by hamilton - 02-04-2024, 06:27 PM
RE: AC voltage and calibration - by sanurss - 02-15-2024, 04:20 PM
RE: AC voltage and calibration - by nickdd - 02-15-2024, 04:58 PM
RE: AC voltage and calibration - by sanurss - 02-16-2024, 11:55 AM
RE: AC voltage and calibration - by admin - 02-16-2024, 12:11 PM
RE: AC voltage and calibration - by nickdd - 02-16-2024, 07:25 PM
RE: AC voltage and calibration - by sanurss - 02-16-2024, 07:46 PM
RE: AC voltage and calibration - by nickdd - 02-16-2024, 10:51 PM
RE: AC voltage and calibration - by sanurss - 02-17-2024, 08:11 PM
RE: AC voltage and calibration - by nickdd - 02-17-2024, 09:51 PM
RE: AC voltage and calibration - by sanurss - 02-18-2024, 07:25 AM
RE: AC voltage and calibration - by sanurss - 03-22-2024, 03:42 PM
RE: AC voltage and calibration - by admin - 03-22-2024, 11:29 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)