Motion control
Smoothie reads G-code instructions, and converts those into movement, typically by turning motors.
While that might sound pretty trivial to do, the laws of physics actually make this a bit more challenging that one might expect.
This page explains how to configure the different motion control parameters you can tune in Smoothie.
NOTICE
NOTE you MUST define at least alpha, beta and gamma in a valid config file, do not comment out gamma even if you are not using it.
Acceleration
Acceleration
Or "the increase of speed". You experience it everyday.
When you ask Smoothie to move a certain distance at a certain speed, it starts at a speed of 0 ( not moving ).
If it goes instantly to the requested speed, in most cases, that won't work: A motor can not go from a speed of 0 to several rotations per second instantly. It needs to accelerate to that speed.
Similarly, the axis which is controlled itself has a given weight that needs to be moved. The faster you accelerate, the more force is required to accelerate the mass to the target speed.
This means that for any given machine, you must tune your acceleration. And that acceleration's value is a function of the torque of your motors, and the weight of whatever needs to move.
You set the acceleration value by modifying the Acceleration value in your configuration file :
acceleration 3000 # Acceleration in mm/second/second.
Acceleration
Force is mass times acceleration
The units is millimeters per second per second, which means how many “millimeters per second “worth of speed is added every second.
3000 is a pretty common value for a 3D printer or laser cutter, since they have very little mass to move.
200 is a common value for CNC mills or routers since they have much more mass to move, and have to apply forces to their tool.
There is no mathematical/easy way of determining a perfect value: you are going to need to try values and find the one that works best for you.
If you feel like your machine is too slow, you increase acceleration. If your machine starts losing steps, losing it's position, or shakes too much, you reduce acceleration.
Note that you do not need to reset your Smoothieboard to try new values. You can start a “job”, and while the job is executing, try new values using the M204 M-code. For example, M204 S2000 sets acceleration to 2000 ( it takes a few seconds for this to take effect after the command is sent ).
Z axis
On some machines, your Z axis is very different from the others and has different requirements and capabilities.
On those machines, you can set the acceleration for Z separately, by editing the Gamma.acceleration value.
Junction deviation
Smoothie accelerates when it starts a move, and decelerates when it stops the move.
But what about if you move forward, then need to move somewhat to the right ? Do you really want to decelerate to a speed of zero before moving to the right ? That'd be a huge waste of time.
Junction deviation determines how much to slow down, proportional to how much the direction changes.
It doesn't really have a unit, it's just an arbitrary ratio. The smaller junction deviation is, the more we slow down on direction changes. The larger it is, the less we slow down on direction changes.
This generally means you can configure how much the machine “shakes” when moving : The less the machine slows down when changing direction, the more force is transfered to the structure of the machine, and the more the machine will shake.
But the more sturdy the machine it is, the higher junction deviation it will be able to handle without shaking.
Like acceleration, this is a value you will have to “play with” to find the right value for you.
You change it by changing the Junction_deviation value in config.
junction_deviation 0.05 # Similar to the old "max_jerk", in millimeters,
0.05 is a typical value for a 3D printer. If your printer is very sturdy, you could use 0.1. 0.005 is a typical value for a CNC mill or router, though for some machine you might need to go to smaller values like 0.001.
You can learn more about Junction Deviation in this forum post
Maximum speeds
Where speeds are concerned, Smoothie makes the distinction between two very important things: axes and actuators.
An actuator and an axis are two different things. An actuator is the thing that the motor causes to move directly. The axes are pretty much the coordinate system for the “tool”, and the system the Gcode uses.
On a cartesian machine, they are the same thing ( X is alpha, Y is beta, etc. See Greek_alphabet ). But on a linear delta machine for example, they are different.
On a linear delta, the actuator is the linear axis that moves along a tower, while the axis ( or effector ) is the thing at the end of the arms that moves the tool.
In Smoothie, you can set maximum speeds for both of those systems separately.
Setting a maximum speed ensures that Smoothie will never go higher than that speed for that axis or actuator. This is useful if the machine would “skip” steps or have other problems if a too high speed was required, which is the case in most machines.
To set the maximum speed for an axis, edit the Max_speed configuration option for that axis :
x_axis_max_speed 30000 # mm/min
The units for the speed limit is millimeters per minute.
To limit the speed for an actuator, set the Max_rate for that actuator :
alpha_max_rate 30000.0 # mm/min
Acceleration
Note that increasing acceleration allows reaching higher maximum speeds, in general.But decreasing acceleration also decreases the average movement speed over a whole G-code file.
This is because of physics and inertia.
Adjusting Z once printing starts (sometimes called babysteps)
You can adjust the Z while it is printing by using the WCS offsets. For instance to raise the head 0.1mm.. 1. G10 P0 L2 Z0.1 # this will set the Z WCS to 0.1mm higher, however it will NOT move the head immediately as it only takes effect on the next G1 that has a Z in it 2. G0 Znnn # this will move the Z after the last received g code to nnn, you will need to make sure that nnn is the actual z height you want right now (usually the Z it is currently at, as 0.1mm will be added to that due to step 1)
A better and easier way is in the very latest edge build. G43.2 Z0.1
will raise the Z by 0.1mm by setting the Z tool offset and also queing a move by 0.1mm, this is not instant but will happen when the previous g codes have executed. It can be cancelled with G49. NOTE as this uses tool offsets a multi extruder setup executing a T0 or T1 will reset the offset to the default for that tool.
If you want to do baby steps from the panel menus, you can easily do this using the custom_menu ( see http://smoothieware.org/panel#all-configuration-options ) feature of panels:
custom_menu.babystepup.enable true # custom_menu.babystepup.name Baby step up # custom_menu.babystepup.command G43.2 Z0.05 # custom_menu.babystepdown.enable true # custom_menu.babystepdown.name Baby step down # custom_menu.babystepdown.command G43.2 Z-0.05 #
All options
There are all the options related to motion control
Option | Example value | Explanation |
---|
For devs
Under the hood
Smoothie's main job is to convert Gcode into movement. Motion control modules ( in the source code src/modules/robot ) are the various steps in that process. For more on that process, see Howitworks, for general use and configuration documentation on Smoothie's motion control, see below :
External resources
Video about maximum speeds