New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.1.x] Purge blocks on endstop/probe hit #8690
[1.1.x] Purge blocks on endstop/probe hit #8690
Conversation
That is only in the case of using the LCD Display to position the nozzle at a new mesh point. The whole intent is if the user is spinning the dial, we don't want the nozzle to trace through every mesh point. Instead, we cancel the current move and start heading towards the (currently) selected mesh point on the LCD Display. This allows a much more responsive edit session. There should be no harm throwing out any queued motion commands so long as the next destination mesh point has been identified and a move to get there is submitted.
I suspect we can cut out this tentacle. (Or really... The special case for UBL's LCD Mesh Editing) I think we just need to flush the entire queue... And then make sure we queue up a single move that gets the nozzle to the currently selected mesh point. |
For Map Control it could be safe to have |
If void _lcd_do_nothing() {} if (planner.movesplanned() > 1) { // if the nozzle is moving, cancel the move. There is a new location
stepper.quick_stop();
+ currentScreen = _lcd_do_nothing;
+ while (planner.movesplanned()) idle();
+ stepper.cleaning_buffer_counter = 0;
+ currentScreen = _lcd_ubl_output_map_lcd;
set_current_from_steppers_for_axis(ALL_AXES);
sync_plan_position();
ubl_map_move_to_xy(); // Move to new location
refresh_cmd_timeout();
} |
e608a5d
to
add2f64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ingenious.
Up to now i can't find unwanted side effects.
I see that 2.0.x and 1.1.x still don't match in several areas, most notably the @Roxy-3D I have one specific question regarding two lines. Which is more current and correct? const int ind = ubl_height_amount < 0 ? 6 : 7;
strcpy_P(UBL_LCD_GCODE, PSTR("G29 P6-")); …or… const int ind = ubl_height_amount > 0 ? 9 : 10;
strcpy_P(UBL_LCD_GCODE, PSTR("G29 P6 C -")); |
I believe this is more correct:
The G29 P6 mesh adjust needs a 'C' constant to tell the command how much to shift the mesh up or down. |
3725da4
to
c749c33
Compare
I see! So in that case I'll assume the UBL-oriented stuff in 1.1.x ( |
7bf6aa4
to
320afe0
Compare
320afe0
to
aa7236e
Compare
3c20cfd
to
1951d3a
Compare
I hope to know what the reason for #8700 , #8704 is. |
A possible fix could be to set |
Or
|
The stepper synchronize idea seems good, but then there are cases where Here's one idea. We have room for more block flag bits. We could add an |
@@ -311,8 +311,7 @@ | |||
void unified_bed_leveling::G29() { | |||
|
|||
if (!settings.calc_num_meshes()) { | |||
SERIAL_PROTOCOLLNPGM("?You need to enable your EEPROM and initialize it"); | |||
SERIAL_PROTOCOLLNPGM("with M502, M500, M501 in that order.\n"); | |||
SERIAL_PROTOCOLLNPGM("?Enable EEPROM and init with M502, M500.\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message confused me when I got it a moment ago. I was doing M502 and M500 but was still getting the message. When I added M501, it started working. How come it was removed from the helpful error message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no reason for M501
to be needed. If M501
is required something is broken. Someday someone will have to look into that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the rationale. UBL doesn't know where it can start storing its meshes until after M501
. This is something that we can certainly figure out at compile time, but for now you do need to use M501
as a workaround for this oversight.
As an alternative to #8687 / #8688
Rather than rely on code that plans to trigger endstops clearing a flag (
planner.split_first_move
) to prevent the first move being split, simply make sure to purge the rest of the blocks in the buffer when an endstop or probe move leads to a trigger.The stepper code should be doing this for safety anyway. Although the high-level code is careful to only do single un-segmented moves when endstops or the probe are enabled, and the G-code parser is blocked during operations like
G28
andG29
, there are some cases where there could be more than one move in the planner.When using commands like
G38.2
on a Delta or SCARA, a sideways probe will be a segmented move. Likewise, when using theABORT_ON_ENDSTOP_HIT
feature during an SD print, it is entirely possible for extra moves to be in the planner when the abort occurs.The
cleaning_buffer_counter
has only been used byquick_stop
so far, so this PR modifies it slightly so it can differentiate between an endstop hit and aquick_stop
.The opening code of
Stepper::isr
differs somewhat between the 1.1.x and 2.0.x branches.1beaef0#diff-a7c736c674fcde8ddf7bf0e86181e4c0R355
I'd like to resolve which differences are important and get these back in sync asap.