Skip to content

Comments

Apply soft limits to G2/G3 final target#15156

Merged
thinkyhead merged 1 commit intoMarlinFirmware:bugfix-2.0.xfrom
vector76:patch-1
Sep 4, 2019
Merged

Apply soft limits to G2/G3 final target#15156
thinkyhead merged 1 commit intoMarlinFirmware:bugfix-2.0.xfrom
vector76:patch-1

Conversation

@vector76
Copy link
Contributor

@vector76 vector76 commented Sep 4, 2019

Description

Observed strange behavior when G2/G3 interacts with soft limits. Here is one example: https://www.v1engineering.com/forum/topic/strange-movement/

This strange behavior appears to be due to incorrect application of limits in G2/G3 movements.

Upon examining the code, found that the final movement to reach the target location does not have limits applied (apply_motion_limits).

Benefits

Proper clipping of G2/G3 movements when endpoint is outside working volume.

Related Issues

Unfortunately my machine is down so I can't test it right now. I'll test shortly and update with the findings.

@vector76
Copy link
Contributor Author

vector76 commented Sep 4, 2019

Ok I've reproduced the bug and tested the proposed remedy. Here is a video showing a simple G2 command where the final position is in negative coordinates.
https://youtu.be/yruozlk5LM8

The first two curves are without the fix, first starting from (0, 0), exhibiting the problem, and then starting from within the working volume.

The second two curves are with the proposed bugfix, first starting from (0, 0), properly clipping and then starting from within the working volume.

All four curves are the same gcode:

G92 X0 Y0 Z0
G1 Z5 F300
G1 X20 Y0 F300
G1 Z-0.5 F300
G2 X-14 Y-14 I-20 J0 F300
G1 Z5

@thinkyhead thinkyhead changed the title Soft limits not applied to G2/G3 final target Apply soft limits to G2/G3 final target Sep 4, 2019
@thinkyhead
Copy link
Member

Thanks!

@thinkyhead thinkyhead merged commit 293b890 into MarlinFirmware:bugfix-2.0.x Sep 4, 2019
@vector76 vector76 deleted the patch-1 branch September 15, 2019 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants