-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Reduce _lcd_move()
code size
#4756
Conversation
All values in bytes. Δ Delta to base
|
While testing this PR on MK404 I have noticed few things. Without this changes the LCD Settings -> Move axis limits are With this PR There is a difference how far you can move the x and y axis. But also Z can't be moved to 0.0 anymore Y_MAX_POS is 212.5 and Y_MIN_POS is -4 and the Y_MAX_LENGTH is Y_MAX_POS-Y_MIN_POS --> 212.5-4 = 216.5. On old firmware the LCD stops at 212.0 and new firmware at 217.0 both are off by 0.5 I guess some odd rounding issue. |
@3d-gussner Thanks for the detailed testing. I will take another look 💪 |
Something is off with the Y-axis on current MK3 branch too. It should go from -4.0 to +212.5 on MK3/S. |
re-use clamp_to_software_endstops() to avoid code duplication Change in memory: Flash: -192 bytes SRAM: 0 bytes
lcd_draw_update is automatically set to 1 when the knob is rotated. See lcd_knob_update() _lcd_move is called before lcd_draw_update is decremented, since it is called as a submenu Change in memory: Flash: -12 bytes SRAM: 0 bytes
342dfbf
to
c0904e4
Compare
I've done some testing on MK3S+. The crashes are likely happening due to these lines being removed: if (min_software_endstops && current_position[axis] < min) current_position[axis] = min;
if (max_software_endstops && current_position[axis] > max) current_position[axis] = max; This code is technically incorrect though as it limits the axis movement even more than
On my printer the offset in XYZ calibration is: X: -1.58mm This means that When I run the belt test I get the following lengths:
Y axis:
I haven't checked if my XYZ Calibration is out of date... but any skew in calibration is enough to cause a TMC crash with this PR. Especially if something like a cable or cable ties are blocking the X gantry. |
Re-ran XYZ calibration, my PINDA sensor was a bit too high. Unfortunately the results are pretty similar as before. Offset: Results from belt test (to get axis lengths):
Y axis:
I suspect the cable harness is limiting my X-axis length a little bit on the far right side. |
Closing this PR for now. |
Reuse
clamp_to_software_endstops()
to avoid code duplication. The code should be functionally equivalent.Change in memory:
Flash: -204 bytes
SRAM: 0 bytes