# What defines the speed at which a motor is retracting and how can it be changed?

Given a Marlin firmware and a line of G-code such as the following:

G1 F100 X50 Y50 Z0 E-10

What defines the speed at which the stepper motor associated with the E-value is retracting? It is my understanding that the Feed Rate defines the speed of the movement (in this case 100mm/m) but I am not clear how I could accelerate a retraction?

The reason I am asking is that I am not seeing a swift removal of material as i retract. Could the slow feed rate be the issue? I am using a pellet printer (WASP 3MT) and generating G-code from polylines on Silkworm.

• Considering this and all previous postings, if might be helpful to explicitly state why you are generating the G-code commands yourself instead of being generated by slicer programs. E.g. is that required for a pellet printer? – 0scar Nov 19 '18 at 17:05
• @0scar thanks a lot, I am printing in mid-air a truss-like geometry.I co-wrote an open-source plugin called Silkworm (for Grasshopper) that allows to export Gcode from polylines. – Arthur Mamou-Mani Nov 25 '18 at 14:08

You instruct the printer to move from a certain X-Y position instructed by the previous move, to X=50 and Y=50. While moving at a feedrate of 100 mm/min, it will also retract 10 mm of filament (if the previous extruder distance was 0) during that move. If the movement distance is large, the retraction is slow. If you started from X,Y = 49.99,49.99 it would be very fast.

If you want a fast retraction, first move to a position, and than retract fast, so in separate commands. Do note that we usually do it the other way around: first retract fast and then move, this way there is less oozing of the nozzle.

To sum up, in your G-code command, the speed of retraction depends on the path of travel (the length and speed defined by the feed rate F). If it is fast retraction you are after, you should split the command into two separate commands.

In the command G1 F100 X50 Y50 Z0 E-10:

• G1 - move linearly
• F100 - Use a feed rate of 100 mm/minute
• X50 Y50 Z0 - tells those axes to move to (50, 50, 0) (absolute positioning)
• E-10 - tells the extruder to retract 10mm (relative positioning)

If you are not experiencing high enough retraction speed:

• Try increasing the retraction speed in your slicer.
• Try increasing the max acceleration for the E axis using M201 (e.g. M201 E10000 sets to 10,000 mm/s).
• Try increasing the max feed rate for the E axis using M203 (e.g. M203 E25 sets to 25 mm/s).

Notes:

• If you're able to connect to your printer over USB, and you aren't already using an interface to control it, something like Pronterface might make it easier to test retraction speeds.
• If this is the correct firmware for your printer, it looks like it is able to save changed values to the EEPROM. They may be using a modified Marlin firmware. If so, EEPROM can be saved with M500, loaded with M501, and reset with M502.
• If your firmware limits what you can set with M201 and M203, you may want to download the firmware and try to edit its maximum accel/feedrate before flashing.
• The trick is that the OP is not using a slicer, these are self generated commands (considering the previous postings). The retraction is done during the move, you cannot change the extruder feed rate without changing it for the whole move. – 0scar Nov 18 '18 at 20:29