× Forum Header

CNC Mini Lathe with threading

More
19 Nov 2013 10:23 #40956 by Davenc
I've done a ton of reading on my topic and have a couple of questions on the hardware setup below. I'd like to be able to do threading on my lathe and also configure a speed readout using pyvcp panel. I'm assuming I can use the index pulse to obtain this value?

Hardware assumptions:

An encoder is connected to the spindle and puts out 100 pulses per revolution on phase A (This is the Z axis motor 100 pulse encoder)
The encoder A phase is connected to the parallel port pin 10
The encoder index pulse is connected to the parallel port pin 11

Basic Steps to add the components and configure them:

loadrt encoder num_chan=1
addf encoder.update-counters base-thread
addf encoder.capture-position servo-thread
setp encoder.0.position-scale 100
net spindle-position encoder.0.position => motion.spindle-revs
net spindle-velocity encoder.0.velocity => motion.spindle-speed-in
net spindle-index-enable encoder.0.index-enable <=> motion.spindle-index-enable
net spindle-phase-a encoder.0.phase-A
net spindle-phase-b encoder.0.phase-B
net spindle-index encoder.0.phase-Z
net spindle-phase-a <= parport.0.pin-10-in (Is this the 100 pulse encoder mounted on the Z motor)
net spindle-index <= parport.0.pin-11-in (Is this the single index wheel on the spindle)

I have on order 1 opto couple to read a single spot on the index wheel mounted on the spindle locked between the two spanner nuts on the headstock
I have on order a 100 pulse encoder to mount on the Z axis motor.

It looks like I have it backwards according to the example above? . I've done so much reading about this my head is spinning. I thought I had it right until I starting examining the example above.

Now I read the below information and all it does is add to the confusion, both are linux docs that appear to contradict each other unless I'm interpreting them wrong. Can someone explain this to me so I can understand it enough to configure my lathe? I'm going to guess the 100 pulse encode is needed on the Z axis motor for better resolution when threading?


When the appropriate signals from a spindle encoder are connected to the parallel port, EMC supports lathe threading. These signals are:

Spindle Index
Is a pulse that occurs once per revolution of the spindle.
Spindle Phase A
This is a pulse that occurs in multiple equally-spaced locations as the spindle turns.
Spindle Phase B
(optional) This is a second pulse that occurs, but with an offset from Spindle Phase A. The advantages to using both A and B are increased noise immunity and increased resolution.

If "Spindle Phase A" and "Spindle Index" appear on the pinout, the following information should be entered:

Cycles per revolution
The number of cycles of the Spindle A signal during one revolution of the spindle. This option is only enabled when an input has be set to "Spindle Phase A"

Thanks for your help.

Please Log in or Create an account to join the conversation.

More
19 Nov 2013 18:16 #40971 by andypugh

net spindle-phase-a encoder.0.phase-A
net spindle-phase-b encoder.0.phase-B
net spindle-index encoder.0.phase-Z
net spindle-phase-a <= parport.0.pin-10-in (Is this the 100 pulse encoder mounted on the Z motor)
net spindle-index <= parport.0.pin-11-in (Is this the single index wheel on the spindle)

I have on order 1 opto couple to read a single spot on the index wheel mounted on the spindle locked between the two spanner nuts on the headstock
I have on order a 100 pulse encoder to mount on the Z axis motor.


You may want to ignore phase-B, but if you have a pin for it, and the encoder provides it, then using it will give direction as well as speed/position, which is useful for rigid tapping. You probably won't be doing much rigid-tapping on a mini-lathe though.

If you are not using phase B then you also need
setp encoder.0.counter-mode 1

Putting the encoder on the motor may work if there is a synchronous drive between the motor and the spindle (such as a toothed belt). The encoder scale will need to be fiddled to allow for the gear ratio, it needs to be counts per spindle rev, not motor rev. In practice it will probably work even without a synchronous drive, as it re-synchs to index at the start of each thread. If you have more than one drive ratio then it gets more complicated.

It is common to run the encoder with a 1:1 belt drive from the spindle, and take encoder phases and index from the encoder. Alternatively you can add more slots to your disc and use that as the encoder wheel (use a deeper slot for index)

Please Log in or Create an account to join the conversation.

More
20 Nov 2013 10:20 #40989 by Davenc
Well it looks like I'll be making my own encoder disk and sending the 100 pulse encoder back. Now the question is how many holes can I get away with since I have 188mm circumference to work with for the index wheel. If I keep a minimum of 2mm spacing I can on cut 47 slots in the index wheel. The photon device has a 1mm width so going with less more slots could cause problems.

Is there a magic number I'm looking for? Do the slots have to be an even number?

Thanks

Please Log in or Create an account to join the conversation.

More
20 Nov 2013 17:34 #41000 by ArcEye

Is there a magic number I'm looking for? Do the slots have to be an even number?


In theory it could be any number, but I always go for an exact divisor of 360, it has to make the calculations more accurate and easier.

Likewise in theory the Z pulse should probably co-incide exactly with one of the A pulses, but mine is a completely seperate device and seems to make no difference

I made a 60 hole disc once but doubled that to 120 and got a far smoother operation in threading

Don't think I would recommend anything less than 60

regards

Please Log in or Create an account to join the conversation.

More
20 Nov 2013 17:54 #41001 by Davenc

Is there a magic number I'm looking for? Do the slots have to be an even number?


In theory it could be any number, but I always go for an exact divisor of 360, it has to make the calculations more accurate and easier.

Likewise in theory the Z pulse should probably co-incide exactly with one of the A pulses, but mine is a completely seperate device and seems to make no difference

I made a 60 hole disc once but doubled that to 120 and got a far smoother operation in threading

Don't think I would recommend anything less than 60

regards


Did you do this on a mini lathe? I mean there's a limited amount of room to work with on a 188mm circumference.

Please Log in or Create an account to join the conversation.

More
20 Nov 2013 18:12 #41003 by andypugh

Is there a magic number I'm looking for? Do the slots have to be an even number?


One thing you need to bear in mind is the sampling rate of your encoder counter and the response time of the opto-sensors. You might not want to exceed the count-rate that your system can manage.

However: it isn't the end of the workd if you do exceed the count rate at high spindle speeds if you only want to do spindle-synchronised moves at low spindle speeds.

Feed-per-rev mode at high spindle speeds is likely to be the problem. In theory an index slot long enough to always be detected can be used with a second single-pulse-per-rev encoder counter to provide the motion.spindle.speed-in signal and the high-resolution version can be used to supply motion.spindle.revs. (Or so I believe....)

None of this is relevant if you are running with a hardware counter such as Mesa, Pico, whatever.

Please Log in or Create an account to join the conversation.

More
20 Nov 2013 20:20 #41008 by ArcEye

Did you do this on a mini lathe? I mean there's a limited amount of room to work with on a 188mm circumference.


No it was on medium sized ex-college training lathe with a D1-3 spindle.
Off the top of my head I think I used a 150mm disc and drilled a 120 hole PCD pattern with 2mm holes and 2mm spacing, but that could be slightly off.

Your restriction presumably is the size of the housing or cover at the back of the spindle, rather than the spindle itself.
If you simply cannot exceed 60mm diameter, you might be better off with an encoder and a 1:1 drive

regards

Please Log in or Create an account to join the conversation.

Time to create page: 0.091 seconds
Powered by Kunena Forum