Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Klipper - Thermosensor Type #7

Open
scheerjacob opened this issue Aug 5, 2020 · 32 comments
Open

Klipper - Thermosensor Type #7

scheerjacob opened this issue Aug 5, 2020 · 32 comments

Comments

@scheerjacob
Copy link

Hello,

I am writing code for a configuration file to run Tenlog D3 Pro with Klipper firmware. I would like to know what the sensor type is for the thermosensor in the extruders and in the bed. Also, please let me know what pins these are connected to for Extruder 1, 2 and the bed.

Thank you so much.

P.S. If anyone reading this has successfully run the Tenlog D3 Pro on Klipper firmware, please send us a message and your config files.

@BAUBLITZ
Copy link

BAUBLITZ commented Aug 6, 2020

This is a klipperconfig for an TL-D3S it's only little different from D3 Pro. the difference can you read out from Marlin Firmware.
Thermistors types are the same. take a look in the Zip there two files from marlin with teh different Pin's abot D3S and D3 Pro. you must change this in the printer.cfg
printer.zip

@scheerjacob
Copy link
Author

Thanks, did the config file work for you in the end? I am wondering because we tried to connect our Tenlog to Klipper and Octoprint. The error we are getting is that the Octoprint is not reading the temperatures from the thermosensors on the extruders or the heating bed

@BAUBLITZ
Copy link

BAUBLITZ commented Aug 7, 2020

Yes it works for me , but im back to Marlin. I miss the mirror and duplex mode in klipper. The prinquality ans speed is better in klipper and for Dualcolor is klipper very good.

@vegeta340
Copy link

@BAUBLITZ please correct me if I'm wrong but "step_distance: .00974" from extruder definition is instead of esteps from Marlin? How to determine this number for Titan extruders where esteps=382.165?

@BAUBLITZ
Copy link

BAUBLITZ commented Feb 1, 2021

klipper need mm/step and marlin steps/mm 382.165 in marlin are 0,00261 in klipper

@tonywright
Copy link

Hi Scheerjacob, did you get klipper working with your tenlog d3 pro? I have the same issue using the above printer.cfg, it fails with ADC out of range. The pins seem to checkout ok compared to marlin firmware but I cannot see what value is being returned to see if it is anywhere close to a valid value.
Thanks

@matti125
Copy link

While I do not have the Tenlog d3 pro, I have the Tenlog Hands 2, and It works fine with klipper.

@tonywright
Copy link

While I do not have the Tenlog d3 pro, I have the Tenlog Hands 2, and It works fine with klipper.

Thanks matti125, I managed to get past the temp warning by setting the minimum to -100 but after that the printer wouldn't move any of the steppers although it seemed to be connected ok. Might give it another go in a bit and recompile the bin file just in case I mixed that up.

@marcello-fialho
Copy link

While I do not have the Tenlog d3 pro, I have the Tenlog Hands 2, and It works fine with klipper.

Do you have the printer.cfg for the Hands 2? Is it possible to do the dual z synch with klipper?

@matti125
Copy link

AFAIUI, klipper does dual z synch when you you have two z axis definitions. Here are my config files. The second head is currently not xy calibrated, so ignore the x and y offsets.

printer.cfg:

[include kiauh_macros.cfg]
[include macros.cfg]
[printer]
max_velocity: 200
max_accel: 4000
#max_accel: 7000
#max_accel_to_decel: 7000

#[include extruders_titan/printer.cfg]
#[include extruders_std/printer.cfg]
[include extruders_titan/extruder0_titan_maxiwatt]
[include extruders_titan/extruder1_titan_stdheatblock]

[mcu]
baud: 250000
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
pin_map: arduino

[resonance_inducer]
probe_points: 110,110,30

[pause_resume]

[display_status]

[virtual_sdcard]
path: ~/gcode_files

[printer]
kinematics: cartesian
max_z_velocity: 20
max_z_accel: 60

[input_shaper]
shaper_freq_y: 35  # frequency for the Y mark of the test model


[bed_screws]
screw1: 25,35
screw2: 25,185
screw3: 195,185
screw4:	195,35

[stepper_x]
step_pin: ar54
dir_pin: ar55
enable_pin: !ar38
rotation_distance: 40
microsteps: 16
endstop_pin: ^!ar3
position_endstop: -48
position_max: 220
position_min: -50
homing_speed: 40
homing_positive_dir: false

# Definition for the secondary carriage and extruder1
[dual_carriage]
axis: x
step_pin: ar36
dir_pin: ar34
enable_pin: !ar30
rotation_distance: 40
microsteps: 16
endstop_pin: ^!ar2
position_endstop: 265
position_min: 0
position_max: 265
homing_speed: 40

[stepper_y]
step_pin: ar60
dir_pin: !ar61
enable_pin: !ar56
rotation_distance: 40
microsteps: 16
endstop_pin: ^!ar14
position_endstop: 0
position_max: 220
homing_speed: 30

[stepper_z]
step_pin: ar46
dir_pin: ar48
enable_pin: !ar62
microsteps: 16
rotation_distance: 4
endstop_pin: ^!ar18
position_max: 250
position_min: -0.2

[stepper_z1]
step_pin: ar65
dir_pin: ar66
enable_pin: !ar64
microsteps: 16
rotation_distance: 4
endstop_pin: ^!ar19

[heater_bed]
heater_pin: ar8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog14
min_temp: 0
max_temp: 110
control: pid

[fan]
pin: ar9
max_power: 1.0
shutdown_speed: 0
cycle_time: 0.010
hardware_pwm: False
kick_start_time: 0.100
off_below: 0.0

[heater_fan fan]
pin: ar5
heater: extruder,extruder1
heater_temp: 80.0
fan_speed: 1.0

#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 30.184
#*# pid_ki = 2.916
#*# pid_kd = 78.101
#*#
#*# [heater_bed]
#*# pid_kp = 66.306
#*# pid_ki = 0.781
#*# pid_kd = 1407.349
#*#
#*# [extruder1]
#*# control = pid
#*# pid_kp = 24.794
#*# pid_ki = 1.531
#*# pid_kd = 100.417
#*#
#*# [stepper_z]
#*# position_endstop = 0.0

extruder1_titan_stdheatblock.cfg:


[extruder1]
step_pin: ar26
dir_pin: !ar28
enable_pin: !ar24
microsteps: 16
gear_ratio: 4:1
rotation_distance: 30
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: ar10
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog13
pressure_advance = 0.1
min_temp: 0	
max_temp: 260

[input_shaper]
shaper_freq_x: 35  # frequency for the X mark of the test model

extruder0_titan_maxiwatt.cfg:

# The definition for the primary extruder
[extruder]
step_pin: ar57
dir_pin: !ar58
enable_pin: !ar59
microsteps: 16
gear_ratio: 4:1
rotation_distance: 30
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: ar11
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog15
pressure_advance = 0.075
min_temp: 0
max_temp: 260
max_extrude_only_distance: 200.0
max_extrude_cross_section: 3

[input_shaper]
shaper_freq_x: 35  # frequency for the X mark of the test model

macros.cfg:

# Helper script to park the carriage (called from T0 and T1 macros)
[gcode_macro PARK_extruder]
gcode:
    SAVE_GCODE_STATE NAME=park0
    G21
    G90
    G1 X-48 F3000
    RESTORE_GCODE_STATE NAME=park0

[gcode_macro PARK_extruder1]
gcode:
    SAVE_GCODE_STATE NAME=park1
    G21
    G90
    G1 X265 F3000
    RESTORE_GCODE_STATE NAME=park1

# Activate the primary extruder
[gcode_macro T0]
gcode:
    PARK_{printer.toolhead.extruder}
    ACTIVATE_EXTRUDER EXTRUDER=extruder
    SET_DUAL_CARRIAGE CARRIAGE=0
    SET_GCODE_OFFSET Y=0 X=0

[gcode_macro T1]
gcode:
    PARK_{printer.toolhead.extruder}
    ACTIVATE_EXTRUDER EXTRUDER=extruder1
    SET_DUAL_CARRIAGE CARRIAGE=1
    SET_GCODE_OFFSET X=-1.45 Y=1.55

[gcode_macro START_PRINT]
gcode:
    {% set BED_TEMP = params.BED_TEMP|default(60)|float %}
    {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
    # Start bed heating
    M140 S{BED_TEMP}
	# Use absolute coordinates
    G90
	#reset E
	G92 E0
	#Set extruder to relative mode
	M82
    # Reset the G-Code Z offset (adjust Z offset if needed)
    #SET_GCODE_OFFSET Z=0.08
    # Home the printer
    G28
    # Move the nozzle near the bed
    G0 Z0.5 Y45 F3000
	G1 X2
    # Wait for bed to reach temperature
    M190 S{BED_TEMP}
    # Set and wait for nozzle to reach temperature
    M109 S{EXTRUDER_TEMP}
	#Prime
	G28 X
	PRIME_LINE

[gcode_macro PRIME_LINE]
gcode: 
    M117 Prime Line
    G90 ; XYZ to abs mode
	M83 ; set E to rel mode
    # move z axis 
    G1 Z2 F3000 ;Move Z Axis up
    # move to prime position 
	G0 Y50 Z0.28 F1500
    G0 X2 ;Move to start position
    G1 Y200 E10 ;Draw the first line
    G0 X3 ;Move to side a little
    G1 Y70 E10 ;Draw the second line
    G1 Z1 F3000 ;Move Z Axis up
	M82  ;set e to abs mode
	G92 E0 ;Reset E

[gcode_macro END_PRINT]
gcode:
    M117 End printing.
    G91 ; relative positioning
    G1 E-1 F300 ;retract the filament a bit before lifting the nozzle to release some of the pressure
    G1 Z+5 E-2 F1000 ;move Z up a bit and extract a bit more
    T1
	T0
    G90 ; absolute positioning
 	G0 Y220 F3000 ; make the printed object accessible
    m104 S0 ; turn hotend heating off
    M140 S0 ; turn bed heating off
    M107 ; turn fan off
    M84 ; steppers off

kiauh.cfg:

################################################################################
# ~~~~~~~~~~~~~~~~~~~~~~~~  AUTOCREATED WITH KIAUH  ~~~~~~~~~~~~~~~~~~~~~~~~~~ #
################################################################################
# Recommended macros and config entries if you use Mainsail or Fluidd!         #
# You can edit or delete those macros if you already defined them elsewhere!   #
################################################################################

[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
    TURN_OFF_HEATERS
    CLEAR_PAUSE
    SDCARD_RESET_FILE
    BASE_CANCEL_PRINT

[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
gcode:
    ##### set defaults #####
    {% set x = params.X|default(-1) %}      #edit to your park position
    {% set y = params.Y|default(221) %}      #edit to your park position
    {% set z = params.Z|default(245)|float %} #edit to your park position
    {% set e = params.E|default(1) %}        #edit to your retract length
    ##### calculate save lift position #####
    {% set max_z = printer.toolhead.axis_maximum.z|float %}
    {% set act_z = printer.toolhead.position.z|float %}
    {% set lift_z = z|abs %}
    {% if act_z < (max_z - lift_z) %}
        {% set z_safe = lift_z %}
    {% else %}
        {% set z_safe = max_z - act_z %}
    {% endif %}
    ##### end of definitions #####
    SAVE_GCODE_STATE NAME=PAUSE_state
    BASE_PAUSE
    G91
    G1 E-{e} F2100
    G1 Z{z_safe}
    G90
    G1 X{x} Y{y} F6000


[gcode_macro RESUME]
rename_existing: BASE_RESUME
gcode:
    ##### set defaults #####
    {% set e = params.E|default(1) %} #edit to your retract length
    G91
    G1 E{e} F2100
    G90
    RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
    BASE_RESUME

################################################################################
################################################################################

@matti125
Copy link

And in case you run with standard hotends/extruders, here is the cfg file for those. Most importantly it has a different extruder feed ratio.

[printer]
max_velocity: 200
max_accel: 7000
#max_accel: 7000
max_accel_to_decel: 7000

# The definition for the primary extruder
[extruder]
step_pin: ar57
dir_pin: !ar58
enable_pin: !ar59
microsteps: 16
rotation_distance: 32.5
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: ar11
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog15
pressure_advance = 0.1
min_temp: 0
max_temp: 260
max_extrude_only_distance: 200.0

[extruder1]
step_pin: ar26
dir_pin: ar28
enable_pin: !ar24
microsteps: 16
rotation_distance: 32.5
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: ar10
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog13
pressure_advance = 0.1
min_temp: 0	
max_temp: 260
max_extrude_only_distance: 200.0

[input_shaper]
shaper_freq_x: 34  # frequency for the X mark of the test model

@tonywright
Copy link

Hi Matti125, thanks for uploading your configs, I really hoped this would help But I have exactly the same problem, after lowering all 3 minimum temperatures to -200 the system appears to work right up until I try moving a servo, then it just times out without a glimmer of movement.
I can read the status: "ready", I can read and trigger the (Optical) end stops, the LEDs on the end-stops are lit so it appears to be getting power. That is the only indication though as it has a momentary power switch without an "On" position. all the thermostats are reading -99.6 degrees. I am just wondering if there is a board pin that needs to be "switched" on to put power to the motors?

Klipper was so easy to get working on my Ender 3 and I much prefer it to the out-dated version of Marlin on the tenlog.

Thanks

Tony

@matti125
Copy link

matti125 commented Aug 18, 2021

Hmm.. are your VGA cables properly connected to the extruder/hotends? And you have checked that the pins are correct on the printer.cfg for measuring the temperature and controlling the motors? And then of course, do you have the power switched on for the printer? The control board will power on with the just power from USB (from the RPi), so it will appear working, even though no motors would then really step/spin. Sorry, basic stuff, but I was myself hit by not having one of the VGA connectors properly plugged in, which resulted in the temp readings being negative.

It seems like you would need to figure out a way to make the power supply switch on with the momentary power switch. I have an old-fashioned on/off switch, which seems to be easier in this regard. OTOH, I probably cannot switch the power off with software.

@tonywright
Copy link

I don't think it is a cable problem as I have switched back and forth with Marlin and it works fine with that. I have double and triple checked the pins and they match the pins.h (pins_TENLOG_D3_HERO.h) in the marlin firmware, the only difference is that in klipper they have for example "analog15" for the temp sensor pin instead of just "15" as in the pins.h file.
I now have the display showing the "Loading" screen when it is powered up and this goes off if I power it down using the switch so I think the main power is on.
I might try putting a modified copy of Marlin 2.x on it that I have found. Unless I start feeling very adventurous and replace the mother board with a btt skr1.2 pro :) I know Klipper will work with that.

Thanks for the help.

@matti125
Copy link

I guess your pins are then exactly the same ones I have?

I might still want to check that the power supply is really outputting the 24V high power lines. It might quite well be that there is a pilot +5v voltage that is always on after toggling the on/off switch (regardless of any software commands), but the 24 would need to be switched on by the software switching on a pin. Did u check whether there is a something on the power supply terminals, labeled as "control" or similar? Something that would probably have a thin wire going to it, from one of the output pins of the control board. (Btw, I used to design power supplies way, way back :).
At least the board I have is suitable for klipper, my standard printing speed is now 100mm/s with input shaping, pressure advance and custom python-based functionality. Using Marliln would seem like a step back :/

@tonywright
Copy link

I don't know what happened the first time but just tried it again and the display is powered by usb, if I click "Home" and immediately turn on the power switch the heads move for a few seconds until the power automatically goes off
I just need to find the pin number that keeps the power on, I don't really want to start messing with the hardware until I rule everything else out.
Looking in marlin and the "#define PSU_CONTROL" is remmed out so it looks like it might be else where, unless the power board is checking something else that happens when Marlin starts and then keeps the power on.
Mind you if I can find the thin wire you mentioned I could trace it back to the motherboard and perhaps find the pin number that way. The printer is in a cabinet and it is very difficult to get the bottom panel off.

@tonywright
Copy link

I have found this in the tenlog pins.h file:
#define PS_ON_PIN 40 //zyf 40 //PF1

I then found this page Klipper3d/klipper#1295

that gave me this code that I added to printer.cfg:
[output_pin ps_on]
pin: !ar12
value: 0
shutdown_value: 0

[gcode_macro m80]
gcode:
SET_PIN PIN=ps_on VALUE=1

[gcode_macro m81]
gcode:
SET_PIN PIN=ps_on VALUE=0

I changed the pin to ar40, now clicking M81 macro turns on the power and M80 turns it off.
With power, everything works including the thermostats. :)

Thanks for the help in getting klipper working with my tenlog d3 pro.

@marcello-fialho
Copy link

marcello-fialho commented Aug 19, 2021 via email

@matti125
Copy link

@tonywright , glad you were able to fix it! And @marcello-fialho, as u said, there is no mirror printing (yet) with klipper, but I rather find it a gimmick instead of a really useful feature. Otherwise, the concept behind klipper is just so much better IMHO. And if you really, really wanted to do mirror printing, I guess you could write you own stuff in python to do that :)

@marcello-fialho
Copy link

marcello-fialho commented Aug 19, 2021 via email

@marcello-fialho
Copy link

marcello-fialho commented Sep 4, 2021 via email

@dfgas
Copy link

dfgas commented Mar 22, 2023

did you guys ever get the tl-d3 pro with the 8bit board working and has the mirror and duplicate modes been added yet?

@tenlog
Copy link
Owner

tenlog commented Mar 22, 2023 via email

@kiler129
Copy link

@tenlog The firmware shipped is an ancient Marlin v1.
@dfgas There's a config for Klipper but I don't think Klipper supports mirror/duplicate modes, unless you tinker with GCode in your slicer.

@tenlog
Copy link
Owner

tenlog commented Mar 22, 2023 via email

@dfgas
Copy link

dfgas commented Mar 22, 2023

Our printer comes with 4 printing modes to choose from. Click this position on the screen to set it up, can you find it? Grzegorz Zdanowski @.> 于2023年3月22日周三 15:44写道:

@tenlog https://github.com/tenlog The firmware shipped is an ancient Marlin v1. @dfgas https://github.com/dfgas There's a config for Klipper but I don't think Klipper supports mirror/duplicate modes, unless you tinker with GCode in your slicer. — Reply to this email directly, view it on GitHub <#7 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMGC76OMBYMFI2BI7ZHXYX3W5KUU5ANCNFSM4PV6HUKQ . You are receiving this because you were mentioned.Message ID: @.
>

we are talking klipper, not your firmware.....

@tenlog
Copy link
Owner

tenlog commented Mar 23, 2023 via email

@shablam
Copy link

shablam commented Apr 26, 2023

HI would you mind sharing your printer.cfg for the tl d3 pro that you got working? This one is not working for me. https://github.com/jonpackard/klipper_config_tld3pro/blob/master/printer.cfg something must be off on the pins. thanks in advance.

@kiler129
Copy link

@shablam https://github.com/Klipper3d/klipper/pull/6036/files

@shablam
Copy link

shablam commented Apr 27, 2023

@shablam https://github.com/Klipper3d/klipper/pull/6036/files

ok thanks again. I did get it working but for my BMG unit some values had to change. Overall yours worked for me less then rotation distance mainly. also 115200 rate.

@RagDollino
Copy link

@shablam https://github.com/Klipper3d/klipper/pull/6036/files

ok thanks again. I did get it working but for my BMG unit some values had to change. Overall yours worked for me less then rotation distance mainly. also 115200 rate.

Hello, what values ​​did you change for the BMG extruders? I'm a bit new to klipper... Thanks in advance.

@shablam
Copy link

shablam commented Apr 29, 2023

@shablam https://github.com/Klipper3d/klipper/pull/6036/files

ok thanks again. I did get it working but for my BMG unit some values had to change. Overall yours worked for me less then rotation distance mainly. also 115200 rate.

Hello, what values ​​did you change for the BMG extruders? I'm a bit new to klipper... Thanks in advance.

HI, mainly the rotation. that must be for a stock extruder. the rotation is more like 7.9. i have it around 9 but the calculations I am told put it about 7.9. So i probably will change it. the other link I posted has some numbers I used. also change the baud rate to 115200.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests