Jump to content

"sensor type is not valid" in a Nitehawk-SB setup


Recommended Posts

Here's one that's got me pulling my beard out (hair is long-gone...):

"Klipper reports error: Option 'sensor_type' is not velid in section 'thermistor rtd pt1000'

Using "printer.cfg" and a separate config file for the Nitehawk SB, with an "include nitehawk-sb.cfg" statement at the beginning.  The 'nitehawk-sb.cfg' file was taken directly from the nitehawk git page.

What's confusing me is that I did a direct copy & paste from the Klipper Configuration Reference pages,  from the section heading: "Directly connected PT1000," which after a little editing now reads:

[thermistor RTD PT1000]
sensor_type: pt1000
sensor_pin: nhk:gpio29
pullup_resistor: 4700
temperature1: 0.0
resistance1: 1000.0
temperature2: 100.0
resistance2: 1385.1
temperature3: 200.0
resistance3: 1758.6
gcode_id: hotend_th

Using the existing thermistor section from the nitehawk-sb configuration example as a template. commented it out and added the copied section from Klipper reference page.  Klipper demanded a "temperature1" liine, so I took the temp/resistance numbers from a chart for the PT1000, picked three temps and plugged the numbers in, then "save & restarted" the file. 

Klipper still doesn't like it; dealt with several errors initially, and thought I was making progress, then ran into this error and I'm stumped as to what's supposed to be there for sensor-type, since Klipper documentation cites "sensor_type: PT1000."

Any ideas on where I'm going wrong here?

 

Link to comment
Share on other sites

You are combining the [thermistor] and [temperature_sensor] definitions

for a [temperature_sensor] you can define a  #sensor_type

and for [thermistor] you can define

#temperature1:
#resistance1:
#temperature2:
etc

You can't combine them.

 

Also, seeing as you are referencing sensor_pin: nhk:gpio29 which is the nighthawk hotend temp pin, it looks like this should be part of the [extruder] definition. Not a standalone temp sensor definition.

Edited by Crashdown
Link to comment
Share on other sites

Crashdown is correct, your config is invalid

As per https://www.klipper3d.org/Config_Reference.html#thermistor

[thermistor PT1000]
temperature1: 0.0
resistance1: 1000.0
temperature2: 100.0
resistance2: 1385.1
temperature3: 200.0
resistance3: 1758.6


and https://www.klipper3d.org/Config_Reference.html#temperature_sensor

[temperature_sensor RTD] 
sensor_type: PT1000
sensor_pin: nhk:gpio29
pullup_resistor: 4700
min_temp: 0
max_temp: 100
gcode_id: hotend_th

I'm still checking the actual board to confirm it can actually be used with a PT1000 or that you even need the [thermistor] section above because PT1000 are provided by Klipper as a default.

Edited by Methos
Link to comment
Share on other sites

Ok I think I understand what you are trying to do. 

So to use a custom thermistor you need to define a [thermistor]

[thermistor RTD_PT1000]
temperature1: 0.0
resistance1: 1000.0
temperature2: 100.0
resistance2: 1385.1
temperature3: 200.0
resistance3: 1758.6
beta:

Then in your [extruder] you reference your new thermistor with


sensor_type: RTD_PT1000
sensor_pin: nhk:gpio29
pullup_resistor: 2200
gcode_id: hotend_th

Edited by Crashdown
Link to comment
Share on other sites

Correct, but now your talking about the [extruder] section so the documentation is different

https://www.klipper3d.org/Config_Reference.html#extruder

 

[extruder]
sensor_type: RTD_PT1000
sensor_pin: nhk:gpio29
pullup_resistor: 2200

The gcode_id can not be used in the [extruder] as best as I can see.
Again I do not know why you are assigning a PT1000 thermistor because the config for these is included in Klipper.

 

Link to comment
Share on other sites

Yeah I assume he is only adding a lot of this because he is chasing errors and copy pasting. 

The default LDO config doesn't include a sensor type line in the extruder config so he is copying from other standalone sensors in the same config and the config reference. 

Link to comment
Share on other sites

Here's a shot of my Nitehawk 36 extruder section. Like yours, the only thing in printer.cfg is the [include nitehawk-36.cfg]. Everything I have commented out is controlled elsewhere. I doubt the pins are the same but the lines should be enough for you to compare to and get up and running. 

 

# This file contains pin mappings for the LDO Nitehawk-36 Toolboard
# To use this config, the firmware should be compiled for the Raspberry Pi RP2040
# Make sure to include this config *at the end* of printer.cfg to overwrite the relevent sections

# See https://docs.ldomotors.com/en/voron/nitehawk-sb#firmware-setup-and-update
# For instructions on uploading/updating klipper firmware to the PCB

## LDO Nitehawk-SB Toolboard Partial Config

## *** THINGS TO CHANGE/CHECK: ***
## MCU paths                            [mcu] section
## Thermistor types                     [extruder] sections

## *MAKE SURE* to include this partial config file *AFTER* the main controller config. 
## This will ensure the relavent sections are overwritten by the pin mappings specified here.

[mcu nhk]
##  Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify
##--------------------------------------------------------------------
serial: /dev/serial/by-id/usb-Klipper_rp2040_30333938340AB839-if00 
restart_method: command
##--------------------------------------------------------------------

#####################################################################
#   Endstops
#####################################################################
## XES - Toolhead PCB
[stepper_x]
endstop_pin: nhk:gpio13


#####################################################################
#   Filament Sensor
#####################################################################
#[filament_switch_sensor filament_sensor]
#switch_pin: nhk:gpio3

#####################################################################
#     Extruder
#####################################################################
[extruder]
step_pin: nhk:gpio23
dir_pin: !nhk:gpio24
enable_pin: !nhk:gpio25
heater_pin: nhk:gpio9
sensor_pin: nhk:gpio29
pullup_resistor: 2200
rotation_distance: 34.054128
##  Use 50:10 for Stealthburner/Clockwork 2
##  Use 50:17 for Afterburner/Clockwork (BMG Gear Ratio)
##  Use 80:20 for M4, M3.1
##  Use 50:8  VZ-Hextrudort-Low
##  Use 60:8  VZ-Hextrudort-Low Plus
##  Use 9:1 for G2SA / WWG2
##  Use 7.5:1 for LDO Orbitor 2.5
gear_ratio: 7.5:1
microsteps: 16
full_steps_per_rotation: 200    #200 for 1.8 degree, 400 for 0.9 degree
nozzle_diameter: 0.4
filament_diameter: 1.75
sensor_type: PT1000
min_temp: 10
max_temp: 330
max_power: 1.0
min_extrude_temp: 170
max_extrude_only_distance: 500
max_extrude_only_velocity: 120
max_extrude_cross_section: 5
#pressure_advance: 0.024 #200mm/s ABS
#pressure_advance: 0.0355 #235mm/s PLA
#pressure_advance: 0.02508 #2508mm/s ASA/CF
#pressure_advance: 0.03715 #235mm/s Prusa Slicer Calibration?
#pressure_advance: 0.044
pressure_advance: 0.04628

#pressure_advance_smooth_time: 0.040

[tmc2209 extruder]
run_current: 0.85
stealthchop_threshold: 0
sense_resistor: 0.100
uart_pin: nhk:gpio0
tx_pin: nhk:gpio1
interpolate: true

#####################################################################
#   Fans
#####################################################################
## PCF
[fan]
pin: nhk:gpio6


## HEF
[heater_fan hotend_fan]
pin: nhk:gpio5
tachometer_pin: nhk:gpio16
tachometer_ppr: 2
max_power: 1.0
fan_speed: 1
heater: extruder
heater_temp: 150

#####################################################################
#     Probe
#####################################################################
## Probe Port
#[probe]
#pin: nhk:gpio10

#####################################################################
#   Lights
#####################################################################
## Stealthburner Headlights
[neopixel headlight]
pin: nhk:gpio7

## PCB Activity Light
[output_pin act_led]
pin: !nhk:gpio8

#####################################################################
#   Accelerometer
#####################################################################
#[adxl345]
#cs_pin: nhk:gpio27
#spi_software_sclk_pin: nhk:gpio18
#spi_software_mosi_pin: nhk:gpio20
#spi_software_miso_pin: nhk:gpio19

#[resonance_tester]
#accel_chip:adxl345

    

#####################################################################
#   Filament sensor
#####################################################################

#[filament_switch_sensor switch_sensor]
#switch_pin: ^gpio3
#pause_on_runout: True


##--------------------------------------------------------------------
## Uncomment below for 250mm build
#probe_points:
#    125, 125, 20

## Uncomment below for 300mm build
#probe_points:
#    155, 155, 20

## Uncomment below for 350mm build
# probe_points:
#    175, 175, 20

 

 

Link to comment
Share on other sites

Thanks so much for the input - - I'll be busy today for sure!

@McCosch - - I'm running a BTT SKR Mini E3 v3 at the moment, and it is compatible with a PT1000; checked before I bought the thermistor.  😉

I find myself wishing that there was (or if there IS, that I was aware of) a 'plain language,' nutshell overview of Klipper explaining how it works as a system, without the minutely exhaustive detail of the configuration reference, which is like trying to get a drink from a firehose.  It's precisely because I don't have this 'system overview' understanding  that I end up doing things like Crashdown describes: combining the [thermistor] and [temperature_sensor] definitions in a mix 'n' match manner which is a no-no.  I can read the reference, and understand each piece... but where I'm failing is in understanding how those pieces interrelate and fit into the whole so they don't step on each other.  It's a bit like trying to learn correct grammar and sentence/paragraph construction by reading a dictionary, if that makes any sense (or maybe a blind man trying to put together a jigsaw puzzle.)  Which is why I'm doing exactly what Crashdown further accurately describes as "adding a lot of this because he is chasing errors and copy pasting."  Exactly.  Start with an example, and if it works, great; if not, tweak it until it does... or until I'm stuck and turn to the wiser heads here.

I'm like the backyard mechanic who knows how to replace points, plugs, and condensor when his engine is running kinda ragged... without knowing exactly *why* those need to be replaced, or how the individual pieces function in the 'engine-as-a-whole.'  Guess what I'm doing with this thermistor issue is like mixing different kinds of spark plugs, with different temperature ranges and resistances and electrode spacings, and then wondering why the engine is *still* running ragged.  😕  Or installing the points but gapping them to the wrong spec. (Dating myself with this talk of 'points-plugs-condenser' ain't I?  🙂   )

Thank the powers that be that places like this one exist where I can dispel some of that ignorance.  It's a long, slow process though, lots of trial-and-error (mostly error!)

Thanks again!!

 

 

Link to comment
Share on other sites

60 years old here. Don't beat yourself up ... this is how we learn. Next time will be easier, next year you will be helping others. I am a machinist, so I too am a mechanical guy here, points,plugs- condenser ...  you forgot cap and rotor? 🙂 You should have read the thread about grease ... OMG.

Have fun ... it's a hobby.

Link to comment
Share on other sites

5 hours ago, kharrisma said:

I'm in the same boat regarding being more apt with the mechanical side of things. I'm a machinist and hobby car guy. What helped me the most is knowing that printer.cfg is referenced, within that if you put an include at the top of printer.cfg, anything read after that, overides that include. Your nitehawk.cfg should be at the end of printer.cfg. Also when it comes to certain fields, like "extruder" there are set parameters that can be included.  If there is a reference to anything that has a simliar name, unless its explicitly listed in the extruder section then it can not be used in extruder. That seems to be what your dealing with. LIke mentioned above it looks like your combining terms from different sections.  Things listed under extruder, can not be used in the thermistor section and vice/versa. I looked at the nitehawk-sb.cfg LDO references. I don't see the section your trying to use listed.  

https://github.com/MotorDynamicsLab/Nitehawk-SB/blob/master/Firmware/Klipper Configs/nitehawk-sb.cfg

 

Link to comment
Share on other sites

Starting to feel like this thing is my JOB!

 

Think I squared away the thermistor issue - - there's a 'format' that has to be followed in the config file (which I was failing to follow, commenting out what I though was a surperfluous temp sensor), where at the end in the "Thermistor" section, one must first "define" the sensor, which includes it's name and temp/resistance data,

[thermistor CMFB103F3950FANT]
temperature1: 0.0
resistance1: 32116.0
temperature2: 40.0
resistance2: 5309.0
temperature3: 80.0
resistance3: 1228.0

THEN one fills in the 'working data" for the extruder using the name it got assigned above:

[temperature_sensor nh_temp]
## Nitehawk PCB Sensor
sensor_type: CMFB103F3950FANT
sensor_pin: nhk:gpio26
pullup_resistor: 2200
min_temp: 0
max_temp: 100
gcode_id: nh_th

So If I follow that same format for the PT1000, it should have no issues.  Did just learn, though, that if you run a PT1000 through the default 4.7K pullup resistor on the control card (the nitehawk toolhead, in this case), it's rendered less sensitive to temp changes than a 'standard' thermistor is - - it's recommended to change that pullup resistor on the board with a 1K 0.1% resistor to realize the full capabilities of this thermistor.  Looks like I'll need to practice my SMD soldering "skills!"

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...