Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Bill_O on July 28, 2020, 05:25:57 PM

Title: spindle dwell before run
Post by: Bill_O on July 28, 2020, 05:25:57 PM
In Mach3 there was a delay you could set for the spindle to get (up or down) to speed before the file started to run.
I am unable to find a similar setting in Mach4 .
Or do I need to make a custom m3 and use mcSpindleSetAccelTime?

Thanks,
Bill
Title: Re: spindle dwell before run
Post by: Graham Waterworth on July 28, 2020, 09:22:02 PM
Check the spindle tab on the config screen, you may need to scroll left to see it.

Title: Re: spindle dwell before run
Post by: Bill_O on July 29, 2020, 08:48:29 AM
Graham,

I feel like a real idiot.
I looked at that page 10 times and never looked at the column headings.
I just looked at the bottom.

thanks,
bill
Title: Re: spindle dwell before run
Post by: devinw on August 03, 2020, 02:52:49 PM
In a situation where you don't have feedback to mach4 of the actual RPM coming from the VFD, how do you make sure the spindle waits to spool up before moving? Do you check that "override" option only? I tried this last night and my code still just started ripping before the spindle was even ready.
Title: Re: spindle dwell before run
Post by: Bill_O on August 03, 2020, 04:39:52 PM
devinw,

I ended up making a custom m3.
This has some extra things in it for my machine but it might help.

Bill

Code: [Select]
function m3()
local inst = mc.mcGetInstance()
--Get Spindle On and Spindle Auto handles
local hSpin = mc.mcSignalGetHandle(inst, mc.OSIG_SPINDLEON)
local hreg = mc.mcRegGetHandle(inst, 'iRegs0/SpindleAuto')
--Get spindle on state
local SpinOn = mc.mcSignalGetState(hSpin)
--Get Spindle Auto value
local SpinVal = mc.mcRegGetValue(hreg)
if (SpinVal == 0) then
mc.mcSignalSetState(hSpin, 0)
--wx.wxMessageBox('Spindle OFF')
else
if (SpinOn == 0) then
mc.mcSignalSetState(hSpin, 1)
wx.wxMilliSleep(5500)
--wx.wxMessageBox('Spindle ON')
end
end
end
if (mc.mcInEditor() == 1) then
m3()
end
Title: Re: spindle dwell before run
Post by: devinw on August 04, 2020, 11:35:13 AM
devinw,

I ended up making a custom m3.
This has some extra things in it for my machine but it might help.

Bill

Code: [Select]
function m3()
local inst = mc.mcGetInstance()
--Get Spindle On and Spindle Auto handles
local hSpin = mc.mcSignalGetHandle(inst, mc.OSIG_SPINDLEON)
local hreg = mc.mcRegGetHandle(inst, 'iRegs0/SpindleAuto')
--Get spindle on state
local SpinOn = mc.mcSignalGetState(hSpin)
--Get Spindle Auto value
local SpinVal = mc.mcRegGetValue(hreg)
if (SpinVal == 0) then
mc.mcSignalSetState(hSpin, 0)
--wx.wxMessageBox('Spindle OFF')
else
if (SpinOn == 0) then
mc.mcSignalSetState(hSpin, 1)
wx.wxMilliSleep(5500)
--wx.wxMessageBox('Spindle ON')
end
end
end
if (mc.mcInEditor() == 1) then
m3()
end

Nice, I'm sure that works, but that is pretty advanced for me lol. I'm gonna have to read up a LOT to even understand what's going on there :D.
Title: Re: spindle dwell before run
Post by: Bill_O on August 04, 2020, 12:21:51 PM
devinw,

This might help in the understanding.
Go to the bottom to get the newest version.


https://www.machsupport.com/forum/index.php?topic=43260.msg279695#msg279695
 (https://www.machsupport.com/forum/index.php?topic=43260.msg279695#msg279695)
Title: Re: spindle dwell before run
Post by: devinw on August 04, 2020, 12:34:42 PM
devinw,

This might help in the understanding.
Go to the bottom to get the newest version.


https://www.machsupport.com/forum/index.php?topic=43260.msg279695#msg279695
 (https://www.machsupport.com/forum/index.php?topic=43260.msg279695#msg279695)

Thanks! I will read that . Much appreciated