Stepper motor

From RepRap
Revision as of 23:41, 26 May 2013 by Virtlink (talk | contribs) (Moved all stepper motor model specific info away. This page is for stepper motors in general now.)
Jump to: navigation, search
StepperMotor-reprap-stepper.jpg

Stepper motors are one kind of electric motor used in the robotics industry. Stepper motors move a known interval for each pulse of power. These pulses of power are provided by a stepper motor driver and is referred to as a step. As each step moves the motor a known distance it makes them handy devices for repeatable positioning.

There are two major types of stepper motor known as bipolar and unipolar. Wikipedia has further information on stepper motors. Please see Wikipedia. A good diagram showing a stepper motor's mechanical operation is here.

An editor has suggested splitting this page into smaller sections. (Discuss)

Terms

NEMA
Refers to the frame size of the motor as standardized by the US National Electrical Manufacturers Association in its Publication ICS 16-2001. It specifies the “face” size of the motor but not its length. For example a NEMA 23 stepper has a face of 2.3 x 2.3 inches with screw holes to match. Note: just because a motor is bigger does not mean it is more powerful in terms of torque. It is perfectly possible for a NEMA 14 to “out pull” a NEMA 17 or a NEMA 23.
Bipolar and Unipolar
These terms refers to the internals of the motor. Each type has a different stepper driver circuit board to control them. In theory a RepRap could use either, but in practice most are bipolar.
Micro stepping
A stepper motor always has a fixed number of steps. Microstepping is a way of increasing the number of steps by varying the amount of electricity sent to the coils inside the stepper motor. In most cases, micro stepping allows stepper motors to run smoother and more accurately.

Bipolar Motors

StepperMotor-bipolar stepper sch.png

These motors are the strongest type of stepper motor. You identify them by counting the leads - there should be four or eight. They are also the type of motors we are using in the RepRap Project's Mendel & Darwin designs. They have two coils inside, and stepping the motor round is achieved by energising the coils and changing the direction of the current within those coils. This requires more complex electronics than a unipolar motor, so we use a special driver chip to take care of all that for us. Some designs (the eight-wire ones) split each coil in the middle so you can wire the motor either as bipolar (short the middles) or unipolar (short the middles and treat the link as the centre tap - see below).

Unipolar Motors

StepperMotor-unipolar stepper sch.png

Unipolar motors have two coils, each one has a centre tap. They are readily recognizable because they have 5, 6 or even 8 leads. It is possible to drive 6 or 8 lead unipolar motors as bipolar motors if you ignore the centre tap wires. 5 lead motors have both centre taps connected, so re-wiring them to a 4 lead version requires at least opening the motor, if it can be done at all.

The main beauty of unipolar motors is that you can step them without having to reverse the direction of current in any coil, which makes the electronics simpler. Some early RepRap prototypes used this trick. Because the centre tap is used to energise only half of each coil at a time, unipolar motors generally have less torque than bipolar motors.

Stepping Angle

Most stepper motors used for a Mendel have a step angle of 1.8 degrees. It is sometimes possible to use motors with larger step angles, however for printing to be accurate, they will need to be geared down to reduce the angle moved per step, which may lead to a slower maximum speed.

Micro stepping

Microstepping between pole-positions is made with lower torque than with full-stepping, but has much lower tendency for mechanical oscillation around the step-positions and you can drive with much higher frequencies.

If your motors are near to mechanical limitations and you have high friction or dynamics, microsteps don't give you much more accuracy over half-stepping. When your motors are 'overpowered' and/or you don't have much friction, then microstepping can give you much higher accuracy over half-stepping. You can transfer the higher positioning accuracy to moving accuracy too.

History

Stepper Motor History for Darwin (V1.0 RepRap)

The RepRap Darwin used a NEMA 23 stepper motor. This stepper motor was a unipolar stepper motor which could be configured as a bipolar. This design used 3 stepper motors, one for each axis, and a DC motor for its extruder. Later many people upgraded their extruders to increase their control of the extruder.

Note the Generation 2 electronics supported the first configuration with 3 stepper driver circuit boards for the steppers and a PWM circuit board to control the DC motor.

The Darwin stepper motor requirements were as follows:

Parameter Specification
Size NEMA 23
Type Bipolar
Shaft dual-output shaft
Torque 100 oz-in or about 0.71Nm (71 N-cm)
Resistance about 10 ohms, or 1 to 30 ohms


Note

If you are using the PIC controller (Note: Generation 1 electronics) you need a motor that will use about 1A per winding at 12V - that is, around 10 ohms. The Arduino circuit can be adjusted to accommodate a wider range of steppers, but remember that if you specify a low-resistance one and the Arduino controller has to chop the voltage to limit the current going through it, that will also limit the torque.

Stepper Motor History for Mendel (V2.0 RepRap)

The RepRap Mendel used either NEMA 17 or NEMA 14 bipolar stepper motors. It used four stepper motors: one for each of the three axes and one for the extruder.

Note this configuration of four stepper motors was supported by the 3rd generation electronics.

The Mendel stepper motor requirements were as follows:

Parameter Specification
Size NEMA 17 or 14 (prototype was NEMA 14)
Type Bipolar
Shaft dual-output shaft (need to make knurling the stepper shaft easier, not applicable to recent geared extruders)
Torque 0.137 Nm (13.7N-cm or 19.4 oz-in)
Resistance Must be over 6 ohms (not applicable to recent stepper controllers, see "current" below)

Models and suppliers

The different stepper motor models and their suppliers can be found on their respective pages:

Holding Torque

It is recommended that you get approximately 13.7 N-cm (0.137 Nm or 1400 g-cm or 19.4 ozf-in or 1.21 lbf-in) of holding torque (or more) for axis motors to avoid issues, although one stepper with less has been used successfully (see below). If in doubt, higher is better.

For Wade's Geared Extruder (most widely used one as of 2012) it is suggested to use motor that is capable of creating a holding torque of at least 40 N-cm (0.4Nm).

If you need to convert between different units for the torque you can use the torque unit converter here.

Size

If using the smaller NEMA 14 motors, aim for the high torque option. NEMA 14s are neater, lighter and smaller, but can be hard to obtain with the appropriate holding torque. NEMA 17s are quite easy to get in the specification that Mendel needs, but are bulkier and less neat. NEMA 14s are running near the edge of their envelope: they will get warm. NEMA 17s are well inside what they can do, and will run much cooler.

Note that any Mendel part that goes on to a stepper motor shaft expects the shaft to be roughly Ø5mm. If the shaft is a different size, you will need to make allowances for this in the parts you obtain/make.

Based upon the NEMA 17 specification (from what i can find) the mounting holes are spaced 1.22in or 31mm apart along the edge of the motor. This should help if you are using second hand / salvaged parts.

Wiring

Steppers motors come in several wiring configurations. 4, 6 and 8 wires are all fairly common and work fine with the standard RepRap electronics. 5 wire stepper motors exist but won't work with the standard RepRap electronics, because the 5th wire connects to both coil centers. See stepper wiring for more details.

Heat

Most of the motors specs give the current for two coils that will give an 80 °C rise, i.e. they can run at 100 °C! When using them on plastic brackets you need to under-run them to keep the brackets from melting. With PLA's glass transition temperature between 60-65 °C, you have to seriously under-run them! Fortunately temperature rise is proportional to power, which is in turn proportional to the square of current (P=I^2R), but torque is directly proportional so you can keep temperature under control without losing too much torque. For example, running a stepper at 70% of the rated current would result 70% of the torque and 49% (0.7^2=0.49) of the power dissipation and thermal rise.

Current

All recent stepper controllers use a current-limiting design. Because of this, the resistance (ohms) of the coils doesn't matter, as long as it is low enough for the current to rise fast enough for the current-limiting design to come into play. If the resistance is too high (i.e. 24V steppers) the current doesn't raise fast enough for reliable microstepping. For this reason, stepper motors rated for 3-5V and 1-1.5A are generally recommended, as these motors will perform near their peak torque with a current-limiting stepper controller (such as a Pololu A4988).

Designs which use a separate "extruder controller board" sometimes use H-bridges (which are designed for running a DC motor) instead of a proper current-limiting stepper controller. On these boards, you need to be careful not to turn the current (PWM) too high, especially with low-ohm (low voltage) motors. You run the risk of overheating both the stepper motor and the H-bridge chip.


Unscientific rules of thumb for motor purchases

1) Generally, the longer the motor body, the more torque the motor has.

2) If a motor is rated to more amps or volts than your driver can produce, your motor will not produce the manufacturer's rated torque.

3) A motor can safely exceed its rated voltage with a chopping stepper driver (which is all the RepRap stepper drivers, save only the Gen3 electronics extruder board hack). It cannot exceed its rated current (amps) without severely overheating and dying a quick death.

4) Stepper motors are generally rated for a 50 °C temperature rise at rated current/torque.

5) ABS melts at 105 - 120 °C but softens at 80 °C. Therefore you probably can't run your steppers at their full rated torque without melting your plastic motor mounts.

6) Power is measured in watts (W) and is calculated as volts (V) × current (A).

7) Power made available to a motor will be turned into heat and motion.

8) The more power made available to the motor the higher the amount of heat and motion. Heat is proportional to current squared while motion is proportional to current, so losing a little motion (torque) can lose a lot of heat.

9) Current and torque are related. The more current, the more torque. More current also means more power requirement and more heat on motor and stepper driver.

10) A motor's rated amps, volts, or ohms (if missing from the spec sheet) can be calculated with the other two numbers using Ohm's Law. Or you can cheat and use a calculator.

Driving stepper motors

See motor driver.

Wiring Your Stepper

Pretty much all of our RepRap electronics are designed for Bipolar stepper motors. Every bipolar stepper motor has 4 wires that need to be wired to the driver board. These are labeled A, B, C, and D for lack of better terms. A and B are connected, as well as C and D. You can generally find out which wires are connected using a multimeter to measure the resistance. If you measure a small resistance (1-30 ohm) then they are connected. Generally, they are color coded and we have datasheets available, so things are easy.

On motors with six wires, you'll find 4 pairs with low resistance and two pairs with double the low resistance. These two pairs with high resistance are the ones you want. Ignore the remaining two wires and proceed as if you had four wire steppers. In a datasheet it's the middle wire of each of both coils which has to be ignored.

Shortcut for finding the proper wiring sequence

Reproduced by kind permission of Rustle Laidman at StepperWorld.com [1]

Connect the 4 coil wires to the controller in any pattern. If it doesn't work at first, you only need try these 2 swaps:

Name A B C D
Arbitrary first wiring order 1 2 4 8
Switch end pair 1 2 8 4
switch middle pair 1 8 2 4

You're finished when the motor turns smoothly in either direction. If the motor turns in the opposite direction from desired, reverse the wires so that ABCD would become DCBA.

NOTE: Some Reprap Electronics (such as RAMPS) will be looking for the endstops to be hooked up while testing the motor wiring as noted above. In this case you may see your motor move smoothly in one direction, but not at all in the other (as it thinks the endstop is triggered). If your firmware allows you to disable endstops you should do so for testing motor wiring, or alternatively you can connect the motor to the Extruder stepper motor connector to check that it moves smoothly in each direction.

Another Note: The procedure above doesn't always work in two steps, (e.g, if your setup needs "1" matched with "4"). Swapping the 2nd with the 4th, then the 2nd with the 3rd would be more certain.

Stepper Motors

There is a good article on Wikipedia explaining the technology behind stepper motors. The physical size of stepper motors are usually described via a US-based NEMA standard, which describes the bolt-up pattern and shaft diameter; the RepRap site has an article explaining the standard. In addition to the NEMA size rating, stepper motors also also rated by the depth of the motor in mm, the longer the motor typically the more powerful. Stepper motors also have a step size rating, 4 steps within each cycle. The step size, divided into 360 degrees gives the number of steps per revolution. For example, "1.8 degrees per full step" is a common step size rating, equivalent to "200 steps per revolution".

Some stepper motor controllers generate 'microsteps' by generating a sine/cosine waveform for the stepper coils. The microsteps become less accurate then the full size steps, but allow finer control and smother operation. Also check the motor torque and the current draw to compare stepper motor strengths.


The pages related to building a Mendel has a list of suppliers of stepping motors.

The power of a motor is usually proportional to the physical size of the motor, The Darwin version of RepRap primarily used NEMA 24 motors, whereas the Mendel version is designed to use either NEMA 14 or NEMA 17 motors. The more commonly used size is NEMA 17 as it is easier to find NEMA 17 motors with sufficient torque compared to NEMA 14.

The StepperMotor page has even more details about the most common motors used in a RepRap/RepStrap.

Torque

The Mendel officially requires 13.7 N-cm torque (0.137 N-m or 1400 g-cm or 1.215 lb-in) for each of the X, Y and Z axes. Recent designs for extruders (ExtruderController) almost exclusively require stepper motors as well, but no torque requirements have been given in those designs.

Stepper motors do not offer as much torque or holding force as comparable DC servo motors or DC gear motors. Their advantage over these motors is one of positional control. Whereas DC motors require a closed loop feedback mechanism, as well as support circuitry to drive them, a stepper motor has positional control by its nature of rotation via fractional increments.

Power and current

All stepper motors will have certain specifications for voltage and current (typically 2.8 V and 1.68 A); as long as the stepper driver/controller does current control, you can use any supply voltage greater than the motor's rated voltage. In fact, a large difference is advantageous to the top speed of the motor. If the driver/controller does not do current control, you must use a supply voltage fairly close to the motor voltage (no more than 2x the voltage specified by the manufacturer) or the motor will overheat and burn out its winding insulation or demagnetize its rotor.

The version 2.3 RepRap axis controllers do have current control.

Stepper drivers vs stepper controllers

See motor driver


Further reading

  • motor driver
  • The PMinMO wiki: "Motors" article gives some recommendations for CNC motor selection.
  • Some Wikipedia: linear actuator#Electro-mechanical actuators, rather than the motor spinning the lead screw as in most CNC designs, instead the motor spins an internal lead nut, pulling the motor up and down a (non-spinning) lead screw that passes all the way through the motor. The electronics works identically to other stepper motors -- standard stepper motor electronics can drive it. One RepRap researcher points out that this makes the mechanics simpler and, with a few changes to the design, could potentially lower total cost of a RepRap.[2][3][4]
  • Stepper World has a great series of articles about how stepper motors work.
  • CNC Information has some information on how stepper motors work along with many other CNC related categories.