diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md index f0ca2dce2..79f05f121 100644 --- a/docs/Config_Reference.md +++ b/docs/Config_Reference.md @@ -5064,15 +5064,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. Both values must not be +# the same. 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 68180a002..b11b9d94e 100644 --- a/klippy/extras/hall_filament_width_sensor.py +++ b/klippy/extras/hall_filament_width_sensor.py @@ -35,6 +35,14 @@ class HallFilamentWidthSensor: self.is_log =config.getboolean('logging', False) self.enable_flow_compensation = config.getboolean( 'enable_flow_compensation', True) + 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") # Use the current diameter instead of nominal while the first # measurement isn't in place self.use_current_dia_while_delay = config.getboolean(