Lathe sub spindle m codes

More
02 Jan 2025 02:53 #317850 by Jdolecki
Lathe sub spindle m codes was created by Jdolecki
On a lathe the m codes for a Main spindle are m3,m4 and m5. Fwd,rev,stop

if I had a second sub spindle what are the m codes for those?

thanks john

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

More
02 Jan 2025 11:53 #317868 by Aciera
Replied by Aciera on topic Lathe sub spindle m codes
You can control multiple spindles using 'M3 $n'

linuxcnc.org/docs/html/gcode/m-code.html#mcode:m3-m4-m5

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

More
02 Jan 2025 16:31 #317874 by spumco
Replied by spumco on topic Lathe sub spindle m codes
To expand a little on Aciera's response...

Starting/stopping the sub-spindle is pretty straightforward, but as I've recently found there aren't many sub-spindle lathe configurations posted on the forum (or other places), so setting one up isn't really a simple cut-paste from someone else's config.

There are a couple of considerations if you are retrofitting (or building) a sub-spindle lathe:
  • Spindle direction and main-sub synchronization
    • To make programming easier, the sub needs to rotate opposite the main when the sub is sent an M3 command.  If not, then back-working tools (for the sub) would need to all be programmed opposite than main tools.
    • This makes synchronizing the main and sub for a parting hand-off a little more complicated than just setting them both to "M3 Sxxxx".  I won't post the gory details right now, but on my DIY lathe (with sub) I created an M-code activated 'switch' that basically sends the main spindle's inverted position feedback to the sub's command input.
    • Result - when the synch M-code is activated, the main spindle is programmed and the sub is slaved to the main - both rotate at the same speed and direction until the de-activate M-code is triggered.
    • Both my main and sub motors are servos controlled via step & direction; I don't know how accurate 0-10v (or -10/+10v, or Ethercat, etc.) would be during a main-sub synchronization attempt.  
  • Sub axis naming
    • LinuxCNC doesn't allow (as far as I know), axes to have an 'alias' applied.  If you're used to programming a sub's linear axis as "Z2" you'll have to get used to using a different letter.  LCNC can control up to 9 axes, but since the Z-axis is already (likely) the turret, then the logical letter for the sub's linear axis is 'W,' since UVW generally represent linear axes parallel to the primary XYZ axes.
Note that my lathe isn't finished yet and I've not done much cutting, but the main/sub config appear to be working OK... so take the above with a large grain of salt.
The following user(s) said Thank You: besriworld

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

More
12 Jan 2025 11:53 #318761 by robh
Replied by robh on topic Lathe sub spindle m codes
iv not really had issue using UVW on my lathe with two turrets
only part i miss is running them together todo parts, as 2nd has to sit around while other is machining then swop over.. but thats a limit of single path controlls.

as for spindle control
i think the issue with sub spindle, or infact more than 1 spindle is there is no standard when it comes to Mcodes for direction or sync codes also

the only part that remains normal on machiens i find is S1, S2 etc , 1 is always main, 2 is sub and 3,4 etc tend to be turret power tooling etc.

one of my machiens for spindle sync has this code
G114.1 H1 D-2 R0
M77 (wait & check for sync to complete)

G114.1 spindle sync active,
H define which is the master spindle
D which spindle is doing the following
R phase offset from spindle axis zero

M77
follow by M77 makes the machine wait for sync to finish before processing more code, if no R is used can skip M77

this can sync to a already running spindle or both can syn from M5 and start together etc.. ovbisly can sync power tooling to a spindle, spindle to power tooling etc.. so gear hobbing , polygon is possible.

there is also a torque code you can issue to limit torque of spindles on pickup or check the part did part off fully before retract etc.

G114.2-Polygon machining command. There are many unique ways to use
polygon machining. Not just for hex or square shapes. Side slots,
Phillips screw driver shapes and whatever else can benefit from the
live tool synchronized with the part while cutting. Use G113 to
cancel.
G114.2 H3 D1 E3 L6 (R15.)
H3 = Master spindle or S3(gang live tool) S4 U121B option
D1= Slave spindle. Could be 1,-1, 2, -1 - is for direction.
E3 = Rotation rate. Number of teeth of the cutter.
L6= Number of flats to be cut on the part.
R15. = Phase shifting amount in degrees.(only on 1:1 ratio
spindles)
G114.3-(option) Gear hobbing command. With a special holder this command
will
time the cutter(S3) and spindle(S1C1) to constantly hold position
so all we do is feed across the part as if we were turning and a
gear shape is cut. A "C" axis is also needed! Use G113 to cancel.
G114.3 H3 D-9 E1 L18 (P0) (Q1.)
H3 = Master spindle or S3(gang live tool)
D-9= Slave spindle or 9= Caxis -9 = reverse
E1 = Rotation rate. Always set to one. Not sure exactly why!
L18= Number of gear teeth to be on the part.
P0 = Helix angle -89.000 to 89.000 for helical gears. Leave off
or set to P0 for spur(straight) gears.

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

Moderators: piasdom
Time to create page: 0.054 seconds
Powered by Kunena Forum