Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: ekcourter on January 16, 2023, 07:40:41 PM

Title: Macro to Output to Clamp
Post by: ekcourter on January 16, 2023, 07:40:41 PM
Hi. The Mach3 output, which activates a fixture clamp, deactivates with E-stop. I want the workpiece to stay clamped after E-stop. I also need to activate and deactivate clamp with a Macro during operation. Thanks Edward
Title: Re: Macro to Output to Clamp
Post by: Graham Waterworth on January 17, 2023, 05:57:44 AM
You could use a latched relay for the clamping and then use two outputs from mach to toggle the state that way Estop will not change the clamping state.

Then two M code macros can be set up to drive the relay.

M1000.m1s
ActivateSignal(OUTPUT3)

M1001.m1s
ActivateSignal(OUTPUT4)

Title: Re: Macro to Output to Clamp
Post by: ekcourter on January 18, 2023, 03:54:10 PM
On paper, it appears I can use a mechanical relays normally closed contacts and let the contact spring act as default on/clamped.  The SSR could just drive the relay coil.  One less output pin. You may also may be able to open, rather than close, a SSR with an output pin enable, but I don't know how to do this? Thanks all, Edward
Title: Re: Macro to Output to Clamp
Post by: Graham Waterworth on January 18, 2023, 09:01:12 PM
You may need to use a Charge Pump relay so that Mach is in control before any outputs are active, then you should not get strange outputs during start up.
Title: Re: Macro to Output to Clamp
Post by: joeaverage on January 19, 2023, 08:06:24 PM
Hi,
I assume you are using some sort of pneumatic valve to operate the clamp?

My forte is electronics and tend to think of those solutions first......but I would use a JK FlipFlop as a latch. JK FlipFlops are a small IC and can be had for a dollar or so.

If you want to clamp a part, the the JK latch which controls the pneumatic valve will require a pulse from Mach to do so. To unclamp the part a second pulse
is required. If Mach were to Estop the it will not produce the pulse and thus anything that is currently clamped would stay so until the pulse is applied.

JK FlipFlops have a Set and a Reset terminal in addition to the J and K inputs, thus you could have a external button to clamp a part and another button to unclamp
it, without affecting Machs ability to alternately clamp then unclamp.

Craig
Title: Re: Macro to Output to Clamp
Post by: ekcourter on January 20, 2023, 06:45:22 PM
I looked at the latching and bi-state relays and diagramed out how it would work and the code.  I now think that the BOB (PMDX 125) SPDT Mechanical relay would be the simplest solution. The NC terminals would signal clamp, and always default to clamp.  The power could come from either on, or off, the board as needed.  Trusty spring, one Pin, one output, two M codes. Seems too simple but simple is always good, Thanks all, Edward