586,655 active members*
3,098 visitors online*
Register for free
Login

Thread: UPS for CNC

Results 1 to 17 of 17
  1. #1
    Join Date
    Dec 2010
    Posts
    634

    UPS for CNC

    So, I'd like to head down to the shop to make a few fretboards for a customer but, we've got thunderstorms with plenty of lightning and wind coming through - conditions which have lead to brownouts and short blackouts in the past.

    What I'm wondering is if anyone has any ideas on how to integrate a UPS into a CNC system.

    My spindle is run from a VFD which runs for about 15 to 20 seconds after you un-plug it so I imagine it might run for a second or so under load.

    When power is removed from the driver, the Z axis usually drops a bit. In case of a black out or an e-stop, the part is typically ruined due to the Z-drop.

    So, I think the solution to protection from brown/black outs would be to run the system from a UPS. Upon power failure, or perhaps 500ms of total power failure, the system would immediately feed hold, retract to safe Z and shut off the spindle and then sit until the juice runs out.

    If power returns before the computer shuts off, it would just be a matter of hitting stop, re-starting the spindle and doing a "run from here" to finish the piece.

    Does anyone know how hard it would be to get the message to Mach 3 that there is a power failure and for that message to run a macro that would perform those tasks?

    UPS's with USB connections are pretty common these days, I just bought one for my computer for I think about $65 or something like that. I haven't written a lick of code in about 15 years so I have no idea how one would go about writing a plug in for Mach to read the UPS status over USB.

    Thoughts?
    -Andy B.
    http://www.birkonium.com CNC for Luthiers and Industry http://banduramaker.blogspot.com

  2. #2
    Join Date
    Nov 2007
    Posts
    483
    Quote Originally Posted by BanduraMaker View Post
    UPS's with USB connections are pretty common these days, I just bought one for my computer for I think about $65 or something like that. I haven't written a lick of code in about 15 years so I have no idea how one would go about writing a plug in for Mach to read the UPS status over USB.

    Thoughts?
    I guess it would be a matter of figuring out what pin on the USB is the output and whether it was within the volt range of your controllers input the using a similar code to what the auto zero tool does.

    Never done it myself but it should be possible.

  3. #3
    Join Date
    Jan 2006
    Posts
    2985
    I'd think you could hack into the indicator ligths on the UPS if nothing else. Many have an LED to show normal and UPS operation. If you could tap into the LED which shows it is running on battery power, you could feed that signal into your BOB to halt mach.

    Matt

  4. #4
    Join Date
    Dec 2010
    Posts
    634
    It's not so simple unfortunately. USB uses a serial protocol to communicate with the PC using some sort of standardized messaging for UPS devices. If it was a simple logic level output, you'd be right but, it's not.

    p.s. didn't read about the LED hack idea - that's an interesting one and might just work.
    -Andy B.
    http://www.birkonium.com CNC for Luthiers and Industry http://banduramaker.blogspot.com

  5. #5
    Join Date
    Nov 2006
    Posts
    1036
    Rather than hack into the UPS, you could use a 120 v relay (to detect power loss {link: http://www.mouser.com/ProductDetail/...EXNyXZ1uAQsEWG } ) and feed in either the NC or NO output (as you feel is appropriate) to your BOB.

  6. #6
    Join Date
    May 2005
    Posts
    120
    Finding your way back from the lost steps is the hard part.

    If you were using a 1/4" bit, you could make a 1/4" plunge hole somewhere in the waste, and that could be your reference starting point should you have to run your code again.

    If you added some extra deep cycle lead acid batteries to your UPS, you might be able to add enough reserve to finish a medium size job. You see solar guys using 500 amp hour batteries chained together.

    The trade off would be: are the ruined pieces worth the price of the battery bank over a year's time?
    I've built two Mechmates (48x96" and 60x120"), so can you: http://mechmate.com/

  7. #7
    Join Date
    Dec 2010
    Posts
    634
    I use home switches so that's actually the easy part.

    I really like the idea of using some sort of sensor to trip an input on the G540 and run a macro rather than using the USB output from the UPS. A cap on the output line could put a little delay in there to keep from tripping on a very small brownout event. I might have to do some testing to see how long my spindle runs when power is dropped.

    I'm not really interested in spending a ton of money on this and besides that, my spindle runs off 220 so I'd need a 220 inverter which would be ridiculously expensive.

    The brownouts and blackouts are somewhat rare but we do probably get about a half dozen per year.

    Now how do I get an input to run a macro?
    -Andy B.
    http://www.birkonium.com CNC for Luthiers and Industry http://banduramaker.blogspot.com

  8. #8
    Join Date
    May 2005
    Posts
    120
    Quote Originally Posted by BanduraMaker View Post
    I use home switches so that's actually the easy part.

    We all do, but have you ever tried to restart a part? Was it EXACTLY on?


    Usually (and mind you my table is 60x120" ) it is off by a mm or so. Acceptable for some jobs, but not all.
    I've built two Mechmates (48x96" and 60x120"), so can you: http://mechmate.com/

  9. #9
    Join Date
    Dec 2010
    Posts
    634
    I typically use fixtures with a dowel pin hole that I use as the origin set to a particular offset. e.g. for my fretboards, the fixture is G59P7. So far, every time I've re-mounted the fixture, it's been within .001" of where it's supposed to be. That is, when I check it with a 1/4" pin in the spindle, it goes right in the hole. I can hear a change in tone from the stepper maybe 50% of the time which means it's off by a little bit.

    I do have one fixture that's totally off by about .040" all the time. I think it has to do that the fence I used to cut it originally was off by about that much but I can't be sure.

    I have done a few "run from here's" e.g. after breaking a .024" bit during fret slot cutting and it was dead nuts on.
    -Andy B.
    http://www.birkonium.com CNC for Luthiers and Industry http://banduramaker.blogspot.com

  10. #10
    Join Date
    May 2005
    Posts
    120
    Quote Originally Posted by BanduraMaker View Post
    .

    I'm not really interested in spending a ton of money on this and besides that, my spindle runs off 220 so I'd need a 220 inverter which would be ridiculously expensive.
    220-240v UPS are standard throughout most of the world. But you are right, they, and the batteries would cost you money.
    I've built two Mechmates (48x96" and 60x120"), so can you: http://mechmate.com/

  11. #11
    Join Date
    May 2005
    Posts
    120
    Quote Originally Posted by BanduraMaker View Post
    I typically use fixtures with a dowel pin hole that I use as the origin set to a particular offset. e.g. for my fretboards, the fixture is G59P7. So far, every time I've re-mounted the fixture, it's been within .001" of where it's supposed to be. That is, when I check it with a 1/4" pin in the spindle, it goes right in the hole. I can hear a change in tone from the stepper maybe 50% of the time which means it's off by a little bit.

    I do have one fixture that's totally off by about .040" all the time. I think it has to do that the fence I used to cut it originally was off by about that much but I can't be sure.

    I have done a few "run from here's" e.g. after breaking a .024" bit during fret slot cutting and it was dead nuts on.

    Cool, then you have a great system in place already!
    I've built two Mechmates (48x96" and 60x120"), so can you: http://mechmate.com/

  12. #12
    Join Date
    Jul 2006
    Posts
    1256
    Andy are you thinking of a UPS for the whole machine?
    The Z axis may drop with power off if you have a ballscrew as the weight of the spindle will allow it to drop without a brake.
    On a brown or blackout,what happens when the power comes back on
    Larry
    L GALILEO THE EPOXY SURFACE PLATE IS FLAT

  13. #13
    Join Date
    Dec 2010
    Posts
    634
    Quote Originally Posted by lgalla View Post
    Andy are you thinking of a UPS for the whole machine?
    The Z axis may drop with power off if you have a ballscrew as the weight of the spindle will allow it to drop without a brake.
    On a brown or blackout,what happens when the power comes back on
    Larry
    Yes, a UPS that would allow the machine to run long enough to move the spindle to a safe place in case of a blackout. My spindle itself runs off of 220 so I wouldn't run that on the UPS. The VFD stores some juice and I imagine it might run for a second or two with the power cut but I need to check.

    My Z axis indeed drops when de-energized and that's the whole problem I'm trying to avoid. When the machine is warm, I've seen it drop several inches when I power it down.

    I like the idea of making some sort of sensor on the 120v line that would trip when power is lost. A small cap & resistor on the line could be tuned to provide a delay of a few milliseconds so that brownouts wouldn't cause the system to trip.
    -Andy B.
    http://www.birkonium.com CNC for Luthiers and Industry http://banduramaker.blogspot.com

  14. #14
    Join Date
    May 2008
    Posts
    4068
    You can put shocks in Z axis to spindle and will not drop after power shut off
    XZero cnc

  15. #15
    Join Date
    Mar 2003
    Posts
    35538
    Now how do I get an input to run a macro?
    Say the macro you want to run is M987.m1s

    1) Assign the Input pin to an OEMTrigger #
    2) Go to Config > System Hotkeys, and enter 301 for the OEM Trigger # you set up.
    3) Create a macro with the following code:
    SetTriggerMacro(987)
    and save it as M988.m1s (it can be any number)
    4) Add M988 to your Initialization String in General Config.

    When the input is triggered, the M987 macro will run.

    It's also possible to use a Brain to trigger it, but this is easier.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  16. #16
    Join Date
    Jun 2007
    Posts
    3757
    If UPS does not run the whole machine, it is unlikely that a brownout won't stuff something up.
    You can buy fairly low cost generators these days. Just make sure the power quality matches the machine and computer requirements.
    For the same power a generator will probably cost much less than a UPS.
    Buy some ear muffs at the same time. Then you can't hear the thunder, either.

  17. #17
    Join Date
    Feb 2009
    Posts
    6028
    Ups devices have been used for decades on sensitive cnc equipment for years, to do just that, get them to a safe position.
    Your other options are to counterbalance your z, add a electromechanical brake. The brake is usually the easiest. Power releases the brake, no power locks it up.

    I have bought line monitors to shut stuff of quicker in brown out. Grainger has those.

Posting Permissions

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