Welcome! Log In Create A New Profile

Advanced

Detailed questions regarding gcode (federate, acceleration, jerk)

Posted by schpongo 
Detailed questions regarding gcode (federate, acceleration, jerk)
September 18, 2017 12:31PM
I'm new to the world of 3d printing and gcode ,curruntly I am working on a controller for a 3d printer.
I have some questions about the structure of gcode.

I've created to following gcode using cura with the acceleration and jerk setting enabled.
Please correct anything that I've misunderstood.

M204S3000
M205X20
G1F1800X20.222Y18.834E0.01486
G1X20.87Y18.383E0.02971
G1X21.561Y17.999E0.04458
G1X22.286Y17.687E0.05943
....

If I've understood the wiki correctly , In line 1 I will set the default (not maximum) acceleration for all axis and all movements (print, travel and retract) to 3000 mm/s^2.
In the wiki the S refers to 'normal moves' and a T to filament only moves. What are filament only moves?
This setting will be used for all relevant commands that come past line 1 and will continue to be used until another M204 command is issued?

In line 2 the maximum(not normal) XY jerk is set to 20 mm/s^3 and this setting is used until a new max jerk is set?
But what determines which jerk value is used for a move, if only the maximum value is set?
Is the max value used for all moves?
Is the jerk actually the third derivative of the position value or is it a sort of minimum acceleration?

In line 3 the federate is set to 1800 mm/ for all following commands or just for the G1 command in line 3?
To which commands does this apply? G0 G1 G2, G10 any other?
Does that mean the axis speed is set to 1800 mm/s or the spacial movement speed is set to 1800 mm/min?
What feedrate is used if none is specified.

I know that those are a lot of questions, but I would greatly appreciate it, if they could all be answered.
And please do feel free to be as elaborate as possible.

Thanks for the help
Daniel

----------------
EDIT:
- Corrected mm/s to mm/min

Edited 1 time(s). Last edit at 09/19/2017 01:20AM by schpongo.
Re: Detailed questions regarding gcode (federate, acceleration, jerk)
September 18, 2017 07:32PM
feed rates are in mm/min so divide by 60 for mm/sec eg F1800 is 30mm/sec

the feed rate is the feed rate for all following moves commands, ie all commands that can take a feed rate parameter.

Feed rates set the axis speed, when moving multiple axis in one command the lowest feed rate is used (normally E axis)

starting feed rate is undefined and firmware specific, never assume anything and always set a feed rate
Re: Detailed questions regarding gcode (federate, acceleration, jerk)
September 19, 2017 10:19AM
Quote

In the wiki the S refers to 'normal moves' and a T to filament only moves. What are filament only moves?

Segments where only the filament moves, such as a retract or prime.

Quote

Is the max value used for all moves??

The max value is available for any move, but might not be necessary. For example if one long straight line is segmented into two G1 commands you do not need any accel/jerk to chain them together.

Quote

Is the jerk actually the third derivative of the position value or is it a sort of minimum acceleration?

This varies by firmware, but jerk is frequently implemented as an angle-dependent minimum cornering speed because its easier to calculate that way.

Quote

In line 3 the federate is set to 1800 mm/ for all following commands or just for the G1 command in line 3?

Feedrate is modal and will persist until another F word is read. Feedrate affects all coordinated movements, which would be G1/G2/G3 plus other commands that may vary by controller.

By definition G0 produces an uncoordinated movement to reach the destination as quickly as possible, and does not obey the feedrate limit. Since the motion is uncoordinated, the machine may not move in a straight line. A lot of CAM will avoid using G0 near the part because unpredictable motion risks collision.

I think a lot of 3d printer firmwares treat G0 as G1 with a predefined feedrate specified in config, but I'm not sure.
Re: Detailed questions regarding gcode (federate, acceleration, jerk)
September 19, 2017 03:14PM
Quote
Dust
Feed rates set the axis speed, when moving multiple axis in one command the lowest feed rate is used (normally E axis)

Are you certain?
Because that would mean, that If I were to set my feed rate to 100 mm/min and would move all my axis at that speed, that resulting speed is actually (3)^0,5 * 100 mm/min
Re: Detailed questions regarding gcode (federate, acceleration, jerk)
September 19, 2017 05:20PM
Its just that when a move is one axis only it will move at either:
-the feedrate specified i.e. G1 X100 F3000 moves at 3000mm/min, as long as its no faster than maximum feedrate specified in config
-the last used feedrate if none is specified.

When a multiple-axis move is commanded eg:
G1 X100 Y100 Z100 F2000 then the limiting axis will usually be Z as generally z axes have low maximum feedrates as they are typically screw driven. It's not likely to be 2000 mm/min in this example but probably slower.

If you add in an extruding move such as
G1 X10 Y10 E0.56 F5000

Then the limiting factor will usually be the extruder it is not going to be able to extrude at 5000 mm/min, so it will extrude at its maximum feedrate from config, and the x and y axes will move at the same speed to coordinate the move.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: Detailed questions regarding gcode (federate, acceleration, jerk)
September 19, 2017 06:11PM
I'm not an expert on this issue, but my understanding of G1 feedates is that they only apply to the cartesian axes unless the move is an extruder-only move. The following commands will execute in the same amount of time because the E travel is ignored when calculating the speed of a carteisan move.
G1 X10Y10 E1  F500
G1 X10Y10 E10 F500

Under this interpretation, the following G-code:
Quote

G1 X10 Y10 E0.56 F5000

Should be fine, because the E axis is only expected to travel 0.56mm in the time that the X and Y axes both travel 10mm. The actual speed experienced by the E axis will be:
200mm/min = 0.56mm / sqrt(10mm^2 + 10mm^2) / 5000mm/min

The wiki is somewhat ambiguous but I believe it supports my interpretation:

Quote

Xnnn The position to move to on the X axis
Ynnn The position to move to on the Y axis
Znnn The position to move to on the Z axis
Ennn The amount to extrude between the starting point and ending point
Fnnn The feedrate per minute of the move between the starting point and ending point (if supplied)
[reprap.org]

Of course a move will be capped if it requires any motor to exceed the hard limits programmed into the config file.
Re: Detailed questions regarding gcode (federate, acceleration, jerk)
September 19, 2017 07:19PM
Yes I'd buy that, especially given that extrudes are usually very small distances relative to x and y. That being said I've seen xy speed limited by e axis jerk being too low.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Sorry, only registered users may post in this forum.

Click here to login