A bit of theory:
« A stepper motor (or step motor) is a brushless DC electric motor that divides a full rotation of the motor into a number of equal steps. The motor’s position can then be commanded to move and hold at one of these steps without any feedback sensor (an open-loop controller). » (Wikipedia)
Because they work by steps, and you can accurately control how many steps you move in each direction, stepper motors are a very practical way of moving things to a desired position. This makes them great for most CNC applications.
Smoothie comes with stepper motor drivers designed for bipolar stepper motors, with a maximum current rating of 2 Amps.
10mH
is bad.
12V
, where "CNC" steppers have voltage below 5V.
Bipolar stepper motors have two poles (bi-polar). Each pole is connected to two wires. That’s 4 wires coming out of your stepper motor. These have to be connected to your Smoothieboard.
Each stepper motor driver on the Smoothieboard has 4 connections to that effect. (Stepper motor drivers are labeled M1, M2 etc…)
The tricky thing is often to find out which wires connect to which poles. If you just wire things at random, you have a chance it will work, but let’s be scientific about it. Several methods:
Now to connect the wires to the Smoothieboard. Let’s call one coil A, and the other coil B. It doesn’t matter which is which. Polarity also doesn’t matter, all it changes is the direction the motor turns, and you can change that in the configuration file. Now simply connect your two wires to the Smoothieboard’s 4 pins for that stepper motor driver as such: AABB or BBAA. Other combinations like ABBA or ABAB will not work.
Once your stepper motor is properly connected to your Smoothieboard, it is ready to be controlled.
In this example, a stepper motor is connected to the M1 driver, and power is provided to VBB (the main power input).
If you want to use larger stepper motors than the Smoothieboard’s drivers can handle (2A max), you need to use external stepper drivers.
You can find detailed information on how to wire an external stepper motor driver to a Smoothieboard in the External driver appendix.
Example configurations are available on GitHub.
You can also refer to the Configuration documentation.
The first thing you have to do is tell the stepper motor drivers what is the current rating for your stepper motors is. To drive the stepper motor correctly, the driver has to know the motor’s current rating.
Each stepper motor model has a precise current rating. You can drive your stepper motor at a lower current, which will make it more silent, but also less powerful. But you cannot drive the motor at a higher current than it is rated at. This would cause overheating, and possibly skipped steps.
The rating is often written on your stepper motor’s label (see picture on the right). If it is not, you can get it by googling the stepper motor model number, or by contacting your seller or manufacturer.
Once you have the correct rating, you can set the corresponding parameter in the configuration file.
Smoothie has a funny way of naming stepper motor drivers. Instead of naming them X, Y or Z, because this makes no sense in non-cartesian robots like delta robots, we name the drivers using Greek letters so they are arm application agnostic:
Label on the Smoothieboard | M1 | M2 | M3 | M4 | M5 |
---|---|---|---|---|---|
Axis in a Cartesian machine | X (left-right) | Y (front-back) | Z (up-down) | E0: First extruder | E1: Second extruder |
Greek letter | α (alpha) | β (beta) | γ (gamma) | δ (delta) | ε (epsilon) |
Current setting configuration option | alpha_current | beta_current | gamma_current | delta_current | epsilon_current |
Now, as described in the “Unboxing” paragraph, connect the board to your computer, open the “config” file with a text editor, and change the configuration value for each stepper motor driver to the correct value.
For example, if your alpha stepper motor has a current rating of 1.68A, edit the corresponding line to read:
alpha_current 1.68 # X stepper motor current
Do this for each stepper motor you have to connect to the board. (If you have a Cartesian robot, see which motor connects to which stepper driver in the array above. If you use another type of arm solution, see the specific documentation.)
A stepper motor driver operates in steps. It moves a certain number of steps in one direction, then a certain number of steps in another. You think in millimeters. You want your machine to go to a certain position in millimeters, then another position in millimeters.
You need Smoothieboard to convert the millimeters you ask of it, into steps the stepper motor driver understands.
That conversion depends on your exact arm solution. The most common, and the simplest, is the Cartesian arm solution, and it is the one we will focus on here. Documentation for other arm solutions can be found separately.
In the case of a Cartesian arm solution, you simply convert a certain number of millimeters to a certain number of steps. That is the steps_per_millimeter configuration option that you have to set for each stepper motor.
To compute it, you must multiply a certain number of factors.
The formula is as follows:
steps per millimeter = ((full steps per rotation) x (microsteps per step)) / (millimeters per rotation)
To help you, there is an awesome calculator by the awesome Josef Prusa: http://calculator.josefprusa.cz/
Once you know the correct value for a given stepper motor driver, set it in the config file.:
alpha_steps_per_mm 80 # Steps per mm for alpha stepper
Do this for each stepper motor driver.
In the case of your extruder stepper motor, the principle is the same, but the value is extruder_steps_per_mm
.
Here is a good video on steps per millimeters:
It is now time to test your stepper motors. For this, you will need to use host software like Pronterface or the web interface.
Now connect to your Smoothieboard over the serial interface. Power your machine on by plugging the PSU into the wall.
Now you need to move an axis to make sure the stepper motor is turning in the right direction. In Pronterface, click near the yellow arrow marked “+X”.
Your X axis will move. If it moved to the right, great! Everything is fine, and you have nothing to change. If it moved to the left, you need to invert the direction of that axis.
You do this by editing the configuration file, and inverting the direction pin for that stepper motor driver:
alpha_dir_pin 0.5 # Pin for alpha stepper direction
Becomes:
alpha_dir_pin 0.5! # Pin for alpha stepper direction
This is for your axes. In the case of your extruder, the config value is extruder_dir_pin
.
Save the config file, reset the Smoothieboard, connect again using Pronterface. Now the axis will move in the right direction.
Do this for each axis.