Saturday, November 23, 2019

What you need to know about the motor and drive types

In the previous section, I explained a high-level overview of how stepper motors are driven. But it’s more complicated than just hooking things up. There are different types of drives, motors and wiring schemas.

Bipolar and unipolar motors
Broadly speaking, there are 2 types of stepper motors – bipolar and unipolar. The difference is how coils inside the motor are wired up and how they can be energized to get correct magnetic poles for each step. It all boils down to a simple question. How many wires does a stepper motor have? Based on wires which come out of motor we can determine what kind of motor it is and what kind of drive we need to run it.

What you need to know about the motor and drive types


A 4-wire step motor can be only driven by the bipolar drive. 5-wire motor can only be driven by the unipolar drive since center taps are tied together internally. Motors with 6 and 8 wires can be used with both drive types since you can decide how to hook them up externally.

The difference is how coils inside motors are energized. In the bipolar motor current (polarity) must be reversed in wires for each step. Unipolar motors achieve pole reversal trough center taps in coils, but only energizing half of the coil same time. Adafruit has a good article about unipolar vs bipolar motor coils and wiring. It’s definitely a plus if you make yourself familiar with how they differ.

Driver types
Other than being unipolar and bipolar drives- there are also different ways how they control current and voltage in the motor windings. Primary types are the following:

constant voltage drives also referred to as L/R drives
constant current drives also referred as chopper drives
I don’t go into detail about unipolar drives or constant voltage drives since most likely you end up with a constant current driver with a bipolar motor. Chopper drives are the most popular these days because of the torque and speed limitations of L/R stepper drives.

Chopper drive benefits
When using a chopper drive, the nominal voltage of the motor is mostly irrelevant for practical purposes. At least for hobby user and Arduino enthusiast. So don’t get scared away from stepper motor based on very low rated voltage. The important figure is the rated current.

A chopper drive can run the stepper motor with much higher voltage than the motor’s rated voltage. Higher voltage allows the current to flow through the stepper motor faster, which gives the ability to turn it faster with more torque. Drive keeps current in the motor below the fixed value which keeps motor burning out. Additionally- higher voltage means less heat.

Fixed current is usually set by trimmer pot on the drive board. That allows you to change maximum current based on needed torque and rated current by motor specs.

https://article-realm.com/article/Writing-and-Speaking/Article-Writing/3754-How-to-choose-the-NEMA-23-or-the-NEMA-34-stepper-motors.html
http://www.stepperchina.com/2019/11/22/do-you-really-whichi-is-fit-for-you-nema-17-or-nema23/


How to drive a stepper motor for Common Question

If you are planning stepper motor for 3D printer, CNC router or some other machine which needs accurate positioning. Looking around leads you to a lot of people talking about stepper motors. But what are they exactly and especially- how to drive a stepper motor?

I have gathered some basic misconceptions and questions people have asked me over time about driving stepper motors. Starting with the high-level logic behind running a stepper motor and ending with some common questions and problems.

Consider this as a simplified beginner’s guide. I don’t go into the deep technical and calculation side of things which can get very complicated and application dependent. You can learn all that later. Your current mission is most likely to get the motor running and understand the basics behind running stepper motors.
How to drive a stepper motor for Common Question


What is a stepper motor?
There is a lot of resources online which go into great detail about different types of stepper motors and how they work. Check out, for example, this article about stepper motor types. But this is not important at moment. What you need to know is that stepper motors are not your average DC motors. They will not run by hooking up directly to the power supply. They usually have 4 wires, but there is also a 5, 6 and 8 wires stepper motors.

Stepper motor’s rotation is controlled by exciting coils in correct order and polarity. The motor moves exactly one small predefined angle (called a step) each time coil(s) in motor get excited. But motor will not run continuously- it holds the position while powered. Step angle is usually 1.8 degrees. This means you have to make 200 steps to make a complete 360-degree turn (1.8 * 200). Check out this excellent video on youtube which visualizes driving stepper motor by energizing coils in the correct order.

Even though they are used for accurate positioning, they don’t have any position feedback mechanisms like servos have. But if used correctly- there is no need anyway. Controlling rotation and position is done through making correct amounts of steps.

Friday, November 15, 2019

How to Connect the computer to the CNC controller

There are quite a few options to connect your computer whether it is a laptop or desktop to the CNC controller. The connection is also dependent on the software you intend to use. Mach3 is probably the most widely used for CNC routers and foam cutters. It was designed to use the parallel port with a DB25 (25 pins) cable. The parallel port is now obsolete and Mach3 would only run on Windows 32bit computers with the parallel port driver. This meant Windows XP was the last version you could use. But you can use it on modern computers with specialized hardware and drivers. My article here has much more detail 6 Solutions for Mach3 Obsolete Parallel Port Interface.

Don’t discount the old parallel port if you’ve got an old desktop computer laying around with a couple of gigabytes of RAM it will work just fine with Mach3 and LinuxCNC. You can usually pick them up very cheaply as well. This is a very reliable solution and I’ve used it for years on both Mach3 and LinuxCNC. You can also buy parallel port cards to add to a more modern desktop machine. This way you can dedicate the computer just to CNC. The majority of CNC controllers sold on eBay and Amazon that support Mach3 and LinuxCNC are still parallel port versions.

17HS15-1504S


If you’d prefer to go USB then you have a couple of options.

Use an Arduino based controller
Use a USB controller board or adapter for Mach3 or Mach4. LinuxCNC doesn’t support USB
Arduino based USB controllers
3d printers use Arduino based board and these are very popular. CNC routers and foam cutters can use these as well. The only downside is that you need to able to load compile and upload firmware to the board. This is fairly easy and there are many tutorials on how to do this. You won’t be able to use Mach3 or Mach4 with this setup. The Universal G-code Sender(UGS) is probably the most popular software to control the board. There are some forks of this for foam cutters as well. I’ll be doing an in-depth article on this soon.

USB for Mach3
To use USB with Mach3 you can buy a specialized controller board with drivers that support Mach3 or a USB to parallel adapter to connect to an old parallel port controller. This isn’t a generic adapter but a specialized CNC USB adapter. The best one of these is the UC100. More details here

Ethernet Controllers
These use your network port to connect to a specialized controller card or adapter that can connect to a parallel port controller, known as BOB(Break Out Boards) This works for Mach3/4 as well as LinuxCNC. (stepper motor power supply)


Suggested configurations
In these suggested configuations I’ll show what I would purchase using the following criteria. Machine intended use, budget and connection to the computer.


http://forum.reactivetrainingsystems.com/entry.php?76624-Current-and-voltage-we-need-to-supply-to-the-stepper-motors