diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md index c1a70bc66..5cf0747ca 100644 --- a/docs/Config_Reference.md +++ b/docs/Config_Reference.md @@ -5095,15 +5095,16 @@ adc2: # 1.50 for cal_dia1 and 2.00 for cal_dia2. #raw_dia1: 9500 #raw_dia2: 10500 -# The raw calibration values for the sensors. The default is 9500 -# for raw_dia1 and 10500 for raw_dia2. +# The raw calibration values for the sensors. The values must be +# different. The default is 9500 for raw_dia1 and 10500 for raw_dia2. #default_nominal_filament_diameter: 1.75 # The nominal filament diameter. This parameter must be provided. #max_difference: 0.200 # Maximum allowed filament diameter difference in millimeters (mm). # If difference between nominal filament diameter and sensor output # is more than +- max_difference, extrusion multiplier is set back -# to %100. The default is 0.200. +# to 100%. Must be less than default_nominal_filament_diameter. +# The default is 0.200. #measurement_delay: 70 # The distance from sensor to the melting chamber/hot-end in # millimeters (mm). The filament between the sensor and the hot-end diff --git a/klippy/extras/hall_filament_width_sensor.py b/klippy/extras/hall_filament_width_sensor.py index ecfeb85dc..2d362f576 100644 --- a/klippy/extras/hall_filament_width_sensor.py +++ b/klippy/extras/hall_filament_width_sensor.py @@ -39,6 +39,14 @@ class HallFilamentWidthSensor: # measurement isn't in place self.use_current_dia_while_delay = config.getboolean( 'use_current_dia_while_delay', False) + if self.rawdia1 == self.rawdia2: + raise config.error( + "hall_filament_width_sensor: raw_dia1 and raw_dia2 must be" + " different") + if self.min_diameter <= 0: + raise config.error( + "hall_filament_width_sensor: max_difference must be less than" + " default_nominal_filament_diameter") # filament array [position, filamentWidth] self.filament_array = [] self.lastFilamentWidthReading = 0