-
-
Notifications
You must be signed in to change notification settings - Fork 766
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
Autoleveler - Apply to Gcode - incorrect first movements #1583
Comments
I made some investigation... I think that the problem is, the autoleveler takes the origo (0:0:0) as the first point, because of this the cnc goes from home at first into the origo then to the actual first point. If the g-code lines (marked with yellow) are deleted, the engraving is fine. (gcode.apply.gcode.docx) The first movement (yellow line) goes on the surface, from the origo, not from the first point: Another issue: feedrate |
I am having the same issue with first unwanted line. Is there any way to save updated G-code into a file? I also noticed the issue with federate set to crawl. Would be great if this can be fixed too, but not critical. The plugin is very much works for me (if not these two issues) - great job guys! |
Disclaimer: this is my first time I am looking at UGS code. The updatePointWithCommand is not aware of mechanics of the G28 and how it affect the new positions. Because Z0 found in the command arguments, the parser assume a move of Z-axis to coordinate 0 (active coordinate system?). At this point the parser assumes location as X,Y,0. The next command that move spindle to work position X,Y calculate Z axis based on current value of 0, and spindle dive with first move command to Z=0+-adjustment. I believe, the issue with unwanted line can be resolve if handleGCode can properly recognize and appropriately update X,Y,Z. |
Hello everyone, |
No worries, @zdima! |
@andrewmurraydavid can you post a sample file without the fix for us to test with? |
Here's a sample @breiler, hope it's useful: (1004)
G90 G94
G17
G21
(Engrave1 4)
T8 M6
S12000 M3
G17 G90 G94
G54
(this is where UGS calls the end mill "home")
; Z5 (this is the line I added to avoid collision with the piece and that extra line)
G0 X46.868 Y6.316
Z12
G1 Z1.82 F2000
Z-0.05 F500
X46.873 Y6.412 F2000
Y7.43
X46.885 Y7.777
Y7.779
X46.914 Y7.949
(keeps on going for another 5000 lines)
Z12
M5
M30 |
Thanks, I have made a small code change which seems to fix this. The change may be small but it is a very central part so I need to do a lot of testing before I dare merging it. Thanks for the patience. |
It is merged and available in the latest nightly build: I would appreciate help testing this. |
Thank you, @breiler! For reference the issue I'm getting is not finding a resource:
Happy to connect with you if needed. My email should be in my github profile. |
So far it works great! I don't find any breaking changes! Thank you, @breiler ! A quick question I have about the leveler Z adjustment, what's the speed the Z is adjusted with? I couldn't find that information in the code after a quick search. Could you point me in the right direction? Thanks! |
I am not sure what you are asking for. But all settings for the auto leveler is handled here: |
Right, I see why the comment can be confusing. So let's take this example: G1 F1000 X12 Y23 And let's say the Z offset for that point is 0.5 from the leveler. Does that translate to: G1 F1000 X12 Y23 Z0.5
; or
G0 Z0.5 ; or G1 F? Z0.5
G1 F1000 X12 Y23 Hope that makes more sense. The reason I'm asking is because my program uses F1000, but when the level mesh is applied to the gcode the feedrate doesn't go over 500 (when overridden to 200%). And obviously the program runs much slower. |
Does your program have arcs which could cause this problem #2430? |
Not G2 or G3 arcs, but arcs made via smaller lines. File is txt as github doesn't accept .nc files. |
I just found the generated gcode with the applied Z offests. Maybe this helps too? |
Your gcode has plenty of small details which you are trying to run at a feed rate of 3000 mm/min. If I have to guess, your machines acceleration/deceleration settings are set in a way that don't allow it to reach your desired speed. If I use the default acceleration setting of 10 mm/sec2 I also get around 500mm/min. If I increase this to 100mm/sec2 it will acheive much higher speeds. But then there is also a risk that the stepper motors will loose steps... I don't think that there is much we can do about this from UGS point of view. |
Thank you for helping me understand the cause. Sorry to have bugged you on a weekend. Thank you again! Also, I've been running the machine all day with the the update you made for the original issue I commented about and I haven't have any issues! Thanks for the fix!! |
Closing this as it seems to be working now. |
Describe the bug
The first movements are incorrect if the scanned surface coordinates are applied to the gcode.
There is a first unwanted engraved line.
Version
UGS Platform 2.0.7
Operating system (please complete the following information):
Raspberry PI 3B+; Raspberry Pi OS with desktop
Gcode generator
Fusion360
Original Gcode:
Leveled Gcode:
I think that, the autoleveler function calculates the first movements ( from G0 X-12.409 Y-19.818) incorrectly.
The text was updated successfully, but these errors were encountered: