Add gear/range change to linuxcnc turn post

  • Trav328
  • Trav328's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
24 Aug 2025 17:14 #333864 by Trav328
For the past while i have been using mastercam v9 for my linuxcnc powered lathe , I use 3 M codes to select speed ranges , this was easy to setup in the mastercam post but im having a hard time with the fusion post.

All the information i can find online seems to be a bit dated or the post format has changed , it looks like there used to be a fairly simple section for the spindle but now is more complicated than i can handle.

1-649 rpm - M101
650-1199 rpm - M102
1200-2200rpm - M103

Here is what the code should look like , note the M102 before the spindle turns on , If using constant surface speed it should output the M code for the max RPM

G0 T0002 M06 G43
G97 M102 S1200 M03
G0 G54 X1.8013 Z.11 M8


I have attached the newest linuxcnc turn post with a few small changes i have made for other things.including G43 at every tool change .

Thanks for any help you are able to offer.

 

File Attachment:

File Name: linuxcncturning.txt
File Size:52 KB
Attachments:

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

More
27 Aug 2025 11:52 #333989 by andypugh
Replied by andypugh on topic Add gear/range change to linuxcnc turn post
If you are using CSS then this might be more complicated than it first seems.
The PP would need to calculate the spindle speed at the start and end of the sequence of feed moves and choose a spindle gear appropriately.

My own lathe handles this in HAL, but certainly not optimally. It will often do a gear change at the end of a facing cut, then change back at the start of the next cut, which isn't ideal.

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

  • Trav328
  • Trav328's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
29 Aug 2025 00:45 - 04 Sep 2025 15:58 #334067 by Trav328
Replied by Trav328 on topic Add gear/range change to linuxcnc turn post
it took me a few days of reading and playing but i got it working even with  CSS , in the properties tab you can now define you highest speeds for the ranges and fusion will automatically output the desired M code , im used to old mastercam posts but getting the hang of fusion.

once i figured it out this was fairly easy to setup using some bits from an okuma post , you can add as many gears as needed.

here is my current linuxcnc post, setup to switch between 3 gears based on defined speeds in the property tab , puts G43 at every tool change , properly posts G28 , working CSS (selects high gear) , several other changes im forgetting. 

download the text file and change to .CPS , i am not responsable for your machine.

   
 
  
 

File Attachment:

File Name: linuxcnctu...ange.txt
File Size:53 KB
Attachments:
Last edit: 04 Sep 2025 15:58 by Trav328. Reason: fixed g28 calling x0/z0 , g43 at tool change , working CSS (selects high gear)
The following user(s) said Thank You: andypugh

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

Time to create page: 0.098 seconds
Powered by Kunena Forum