klipper update

This commit is contained in:
Rainboooom
2023-06-15 11:41:08 +08:00
parent 845d13acb1
commit dffff1ae35
1921 changed files with 1625400 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
# Base config file for atmega at90usb1286
CONFIG_MACH_AVR=y
CONFIG_MACH_at90usb1286=y
CONFIG_CLOCK_FREQ=16000000

View File

@@ -0,0 +1,4 @@
# Base config file for atmega1280
CONFIG_MACH_AVR=y
CONFIG_MACH_atmega1280=y
CONFIG_CLOCK_FREQ=16000000

View File

@@ -0,0 +1,4 @@
# Base config file for atmega1284p
CONFIG_MACH_AVR=y
CONFIG_MACH_atmega1284p=y
CONFIG_CLOCK_FREQ=16000000

View File

@@ -0,0 +1,4 @@
# Base config file for atmega2560
CONFIG_MACH_AVR=y
CONFIG_MACH_atmega2560=y
CONFIG_CLOCK_FREQ=16000000

View File

@@ -0,0 +1,4 @@
# Base config file for atmega328
CONFIG_MACH_AVR=y
CONFIG_MACH_atmega328=y
CONFIG_CLOCK_FREQ=16000000

View File

@@ -0,0 +1,4 @@
# Base config file for atmega644p
CONFIG_MACH_AVR=y
CONFIG_MACH_atmega644p=y
CONFIG_CLOCK_FREQ=16000000

View File

@@ -0,0 +1,2 @@
# Base config file for host simulator
CONFIG_MACH_SIMU=y

View File

@@ -0,0 +1,2 @@
# Base config file for linux process
CONFIG_MACH_LINUX=y

View File

@@ -0,0 +1,2 @@
# Base config file for LPC176x boards
CONFIG_MACH_LPC176X=y

2
test/configs/pru.config Normal file
View File

@@ -0,0 +1,2 @@
# Base config file for the Beaglebone PRU
CONFIG_MACH_PRU=y

View File

@@ -0,0 +1,2 @@
# Base config file for rp2040 boards
CONFIG_MACH_RP2040=y

View File

@@ -0,0 +1,3 @@
# Base config file for Atmel SAM3x8e ARM processor
CONFIG_MACH_ATSAM=y
CONFIG_MACH_SAM3X8C=y

View File

@@ -0,0 +1,3 @@
# Base config file for Atmel SAM3x8e ARM processor
CONFIG_MACH_ATSAM=y
CONFIG_MACH_SAM3X8E=y

View File

@@ -0,0 +1,3 @@
# Base config file for Atmel SAM4E8E ARM processor
CONFIG_MACH_ATSAM=y
CONFIG_MACH_SAM4E8E=y

View File

@@ -0,0 +1,3 @@
# Base config file for Atmel SAM4S8C ARM processor
CONFIG_MACH_ATSAM=y
CONFIG_MACH_SAM4S8C=y

View File

@@ -0,0 +1,3 @@
# Base config file for SAMD21 boards
CONFIG_MACH_ATSAMD=y
CONFIG_MACH_SAMD21G18=y

View File

@@ -0,0 +1,4 @@
# Base config file for Atmel SAMD51P20 ARM processor
CONFIG_MACH_ATSAMD=y
CONFIG_MACH_SAMD51P20=y
CONFIG_CLOCK_REF_X25M=y

View File

@@ -0,0 +1,3 @@
# Base config file for Atmel SAME70Q20B ARM processor
CONFIG_MACH_ATSAM=y
CONFIG_MACH_SAME70Q20B=y

View File

@@ -0,0 +1,3 @@
# Base config file for STM32F031 boards
CONFIG_MACH_STM32=y
CONFIG_MACH_STM32F031=y

View File

@@ -0,0 +1,3 @@
# Base config file for STM32F070 ARM processor
CONFIG_MACH_STM32=y
CONFIG_MACH_STM32F070=y

View File

@@ -0,0 +1,4 @@
# Base config file for STM32F1 ARM processor using serial communication
CONFIG_MACH_STM32=y
CONFIG_MACH_STM32F103=y
CONFIG_STM32_SERIAL_USART1=y

View File

@@ -0,0 +1,3 @@
# Base config file for STM32F1 ARM processor
CONFIG_MACH_STM32=y
CONFIG_MACH_STM32F103=y

View File

@@ -0,0 +1,3 @@
# Base config file for STM32F405 ARM processor
CONFIG_MACH_STM32=y
CONFIG_MACH_STM32F405=y

View File

@@ -0,0 +1,3 @@
# Base config file for STM32F407 ARM processor
CONFIG_MACH_STM32=y
CONFIG_MACH_STM32F407=y

View File

@@ -0,0 +1,3 @@
# Base config file for STM32F429 ARM processor
CONFIG_MACH_STM32=y
CONFIG_MACH_STM32F429=y

View File

@@ -0,0 +1,3 @@
# Base config file for STM32F446 ARM processor
CONFIG_MACH_STM32=y
CONFIG_MACH_STM32F446=y

View File

@@ -0,0 +1,3 @@
# Base config file for STM32G0B1 ARM processor
CONFIG_MACH_STM32=y
CONFIG_MACH_STM32G0B1=y

View File

@@ -0,0 +1,3 @@
# Base config file for STM32H743 ARM processor
CONFIG_MACH_STM32=y
CONFIG_MACH_STM32H743=y

View File

@@ -0,0 +1,52 @@
# Test config for bed screws tool
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
rotation_distance: 40
microsteps: 16
endstop_pin: ^PE5
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
rotation_distance: 40
microsteps: 16
endstop_pin: ^PJ1
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
rotation_distance: 8
microsteps: 16
endstop_pin: ^PD3
position_endstop: 0.5
position_max: 200
[bed_screws]
screw1: 100,50
screw1_name: Front right
screw1_fine_adjust: 200,50
screw2: 75,75
screw2_fine_adjust: 200,75
screw3: 75,75
screw3_name: Last
screw3_fine_adjust: 75,90
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100

View File

@@ -0,0 +1,49 @@
# Test case for bed screws helper tool
CONFIG bed_screws.cfg
DICTIONARY atmega2560.dict
# Start helper script and then abort it
G28
BED_SCREWS_ADJUST
ACCEPT
ACCEPT
ABORT
# Start helper script and run until success
BED_SCREWS_ADJUST
ACCEPT
ACCEPT
ACCEPT
ACCEPT
ACCEPT
ACCEPT
# Start helper script and run with two readjusts
BED_SCREWS_ADJUST
ACCEPT
ADJUSTED
ACCEPT
ACCEPT
ACCEPT
ACCEPT
ADJUSTED
ACCEPT
ACCEPT
ACCEPT
ACCEPT
ACCEPT
ACCEPT
ACCEPT
ACCEPT
# Start helper script and run with two readjusts
BED_SCREWS_ADJUST
ABORT

76
test/klippy/bltouch.cfg Normal file
View File

@@ -0,0 +1,76 @@
# Test config for bltouch
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: ^PE5
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: ^PJ1
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 8
endstop_pin: probe:z_virtual_endstop
position_max: 200
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
microsteps: 16
rotation_distance: 33.5
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PH5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK6
control: watermark
min_temp: 0
max_temp: 130
[bltouch]
sensor_pin: PC7
control_pin: PC5
z_offset: 1.15
[bed_mesh]
mesh_min: 10,10
mesh_max: 180,180
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100

29
test/klippy/bltouch.test Normal file
View File

@@ -0,0 +1,29 @@
# Test case for bltouch support
CONFIG bltouch.cfg
DICTIONARY atmega2560.dict
# Start by homing the printer.
G28
G1 F6000
# Z / X / Y moves
G1 Z1
G1 X1
G1 Y1
# Run BLTOUCH_DEBUG
BLTOUCH_DEBUG
BLTOUCH_DEBUG COMMAND=reset
# Run bed_mesh_calibrate
BED_MESH_CALIBRATE
# Move again
G1 Z5 X0 Y0
# Do regular probe
PROBE
QUERY_PROBE
# Move again
G1 Z9

46
test/klippy/commands.test Normal file
View File

@@ -0,0 +1,46 @@
# Tests for miscellaneous g-code commands
DICTIONARY atmega2560.dict
CONFIG ../../config/example-cartesian.cfg
# Simple status commands
GET_POSITION
M114
STATUS
HELP
QUERY_ENDSTOPS
M115
M18
# G-code state commands
G28
SAVE_GCODE_STATE
G92 Z-5
G92 E5
SAVE_GCODE_STATE NAME=test
G1 Z-5
G91
G1 Z0
RESTORE_GCODE_STATE NAME=test
G1 Z-5
RESTORE_GCODE_STATE
G1 Z0 E0
RESTORE_GCODE_STATE MOVE=1
# Update commands
SET_GCODE_OFFSET Z=.1
M206 Z-.2
SET_GCODE_OFFSET Z_ADJUST=-.1
SET_VELOCITY_LIMIT ACCEL=100 VELOCITY=20 SQUARE_CORNER_VELOCITY=1 ACCEL_TO_DECEL=200
M204 S500
SET_PRESSURE_ADVANCE EXTRUDER=extruder ADVANCE=.001
SET_PRESSURE_ADVANCE ADVANCE=.002 ADVANCE_LOOKAHEAD_TIME=.001
# Restart command (must be last in test)
RESTART

47
test/klippy/delta.test Normal file
View File

@@ -0,0 +1,47 @@
# Test case for basic movement on delta printers
CONFIG ../../config/example-delta.cfg
DICTIONARY atmega2560.dict
# Start by homing the printer. Also tests Z moves.
G28
# Perform an XY+Z move with infintesimal XY component
G1 x0 y0 z15
# Perform an XY move along Y axis (aligned with rear tower)
G1 x0 y5 z15
# Perform an XY+Z move along Y axis
G1 x0 y-5 z10
# Perform a Z move
G1 x0 y-5 z15
# Perform an XY move across all three towers
G1 x2 y2 z10
# Perform an XY+Z move with tiny Z movement
G1 x2 y-10 z10.1
# Move to far away position
G1 x140 y0
# Move to extreme position
G1 x145 y0
# Move to another extreme position
G1 x145 y5
# Test delta_calibrate command
DELTA_CALIBRATE
# Dummy move
G1 Z5 X0 Y0
# Verify stepper_buzz
STEPPER_BUZZ STEPPER=stepper_a
STEPPER_BUZZ STEPPER=stepper_b
STEPPER_BUZZ STEPPER=stepper_c
# Dummy move
G1 Z3 X2 Y3

View File

@@ -0,0 +1,76 @@
# Test config for the DELTA_CALIBRATE command (on linear delta robots)
[stepper_a]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 0.32
endstop_pin: ^PE4
homing_speed: 50
#position_endstop: 297.05
#arm_length: 333.0
[stepper_b]
step_pin: PF6
dir_pin: PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 0.32
endstop_pin: ^PJ0
[stepper_c]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 0.32
endstop_pin: ^PD2
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: delta
max_velocity: 300
max_accel: 3000
#delta_radius: 174.75
[delta_calibrate]
radius: 50
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [printer]
#*# delta_radius = 174.750004
#*#
#*# [stepper_a]
#*# angle = 210.000032
#*# arm_length = 333.000032
#*# position_endstop = 297.049970
#*#
#*# [stepper_b]
#*# angle = 329.999997
#*# arm_length = 332.999811
#*# position_endstop = 297.050132
#*#
#*# [stepper_c]
#*# angle = 90.000000
#*# arm_length = 333.000181
#*# position_endstop = 297.049900
#*#
#*# [delta_calibrate]
#*# height0 = 0.0
#*# height0_pos = 2970499.999,2970499.999,2970499.999
#*# height1 = 0.0
#*# height1_pos = 3163266.999,3163266.999,2727853.999
#*# height2 = 0.0
#*# height2_pos = 2869315.999,3303154.999,2869315.999
#*# height3 = 0.0
#*# height3_pos = 2749008.999,3138330.999,3138330.999
#*# height4 = 0.0
#*# height4_pos = 2885497.999,2885497.999,3218746.999
#*# height5 = 0.0
#*# height5_pos = 3114555.999,2771134.999,3114555.999
#*# height6 = 0.0
#*# height6_pos = 3260109.999,2876968.999,2876968.999

View File

@@ -0,0 +1,31 @@
# Test case for basic movement on delta printers
CONFIG delta_calibrate.cfg
DICTIONARY atmega2560.dict
# Start by homing the printer.
G28
# Run basic delta calibration (in manual mode)
DELTA_CALIBRATE METHOD=manual
G1 Z0.1
ACCEPT
G1 Z0.1
ACCEPT
G1 Z0.1
ACCEPT
G1 Z0.1
ACCEPT
G1 Z0.1
ACCEPT
G1 Z0.1
ACCEPT
G1 Z0.1
ACCEPT
# Run extended delta calibration
DELTA_ANALYZE CENTER_DISTS=74,74,74,74,74,74
DELTA_ANALYZE OUTER_DISTS=74,74,74,74,74,74
DELTA_ANALYZE CENTER_PILLAR_WIDTHS=9,9,9
DELTA_ANALYZE OUTER_PILLAR_WIDTHS=9,9,9,9,9,9
DELTA_ANALYZE SCALE=1
DELTA_ANALYZE CALIBRATE=extended

View File

@@ -0,0 +1,125 @@
# Test config with dual carriage and multiple extruders
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: ^PE5
position_endstop: 0
position_max: 200
homing_speed: 50
[dual_carriage]
axis: x
step_pin: PH1
dir_pin: PH0
enable_pin: !PA1
microsteps: 16
rotation_distance: 40
endstop_pin: ^PE4
position_endstop: 200
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: ^PJ1
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 8
endstop_pin: ^PD3
position_endstop: 0.5
position_max: 200
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
microsteps: 16
rotation_distance: 33.5
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[gcode_macro PARK_extruder0]
gcode:
G90
G1 X0
[gcode_macro T0]
gcode:
PARK_{printer.toolhead.extruder}
ACTIVATE_EXTRUDER EXTRUDER=extruder
SET_DUAL_CARRIAGE CARRIAGE=0
[extruder1]
step_pin: PC1
dir_pin: PC3
enable_pin: !PC7
microsteps: 16
rotation_distance: 33.5
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK7
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[gcode_macro PARK_extruder1]
gcode:
SET_SERVO SERVO=my_servo angle=100
G90
G1 X200
[gcode_macro T1]
gcode:
PARK_{printer.toolhead.extruder}
SET_SERVO SERVO=my_servo angle=50
ACTIVATE_EXTRUDER EXTRUDER=extruder1
SET_DUAL_CARRIAGE CARRIAGE=1
[servo my_servo]
pin: PH4
[heater_bed]
heater_pin: PH5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK6
control: watermark
min_temp: 0
max_temp: 130
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100

View File

@@ -0,0 +1,39 @@
# Test cases on printers with dual carriage and multiple extruders
CONFIG dual_carriage.cfg
DICTIONARY atmega2560.dict
# First home the printer
G90
G28
# Perform a dummy move
G1 X10 F6000
# Activate alternate carriage
SET_DUAL_CARRIAGE CARRIAGE=1
G1 X190 F6000
# Go back to main carriage
SET_DUAL_CARRIAGE CARRIAGE=0
G1 X20 F6000
# Test changing extruders
G1 X5
T1
G91
G1 X-10 E.2
T0
G91
G1 X20 E.2
G90
QUERY_ENDSTOPS
# Servo tests
SET_SERVO servo=my_servo angle=160
SET_SERVO servo=my_servo angle=130
# Verify STEPPER_BUZZ
STEPPER_BUZZ STEPPER=dual_carriage
STEPPER_BUZZ STEPPER=extruder
STEPPER_BUZZ STEPPER=extruder1

View File

@@ -0,0 +1,117 @@
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: ^PE5
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: ^PJ1
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 8
endstop_pin: ^PD3
position_endstop: 0.5
position_max: 200
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
microsteps: 16
rotation_distance: 33.5
nozzle_diameter: 0.500
filament_diameter: 3.500
heater_pin: PB4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 210
[heater_bed]
heater_pin: PH5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK6
control: watermark
min_temp: 0
max_temp: 110
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
# Test config for exclude_object
[exclude_object]
[gcode_macro M486]
gcode:
# Parameters known to M486 are as follows:
# [C<flag>] Cancel the current object
# [P<index>] Cancel the object with the given index
# [S<index>] Set the index of the current object.
# If the object with the given index has been canceled, this will cause
# the firmware to skip to the next object. The value -1 is used to
# indicate something that isnt an object and shouldnt be skipped.
# [T<count>] Reset the state and set the number of objects
# [U<index>] Un-cancel the object with the given index. This command will be
# ignored if the object has already been skipped
{% if 'exclude_object' not in printer %}
{action_raise_error("[exclude_object] is not enabled")}
{% endif %}
{% if 'T' in params %}
EXCLUDE_OBJECT RESET=1
{% for i in range(params.T | int) %}
EXCLUDE_OBJECT_DEFINE NAME={i}
{% endfor %}
{% endif %}
{% if 'C' in params %}
EXCLUDE_OBJECT CURRENT=1
{% endif %}
{% if 'P' in params %}
EXCLUDE_OBJECT NAME={params.P}
{% endif %}
{% if 'S' in params %}
{% if params.S == '-1' %}
{% if printer.exclude_object.current_object %}
EXCLUDE_OBJECT_END NAME={printer.exclude_object.current_object}
{% endif %}
{% else %}
EXCLUDE_OBJECT_START NAME={params.S}
{% endif %}
{% endif %}
{% if 'U' in params %}
EXCLUDE_OBJECT RESET=1 NAME={params.U}
{% endif %}

View File

@@ -0,0 +1,126 @@
DICTIONARY atmega2560.dict
CONFIG exclude_object.cfg
G28
M83
M486 T3
M486 S0
G0 X10
M486 S-1
G0 X0
M486 S1
G0 X11
M486 C
# "Prime" the transform
G1 X140 E0.5
G1 X160 E0.5
G1 X140 E0.5
G1 X160 E0.5
G1 X140 E0.5
G1 X160 E0.5
G1 X140 E0.5
M486 S-1
G0 X0
M486 S2
G0 X13
M486 S0
G0 X10
M486 S-1
G0 X0
M486 S1
G0 X-11
M486 S-1
G0 X0
M486 S2
G0 X13
M486 P2
EXCLUDE_OBJECT
M486 S0
G0 X10
M486 S-1
G0 X0
M486 S1
G0 X-11
M486 S-1
G0 X0
M486 S2
G0 X-13
M486 U2
EXCLUDE_OBJECT
M486 S0
G0 X10
M486 S-1
G0 X0
M486 S1
G0 X-11
M486 S-1
G0 X0
M486 S2
G0 X13
M486 P0
M486 P1
M486 P2
EXCLUDE_OBJECT
M486 S0
G0 X-10
M486 S-1
G0 X0
M486 S1
G0 X-11
M486 S-1
G0 X0
M486 S2
G0 X-13
M486 S66
G0 X66
M486 S-1
G0 X0
M486 P66
M486 S66
G0 X-66
M486 T3
M486 S0
G0 X10
M486 S1
G0 X11
M486 S2
G0 X13

68
test/klippy/extruders.cfg Normal file
View File

@@ -0,0 +1,68 @@
# Config for extruder testing
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: ^PE5
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: ^PJ1
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 8
endstop_pin: ^PD3
position_endstop: 0.5
position_max: 200
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
microsteps: 16
rotation_distance: 33.5
nozzle_diameter: 0.500
filament_diameter: 3.500
heater_pin: PB4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 210
[extruder_stepper my_extra_stepper]
extruder: extruder
step_pin: PH5
dir_pin: PH6
enable_pin: !PB5
microsteps: 16
rotation_distance: 28.2
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100

View File

@@ -0,0 +1,50 @@
# Extruder tests
DICTIONARY atmega2560.dict
CONFIG extruders.cfg
# Extrude only
G1 E5
G1 E-2
G1 E7
# Home and extrusion moves
G28
G1 X20 Y20 Z1
G1 X25 Y25 E7.5
# Update step_distance
SET_EXTRUDER_ROTATION_DISTANCE EXTRUDER=extruder DISTANCE=33.2
G1 X30 Y30 E8.0
# Reverse step_distance
SET_EXTRUDER_ROTATION_DISTANCE EXTRUDER=extruder DISTANCE=-33.1
G1 X30 Y30 E8.2
# Disable extruder stepper motor
SYNC_EXTRUDER_MOTION EXTRUDER=extruder MOTION_QUEUE=
G1 X35 Y35 E8.5
# Disable my_extra_stepper stepper motor
SYNC_EXTRUDER_MOTION EXTRUDER=my_extra_stepper MOTION_QUEUE=
G1 X40 Y40 E9.0
# Enable extruder stepper motor
SYNC_EXTRUDER_MOTION EXTRUDER=extruder MOTION_QUEUE=extruder
G1 X45 Y45 E9.5
# Switch to just my_extra_stepper stepper motor
SYNC_EXTRUDER_MOTION EXTRUDER=extruder MOTION_QUEUE=
SYNC_EXTRUDER_MOTION EXTRUDER=my_extra_stepper MOTION_QUEUE=extruder
G1 X50 Y50 E10.0
# Test pressure advance move
SET_PRESSURE_ADVANCE EXTRUDER=my_extra_stepper ADVANCE=0.020
G1 X55 Y55 E0
G1 X55 Y55 E0.5
G1 X60 Y60 E1.1
G1 X50 Y50
SET_PRESSURE_ADVANCE EXTRUDER=extruder ADVANCE=0.025
G1 X55 Y55 E1.5
G1 X50 Y50
G1 X55 Y55 E2.0
G1 X50 Y50

View File

@@ -0,0 +1,70 @@
# Test config for arcs
[gcode_arcs]
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: ^PE5
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: ^PJ1
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 8
endstop_pin: ^PD3
position_endstop: 0.5
position_max: 200
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
microsteps: 16
rotation_distance: 33.5
nozzle_diameter: 0.500
filament_diameter: 3.500
heater_pin: PB4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 210
[heater_bed]
heater_pin: PH5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK6
control: watermark
min_temp: 0
max_temp: 110
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100

View File

@@ -0,0 +1,11 @@
# Tests for g-code G2/G3 arc commands
DICTIONARY atmega2560.dict
CONFIG gcode_arcs.cfg
# Home and move in arcs
G28
G1 X20 Y20 Z20
G2 X125 Y32 Z20 E1 I10.5 J10.5
# XY+Z arc move
G2 X20 Y20 Z10 E1 I10.5 J10.5

View File

@@ -0,0 +1,85 @@
# Test config for input_shaper
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: ^PE5
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: ^PJ1
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 8
endstop_pin: ^PD3
position_endstop: 0.5
position_max: 200
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
microsteps: 16
rotation_distance: 33.5
nozzle_diameter: 0.500
filament_diameter: 3.500
heater_pin: PB4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 210
[heater_bed]
heater_pin: PH5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK6
control: watermark
min_temp: 0
max_temp: 110
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[input_shaper]
shaper_type_x: mzv
shaper_freq_x: 33.2
shaper_type_x: ei
shaper_freq_x: 39.3
[adxl345]
cs_pin: PK7
axes_map: -x,-y,z
[mpu9250 my_mpu]
[resonance_tester]
probe_points: 20,20,20
accel_chip_x: adxl345
accel_chip_y: mpu9250 my_mpu

View File

@@ -0,0 +1,7 @@
# Test case for input_stepper
CONFIG input_shaper.cfg
DICTIONARY atmega2560.dict
# Simple command test
SET_INPUT_SHAPER SHAPER_FREQ_X=22.2 DAMPING_RATIO_X=.1 SHAPER_TYPE_X=zv
SET_INPUT_SHAPER SHAPER_FREQ_Y=33.3 DAMPING_RATIO_X=.11 SHAPER_TYPE_X=2hump_ei

44
test/klippy/led.cfg Normal file
View File

@@ -0,0 +1,44 @@
# Test case for LED config sections
[led lled]
red_pin: PA2
initial_RED: 0.2
[neopixel nled]
pin: PA3
chain_count: 4
initial_RED: 0.2
initial_GREEN: 0.3
initial_BLUE: 0.4
[dotstar dled]
data_pin: PA4
clock_pin: PA5
chain_count: 2
initial_RED: 0.2
initial_GREEN: 0.3
initial_BLUE: 0.4
[pca9533 p5led]
initial_RED: 0.1
initial_GREEN: 0.2
initial_BLUE: 0.3
[pca9632 p6led]
scl_pin: PB1
sda_pin: PB2
initial_RED: 0.4
initial_GREEN: 0.5
initial_BLUE: 0.6
[display_template dtest]
param_myvar: 1.2
text: { param_myvar }, { param_myvar / 2.0 }, 0.0, 2.0
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: none
max_velocity: 300
max_accel: 3000

58
test/klippy/led.test Normal file
View File

@@ -0,0 +1,58 @@
# Test case for LEDs
CONFIG led.cfg
DICTIONARY atmega2560.dict
# SET_LED tests
SET_LED LED=lled RED=0.2
SET_LED LED=lled RED=0.3 TRANSMIT=0
SET_LED LED=lled RED=0.4
SET_LED LED=lled RED=0.5 SYNC=0
SET_LED LED=nled RED=0.2
SET_LED LED=nled RED=0.3 TRANSMIT=0
SET_LED LED=nled RED=0.4
SET_LED LED=nled RED=0.5 SYNC=0
SET_LED LED=dled RED=0.2
SET_LED LED=dled RED=0.3 TRANSMIT=0
SET_LED LED=dled RED=0.4
SET_LED LED=dled RED=0.5 SYNC=0
SET_LED LED=p5led RED=0.2
SET_LED LED=p5led RED=0.3 TRANSMIT=0
SET_LED LED=p5led RED=0.4
SET_LED LED=p5led RED=0.5 SYNC=0
SET_LED LED=p6led RED=0.2
SET_LED LED=p6led RED=0.3 TRANSMIT=0
SET_LED LED=p6led RED=0.4
SET_LED LED=p6led RED=0.5 SYNC=0
# SET_LED chain tests
SET_LED LED=nled INDEX=2 RED=0.2
SET_LED LED=nled INDEX=1 RED=0.3 TRANSMIT=0
SET_LED LED=nled INDEX=2 RED=0.4
SET_LED LED=nled INDEX=1 RED=0.5 SYNC=0
SET_LED LED=dled INDEX=2 RED=0.2
SET_LED LED=dled INDEX=1 RED=0.3 TRANSMIT=0
SET_LED LED=dled INDEX=2 RED=0.4
SET_LED LED=dled INDEX=1 RED=0.5 SYNC=0
# SET_LED_TEMPLATE tests
SET_LED_TEMPLATE LED=lled TEMPLATE=dtest
SET_LED_TEMPLATE LED=lled TEMPLATE=
SET_LED_TEMPLATE LED=nled TEMPLATE=dtest
SET_LED_TEMPLATE LED=nled TEMPLATE=
SET_LED_TEMPLATE LED=nled INDEX=2 TEMPLATE=dtest
SET_LED_TEMPLATE LED=nled TEMPLATE=
SET_LED_TEMPLATE LED=dled TEMPLATE=dtest
SET_LED_TEMPLATE LED=dled TEMPLATE=
SET_LED_TEMPLATE LED=dled INDEX=2 TEMPLATE=dtest
SET_LED_TEMPLATE LED=dled TEMPLATE=
SET_LED_TEMPLATE LED=p5led TEMPLATE=dtest
SET_LED_TEMPLATE LED=p6led TEMPLATE=dtest

15
test/klippy/linuxtest.cfg Normal file
View File

@@ -0,0 +1,15 @@
# Test config for linux process specific hardware
[mcu]
serial: /tmp/klipper_host_mcu
[printer]
kinematics: none
max_velocity: 300
max_accel: 3000
[temperature_sensor my_ds18b20]
min_temp: 0
max_temp: 100
serial_no: 12345678
sensor_mcu: mcu
sensor_type: DS18B20

View File

@@ -0,0 +1,5 @@
# Tests for various temperature sensors
DICTIONARY linuxprocess.dict
CONFIG linuxtest.cfg
G4 P1000

132
test/klippy/macros.cfg Normal file
View File

@@ -0,0 +1,132 @@
# Test config with macros
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: ^PE5
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: ^PJ1
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 8
endstop_pin: ^PD3
position_endstop: 0.5
position_max: 200
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
microsteps: 16
rotation_distance: 33.5
nozzle_diameter: 0.500
filament_diameter: 3.500
heater_pin: PB4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 210
[heater_bed]
heater_pin: PH5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK6
control: watermark
min_temp: 0
max_temp: 110
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[gcode_macro TEST_SAVE_RESTORE]
gcode:
SAVE_GCODE_STATE NAME=TESTIT1
G92 Z10
RESTORE_GCODE_STATE NAME=TESTIT1
G92 Z0
[gcode_macro TEST_expression]
gcode:
{% if printer.gcode_move.gcode_position.x != 0.0 %}
M112
{% else %}
{ action_respond_info("TEST_expression") }
{% endif %}
[gcode_macro TEST_variable]
variable_t: 12.0
gcode:
{ action_respond_info("TEST_variable") }
{% if t - 12.0 != printer.toolhead.position.y %}
M112
{% endif %}
{% if printer["gcode_macro TEST_variable"].t - 12.0 != 0.0 %}
M112
{% endif %}
SET_GCODE_VARIABLE MACRO=TEST_variable VARIABLE=t VALUE=17
TEST_variable_part2
[gcode_macro TEST_variable_part2]
gcode:
{ action_respond_info("TEST_variable_part2") }
{% if printer["gcode_macro TEST_variable"].t != 17.0 %}
M112
{% endif %}
[gcode_macro TEST_param]
gcode:
{ action_respond_info("TEST_param") }
{% if params.T != "123" %}
M112
{% endif %}
[gcode_macro TEST_in]
gcode:
{% if "abc" in printer or "toolhead" not in printer %}
M112
{% endif %}
# A utf8 test (with utf8 characters such as ° )
[gcode_macro TEST_unicode] ; Also test end-of-line comments ( ° )
variable_ABC: 25 # Another end-of-line comment test ( ° )
description: A unicode test °
gcode: G28
# Main test start point
[gcode_macro TESTIT]
gcode:
TEST_SAVE_RESTORE
TEST_expression
TEST_variable
TEST_param T=123
TEST_unicode
TEST_in

6
test/klippy/macros.test Normal file
View File

@@ -0,0 +1,6 @@
# Tests for miscellaneous g-code commands
DICTIONARY atmega2560.dict
CONFIG macros.cfg
# Run TESTIT macro
TESTIT

View File

@@ -0,0 +1,25 @@
# Test config for manual_stepper
[manual_stepper basic_stepper]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
velocity: 7
accel: 500
[manual_stepper homing_stepper]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: ^PJ1
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: none
max_velocity: 300
max_accel: 3000

View File

@@ -0,0 +1,24 @@
# Test case for manual_stepper
CONFIG manual_stepper.cfg
DICTIONARY atmega2560.dict
# Test basic moves
MANUAL_STEPPER STEPPER=basic_stepper ENABLE=1
MANUAL_STEPPER STEPPER=basic_stepper SET_POSITION=0
MANUAL_STEPPER STEPPER=basic_stepper MOVE=10 SPEED=10
MANUAL_STEPPER STEPPER=basic_stepper MOVE=5
MANUAL_STEPPER STEPPER=basic_stepper MOVE=12 SPEED=12 ACCEL=9000.2
MANUAL_STEPPER STEPPER=basic_stepper ENABLE=0
# Test homing move
MANUAL_STEPPER STEPPER=homing_stepper ENABLE=1
MANUAL_STEPPER STEPPER=homing_stepper SET_POSITION=0
MANUAL_STEPPER STEPPER=homing_stepper MOVE=10 SPEED=100 ACCEL=1
MANUAL_STEPPER STEPPER=homing_stepper ENABLE=0
# Test motor off
M84
# Verify stepper_buzz
STEPPER_BUZZ STEPPER="manual_stepper basic_stepper"
STEPPER_BUZZ STEPPER="manual_stepper homing_stepper"

46
test/klippy/move.gcode Normal file
View File

@@ -0,0 +1,46 @@
; Simple movement tests
; Start by homing the printer.
G28
G90
G1 F6000
; Z / X / Y moves
G1 Z1
G1 X1
G1 Y1
; Delayed moves
G1 Y2
G4 P100
G1 Y1.5
M400
G1 Y1
; diagonal moves
G1 X0 Y0
G1 X1 Z2
G1 X0 Y1 Z1
; extrude only moves
G1 E1
G1 E0
; Verify GET_POSITION works
GET_POSITION
; regular extrude move
G1 X0 Y0 E.01
; fan speeds
M106 S50
M106
M106 S90
M106 S0
M107
; coordinate manipulation
G92 Y-3
G1 Y-2
G91
G1 Y-1

105
test/klippy/multi_z.cfg Normal file
View File

@@ -0,0 +1,105 @@
# Test config with multiple z steppers
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: ^PE5
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: ^PJ1
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 8
endstop_pin: ^PD3
position_endstop: 0.5
position_max: 200
[stepper_z1]
step_pin: PC1
dir_pin: PC3
enable_pin: !PC7
microsteps: 16
rotation_distance: 8
endstop_pin: ^PD2
[stepper_z2]
step_pin: PH1
dir_pin: PH0
enable_pin: !PA1
microsteps: 16
rotation_distance: 8
[z_tilt]
z_positions:
-56,-17
-56,322
311,322
points:
50,50
50,195
195,195
195,50
[bed_tilt]
points:
50,50
50,195
195,195
195,50
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
microsteps: 16
rotation_distance: 33.5
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PH5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK6
control: watermark
min_temp: 0
max_temp: 130
[probe]
pin: PH6
z_offset: 1.15
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100

60
test/klippy/multi_z.test Normal file
View File

@@ -0,0 +1,60 @@
# Test case with multiple z stepper motors
CONFIG multi_z.cfg
DICTIONARY atmega2560.dict
# Start by homing the printer.
G28
G1 F6000
# Z / X / Y moves
G1 Z1
G1 X1
G1 Y1
# Run bed_tilt_calibrate
BED_TILT_CALIBRATE
# Move again
G1 Z5 X0 Y0
# Run Z_TILT_ADJUST
Z_TILT_ADJUST
# Move again
G1 Z2 X2 Y3
# Do regular probe
PROBE
QUERY_PROBE
# Test manual probe commands
PROBE_CALIBRATE
ABORT
PROBE_CALIBRATE SPEED=7.3
TESTZ Z=-.2
TESTZ Z=-.3
TESTZ Z=+.1
TESTZ Z=++
TESTZ Z=--
TESTZ Z=+
TESTZ Z=-
ACCEPT
Z_ENDSTOP_CALIBRATE
TESTZ Z=-.1
TESTZ Z=+.2
ACCEPT
MANUAL_PROBE
TESTZ Z=--
ABORT
# Do regular probe
PROBE
QUERY_PROBE
# Verify stepper_buzz
STEPPER_BUZZ STEPPER=stepper_z
STEPPER_BUZZ STEPPER=stepper_z1
STEPPER_BUZZ STEPPER=stepper_z2
# Move again
G1 Z9

View File

@@ -0,0 +1,8 @@
# Test that basic bounds checks work
CONFIG ../../config/example-cartesian.cfg
DICTIONARY atmega2560.dict
SHOULD_FAIL
# Home the printer, and then attempt to move to an obviously bad location
G28
G1 Y9999

74
test/klippy/polar.test Normal file
View File

@@ -0,0 +1,74 @@
# Test case for basic movement on polar printers
CONFIG ../../config/example-polar.cfg
DICTIONARY atmega2560.dict
; Start by homing the printer.
G28
G90
G1 F6000
; Z / X / Y moves
G1 Z1
G1 X1
G1 Y1
; Delayed moves
G1 Y2
G4 P100
G1 Y1.5
M400
G1 Y1
; diagonal moves
G1 X10 Y0
G1 X1 Z2
G1 X0 Y1 Z1
; extrude only moves
G1 E1
G1 E0
; regular extrude move
G1 X10 Y0 E.01
; Multiple rotations
g1 X10 Y10
g1 X-10 Y10
g1 X-10 Y-10
g1 X10 Y-10
g1 X10 Y15
g1 X-10 Y15
g1 X-10 Y-15
g1 X10 Y-15
g1 X10 Y20
g1 X-10 Y20
g1 X-10 Y-20
g1 X10 Y-20
g1 X10 Y25
g1 X-10 Y25
g1 X-10 Y-25
g1 X10 Y-25
; Multiple rotations in reverse direction
g1 X-15 Y-25
g1 X-15 Y25
g1 X15 Y25
g1 X15 Y-25
g1 X-20 Y-25
g1 X-20 Y25
g1 X20 Y25
g1 X20 Y-25
g1 X-25 Y-25
g1 X-25 Y25
g1 X25 Y25
g1 X25 Y-25
g1 X-30 Y-25
g1 X-30 Y25
g1 X30 Y25
g1 X30 Y-25

232
test/klippy/printers.test Normal file
View File

@@ -0,0 +1,232 @@
# Basic sanity checks on the example printer config files
GCODE move.gcode
# Example kinematic files
DICTIONARY atmega2560.dict
CONFIG ../../config/example-cartesian.cfg
CONFIG ../../config/example-corexy.cfg
CONFIG ../../config/example-corexz.cfg
CONFIG ../../config/example-hybrid-corexy.cfg
CONFIG ../../config/example-hybrid-corexz.cfg
CONFIG ../../config/example-delta.cfg
CONFIG ../../config/example-rotary-delta.cfg
CONFIG ../../config/example-winch.cfg
# Printers using the atmega2560
DICTIONARY atmega2560.dict
CONFIG ../../config/generic-einsy-rambo.cfg
CONFIG ../../config/generic-fysetc-f6.cfg
CONFIG ../../config/generic-gt2560.cfg
CONFIG ../../config/generic-mini-rambo.cfg
CONFIG ../../config/generic-rambo.cfg
CONFIG ../../config/generic-ramps.cfg
CONFIG ../../config/generic-rumba.cfg
CONFIG ../../config/generic-ultimaker-ultimainboard-v2.cfg
CONFIG ../../config/kit-zav3d-2019.cfg
CONFIG ../../config/printer-adimlab-2018.cfg
CONFIG ../../config/printer-anycubic-4max-2018.cfg
CONFIG ../../config/printer-anycubic-4maxpro-2.0-2021.cfg
CONFIG ../../config/printer-anycubic-i3-mega-2017.cfg
CONFIG ../../config/printer-anycubic-kossel-2016.cfg
CONFIG ../../config/printer-anycubic-kossel-plus-2017.cfg
CONFIG ../../config/printer-creality-cr10-v3-2020.cfg
CONFIG ../../config/printer-creality-cr10s-2017.cfg
CONFIG ../../config/printer-creality-cr20-2018.cfg
CONFIG ../../config/printer-creality-cr20-pro-2019.cfg
CONFIG ../../config/printer-creality-ender5plus-2019.cfg
CONFIG ../../config/printer-eryone-thinker-series-v2-2020.cfg
CONFIG ../../config/printer-flashforge-creator-pro-2018.cfg
CONFIG ../../config/printer-hiprecy-leo-2019.cfg
CONFIG ../../config/printer-longer-lk4-pro-2019.cfg
CONFIG ../../config/printer-lulzbot-mini1-2016.cfg
CONFIG ../../config/printer-lulzbot-taz6-2017.cfg
CONFIG ../../config/printer-lulzbot-taz6-dual-v3-2017.cfg
CONFIG ../../config/printer-makergear-m2-2012.cfg
CONFIG ../../config/printer-makergear-m2-2016.cfg
CONFIG ../../config/printer-micromake-d1-2016.cfg
CONFIG ../../config/printer-mtw-create-2015.cfg
CONFIG ../../config/printer-robo3d-r2-2017.cfg
CONFIG ../../config/printer-seemecnc-rostock-max-v2-2015.cfg
CONFIG ../../config/printer-sovol-sv01-2020.cfg
CONFIG ../../config/printer-sunlu-s8-2020.cfg
CONFIG ../../config/printer-tevo-flash-2018.cfg
CONFIG ../../config/printer-tevo-tarantula-pro-2020.cfg
CONFIG ../../config/printer-velleman-k8200-2013.cfg
CONFIG ../../config/printer-velleman-k8800-2017.cfg
CONFIG ../../config/printer-wanhao-duplicator-i3-mini-2017.cfg
CONFIG ../../config/printer-wanhao-duplicator-i3-plus-2017.cfg
CONFIG ../../config/printer-wanhao-duplicator-i3-plus-mark2-2019.cfg
CONFIG ../../config/printer-wanhao-duplicator-6-2016.cfg
CONFIG ../../config/printer-wanhao-duplicator-9-2018.cfg
# Printers using the atmega1280
DICTIONARY atmega1280.dict
CONFIG ../../config/generic-mightyboard.cfg
CONFIG ../../config/generic-minitronics1.cfg
# Printers using the atmega1284p
DICTIONARY atmega1284p.dict
CONFIG ../../config/generic-melzi.cfg
CONFIG ../../config/printer-anet-a4-2018.cfg
CONFIG ../../config/printer-anet-a8-2017.cfg
CONFIG ../../config/printer-anet-e10-2018.cfg
CONFIG ../../config/printer-anet-e16-2019.cfg
CONFIG ../../config/printer-creality-cr10-2017.cfg
CONFIG ../../config/printer-creality-cr10mini-2017.cfg
CONFIG ../../config/printer-creality-ender2-2017.cfg
CONFIG ../../config/printer-creality-ender3-2018.cfg
CONFIG ../../config/printer-creality-ender5-2019.cfg
CONFIG ../../config/printer-tronxy-p802e-2020.cfg
CONFIG ../../config/printer-tronxy-p802m-2020.cfg
CONFIG ../../config/printer-tronxy-x5s-2018.cfg
CONFIG ../../config/printer-tronxy-x8-2018.cfg
CONFIG ../../config/printer-wanhao-duplicator-i3-v2.1-2017.cfg
# Printers using the atmega644
DICTIONARY atmega644p.dict
CONFIG ../../config/generic-simulavr.cfg
# Printers using the at90usb1286
DICTIONARY at90usb1286.dict
CONFIG ../../config/generic-printrboard.cfg
# Printers using the sam3x8c
DICTIONARY sam3x8c.dict
CONFIG ../../config/generic-printrboard-g2.cfg
# Printers using the sam3x8e
DICTIONARY sam3x8e.dict
CONFIG ../../config/generic-alligator-r2.cfg
CONFIG ../../config/generic-alligator-r3.cfg
CONFIG ../../config/generic-archim2.cfg
CONFIG ../../config/generic-radds.cfg
CONFIG ../../config/generic-ruramps-v1.3.cfg
# Printers using the sam4s8c
DICTIONARY sam4s8c.dict
CONFIG ../../config/generic-duet2-maestro.cfg
# Printers using the sam4e8e
DICTIONARY sam4e8e.dict
CONFIG ../../config/generic-duet2.cfg
CONFIG ../../config/generic-duet2-duex.cfg
CONFIG ../../config/printer-modix-big60-2020.cfg
# Printers using the samd51
DICTIONARY samd51p20.dict
CONFIG ../../config/generic-duet3-mini.cfg
# Printers using the lpc176x
DICTIONARY lpc176x.dict
CONFIG ../../config/generic-azteeg-x5-mini-v3.cfg
CONFIG ../../config/generic-bigtreetech-skr-e3-turbo.cfg
CONFIG ../../config/generic-bigtreetech-skr-v1.1.cfg
CONFIG ../../config/generic-bigtreetech-skr-v1.3.cfg
CONFIG ../../config/generic-bigtreetech-skr-v1.4.cfg
CONFIG ../../config/generic-mks-sgenl.cfg
CONFIG ../../config/generic-re-arm.cfg
CONFIG ../../config/generic-smoothieboard.cfg
CONFIG ../../config/generic-th3d-ezboard-lite-v1.2.cfg
# Printers using the stm32f070
DICTIONARY stm32f070.dict
CONFIG ../../config/printer-monoprice-mini-delta-2017.cfg
CONFIG ../../config/printer-monoprice-select-mini-v2-2018.cfg
# Printers using the stm32f103
DICTIONARY stm32f103.dict
CONFIG ../../config/generic-bigtreetech-skr-cr6-v1.0.cfg
CONFIG ../../config/generic-bigtreetech-skr-e3-dip.cfg
CONFIG ../../config/generic-bigtreetech-skr-mini.cfg
CONFIG ../../config/generic-bigtreetech-skr-mini-e3-v1.0.cfg
CONFIG ../../config/generic-bigtreetech-skr-mini-e3-v1.2.cfg
CONFIG ../../config/generic-bigtreetech-skr-mini-e3-v2.0.cfg
CONFIG ../../config/generic-bigtreetech-skr-mini-mz.cfg
CONFIG ../../config/printer-anycubic-vyper-2021.cfg
CONFIG ../../config/printer-monoprice-select-mini-v1-2016.cfg
# Printers using the stm32f103 via serial
DICTIONARY stm32f103-serial.dict
CONFIG ../../config/generic-creality-v4.2.7.cfg
CONFIG ../../config/generic-creality-v4.2.10.cfg
CONFIG ../../config/generic-fysetc-cheetah-v1.1.cfg
CONFIG ../../config/generic-fysetc-cheetah-v1.2.cfg
CONFIG ../../config/generic-mks-robin-e3.cfg
CONFIG ../../config/generic-mks-robin-nano-v1.cfg
CONFIG ../../config/generic-mks-robin-nano-v2.cfg
CONFIG ../../config/printer-alfawise-u30-2018.cfg
CONFIG ../../config/printer-creality-cr10-smart-pro-2022.cfg
CONFIG ../../config/printer-creality-cr30-2021.cfg
CONFIG ../../config/printer-creality-cr6se-2020.cfg
CONFIG ../../config/printer-creality-cr6se-2021.cfg
CONFIG ../../config/printer-creality-ender2pro-2021.cfg
CONFIG ../../config/printer-creality-ender3-s1-2021.cfg
CONFIG ../../config/printer-creality-ender3-v2-2020.cfg
CONFIG ../../config/printer-creality-ender3max-2021.cfg
CONFIG ../../config/printer-creality-ender3pro-2020.cfg
CONFIG ../../config/printer-creality-ender5pro-2020.cfg
CONFIG ../../config/printer-creality-ender6-2020.cfg
CONFIG ../../config/printer-creality-sermoonD1-2021.cfg
CONFIG ../../config/printer-creality-sermoonV1-2022.cfg
CONFIG ../../config/printer-elegoo-neptune2-2021.cfg
CONFIG ../../config/printer-eryone-er20-2021.cfg
CONFIG ../../config/printer-flsun-q5-2020.cfg
CONFIG ../../config/printer-flsun-qqs-2020.cfg
CONFIG ../../config/printer-fokoos-odin5-f3-2021.cfg
CONFIG ../../config/printer-tronxy-x5sa-v6-2019.cfg
CONFIG ../../config/printer-tronxy-x5sa-pro-2020.cfg
CONFIG ../../config/printer-tronxy-xy-2-Pro-2020.cfg
CONFIG ../../config/printer-twotrees-sapphire-plus-sp-5-v1-2020.cfg
CONFIG ../../config/printer-twotrees-sapphire-plus-sp-5-v1.1-2021.cfg
CONFIG ../../config/printer-twotrees-sapphire-pro-sp-3-2020.cfg
# Printers using the stm32f405
DICTIONARY stm32f405.dict
CONFIG ../../config/generic-mellow-fly-gemini-v1.cfg
CONFIG ../../config/generic-mellow-fly-gemini-v2.cfg
# Printers using the stm32f407
DICTIONARY stm32f407.dict
CONFIG ../../config/generic-bigtreetech-e3-rrf-v1.1.cfg
CONFIG ../../config/generic-bigtreetech-gtr.cfg
CONFIG ../../config/generic-bigtreetech-skr-pro.cfg
CONFIG ../../config/generic-bigtreetech-skr-2.cfg
CONFIG ../../config/generic-flyboard.cfg
CONFIG ../../config/generic-mellow-fly-cdy-v3.cfg
CONFIG ../../config/generic-mellow-super-infinty-hv.cfg
CONFIG ../../config/generic-mks-robin-nano-v3.cfg
CONFIG ../../config/generic-prusa-buddy.cfg
CONFIG ../../config/generic-th3d-ezboard-lite-v2.0.cfg
CONFIG ../../config/printer-biqu-b1-se-plus-2022.cfg
CONFIG ../../config/printer-prusa-mini-plus-2020.cfg
# Printers using the stm32f446
DICTIONARY stm32f446.dict
CONFIG ../../config/generic-bigtreetech-octopus.cfg
CONFIG ../../config/generic-fysetc-s6.cfg
CONFIG ../../config/generic-fysetc-s6-v2.cfg
CONFIG ../../config/generic-fysetc-spider.cfg
CONFIG ../../config/generic-mks-rumba32-v1.0.cfg
# Printers using the stm32h743
DICTIONARY stm32h743.dict
CONFIG ../../config/printer-biqu-bx-2021.cfg
# Printers using the stm32g0b1
DICTIONARY stm32g0b1.dict
CONFIG ../../config/generic-bigtreetech-skr-mini-e3-v3.0.cfg
# Printers using the rp2040
DICTIONARY rp2040.dict
CONFIG ../../config/generic-bigtreetech-skr-pico-v1.0.cfg
# Printers using the PRU
DICTIONARY pru.dict host=linuxprocess.dict
CONFIG ../../config/generic-cramps.cfg
CONFIG ../../config/generic-replicape.cfg
# Tests with multiple mcus
DICTIONARY atmega2560.dict zboard=atmega2560.dict auxboard=atmega2560.dict
CONFIG ../../config/sample-multi-mcu.cfg
DICTIONARY atmega2560.dict z=atmega2560.dict
CONFIG ../../config/kit-voron2-250mm.cfg

22
test/klippy/pwm.cfg Normal file
View File

@@ -0,0 +1,22 @@
[output_pin soft_pwm_pin]
pin: PH5
pwm: True
value: 0
shutdown_value: 0
cycle_time: 0.01
[output_pin hard_pwm_pin]
pin: PH6
pwm: True
hardware_pwm: True
value: 0
shutdown_value: 0
cycle_time: 0.01
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: none
max_velocity: 300
max_accel: 3000

30
test/klippy/pwm.test Normal file
View File

@@ -0,0 +1,30 @@
# Test case for pwm
CONFIG pwm.cfg
DICTIONARY atmega2560.dict
# Hard PWM
# Basic test
SET_PIN PIN=hard_pwm_pin VALUE=0
SET_PIN PIN=hard_pwm_pin VALUE=0.5
SET_PIN PIN=hard_pwm_pin VALUE=0.5
SET_PIN PIN=hard_pwm_pin VALUE=0.25
SET_PIN PIN=hard_pwm_pin VALUE=1
# Soft PWM
# Test basic on off
SET_PIN PIN=soft_pwm_pin VALUE=0
SET_PIN PIN=soft_pwm_pin VALUE=0.5
SET_PIN PIN=soft_pwm_pin VALUE=1
# Test cycle time
SET_PIN PIN=soft_pwm_pin VALUE=0 CYCLE_TIME=0.1
SET_PIN PIN=soft_pwm_pin VALUE=1 CYCLE_TIME=0.5
SET_PIN PIN=soft_pwm_pin VALUE=0.5 CYCLE_TIME=0.001
SET_PIN PIN=soft_pwm_pin VALUE=0.75 CYCLE_TIME=0.01
SET_PIN PIN=soft_pwm_pin VALUE=0.5 CYCLE_TIME=1
# Test duplicate values
SET_PIN PIN=soft_pwm_pin VALUE=0.5 CYCLE_TIME=0.5
SET_PIN PIN=soft_pwm_pin VALUE=0.5 CYCLE_TIME=0.5
SET_PIN PIN=soft_pwm_pin VALUE=0.75 CYCLE_TIME=0.5
SET_PIN PIN=soft_pwm_pin VALUE=0.75 CYCLE_TIME=0.75

View File

@@ -0,0 +1,28 @@
# Test case for z_tilt and quad_gantry_level
CONFIG z_tilt.cfg
DICTIONARY atmega2560.dict
# Start by homing the printer.
G28
G1 Z5 X10 Y10 F6000
M400
GET_POSITION
# Run QUAD_GANTRY_LEVEL in manual mode
QUAD_GANTRY_LEVEL METHOD=MANUAL
G1 Z2.909972
ACCEPT
G1 Z2.924972
ACCEPT
G1 Z2.959972
ACCEPT
G1 Z2.924972
ACCEPT
# Report position
G1 Z5 X10 Y10 F6000
M400
GET_POSITION
# Run again in automatic mode
QUAD_GANTRY_LEVEL

View File

@@ -0,0 +1,80 @@
# Test config for the DELTA_CALIBRATE command (on rotary delta robots)
[stepper_a]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
gear_ratio: 107.000:16, 60:16
endstop_pin: ^PE4
homing_speed: 50
#position_endstop: 252
upper_arm_length: 170.000
lower_arm_length: 320.000
[stepper_b]
step_pin: PF6
dir_pin: PF7
enable_pin: !PF2
microsteps: 16
gear_ratio: 107.000:16, 60:16
endstop_pin: ^PJ0
[stepper_c]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
microsteps: 16
gear_ratio: 107.000:16, 60:16
endstop_pin: ^PD2
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: rotary_delta
max_velocity: 300
max_accel: 3000
max_z_velocity: 50
#shoulder_radius: 33.900
#shoulder_height: 412.900
[delta_calibrate]
radius: 50
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [printer]
#*# shoulder_radius = 33.900000
#*# shoulder_height = 412.900000
#*#
#*# [stepper_a]
#*# angle = 30.000000
#*# lower_arm = 320.000011
#*# position_endstop = 251.999999
#*#
#*# [stepper_b]
#*# angle = 150.000000
#*# lower_arm = 320.000000
#*# position_endstop = 251.999973
#*#
#*# [stepper_c]
#*# angle = 270.000000
#*# lower_arm = 319.999985
#*# position_endstop = 251.999902
#*#
#*# [delta_calibrate]
#*# height0 = 0.0
#*# height0_pos = 162606.000,162606.000,162605.000
#*# height1 = 0.0
#*# height1_pos = 157814.000,157814.000,177775.000
#*# height2 = 0.0
#*# height2_pos = 170956.000,151002.000,170956.000
#*# height3 = 0.0
#*# height3_pos = 176042.000,158122.000,158122.000
#*# height4 = 0.0
#*# height4_pos = 168774.000,168774.000,153337.000
#*# height5 = 0.0
#*# height5_pos = 158477.000,174341.000,158477.000
#*# height6 = 0.0
#*# height6_pos = 152152.000,169841.000,169841.000

View File

@@ -0,0 +1,32 @@
# Test case for basic movement on delta printers
CONFIG rotary_delta_calibrate.cfg
DICTIONARY atmega2560.dict
# Start by homing the printer.
G28
# Run basic delta calibration (in manual mode)
DELTA_ANALYZE MANUAL_HEIGHT=252
DELTA_CALIBRATE METHOD=manual
G1 Z0.1
ACCEPT
G1 Z0.1
ACCEPT
G1 Z0.1
ACCEPT
G1 Z0.1
ACCEPT
G1 Z0.1
ACCEPT
G1 Z0.1
ACCEPT
G1 Z0.1
ACCEPT
# Run extended delta calibration
DELTA_ANALYZE CENTER_DISTS=74,74,74,74,74,74
DELTA_ANALYZE OUTER_DISTS=74,74,74,74,74,74
DELTA_ANALYZE CENTER_PILLAR_WIDTHS=9,9,9
DELTA_ANALYZE OUTER_PILLAR_WIDTHS=9,9,9,9,9,9
DELTA_ANALYZE SCALE=1
DELTA_ANALYZE CALIBRATE=extended

View File

@@ -0,0 +1,92 @@
# Test config for bed screws tool with bltouch
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: ^PE5
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: ^PJ1
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 8
endstop_pin: probe:z_virtual_endstop
position_max: 200
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
microsteps: 16
rotation_distance: 33.5
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PH5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK6
control: watermark
min_temp: 0
max_temp: 130
[bltouch]
sensor_pin: PC7
control_pin: PC5
z_offset: 1.15
samples: 3
sample_retract_dist: 2.
samples_result: median
[bed_mesh]
mesh_min: 10,10
mesh_max: 180,180
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[screws_tilt_adjust]
screw1: 10,30
screw1_name: front left screw
screw2: 155,30
screw2_name: front right screw
screw3: 155,190
screw3_name: rear right screw
screw4: 10,190
screw4_name: read left screw
horizontal_move_z: 10.
speed: 50.
screw_thread: CW-M3

View File

@@ -0,0 +1,8 @@
# Test case for bed screws tilt helper tool
CONFIG screws_tilt_adjust.cfg
DICTIONARY atmega2560.dict
# Simple script to test
G28
SCREWS_TILT_CALCULATE
SCREWS_TILT_CALCULATE MAX_DEVIATION=0.01

View File

@@ -0,0 +1,92 @@
# Test config for sdcard_loop
[virtual_sdcard]
path: test/klippy/sdcard_loop
[display_status]
# Override to support unlimited belt size
# (homing Z simply resets its virtual position to 0.0)
[homing_override]
axes: xyz
set_position_x: 0
set_position_y: 0
set_position_z: 0
gcode:
G92 X0 Y0 Z0
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: ^PE5
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: ^PJ1
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 8
endstop_pin: ^PD3
position_endstop: 0.5
position_max: 200000000
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
microsteps: 16
rotation_distance: 33.5
nozzle_diameter: 0.500
filament_diameter: 3.500
heater_pin: PB4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 210
[heater_bed]
heater_pin: PH5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK6
control: watermark
min_temp: 0
max_temp: 110
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[sdcard_loop]
[gcode_macro M808]
gcode:
{% if params.K is not defined and params.L is defined %}SDCARD_LOOP_BEGIN COUNT={params.L|int}{% endif %}
{% if params.K is not defined and params.L is not defined %}SDCARD_LOOP_END{% endif %}
{% if params.K is defined and params.L is not defined %}SDCARD_LOOP_DESIST{% endif %}

View File

@@ -0,0 +1,9 @@
; Virtual SD card unit tests
DICTIONARY atmega2560.dict
CONFIG sdcard_loop.cfg
G28
SDCARD_LOOP_DESIST
; Verify long-name functions
SDCARD_PRINT_FILE FILENAME=big.gcode

View File

@@ -0,0 +1,350 @@
; Large example, to test M808 looping with `partial_data`
M808 L20
; Looping
G92 E0
G91
G1 E1 ; This is line 0
G1 E1 ; This is line 1
G1 E1 ; This is line 2
G1 E1 ; This is line 3
G1 E1 ; This is line 4
G1 E1 ; This is line 5
G1 E1 ; This is line 6
G1 E1 ; This is line 7
G1 E1 ; This is line 8
G1 E1 ; This is line 9
G1 E1 ; This is line 10
G1 E1 ; This is line 11
G1 E1 ; This is line 12
G1 E1 ; This is line 13
G1 E1 ; This is line 14
G1 E1 ; This is line 15
G1 E1 ; This is line 16
G1 E1 ; This is line 17
G1 E1 ; This is line 18
G1 E1 ; This is line 19
G1 E1 ; This is line 20
G1 E1 ; This is line 21
G1 E1 ; This is line 22
G1 E1 ; This is line 23
G1 E1 ; This is line 24
G1 E1 ; This is line 25
G1 E1 ; This is line 26
G1 E1 ; This is line 27
G1 E1 ; This is line 28
G1 E1 ; This is line 29
G1 E1 ; This is line 30
G1 E1 ; This is line 31
G1 E1 ; This is line 32
G1 E1 ; This is line 33
G1 E1 ; This is line 34
G1 E1 ; This is line 35
G1 E1 ; This is line 36
G1 E1 ; This is line 37
G1 E1 ; This is line 38
G1 E1 ; This is line 39
G1 E1 ; This is line 40
G1 E1 ; This is line 41
G1 E1 ; This is line 42
G1 E1 ; This is line 43
G1 E1 ; This is line 44
G1 E1 ; This is line 45
G1 E1 ; This is line 46
G1 E1 ; This is line 47
G1 E1 ; This is line 48
G1 E1 ; This is line 49
G1 E1 ; This is line 50
G1 E1 ; This is line 51
G1 E1 ; This is line 52
G1 E1 ; This is line 53
G1 E1 ; This is line 54
G1 E1 ; This is line 55
G1 E1 ; This is line 56
G1 E1 ; This is line 57
G1 E1 ; This is line 58
G1 E1 ; This is line 59
G1 E1 ; This is line 60
G1 E1 ; This is line 61
G1 E1 ; This is line 62
G1 E1 ; This is line 63
G1 E1 ; This is line 64
G1 E1 ; This is line 65
G1 E1 ; This is line 66
G1 E1 ; This is line 67
G1 E1 ; This is line 68
G1 E1 ; This is line 69
G1 E1 ; This is line 70
G1 E1 ; This is line 71
G1 E1 ; This is line 72
G1 E1 ; This is line 73
G1 E1 ; This is line 74
G1 E1 ; This is line 75
G1 E1 ; This is line 76
G1 E1 ; This is line 77
G1 E1 ; This is line 78
G1 E1 ; This is line 79
G1 E1 ; This is line 80
G1 E1 ; This is line 81
G1 E1 ; This is line 82
G1 E1 ; This is line 83
G1 E1 ; This is line 84
G1 E1 ; This is line 85
G1 E1 ; This is line 86
G1 E1 ; This is line 87
G1 E1 ; This is line 88
G1 E1 ; This is line 89
G1 E1 ; This is line 90
G1 E1 ; This is line 91
G1 E1 ; This is line 92
G1 E1 ; This is line 93
G1 E1 ; This is line 94
G1 E1 ; This is line 95
G1 E1 ; This is line 96
G1 E1 ; This is line 97
G1 E1 ; This is line 98
G1 E1 ; This is line 99
G1 E1 ; This is line 100
G1 E1 ; This is line 101
G1 E1 ; This is line 102
G1 E1 ; This is line 103
G1 E1 ; This is line 104
G1 E1 ; This is line 105
G1 E1 ; This is line 106
G1 E1 ; This is line 107
G1 E1 ; This is line 108
G1 E1 ; This is line 109
G1 E1 ; This is line 110
G1 E1 ; This is line 111
G1 E1 ; This is line 112
G1 E1 ; This is line 113
G1 E1 ; This is line 114
G1 E1 ; This is line 115
G1 E1 ; This is line 116
G1 E1 ; This is line 117
G1 E1 ; This is line 118
G1 E1 ; This is line 119
G1 E1 ; This is line 120
G1 E1 ; This is line 121
G1 E1 ; This is line 122
G1 E1 ; This is line 123
G1 E1 ; This is line 124
G1 E1 ; This is line 125
G1 E1 ; This is line 126
G1 E1 ; This is line 127
G1 E1 ; This is line 128
G1 E1 ; This is line 129
G1 E1 ; This is line 130
G1 E1 ; This is line 131
G1 E1 ; This is line 132
G1 E1 ; This is line 133
G1 E1 ; This is line 134
G1 E1 ; This is line 135
G1 E1 ; This is line 136
G1 E1 ; This is line 137
G1 E1 ; This is line 138
G1 E1 ; This is line 139
G1 E1 ; This is line 140
G1 E1 ; This is line 141
G1 E1 ; This is line 142
G1 E1 ; This is line 143
G1 E1 ; This is line 144
G1 E1 ; This is line 145
G1 E1 ; This is line 146
G1 E1 ; This is line 147
G1 E1 ; This is line 148
G1 E1 ; This is line 149
G1 E1 ; This is line 150
G1 E1 ; This is line 151
G1 E1 ; This is line 152
G1 E1 ; This is line 153
G1 E1 ; This is line 154
G1 E1 ; This is line 155
G1 E1 ; This is line 156
G1 E1 ; This is line 157
G1 E1 ; This is line 158
G1 E1 ; This is line 159
G1 E1 ; This is line 160
G1 E1 ; This is line 161
G1 E1 ; This is line 162
G1 E1 ; This is line 163
G1 E1 ; This is line 164
G1 E1 ; This is line 165
G1 E1 ; This is line 166
G1 E1 ; This is line 167
G1 E1 ; This is line 168
G1 E1 ; This is line 169
G1 E1 ; This is line 170
G1 E1 ; This is line 171
G1 E1 ; This is line 172
G1 E1 ; This is line 173
G1 E1 ; This is line 174
G1 E1 ; This is line 175
G1 E1 ; This is line 176
G1 E1 ; This is line 177
G1 E1 ; This is line 178
G1 E1 ; This is line 179
G1 E1 ; This is line 180
G1 E1 ; This is line 181
G1 E1 ; This is line 182
G1 E1 ; This is line 183
G1 E1 ; This is line 184
G1 E1 ; This is line 185
G1 E1 ; This is line 186
G1 E1 ; This is line 187
G1 E1 ; This is line 188
G1 E1 ; This is line 189
G1 E1 ; This is line 190
G1 E1 ; This is line 191
G1 E1 ; This is line 192
G1 E1 ; This is line 193
G1 E1 ; This is line 194
G1 E1 ; This is line 195
G1 E1 ; This is line 196
G1 E1 ; This is line 197
G1 E1 ; This is line 198
G1 E1 ; This is line 199
G1 E1 ; This is line 200
G1 E1 ; This is line 201
G1 E1 ; This is line 202
G1 E1 ; This is line 203
G1 E1 ; This is line 204
G1 E1 ; This is line 205
G1 E1 ; This is line 206
G1 E1 ; This is line 207
G1 E1 ; This is line 208
G1 E1 ; This is line 209
G1 E1 ; This is line 210
G1 E1 ; This is line 211
G1 E1 ; This is line 212
G1 E1 ; This is line 213
G1 E1 ; This is line 214
G1 E1 ; This is line 215
G1 E1 ; This is line 216
G1 E1 ; This is line 217
G1 E1 ; This is line 218
G1 E1 ; This is line 219
G1 E1 ; This is line 220
G1 E1 ; This is line 221
G1 E1 ; This is line 222
G1 E1 ; This is line 223
G1 E1 ; This is line 224
G1 E1 ; This is line 225
G1 E1 ; This is line 226
G1 E1 ; This is line 227
G1 E1 ; This is line 228
G1 E1 ; This is line 229
G1 E1 ; This is line 230
G1 E1 ; This is line 231
G1 E1 ; This is line 232
G1 E1 ; This is line 233
G1 E1 ; This is line 234
G1 E1 ; This is line 235
G1 E1 ; This is line 236
G1 E1 ; This is line 237
G1 E1 ; This is line 238
G1 E1 ; This is line 239
G1 E1 ; This is line 240
G1 E1 ; This is line 241
G1 E1 ; This is line 242
G1 E1 ; This is line 243
G1 E1 ; This is line 244
G1 E1 ; This is line 245
G1 E1 ; This is line 246
G1 E1 ; This is line 247
G1 E1 ; This is line 248
G1 E1 ; This is line 249
G1 E1 ; This is line 250
G1 E1 ; This is line 251
G1 E1 ; This is line 252
G1 E1 ; This is line 253
G1 E1 ; This is line 254
G1 E1 ; This is line 255
G1 E1 ; This is line 256
G1 E1 ; This is line 257
G1 E1 ; This is line 258
G1 E1 ; This is line 259
G1 E1 ; This is line 260
G1 E1 ; This is line 261
G1 E1 ; This is line 262
G1 E1 ; This is line 263
G1 E1 ; This is line 264
G1 E1 ; This is line 265
G1 E1 ; This is line 266
G1 E1 ; This is line 267
G1 E1 ; This is line 268
G1 E1 ; This is line 269
G1 E1 ; This is line 270
G1 E1 ; This is line 271
G1 E1 ; This is line 272
G1 E1 ; This is line 273
G1 E1 ; This is line 274
G1 E1 ; This is line 275
G1 E1 ; This is line 276
G1 E1 ; This is line 277
G1 E1 ; This is line 278
G1 E1 ; This is line 279
G1 E1 ; This is line 280
G1 E1 ; This is line 281
G1 E1 ; This is line 282
G1 E1 ; This is line 283
G1 E1 ; This is line 284
G1 E1 ; This is line 285
G1 E1 ; This is line 286
G1 E1 ; This is line 287
G1 E1 ; This is line 288
G1 E1 ; This is line 289
G1 E1 ; This is line 290
G1 E1 ; This is line 291
G1 E1 ; This is line 292
G1 E1 ; This is line 293
G1 E1 ; This is line 294
G1 E1 ; This is line 295
G1 E1 ; This is line 296
G1 E1 ; This is line 297
G1 E1 ; This is line 298
G1 E1 ; This is line 299
G1 E1 ; This is line 300
G1 E1 ; This is line 301
G1 E1 ; This is line 302
G1 E1 ; This is line 303
G1 E1 ; This is line 304
G1 E1 ; This is line 305
G1 E1 ; This is line 306
G1 E1 ; This is line 307
G1 E1 ; This is line 308
G1 E1 ; This is line 309
G1 E1 ; This is line 310
G1 E1 ; This is line 311
G1 E1 ; This is line 312
G1 E1 ; This is line 313
G1 E1 ; This is line 314
G1 E1 ; This is line 315
G1 E1 ; This is line 316
G1 E1 ; This is line 317
G1 E1 ; This is line 318
G1 E1 ; This is line 319
G1 E1 ; This is line 320
G1 E1 ; This is line 321
G1 E1 ; This is line 322
G1 E1 ; This is line 323
G1 E1 ; This is line 324
G1 E1 ; This is line 325
G1 E1 ; This is line 326
G1 E1 ; This is line 327
G1 E1 ; This is line 328
G1 E1 ; This is line 329
G1 E1 ; This one breaks
G90
M808
G1 E330 ; Should pass
SDCARD_LOOP_BEGIN COUNT=5
; Sub-loop
G1 X100 Y100
G91
M808 L3
; Inner-loop
G1 Z1
M808
G90
SDCARD_LOOP_END
; Done

151
test/klippy/temperature.cfg Normal file
View File

@@ -0,0 +1,151 @@
# Test config with many different types of temperature sensors
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: ^PE5
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: ^PJ1
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 8
endstop_pin: ^PD3
position_endstop: 0.5
position_max: 200
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
microsteps: 16
rotation_distance: 33.5
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB4
sensor_type: AD595
sensor_pin: PK5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PH5
sensor_type: PT100 INA826
sensor_pin: PK6
control: watermark
min_temp: 0
max_temp: 130
[temperature_fan test_max6675]
pin: PH6
min_temp: 0
max_temp: 100
control: watermark
sensor_type: MAX6675
sensor_pin: PE4
[temperature_fan test_max31855]
pin: PG5
min_temp: 0
max_temp: 100
control: watermark
sensor_type: MAX31855
sensor_pin: PE3
[temperature_fan test_max31856]
pin: PH3
min_temp: 0
max_temp: 100
control: watermark
sensor_type: MAX31856
sensor_pin: PH4
[temperature_fan test_max31865]
pin: PB6
min_temp: 0
max_temp: 100
control: watermark
sensor_type: MAX31865
sensor_pin: PB7
[thermistor my_custom_thermistor]
temperature1: 25
resistance1: 100000
temperature2: 100
resistance2: 1500
temperature3: 250
resistance3: 100
[temperature_fan test_custom_thermistor]
pin: PJ0
min_temp: 0
max_temp: 100
control: watermark
sensor_type: my_custom_thermistor
sensor_pin: PF3
[adc_temperature my_custom_adc]
temperature1: 25
voltage1: 1
temperature2: 100
voltage2: 2
temperature3: 250
voltage3: 3
[temperature_fan test_custom_adc]
pin: PH1
min_temp: 0
max_temp: 100
control: watermark
sensor_type: my_custom_adc
sensor_pin: PF4
[adc_temperature my_custom_resistance_adc]
temperature1: 25
resistance1: 1000
temperature2: 100
resistance2: 2000
temperature3: 250
resistance3: 3000
[temperature_sensor test_custom_resistance_adc]
sensor_type: my_custom_resistance_adc
sensor_pin: PF5
[temperature_sensor test_PT1000]
sensor_type: PT1000
sensor_pin: PK1
[controller_fan test_controller_fan]
pin: PH0
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100

View File

@@ -0,0 +1,17 @@
# Tests for various temperature sensors
DICTIONARY atmega2560.dict
CONFIG temperature.cfg
# Set various temperatures
M104 S100
M105
M140 S60
M105
M140 S0
# Test "wait for temp" g-code
M109 S100
M109 S60
M105

97
test/klippy/tmc.cfg Normal file
View File

@@ -0,0 +1,97 @@
# Test config for tmc drivers
[stepper_x]
step_pin: PC0
dir_pin: PL0
enable_pin: !PA7
microsteps: 16
rotation_distance: 40
endstop_pin: tmc2130_stepper_x:virtual_endstop
position_endstop: 0
position_max: 250
[tmc2130 stepper_x]
cs_pin: PG0
run_current: .5
sense_resistor: 0.220
diag1_pin: !PK2
[stepper_x1]
step_pin: PC3
dir_pin: PL6
microsteps: 16
rotation_distance: 40
endstop_pin: ^PB6
[tmc2130 stepper_x1]
cs_pin: PG1
run_current: .5
sense_resistor: 0.220
diag1_pin: !PK2
[stepper_y]
step_pin: PC1
dir_pin: !PL1
microsteps: 16
rotation_distance: 40
endstop_pin: tmc5160_stepper_y:virtual_endstop
position_endstop: 0
position_max: 210
[tmc5160 stepper_y]
cs_pin: PG2
run_current: .5
sense_resistor: 0.220
diag1_pin: !PK7
[stepper_y1]
step_pin: PA4
dir_pin: PA6
microsteps: 16
rotation_distance: 40
endstop_pin: tmc2209_stepper_y1:virtual_endstop
[tmc2209 stepper_y1]
uart_pin: PA5
diag_pin: PH6
run_current: .5
sense_resistor: 0.075
[stepper_z]
step_pin: PC2
dir_pin: PL2
microsteps: 16
rotation_distance: 8
endstop_pin: ^PB4
position_endstop: 0.5
position_max: 200
[tmc2208 stepper_z]
uart_pin: PK5
run_current: .5
sense_resistor: 0.220
[stepper_z1]
step_pin: PB5
dir_pin: PK6
enable_pin: !PH5
microsteps: 16
rotation_distance: 8
endstop_pin: ^PH3
[tmc2660 stepper_z1]
cs_pin: PK1
run_current: .5
sense_resistor: 0.220
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[endstop_phase]

45
test/klippy/tmc.test Normal file
View File

@@ -0,0 +1,45 @@
# Tests for the tmc drivers
CONFIG tmc.cfg
DICTIONARY atmega2560.dict
; Start by homing the printer.
G28
G90
G1 F6000
; Z / X / Y moves
G1 Z1
G1 X1
G1 Y1
; Test DUMP_TMC commands
DUMP_TMC STEPPER=stepper_x
DUMP_TMC STEPPER=stepper_x1
DUMP_TMC STEPPER=stepper_y
DUMP_TMC STEPPER=stepper_y1
DUMP_TMC STEPPER=stepper_z
DUMP_TMC STEPPER=stepper_z1
; Test INIT_TMC commands
INIT_TMC STEPPER=stepper_x
INIT_TMC STEPPER=stepper_x1
INIT_TMC STEPPER=stepper_y
INIT_TMC STEPPER=stepper_y1
INIT_TMC STEPPER=stepper_z
INIT_TMC STEPPER=stepper_z1
; Test SET_TMC_CURRENT commands
SET_TMC_CURRENT STEPPER=stepper_x CURRENT=.7
SET_TMC_CURRENT STEPPER=stepper_x1 CURRENT=.7
SET_TMC_CURRENT STEPPER=stepper_y CURRENT=.7
SET_TMC_CURRENT STEPPER=stepper_y1 CURRENT=.7
SET_TMC_CURRENT STEPPER=stepper_z CURRENT=.7
SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT=.7
; Test SET_TMC_FIELD commands
SET_TMC_FIELD STEPPER=stepper_x FIELD=intpol VALUE=0
SET_TMC_FIELD STEPPER=stepper_x1 FIELD=intpol VALUE=0
SET_TMC_FIELD STEPPER=stepper_y FIELD=intpol VALUE=0
SET_TMC_FIELD STEPPER=stepper_y1 FIELD=intpol VALUE=0
SET_TMC_FIELD STEPPER=stepper_z FIELD=intpol VALUE=0
SET_TMC_FIELD STEPPER=stepper_z1 FIELD=intpol VALUE=0

122
test/klippy/z_tilt.cfg Normal file
View File

@@ -0,0 +1,122 @@
# Test config for z_tilt and quad_gantry_level
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: ^PE5
position_endstop: 0
position_max: 250
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: ^PJ1
position_endstop: 0
position_max: 250
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 8
endstop_pin: ^PD3
position_endstop: 0.5
position_max: 250
[stepper_z1]
step_pin: PC1
dir_pin: PC3
enable_pin: !PC7
microsteps: 16
rotation_distance: 8
endstop_pin: ^PD2
[stepper_z2]
step_pin: PH1
dir_pin: PH0
enable_pin: !PA1
microsteps: 16
rotation_distance: 8
[stepper_z3]
step_pin: PE3
dir_pin: PG5
microsteps: 16
rotation_distance: 8
[quad_gantry_level]
gantry_corners:
-55,-7
305, 320
points:
25,0
25,200
225,200
225,0
[z_tilt]
z_positions:
-55,-7
-55,320
305,-7
305,320
points:
50,50
50,195
195,195
195,50
[bed_tilt]
points:
50,50
50,195
195,195
195,50
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
microsteps: 16
rotation_distance: 33.5
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PH5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK6
control: watermark
min_temp: 0
max_temp: 130
[probe]
pin: PH6
z_offset: 1.15
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100

28
test/klippy/z_tilt.test Normal file
View File

@@ -0,0 +1,28 @@
# Test case for z_tilt and quad_gantry_level
CONFIG z_tilt.cfg
DICTIONARY atmega2560.dict
# Start by homing the printer.
G28
G1 Z5 X10 Y10 F6000
M400
GET_POSITION
# Run Z_TILT_ADJUST in manual mode
Z_TILT_ADJUST METHOD=MANUAL
G1 Z2.909972
ACCEPT
G1 Z2.924972
ACCEPT
G1 Z2.959972
ACCEPT
G1 Z2.924972
ACCEPT
# Report position
G1 Z5 X10 Y10 F6000
M400
GET_POSITION
# Run again in automatic mode
Z_TILT_ADJUST

View File

@@ -0,0 +1,75 @@
# Test config for probe:z_virtual_endstop
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: ^PE5
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: !PF7
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: ^PJ1
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: PL1
enable_pin: !PK0
microsteps: 16
rotation_distance: 8
endstop_pin: probe:z_virtual_endstop
position_max: 200
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
microsteps: 16
rotation_distance: 33.5
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PH5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK6
control: watermark
min_temp: 0
max_temp: 130
[probe]
pin: PH6
z_offset: 1.15
[bed_mesh]
mesh_min: 10,10
mesh_max: 180,180
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100

View File

@@ -0,0 +1,38 @@
# Test case for probe:z_virtual_endstop support
CONFIG z_virtual_endstop.cfg
DICTIONARY atmega2560.dict
# Start by homing the printer.
G28
G1 F6000
# Z / X / Y moves
G1 Z1
G1 X1
G1 Y1
# Run bed_mesh_calibrate
BED_MESH_CALIBRATE
# Move again
G1 Z5 X0 Y0
# Do regular probe
PROBE
QUERY_PROBE
# Test PROBE_CALIBRATE
PROBE_CALIBRATE
ABORT
PROBE_CALIBRATE SPEED=7.3
TESTZ Z=-.2
TESTZ Z=-.3
TESTZ Z=+.1
TESTZ Z=++
TESTZ Z=--
TESTZ Z=+
TESTZ Z=-
ACCEPT
# Move again
G1 Z9