Skip to content

Commit

Permalink
v122
Browse files Browse the repository at this point in the history
## v122:
* sensor_adc.yaml : 
	- fix ${adc_zero_calibration} not set on every BEMF
	- update update_interval and sliding_window_moving_average for better accuracy
  • Loading branch information
nliaudat authored Dec 30, 2024
1 parent 2ee0dc4 commit 04e4b85
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# change log
## v122:
* sensor_adc.yaml :
- fix ${adc_zero_calibration} not set on every BEMF
- update update_interval and sliding_window_moving_average for better accuracy
## v121:
* sensor_others.yaml : set uptime to update_interval: 5min + add unique component ID
* inputs.yaml : add unique component ID
Expand Down
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ substitutions:
name: floor-heating-controller #no special caracters
friendly_name: "Floor heating"
id_prefix: "heating_controller_" #if you have more than one board, it could be usefull to remane all the "id:heating_controller_xxxx" with a decicaded prefix [not done in sensor_adc.yaml actually]
revision: "1.121"
revision: "1.122"

#time
TZ: "Europe/Zurich" #timezone
Expand Down
34 changes: 17 additions & 17 deletions sensor_adc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ sensor:
# ADC_ATTEN_DB_6 : 150 mV ~ 1750 mV
# ADC_ATTEN_DB_12 : 150 mV ~ 2450 mV

### new version with opamp
## in use the motor use 15-20 mV. At endstop, it raise to 50 mV
- platform: adc
pin: ${adc_bemf_1_pin} #GPIO36
name: "BEMF 1" #CH1 + CH2
update_interval: 100ms # the start of motor need a lot of current (>480 mv), it must be averaged to not trigger the endstop. If 10ms, it always stop. The BEMF trigger must be approx 0.32mv
update_interval: 50ms # the start of motor need a lot of current, it must be averaged to not trigger the endstop. 50ms update interval with sliding_window_moving_average [5,5] works
attenuation : 0dB #auto
accuracy_decimals: 3
# samples: 10
filters:
- offset: ${adc_zero_calibration} # stall voltage : https://github.com/nliaudat/floor-heating-controller/wiki/BEMF-trigger-calculation
# - skip_initial: 10
# only for binary sensors : - delayed_on_off: 100ms # prevent trigger at motor start : https://esphome.io/components/binary_sensor/
- sliding_window_moving_average:
window_size: 9
send_every: 9
window_size: 5
send_every: 5
id : BEMF_1_2_sensor_ADC
# web_server:
# sorting_group_id: sorting_group_BEMF
Expand All @@ -30,47 +30,47 @@ sensor:
- platform: adc
pin: ${adc_bemf_2_pin} #GPIO39
name: "BEMF 2" #CH3 + CH4
update_interval: 100ms
update_interval: 50ms
attenuation : 0dB #auto
accuracy_decimals: 3
# samples: 10
filters:
- offset: -0.075
- offset: ${adc_zero_calibration}
- sliding_window_moving_average:
window_size: 9
send_every: 9
window_size: 5
send_every: 5
id : BEMF_3_4_sensor_ADC
# web_server:
# sorting_group_id: sorting_group_BEMF

- platform: adc
pin: ${adc_bemf_3_pin} #GPIO34
name: "BEMF 3" #CH5 + CH6
update_interval: 100ms
update_interval: 50ms
attenuation : 0dB #auto
accuracy_decimals: 3
# samples: 10
filters:
- offset: -0.075
- offset: ${adc_zero_calibration}
- sliding_window_moving_average:
window_size: 9
send_every: 9
window_size: 5
send_every: 5
id : BEMF_5_6_sensor_ADC
# web_server:
# sorting_group_id: sorting_group_BEMF

- platform: adc
pin: ${adc_bemf_4_pin} #GPIO35
name: "BEMF 4" #CH7 + CH8
update_interval: 100ms
update_interval: 50ms
attenuation : 0dB #auto
accuracy_decimals: 3
# samples: 10
filters:
- offset: -0.075
- offset: ${adc_zero_calibration}
- sliding_window_moving_average:
window_size: 9
send_every: 9
window_size: 5
send_every: 5
id : BEMF_7_8_sensor_ADC
# web_server:
# sorting_group_id: sorting_group_BEMF
Expand Down

0 comments on commit 04e4b85

Please sign in to comment.