Hello Guest it is March 29, 2024, 04:53:13 AM

Author Topic: Rotary Encoder as Spindle Index Pulse - Possible with Mach?  (Read 13412 times)

0 Members and 1 Guest are viewing this topic.

melee

*
Hi All,

I have trawled through the posts and don't think the answer to my question is documented here.

I am retrofitting a lathe, which originally was AC servo driven with a Fanuc controller. 
I have replaced the servos with steppers but the spindle motor was a Lenze DC motor with GEC Gemini speed controller, so I was able to control that from Mach through a spindle board.

All that remains is a timing pulse to give Mach spindle RPM

In its original form, spindle timing was via a rotary encoder tied to the spindle.
(Litton Servotechnik G61 rotary encoder run on a 1:1 toothed belt)

It is a 1024 line encoder which I presume to mean 1024 graduations which generate a pulse. 
This seems a bizarre number to me, since it is not divisible by 360, and far too high for any normal requirement for spindle timing.

It looks as if there is a Z channel as well as A and B.  This is high only when A and B are both high, so may cut down the pulses a bit.
It is a RS422 line driver interface but I have a circuit diagram to build a Line Receiver quite simply using a standard IC chip.

So my question is, will I be able to use the output for spindle timing?

I am aware that Mach has problems with minimum pulse lengths required for timing pulses.
I don't see how a unit generating as many pulses as this thing, could be used as a straight timing pulse hooked up to Spindle Index or Spindle Timing under ports and pins.

Mach has provision for MPGs and Encoders but I don't know if there is some way to feed the output to Mach as a timing pulse.

If all else fails I can quite simply install a Hall Effect switch or optical switch to generate the pulse.

It is just that having something as sophisticated and expensive already attached, I would like to use it if possible.

Thanks

Melee

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Rotary Encoder as Spindle Index Pulse - Possible with Mach?
« Reply #1 on: June 29, 2009, 01:33:02 PM »
You could use the Index pulse (Z) of the encoder for the Index to Mach BUT you would almost certainly have to electronically stretch it so its probably just as easy to fit an opto instead.
 If you are using the SmoothStepper then there is no problem at all as it can read the very short index pulse from an encoder.
Hood

melee

*
Re: Rotary Encoder as Spindle Index Pulse - Possible with Mach?
« Reply #2 on: June 30, 2009, 03:36:34 AM »
Thanks Hood,

Pretty much what I thought.

I didn't realise that Smooth Stepper was capable of reading very short pulses, may have a play with that in the future.

The problem answered itself after I posted.
I removed the encoder and heard an ominous rattle.  When I stripped it I found that the spindle ball race had partially collapsed and some of the ball bearings were inside the encoder.

The likelihood of that working properly, even with a new bearing, are not good enough to bother spending the effort on it.
I will go to Plan B, the simple switch.

regards

Melee

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Rotary Encoder as Spindle Index Pulse - Possible with Mach?
« Reply #3 on: June 30, 2009, 05:14:58 AM »
You could use the Index pulse (Z) of the encoder for the Index to Mach BUT you would almost certainly have to electronically stretch it so its probably just as easy to fit an opto instead.
 If you are using the SmoothStepper then there is no problem at all as it can read the very short index pulse from an encoder.
Hood

You may also have to amplify it. The index pulse on my encoder is only 2V  . .  i.e. ignored by the BOB.

For a lathe, one would want to follow the development of the new threading functions in Mach. This is going to involve multiple count index. Last I peeked into that thread it seemed to be settling around 100 per rev, so an encoder index would not be adequate anyway to take advantage of the new lathe threading features.

Anyone working on a lathe index for use with Mach would be well advised to design something that can accommodate a multi slot wheel of some kind.


 

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Rotary Encoder as Spindle Index Pulse - Possible with Mach?
« Reply #4 on: June 30, 2009, 05:22:41 AM »
You may also have to amplify it. The index pulse on my encoder is only 2V  . .  i.e. ignored by the BOB.

That seems unusual, well certainly from any encoders I have, are they 5v encoders? Does the spec say the index pulse is 2v or are you just measuring that?

Hood

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Rotary Encoder as Spindle Index Pulse - Possible with Mach?
« Reply #5 on: June 30, 2009, 05:53:19 AM »
You may also have to amplify it. The index pulse on my encoder is only 2V  . .  i.e. ignored by the BOB.

That seems unusual, well certainly from any encoders I have, are they 5v encoders? Does the spec say the index pulse is 2v or are you just measuring that?
Hood

http://www.usdigital.com/assets/general/90_e6_datasheet_0.pdf

These are all  '5V encoder' but that refers to the supply, not the output. Mine is the 1800 line with index. I can't use the encoder index due to reduction, but just to dink around with it, I hooked it up to the BOB . . . zip, NADA. I did not pursue interfacing it, although that would probably be simple. Changing the pulse width is outside my knowledge.


« Last Edit: June 30, 2009, 06:02:41 AM by simpson36 »

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: Rotary Encoder as Spindle Index Pulse - Possible with Mach?
« Reply #6 on: June 30, 2009, 09:53:49 AM »
Hi All,
 "Anyone working on a lathe index for use with Mach would be well advised to design something that can accommodate a multi slot wheel of some kind."

Actualy you may need two disc's one for index and another used for monitoring the rpm of the the spindle. Where this is all going or end up is purely experimental and it only relates to PP use. Not much activity currently going on.
There is only a few of us randomly fooling with it and wish there were more.
I haven't tried using an encoder, in this case, just one of the channels, but maybe in the near future.
Have some 128's so that would be 256 counts on one channel and haven't tested to see how it may limit rpm readout.

You could stretch or devide the encoder pulses using op amps. Just another book to read as i haven't fooled with them in years. Depending on the encoder /  5 volt supply, you "may" need to ampify the signal to change the pin state from a high to low.

Only guessing, but, until the current code rewriting of Mach gets done, probably won't see any new SS plugin or much pressure on taking care of threading or Turn / lathe  for that matter.  >:( So don't hold your breath!

Transition periods of change seem to be llike an eternity!  ???
RICH



 

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Rotary Encoder as Spindle Index Pulse - Possible with Mach?
« Reply #7 on: June 30, 2009, 10:24:17 AM »
Rich,

If you have been following my progress on the 4th axis, you can see an encoder on the spindle seems to pretty much solve the threading issue, and it makes tapered threads a piece of cake.

I may be wrong on this, but it seems that MACH's single point threading is a simple plunge at the same place over and over . . . not the best way to cut threads anyway. Using an axis, it is easy to advance the threading tool in the classic way to cut only one side of the thread form. If MACH threading already does this, then disregard this paragraph.

If one is going to go thru the trouble of rigging and encoder on the lathe spindle, why not just use it as an encoder and run the spindle as another axis. Rather than 'swap axis', could not a new special purpose axis be created within MACH that is the 'spindle axis'. It could simply be a selection similar to choosing PWM or step for speed control, and it might even be automatically compatible with the popular smooth stepper.

The faciilities are already present in MACH and it seems that G-code compatibility could be accomplished with a macro.

Just random thoughts on the topic.
Re: Rotary Encoder as Spindle Index Pulse - Possible with Mach?
« Reply #8 on: June 30, 2009, 05:28:32 PM »
Quote
http://www.usdigital.com/assets/general/90_e6_datasheet_0.pdf

These are all  '5V encoder' but that refers to the supply, not the output. Mine is the 1800 line with index. I can't use the encoder index due to reduction, but just to dink around with it, I hooked it up to the BOB . . . zip, NADA. I did not pursue interfacing it, although that would probably be simple. Changing the pulse width is outside my knowledge.

The sheet state TTL output which would imply 5v?  On an open collector encoder with 5v supply you would not measure 5v without a pull up resistor, but they seem to indicate TTL for both Single ended and Differential?
I believe the 1024 pulses comes from eight bit binary value (255+1)x4, I only ever used it directly as I could always use a scaling value on the systems I used it on.
Heidenhain seemed to favour this resolution.
Nosmo.

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Rotary Encoder as Spindle Index Pulse - Possible with Mach?
« Reply #9 on: July 01, 2009, 01:27:21 AM »
Quote
http://www.usdigital.com/assets/general/90_e6_datasheet_0.pdf

These are all  '5V encoder' but that refers to the supply, not the output. Mine is the 1800 line with index. I can't use the encoder index due to reduction, but just to dink around with it, I hooked it up to the BOB . . . zip, NADA. I did not pursue interfacing it, although that would probably be simple. Changing the pulse width is outside my knowledge.

The sheet state TTL output which would imply 5v?  On an open collector encoder with 5v supply you would not measure 5v without a pull up resistor, but they seem to indicate TTL for both Single ended and Differential?
I believe the 1024 pulses comes from eight bit binary value (255+1)x4, I only ever used it directly as I could always use a scaling value on the systems I used it on.
Heidenhain seemed to favour this resolution.
Nosmo.

I thought TTL simply was an acronym for Transistor-to-Transistor Logic. Older parallel ports for example are 5V and newer ones are 3.3V, but both are TTL, is that not correct?

The data sheet on the encoder says the output is 2V and there is no reaction at all from the BOB. That's about all I can say about it.