Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: yantra3d on January 17, 2008, 01:48:21 PM

Title: using a spindle encoder w/ Mach 3
Post by: yantra3d on January 17, 2008, 01:48:21 PM
 I have an older DOS-based cnc lathe that I'm looking to upgrade to Mach 3 using my existing g100/mach3 setup. The lathe uses a KVM style spindle motor controller and so I was planning on using the digispeed XL board, however, the spindle uses an encoder (see attached image) and I'm trying to find out how I might be able to take advantage of the existing encoder arrangement by configuring mach rather than swapping it out for a pulse generating indexer, etc...

 Can this be accomplished with the g100 and mach combined or can mach even be configured to at all to take advantage of a spindle encoder like this one?

 Thanks!!


Title: Re: using a spindle encoder w/ Mach 3
Post by: Hood on January 17, 2008, 04:05:19 PM
I dont know anything about the G100 so cant say whether it can be used or not, however I know the SmoothStepper will be using an encoder for spindle sync for threading etc so maybe it can be similar for the G100.
Hood
Title: Re: using a spindle encoder w/ Mach 3
Post by: jimpinder on January 18, 2008, 12:34:00 PM
Mach 3 is programmed to accept pulses into the computer to measure the spindle speed. There are two methods. One is a simple one pulse per revolution of the spindle. The other is several pulses per revolution (these can be specified).

What you need to know, therefore, is the system your existing lathe/mill uses. This needs converting to a 5 volt signal, and then can be fed into your computer.

So the question is - what signal does your system give out.

It may be, however,  that the problems trying to integrate an existing system into Mach3 is too expensive. You can buy optical encoders for a few pence/cents and achieve a satisfactory input into Mahc 3 . There are several posts on this if you do a search.

I use an optical encoder to measure the spindle speed and a Digispeed PWM converter to run my lathe/mill with excellent results.

I have attached a diagram for the optical encoder - which can be wired directly to your brealout board. I was looking for a picture -  but I can't find one

The tracking of your spindle speed is quite simple - I think the "control" of your spindle speed will be the most important.
Title: Re: using a spindle encoder w/ Mach 3
Post by: yantra3d on January 19, 2008, 05:53:12 PM
 Thanks a lot for help... I really appreciate it!

 So by signal are you referring to the main controller board's output signal to the spindle controller or one that is sent back to the software/pc?
Title: Re: using a spindle encoder w/ Mach 3
Post by: DennisCNC on January 19, 2008, 09:40:43 PM
^What main controller board are you referring to?

What mach needs is one pulse per revolution of the spindle it can be a reflective sensor or inductive proximity sensor that senses a piece of metal.  The signal from the sensor can't be very short so if you are using the reflective sensor and put a 1/16" strip of shiny stuff on the spindle that will probably not work as it will go by to fast for mach to see it.   Another thing with threading and mach you need a motor with some HP, because mach uses one pulse per rev of the spindle if you take a cut and spindle slows down a little mach will take some time to adjust and feed speed to correct for the slower spindle speed and will most likely ruin the thread unless you take a lot of very small cuts.  But if you have at least 1HP motor it will hold the spindle speed nice and steady so you can take some good cuts and have nice threads.  The motor you have now will probably not be the best choice,  it worked with the DOS system because the encoded sent out 100 or more pulses per rev of the spindle so the control software noticed the slightest change in spindle speed and corrected the feed quickly.
Title: Re: using a spindle encoder w/ Mach 3
Post by: yantra3d on January 19, 2008, 10:17:06 PM
 Are you saying that it would not work even if I were able to get mach to acknowledge the pulses from the encoder (using the "several pulses per revolution" option and specifying the correct pulses/rev which matched the encoder)?

 As for the "controller" I was referring to the existing main controller board (LCB3) that is equipped with the cnc lathe. As it is currently setup the encoder connects directly to the controller board and the board ouputs signals to the spindle controller. I wasn't sure if Jim was referring to the signal being sent from the controller board to the spindle controller or if he was referring to another signal (perhaps sent from the board to the pc for the software to track!?!).

 Thanks again for all the help guys.
Title: Re: using a spindle encoder w/ Mach 3
Post by: DennisCNC on January 20, 2008, 01:55:03 PM
1. Mach is made to take one pulse per rev, if you know how to write custom plug-ins for mach that take more pulses thats great! It will help all of us.

2. You might be on to something, it is possible that the encoder goes to the spindle motor controller and keeps a constant speed no matter what the load is until it is too much for the motor,  but I don't know that for sure unless you have some manuals that say that.  You can do a test, buy a cheap tachometer on eBay start the spindle and put some load on the chuck and see if it slows down if not, then great if it does then the encoder has no control of the spindle rpm and is just passed straight to the pc.


Title: Re: using a spindle encoder w/ Mach 3
Post by: yantra3d on January 20, 2008, 11:07:44 PM
 I might be in some luck with this encoder... apparently it has a separate indexing channel (z channel) which generates 1 pulse per rev. The typical A and B channels generate 60 ppr but can't I just bypass these outputs and send the z-channel signal (providing it's 5v) back to mach? 

 Would it be worth a try?


 
Title: Re: using a spindle encoder w/ Mach 3
Post by: Hood on January 21, 2008, 02:38:25 AM
I think the Index pulse will be too short for Mach to see through the parallel port.
Hood
Title: Re: using a spindle encoder w/ Mach 3
Post by: yantra3d on January 21, 2008, 01:27:30 PM
 How about through the ethernet port via the Grex/G100? Would that be worth trying?
Title: Re: using a spindle encoder w/ Mach 3
Post by: softselect on January 21, 2008, 04:09:25 PM
a lot of commercial rotary encoders have an index pulse(one pulse/rev) that is used for synchronization, look at the label and search google for wire colours
Friedrich
Title: Re: using a spindle encoder w/ Mach 3
Post by: Peter Homann on January 21, 2008, 05:39:54 PM
I have an older DOS-based cnc lathe that I'm looking to upgrade to Mach 3 using my existing g100/mach3 setup. The lathe uses a KVM style spindle motor controller and so I was planning on using the digispeed XL board, however, the spindle uses an encoder (see attached image) and I'm trying to find out how I might be able to take advantage of the existing encoder arrangement by configuring mach rather than swapping it out for a pulse generating indexer, etc...

 Can this be accomplished with the g100 and mach combined or can mach even be configured to at all to take advantage of a spindle encoder like this one?

 Thanks!!






Hi,

Does the encoder you have contain an index pulse output? A lot do. If so you could use that.

Cheers,

Peter.
Title: Re: using a spindle encoder w/ Mach 3
Post by: yantra3d on January 21, 2008, 06:12:21 PM
 Yes, the encoder outputs a separate indexing (Z) channel that pulses at 1 ppr. I have the wiring diagram available for the encoder so it's not a problem to hook it up for a test. However, I'm trying to determine the output voltage before I attempt that. It appears to be 5v but I'm being cautious and waiting for verification before I proceed cause I don't want to risk frying my Grex.  :'(

 Hood thinks the pulse from the indexing channel may be too short for mach to read through the parallel port (as he mentioned above) so I'm going to check into running it through the grex/ethernet port and see if that might help. If that doesn't cut it then I might have to find an alternative.

 On the subject of the smoothstepper; does anyone know how many drives/axis it can support?

Title: Re: using a spindle encoder w/ Mach 3
Post by: Peter Homann on January 21, 2008, 06:38:56 PM
Hi,

Yes, you could be right, and you may need to go to a single pulse encoder. Have you seen the engineering notes for hooking sensors to the DigiSpeed-XL?

The DigiSpeed-XL has signal conditioning circuitry to allow the use of very simple opto-interrupters;

http://www.homanndesigns.com/EN001.pdf
http://www.homanndesigns.com/EN002.pdf

Also, as far as I understand, the Smoothstepper can control 6 axis.

Cheers,

Peter.
Title: Re: using a spindle encoder w/ Mach 3
Post by: yantra3d on January 22, 2008, 04:03:33 PM
 I hadn't seen those engineer's notes for the digispeed although I've already read the manual. Thanks for the info Peter... I appreciate that!
Title: Re: using a spindle encoder w/ Mach 3
Post by: yantra3d on January 26, 2008, 08:20:29 PM
 I was told by the manufacturer that the encoder is designed to run at 5V (and only 5V) for both input and output. He also mentioned that the lathe was originally setup to use only the A and Z channels of the encoder; where the A channel (60ppr) was used for speed control and the Z channel (1 ppr) was used threading.

 
Title: Arduino Diecimilia baord??
Post by: yantra3d on January 29, 2008, 04:46:46 PM
 Has anyone tried using one of these Arduino usb microcontroller boards:

http://www.arduino.cc/en/Main/ArduinoBoardDiecimila

 I should be able to easily program it to have the short pulse that's generated by the encoder trigger a delay or another signal of greater length so that mach can then read it. It's $35 so it would be overkill for this app however it includes 14 digital input/outputs (6 of which can be used as PWM outputs) and 6 analog inputs so it could prove worth the investment.

 Anyone have any experience with one of these boards?
Title: Re: using a spindle encoder w/ Mach 3
Post by: vmax549 on February 03, 2008, 03:59:48 PM
If you are planning on using the encoder setup in the picture to also be a timing signal I see a BIG problem.

THe drive motor is not using a timing belt to drive the spindle. IF it slips(and it will) the spindle will be OUT of synch. With that setup you will need to use a signal that is timed to the spindle itself.

It apperars that the encoder is there JUST to help control motor speeds.

(;-) TP
Title: Re: using a spindle encoder w/ Mach 3
Post by: yantra3d on February 03, 2008, 08:22:26 PM
 I'm not sure I completely understand what you mean. I realize that the motor is not using a timing belt to drive the spindle, however, the encoder is attached to the spindle shaft and not the motor shaft so it is getting it's reading directly from the spindle - not from the motor. I don't see how this would be a problem, maybe you can you explain?

 My understanding of the original encoder setup is that the 60 ppr (A) channel was used to measure speed and the 1 ppr indexing (Z) channel was used for spindle positioning (threading). The B phase was apparently bypassed altogether.

Title: Re: using a spindle encoder w/ Mach 3
Post by: vmax549 on February 03, 2008, 09:57:09 PM
OOPS MY mistake it looked to me like what is the spindle housing looked to be the drive motor.

Sorry (;-) TP
Title: Re: using a spindle encoder w/ Mach 3
Post by: yantra3d on February 04, 2008, 12:48:25 AM
lol... no worries. ;)

 I won't be able to test the spindle w/ mach for another 2 weeks but I'll post my results then... thanks to everyone for all the helpful info.
Title: Re: using a spindle encoder w/ Mach 3
Post by: Mach3Man on November 15, 2017, 05:59:47 PM
Hi all, this is my first post and so sorry if I have missed something...
Could the signal not be "stretched" with a suitable circuit to increase the pulse length to something Mach 3 can "see".  I can think of several easy ways to accomplish this with analogue/digital/MCU circuits... a quick Google throws up loads of circuits too.

I am converting my EMI MEC Autosprint pin diode lathe into CNC and am am looking into bet way to add an encoder, I have bough an inductive sensor to start with.  The lathe spindle is currently fixed to 1 of 4 different speeds which I hope will work but if necessary I will add an inverter to the 3 Phase motor so I can control the speed.

^What main controller board are you referring to?

What mach needs is one pulse per revolution of the spindle it can be a reflective sensor or inductive proximity sensor that senses a piece of metal.  The signal from the sensor can't be very short so if you are using the reflective sensor and put a 1/16" strip of shiny stuff on the spindle that will probably not work as it will go by to fast for mach to see it.   Another thing with threading and mach you need a motor with some HP, because mach uses one pulse per rev of the spindle if you take a cut and spindle slows down a little mach will take some time to adjust and feed speed to correct for the slower spindle speed and will most likely ruin the thread unless you take a lot of very small cuts.  But if you have at least 1HP motor it will hold the spindle speed nice and steady so you can take some good cuts and have nice threads.  The motor you have now will probably not be the best choice,  it worked with the DOS system because the encoded sent out 100 or more pulses per rev of the spindle so the control software noticed the slightest change in spindle speed and corrected the feed quickly.

Title: Re: using a spindle encoder w/ Mach 3
Post by: joeaverage on November 16, 2017, 01:00:26 AM
Hi,
yes there are many pulse stretching circuits you could use. Another possibility is a Hall sensor like:
http://nz.element14.com/honeywell/ss411p/sensor-hall-effect-bipolar-to/dp/1784734 (http://nz.element14.com/honeywell/ss411p/sensor-hall-effect-bipolar-to/dp/1784734)
Little button magnets glued to the spindle passing within a mm or so of the IC will cause the sensor to have an output. Note that all it requires is 0V,5V and an output, only
three wires. With a few magnets in a row you wouldn't need any pulse stretching, the magnets would trigger the output for as long as there were magnets in proximity.

Craig