Welcome! Log In Create A New Profile

Advanced

Marlin 2.0.5.x inconsistent speeds pen plotter with G02/G03

Posted by Ohmarinus 
Marlin 2.0.5.x inconsistent speeds pen plotter with G02/G03
March 31, 2020 04:27AM
Hi all, so this DIY pen plotter is coming a long way but I keep getting slowdowns in some of the gcode files that I feed to it. For example, one file is about 3Mb and it runs fine, but the other file is 87kb and it maxes out the buffer on the Mega2560.

Example video:
[www.youtube.com]

As you can see the speeds vary a lot. It doesn't only slow down, but it also speeds up beyond the max acceleration settings somehow. I suspect it is the G02/G03 commands giving trouble.

The gcode file is also included in here. Maybe someone knows what could be the problem or how to fix it.
This is the file: antonio_grass__0001.gcode

These are my arc support settings:
//
// G2/G3 Arc Support
//
#define ARC_SUPPORT                 // Disable this feature to save ~3226 bytes
#if ENABLED(ARC_SUPPORT)
  #define MM_PER_ARC_SEGMENT      1 // (mm) Length (or minimum length) of each arc segment
  //#define ARC_SEGMENTS_PER_R    1 // Max segment length, MM_PER = Min
  #define MIN_ARC_SEGMENTS       24 // Minimum number of segments in a complete circle
  //#define ARC_SEGMENTS_PER_SEC 50 // Use feedrate to choose segment length (with MM_PER_ARC_SEGMENT as the minimum)
  #define N_ARC_CORRECTION       25 // Number of interpolated segments between corrections
  //#define ARC_P_CIRCLES           // Enable the 'P' parameter to specify complete circles
  //#define CNC_WORKSPACE_PLANES    // Allow G2/G3 to operate in XY, ZX, or YZ planes
#endif

// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes.
//#define BEZIER_CURVE_SUPPORT

Anyone has a hint of what to try to improve? Maybe change some arc support settings?

I have also filed this issue as a bug in the Github:
[github.com]

Edited 3 time(s). Last edit at 03/31/2020 04:52AM by Ohmarinus.


http://www.marinusdebeer.nl/
VDX
Re: Marlin 2.0.5.x inconsistent speeds pen plotter with G02/G03
March 31, 2020 05:49AM
... could be, it's the segment length or curve/segment-resolution, what's causing this inconsistent speeds -- then normal G1 speed is set to pretty fast (if not too fast) ... but with short segents its drastically reduced by start/stop-acceleration and insufficient jerk ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Marlin 2.0.5.x inconsistent speeds pen plotter with G02/G03
March 31, 2020 06:32AM
Quote
VDX
... could be, it's the segment length or curve/segment-resolution, what's causing this inconsistent speeds -- then normal G1 speed is set to pretty fast (if not too fast) ... but with short segents its drastically reduced by start/stop-acceleration and insufficient jerk ...

Hello Viktor smiling smiley

What would you suggest I can try to change in the settings?

Would enabling and playing with these settings do anything? I am kind of clueless as what could help and trial and error method takes ages because I have to reupload the full sketch and start a drawing every time I want to try it out..

//#define ARC_SEGMENTS_PER_R 1 // Max segment length, MM_PER = Min
//#define ARC_SEGMENTS_PER_SEC 50 // Use feedrate to choose segment length (with MM_PER_ARC_SEGMENT as the minimum)


http://www.marinusdebeer.nl/
VDX
Re: Marlin 2.0.5.x inconsistent speeds pen plotter with G02/G03
March 31, 2020 06:45AM
... try to reduce the speed (F-value in the G-code) and rise the jerk value -- so for small angle deviation it won't do fullstop for every segment ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Marlin 2.0.5.x inconsistent speeds pen plotter with G02/G03
March 31, 2020 06:58AM
Quote
VDX
... try to reduce the speed (F-value in the G-code) and rise the jerk value -- so for small angle deviation it won't do fullstop for every segment ...

Alright, but the issue is I built this machine to be fast smiling smiley And the speed and jerk settings are perfect when not printing G02/G03 movements. So it's more of a buffer problem I think, while it doesn't have to be a buffer problem. Using a 32-bit controller doesn't make any difference by the way.

Edited 1 time(s). Last edit at 03/31/2020 06:59AM by Ohmarinus.


http://www.marinusdebeer.nl/
Re: Marlin 2.0.5.x inconsistent speeds pen plotter with G02/G03
March 31, 2020 11:04AM
My MPCNC when using a pencil is relativity fast, so I though I would try your G-Code.

After removing ;G28 F3000 ; home fast as my MPCNC has software end-stops an was do required, I commenced to Printing the posted G-Code.
When it gets to the G2-G3 commands it indeed does slow. I have a Arduino with Ramps 1.6 running Marlin 2.

Although you most likely knew this would happen, this is just an FYI to my test for a MPCNC using your G-Code "including the arc function commands G2 an G3".


Electronics Technician / Computer Programmer
Re: Marlin 2.0.5.x inconsistent speeds pen plotter with G02/G03
March 31, 2020 11:25AM
I've seen something like this before [github.com]

ie they recommend to change G2_G3.cpp#L219 and G2_G3.cpp#L239 and replace seg_length with 0.0

Can you give this a try?

Edited 1 time(s). Last edit at 03/31/2020 11:29AM by Dust.
Re: Marlin 2.0.5.x inconsistent speeds pen plotter with G02/G03
March 31, 2020 01:16PM
Quote
Dust
I've seen something like this before [github.com]

ie they recommend to change G2_G3.cpp#L219 and G2_G3.cpp#L239 and replace seg_length with 0.0

Can you give this a try?

Hey, this is exactly the solution I found! Thanks a lot, it was posted simultaneously on Github by 'ellensp'. I got a mail and went there first so I already tested and it's a confirmed fix. So happy this works now!

Solution as mentioned on Github:
[github.com]

And here's the video of it working smoothly:
[www.youtube.com]

Edited 1 time(s). Last edit at 03/31/2020 01:16PM by Ohmarinus.


http://www.marinusdebeer.nl/
Re: Marlin 2.0.5.x inconsistent speeds pen plotter with G02/G03
March 31, 2020 03:06PM
Lucky I came across this post, using what I learned here I can try these setting for myself ,

Thank You

Edited 1 time(s). Last edit at 03/31/2020 04:49PM by Roberts_Clif.


Electronics Technician / Computer Programmer
Re: Marlin 2.0.5.x inconsistent speeds pen plotter with G02/G03
March 31, 2020 03:30PM
The main Marlin developer/maintainer has looked at this now, and has made the second change part of marlin. So perhaps the first change was not needed.
Re: Marlin 2.0.5.x inconsistent speeds pen plotter with G02/G03
March 31, 2020 06:15PM
Quote
Dust
The main Marlin developer/maintainer has looked at this now, and has made the second change part of marlin. So perhaps the first change was not needed.

Interesting, where can I see the progress? smiling smiley

I still have to fix a jitter issue so that will be my next challenge.


http://www.marinusdebeer.nl/
Sorry, only registered users may post in this forum.

Click here to login