Skip to content

Collision sensing

Mark edited this page Feb 21, 2025 · 70 revisions

Collision sensing for klipper (Touch probe)

Note

This feature requires the BDsensor firmware version(you can sending M102 S-1 to get that version,not the hardware version on the sensor) is V1.1b , > V1.2b or purchased after March 2024 , else you need to flash the firmware into BDsensor with external hardware tool like STlink.

Don't heat up the nozzle too high while homing with soft PEI like Whambam that maybe leave a hole on that PEI with high temperature.

How does it work

  • If the nozzle or bed is stopped by the collision, the distance data measured by bd sensor will also be stop changing, then the bd sensor will output a stop signal quickly.

  • the process of auto z_offset calibration when do G28: It can be triggered after the nozzle touch the bed while homing--->then move slowly up until the nozzle just leave the bed--->setting this position as the 0 position of z axis.

Benefit:

  • Auto z_offset calibration.

    meanwhile you still can manually adjust the z_offset for different fialment.

  • Overcome the temperature drift.

    The temperature drift will change the z_offset, but it does not change the range of bed_mesh heightmap with BDsensor. that means the bed mesh is the same even with different temperature.

How to activate

  1. Add collision_homing, collision_calibrate into section [BDsensor] and recommend to set the z_offset:0 to 0.
[BDsensor] 
...
collision_homing:0 #  set it 1 to enable homing with nozzle collision sensing. disable it by setting 0.
collision_calibrate:0 # set it 1 to enable auto calibrate BDsensor with nozzle collision sensing. disable it by setting 0.
# that means we do not need to manual move the nozzle on the bed and do paper test before sending calibrate command M102 S-6.
z_offset:0
...
  1. The sensitivity depends on the speed, the slower speed the higher sensitivity, so you need to adjust the speed of Z axis, the homing_speed and second_homing_speed should be in the range of 2 ~ 5.

Note

the nozzle should be cleared or heated up to soft the filament residues.

Please don't set the speed too high or too slow. if the speed is too high that maybe damage your hotend or bed, or too slow that will be triggered in the air where the nozzle actually doesn't touch the bed.

for example.

[stepper_z]
....
endstop_pin: probe:z_virtual_endstop
#position_endstop: 0.0
position_max: 250
homing_speed: 5
second_homing_speed:3
homing_retract_dist:5
homing_retract_speed:2

Tip

3. The z_hop and homing_retract_dist should be >=5

[safe_z_home]
z_hop: 5 

[stepper_z]
homing_retract_dist:5
[BDsensor] 
...
speed:3 # this speed only works for the z tilt and PROBE_ACCURACY command.
...

Important

Use zero_reference_position

[bed_mesh]
horizontal_move_z:1 # 0.7~1.0mm is recommended
zero_reference_position: 150, 160 # Set this value to be the same as home_xy_position that is in the section safe_z_home
....

Test homing

Please send G28 Z about 10 times, and then see if the output data on the console are stable after each G28 Z . https://www.pandapi3d.com/post/nozzle-collision-sensing-with-bdsensor

Video: How to start contact probe

Clone this wiki locally