How do I use [Probe] with a fixed gantry and a moving bed, probing moves in the wrong direction!

Basic Information:

Printer Model: Dremel 3D45
MCU / Printerboard: Duet 3 Mini 5+
Host / SBC Raspberry Pi 4
klippy.log klippy(30).log (3.2 MB)

Fill out above information and in all cases attach your klippy.log file (use zip to compress it, if too big). Pasting your printer.cfg is not needed
Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there

Describe your issue:

The printer uses a fixed gantry, which can move the print head on the x and y-axis with a bed, which can be raised or lowered on the z-axis via a threaded screw. The probe is a micro-switch attached to the print head, which can be raised or lowered via a servo, which keeps it out of the way during printing. I am trying to set up the probe and screws_tilt_adjust commands. However, the probing operation is lowering the bed, rather than raising the bed towards the microswitch - It is moving in the wrong direction.
After completing, the probe operation (if I press the microswitch with my finger), the sample_retract operation commences, but this is moving the bed in the wrong direction as well. It is raising the bed, towards the micro-switch, rather than lowering it away. I have tried making the sample retract distance or the lift speed to negative, to correct the movement direction, but klipper won’t accept negative values. How do I resolve this issue?

The intended homing procedure and screws_tilt-adjust is as follows:
#1 The bed, x and y axis are homed, using sensor-less homing. The bed is moved to its lowest position using sensorless homing. (working)
#2 The screws_tilt_adjust command is run, and the bed is raised to 170mm, close to the print head. (working)
#3 The microswitch is lowered into position using the servo. (working)
#4 The bed is raised until the microswitch is pressed. (not working, the bed moves in the opposite direction)
#5 After the microswitch is pressed by the bed, the bed is retracted 5mm, downwards. Ready to take another reading from the microswitch (not working, the bed retracts upwards!)
#6 The bed is raised again, as per #4. (not working as #4)
#7 An average reading is taken, ready to move onto the next position. (not made it this far)

Don’t know, if I get your problem right!

The logic is inverted?

My first idea was

sample_retract_dist = "negative value"

but your klippy.log shows

configparser.Error: Option 'sample_retract_dist' in section 'probe' must be above 0.0

So “sample_retract_dist” can’t be negative!

I have no other idea, sorry!

Good luck, hcet14

Your configuration seems strange:

[stepper_z]
step_pin = PC24
dir_pin = !PB28
enable_pin = !PC28
microsteps = 64
rotation_distance = 8
homing_speed = 18
endstop_pin = tmc2209_stepper_z:virtual_endstop
homing_retract_dist = 0
position_endstop = 0
position_max = 179
  • position_endstop is not a valid setting when using a virtual_endstop
  • tmc2209_stepper_z:virtual_endstop seems like sensorless homing for the z-axis but does not involve a probe. Here the correct setting would be endstop_pin: probe:z_virtual_endstop
  • You have not set a position_min for this axis
1 Like

Hey, after searching through the configuration reference, I found the solution, by changing/adding the following values:

[stepper_z]
dir_pin: PB28
homing_positive_dir: True
position_endstop: 179

[probe]
horizontal_move_z: 10
  • The direction pin of the stepper had to be reversed, by removing the “!” prefix.
  • The position_endstop was necessary, and had to be set to the maximum extent of the rail.
  • Homing_positive_dir was added and set to true, so that the polarity of the axis was reversed.
  • Because the polarity of the axis was reversed, I had to change the values of horizontal_move as appropriate.

Thank you for your help!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.