Welcome! Log In Create A New Profile

Advanced

Controlling feed rates

Posted by Nickolai 
Controlling feed rates
December 20, 2012 10:21AM
I'm very new to 3D printing and was playing with a Prusa yesterday when I started getting some really bad results when trying to print a rubber ducky.

I strongly suspect that this could have been avoided if I had simply been able to slow down the process. It seems like the only way to do this is to rewrite the entire G-code file, since Pronterface does not have any options for controlling the speed during a run (or maybe I missed them?).

I was trying to think about how to remedy this, I suppose at some point pronterface reads a line of text out of the gcode file and sends it to the printer - is there any way to intercept this line, check it for a feed rate, and then multiply that rate by some on screen factor? This is commonly done on CNC mills - the ones I've worked with have simple buttons on the control panel that allow you to increase or decrease the feed rate at will, which is extremely useful both for successfully making the part and preservation of the tool. Would be great if we can replicate this for 3D printers!
Re: Controlling feed rates
December 20, 2012 01:35PM
Went and dug through the pronterface files and seem to have found the appropriate section in printcore.py, in the _send command is where it actually sends the command to the printer. I think that's the place to parse the command for a feedrate and make the appropriate changes, although it will require a little extra work if one wants to change the feedrate after one has been set earlier in the file. I have to say, I'm impressed with the code organization, the relevant line was pretty easy to find!
Re: Controlling feed rates
December 20, 2012 01:48PM
I think the version of Pronterface that comes bundled with Cura has a button that scales the speed of the print. It sends an M code and Marlin does the scaling.


[www.hydraraptor.blogspot.com]
Re: Controlling feed rates
December 20, 2012 03:39PM
pronterface allows you to enter raw gcode down in the lower right. print speed is controlled with the M220 command

M220 S50 will print at 50% speed
M220 S100 will restore it to normal speed
M220 S200 will double the speed
Re: Controlling feed rates
December 20, 2012 03:57PM
And this can be entered in the middle of a print? Is it similar to the pause command, which, as I noticed at least on my printer, doesn't have an immediate effect but can take a few seconds?
Re: Controlling feed rates
December 20, 2012 04:04PM
Yes - you can enter it at any time - even while printing. It takes a few seconds for the buffer to be used up before the change in speed occurs.

I do it all the time during prints - usually to speed things up on small layers when I think it's slowing down too much.

BTW - there is another command - I think it's M221 which can be used to change the extrusion speed. I believe M220 changes both the extrusion speed ans the head movement speed in sync with one another where the M221 will only affect the extrusion speed.
Re: Controlling feed rates
December 21, 2012 08:46AM
Part of printer calibration is to find and set maximum speeds and maximum acceleration. Once set right, G-code can set too high feedrates as much as it wants, the printer will print at its maximum feedrate, only. But oh well, a "look, it works"-community isn't exactly open to do things right. Band aid like M220 is much more accepted.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Controlling feed rates
December 21, 2012 01:31PM
Traumflug Wrote:
-------------------------------------------------------
> Part of printer calibration is to find and set
> maximum speeds and maximum acceleration. Once set
> right, G-code can set too high feedrates as much
> as it wants, the printer will print at its maximum
> feedrate, only. But oh well, a "look, it
> works"-community isn't exactly open to do things
> right. Band aid like M220 is much more accepted.

M220 is not a band aid, it's a tool.

I fundamentally disagree with this idea of finding one speed and "setting it," as it ignore many of the dynamics of printing.

Can this one speed work regardless of the ambient temperature at which you programmed it? What about for various geometries, will it work equally well for small objects as well as large ones? What about using a fan for cooling the part, do you need one speed for fan on and one for fan off (and the previous questions about temperature and geometry then have to apply to both of those speeds)? Even down to the plastic, what if you get a weird batch that takes longer to cool?

A careful machinist watches his part and adjusts the machine as necessary to make sure things are going right, especially for one off parts. Being able to change the feedrate and coolant level (fan speed) on the fly can save a part that would otherwise be ruined because the programmed speeds didn't take some environment variable into account. I think it's especially useful to novice machinists/printers who are still getting a grasp on their machine.

Edited 1 time(s). Last edit at 12/21/2012 02:24PM by Nickolai.
Re: Controlling feed rates
December 21, 2012 01:40PM
FWIW since we're off topic anyway, I think GCode wasn't the right choice for driving the firmware, it embeds too much of the configuration into the output file.
Ideally you'd want to delineate configuration information from the actual motion description.
I.e. it would be better if you could print the same file using 3mm ABS and 1.75mm PLA.
Re: Controlling feed rates
December 21, 2012 02:54PM
Polygonhell Wrote:
-------------------------------------------------------
> FWIW since we're off topic anyway, I think GCode
> wasn't the right choice for driving the firmware,
> it embeds too much of the configuration into the
> output file.
> Ideally you'd want to delineate configuration
> information from the actual motion description.
> I.e. it would be better if you could print the
> same file using 3mm ABS and 1.75mm PLA.


On that topic, what you you have to do to switch materials? I would think all that needs to be changed is the extruder temperature and the feedrate for the extruder. For going from 1.75 to 3, just scale the extruder feedrate by (1.75/3)^2, and the reverse for the other way. Does that make sense?
Re: Controlling feed rates
December 22, 2012 05:13AM
Polygonhell Wrote:
-------------------------------------------------------
> FWIW since we're off topic anyway, I think GCode
> wasn't the right choice for driving the firmware,
> it embeds too much of the configuration into the
> output file.
> Ideally you'd want to delineate configuration
> information from the actual motion description.
> I.e. it would be better if you could print the
> same file using 3mm ABS and 1.75mm PLA.

I've wanted to do the same thing. The G-Code spec and most G-Code implementations support system parameters/variables and even expressions. So you could set a system parameter for temperature etc and run the same GCode file.

GCode is actually quite a flexible and powerful language, the very limited Reprap implementations make it look worse than it is.

It is common for CNC machinists to tinker with things during a job, but it depends whether you view a 3D printer as a printer or a machine tool. I would prefer a printer concept, I send a file to a printer and it appears on a printer somewhere. Certainly for general users of 3D printers, this is what they expect.

Ideally I'd like to send an STL to a printer and have it all done by the printer, but that is for next year winking smiley
Re: Controlling feed rates
April 26, 2016 09:28AM
Very good thread and read.

I'm still trying to dial in default MAX feed rates and accelerations for my HIC i3 printer. The default MAX values set in the OEM firmware was off the charts i.e. 500mm/sec for the X-Y non-printing move feedrates? So I re-set the MAX X-Y firmware/EEPROM to 120mm/sec what I believe the HIC i3 Reprap will do without tearing itself apart just in case M220 S200 command by accident or some kind of speed runway issue.

I'm still tweaking the 2 month old printer, and my first. Wholly agree that if you just set it and print different objects and sizes without paying attention, your prints will not come out like they should. Each print = check print quality and if you print that object regularly, save a slicer configuration named file for it.

---
Re: Controlling feed rates
September 06, 2016 06:32PM
I am just geting into the extruder controls of my homebrew 3d printer and so far have found this to be the most confusing.

We have a filament with a certain diameter which is reduced to the extruded diameter, therefore there is an Extrusion multiplication of filament/extrusion area..
There is a max feedrate which limits the volume of material that the extruder can melt fast enough to use.
I presume this feedrate must match the extruded volume deposited at the speed of the x,y,z motion
or sqrt ( Xvelocity2+ Yvelocity 2+ Zvelocity2 )
The motors all have their maximum velocity which cannot be exceeded but the feedrate must also limit the max X,Y,Z motor max rates.
The x,y,z motor speeds must all be scaled relative to each other so that the appropriate distance is covered by the 3 axis.
Ratio is Maximum distance axis * steps_mm/ Minor distance axis* steps_mm
Since the trapezoidal speed profile has a range of velocities, this should also shape the feedrate velocity. Right?
So it seems to me that the motor E value must be related to the Feed rate to cause this variation in feedrate.
This sure is convoluted.
Re: Controlling feed rates
September 13, 2016 07:44AM
Not as convoluted as bumping a 5 year old thread...
Re: Controlling feed rates
April 12, 2017 10:51AM
Well I bumped into this as well. I'm trying to control the adjust the print speed in real time using the m220 command but it doesn't have any effect. When I turn the knob on the lcd screen of the ramps board it does work but not through the G-code.
I'm using the most recent Marlin firmware is there something I'm missing or is the M220 command not in use anymore?
Sorry, only registered users may post in this forum.

Click here to login