Running Dewalt 660 from gcode and board

New Home Forum Mostly Printed CNC – MPCNC Hardware Development – MPCNC Running Dewalt 660 from gcode and board

This topic contains 26 replies, has 5 voices, and was last updated by  Kevin Lease 3 months, 3 weeks ago.

Viewing 27 posts - 1 through 27 (of 27 total)
  • Author
    Posts
  • #87903

    Chris
    Participant

    Is it possible to wire the Dewalt to the board and operate it through the gcode.

    #87904

    Jeffeb3
    Participant

    The dewalt runs on AC. So you need a relay. There was one I liked with all the wiring and safety involved on amazon.

    https://www.amazon.com/gp/product/B00WV7GMA2

    You can wire this into the fan port, and control it like you would a fan.

    Any relay should work though, This is just nice because you don’t have to risk shocking yourself with AC. Or shorting AC

    #87905

    Jeffeb3
    Participant

    Whoa, it looks like it’s only available from other, expensive sellers… Sorry.

    #87907

    Chris
    Participant

    So how would that work? I may be able to find something similar. I’m pretty new the CNC world. Would I plug the Dewalt to this and then the board to the high power relay?

    #87909

    Chris
    Participant

    Sorry, missed the bottom part of your reply. Would I lose any power at all with this thing? What would be the gcode to start or stop before and after a job?

    #87911

    Jeffeb3
    Participant

    For this one, you’d connect the dewalt to this, and plug this power strip into the wall. On the side of it, it’s got little green plugs to connect to the controller board. If it senses a signal on the green plug, it connects the dewalt’s plug to wall power. If it doesn’t sense a signal, it disconnects the power to the dewalt. The controller would have to send a signal when it wants the router on.

    If you use the fan connector, then you can put commands in your gcode to start the fan at the beginning, and stop it at the end. You’ll hit play on your gcode, and see the router spin up, do all the cutting, and then turn off at the end.

    If you plan on doing this. Be very careful. I have not given you enough information to do this safely (and I’m not sure I can from here). You’ll have to do some research and find out how to do it. AC is no joke. The controller can only hurt itself so far, but if you give it AC power, it can kill.

    #87913

    Chris
    Participant

    Okay. Thanks. I’m giving it a lot of research. It’s a future project I’m considering. I have yet to fully operate my CNC. Still running tests on it and tweaking things. I also intend to operate a 12v led strip that will turn on and off when I start and stop a job or control it through a fan pin on the board. So that is my first project before I get into auto power control of the spindle.

    #87918

    Jeffeb3
    Participant

    I have a tutorial on thingiverse running one of the more exposed relay boards off of a raspberry pi. I am switching the AC to the printer and the 12V to an LED strip with it.

    https://www.thingiverse.com/thing:1428478

    It’s also sort of incomplete, because I want people to use their heads. That’s my safety strategy :). It’s also for the pi and octoprint, which is a little different.

    #87919

    Heath
    Participant

    Whoa, it looks like it’s only available from other, expensive sellers… Sorry.

    It’s available from the manufacturer for a reasonable price here:  https://dlidirect.com/products/iot-power-relay

    I use it as well.  It has 2 “normally off” outlets and the DeWalt is plugged in to one of them.  I have the sensor wired to the “heatbed” port on my controller.  Gcode to turn the bed heater on will trigger the relay to turn the “normally off” outlets on turning on the DeWalt.

     

    #87932

    Chris
    Participant

    What would the gcode be? I see on amazon they have a raspberry pi with a relay module on it. Would that be the same thing? I’m not exactly sure what I’m looking for. Is it basically a large mosfet?

    #87933

    Chris
    Participant

    Would this also work?

    NEW Raspberry Pi Expansion Board Power Relay Module for Raspberry Pi 3 2 Model B B+ @XYGStudy https://www.amazon.com/dp/B01G05KLIE/ref=cm_sw_r_cp_api_i_kVixCbVFZMAQN

    #87934

    Chris
    Participant

    I was under the impression octoprint would drop offline on occasion. It’s done it with my printer s couple times.

    #87935

    Barry
    Participant

    I’m not sure if they’re solid state relays, or real mechanical relays.  For hooking to a Rambo or ramps, there’s gcode to enable either the heat bed, or part cooling fan.  You’d hook the iot relay to one of these outputs.  Then add the proper gcode to the start of your cut file.  Estlcam has setting to add it automagically.

    #87936

    Chris
    Participant

    Ok, awesome. I’m still learning the whole thing with the gcode being sent for tool change as well.

    #87938

    Chris
    Participant

    Is octoprint required?

    #87957

    Heath
    Participant

    I think that relay for the Pi would add a lot of complexity. The “IoT Relay” from Digital Loggers is very simple to implement. No hacking up AC power wires, no involving a Raspberry Pi, etc. It is literally just a pair of wires going from your RAMPS or Rambo or whatever control board you have to the relay. Then you add a single command to your starting and ending gcode that you generate from Estlcam, Fusion 360, or whatever you’re using to create your tool paths. It’s very simple and elegant.

    #87981

    Barry
    Participant
    #87984

    Jeffeb3
    Participant

    Barry, and Heath have it right. The relay board you posted is pretty neat, but it won’t be controlled by Marlin, it would have to be controlled by the pi. Sorry I sent you down the rabbit hole with my Thingiverse link.

    That relay board has relays that say 10A at 250VAC, so those are probably mechanical, not SSR. That would be an ok relay for this application, since the dewalt is 600W at 120VAC, or about 5A.

    The IoT relay (especially at $27) is a better choice. No AC wiring needed, and it will be controlled by Marlin.

    For example, turning the fan on is M106 S255:

    http://marlinfw.org/docs/gcode/M106.html

    M107 will turn it off. Your gcode would just have to add in the M106 command at the top and the M107 command at the bottom. You can do this with a text editor, but it’s more convenient to just make the program that’s making the gcode (like estlCAM) insert those commands for you.

    If you wanted to do the pi solution, then you’d have to run octoprint, and configure it to turn on and off that pin when it started or stopped a job. That’s basically what I’m describing my TV tutorial.

    FTR, I run octoprint on all my prints, and I haven’t had a problem with a job not finishing due to octoprint. I’ve been using it for more than two years without problems. But there are some problems that could cause instability, like a bad USB cable, having an insufficient power supply, or even running the GUI on the pi while printing (it really should be headless).

    #87991

    Barry
    Participant

    That reminds me, I really need to get my relays wired in.  I bought two of them about 6 months ago to put on both routers, and haven’t gotten around to it…

    #87996

    Chris
    Participant

    I have my RPI running only octoprint without raspian or anything, but the lack of power could have been an issue. I now use a power cord instead of a mini usb to basically a phone charger. I think im going to buy it. I originally tried to universal g-code sender via the pi for marlin on my rambo v1.4, but it looks like it won’t let me. Sucks, but no big deal. Just seems like a way better option. I had a pi and a screen already. Think i will just use octoprint and the iot relay you have. Looks like a sweet deal.

    #88000

    Chris
    Participant

    I found it for 19.99 on amazon. Shipping on the man site is 26 bucks and the item is 24. kinda insane. With prime, ill get it for less than half the cost.

    #88001

    Chris
    Participant

    Will it also be able to regulate speed or will i via the software?

    #88003

    Jeffeb3
    Participant

    Will it also be able to regulate speed or will i via the software?

    No, that’s a whole different animal. This is just on or off.

    #88367

    Chris
    Participant

    so, i got the iot relay, wired up some lights on one fan, a 40mm fan on another, and the router on the hotend. I get a failed error. E1 heating failed specifically. Could it be lack of thermistor or am i demanding too much power from the power supply? I have an atx psu i could use, but don’t want to try it if that’s not the issue. Any ideas?

    repetier log:

    18:21:56.454 : echo:DEBUG:INFO,ERRORS
    18:22:27.659 : Error:Heating failed, system stopped! Heater_ID: 0
    18:22:27.666 : Error:Printer halted. kill() called!

    #88369

    Jeffeb3
    Participant

    The heaters don’t work like the fan. They use the thermometer to decide when to heat. They have a lot of checks since a runaway heater is a fire hazard.

    The thing you could do is remap the heater pin to something else, like pin 70, then configure the board with more fan pins and set them to the original heater pin. Then you can turn stuff on with M106 S255 P2 or P3.

    #90467

    Heath
    Participant

    You’ll have to edit firmware a little.  Either remap the pins, OR comment out these two lines in configuration.h:

    #define THERMAL_PROTECTION_HOTENDS
    #define THERMAL_PROTECTION_BED

    With those lines enabled, the firmware will look for changes to the temperature when the heaters are enabled.  It doesn’t see a change, so assumes a problem and shuts everything down for safety.  Necessary on a 3D printer, but not for our MPCNC (unless you’re also using it as a 3D printer).  Commenting out those lines disables that.

     

    #90968

    Kevin Lease
    Participant

    I used this mechanical relay from Amazon:

    https://www.amazon.com/gp/product/B00MKWACVI/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1

    It costs about 8 dollars.

    Uses 12V DC to control 120VAC power.  I bought three.  I use one for my dewalt router, one for my shop vac and the third I have set up with an emergency stop button to interrupt power to ramps board (when it loses power it simultaneously stops motion of the motors and turn off relays to router and vac).

    I changed the definition in Configuration.h of marlin to #define MOTHERBOARD BOARD_RAMPS_14_EFF and refreshed the firmware to ramps 1.4

    The relays are controlled through 12V output on D8 and D9 on ramps 1.4.

    Then the control of the relay is with Gcode such as M106 P0 S255 to turn on the relay 1 and M106 P0 S0 to turn it off; and M106 P1 S255 to turn on relay 2 and M106 P1 S0 to turn off relay 2.

     

     

     

     

    1 user thanked author for this post.
Viewing 27 posts - 1 through 27 (of 27 total)

You must be logged in to reply to this topic.