Can EMC2 control machine with independent spindles

More
15 Feb 2011 09:29 #7195 by Nick
Can EMC2 control a machine with two semi-independent spindles.

The machine has X linear axis and A angular, on the X axis there's a portal with
1. Spindle mounted on the Z1 axis for dirty cycle.
2. Spindle mounted on Y and Z2 linear axis and B angular axis for final cycle.

Is there any way to control such machine with EMC2.

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

More
15 Feb 2011 09:47 #7198 by andypugh
It shouldn't be a problem.

I have a combination mill/lathe with two motors running from the same VFD. I use an EMC2-controlled relay to switch between the two motors.

Using the HAL component "gearchange" you can easily set up different pwm-to-spindle speed calibrations for the two options.

You would then use either an M-code or a G-code digital output to swap spindles. I think that the custom M-code approach would probably work best in this case.

You just need to create two files called (for example) M101 and M102 assuming that the changeover relay is controlled via pin 1 of the parport.

M101 should look a bit like:

#!bin/bash
halcmd setp parport.0.pin-01-out 1

And M102 could be

#!bin/bash
halcmd setp parport.0.pin-01-out 0

You could add other halcmd and generic bash lines to check that the spindle was stopped before switching spindles, for example.

Then you would use M101 and M102 in the G-code program to swap spindles.

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

More
17 Feb 2011 09:38 #7274 by Nick
You've got lathe/mill that work as a lathe or as a mill but not both at the same time.

And we need to control two spindles a time. So the first one goes 100 mm ahead of the second and makes dirty cut. This machine makes long timbers for house building. And looks like a very long lathe with two mill spindles as a cutters.

Thanks for the quick answer!

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

More
17 Feb 2011 11:00 #7278 by andypugh
If you want to use two spindles at the same time, then things are a little bit harder. Not because of a limitation of EMC2, but because of a limitation of G-code. G-code has only one "S" word, to control the speed of only one spindle.
If you always want to use both spindles at the same time, at the same speed, or at a fixed ratio, then it is fairly easy, just link the motion.spindle-speed-out pin in HAL to two PWM generators with different input scales (or fix the scales in the VFD setups).
You could also link the PWM scales to Pyvcp input boxes or dials in the GUI.
If the G-code needs to control the second spindle speed directly, then I think you would need to control it with M67 analog output rather than S so that a typical line of G code to set one spindle to 1000rpm and the other to 3000 would be
S1000 M67 E0 Q3000

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

More
24 Feb 2011 12:31 #7431 by Nick
Main problem is that I do not know how to configure EMC to control position of each spindle at the same time.
And how should the Gcode looks like?

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

More
27 Feb 2011 01:27 #7480 by andypugh
Are the spindles able to move independently? In how many axes?
As well as the X, Y and Z axes, G-code allows you to use A, B and C (normally rotary) and U, V and W axes too.

So, if your machine has two spindles that share X and Y but have independent Z control, one would be Z and the other W in the G-code

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

More
28 Feb 2011 13:11 #7505 by Nick
They share two axis, one rotary (lathe's main axis) and one linear X, others are not shared

So I have one spindle on XA YZ
And another one on XA BCW.

What about feed rates and rapid moves, how they will be calculated?
Should I make special hal configuration for them?

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

More
28 Feb 2011 14:26 #7506 by andypugh
Nick wrote:

They share two axis, one rotary (lathe's main axis) and one linear X, others are not shared

So I have one spindle on XA YZ
And another one on XA BCW.

Are you sure you don't mean XA BUW?
Not that it matters, EMC2 doesn't actually mind you using ABC words for linear axes if you want to.
A picture would help :-)

What about feed rates and rapid moves, how they will be calculated?

Good question. I have a feeling that I read sometime that the UVW axis speeds are not part of the velocity calculations, but I think this just means that the net linear velocity will not be reduced to respect their speed limits.
There is a development branch of EMC2 which is intended to rationalise the way EMC2 treats complex machines like this, and that might address this issue, if there is actually a problem.
I think you would _have_ to use inverse time mode rather than linear speed mode to get sensible feed rates.
In inverse time mode G1 U30 V20 A10 X12 F2 would mean "move all axes to the requested position in 0.5 seconds"

Should I make special hal configuration for them?

Yes, this is definitely going to be a special configuration, but you could create an XYZA machine with stepconf or pncconf as a basis, then edit the INI and HAL by hand (copy and paste) to create the extra axes.

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

More
23 Dec 2014 00:41 #54226 by Tomasz_K

If you want to use two spindles at the same time, then things are a little bit harder. Not because of a limitation of EMC2, but because of a limitation of G-code. G-code has only one "S" word, to control the speed of only one spindle.
If you always want to use both spindles at the same time, at the same speed, or at a fixed ratio, then it is fairly easy, just link the motion.spindle-speed-out pin in HAL to two PWM generators with different input scales (or fix the scales in the VFD setups).
You could also link the PWM scales to Pyvcp input boxes or dials in the GUI.
If the G-code needs to control the second spindle speed directly, then I think you would need to control it with M67 analog output rather than S so that a typical line of G code to set one spindle to 1000rpm and the other to 3000 would be
S1000 M67 E0 Q3000


Hi
Is it possible to synchronize the two rotary axes in the same way as for tapping on a milling machine?

Tomasz

P.S.
Sorry for my bad english.

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

More
28 Dec 2014 19:13 #54333 by andypugh

Is it possible to synchronize the two rotary axes in the same way as for tapping on a milling machine?


There are ways, but the details would depend on exactly what you are trying to do.
I sometimes slave a rotary axis to the spindle for gear hobbing, for example.

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

Time to create page: 0.085 seconds
Powered by Kunena Forum