logo
logo
Sign in

How to use stepper motor?

avatar
stepperonline
How to use stepper motor?

Controlling stepper motors is a broad topic and this article is a simplified beginner's guide to use stepper motors. It covers the basics of how stepper motors operate. Its purpose is to help beginners get stepper motors running.

To drive a stepper motor you usually need the following equipment:

  • Stepper motor
  • Stepper motor driver
  • Controller
  • Switching power supply

How to choose the proper equipment

1. Stepper motor

A stepper motor is an electromagnetic device that moves in discrete steps. It has several coils which are organized into phases. When each phase is energized in turn, it causes the motor to step. With stepper motors, you can achieve precise positioning and speed control. There are three main ways that a stepper motor can be driven. These three driving ways are full-step drive, half-step drive, and microstepping.

You need to select the right stepper motor for your speed and torque requirements based on data such as frame size, step angle,holding torque, rated current, number of leads, and unipolar or bipolar. I will explain some of these important concepts next.

Nema: Nema is not a standard for the electrical characteristics of stepper motors. It is simply a standard for faceplates and mounting holes to facilitate motor interchangeability. For example, the "17" in "NEMA 17" refers to the faceplate size, which in the NEMA standard is the "number" of NEMA divided by 10 inches. Thus, a NEMA 17 motor has a faceplate that is approximately 1.7 inches wide.

Step angle: The step angle indicates the rotation angle of the stepper motor when the control system sends a stepping pulse signal. The step angle of the general two-phase stepper motor is 0.9°/1.8°, the three-phase stepper motor is 1.2°, and the five-phase stepper motor is 0.72°.

Speed-torque: The operating performance of stepper motors at low speeds is of more practical importance. Stepper motors typically operate at speeds of 300 to 600 rpm. Considering that the user uses a mechanical reduction device to carry the load, the normal speed of the motor is often selected at tens of rpm to provide sufficient torque for the motor. In this case, the motor provides high force, high efficiency and low noise.

As for the vibration problem, it should be solved by increasing the drive subdivision. Subdivision is the drive's control of the motor after each pulse sent by the upper computer is subdivided by a multiplier set by the drive. Simply put, it is the reduction of the motor's step angle by the subdivision multiplier.

Motor speed calculation formula: Motor speed (unit: RPM) = pulse frequency (unit: Hz)*60/subdivision.

Holding torque: The holding torque is the amount of torque required to move the motor one full step while the coils are energized and the rotor is stationary. The stepper motor winding is energized even if the rotor itself is stationary. This is to maintain the load in place while stationary.

Shaft style: You need to know the physical shape of this motor shaft in order to match your stepper motor to gears, pulleys, and other external connections such as shaft couplers. There are several common shapes. Additionally, the length of the shaft needs to be considered.

Some common types of shafts are listed below:

  • Round Shaft - round shaped shaft
  • "D" Shaft - a "D-shaped" shaft that is useful for mounting gears with set screws.
  • Geared Shaft - a shaft with a gear etched into it.
  • Lead-screw shaft - a shaft shaped like a screw, used for building linear actuators.

Rated Current: This refers to the peak current. This is a useful specification because it allows you to select a suitable driver and power supply for your stepper motor.

2. Stepper motor driver

Stepper motor driver generally has to be used in conjunction with stepper motor, so when you buy a stepper motor, it is best to match a suitable driver at the same time to reduce the trouble later.

Almost all stepper motor drivers use a standard protocol to control the motor. It uses 3 pins:

ENABLE - The driver will only operate when the ENABLE pin is pulled LOW or HIGH, depending on the driver.

DIRECTION - When LOW, the motor will rotate in one direction and when HIGH in the other direction. This is related to how you connect the motor.

STEP - Whenever the STEP pin goes from low to high, the stepper will make one step (or microstep, depending on the driver's settings).

3. Controller

Stepper motor controller is capable of sending high speed pulse signals and is programmable. PLC, microcontrollers and other devices are common controllers on the market.

4. Switching power supply

It is better to use switching power supply for stepper motor. It has a strong anti-interference ability and allows a wide range of fluctuations. The current needs to be selected according to the size of the load. It is necessary to leave a certain amount of margin. For example, the stepper motor current is 3A, the control load current 2A, the switching power supply should be selected 6A to 8A.

How to wire a stepper motor to a driver

You need to figure out which wires make up the coil pairs. Here’s three ways to figure this out.

1.You can use a multimeter and measure the resistance between the wires coming from the stepper motor. If you have a reading, it's a pair. If not, it's not a pair.

2.In addition, if you don't have a multimeter, turn the motor while touching the wires. Whichever combination makes it difficult to move the motor, it's a pair.

3.Of course, it's not practical to sort out all possible combinations of connections with an ohmmeter or by feel. It is still easiest to connect the motor according to its datasheet. Assuming you don't already have one, then read the model number off the motor and search online. You may need to contact the supplier to get the data sheet for the motor. STEPPERONLINE provides the appropriate data sheet, or you can contact customer service if anything else is still unclear.

The following diagram shows several different winding arrangements:

Moving the motor

Once you have everything connected correctly, you can upload the firmware to a microcontroller like Arduino. When creating some custom things, you need to program it on the Arduino. You can make use of the Arduino Stepper Librarywhich comes packaged with your Arduino IDE. The stepper library handles the sequencing of the pulses that we will send to the stepper motors, and it can be used for a variety of motors, including unipolar and bipolar.

Currently Arduino's built-in stepper library can only control one stepper motor, if you need to control two or more stepper motors, then the AccelStepper library is a very good choice. The AccelStepper library, which is a high-level library written by Mike McCauley. You will need to use the Arduino IDE Library Manager to install this library, as it is not included in the Arduino IDE.

I hope this article has given you an idea of how to operate your stepper motor at the simplest level, and that stepper motors aren't really that hard to use after all. If you're designing a project that requires you to be able to position something precisely, then a stepper motor is an ideal choice.

collect
0
avatar
stepperonline
guide
Zupyak is the world’s largest content marketing community, with over 400 000 members and 3 million articles. Explore and get your content discovered.
Read more