Hello Guest it is April 26, 2024, 01:41:20 AM

Author Topic: Customized spindle warm-up?  (Read 482 times)

0 Members and 1 Guest are viewing this topic.

Offline JtheB

*
  •  35 35
    • View Profile
Customized spindle warm-up?
« on: May 23, 2023, 08:56:07 AM »
Hey ya'll,
How would one go about customizing the commands behind the Spindle Warm-up button? I have a CNCDepot S30 spindle that I'd like to last until I'm dead. Following their warm-up procedure takes about 15 minutes and I currently do manually. Automating this process would be a big deal in the mornings. The S30 peaks @ 18K rpms.

S30 Warm-up procedure:
Run @ 25% max rpm for 3 minutes
Stop for 1 min
Run @ 50% max rpm for 4 minutes
Stop for 1 min
Run @ 75% max rpm for 4 minutes
Stop for 1 min
Check temp for 85deg @ spindle housing

I'm not a coding expert but I'm learning.....
The code I can manage stumbling through if I knew where to apply it in Mach
Thank you.
« Last Edit: May 23, 2023, 08:58:20 AM by JtheB »
Re: Customized spindle warm-up?
« Reply #1 on: May 23, 2023, 09:15:29 AM »
Just write a G Code program and save it as your spindle warm up.  That is how I have all of our spindle warm up programs here in the shop.
Figure out a time that your spindle warms up to that 85 deg mark and let it be that. 
Use your own Spindle RPM in place of S
G04 P###  Adding a "." will make it read seconds instead of milliseconds (from my experience).   G04 P1.0 = 1 Second

(Spindle Warm Up)
S1000
G04 P180.0 (Dwell for 3 Minutes)
M5
G04 P60.0 (Dwell for 1 Minute)
S1500
M3
G04 P180.0
M5
G04 P60.0
S2000
M3
G04 P180.0
M5
G04 P60.0
ETC......
ETC....
M30
Chad Byrd

Offline JtheB

*
  •  35 35
    • View Profile
Re: Customized spindle warm-up?
« Reply #2 on: May 23, 2023, 09:20:09 AM »
NICE!
Thank you Cbyrdtopper!
Re: Customized spindle warm-up?
« Reply #3 on: May 23, 2023, 09:25:10 AM »
I just load the G Code File and run it from there.
But you can make a custom button if you want to do that as well.
Save your Spindle warm up program as O9001 (as an example).  Save it in the "Subroutines" folder in the Mach4 Directory
Make a button on your screen and in the button's Clicked Script put following code in:

local inst = mc.mcGetInstance()
mc.mcCntlMdiExecute(inst, "M98 P9001")

The only thing you need to do different in your spindle warm up program is to have an M99 at the end instead of an M30 so it will return to the button press and stop from there.  Weird I know, but that is how it works for me when I run sub programs from a button press.



Or just save it and run it is as a G Code file.
Chad Byrd

Offline JtheB

*
  •  35 35
    • View Profile
Re: Customized spindle warm-up?
« Reply #4 on: May 23, 2023, 09:47:36 AM »
Understood.... mostly.
It'll take me a bit to navigate but I'll post an update once sorted.


Thanks again Chad.

Offline JtheB

*
  •  35 35
    • View Profile
Re: Customized spindle warm-up?
« Reply #5 on: May 23, 2023, 10:20:49 AM »
This is gonna sound ignorant, but.....
Does the initial spindle startup S1000 not need a prior M3 command in this context?
Is there a function of the interface that supersedes this need?

Offline JtheB

*
  •  35 35
    • View Profile
Re: Customized spindle warm-up?
« Reply #6 on: May 23, 2023, 10:46:03 AM »
Scratch that.
This is perfect.
Much appreciated!