docs: Re-organize Hall Filament Width Sensor Doc

Signed-off-by: Yifei Ding <yifeiding@protonmail.com>
This commit is contained in:
Yifei Ding 2021-10-23 12:03:45 -07:00 committed by KevinOConnor
parent 71ab552562
commit 0d0d8cbb7d
1 changed files with 78 additions and 70 deletions

View File

@ -1,6 +1,6 @@
# Hall filament width sensor # Hall filament width sensor
This document describes Filament Width Sensor host module. Hardware used for developing this host module is based on Two Hall liniar sensors (ss49e for example). Sensors in the body are located opposite sides. Principle of operation : two hall sensors work in differential mode, temperature drift same for sensor. Special temperature compensation not needed. You can find designs at [thingiverse.com](https://www.thingiverse.com/thing:4138933) This document describes Filament Width Sensor host module. Hardware used for developing this host module is based on Two Hall liniar sensors (ss49e for example). Sensors in the body are located opposite sides. Principle of operation : two hall sensors work in differential mode, temperature drift same for sensor. Special temperature compensation not needed. You can find designs at [Thingiverse](https://www.thingiverse.com/thing:4138933)
[Hall based filament width sensor assembly video](https://www.youtube.com/watch?v=TDO9tME8vp4) [Hall based filament width sensor assembly video](https://www.youtube.com/watch?v=TDO9tME8vp4)
@ -10,74 +10,75 @@ Sensor generates two analog output based on calculated filament width. Sum of ou
## Configuration ## Configuration
[hall_filament_width_sensor] ```
[hall_filament_width_sensor]
adc1: analog11 adc1: analog11
adc2: analog12 adc2: analog12
# adc1 and adc2 channels select own pins Analog input pins on 3d printer board # adc1 and adc2 channels select own pins Analog input pins on 3d printer board
# Sensor power supply can be 3.3v or 5v # Sensor power supply can be 3.3v or 5v
Cal_dia1: 1.50 # Reference diameter point 1 (mm) Cal_dia1: 1.50 # Reference diameter point 1 (mm)
Cal_dia2: 2.00 # Reference diameter point 2 (mm) Cal_dia2: 2.00 # Reference diameter point 2 (mm)
# The measurement principle provides for two-point calibration # The measurement principle provides for two-point calibration
# In calibration process you must use rods of known diameter # In calibration process you must use rods of known diameter
# I use drill rods as the base diameter. # I use drill rods as the base diameter.
# nominal filament diameter must be between Cal_dia1 and Cal_dia2 # nominal filament diameter must be between Cal_dia1 and Cal_dia2
# Your size may differ from the indicated ones, for example 2.05 # Your size may differ from the indicated ones, for example 2.05
Raw_dia1:10630 # Raw sensor value for reference point 1 Raw_dia1:10630 # Raw sensor value for reference point 1
Raw_dia2:8300 # Raw sensor value for reference point 2 Raw_dia2:8300 # Raw sensor value for reference point 2
# Raw value of sensor in units # Raw value of sensor in units
# can be readed by command QUERY_RAW_FILAMENT_WIDTH # can be readed by command QUERY_RAW_FILAMENT_WIDTH
default_nominal_filament_diameter: 1.75 # This parameter is in millimeters (mm) default_nominal_filament_diameter: 1.75 # This parameter is in millimeters (mm)
max_difference: 0.15 max_difference: 0.15
# Maximum allowed filament diameter difference in millimeters (mm) # Maximum allowed filament diameter difference in millimeters (mm)
# If difference between nominal filament diameter and sensor output is more # If difference between nominal filament diameter and sensor output is more
# than +- max_difference, extrusion multiplier set back to %100 # than +- max_difference, extrusion multiplier set back to %100
measurement_delay: 70 measurement_delay: 70
# The distance from sensor to the melting chamber/hot-end in millimeters (mm). # The distance from sensor to the melting chamber/hot-end in millimeters (mm).
# The filament between the sensor and the hot-end will be treated as the default_nominal_filament_diameter. # The filament between the sensor and the hot-end will be treated as the default_nominal_filament_diameter.
# Host module works with FIFO logic. It keeps each sensor value and position in # Host module works with FIFO logic. It keeps each sensor value and position in
# an array and POP them back in correct position. # an array and POP them back in correct position.
#enable:False #enable:False
# Sensor enabled or disabled after power on. Disabled by default # Sensor enabled or disabled after power on. Disabled by default
# measurement_interval:10 # measurement_interval:10
# Sensor readings done with 10 mm intervals by default. If necessary you are free to change this setting # Sensor readings done with 10 mm intervals by default. If necessary you are free to change this setting
#logging: False #logging: False
# Out diameter to terminal and klipper.log # Out diameter to terminal and klipper.log
# can be turn on|of by command # can be turn on|of by command
#Virtual filament_switch_sensor suppurt. Create sensor named hall_filament_width_sensor. #Virtual filament_switch_sensor suppurt. Create sensor named hall_filament_width_sensor.
# #
#min_diameter:1.0 #min_diameter:1.0
#Minimal diameter for trigger virtual filament_switch_sensor. #Minimal diameter for trigger virtual filament_switch_sensor.
#use_current_dia_while_delay: False #use_current_dia_while_delay: False
# Use the current diameter instead of the nominal diamenter while the measurement delay has not run through. # Use the current diameter instead of the nominal diamenter while the measurement delay has not run through.
# #
#Values from filament_switch_sensor. See the "filament_switch_sensor" section for information on these parameters. #Values from filament_switch_sensor. See the "filament_switch_sensor" section for information on these parameters.
# #
#pause_on_runout: True #pause_on_runout: True
#runout_gcode: #runout_gcode:
#insert_gcode: #insert_gcode:
#event_delay: 3.0 #event_delay: 3.0
#pause_delay: 0.5 #pause_delay: 0.5
```
## G-Code Commands
## Commands
**QUERY_FILAMENT_WIDTH** - Return the current measured filament width as result **QUERY_FILAMENT_WIDTH** - Return the current measured filament width as result
**RESET_FILAMENT_WIDTH_SENSOR** – Clear all sensor readings. Can be used after filament change. **RESET_FILAMENT_WIDTH_SENSOR** - Clear all sensor readings. Can be used after filament change.
**DISABLE_FILAMENT_WIDTH_SENSOR** – Turn off the filament width sensor and stop using it to do flow control **DISABLE_FILAMENT_WIDTH_SENSOR** - Turn off the filament width sensor and stop using it to do flow control
**ENABLE_FILAMENT_WIDTH_SENSOR** - Turn on the filament width sensor and start using it to do flow control **ENABLE_FILAMENT_WIDTH_SENSOR** - Turn on the filament width sensor and start using it to do flow control
@ -96,34 +97,41 @@ Sensor generates two analog output based on calculated filament width. Sum of ou
**hall_filament_width_sensor.is_active** Sensor on or off **hall_filament_width_sensor.is_active** Sensor on or off
## Template for menu variables ## Template for menu variables
[menu __main __filament __width_current]
type: command
enable: {'hall_filament_width_sensor' in printer}
name: Dia: {'%.2F' % printer.hall_filament_width_sensor.Diameter}
index: 0
[menu __main __filament __raw_width_current] ```
type: command [menu __main __filament __width_current]
enable: {'hall_filament_width_sensor' in printer} type: command
name: Raw: {'%4.0F' % printer.hall_filament_width_sensor.Raw} enable: {'hall_filament_width_sensor' in printer}
index: 1 name: Dia: {'%.2F' % printer.hall_filament_width_sensor.Diameter}
index: 0
[menu __main __filament __raw_width_current]
type: command
enable: {'hall_filament_width_sensor' in printer}
name: Raw: {'%4.0F' % printer.hall_filament_width_sensor.Raw}
index: 1
```
## Calibration procedure ## Calibration procedure
Insert first calibration rod (1.5 mm size) get first raw sensor value To get raw sensor value you can use menu item or **QUERY_RAW_FILAMENT_WIDTH** command in terminal
To get raw sensor value you can use menu item or **QUERY_RAW_FILAMENT_WIDTH** command in terminal 1. Insert first calibration rod (1.5 mm size) get first raw sensor value
Insert second calibration rod (2.0 mm size) get second raw sensor value 2. Insert second calibration rod (2.0 mm size) get second raw sensor value
Save raw values in config 3. Save raw sensor values in config parameter `Raw_dia1` and `Raw_dia2`
## How to enable sensor ## How to enable sensor
After power on by default sensor disabled. By default, the sensor is disabled at power-on.
Enable sensor in start g-code by command **ENABLE_FILAMENT_WIDTH_SENSOR** or change enable parameter in config
To enable the sensor, issue **ENABLE_FILAMENT_WIDTH_SENSOR** command or set the `enable` parameter to `true.`
## Logging ## Logging
After power on by default diameter Logging disabled. By default, diameter logging is disabled at power-on.
Data to log added on every measurement interval (10 mm by default)
Issue **ENABLE_FILAMENT_WIDTH_LOG** command to start logging and issue **DISABLE_FILAMENT_WIDTH_LOG** command to stop logging. To enable logging at power-on, set the `logging` parameter to `true`.
Filament diameter is logged on every measurement interval (10 mm by default).