Hello Guest it is March 28, 2024, 06:43:05 PM

Author Topic: Manual Spindle Start Switch?  (Read 2044 times)

0 Members and 1 Guest are viewing this topic.

Manual Spindle Start Switch?
« on: April 26, 2020, 01:31:42 PM »
I have a benchtop lathe that I converted to CNC (https://www.youtube.com/playlist?list=PLZYHEvmLdMEqb9NKAPYyhaSPm2VY4q45G if you are curious)

I find that I still do the occasional operation (like drilling from the tailstock) that requires the spindle to be turned on/off manually.

I can do this from the Mach 4 interface, but it would be handy to wire in a physical switch so I can start and stop the spindle. This would work exactly like the interface buttons (and ideally would toggle the UI elements ).

Can this be done, and if so, how?
Re: Manual Spindle Start Switch?
« Reply #1 on: April 26, 2020, 08:36:44 PM »
I use the PMC to "connect" all of my operator station switches.


Mike
We never have the time or money to do it right the first time, but we somehow manage to do it twice and then spend the money to get it right.
Re: Manual Spindle Start Switch?
« Reply #2 on: April 26, 2020, 10:51:33 PM »
Do you have an example?

Do you use a separate momentary-contact switch for each op, or can a toggle work as off/on?

Offline thosj

*
  •  532 532
    • View Profile
Re: Manual Spindle Start Switch?
« Reply #3 on: April 27, 2020, 08:43:14 AM »
I do it in the Screen Start Script, Signal Library. A button, momentary, is wired to an input, in my case a Pokeys 57E, and the code is in the Signal Library. It IS a toggle. You need to setup the input for whatever input you're using, BOB, PoKeys, whatever. PMC might be easier, you don't have to write the code, but the code ain't much!!

My code:

------------Mach4 Input 8 PoKeys Pin 8----------------
------------Toggle SpinCW-----------------------------
[mc.ISIG_INPUT8] = function (state)
if (state == 1) then
     local inst = mc.mcGetInstance();
     local sigh = mc.mcSignalGetHandle(inst, mc.OSIG_SPINDLEON);
     local sigState = mc.mcSignalGetState(sigh);
     if (sigState == 1) then
         mc.mcSpindleSetDirection(inst, 0);
     else
         SpinCW()
     end
end

end,

Tom
--
Tom
Re: Manual Spindle Start Switch?
« Reply #4 on: April 27, 2020, 09:47:11 AM »
So then you also need a "Spindle Off" button, momentary contact, that works the same way, right?

Offline thosj

*
  •  532 532
    • View Profile
Re: Manual Spindle Start Switch?
« Reply #5 on: April 27, 2020, 01:09:37 PM »
No.....that momentary button, with that code, toggles........like the code comment says.......one press, spindle on, next press, spindle off. You do need a speed active, and Mach4 starts up with zero speed. So an S1000 or some such via MDI or gcode. I actually put some code in my RefAllHome script to set the spindle speed as in Mach3 it was remembered between sessions and I never shook that, always assuming a speed was there on Mach4 startup and it isn't:)
« Last Edit: April 27, 2020, 01:11:17 PM by thosj »
--
Tom
Re: Manual Spindle Start Switch?
« Reply #6 on: May 05, 2020, 09:31:35 PM »
OK, a switch to start it is  nice, now how about a pot to an d analog input to over ride the spindle speed. I have done this for Feed and Rapid, but I didint find a spinOverrride script.

Anyone done this?

Offline thosj

*
  •  532 532
    • View Profile
Re: Manual Spindle Start Switch?
« Reply #7 on: May 06, 2020, 07:27:22 AM »
I do it but with a PoKeys 57E which has inputs for analog pots, pins 44 and 45 if memory serves. So I just wired pots, one for spindle speed and one for feed override. I don't think I had to write any code, might just be in PoKeys plugin/software. The feed override also overrides rapid, so you can pretty easily control things!! I'm old fashioned and ran machines in the real world with pots to control feed/speed, so I will NOT run a machine without those two things. The new kids laugh, but I prefer sneaking up on the first part rather that replacing broken cutters. My Kurt vises don't have cutter marks on top!!!
--
Tom
Re: Manual Spindle Start Switch?
« Reply #8 on: May 06, 2020, 07:57:34 AM »
Thanks. I am using a Pokey57E and I have pots connected for Rapid and Feed over ride. They require a script in the PMC folder that reads the pot and calls the Feed and Rapid override function. What I dont know is the correct name of the Spindle over ride function.

Offline thosj

*
  •  532 532
    • View Profile
Re: Manual Spindle Start Switch?
« Reply #9 on: May 06, 2020, 09:24:48 AM »
Hmmmm.....no script in my PMC folder. I'll have to go look how they work!! Trouble with all this customization stuff is you struggle and get it working and two years later you don't remember how the hell you did it;) I'll be back.
--
Tom