Skip to content

Instantly share code, notes, and snippets.

@Deathproof76
Last active June 21, 2024 13:16
Show Gist options
  • Save Deathproof76/68d31997810bbd8ea56d614e7218e7d8 to your computer and use it in GitHub Desktop.
Save Deathproof76/68d31997810bbd8ea56d614e7218e7d8 to your computer and use it in GitHub Desktop.
Tina2S Klipper config
# This file contains pin mappings and other defaults for the Weefun/Weedo
# Tina2s based on the GD32F103. It won't work with the ATMega-bsed
# Tina/Tina wifi/monoprice cadet.
# The biggest issue with this printer is that the USB-serial CH340G's DTR pin
# is tied to reset with a 1k resistor - not a capacitor circuit like most.
# restart_method of 'tina2s' was added to make sure DTR is held high during
# normal operation
# Pins were found in https://github.com/weedo3d/TINA2Sfirmware and confirmed
# on hardware. Flashing will not work with stm32flash or via makefile because
# of the DTR implementaiton. It can be flashed using the proprietary upload
# tool found in their repository. Factory firmware can be reverted with the
# same tool
# menuconfig options:
# [*] Enable extra low-level configuration options
# Micro-controller Architecture (STMicroelectronics STM32) --->
# Processor model (STM32F103) --->
# [ ] Only 10KiB of RAM (for rare stm32f103x6 variant) (NEW)
# [ ] Disable SWD at startup (for GigaDevice stm32f103 clones) (NEW)
# Bootloader offset (32KiB bootloader) --->
# Clock Reference (8 MHz crystal) --->
# Communication interface (Serial (on USART1 PA10/PA9)) --->
# (115200) Baud rate for serial port
# () GPIO pins to set at micro-controller startup (NEW)
[printer]
kinematics: cartesian
max_velocity: 250
max_accel: 800
max_z_velocity: 20
max_z_accel: 400
#[firmware_retraction]
#retract_length: 6.8
#retract_speed: 70
#unretract_extra_length: 0
#unretract_speed: 70
[stepper_x]
step_pin: PB8
dir_pin: PB7
enable_pin: !PB9
microsteps: 16
full_steps_per_rotation: 200
rotation_distance: 32
endstop_pin: ^PA7
position_endstop: 105
position_max: 105
homing_speed: 35.0
[stepper_y]
step_pin: PA12
dir_pin: !PA11
enable_pin: !PA15
microsteps: 16
full_steps_per_rotation: 200
rotation_distance: 32
endstop_pin: ^!PC4
position_endstop: 0
position_min: 0
position_max: 105
homing_speed: 35.0
[stepper_z]
step_pin: PC7
dir_pin: PC6
enable_pin: !PA8
microsteps: 16
full_steps_per_rotation: 200
rotation_distance: 8
endstop_pin: ^PC5
#position_endstop: 100
position_endstop: 99
position_min: -2
position_max: 100
homing_speed: 30.0
[extruder]
step_pin: PB4
dir_pin: !PB3
enable_pin: !PB6
microsteps: 16
full_steps_per_rotation: 200
max_extrude_only_distance: 100.0
rotation_distance: 35.5
nozzle_diameter: 0.400
filament_diameter: 1.750
pressure_advance: 0.24
heater_pin: PC14
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC0
control: pid
pid_Kp: 35.983
pid_Ki: 2.499
pid_Kd: 129.539
min_temp: 0
max_temp: 275
max_extrude_only_velocity: 50
max_extrude_only_accel: 200
[heater_fan myfan]
pin: PC15
heater: extruder
[heater_bed]
heater_pin: PA5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC1
control: pid
pid_Kp: 70.383
pid_Ki: 4.837
pid_Kd: 256.017
min_temp: 0
max_temp: 120
[probe]
pin: !PC13
x_offset: 28
y_offset: 2
# z_offset:
[bed_mesh]
speed: 220
horizontal_move_z: 4
mesh_min: 28, 14
mesh_max: 100, 95
move_check_distance: 5
split_delta_z: 0.012
#fade_start: 1
#fade_end: 10
#fade_target: 0
probe_count: 5, 5 # Values should be odd, so one point is directly at bed center
algorithm: bicubic
bicubic_tension: 0.2
[output_pin myled]
pin: PB0
value: 1
pwm: True
cycle_time: 0.001
hardware_pwm: True
[gcode_macro LEDON]
gcode: SET_PIN PIN=myled VALUE=1
[gcode_macro LEDOFF]
gcode: SET_PIN PIN=myled VALUE=0
[gcode_macro M106]
gcode:
{% if params.S is defined %}
{% if params.S|int == 255 %}
{% set realspeed = 1 %}
{% else %}
{% if params.S|int == 0 %}
{% set realspeed = 0 %}
{% else %}
{% set realspeed = 0.392156862745098*params.S|int %}
{% endif %}
{% endif %}
{% else %}
{% set realspeed = 1 %}
{% endif %}
{% if params.P is defined %}
SET_FAN_SPEED FAN=fan_{params.P|int} SPEED={realspeed}
{% else %}
SET_FAN_SPEED FAN=fan_0 SPEED={realspeed}
{% endif %}
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
baud: 115200
restart_method: tina2s
[display]
lcd_type: uc1701
cs_pin: PB12
a0_pin: PC2
rst_pin: PB11
contrast: 63
encoder_pins: ^PC3, ^PA1
click_pin: ^!PA4
# Mainsail settings
[include mainsail.cfg]
# All customizations are documented in globals.cfg. Just copy a variable from
# there into the section below, and change the value to meet your needs.
[gcode_macro _km_options]
# These are examples of some likely customizations:
# Any sheets in the below list will be available with a configurable offset.
#variable_bed_surfaces: ['smooth_1','texture_1']
# Length (in mm) of filament to load (bowden tubes will be longer).
# X position to park the toolhead.
variable_park_x: 98.0
# Y position to park the toolhead.
variable_park_y: 98.0
# Z position to park the toolhead.
variable_park_z: 98.0
variable_start_end_park_y: 99.0
variable_load_length: 90.0
variable_print_min: 3, 3
variable_print_max: 98, 89
#variable_start_z_tilt_adjust_at_temp: False
#BED_MESH_CALIBRATE_FAST
variable_start_bed_heat_overshoot: 0.0
variable_probe_mesh_padding : 5.0
#variable_bed_surfaces: ['v1']
variable_menu_temperature: [
{'name' : 'PLA', 'extruder' : 200.0, 'bed' : 55.0},
{'name' : 'PETG', 'extruder' : 230.0, 'bed' : 70.0}]
# {'name' : 'ABS', 'extruder' : 245.0, 'bed' : 110.0, 'chamber' : 60}]
variable_start_purge_length: 8
variable_start_purge_clearance: 1
variable_start_purge_prime_length: 5.0
#variable_start_purge_length: 30 # This value works for most setups.
gcode: # This line is required by Klipper.
# Any code you put here will run at klipper startup, after the initialization
# for these macros. For example, you could uncomment the following line to
# automatically adjust your bed surface offsets to account for any changes made
# to your Z endstop or probe offset.
# ADJUST_SURFACE_OFFSETS
G28
# This line includes all the standard macros.
[include klipper-macros/*.cfg]
# Uncomment to include features that require specific hardware support.
# LCD menu support for features like bed surface selection and pause next layer.
[include klipper-macros/optional/lcd_menus.cfg]
# Optimized bed leveling
[include klipper-macros/optional/bed_mesh.cfg]
# The sections below here are required for the macros to work. If your config
# already has some of these sections you should merge the duplicates into one
# (or if they are identical just remove one of them).
[idle_timeout]
gcode:
_KM_IDLE_TIMEOUT # This line must be in your idle_timeout section.
[pause_resume]
[respond]
[save_variables]
filename: ~/printer_data/variables.cfg # UPDATE THIS FOR YOUR PATH!!!
[virtual_sdcard]
path: ~/printer_data/gcodes # UPDATE THIS FOR YOUR PATH!!!
[display_status]
# Uncomment the sections below if Fluidd complains (because it's confused).
#[gcode_macro CANCEL_PRINT]
#rename_existing: CANCEL_PRINT_FAKE_BASE
#gcode: CANCEL_PRINT_FAKE_BASE {rawparams}
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
@Deathproof76
Copy link
Author

Deathproof76 commented Mar 28, 2023

@Deathproof76
Copy link
Author

Deathproof76 commented Mar 28, 2023

The [gcode_macro M106] is basically a provisional dummy variable for the macros as the fanspeed can't be adjusted (at least not really).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment