Hello Guest it is March 29, 2024, 09:37:05 AM

Author Topic: Mach 3 outputs and e stop behavior  (Read 4823 times)

0 Members and 1 Guest are viewing this topic.

Re: Mach 3 outputs and e stop behavior
« Reply #10 on: February 09, 2018, 04:51:46 PM »
ya the latching relay idea would work, drawback is i don't have any on hand and also i believe it would require 2 io per relay instead of 1 which i don't have available on my control card if i want 4 vise. but it is probably the cleanest solution suggested in a way and i did not even think about that approach until Overloaded suggest the 2 relay solution, so thanks for that idea .

anyway i was hoping to get something working today with what i have in the shop so i made some arduino program that monitors the mach3 controller card outputs + the estop switch. basically it just passes the mach3 outputs but latches the previously scanned state if the estop is activated. and then after finishing  that i realized the arduino cannot drive the relays bc they are 24 volt and the arduino board on its own does not have open drain outputs of course, whereas the cnc control card does have 8 open drain outputs.

so in the end i just ordered a relay shield for the arduino and have to buy something anyways, but i t was quite cheap and should be here early next week. tgif i guess.

ill post results when it arrives.

thanks for your input everyone.
Re: Mach 3 outputs and e stop behavior
« Reply #11 on: February 09, 2018, 05:58:26 PM »
ya the latching relay idea would work, drawback is i don't have any on hand and also i believe it would require 2 io per relay instead of 1 which i don't have available on my control card if i want 4 vise.

The method I suggested only uses 2 outputs total, 1 for each relay. 2 simple SPDT ice cube relays. (I assumed everybody has a few of them lying around  ::) ;D )

BTW, what is the voltage of the devices we're talking about ?
Outputs ? Vise ?
(how does an electric vise work anyway ?  ??? )
Just curious.
Russ
Re: Mach 3 outputs and e stop behavior
« Reply #12 on: February 10, 2018, 12:12:16 AM »
Hi Russ,

yes 2 outputs total per vise per se, since i ultimately desire to control each vise independently. if you look at the movements in the  video i posted earlier, i have 10 macros basically, 1 to open/close all vises, and 1 to open close each vise independently. in the video i make use of all macros to get that sequence. So that uses 4 outputs which is all i have actually per card free in my current config. the macros are all basically de/ActiveateSignal(xx), there is not much magic there and it works nicely other than the estop issue.

i also have 2 larger cncs than shown in video that can hold actually 8-10 of such vises so i try to keep the io required as low as possible for now which is why originally i had bought a modbus relay card to expand the output capability of my machines, and intended to not even use any of the outputs from the controller cards since there are only a few free on the cards i have.it;s possible eventually this card will work out but i spent about 3 days reading and trying things, and beyond the modbus setup window i could not get mach3 to communicate with the card, so i gave up.

re voltages of device:

the cnc card is a "leafboy77" card that has open drain outputs so you can use whatever voltage yo would like.  in all my cabinets i have  a 24v supply for most things and then either a 48 or 60v supply for the steppers. so i have 24 v relays and air solenoids etc. since the leafboy outputs are open drain it is no problem to interface them with 5V arduino but i did not think hard enough about then putting the arduino on the  relays i have wired to the air solenoids which require 24V.

re: electric vise

probably i should have said pneumatic vise, because it is actually just an air cylinder with a jaw on it. by electric i just meant it is controlled electronically, with an air solenoid, very similar to the collet example you gave in your own work i would guess. so the solenoid directs the air to either open or close the vise. i can take more pictures on monday if you are interested in how it is setup. but is basically mach3->leafboy77 card->a bunch of relays and water pumps etc at 24V and a bunch of steppers at 48-60 VDC + a vfd.

have a great weekend!
Re: Mach 3 outputs and e stop behavior
« Reply #13 on: February 10, 2018, 12:44:28 AM »
Thanks for the details, I understand better now.
I have not seen the video. Slow connection, lame pc ......could not get it to run for me.
Will try again a bit later when on a different pc.

You have a good one as well.
Kind regards,
Russ
Re: Mach 3 outputs and e stop behavior
« Reply #14 on: February 10, 2018, 12:13:59 PM »
Russ,

Ah ok, if the video is not working then here is 1 picture i had already taken off my phone last week of the vises, you can't see all 4 in the photo but im sure you can get the idea, just a twin rod cylinder with some blocks added...



cheers

s
Re: Mach 3 outputs and e stop behavior
« Reply #15 on: February 15, 2018, 12:48:02 AM »
tl;dr: i was able to make an acceptable solution using an arduino and a relay shield.




...I'm not sure this is the best solution, it does work in that you can latch the vise to that state it was in when the estop event occurred. Here i tried to make a holder for the a
holder for the arduino to stick on din 25 rail.




I made a video to show the clamp does not move from either state when the estop is pressed. In the test setup m8201 is closing the first vise and m8301 opens it. I hit estop in both states to show it does not affect the position.



The final program was a bit more complicated than i originally thought bc my original idea had some gotchas and was not adequate for every situation.

In the end i used the mach3 outputs (4 of them, 1 for each vise) to send pulse signals to the arduino inputs, a momentarily high pulse toggles the state of the corresponding output relay.  I used 4 outputs on the arduino to signal the relays state back to inputs of the mach3 control card. The signal on these connections is the state of the corresponding relay (ie latched or not).

The open sesame macros check the corresponding mach3 control card input to see if the vise is open or closed. If it is in closed state then a toggle pulse is sent to the corresponding arduino input, if it is already open no pulse is sent. The closed works in a similar manner. This allows me to control 4 vises with 4 output only, not 8 as would have been needed with actual latching relays. But at the cost of 4 inputs on the mach3 control card if you want mach3 to know the sate of the vise. The card has 16 inputs and i use only 5  before this, so not too bad in the end.

Again its a bit of a complicated solution but it seems to work

I also noticed in the modbus section there are many serial modbus firmwares for the arduino, so that might be another way to try to set it up as well which might not require any connections between the arduino and mach3 control card at all.

Anyway, thanks to Russ and others for their input.

s