Hello Guest it is March 28, 2024, 01:39:24 PM

Author Topic: Lua Scripting with CycleStop()  (Read 694 times)

0 Members and 1 Guest are viewing this topic.

Lua Scripting with CycleStop()
« on: December 27, 2020, 03:54:20 PM »
Hello together,

I am a fresh forum user. So apologies if I do something wrong here.

I have a problem using my CNC Lathe. I installed an ServoDrive for the spindle. It all works good, but when I use the "Stop" Button on the Lathe Screen the Spindel goes instantly to zero and starts again to go ramped to zero.

I took a look in the ScreenScript and found the CycleStop() function

function CycleStop()
    mc.mcCntlCycleStop(inst);
    mc.mcSpindleSetDirection(inst, 0);
    mc.mcCntlSetLastError(inst, "Cycle Stopped");
end

the mc.mcCntlCycleStop(inst) makes the "0" command. When the function is not called the spindle goes normally to "0" in a ramp as it does when I push the M4 and M3 Buttons on the screen.
Is it possible to access the function mcCNTLCycleStop(inst) in any way to take a look what there is programmed?

Regards,
Rainer
Re: Lua Scripting with CycleStop()
« Reply #1 on: December 27, 2020, 09:16:59 PM »
Hi,
this post would be best on the Mach4 General discussion board, no doubt Tweakie will shift there.

You should not be using Stop (or CycleStop) to stop a job, a hard stop like that decelerates at max and you will lose reference.
The correct procedure is <FeedHold> followed by <Stop>. A <Stop> by itself aborts whatever remaining moves in the motion buffer,
therefore Mach thinks its has made those moves and it at position (x,y,z) when in fact those were aborted and is at position (r,s,t).
A <FeedHold> on the other hand allows the remaining moves, commonly 150ms worth, to execute and drain the motion buffer and
Mach will arrive at (x,y,z) with no loss of reference.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Lua Scripting with CycleStop()
« Reply #2 on: December 31, 2020, 09:58:26 AM »
Another thing to try is under Configure-> Control General tab. Select Cycle Stop Is controlled Stop? checkbox...

Feed hold is the most correct way but it's your machine ;)
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com