# Do printer controllers take inertia into account when interpreting G-code into movement instructions?

I've never built a 3D printer before, but I understand dynamical systems and control theory, and I imagine a lot of the distortion/inaccuracy that happens during the FDM process (especially at high speeds) is due to position inaccuracies because of inertia. For example, a heavy print head moving fast enough might overshoot its position target if the system expects it to stop instantly. Does any existing 3D printer controller software try to measure the mass of the print head/movement assembly and then use that to come up with better movement instructions?

To speculate a bit: This additional accuracy might not be useful with many normal stepper-driven printers because they lack resolution and/or control, but I think in some cases it would. I imagine with enough positional accuracy and acceleration control you could model the print head position with a dynamical system and get extremely precise movement right up to the mechanical limits of the system.

Am I wrong that inertia has a large effect? Would this be theoretically impossible for some reason I'm not thinking about?

• What printers usually end up with is oscillation when turning corners, so that you will see a wave pattern in prints. Feb 11 '21 at 16:42
• For what it's worth, most printers try very hard to avoid having a "heavy print head", but a moving bed (which many do have) ends up being the same thing. CoreXY and delta machines, however, tend to have no fast-moving parts with significant mass. Feb 12 '21 at 2:16

Stepper motors "want" to keep their position as they are told to by the firmware, therefore they do whatever it's needed (accelerate and brake) to follow the orders they received.

The question is: is the firmware telling them to move/accelerate/brake faster/harder than they can? if yes, they won't keep up (because of inertia and much more) so you'll see artefacts. If not, they will follow the orders exactly (well, mostly, but it's not important now) and no distortions will be there.

Whether they keep up or not is up to you: you are setting their power (the motor current) and you are telling them how fast/hard to move/accelerate/brake. If you push them too much, the motors will try... and fail to keep up. That's why you have max acceleration, speed, jerk in the firmware and in the slicer.

Additional info: even if the motors keep the position as they are told to, the motors have no knowledge of anything past them: belts, leadscrews, and so on.

Imagine the X axis belt (which connects the motor to the printing head) is made of an elastic band: the motors will be where you order them to be, but the inertia of the printing head will stretch the elastic band and the printing head will NOT be where you expect it to be.

It is again up to you to reduce the max acceleration to a value below what the motors could be able to do, if needed. Motors are often not pushed to their limit also because other factors cause issues before the motors fail.

How to know how much to limit the acceleration and speed? the only way is trying.

• The rubberband example actually uses inertia in the non-physical way. The rubber band acts as a spring, so any happening is delayed by a factor of the length of the band and the spring coefficient of it Feb 11 '21 at 22:16
• @Trish it may not be completely rigorous, but I think it answers the question in a quite clear way for people not particularly versed in physics :)
– FarO
Feb 12 '21 at 10:09

# Inertia is not what you think it is

Inertia is technically speaking something that in physics is not what you commonly understand under the term. There is no mysterious "Inertia Force" that slows your actions on a setup. Inertia is not what makes you overshoot a print's endpoint.

Inertia is just the principle why you need to break (negative acceleration) before you reach the endpoint of travel and how much you need to and how fast you can step on the break (jerk).

## Recap on Newtonian Motion Mechanics

Inertia is the fact that an item that is under movement and does not get acted upon just does nothing, as Newton's first law prescribes. That your applied force only takes effect on a body over time (the common thing understood under inertia) follows directly from the description of the 2nd Law of Newtonian Mechanics:

Mutationem motus proportionalem esse vi motrici impressae, et fieri secundum lineam rectam qua vis illa imprimitur.

The alteration of motion is ever proportional to the motive force impressed; and is made in the direction of the right line in which that force is impressed.

$$F=\frac{d}{dt} (m\times v)$$

The Force onto a body is the change over time($$\frac{d}{dt}$$) of mass and velocity. In the classics physical case with constant mass, this becomes the much more well known formulation: $$F=m\times \frac{d}{dt} v=m\times\dot v=m\times a$$

Now, we have an item of known mass and a known initial velocity $$v_0$$. The speed of the item at any moment is thus $$v(t)=v_0-(\frac F m\times t)=v_0-(a\times t)$$

### Momentum

Another thing that is often mingled into the therm inertia is actually the momentum of an item. It follows directly from the newton text: the force is proportional to the change of momentum. $$F=\frac{d}{dt}p=\frac{d}{dt}(m\times v)$$$$p=m\times v$$ Momentum can be best understood as an amount of "energy" (it's not, energy is $$E_\text{kin}=m\times v^2$$)

# The principle of inertia is looked at in the slicer

Most slicers set a maximum acceleration for machines and jerk for machines. These values are decided based on the mass of the printhead: Maximum acceleration times the mass of the printhead is the maximum force. Jerk is the derivate of acceleration over time, so it flows into motion mechanics back as $$F(t)=m\times j\times t$$. So choosing the Jerk and Max-acceleration does include information about the mass of the printhead, without expressly stating it.

One could write the code in reverse and decide on a maximum allowable Force and include the mass of the printhead, resulting in automatically calculated settings for the maximum allowable 2nd and 3rd derivate of the position, acceleration and jerk.

# Printer control boards just throttle

Likewise, printer control boards just throttle acceleration and jerk to a value in their firmware. They don't need to know the mass of the printhead if they put maximum values on both, and those account for the behavior wanted.

There is no accuracy to be gained from doing the calculation the other way around in the firmware: Even knowing the mass and some allowable force would not get you any way closer but spend quite some code on a function that is called for a few static values.

What is more influential, the acceleration and jerk settings are very heavily influenced by how your printhead is mounted, not just the mass of the printhead: Do you have a feather mounted on linear rails and moved with a screw? Or do we have a kilo chunk of lead mounted on a cross of 2 mm aluminium rod rails, pulled with a super soft rubber twist?

• I think I was using inertia properly. I mean, for example, that once the print head is moving it might overshoot its position objective. The Jerk settings do speak to what I'm talking about. Do they just have a flat estimate of the mass? Feb 11 '21 at 14:12
• @ZECTBynmo "Overshooting" is exactly why I said you understand inertia wrong. You need to just reduce the max acceleration and jerk. Feb 11 '21 at 18:33
• Thanks for the responses. I understand the comments about jerk and max acceleration - although my question about how those settings are setup is not answered. Are there any controllers that dynamically measure mass constants for those values? Also, your comments about inertia don't make sense to me - those jerk settings are specifically to correct for the effects of inertia I'm talking about, no? Feb 11 '21 at 18:50
• Anyway thanks for pointing me in the direction of jerk/acceleration limits. I'll see if I can find projects that dig into setting those dynamically. Feb 11 '21 at 19:00
• @ZECTBynmo let me put something straight: to calculate all those values (e.g. deforming of rails etc.) influencing the actual movement path in real time, your machine would need to model the behavior of the whole machine in every moment. That is a task for a supercomputer. I am not aware of any commonly used firmware that even would allow to set a mas value for the printhead, let alone use that to calculate anything. Feb 11 '21 at 19:11