Spindle power control

This topic contains 16 replies, has 8 voices, and was last updated by Profile photo of Chris Chris 3 weeks, 5 days ago.

Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #11436
    Profile photo of Jeffeb3
    Jeffeb3
    Participant

    What do you guys/gals think of this:
    http://www.amazon.com/dp/B00WV7GMA2?psc=1

    At 12A, it seems like an easy/safe way to have the dewalt spindle being turned on by the gcode. More specifically, turned off when the cutting is done. It probably also has enough current for the vac as well.

    Added bonus, if cutting the power to the ramps board also cuts input to this relay (which it should), then I can wire an EStop button on the 12VDC power of the ramps, and be able to turn off the motors, and spindle with one, low voltage connection. I’ve got this EStop ready to go, but I don’t feel comfortable wiring it into the 120VAC of the DeWalt. It just doesn’t seem physically sturdy enough.

    Another option I’ve been thinking about, but I need to think about some more, is using a fast switching solid state relay. I think I could actually replace the HF speed control with a PWM’ed solid state relay, which would essentially be doing a triac, but I could control it from the arduino. I might have a hard time finding a premade board with a fast switching 10A SSR on it though. And of course, if it costs $100, I’m out. Any thoughts?

    #11459
    Profile photo of Leo69
    Leo69
    Participant

    That is a cool gadget for the price and would probably work well for on off control of all the equipment you mentioned. In assuming you’ll hardwire the E-stop but how would you implement the spindle and vac on/off, with an M42 code?

    I use an SSR on my homemade arduino reflow oven and i think it only cost a few dollars but I doubt it could switch fast enough for pwm. I think the on/off control is a good idea but i find that i only set speed when i start a job or after a tool change so not sure I’d make much use of pwm spindle speed control.

    #11460
    Profile photo of Jeffeb3
    Jeffeb3
    Participant

    M42, or just use the fan control, M106/M107.

    I also keep thinking of this thing:
    Add speed control to a DIY CNC machine

    I wasn’t thinking of changing the speed on the fly, I just want to be able to set it in the gcode and get consistent spindle speed day to day.

    #11461
    Profile photo of Leo69
    Leo69
    Participant

    Lol. That’s pretty cool. Reminds me of the stereo receivers in the 90s that had volume knobs that physically rotated when you adjusted with the remote:)

    #13825
    Profile photo of Barry
    Barry
    Participant

    Just ordered the power strip from the first post, will update when I get it figured out.

    #13872
    Profile photo of Barry
    Barry
    Participant

    Imagine a 42 year old dude bouncing around like a little girl with kittens….



    Add in a M106 to Repetier in the start scripts, and a M107 to end and kill.
    You get this!

    #13873
    Profile photo of vicious1
    vicious1
    Admin

    That is awesome!

    #13874
    Profile photo of Mike Cunningham
    Mike Cunningham
    Participant

    For speed control, I went redneck.

    http://www.thingiverse.com/thing:1635710

    vacuum and spindle are powered by a ….. less than NEC-approved gang box, behind the router. 2x 20A relays, wired to digital outputs, each relay feeds one of the plugs.

    With my servo solution, you have to add M280 P0 S0 (max speed) or M280 P0 S180 (min speed) with the stock firmware, and M42 P57/58 S0/1 (A3/A4 on AUX-1) to control the relays.

    As an electronics engineer, I’ve significantly modified Marlin on my ramps, adding the appropriate M3/M5 and M10/M11 commands. in Marlin_main.cpp, around line 6500, add the appropriate case blocks for the commands you want to add, then add them higher in the file… here is my M3/M5, for example:

      inline void gcode_M3() {
        OUT_WRITE(SPINDLE_ENABLE, HIGH);
        int servo_index = code_seen('P') ? code_value_short() : 0;
        int servo_position = 0;
        if (code_seen('S')) {
          servo_position = code_value_short();
          if (servo_index >= 0 && servo_index < NUM_SERVOS)
            servo[servo_index].move(servo_position);
          else {
            SERIAL_ERROR_START;
            SERIAL_ERROR("Servo ");
            SERIAL_ERROR(servo_index);
            SERIAL_ERRORLN(" out of range");
          }
        }
      }
      
      inline void gcode_M5() {
        OUT_WRITE(SPINDLE_ENABLE, LOW);
      }

    EDIT 1: and the code lower, in the switch (I put it right after M81):

          case 3: // M3: Turn on SPINDLE_ENABLE relay, P=servo number (defaults 0), S=servo setting (180-0)
            gcode_M3();
            break;
    
          case 5: // M5: Turn off SPINDLE_ENABLE relay
            gcode_M5();
            break;
    

    edit 2- don’t forget to define SPINDLE_ENABLE somewhere (like your pins.h file), to identify which pin the relay is on

    edit 3- most SSR relays can not switch fast enough, and will BBQ if you hook them up to PWM. The highest reasonable rate to cycle a SSR is about 10Hz (10 times per second), and even that will burn it up quickly (within a few months)

    V/r,
    Mike

    #13896
    Profile photo of Jeffeb3
    Jeffeb3
    Participant

    Very cool. I’m definitely jealous now.

    #14008
    Profile photo of nerdyrcdriver
    nerdyrcdriver
    Participant

    Ordered one last night (saturday) and it just showed up this morning (sunday).

    Excited to hook it up when I expand my machine to fit a part I’m making. Just waiting on the new belt to show up so that it can reach the slightly longer span.

    #14023
    Profile photo of Barry
    Barry
    Participant

    I have my shop vac attached to the normally off circuit now as well. Still trying to figure out how to mount a dust foot to the new mount. I think I’m going to have to make a new part for that. Right now I have a crevice tool bungied to the side of the router, which helps a little.

    #14552
    Profile photo of nerdyrcdriver
    nerdyrcdriver
    Participant

    https://smile.amazon.com/gp/product/B017743I7S/ref=s9_simh_gw_g23_i3_r?ie=UTF8&fpl=fresh&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=desktop-1&pf_rd_r=46F13SJGAVCAAWRE2E5X&pf_rd_t=36701&pf_rd_p=6aad23bd-3035-4a40-b691-0eefb1a18396&pf_rd_i=desktop

    Naturally, after I bought the one linked in the first post Amazon recommended its little brother for a little more than half the cost.

    Edit: Whoops, didn’t look at that nearly closely enough. But if you didn’t mind hard wiring in a chord or an outlet its not a bad option.

    #14634
    Profile photo of Jeffeb3
    Jeffeb3
    Participant

    That one sensed the input AC and uses that as a switch. Which can’t just be connected to the D9 pins.

    #14921
    Profile photo of nerdyrcdriver
    nerdyrcdriver
    Participant

    Another good point against it. The post is too old for me to edit/delete though.

    #15075
    Profile photo of Fred D PInczuk
    Fred D PInczuk
    Participant

    oh my god! Where are you been all my life!?

    #22857
    Profile photo of Jeffeb3
    Jeffeb3
    Participant

    I finally took some of my own medicine and bought one of these, and installed it. It works fine. I am using a grbl board, and I connected it to the “spindle speed” control output, but it definitely will not control speed, but with M103 S1000 and M105 commands I can turn it on and off from the GCODE. So that’s a success. Thanks for testing it Barry.

    #23221
    Profile photo of Chris
    Chris
    Participant

    Another little trick for those interested… I was using D9 for my fans on RAMPS to keep the stepper drivers cool (my post uses “M106” to bring up fan speed at the start, and “M106 S150” to slow it down but keep it running at the end). I tried using the ATX power control for the spindle (M80/M81, after changing the firmware PS_DEFAULT_OFF) but I wasn’t happy with the risk of having the spindle accidentally power up (such as when using Repetier Host which automatically issues the M80 command when it connects).

    So instead I went with using D10 (the extruder heater) to control the spindle (and using “M104 T0 S0” to turn off and “M104 T0 S100” to turn on). However, that causes a problem because the firmware is looking for the extruder to heat up (and for the thermistor to respond, which won’t happen since it is a hard resister!) – which in turn shuts down the firmware after a small wait. But a simple edit to the firmware fixes this … just change the Configuration.h file and comment out the “#define THERMAL_PROTECTION_HOTENDS” – which will tell it to ignore the thermistors. The result is being able to control fan speed on D9, and have spindle on/off on D10.

Viewing 17 posts - 1 through 17 (of 17 total)

You must be logged in to reply to this topic.