Basic CNC

I'll give it a shot, but microstepping gets a little complicated. I will have to resort to visual aids.

Lets start with our software and how it communicates to our drivers (I have, in my previous posts, referred to these as "motor controllers" as well). Most home users are likely going to be using either EMC2/LinuxCNC, or Mach3 running on a PC. The software has to have some way of interacting with the real world, and most commonly that is through a parallel port and breakout board. When you configure the software, you select individual pins on the parallel port, and tell the software what they are connected to (x motor, y motor, z motor, spindle motor, home switches, etc). Motors take 2 pins each, one for "step", and one for direction. "Step" is what we have been talking about in previous posts. Its the pulse that makes the motor go. One pulse (parallel port pin goes to 5v, then to 0) causes the motor to advance one step. The direction pin controls the direction of advance. Nothing to tricky here.

So what do we need a driver for? First of all, your parallel port is only going to do about 5v at a couple milli-amps, not enough to power a motor, so we need something to boost that power. Secondly of all we talk lightly about "steps", and direction, but there is a lot more going on with the motor than it seems. Let's refer to my visual aid here. This diagram shows simple stepper motor, one that turns 90 degrees per step. In the middle we see the rotor (the thing attached to the output shaft). This is basically a permanent magnet (red is north, black is south). On the outside, we have what is called the "stator" (which means stationary). This is where the coils are. There are two coils, and each coil has 2 ends. The ends of coil one are P1a and P1b, and the ends of coil two are P2a and P2b.

Full Stepping

Now that we have that straight, lets get down to business. Recall that the north poles of magnets attract the south poles of other magnets, and repel the north poles of other magnets. Recall also, that if we run a current through the coils of wire in the stator, we are going to create an electromagnet (one pole will be north, the other, south, this switches depending on direction the current flows in the coil).

In our first diagram, we see the rotor at the zero position. Coil one is energized. When we hit our "step" pin, the driver is going to de-energize coil one, energize coil two. The rotor is now going to be attracted to coil 2, and will rotate 90 degrees. We get another step pulse, and the motor de-energizes coil two, and energizes coil one. This time, coil one is hooked up in the opposite direction of what it was in our zero position. The rotor turns. One more step. Coil 1 de-energize, coil 2 energized in reverse. One last step, and we are back to where we started. If we keep sending pulses the motor keeps advancing, if we change the value of the "direction" pin, the direction will reverse. The driver reverses the direction of the motor by going through the sequence above in reverse.

Half Stepping

So that's the basic stuff, but what is this "half step stuff".

Half stepping is a lot like full stepping. If you look at the second picture, in the second diagram, you will notice that we have energized both coils at the same time (unlike with full stepping, where we only had one active at a time. You will also notice that the rotor is half way between it's normal, 90 degree position (hence the name, half step). Notice that the two poles are both attracting the rotor, and assuming the current flowing through them is equal, they are going to pull with approximately the same amount of force, so the rotor is exactly between them. In this case, we only move 45 degrees between steps, and it takes us 8 half steps to make a full revolution. Otherwise, everything is the same.

Micro Stepping

Now that we have covered full and half stepping, micro stepping isn't so bad. It is basically half stepping taken a little further. Imagine that we have a motor driver that can do 10 microsteps per step. Remember when talking about half stepping where I said if we power two coils, and the current in each coil is the same, the rotor goes halfway between? Well, what happens if the currents aren't equal? Basically the rotor will be somewhere between the two, but it will be closer to the pole of the coil that has the stronger current running through it.

Lets say we start in our zero position, and coil 1 has 10A going through it. If we were in half step, we would leave coil 1 active, and send 10A through coil 2. With microstepping, we are gonna take things a little slower. Instead of sending the full current to coil 2, we will send say, 1 amp through coil2, and while we are at it, we will reduce the current through coil1 to 9A. On our next pulse, coil2 goes to 2A, coil1 goes to 8A. Then 3A and 7A, then 4A and 6A, then 5A and 5A (we're in the middle), etc. Now, instead of taking 4 pulses to do one revolution, it takes us 40.

Motor drivers are pretty complicated beasts, especially when you get into microstepping, but they are really easy to use. Servo drivers can be a little trickier to use, but I'll leave that for another time.

stepper_diagram.jpg
 
Ok, that's how the motor works when it's half stepping or micro stepping, and it's interesting to know, but more importantly why do I need to implement it ?
Is it to to be more accurate, or faster, or slower, or with more or less torque?
In other words, if I want to move an axis 6" from point A to point B, why would I choose to use less than full steps to get there?


M
 
This is great info, and much appreciated. If one were to try their hand at building a cnc machine, deciding which motor to use would depend on how much you are willing to invest in the motors, since, I am assuming, one type would be more expensive than the other. Would that be the main deciding factor in the type of motor to use, or are there other factors involved?

Patrick

Sorry Bill, I'm not trying to move off topic, but am trying to determine which way to go.
 
As covered above, microstepping is sort of a subset of half stepping. It can be used to acheive greater position resolution, but not without some compromises. Here's a fact list regarding microstepping:

1) Positional accuracy will be affected by the motor's inhenent detent torque. The detent torque is a sinusoidal function that completes one full cycle for every natural step position. Superimposing this on the ideal microstepping torque vs position yields a distorted position vs step curve for positions in between detents. If the motor has repeatable detent torque cycles, this can be compensated for to some extent by altering the shape of the microstepping.

2) Microstepping excels at driving loads with resonances at the desired step rates.

3) Microstepping falls flat on its face when driving loads with a lot of stiction.

4) Microstepping in a CNC application is best used with a stepper motor having MUCH more torque available than is needed to move the load. The reasons for this are complicated, but has to do with the flux angle vs the rotor's position angle. The motor will not generate enough delta torque between microsteps to actually move unless the load torque is much less than the available torque. This is less of an issue with continuous rotation as inertia helps keep you moving. If the motor is commanded to stop in between detents, it may not start moving again until the motor the commutation waveform yields a flux angle large enough to generate enough torque to overcome the load.

5) When microstepping, position is held by statically applying voltages to each coil. If power is removed (as with half stepping a motor in between detents) the dentent torque will cause the motor to drive into the nearest detent.

6) Microstepping waveforms are created by modulating the winding currents with sine and cosine of rotor position between detents. One step equals 360 elelctrical degrees regardless of the motor's inate step angle.

7) Only bipolar motors are usually microstepped (although polyphase motors also lend themselves well to microstepping).

John
 
As covered above, microstepping is sort of a subset of half stepping. It can be used to acheive greater position resolution, but not without some compromises. Here's a fact list regarding microstepping:

1) Positional accuracy will be affected by the motor's inhenent detent torque. The detent torque is a sinusoidal function that completes one full cycle for every natural step position. Superimposing this on the ideal microstepping torque vs position yields a distorted position vs step curve for positions in between detents. If the motor has repeatable detent torque cycles, this can be compensated for to some extent by altering the shape of the microstepping.

2) Microstepping excels at driving loads with resonances at the desired step rates.

3) Microstepping falls flat on its face when driving loads with a lot of stiction.

4) Microstepping in a CNC application is best used with a stepper motor having MUCH more torque available than is needed to move the load. The reasons for this are complicated, but has to do with the flux angle vs the rotor's position angle. The motor will not generate enough delta torque between microsteps to actually move unless the load torque is much less than the available torque. This is less of an issue with continuous rotation as inertia helps keep you moving. If the motor is commanded to stop in between detents, it may not start moving again until the motor the commutation waveform yields a flux angle large enough to generate enough torque to overcome the load.

5) When microstepping, position is held by statically applying voltages to each coil. If power is removed (as with half stepping a motor in between detents) the dentent torque will cause the motor to drive into the nearest detent.

6) Microstepping waveforms are created by modulating the winding currents with sine and cosine of rotor position between detents. One step equals 360 elelctrical degrees regardless of the motor's inate step angle.

7) Only bipolar motors are usually microstepped (although polyphase motors also lend themselves well to microstepping).

John

John, I've read and re-read your post but I'm afraid that it it just went to prove that I'm not nearly as smart as I thought.

I'm ashamed to admit that I have no idea what 'detent torque' is, and knowing that detent torque is a sinusoidal function that completes one full cycle for every natural step position didn't help at all.
Same goes for the entire content of paragraph four, it left me :headscratch:
I won't go on because I'm just demonstrating my ignorance, and I'm obviously thinking that 'basic cnc' is much less basic than I'm able to under stand. :confused:

However, if you or someone else could provide a 'Dummies 101' of when and why half stepping or micro stepping should be used, and what the pros and cons are, I'd be grateful.


M
 
Ok, that's how the motor works when it's half stepping or micro stepping, and it's interesting to know, but more importantly why do I need to implement it ?
Is it to to be more accurate, or faster, or slower, or with more or less torque?
In other words, if I want to move an axis 6" from point A to point B, why would I choose to use less than full steps to get there?


M

Honestly, you don't need to do anything but full step, there are some reasons why you might want to though.

When you are designing a machine, there are 3 things you are interested in.

1) Torque - how much load can you move, and how quickly can you accelerate that load
2) Speed - how fast can you go.
3) Accuracy - how accurately can I position my tool.

That's all. There are various ways to get there, but that's really all you care about. As always, there are tradeoffs, lets talk about some of those.

Torque

With steppers, you always see motors listed with the holding torque. This is number is mostly useless, unless you are going to be using them as expensive brakes. What you want to look at is the torque curve. This will tell you what kind of torque you are going to have at a given speed. There are two speeds you care about, your cutting speed, and your rapid speeds.

Speed

Speed is important, because it determines your maximum feed rate and rapids. The actual speeds are going to depend on how fast your motor can go, and the reduction added by the rest of your drive system (screws, belt reduction if you are using it).

Accuracy

Accuracy is going to depend on the motor you are using (1.8deg per step, 0.9deg step, etc), how you are driving it (full/half/micro step), and the reduction added by the rest of your drive system. If you have a 1.8 deg stepper, and are running it with full step (200 pulses per revolution), and have a 1/4 TPI screw, you are gonna have to send 800 pulses to get the axis to move 1 inch. That means you have 1inch/800pulses = 0.00125"/pulse. That is the best you can do for positioning. If you go to half step, it's gonna take 1600 pulses to go an inch, which gives you 0.000625 inches per pulse. I'd be happier with that personally, but you are gonna lose some torque.

Basically you trade between torque, speed, and accuracy. Using half step or microstepping will increase your accuracy, but reduce your max torque. If your PC can't deliver enough pulses per second, it can also reduce your maximum speed.

Another thing to think about is that you can switch the mode of the controller once everything is set up. Most people will spend at least a couple hours once their system is together adjusting their max speed, and acceleration to get the most out of their particular machine.

To address HSS's concerns, I'm not sure what you mean by "type". For steppers, you are basically going to pay more as you get larger and larger motors. When choosing a motor, I would look at other people that have converted similar sized machines, and go with a motor the same size as them, going larger when in doubt. As far as full/half/micro stepping, that is all about the driver, not the motor, and most decent drivers you find will be able to do at least half step, if not micro-stepping. That stuff is usually configurable, so even if you don't think you want to use it, you can play with it to see what effect it has.
 
John;

With all due respect to you and the knowledge you have on this subject ( I have followed some of your stuff) I have to agree wilh Mike on this. I can understand most of what you daid but some, like Detent Torque needs to be simplified even more. The use of half stepping and micro-stepping is still beyond my grasp also. Maybe we need to back up a little. At this point I don't even know what to ask to clarify anything.

"Billy G"
 
Honestly, you don't need to do anything but full step, there are some reasons why you might want to though.

When you are designing a machine, there are 3 things you are interested in.

1) Torque - how much load can you move, and how quickly can you accelerate that load
2) Speed - how fast can you go.
3) Accuracy - how accurately can I position my tool.

That's all. There are various ways to get there, but that's really all you care about. .................................

Thanks, I'm starting to feel a bit smarter again now. ;)


M
 
Not me. The motor moves the tool. The tool is doing the cutting. How do I know how much torque it will take to make that cut? I understand that from this I will know what size motor to choose. I there a formula or something else?

"Billy G"
 
Not me. The motor moves the tool. The tool is doing the cutting. How do I know how much torque it will take to make that cut? I understand that from this I will know what size motor to choose. I there a formula or something else?

"Billy G"

I don't know if this would work for practical purposes, but I guess you could measure the torque required to make the heaviest cut you're capable of by using a torque wrench to turn the axis while making that cut?


M
 
Back
Top