Welcome to Our Community

Some features disabled for guests. Register Today.

Spindle, how does it work?

Discussion in 'CNC Mills/Routers' started by dareblix, Jun 2, 2016.

  1. dareblix

    dareblix New
    Builder

    Joined:
    Jun 2, 2016
    Messages:
    5
    Likes Received:
    0
    Hello everyone i have a lot of questions about the spindle but let's make it simple, what it is? How do i set up the spindle in grbl? I'm using CNC shield (the red one idk the name) and what kind of motor should i use? I actually have a chicago eléctric 110v dremel can i use it? And i think that's all any sugestion would be great! thanks for read
     
  2. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,237
    Likes Received:
    1,815
    the 'spindle' is the router/dremel/other thing you are using to cut stuff with on the cnc machine.

    You can just switch it on and off yourself, or you can connect it through a relay to GRBL an have the G-code turn it on and off as needed. OR, with some speed control electronics between the shield and the spindle you can control the speed....
    GRBL’s PWM functionality – How to control a laser or variable speed spindle. | Protoneer.co.nz

    GRBL has 2 pin outputs that can control spindles, but what they do exactly depends on the version of GRBL.
    The 2 pins are for on/off/speed and direction.

    in the latest version, 0.9j, the default is to have PWM spindle speed control enabled and this uses different pins.
    older versions had this disabled by default and your cnc shield probably expects this setup.
    details here Connecting Grbl · grbl/grbl Wiki · GitHub

    You can change the option in GRBL (by recompiling in Arduino IDE) so that the pins match your shield.

    Is your shield one of these?
    Arduino CNC Shield V3.XX – Assembly Guide | Protoneer.co.nz
     
  3. dareblix

    dareblix New
    Builder

    Joined:
    Jun 2, 2016
    Messages:
    5
    Likes Received:
    0
    Hello thanks for your explanation, it is this one, i was wondering how should i connect it physically? Can i use a 110v dremel? Dremels usually has universal motors, and it work with ac/dc but i'm not sure if i can use it with grbl, i'll use a 1/8 endmill to cut
     

    Attached Files:

  4. dareblix

    dareblix New
    Builder

    Joined:
    Jun 2, 2016
    Messages:
    5
    Likes Received:
    0
    Also i'm using grbl 0.9 idk if 0.9j it's compatible with grbl shield
     
  5. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,237
    Likes Received:
    1,815
    The GRBL board can only output 5 volts at very low current. So you have to use a relay to switch the 110 volts for the dremel.

    Also, you need to turn off the PWM option, recompile GRBL , and load it onto the Arduino. Follow the instructions on the GRBL web site to install Arduino IDE and then the GRBL library.
    Then, use notepad to open the file
    c:\users\yourusername\sketchbook\libraries\grbl\config.h
    (I may have got the path slightly wrong).
    In that file, change
    Code:
    // Enables variable spindle output voltage for different RPM values. On the Arduino Uno, the spindle
    // enable pin will output 5V for maximum RPM with 256 intermediate levels and 0V when disabled.
    // NOTE: IMPORTANT for Arduino Unos! When enabled, the Z-limit pin D11 and spindle enable pin D12 switch!
    // The hardware PWM output on pin D11 is required for variable spindle output voltages.
    #define VARIABLE_SPINDLE // Default disabled. Uncomment to enable.
    
    to
    Code:
    // Enables variable spindle output voltage for different RPM values. On the Arduino Uno, the spindle
    // enable pin will output 5V for maximum RPM with 256 intermediate levels and 0V when disabled.
    // NOTE: IMPORTANT for Arduino Unos! When enabled, the Z-limit pin D11 and spindle enable pin D12 switch!
    // The hardware PWM output on pin D11 is required for variable spindle output voltages.
    // #define VARIABLE_SPINDLE // Default disabled. Uncomment to enable.
    
    recompile and upload.

    Now GRBL can turn the Spindle Enable pin (D12) on and off in response to M3 and M5 commands in the Gcode.

    That pin can only supply 5 volts at less than 40mA, so we have to have a relay in between.

    You need something like this
    SparkFun Beefcake Relay Control Kit - KIT-11042 - SparkFun Electronics
    That is a kit you have to build but I am sure you can find them ready built.
    like this
    Isolated Relay Circuit
    which is used in this example
    Inventables Blog: Shapeoko Upgrade - Quiet Cut Spindle with gShield and Relay
    (without the speed controller and 48V supply since your Dremel type tool does not need one)
     
    Foresta and Joe Santarsiero like this.
  6. dareblix

    dareblix New
    Builder

    Joined:
    Jun 2, 2016
    Messages:
    5
    Likes Received:
    0
    Okay my CNC shield has 2 spindle pins i guess i'm not sure what of them should i use. Can you explain the M3&M5 g commands?
     
  7. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,237
    Likes Received:
    1,815
    The pins are
    • Spindle direction
    • Spindle Enable
    since you are attaching a dremel that only goes one way round, you don't need the direction pin to be connected.

    M3 is "Spindle on clockwise"
    M4 is "spindle on anticlockwise" (this would involve the direction pin)
    M5 is "spindle off"

    Please read this http://linuxcnc.org/docs/html/gcode/overview.html
    Note that GRBL only supports a small subset of the codes listed there but can get the job done despite that.
     
  8. dareblix

    dareblix New
    Builder

    Joined:
    Jun 2, 2016
    Messages:
    5
    Likes Received:
    0
    Thanks for your explanations i'll try all these stuff :D
     
  9. Mehadi Saki

    Builder

    Joined:
    Apr 27, 2017
    Messages:
    4
    Likes Received:
    0
    Thanks for your discussion. I have a quarry. how I switch Z-limit pin D11 and spindle enable pin D12? just physical using D11 as spindle enable ( that mean in CNC shield Z-limit pin use as spindle enable pin) OR any soft change?
     
  10. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,237
    Likes Received:
    1,815
  11. Mehadi Saki

    Builder

    Joined:
    Apr 27, 2017
    Messages:
    4
    Likes Received:
    0
    "" // Enables variable spindle output voltage for different RPM values. On the Arduino Uno, the spindle
    // enable pin will output 5V for maximum RPM with 256 intermediate levels and 0V when disabled.
    // NOTE: IMPORTANT for Arduino Unos! When enabled, the Z-limit pin D11 and spindle enable pin D12 switch!
    // The hardware PWM output on pin D11 is required for variable spindle output voltages.
    #define VARIABLE_SPINDLE // Default enabled. Comment to disable.""

    I can not understand """The hardware PWM output on pin D11 is required for variable spindle output voltages."""
    Need extra motor driver?
     
  12. arthurmak

    arthurmak New
    Builder

    Joined:
    Dec 23, 2017
    Messages:
    1
    Likes Received:
    0
    Hi,

    Assemble a Chinese CNC that comes with Ardiuno Nano CNC Shield board.

    The board supplies 24V to the spindle motor with on/off switch but it is not working.

    Without the motor plug connected, the X, Y Z axis works. When the motor power plug is connected, when push on/off to connect power, the power adapter would reset and shutdown, apparently triggered by some circuit protection mechanism.

    youtube video:

    Planning to use a relay to separate the power supply, but D12 is connected to ZL jumper (looks like to Z limit). How can I change the Spindle enable to another pin?

    Thanks,
     
  13. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,237
    Likes Received:
    1,815
    read this to see how the spindle enable pin changed between GRBL 0.8 and 0.9/1.1
    Connecting Grbl · gnea/grbl Wiki · GitHub

    so spindle enable is on D11.

    on the front page of the wiki at Home · gnea/grbl Wiki · GitHub it says
    "New '$' Grbl settings for max and min spindle rpm. Allows for tweaking the PWM output to more closely match true spindle rpm. When max rpm is set to zero or less than min rpm, the PWM pin D11 will act like a simple enable on/off output."
    maybe that is what you are looking for?

    PS: knowledge is power, if you use GRBL, read the whole Wiki (-:
     
  14. Foresta

    Foresta New
    Builder

    Joined:
    Mar 16, 2015
    Messages:
    1
    Likes Received:
    1
    Thank you David!!
    This did the trick exactly on my T8 CNC.
    Now I can move to Homing and Leveling tasks.
    Jose
     
    David the swarfer likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice