Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Katoh on August 03, 2017, 03:52:44 AM

Title: Using a Sevo as a Spindle and an Axis
Post by: Katoh on August 03, 2017, 03:52:44 AM
G'Day Friends

On my lathe I have finally got an AC servo to be used as my spindle, big learning curve here and lots of little pitfalls but the majority have been solved, thanks to the help of our wonderful members out there.
What I am trying to do at the moment is use the servo as not only a spindle but a "C" Axis, this is not a complex thing and I have assigned all the correct settings in Mach3 to do this, If I call C to move 50deg it does so, as C is rotational drive across Z. Normal use is as spindle and you can easily call up from 0-2000rpm quite happily. This really is a good thing and works very well on the lathe, disposes all of the changing of pulleys and simply just gives absolute control.
Now my issue begins. The servo is controlled by Step/Dir for both Axis or Spindle, the only way I can make this work is to use the same pins for both and simply disable or enable the one I want to use, no great concern but things can be better. So I assigned 2 different pins for each . EG. Spindle use Step pin1 Dir Pin14 C axis uses Step pin16 Dir pin17 all off port 1. Then the cabling from pin1 and pin16 both feed Step pin on the AC Servo Drive as do Pin14 and Pin17 connect to Dir on the Servo Drive. When I do this neither work. If I disconnect one set, does not matter which one, then axis or spindle works fine. I thought that it might be back feeding into the other pins  so I put a diode on each cable to stop any back feed, but this did not work and with the diode in place I cannot get movement at all from either set. The diode is setup so the + side is to the Servo Drive the Negative side to Mach.

For those that have more knowledge in Electronics than me is this a waste of time to use the 4 pins or am I simply missing something simple?
Thanks for reding
Title: Re: Using a Sevo as a Spindle and an Axis
Post by: RICH on August 03, 2017, 07:10:16 AM
Quote
the only way I can make this work is to use the same pins for both and simply disable or enable the one I want to use

So the software controller, namely Mach3, can instruct output to the same pins for one use only.
It's either a spindle or the  4th axis C, thus, when you manualy enable / disable Mach can approriately control output to the pins. Should be able to use macro's using Swap Axis to switch back and forth if your using a PP. If external controller it must support that command.

Lets see what other users suggest,
I would suggest you post some more info........ xml file / drive  manual / mach3 version/ hardware etc.

RICH
Title: Re: Using a Sevo as a Spindle and an Axis
Post by: Katoh on August 03, 2017, 07:26:33 AM
Hi Rich

thanks for the input, just to clarify its running a smoothstepper ESS, now that may change a few things I realise now. I worked out tonight that I need to swap the direction of the diodes, that makes things work again, then I tried both of them  separately connected  C axis works correctly and spindle works correctly, connect them both even though one is ENABLED and the other DISABLED and it just wont work, that’s where I was hoping the diodes to come into there own. But even thou one is disabled it still must be sending a message through the line.
Might need a manual break switch or relay, what a pain!
Any Suggestions?
Thanks.
Title: Re: Using a Sevo as a Spindle and an Axis
Post by: RICH on August 03, 2017, 05:10:54 PM
Any Suggestions?
I have not followed the evolution of the SS in Long time. I believe that it supports the swapping of axes.
Start reading up on both the VB required and SS information.

In mean time someone with more detailed experience may reply.
RICH
Title: Re: Using a Sevo as a Spindle and an Axis
Post by: ger21 on August 03, 2017, 08:38:50 PM
Create two profiles. One for the Spindle, and one for the C axis.
Title: Re: Using a Sevo as a Spindle and an Axis
Post by: garyhlucas on August 04, 2017, 12:14:41 AM
I have a similar setup and I csn use it as a C axis but can't find a way to make it be a lathe spindle.
Title: Re: Using a Sevo as a Spindle and an Axis
Post by: joeaverage on August 04, 2017, 02:35:34 AM
Hi,
if I understand what you're trying to achieve is to have two sets of step/dir pins and select one set depending on the behaviour required for the servo
at this instant?

If that is the case then you can't combine the pin sets passively. A passive combination network cannot prevent both high AND low states from propagation.
That would require an active network, aka a multiplexer. Probably the simplest would be some CMOS bilateral switches but could also be achieved by
paralleling two tri-state buffers...If you are interested I could sketch up a couple of circuits that might work.

Craig

Title: Re: Using a Sevo as a Spindle and an Axis
Post by: joeaverage on August 04, 2017, 02:37:57 AM
Hi,
in fact even simpler would be a DPDT relay...

Craig
Title: Re: Using a Sevo as a Spindle and an Axis
Post by: joeaverage on August 04, 2017, 02:56:54 AM
Hi,
this might work

Craig
Title: Re: Using a Sevo as a Spindle and an Axis
Post by: Katoh on August 06, 2017, 12:29:43 AM
Hi Friends sorry the late reply.

Quote
Create two profiles. One for the Spindle, and one for the C axis.
Do you mean have two separate XML files one for C drive and One for spindle? Sounds very cumbersome re-starting Mach every time you wish to swap, but should work.

Quote
I have a similar setup and I csn use it as a C axis but can't find a way to make it be a lathe spindle.
I can help you with that What sort of servo are you using?

Quote
Hi,
if I understand what you're trying to achieve is to have two sets of step/dir pins and select one set depending on the behaviour required for the servo
at this instant?

If that is the case then you can't combine the pin sets passively. A passive combination network cannot prevent both high AND low states from propagation.
That would require an active network, aka a multiplexer. Probably the simplest would be some CMOS bilateral switches but could also be achieved by
paralleling two tri-state buffers...If you are interested I could sketch up a couple of circuits that might work.
Yes, and yes I can see that i will not be able to get them to work together.

Quote
in fact even simpler would be a DPDT relay...
Brilliant! That will work and can be activated by a button the the screen controlled by an output! The drawing is spot on I looked at the multiplexer but have no clue on how to wire that up, its a little beyond me, but the double relay is a piece of cake.

Thanks Everyone!





Title: Re: Using a Sevo as a Spindle and an Axis
Post by: rcaffin on August 13, 2017, 07:00:40 AM
Are you using logic gates to combine the signals, or trying to combine the pins?

If you are trying to combine the pins you will need diodes oriented the right way, PLUS a pullup resistor at the output (or a pull-down).
I suggest active LOW, diodes with cathode to pins and anodes joined, PLUS a pull-up R of a suitable value. 1kohm could be a good starting point.

If you are using logic AND gates, you should also use active LOW and a 2-input gate.

Cheers
Roger
Title: Re: Using a Sevo as a Spindle and an Axis
Post by: Katoh on August 13, 2017, 07:30:48 PM
Hi Roger
I am trying to connect the motor output pins together. I have diodes on them already and they set at active low. even though you can disable them in Mach there is still some sort of back-feed  in the system and the servo will not respond to any command, separately they work like a charm.
My cure yet to be wired in but the parts purchased I am going to use one of these. https://www.jaycar.com.au/4pdt-din-rail-mount-relay-cradle/p/SY4004 with one of these https://www.jaycar.com.au/12vdc-4pdt-relay-5a-240vac-30vdc-contacts/p/SY4009 that plugs directly into the cradle and is all screw terminals for ease of fitting up. Using screen 4 I will simply create another button with an "M" command to switch spindle to axis and vise versa. Should work a treat! Famous last words I know. LOL.
Title: Re: Using a Sevo as a Spindle and an Axis
Post by: rcaffin on August 13, 2017, 08:26:30 PM
I have done something similar (and it works fine).

My CNC is a two-spindle unit: one vertical which I use as a mill and one horizontal, which I use as a lathe. I select which spindle to use with one of two macros. One macro (M90) enables a relay for the mill spindle, the other (M91) enables the lathe spindle. Since I run the mill under Mach3Mill and the lathe under the Mach3Lathe programs, I have slightly different axis Step/Dir pins and different Index pins (different XML files). The first thing either of these macros do is to disable the output pins used by the other macro.

In the external physical logic circuit there is also some lockout circuitry which prevents the system from ever trying to energise both spindles at once. Since the spindle PS is DC, there is also lockout circuitry on the Fwd/Rev relays to prevent them from ever being simultaneously activated.

Yes, a little bit of paranoia - and a lot more peace of mind.

Cheers
Roger