Do I Need a Rotary Encoder?

This forum is dedicated to those Hobbyists Interested in CNC machining & 3D Printing in their home shops. (Digital Read Outs are also topical, as is CAD/CAM as it relates to CNC)

Moderator: Harold_V

User avatar
ctwo
Posts: 2996
Joined: Tue Mar 27, 2012 12:37 pm
Location: Silly Cone Valley

Re: Do I Need a Rotary Encoder?

Post by ctwo »

SteveHGraham wrote:Thanks for all that effort. I already knew I needed something beyond a simple disk with one sensor, which is what other people manage to use with Mach3.

What I wanted to know was this: is there any reason to prefer a rotary encoder, with dozens of slots or whatever, to a simple disk with one slot and two sensors at 90 degrees to each other?

A real rotary encoder should be able to provide much better resolution, but is better resolution good for anything?
The only thing I could find relating to that was some people experience poor threading accuracy when using light duty machines with a 1ppr into mach3. How the kflop system interpolates 2ppr and its performance is a guess for me. I suspect a larger machine like Dave's would have no problem since there be enough inertia and torque to maintain a more constant spindle speed, but you are running an 8" mini lathe kind of thing, right? Then again, it's just a guess how the kflop system would handle more pulses. I was looking for a block diagram of the control loop, which I did not find.

If Mach3 is controlling spindle speed based off feedback from kflop (i.e., kflop interpolates nppr to 1ppr and sends that to Mach3, and Mach3 figures out the speed is too slow and sends commands to increase spindle speed back to kflop), then I suspect more pulses is not going to matter. However, if kflop gets speed direction from Mach3 and the kflop controller handles the loop and speed adjustments, then a higher count encoder may actually help you enjoy success. I'm kinda curious how it is set up.

BTW, I'd run the encoder with a belt if you go there.
Standards are so important that everyone must have their own...
To measure is to know - Lord Kelvin
Disclaimer: I'm just a guy with a few machines...
User avatar
SteveHGraham
Posts: 7788
Joined: Sat Jan 17, 2009 7:55 pm
Location: Florida

Re: Do I Need a Rotary Encoder?

Post by SteveHGraham »

This lathe has a gear that appears to turn 1:1 with the spindle, and it's not doing anything important. I think it would be the best place for an encoder.
Every hard-fried egg began life sunny-side up.
User avatar
DICKEYBIRD
Posts: 176
Joined: Sat Feb 03, 2007 10:45 am
Location: Collierville, TN

Re: Do I Need a Rotary Encoder?

Post by DICKEYBIRD »

ctwo wrote:If Mach3 is controlling spindle speed based off feedback...
Mach doesn't need to control spindle speed when cutting threads. Mach synchs the Z axis motion with the spindle speed it captures once per rev. You're better off to forget letting Mach control the spindle speed while threading. The spindle motor speed control & Mach will just chase each other causing a constant variation.
Milton in Tennessee

"Accuracy is the sum total of your compensating mistakes."
User avatar
Dave_C
Posts: 960
Joined: Mon Apr 21, 2008 10:34 am
Location: Springfield. MO.

Re: Do I Need a Rotary Encoder?

Post by Dave_C »

There may be some confusion over how Mach 3 controls Spindle speed during threading. On my machine (yours can be different) I set a speed for the spindle usually using the S word. For example if I have S400 in the code line the spindle runs at 400 RPM.

Now if I want to thread, the thread routine has nothing to do with spindle speed, the threading routine only needs to know how to sync to the same spot on the spindle. (Once per rev)

Mach 3 suggest you give the carriage at least two thread widths in order to let the carriage reach speed before it gets to the first thread. That all has to do with acceleration settings in Mach 3 and how much torque you have to move the carriage. Setting your lead a little longer can help if you have issues with not syncing.

As was stated above, my machine has enough mass that once spindle speed is reached it does not chase! Once the carriage is started it moves very consistently through any thread I have made. My CNC threads are smoother than the ones I cut manually because I can cut them at high spindle speeds! I cut at around 150-200 SFPM and could cut much faster but so far have found no need for it.

Getting a spindle to control smoothly also involves VFD settings and can be quite complex if your are new to setting up drives and the software that sets the speed. (Mach 3 for example)

Drives have acceleration / deceleration times and Mach 3 has more than one way to monitor the spindle and send out a control signal to the drive. One way is to use a PID loop but they can be tricky to get the Proportional, Integral and Derivative numbers set properly.

The Mach 3 forums have some good advice on some of this. Some of it is garbage as well so be careful who you take advice from! It took me longer to get my drive and software set properly for the spindle control than it did to set up my Servos and ball screws.

Dave C.
I learn something new every day! Problem is I forget two.
WJH
Posts: 1417
Joined: Sat Jan 16, 2010 9:29 pm
Location: Florida

Re: Do I Need a Rotary Encoder?

Post by WJH »

The problem is mach 3, use linuxCNC
User avatar
ctwo
Posts: 2996
Joined: Tue Mar 27, 2012 12:37 pm
Location: Silly Cone Valley

Re: Do I Need a Rotary Encoder?

Post by ctwo »

WJH wrote:The problem is mach 3, use linuxCNC
It's the same question though - basically is there any benefit to using a higher resolution encoder over a 2ppr encoder?
Standards are so important that everyone must have their own...
To measure is to know - Lord Kelvin
Disclaimer: I'm just a guy with a few machines...
Post Reply