587,086 active members*
3,061 visitors online*
Register for free
Login
Results 1 to 15 of 15
  1. #1
    Join Date
    Jul 2009
    Posts
    140

    Power down when finished??

    Hi all,

    I'm running Mach3 into a SmoothStepper into a G540. My router is a Bosch Colt.

    I want to have the machine turn itself off completely off after it's finished running a program.

    I have designed a relay setup that will take care of turning the router and dust cleanup vacuum on and off at the right times. No questions or problems there.

    I also want to be able to turn off power to the G540 and the hold down vacuum when the job is finished - I don't like the idea of the steppers and G540 sitting idle, generating heat, for any more time than necessary. Once the job is done, I don't need the vacuum hold down, either.

    Problem is, I need to be able to power up the G540 and hold down vacuum before I've loaded Mach3 - potentially before the computer is even turned on, in the case of the hold down vacuum - but I want to be able to shut both items down with a signal once the job is finished.

    I'm envisioning a momentary switch that powers up some sort of relay network that stays on either until it recieves a signal from the G540, or until a neighboring circuit (the power for the router, for example) loses power.

    Any ideas? Thanks!

    CK

  2. #2
    Join Date
    Mar 2010
    Posts
    371
    Sure. You use a relay with an extra pole as a latch, and use another one controlled by Mach to break the latch.

    You need two relays and a separate power source (like a little 5V wall wart).

    One relay is the one that powers the gecko and the pump. It needs an extra 'pole'. Call this the "power" relay.

    The other is a relay controlled by Mach3 (from a control line on the gecko). Call this the "control" relay.


    Connect one side of the power relay coil to the separate power supply +.
    Connect the other side of the power relay coil to the NC connection of the control relay.
    Connect the common connection of the control relay to the NO connection of the momentary switch AND the NO connection of the extra pole of the power relay.
    Connect the common connection of the momentary switch to ground.
    Connect the common connection of the extra pole of the power relay to ground.
    Connect the - of the extra power supply to ground


    When everything is off, both relays are off.
    When you depress the momentary switch, the coil of the power relay is energized (one side is connected to + of the extra supply, the other is connected to ground through the NC connection of the control relay, through the switch).
    The relay activates, and now the extra pole also connects the coil of the power relay to ground. At this point, the switch can be released, the extra pole is holding the coil energized. This is the latch.

    When Mach3 turns on the control relay, the NC connection through the control relay is broken. The power relay turns off, powering off the gecko and the pump.

    Mach3 then turns off the control relay. The power relay is not activated, because neither the momentary switch nor the extra pole is on.

  3. #3
    Join Date
    Jul 2009
    Posts
    140
    Maybe I've read your reply wrong, but I'm understanding that when Mach3 goes to turn on the spindle at the beginning of the program, the NC is broken and then the Gecko and pump would lose power? What would that accomplish?

    I like the way you're thinking, though...there has to be a way of doing this.

    I'd like to avoid using a second control signal - I'm not an expert at GCode by far, but from what I see, the only constant in every program of mine is a command to turn on the spindle (M3) and at the end M30 to shut it all down. I could use the coolant on code (M7), but I haven't seen it in any of my programs, so I'd have to manually insert it each time - not an ideal solution!

  4. #4
    Join Date
    Mar 2010
    Posts
    371
    This doesn't interact with the router power - you said you had that taken care of. You have to power down the router before you power off the gecko, but so what. The power relay would only power the gecko and your vacuum pump.

    You can't control things with magic - you need a control signal, and you need to invoke the thing some how.

    I'm not a Mach expert, but there may be a way to execute some code on every program exit. I'm not entirely sure that's what you want to do.
    Rather, again, not knowing how to do this, but it's possible to create a button in Mach3 on the screen that can turned on and off. If you can execute some code at the end of every program, that code could test the screen button state, and power off if it's set. That might make it work - it wouldn't power off unless you hit that screen button.

    Brian

  5. #5
    Join Date
    Jul 2009
    Posts
    140

    Talking

    Sorry for the misinterpretation, Brian! Lack of sleep makes me really bad at figuring out technical writing.

    So far, I've found two options for achieving this control layout: (this is counting the router power, btw)

    A momentary switch, a wall adapter, two single pole relays and a double.

    or

    A momentary switch, one single pole and one double pole WITH an extra control signal.

    It might be possible to do much better, though. I'm working up a schematic that will use the momentary switch, the wall adapter, two double-pole relays, or possibly even one single and one double - and with only the router control signal.

    But it's going to be a voodoo design...think multiple pathways to power the adapter, and/or using the common, NC, and NO legs on each relay pole for two DIFFERENT functions each. And I'm going to try and do it without diodes or anything else.

    The difficulty right now is timing...while switching between NC and NO states in a relay, there is a millisecond that neither circuit is complete, and that would be a very bad thing while a program is trying to run.

    I will post my results after I've figured out and tested them.

    Here's hoping I don't create a paradox that destroys the planet...2012 AD would be pissed if I went and did it's job for it

  6. #6
    Join Date
    Mar 2010
    Posts
    371
    I think router power should be completely independent of the gecko and pump power. That should only be a single pole relay, from one control output. You really want to be able to turn on and off the router power while the rest of the system is up and running.

    You wanted away to effectively sleep the entire system. That takes something like what I described, and it doesn't depend on relay switching time. I think you need a completely separate control for that, completely independently of the router control.

    Count the states:
    Frame and pump running, no router
    Frame, pump and router running
    Nothing running

    While there are only 3 states, you need two bits to control 3 states. You can't do it with one. There is no way to indicate router power off without gecko and pump off, which I think you need.

    Please remember then when the gecko power shuts off, all control signals connected to it float.

  7. #7
    Join Date
    Jul 2009
    Posts
    140
    The activate pulse for the router should be independant. I agree there.

    You're also right about there being 3 states, and the need for 2 bits.

    There are already two bits, though. First bit is controlled by the pushbutton switch, second bit comes from the gecko as the router on command.

    The trick is that bit 1 on activates state 1, but bit 2 on activates state 2 AND bit 2 off deactivates everything.

    You've essentially made a latching relay with the wall wart transformer - I might wind up using an actual latching-type relay in it's place, to simplify things a tad.

    As for my timing comment earlier, what I was referring to was the problem that most DT relays are "break before make" - the NC connection breaks before the NO contact forms. The relay type that we want are called Type D - which make the new contact before breaking the old one.

    So again, I think this is possible. You probably still disagree...so the only way to resolve this would be for me to either come up with a working circuit, or fail at it. Then we know!

  8. #8
    Join Date
    Mar 2010
    Posts
    371
    Well, it's your machine and your design, but I would want to be able to turn my router off without powering down the entire system.

    Latching relays are helpful, but tend to be expensive. You could line power a latching relay coil on, but you need to use low voltage DC to power it off. Latching relays don't come that way. That would mean another relay to allow Mach control, or the wall wart and a low voltage DC latching relay.

    In my design, there is no problem with break before make, but I'm not sure what you are planning.

    Have fun!

  9. #9
    Join Date
    Dec 2003
    Posts
    24223
    Brtech sounds like he has covered most bases, it sounds on the surface you are trying not only to do a few things out of the norm but may be against code etc, although for a privately owned machine you can do just about anything you want.
    If you want some thing that can be left powered at all times and look after programmable logic, you could look at a Smart Relay,
    http://www.alliedelec.com/Images/Pro...ol_8140258.pdf
    These are made by a few manufacturers and essentially are the same unit, relabelled.
    They do not need offline programming s/w etc and can be picked up on ebay fairly cheap.
    Some even include a real time clock.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  10. #10
    Join Date
    Jul 2009
    Posts
    140
    Quote Originally Posted by brtech View Post
    Well, it's your machine and your design, but I would want to be able to turn my router off without powering down the entire system.

    Latching relays are helpful, but tend to be expensive. You could line power a latching relay coil on, but you need to use low voltage DC to power it off. Latching relays don't come that way. That would mean another relay to allow Mach control, or the wall wart and a low voltage DC latching relay.

    In my design, there is no problem with break before make, but I'm not sure what you are planning.

    Have fun!
    Brian,

    I'm a bloody nimrod! The switching arrangement I described is all well and good...UNTIL you have to shut off the router for a tool change, clean out the chip vac, or whatever. In which case, the whole thing would shut down.

    So I'm gonna go sit in the corner with my dunce cap for the next few minutes.

    I'll be designing this system around two output signals, hopefully Mach3 has some simple way of ensuring both signals happen at program start, and stop when the program's over. Thanks so much for all your help, I really do appreciate it!

    Quote Originally Posted by Al_The_Man View Post
    Brtech sounds like he has covered most bases, it sounds on the surface you are trying not only to do a few things out of the norm but may be against code etc, although for a privately owned machine you can do just about anything you want.
    If you want some thing that can be left powered at all times and look after programmable logic, you could look at a Smart Relay,
    http://www.alliedelec.com/Images/Pro...ol_8140258.pdf
    These are made by a few manufacturers and essentially are the same unit, relabelled.
    They do not need offline programming s/w etc and can be picked up on ebay fairly cheap.
    Some even include a real time clock.
    Al.
    Hey Al

    Put it down to the unnatural joy I get from solving difficult problems. Sometimes it leads me to overcomplicate things. And yet - I look at the Smart Relay, and I say to myself "that looks far too complicated".

    So...are you in MB, SK, or western ON?

  11. #11
    Join Date
    Dec 2003
    Posts
    24223
    Quote Originally Posted by CarbonKevin View Post


    Hey Al
    So...are you in MB, SK, or western ON?
    Your neighbourhood.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  12. #12
    Join Date
    Dec 2008
    Posts
    226
    Are you aware that the G540 has a charge pump circuit for safety purposes (and really it should be used) so if MACH or EMC etc. are not running the G540 and all outputs are disabled... also when the charge pump signal is absent the motors receive no power and can be freewheeled...

    Unless of course you override the charge pump... and then while you are changing a router bit while the computer is turned off and someone turns it on, or the PC crashes and reboots, or the power fluctuates because of a storm somewhere or something else happens... the port goes into flux and fires up your router removing something I'm sure you'd rather keep... It is probably best practice to switch off your router and unplug it prior to changing bits... but I know that theory flies out the window when its not spinning already... why switch off something that is already off??? I have worked in a plant where the power goes out, and people don't think to turn off their equipment before the power comes back on... table saws left on with the blade up etc... anywhere you can, design for safety BEFORE convenience.

  13. #13
    Join Date
    Jul 2009
    Posts
    140
    Pandinus,

    I'm somewhat familiar with the charge pump on the G540. Currently I do have Mach3 configured to use this feature.

    The way I'm thinking of the system is this - at all times, all safety measures are in place.

    The pushbutton switch will be something of a "priming" feature for the system. Pushing it will send power to my hold down vacuum and my control box. Whether the G540 actually energizes at that point or not doesn't particularly matter.

    The ultimate aim is that when I so chose, I can (possibly with an additional switch) turn the system to "shut down when finished running" mode. From there, when the current program Mach3 is running ends, everything will turn itself off.

    I'm curious - I haven't mentioned it before, but I do have a SmoothStepper in there. Didn't think it affected the particular question particularly. How would it's presence affect the ports going into flux during a reboot and whatnot?

    As for router control when it's being worked on, I usually just power it off at the switch. It's nicely recessed enough that it's a bit of a stretch to imagine it being bumped...but since accidents happen, this system will enhance safety, as the router will need a signal to turn on from the Gecko as well as being switched back on after servicing.

  14. #14
    Join Date
    Dec 2008
    Posts
    226
    I don't know about the smootstepper, but when a PC boots it does some voodoo... checking peripherals and setting IRQs etc.. at this time it can cycle the ports and pins...not even sure if its on purpose but I had my plasma torch fire once while I was trying to set things up... turned off the charge pump while trying to get THC functions working and then rebooted the machine... frightened me a little bit... If the torch hadn't been mounted it might have damaged something or started a fire...

    I'd like to assume being a USB device it is not going to do anything untill the driver is loaded and tells it to do something...

    Here is a thought, and is done quite often... just a 2 or 3 way toggle switch, one position is ON middle OFF and other is PC control... set up a relay on the PC 12V... when you switch the PC on the peripherals get power, then you just have to figure out how to make MACH shut down the PC when finished the program.

  15. #15
    Join Date
    Jul 2009
    Posts
    140
    Wow, Pandinus, you MUST be in my neighborhood...and looking in my window at my new design!

    I'm going to use a selector switch, like you've described, that will either let the system run normally, or into an "auto shutdown" mode, which will disconnect all power once Mach3 reaches a M30 command, and disables all outputs. There will be indicators on it to show what mode the system is in, and an E-stop switch, for good measure.

    The only trick I have to figure out now is finding a way for the M3 command to send signal two different outputs...but that SHOULD be possible with some script editing.

    Once I've got it sorted I'll post schematic and details of the Mach3 changes I made.

    Thanks again everyone!

Similar Threads

  1. X2 cnc finished for now maybe
    By hoss2006 in forum Benchtop Machines
    Replies: 1044
    Last Post: 11-08-2019, 03:10 PM
  2. First CNC - 50% Finished
    By Trucks in forum DIY CNC Router Table Machines
    Replies: 22
    Last Post: 09-14-2009, 02:45 AM
  3. Finished at last (well almost!)
    By Ali Kat in forum DIY CNC Router Table Machines
    Replies: 17
    Last Post: 05-27-2009, 06:19 PM
  4. X2 cnc finished for now
    By hoss2006 in forum Benchtop Machines
    Replies: 1
    Last Post: 01-12-2007, 11:55 PM
  5. Finished the new power supply
    By rippersoft in forum CNC Machine Related Electronics
    Replies: 18
    Last Post: 08-01-2005, 11:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •