585,582 active members*
4,831 visitors online*
Register for free
Login
IndustryArena Forum > OpenSource CNC Design Center > Arduino > Need help connecting limit switches to ramps board
Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2012
    Posts
    16

    Need help connecting limit switches to ramps board

    I have my homebrew diy cnc machine running a code through Grblgru and am happy with it so far.

    I am using a mega 2560 with ramps 1.4 board but cannot get the limit switches to work.

    I have a 3d printer as well so I know how to connect X, Y, and Z limit switches to the board but the grbl wont react when I toggle the switches.

    I have tried both min and max pins but no dice.

    I know the switches work when I use pronterface and Marlin but would like to have them connected with grbl.

    Any help appreciated.

    Greg

  2. #2
    Join Date
    Mar 2015
    Posts
    409

    Re: Need help connecting limit switches to ramps board

    First is to check if the mega sees the limit switch activation

    Do you have a volt meter and can you measure the voltage change on the atmega port(s) when the limit switch is activated/released!

  3. #3
    Join Date
    Apr 2012
    Posts
    16

    Re: Need help connecting limit switches to ramps board

    G'day and thanks for your reply,

    I know the ramps board works fine with the limit switches in pronterface and marlin.

    The limit switches register triggered when pressed but when I load grbl, I get no response from the motors when the switches are triggered.

    I have tried the switches in both min and max on grbl but get no response.

    I have just found another version of grbl for cyclone that looks promising so I'll see how that goes.

  4. #4
    Join Date
    Mar 2015
    Posts
    409

    Re: Need help connecting limit switches to ramps board

    Quote Originally Posted by Gregted View Post
    G'day and thanks for your reply,
    The limit switches register triggered when pressed but when I load grbl, I get no response from the motors when the switches are triggered.
    You have to enable GRBL to response on limit switch activation. In version 1.1f set $21 to 1!

    Quote Originally Posted by Gregted View Post
    G'day and thanks for your reply,
    The limit switches register triggered when pressed but when I load grbl, I get no response from the motors when the switches are triggered.
    If i get it right, you use the same mega and ramps just changed firmware from marling and pronter to GRBL?

  5. #5
    Join Date
    Apr 2012
    Posts
    16

    Re: Need help connecting limit switches to ramps board

    Thanks again.

    I have changed $21=0 to $21=1 and confirmed with $$ but still no response from steppers when I press the limit switch.

    I have connected one to both min and max on the ramps board but no response from either.

    I am watching the cnc the whole time so no real drama but it would be handy to have this fail safe working.

  6. #6
    Join Date
    Mar 2015
    Posts
    409

    Re: Need help connecting limit switches to ramps board

    I checked my arduino uno board, it does response to limit switch.
    try the folowing:
    - Disconnect limit switch
    - Connect your terminal program (the one u used for setting $21=1).
    - Reset atmega
    you should now see the normal startup message and version information.
    - connect the Limit A-axis pin on the atmega to ground.
    You should see now the alarm message.
    This is my message
    Grbl 1.1f ['$' for help]
    ALARM:1
    [MSG:Reset to continue]
    This is my message

    You said:
    I have tried both min and max pins but no dice
    What do you mean by min and max pins, GRBL only has X,Y,Z limit pins!

  7. #7
    Join Date
    Apr 2012
    Posts
    16

    Re: Need help connecting limit switches to ramps board

    Good morning,

    It's 7.30 am here in Oz so might be good evening there at 11.23 pm.

    Thanks again for all your help.

    I will try connecting the limit switches with the terminal window open later.

    I am using Mega 2560 and ramps 1.4 board to run my cnc and it has limit pins for both min and max on all axis for 3d printer set up.

  8. #8
    Join Date
    Mar 2015
    Posts
    409

    Re: Need help connecting limit switches to ramps board

    Your ramps board has a GND and Signal pin for each Limit (X,Y,Z).
    I can now reproduce your problem.
    When GRBL hits a limit, all steppers are stopped immediateley. You will lose positions. GRBL will not response to any command until a reset is done.
    If you then (re)boot GRBL with one of the limit switches activated, a message is send warning that the limit switch is activated, and GRBL response to commands again. This way you can jog to inactivate the limit switches.

    This is the message i see when i boot GRBL having a limit switch activated:
    Grbl 1.1f ['$' for help]
    [MSG:Check Limits]
    [MSG:'$H'|'$X' to unlock]
    By default GRBL expect the limit swiches to be open when not activated (NO=Normaly Open), this way you can detect a short in the wiring. I prefer limit switches to be closed when not activated(NC=Normaly Closed) then you can detect a disconnected limit switch.
    The RepRapWiki also advises to use NC
    1. Connect S (top row, labelled to the left) on RAMPS to NC on the switch.
    2. Connect GND on RAMPS to C on the switch
    You can solve this by two ways:
    - Change the wiring of you limit switches to NO
    - Change the signal level of the GRBL detection by setting $5=1 (Invert Limit Pins).

    My software also doesn't detect booting with the limit switch activated. I have to make a fix for this because it is important it does!

    Hope this help

    Huub

Similar Threads

  1. plz help wiring limit&Home switches to TB6600 board
    By soolom_1 in forum Stepper Motors / Drives
    Replies: 3
    Last Post: 06-25-2016, 12:40 AM
  2. JP-382A Board Limit Switches
    By iBeta in forum PCB milling
    Replies: 0
    Last Post: 12-16-2015, 01:47 PM
  3. Help with limit switches and Xylotex board
    By dowling177 in forum Xylotex
    Replies: 5
    Last Post: 11-26-2008, 09:51 PM
  4. connecting limit switches
    By leandrot in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 8
    Last Post: 03-26-2008, 12:41 PM
  5. Limit and EStop Switches with HCNCPro board
    By dshowalt in forum Hobbycnc (Products)
    Replies: 2
    Last Post: 06-17-2007, 05:34 AM

Tags for this Thread

Posting Permissions

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