2019年12月2日星期一

Tips on How to Mount A Stepping Motor?

If you are new to step motors, you may be wondering how to mount one in your application. You’ll need to be concerned with three things: piloting the motor, fastening it to the mounting surface, and coupling the shaft to your load.
The motor outline drawing below, which we acquired from a vendor of high quality step motors, highlights all three:
Item 1 is the shaft. You’ll need a coupling to connect the shaft to your load. We’ll cover this in more detail in a future post.
Item 2 is the pilot. You’ll need a precise hole in your mounting bracket that is concentric to whatever you’ll connect to the motor shaft.
Item 3 represents the feature you’ll use to fasten the motor to the mounting surface – in this case four through holes that can accept a screw or bolt.
If you’re not up for machining your own, mounting brackets in standard sizes like NEMA 17, 23 and 34 are available for purchase. Since step motors generate heat, aluminum mounting brackets are preferable to steel because aluminum will conduct heat out of the motor more efficiently, so you can likely get by with a smaller, less expensive motor. We like this size 23 step motor mounting bracket from Amazon, which includes the necessary pilot hole and four tapped mounting holes for #8-32 screws. They even include the screws.
Now let’s check the mounting details for popular NEMA step motor sizes.
  • Shaft diameter: typically 12.7 mm (1/2 inch), 5/8” on longer motors
  • Mounting holes: four 5.5 mm through holes, 69.6 mm apart
  • Pilot: 73.02 mm

  • Shaft diameter: typically 6.35 mm (1/4 inch)
  • Mounting holes: four 5.1 mm through holes, 47.14 mm apart
  • Pilot: 38.1 mm


  • Shaft diameter: typically 5 mm
  • Mounting holes: four #4-40 tapped holes (M3 from some suppliers), 31 mm apart
  • Pilot: 22 mm

  • Shaft diameter: typically 5 mm
  • Mounting holes: two #4-40 studs, 26 mm apart
  • Pilot: 22 mm

  • Shaft diameter: typically 5 mm
  • Mounting holes: four M2.6 tapped holes, 23 mm apart
  • Pilot: 22 mm

  • Shaft diameter: typically 4 mm
  • Mounting holes: four M2 tapped holes, 16 mm apart
  • Pilot: 15 mm

2019年11月29日星期五

Tutorial on Calibrating Stepper Motor Machines with Belts and Pulleys

While making machines which is actuated by stepper motors without closed loop step motor control, you more often than not want to calibrate the stepper motors in software to make the machine move exactly as you want it to. If you tell the machine to move 10 mm in a direction, you don’t want it to move 9 mm or 11 mm.
A popular stepper motor standard: the NEMA 17
A popular stepper motor standard, the NEMA17 motor, used together with a GT2 belt and pulley and a Grbl Arduino shield.
In motion control software (such as Grbl) you need to specify an axis’ steps per mm or equivalent, i.e. how many steps the motor has to run to achieve a motion of 1 mm (note that this number doesn’t need to be an integer).
So, how do we find this number? Before going into that, we’re going to talk about some stepper motor basics and microstepping.

Microstepping

A very common resolution for stepper motors is 200 steps per revolution (aka. 1.8 degrees per step). We will use this resolution as an example in the rest of this post. Often 200 steps per revolution may not be sufficient to acheive the accuracy required by the men upstairs.
To increase the accuracy you can enable microstepping. This will increase the number of steps per revolution with a factor of 2n (n is an integer). Microstepping up to 8x (i.e. 8 times the full step resolution – resulting in 1600 steps per revolution in our example above) is common, but you may even find stepper systems with 256x microstepping.
One VERY important drawback with microstepping you should take into consideration is that the holding torque drastically decreases as the microstepping factor increases. According to oyostepper.com a microstepping factor of 8x will give you only 19.51% holding torque compared to what you get from not enabling microstepping (256x microstepping will give you as little as 0.61% of the original holding torque)!
Holding torque graph at different microstepping settings (from http://micromo.com)
Holding torque graph at different microstepping settings (from http://micromo.com)
Thus microstepping is a dangerous double-edged sword that should be handled with great care.

Calculating Steps/mm Using Belts and Pulleys

In many of our machines we have used belts and pulleys to actuate them. These belts and pulleys come in many shapes and sizes, but one standard we have grown accustomed to is the GT2 standard. GT2 belts and pulleys come in (at least) three different sizes: 2 mm, 3 mm and 5 mm pitch.
Differently sized GT2 belts (from http://instructables.com)
Differently sized GT2 belts (from http://instructables.com), millimeters in parenthesis.
The following equations obviously work with chains instead of belts as well, as long as you input the correct pitch. Note that these equations don’t take backlash into account.
Linear Motion
Here’s a simple equation you can use to calculate steps per mm for linear motion with belts and pulleys.
linear_eq
srev is the number of steps per revolution for the motor
fm is the microstepping factor (1, 2, 4, 8 etc.)
p is the pitch (e.g. 2mm)
Nt is the number of teeth on the pulley attached to the motor shaft.
EXAMPLE: Using the motor in our previous example with 2x microstepping, 2 mm pitch belts and a 20 teeth pulley will give us 10 steps per mm, i.e. a resolution of 0.1mm.
A typical setup to use this equation for can be a trolley which moves linearly along an axis. One end of the belt (an open-ended one) is attached to the trolley and goes around the motor pulley, then around an idle pulley on the opposite side of the motor before the other end is attached to the trolley as well (this scheme is used both in this and this project).
One of our earlier machines where we used stepper motors for linear motion
One of our earlier machines where we used stepper motors to acheive linear motion
Rotational Motion
Sometimes you want to keep things rotational. Perhaps you want to draw on a cylindrical surface or make a miniature steamroller to drive back and forth? Imagine a setup with a closed belt going around two pulleys just like the chain on a bicycle. One of the pulleys is attached to the motor shaft while the other pulley is attached to a shaft on a different axis (for instance the roller on our miniature steamroller).
A tiny steamroller
A tiny steamroller
Here’s a usable equation to calculate steps/mm for this kind of setup:
rot_eq2
srev is the number of steps per revolution for the motor
Nf is the number of teeth on the final (passive) pulley
fm is the microstepping factor (1, 2, 4, 8 etc.)
Nm is the number of teeth on the motor pulley
Dr is the diameter of the roller in our steamroller example.
EXAMPLE: Using the same motor as before with 8x microstepping, a 40 teeth pulley on the roller axis, a 20 teeth pulley on the motor axis and a 200 mm roller diameter will give us approximately 5.09 steps per mm, i.e. a resolution of around 0.2 mm.

Post-calibration

To confirm that the calibrations are correct, or just to make them more accurate, you should do some simple “post-calibrations”. This is particularly easy if you’re calibrating a drawing machine, 3D printer, a CNC machine or anything else that leaves a distinct measureable mark. To do this simple, but effective calibration process, tell the machine to move a certain distance (not too short). Measure the distance traveled and compare it to the intended travel distance. If they are identical: HUZZAH! If not, adjust your steps/mm settings with a ratio equal to the error.

2019年11月25日星期一

How to Control NEMA17 Motor with A4988 Driver

If you’ve come to this article, you’re probably at the same point as I was before I made my stepper motor move without noise, vibration or jump steps. That’s why in this article, I will provide a sufficient level of depth to know how to control a stepper motor (for example – a NEMA 17 or other stepper motor size) and fixing the problems that may arise.
When a stepper motor is used in a 3D printer, most likely a team of electronics and programming experts makes calculations and put everything together to works perfectly. Instead, when I try to use the same stepper motor in a hobby project (after a normal 8 hours daily job) it’s quite different. Moreover, things get complicated if you have a low budget and just wanted to use the stepper motor to make a robot or rotate a cup holder like in the way I did. All of these situations may give you big headaches.
Let’s start with the beginning and I’ll tell you in a few words from where the whole story started. It is possible to write a long story in this article, but I have a lot to explain to you about stepper motors.