Welcome! Log In Create A New Profile

Advanced

Bltouch and z axis issues

Posted by slf495 
Bltouch and z axis issues
August 20, 2020 07:09PM
I am having to reinstall and re-setup everything, and i am at the point trying to setup the bltouch with marlin. The probe IS working, but I am finding that when it probes, the z axes doesn't move back down prior to the second probe, anyone have any idea what I've done and how to fix it?
Re: Bltouch and z axis issues
August 26, 2020 04:23PM
I have a similar problem: after the first touch (which works perfectly) the Z-Axis stays in place and BlTouch tries to "eject" the pin. That is not possible because the Z axis still is in the "pin jumps in" position. The expected behaviour is, that the Z-Axis moves up some millimeters before ejecting the pin for a second (slow) move down of the Z-axis.
I have fiddled around with several marlin versions and tried lots of configurations in the last weeks - unfortunately with no success.

The relevant lines from configuration.h and configuration_adv.h are: (complete config is attached)

#define MOTHERBOARD BOARD_BTT_SKR_PRO_V1_1
#define USE_ZMIN_PLUG
#define ENDSTOP_INTERRUPTS_FEATURE
#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
#define BLTOUCH

#define MULTIPLE_PROBING 2
#define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES 15 // Z Clearance between probe points
#define Z_CLEARANCE_MULTI_PROBE 15 // Z Clearance between multiple probes

#define Z_AFTER_PROBING 15 // Z position after probing is done

#define HOMING_BUMP_MM { 5, 5, 15 } // (mm) Backoff from endstops after first bump
#define HOMING_BACKOFF_POST_MM { 2, 150, 10 } // (mm) Backoff from endstops after homing


Marlin is Version 2.0.6.0, Board is BigTreeTech_SKR_PRO V1.1 (32bit arm processor)

My BLtouch-clone is connected via a AtTiny85 to the board to be independent from configuration of 5V/OC mode and to stretch the pulse length to 12ms.


Has anybody an idea what else I could change in the configuration or is the behaviour a real bug?

Best regards, Zabex
Attachments:
open | download - config.zip (73.9 KB)
Re: Bltouch and z axis issues
August 29, 2020 01:57PM
I instrumented motion.cpp, planner.cpp and probe.cpp with tons of DEBUG statements and found that setting the axis pos to zero has no effect.

Relevant code lines from function void do_homing_move() in file motion.cpp:
// Get the ABC or XYZ positions in mm
abce_pos_t target = planner.get_axis_positions_mm();
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("###1331 axis= ", axis); //ZABEX 2020-08-29

DEBUG_POS("###1332 do_homing_move BEFORE target[axis]=0", current_position);//ZABEX 2020-08-29
target[axis] = 0; // Set the single homing axis to 0
planner.set_machine_position_mm(target); // Update the machine position

DEBUG_POS("###1336 do_homing_move AFTER target[axis]=0", current_position);//ZABEX 2020-08-29


The result of debug output ###1332 is 15.5mm and of debug output ###1336 is also 15.5mm instead of zero.

Here an extract from my logging:
18:52:03.027 : >>> do_homing_move X223.00 Y170.00 Z15.50
18:52:03.027 : ###1278 do_homing_move:distance=15.00
18:52:03.027 : ###1279 do_homing_move:fr_mm_s=10.00
18:52:03.028 : ###1283 do_homing_move:real_fr_mm_s=10.00
18:52:03.028 : ...(Z, 15.00, 10.00)
18:52:03.028 : ###1309 do_homing_move:is_home_dir=0
18:52:03.028 : ###1331 axis= 2
18:52:03.028 : current_position= X223.00 Y170.00 Z15.50 : ###1332 do_homing_move BEFORE target[axis]=0
18:52:03.028 : current_position= X223.00 Y170.00 Z15.50 : ###2861 planner:set_machine_position_mm BEFORE position.set
18:52:03.028 : ###2862 planner: c=0.00
18:52:03.028 : current_position= X223.00 Y170.00 Z15.50 : ###2868 planner: set_machine_position_mm AFTER position.set
18:52:03.028 : ###2873 planner: set_machine_position_mm AFTER position.set, position.c=0
18:52:03.029 : current_position= X223.00 Y170.00 Z15.50 : ###2879 planner: set_machine_position_mm AFTER stepper.set_position()
18:52:03.029 : current_position= X223.00 Y170.00 Z15.50 : ###1336 do_homing_move AFTER target[axis]=0
18:52:03.029 : ###1340 target[axis]=distance = 15.00
18:52:03.029 : current_position= X223.00 Y170.00 Z15.50 : ###1351 do_homing_move AFTER target[axis]=distance
18:52:03.030 : ###1348 planner.synchronize
18:52:03.137 : current_position= X223.00 Y170.00 Z15.50 : ###1355 do_homing_move AFTER planner.synchronize()
18:52:03.137 : <<< do_homing_move X223.00 Y170.00 Z15.50


In void Planner::set_machine_position_mm() I inserted a
set_current_from_steppers_for_axis(ALL_AXES); //ZABEX Bugfix 020-08-29
in the ELSE block after stepper.set_position(position);
So the code looks like:
void Planner::set_machine_position_mm(const float &a, const float &b, const float &c, const float &e) {
TERN_(DISTINCT_E_FACTORS, last_extruder = active_extruder);
TERN_(HAS_POSITION_FLOAT, position_float.set(a, b, c, e));
DEBUG_POS("###2861 planner:set_machine_position_mm BEFORE position.set", current_position);//ZABEX 2020-08-29
DEBUG_ECHOLNPAIR("###2862 planner: c=", c);//ZABEX 2020-08-29

position.set(LROUND(a * settings.axis_steps_per_mm[A_AXIS]),
LROUND(b * settings.axis_steps_per_mm[B_AXIS]),
LROUND(c * settings.axis_steps_per_mm[C_AXIS]),
LROUND(e * settings.axis_steps_per_mm[E_AXIS_N(active_extruder)]));
DEBUG_POS("###2872 planner: set_machine_position_mm AFTER position.set", current_position);//ZABEX 2020-08-29
//FALSCH: set_current_from_steppers_for_axis(ALL_AXES); //ZABEX Bugfix 020-08-29
if (has_blocks_queued()) {
//previous_nominal_speed_sqr = 0.0; // Reset planner junction speeds. Assume start from rest.
//previous_speed.reset();
buffer_sync_block();
DEBUG_POS("###2878 planner: set_machine_position_mm AFTER buffer_sync_block", current_position);//ZABEX 2020-08-29
}
else
{
stepper.set_position(position);
DEBUG_POS("###2885 planner: set_machine_position_mm AFTER stepper.set_position(", current_position);//ZABEX 2020-08-29
set_current_from_steppers_for_axis(ALL_AXES); //ZABEX Bugfix 020-08-29
DEBUG_ECHOLNPAIR("###2885 planner: set_machine_position_mm AFTER set_current_from_steppers_for_axis() position.c=", position.c);//ZABEX 2020-08-29
DEBUG_POS("###2886 planner: AFTER set_current_from_steppers_for_axis", current_position);//ZABEX 2020-08-29

}
}



That changes the current position to zero but unfortunately the axis still does not move up for Move Away before Home 2 Slow.

Is there anybody who has deeper knowledge of the mechanisms around the handling of the values between position and current_position?

Best regards,

Zabex
Re: Bltouch and z axis issues
August 30, 2020 09:54AM
Maybe I was searching in the wrong place. Homing for X and Y works and they show the same behaviour in position and current_position as Z.
To determine whether the not executed "move away" has something to do with my12ms endstop signal from BLtouch I made the BLtouch signal 2000ms long (using a Tiny85).
That leads to no change.

I tried the following:
Moved Z to +30mm and put a 20mm box and a 10mm box on the bed. When executing the Z-Part of G28 I moved the 20mm box below the BLtouch and replaced it by the 10mm box after the first touch. I removed both boxes after the second touch.
The result was:
- Z moves fast down until 20mm box was touched first.
- Z moves slowly down until the 10mm box was touched second.
- Z moves down some millimeters and stops.

So neither the "move away" of HOMING_BUMP_MM=15mm up works nor the HOMING_BACKOFF_POST_MM=10. Seems as if "moving up" was inhibited by - hm, by what?

I enabled endstop monitoring (M43 E1) and saw events for X and Y but not for Z. Is there a special ENDSTOP handling for BLtouch?
Re: Bltouch and z axis issues
August 31, 2020 01:02PM
Brandnew Marlin 2.0.6.1 shows still the same error: Not moving up after first or second Z-probe-touch
Re: Bltouch and z axis issues
August 31, 2020 03:41PM
SOLVED:

After I disabled Z-max endswitch in line 687 of Configuration.h the homing works as intendedsmiling smiley
//#define USE_ZMAX_PLUG

Maybe my light barrier is inverted or a cable is broken or there is a bug. Sorry, I will examinate this not now...


Greetings from

ZABEX
Re: Bltouch and z axis issues
July 16, 2022 11:51PM
Quote
Zabex
SOLVED:

After I disabled Z-max endswitch in line 687 of Configuration.h the homing works as intendedsmiling smiley
//#define USE_ZMAX_PLUG

Maybe my light barrier is inverted or a cable is broken or there is a bug. Sorry, I will examinate this not now...


Greetings from

ZABEX

THANK you Zabex !!! You solved my issue too! Be Healthy !
Re: Bltouch and z axis issues
September 18, 2024 06:31AM
Brilliant answer, thank you. Spent hours trying to discover why the z axis didn't raise after the first probe and then crash into the bed.
Sorry, only registered users may post in this forum.

Click here to login