Вы находитесь на странице: 1из 7

Wiring Limit Switches gnea/grbl Wiki GitHub Pgina 1 de 7

gnea / grbl

Wiring Limit Switches


Sonny Jeon edited this page on Jun 2 6 revisions

The limit switches are used to detect the physical limits of the working area and to position the Pages 14
head in initial position during the homing process. Properly connected limit switches can increase
significantly the reliability of the GRBL - the microcontroller pins connected to the switches are very Home

vulnerable to any noise. Compiling Grbl

Before starting, make sure your coordinate frame is setup properly on your CNC machine and Connecting Grbl
satisfies the right-hand rule. If you're not sure, its explained in the quick setup guide here. Flashing Grbl to an Arduino
Otherwise, you will likely encounter problems with the homing cycle, where it behaves strangely. If
Frequently Asked Questions
you are having issues with the homing cycle, read this FAQ.
Grbl v1.1 Commands
There are two types of end switches wiring:
Grbl v1.1 Configuration
Normally Opened end switches (NO) - switches are connected in parallel, if the head hits one
Grbl v1.1 Interface
of the switches the resistance becomes low (<10 Ohm). The wiring is simple but there is no
indication if one of the switches is disconnected (broken wire). Grbl v1.1 Jogging

Grbl v1.1 Laser Mode


Normally Closed end switches (NC) - switches are connected in serial, if the head hits one of
the switches the resistance become high (> 1 MOhm). The wiring is more complicated but if Known Issues
any of the switches is disconnected (broken wire) this will be immediately detected. This is the Set up the Homing Cycle
way how all professional CNC machines end switches were wired.
Using Grbl
The easiest way to attach limit switches to Arduino UNO is to just connect the switches to the Wiring Limit Switches
corresponding pins and to rely on the internal weak pull up resistors (~47K) of the ATMega328
chip. The Normal connected (NC) switch wiring is shown below:
Clone this wiki locally

https://github.com/gnea/grbl.wiki.git

Clone in Desktop

The Normal Open (NO) switch wiring is shown below:

https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches 07/10/2017
Wiring Limit Switches gnea/grbl Wiki GitHub Pgina 2 de 7

One improvement is to connect 1K to 4.7K pull up resistors to 5V and 100nF capacitors to GND.
The extra pull ups and capacitors have noticeable noise suppression effect over the GRBL
performance.

https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches 07/10/2017
Wiring Limit Switches gnea/grbl Wiki GitHub Pgina 3 de 7

Adding shielded cables to the end sensors or at least using twisted pair of two wires reduces
further the noises injected from the next door stepper motor cables.

The ultimate solution for noise filtering on end switches is to add optocouplers - they have many
benefits compared to the listed above solutions:

There is no direct galvanic connection between the end sensor and the microcontroller pin -
any ESD discharges will not affect the GRBL controller
Optocouplers are inert elements - short glitches will simply not pass at all
Optocouplers are current driven elements and they require huge energy from the noises in
order to pass - in normal operating conditions they effectively all the noises

During the discussion on GRBL forum we came to the following design of GRBL limit switch end
sensor break out board - see the images below. The board is single side PCB (1.0mm to 1.6mm
FR4) and uses connector with screws for attaching the end sensor wires. We recommend to use
crimping of the wires before inserting them into the connectors.

The schematic of the end sensor board which uses optocouplers

https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches 07/10/2017
Wiring Limit Switches gnea/grbl Wiki GitHub Pgina 4 de 7

The BOM file of used components and the estimated price of the board

The 3D view of the board - this is how it will look like after assembly.

https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches 07/10/2017
Wiring Limit Switches gnea/grbl Wiki GitHub Pgina 5 de 7

The bottom copper layer (viewed from top side of the board)

The top silkscreen layer (viewed from top side of the board)

https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches 07/10/2017
Wiring Limit Switches gnea/grbl Wiki GitHub Pgina 6 de 7

The bottom solder resist layer (viewed from top side of the board)

The DXF file of the copper layer (view from bottom - ready for milling) GRBL.DXF.V2.zip

The GCode generated in CopperCam for milling the board - by having some CNC and engraving
bit it's possible to mill the board from FR4.

Simple.GRBL.zip

The gerber files and the NC drill files for producing properly the PCB (you can send these files to
any PCB factory to get good quality boards).

Gerbers.zip

The schematic/BOM/PCBs and other layer images as single PDF for convenient documentation

End.switches.break.out.board.pdf

For Woodpecker PCB the wiring of end switches should be done in the following way:

https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches 07/10/2017
Wiring Limit Switches gnea/grbl Wiki GitHub Pgina 7 de 7

You can use some cable housing and crimp the wires to get more professional look (these housing
connectors will fit straight into the board header)

http://uk.farnell.com/multicomp/2226a-02/crimp-housing-1-row-2-way/dp/1593506

https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches 07/10/2017

Вам также может понравиться