XY Motion System | Motion Test

A DIY tool changing 3D printer

With the CroXY motion system assembled and the Duet 2 WiFi flashed with klipper its time for some moves!

Test Setup

First lets look at the test setup. I have my XY Motion System clamped to the test bench along with an emergency stop (at the back.. yeah not smart really).

I want to run the heaters, logics and so on at 24V but plan to run the XY and potentially Z motors at 48V. Currently all I have is the 24V supply. So for this test we will only run the motors at 24V.

The duet is connected to the 4 motors and endstops. I have also connected a 24V fan to an always on fan port on the duet. This fan blows over the Duet (mainly the drivers) as soon as the 24V supply is turned on.

The Pi is connected to ethernet and powered by an external 5V supply and then powers the duet when the 24V is turned off. This allows me to work on the config without having the 24V system online.

Wiring is crude, but it works 😉

XY Motin system test setup.
XY Motin system test setup - Duet closeup..

I ran into a small issue with the design. Aparently the endstops lightbeam was not where I expected it to be. I had to slightly bend all the set screws to get them to activate the endstops. This is obviously not great so I have to fix that.

Deformed set screw.

Preperations

Klipper configuration

We wired everything up, then we have to configure klipper to run a 4 motor CroXY.

First thing is to figure out what all the pins on the duet does. This is a generic config file for the Duet 2 WiFI board. It contains all the commonly used pins. Be aware that you must remove the folloing two lines if you do not use the Duex Expansion board or klipper will repport an error:

				
					[mcu]
serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00
				
			

Klipper insists on having certain things defined before you can run anything. The things that must be defined are:

  • At least 1 X, Y, and Z motor
  • At least 1 extruder
  • At least 1 heat bed
 
This is how my 5 steppers are configured. The Z one is currently not connected to anything but it has to be deifned and I will later use it to test the Z-axis mechanism. There is also a 6th stepper for the extruder as it has to be defined for klipper to work. I just used some of the pins fond on a Duex5.
				
					#This config contains all the stepper drivers and their configurations.
[stepper_x]
step_pin: PD4#E1 Motor plug on Duet 2 WiFI
dir_pin: PD9#E1 Motor plug on Duet 2 WiFI
enable_pin: !PC6
rotation_distance: 40 #20 teeth pulley and 2 mm pitch belt: 20*2 = 40 mm/rotation
microsteps: 16
full_steps_per_rotation: 200 #1.8 deg stepper
gear_ratio: 1:1 #No Gearing
endstop_pin: ^PC16#E1 Motor
position_endstop: 0
position_min: 0
position_max: 415#416 Theoretic max
homing_speed: 200
homing_retract_dist: 3.0
homing_retract_speed: 50
second_homing_speed: 2

[stepper_x1]
step_pin: PD5#E0 Motor plug on Duet 2 WiFI
dir_pin: !PA1#E0 Motor plug on Duet 2 WiFI
enable_pin: !PC6
rotation_distance: 40 #20 teeth pulley and 2 mm pitch belt: 20*2 = 40 mm/rotation
microsteps: 16
full_steps_per_rotation: 200 #1.8 deg stepper
gear_ratio: 1:1 #No Gearing
endstop_pin: ^PD10#E0 Motor

[stepper_y]
step_pin: PD6#X Motor plug on Duet 2 WiFI
dir_pin: !PD11#X Motor plug on Duet 2 WiFI
enable_pin: !PC6
rotation_distance: 40 #20 teeth pulley and 2 mm pitch belt: 20*2 = 40 mm/rotation
microsteps: 16
full_steps_per_rotation: 200 #1.8 deg stepper
gear_ratio: 1:1 #No Gearing
endstop_pin: ^PC14#X Motor
position_endstop: 363
position_min: 0
position_max: 363#364 Theoretic max
homing_speed: 200
homing_retract_dist: 3.0
homing_retract_speed: 50
second_homing_speed: 2

[stepper_y1]
step_pin: PD7#Y Motor plug on Duet 2 WiFI
dir_pin: PD12#Y Motor plug on Duet 2 WiFI
enable_pin: !PC6
rotation_distance: 40 #20 teeth pulley and 2 mm pitch belt: 20*2 = 40 mm/rotation
microsteps: 16
full_steps_per_rotation: 200 #1.8 deg stepper
gear_ratio: 1:1 #No Gearing
endstop_pin: ^PA2#Y Motor

[stepper_z]
step_pin: PD8#Z Motor plug on Duet 2 WiFI
dir_pin: PD13#Z Motor plug on Duet 2 WiFI
enable_pin: !PC6
rotation_distance: 40 #20 teeth pulley and 2 mm pitch belt: 20*2 = 40 mm/rotation
microsteps: 16
full_steps_per_rotation: 400 #0.9 deg stepper
gear_ratio: 40:20 #20 teeth drive gear on motor and 40 teeth driven gear on Z-axis
endstop_pin: ^PD29#Z Motor
position_endstop: 100
position_min: 0
position_max: 100#
homing_speed: 40
homing_retract_dist: 5.0
homing_retract_speed: 40
second_homing_speed: 5


#!!!
[extruder]
step_pin: PD2#E2 Motor - Duex5 board
dir_pin: PD28#E2 Motor - Duex5 board
enable_pin: !PC6
rotation_distance: 53.64 #Drive wheel Ø=18mm. Rotation distance = O=D*PI = 56.2  -  61.2#!!!!!!!!!!!!!
microsteps: 16
full_steps_per_rotation: 200 #1.8 deg stepper
gear_ratio: 44:10, 37:17 #The LGX Lite Gear Set is a 10 teeth drive gear and a 37 teeth driven gear followed by a 14 teeth driving gear and a 44 teeth driven gear#!!!!!!!!!!!!!




########################################
# TMC UART configuration
########################################

[tmc2660 stepper_x]
cs_pin: PC25#E1 Motor
spi_bus: usart1
sense_resistor: 0.051
run_current: 1 #Duet 2 WiFi can deliver 2.5A MAX Peak = 2.5*0.707=1.76A RMS - LDO-42STH48-2504AH can handle 2.5A Max Peak = 2.5*0.707=1.76A RMS  -  0.95 is minimum to handle 1000mm/s @20kacc.

[tmc2660 stepper_x1]
cs_pin: PC17#E0 Motor
spi_bus: usart1
sense_resistor: 0.051
run_current: 1 #0.6

[tmc2660 stepper_y]
cs_pin: PD14#X Motor
spi_bus: usart1
sense_resistor: 0.051
run_current: 1 #0.6

[tmc2660 stepper_y1]
cs_pin: PC9#Y Motor
spi_bus: usart1
sense_resistor: 0.051
run_current: 1 #0.6

[tmc2660 stepper_z]
cs_pin: PC10#Z Motor
spi_bus: usart1
sense_resistor: 0.051
run_current: 0.5 #0.6

[tmc2660 extruder]
cs_pin: PD23#E2 Motor - Duex5 board
spi_bus: usart1
sense_resistor: 0.051
run_current: 0.65 #rated current of LDO-36STH20-1004AHG is 1A. 1A*0,707(RMS) = 0.707. * 80% = 0,56
				
			

Now, when you define a heater for your extruder and bed you will get errors when no heater is connected. To get around this for both heaters (ONLY FOR TESTING WITHOUT HEATERS) you can write this at both heaters in your config file to tell Klipper to ignore these heaters.

				
					min_temp=-273.15 #ONLY for testing without heaters connected
max_temp=99999999 #ONLY for testing without heaters connected
				
			

Speed Test Macro

With Klipper all setup and ready, its time to create a Macro to run a test G-Code. This is nice so I won’t have to keep typing in the moves.

The Speed test macro is very simple. It does som G1 moves back and forth at 120.000mm/min (2000mm/s) in first X, then Y, then diagonally, then some short moves in X, then in Y, and finally homes X and Y.

				
					[gcode_macro Speed_Test]
description: Printer moves aroudn to test differnet speed and acc. settings
gcode:
    G1 X415 Y363 F120000
    G1 X0 Y363 F120000
    G1 X415 Y363 F120000
    G1 X0 Y363 F120000

    G1 X0 Y0 F120000
    G1 X0 Y363 F120000
    G1 X0 Y0 F120000
    G1 X0 Y363 F120000

    G1 X415 Y0 F120000
    G1 X0 Y363 F120000
    G1 X415 Y0 F120000
    G1 X0 Y363 F120000


    G1 X205 Y180 F120000
    G1 X190 Y180 F120000
    G1 X205 Y180 F120000
    G1 X190 Y180 F120000
    G1 X205 Y180 F120000
    G1 X190 Y180 F120000
    G1 X205 Y180 F120000
    G1 X190 Y180 F120000

    G1 X190 Y165 F120000
    G1 X190 Y180 F120000
    G1 X190 Y165 F120000
    G1 X190 Y180 F120000
    G1 X190 Y165 F120000
    G1 X190 Y180 F120000
    G1 X190 Y165 F120000
    G1 X190 Y180 F120000


    G1 X10 Y350 F120000
    G28 X
    G28 Y
				
			

By adjusting the maximum speed the printer is allowed to move through the web interface (Gotta <3 Mainsail+Klipper), I can slowly increase the speed from my starting point up to 2000 (what the macro calls for). The “Speed Test” button activates the macro.

Screen snippet from the Mainsail web interface

Expected result

Given that we only run 24V and that there is no toolhead (we only have to move the gantry weight) I updated the motor simulation to see how close it is to reality. This should be what we can expect on 24V, 458g (heaviest gantry) – Only half the mass will be used in the simulation (two motors), 10k acc.

Expected motor performance in test setup.

The white horizontal line represents the torque required by one motor to accelerate half the gantry weight at 10k acc.

The orange line represents the available torque at 1A drive current and 24V.
Changing drive current will move the horizontal part at the top of the orange line up or down. Looking at this I do not think I would even need 0.5A to reach 1000mm/s at 10k acc. with the final setup. Which is great. That means the motors may actually survive in the chamber.
The start of the slope is based on the voltage. So at 24V the torque drops off at 420mm/s. At 48V it would be 840 mm/s.

Based on this analysis I would be verry happy if I can do 800mm/s on the test setup.

Lets Move

Without futher ado, lets move!

The video show the “Speed Test” macro at the final result of 1000 mm/s at 20k accelerations.

Soo.. for some reason it can move way faster than the simulation says… Awesome! 

I have no clue why. I guess Eddie The Engineer made the simulation rather conservative.

Aynyways, lets not dwell on this. Time to move onto the Z-Axis!

Read more about

A DIY tool changing 3D Printer

Subscribe
Notify of

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments