New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stock Controller Card Connecting Limit Switches #123

Closed
rseijo opened this Issue Feb 10, 2017 · 181 comments

Comments

Projects
None yet
@rseijo
Copy link

rseijo commented Feb 10, 2017

Hi, I am new to CNC and GRBL. Wondering if Limit Switches can be connected to the stock controller card? if yes, does anyone have wiring and GRBL programming instructions? Using GRBL v1.1f

The card in question is the Woodpecker CNC GRBL 0.9

Thanks!
Ralph

woodpecker cnc brbl 0 9

@electrokean

This comment has been minimized.

Copy link

electrokean commented Feb 10, 2017

Start here: https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches
Although that is a work in progress - there is also a long discussion at #96
Nothing specific to the Woodpecker though

@luben111

This comment has been minimized.

Copy link

luben111 commented Feb 10, 2017

@rseijo
Can you bring some more information about your board? Some links, schematics and data sheets in order to help you. Thanks

It looks like Arduino core with added dedicated connectors for stepper drivers.

@chamnit

This comment has been minimized.

Copy link
Contributor

chamnit commented Feb 10, 2017

Closing because this is not a bug, but feel free to continue.

@chamnit chamnit closed this Feb 10, 2017

@rseijo

This comment has been minimized.

Copy link

rseijo commented Feb 10, 2017

Thanks so much for the quick responses!!
In review of the Wiki for Wiring Limit Switches it covers Arduino Cards & Shields; not the stock board (in above image) that came with the CNC Machine. Any ideas?

Also, I have yet to locate any nomenclature, data sheets, etc. for the stock board.

@luben111

This comment has been minimized.

Copy link

luben111 commented Feb 11, 2017

@rseijo Until this is Arduino nano processor with Grbl you can do the following:

  • measure with multimeter and find which header pins to which pins of micro controller are connected
  • once you have this list we can figure out the correct end switches wiring
@electrokean

This comment has been minimized.

Copy link

electrokean commented Feb 11, 2017

Ralph, the only reference to this "stock board" you mention that I could find is one AliExpress seller:
https://www.aliexpress.com/store/product/GRBL-0-9J-USB-port-cnc-engraving-machine-control-board-3-axis-control-laser-engraving-machine/1941516_32713561151.html
This isn't really a common board, and if there is no documentation for it it will be difficult for us to assist you.

The standard grbl limit inputs are on D9 (X) D10 (Y) and D12 (Z). See https://github.com/gnea/grbl/wiki/Connecting-Grbl
There are pins on the header that seem to be labelled A0-A7 and D13 - and the diagram on the above linked page tells you what those are used for.
I can also see some with labels starting with X/Y/Z but I can't make out the labels clearly. At a guess I'd expect those to be the ones you need for the limits. Can you tell us what they say? Maybe a close up photo from front and back of PCB near that connector would help us.
If you have a multimeter, it would be possible to use that to trace out the connections from the ATmega IC to the header pins as suggested by @luben111

All that said, this board uses a CH340 USB to serial chip, and this has been known to be the cause of communication problems for many people (data loss). I would personally recommend getting a board that is more common and well documented, such as the Protoneer shield, and an Arduino Uno to plug it into. I expect those stepper drivers on the Woodpecker board follow the standard "Pololu" pinout, so you should be able to move them across to a new shield. After all the time and cost invested a CNC, you really don't want to use an unreliable and unsupported controller, even more so as a beginner.

@BlueOrangeLive

This comment has been minimized.

Copy link

BlueOrangeLive commented Feb 11, 2017

Hello.

The external contacts are all GND.
2* Limit-X-Axis
2* Limit-Y-Axis
2* Limit-Z-Axis
A5 = Probe
A4 =
A3 = Coolant Enable
A2 = Cycle Start/Resume
A1 = Feed Hold
A0 = Reset/Aboat
A7 =
A6 =
D13 = Spindel Direction
RST
5V

Limit Switch Wiring:

From another shop's view from the back of the board:
pcb_backside

Greetings Jürgen

@luben111

This comment has been minimized.

Copy link

luben111 commented Feb 11, 2017

We need to know the connections between the header pins and the microcontroller.

Use a multimeter and probably a needle or pin to touch the microcontroller pins. It may take 15-20 minutes to get all connections.

@rseijo

This comment has been minimized.

Copy link

rseijo commented Feb 11, 2017

Kean, Luben111 and Jurgen, thanks so much for the guidance and collaboration! I thought I was going to be lost on this issue.

Jurgen, I think you have cracked the code 👍 I will try the suggested setup and report my finding.

Incidentally, I order an Arduino UNO with the CNC Shield, so I have that as an alternative if this stock board does not workout,

BTW, here is a closeup image of the stock board Front.
img_3387

Thanks again!

@luben111

This comment has been minimized.

Copy link

luben111 commented Feb 12, 2017

@rseijo You still need to measure which pin of the header to which pin of the microcontroller is going by using simple multimeter. Set the multimeter to measure short circuit (beeps when you touch both probes). See below images describing the sequence. At the end you should get some list as:
Pin1 (Xon1) - pin XX of Atmega328
Pin3 (Xon2) - pin XX of Atmega328
Pin5 (Yon1) - pin XX of Atmega328
......
If we have this list we could draw nice diagram how to connect the limit switches.
1
2
3

@rseijo

This comment has been minimized.

Copy link

rseijo commented Feb 12, 2017

Hi luben111, I will check that out and report back findings. It will be later today; on my way out to the grocery story :-) Thank you for the detailed instructions with images, this helps immensely!!!

@rseijo

This comment has been minimized.

Copy link

rseijo commented Feb 13, 2017

Hi, I checked the PIN Out of the chip with the multi-meter and found that the Zen, Yen & Xen had no connection points to the Atmega328 chip. Continued checking the other pins and have identified where they reside on the chip (see below image please).

Enabled the Hard limits, boolean ($21=1) and connected a Normally Open switch on Yen. Started Candle (v1.1.7) in Jog mode moved the Y Axis, while it was moving closed the switch and the Axis stopped moving. Same results for X & Z Axis; on all 6 *en pins. Pressed Reset, Alarm appears, pressed Unlock and I am able to continue the Axis travel.

Is this the correct response and sequence to restart the travel?

cnc pinout

@luben111

This comment has been minimized.

Copy link

luben111 commented Feb 13, 2017

@rseijo The end switches are maybe going to some serial resistors - see image below.
cbf5e5fe-f067-11e6-9638-2d04dcadcb68

You need to find where the end switches are going, you can visually follow the wires on the PCB.

Also the enumeration of the microcontroller pin numbers is as follows (please add the pin numbers in the table where to each header pin is corresponding some controller pin).
up

Without populating the table above with some data we can't make the correct wiring,

@luben111

This comment has been minimized.

Copy link

luben111 commented Feb 13, 2017

BTW, if your current GRBL version is before 0.9j and you'd like to use the latest versions of GRBL you probably have to modify the PCB - the Z limit switch in latest versions is attached to different controller pin (compared to version before 0.9j). As I see the listed version is 0.9j so maybe there is no need to modify the board.

@rseijo

This comment has been minimized.

Copy link

rseijo commented Feb 14, 2017

Hi Luben111, I posted the updated diagram above and here too.

The PIN Outs for the X, Y & Z connections are on the backside of the PCB. Added 2 close up pictures.

cnc pinout

fullsizerender

img_3399

@rseijo

This comment has been minimized.

Copy link

rseijo commented Feb 14, 2017

With regard to GRBL version, I am using Candle v1.1.7

image

@electrokean

This comment has been minimized.

Copy link

electrokean commented Feb 14, 2017

OK, so it looks like

  • there are two pairs of header pins per axis wired in parallel - perfect if you want two NO switches
  • R20/R21/R22 are 100 ohm resistors in series with each limit input (for protection)
  • there are capacitors in parallel with the inputs to filter noise
  • the traces from those resistors disappear under the ATmega chip

Limit pins on the ATmega should be
Axis = Arduino pin name = AVR pin name = pin number via series resistor
X = D9 = PB1 = pin 13 via R20
Y = D10 = PB2 = pin 14 via R21
Z = D12 = PB4 = pin 16 via R22

With your multimeter you should be able to measure the 100R resistor between those header pins and ATmega pins to confirm

@luben111

This comment has been minimized.

Copy link

luben111 commented Feb 14, 2017

@rseijo
Now you need to make the final step and measure the connections between other end of resistors and the microcontroller as @electrokean suggested.

r

After that we'll create the proper wiring diagram for your board

@luben111

This comment has been minimized.

Copy link

luben111 commented Feb 14, 2017

The final wiring will be (first we need to confirm the connections - see above)
woodpecker
You can use some cable housing and crimp the wires to get more professional look (these connectors will fit straight into your header)
http://uk.farnell.com/multicomp/2226a-02/crimp-housing-1-row-2-way/dp/1593506

@rseijo

This comment has been minimized.

Copy link

rseijo commented Feb 14, 2017

Hi Kean & Luben111,
Thanks for the continued guidance! Below is updated diagram with the PIN Locations for R20/R21/R22 on the Atmega328 chip.

Luben111, the diagram with the switches is awesome. Thanks

image

@luben111

This comment has been minimized.

Copy link

luben111 commented Feb 14, 2017

@rseijo
Well done! Now we have the whole puzzle:
pin 13 in TQFP32 is PB1 - goes to pin15 of DIP 28 and
pin 14 in TQFP32 in PB2 - goes to pin 16 of DIP 28
pin 16 in TQFP32 in PB4 - goes to pin 18 of DIP 28

This means that the wiring above is correct and you can use to connect the end switches.
Also this shows that you can upload GRBL v.1.1 and everything should work.

Please let us know what was the result after connecting the end switches.

BTW, the Woodpecker board is not bad at all and I'm inclined to use it in the future for small projects.

@electrokean

This comment has been minimized.

Copy link

electrokean commented Feb 14, 2017

@rseijo great work - if only they labelled it better, or bothered to provide documentation
@luben111 what a pity it uses a CH340

@rseijo

This comment has been minimized.

Copy link

rseijo commented Feb 14, 2017

Luben111, Will do! Thanks for the confirmation and all your help!!

@rseijo

This comment has been minimized.

Copy link

rseijo commented Feb 15, 2017

Guys, Complete and Total Success!
Connected the 4 NO switches (X & Y) and everything stops (travel and spindle) when a switch is triggered. Works perfectly! I need secure the wiring and then move on the next challenge; come up with a mounting bracket/place for the Y Axis switches that don't take up too much space.

I'm so grateful to your support and guidance. Best regards!

Ralph

@rseijo

This comment has been minimized.

Copy link

rseijo commented Feb 15, 2017

Call me crazy, any suggested resources of where I can source parts to make a large CNC? 1ft x 3ft Table.

@electrokean

This comment has been minimized.

Copy link

electrokean commented Feb 15, 2017

That's pretty open ended - there is many types of CNC, but I'm assuming you mean a gantry style.
Also 1ft x 3ft isn't that large - maybe for a hobby user, but it is quite small for a business.
You could start with a common Chinese machine - do a search for "6090 cnc" on ebay or AliExpress
You're unlikely to get all the parts individually for much less, and there are sellers who supply the hardware without motors or electronics if you want to customise it.

@electrokean

This comment has been minimized.

Copy link

electrokean commented Feb 15, 2017

Also, check out cnczone.com if you haven't already - lots of build logs there.

@chamnit

This comment has been minimized.

Copy link
Contributor

chamnit commented Feb 15, 2017

A shapeoko 3 XL is pretty close to those dimensions.

@langwadt

This comment has been minimized.

Copy link

langwadt commented Feb 15, 2017

@rseijo parts are just a small part of building a cnc, but I've gotten stuff from http://www.robotdigg.com they've got tons of stuff and I think very decent prices

@lokmangokdere

This comment has been minimized.

Copy link

lokmangokdere commented Dec 31, 2017

@biasedlogic
Hi,
I want to press cnc 1610 plastic parts with 3d printer my machine is prusa i3 hephestos but i dont know slic3r settings. I pressed some other parts,

this is pan tilt camera part first layer
firstlayer
this is pan tilt camera part end layer
endlayer
please can you help me slic3r settings for cnc 1610 plastic parts.
i am using repitier host 1.5
Thanks

@biasedlogic

This comment has been minimized.

Copy link

biasedlogic commented Dec 31, 2017

@lokmangokdere
Your printer is very out of tune. This is not the right place to debug it, please try some of the 3d printing communities for help. Once your printer prints ok, the parts for the homing switches are good on any generic settings - say, 0.2mm layer, 3-4 perimeters, 25-40% in fill, 3-4 top and bottom layers. But right now your printer needs getting right first!

@lokmangokdere

This comment has been minimized.

Copy link

lokmangokdere commented Dec 31, 2017

@biasedlogic
Thank your answer. I am try a lot of 3d printing communities for help but i didnt get help
i am a lot of press part different settings but didnt change soon.
i try for example https://github.com/prusa3d/Slic3r-settings
can you give me cnc 1610 plastic parts and settings ini file? for gread press

@chamnit

This comment has been minimized.

Copy link
Contributor

chamnit commented Dec 31, 2017

@lokmangokdere : Please refrain from posting non-Grbl related issues here. There are lots of other resources online about solving common 3d printing problems, like you have. A simple google search will show you some websites that go through all types of 3d printing issues with pictures, explanations, and how to fix them.

@lokmangokdere

This comment has been minimized.

Copy link

lokmangokdere commented Dec 31, 2017

@chamnit
okey thanks a lot but if i fixed this problem i want to homing switches designed for 1610
this is biasedlogic's comment
"@lokmangokdere
Remind me on November 6th, I'll be back with my 1610, i will send you my full config.
Do you have access to a 3d printer? If yes, i have homing switches designed for 1610"

@Miq1

This comment has been minimized.

Copy link

Miq1 commented Jan 17, 2018

Anyone here having a schematic of the Woodpecker board? I burned the MOSFET for the spindle and am afraid it might have been caused by the probe GND attached to the drill. There is no connection at all between neither spindle housing nor spindle "-" wire to the controller GND, so the probe GND establishes one.

@ilie321

This comment has been minimized.

@ilie321

This comment has been minimized.

Copy link

ilie321 commented Jan 17, 2018

i burned also the irf when i loaded new firmware 1.1. i dont know how was possible. i just changed it with a normal irf540 from which i've cut some part from radiator to fit

@Miq1

This comment has been minimized.

Copy link

Miq1 commented Jan 17, 2018

Awesome! Thank you so much!

I ordered spare RF540s myself to fix the board, but the Chinese provider will send me a replacement board as well. They did not argue at all, so I suppose they might have heard that issue more than once... :-)

In the schematic it looks like the spindle's black wire was connected to GND (with a filtering capacitor), so the additional connection through the probe GND wire should do no harm. Strange...

Did you experience any overheat issues with the MOSFET? I am wondering if the small surface on the board is insufficient to cool the RF540?

@ilie321

This comment has been minimized.

Copy link

ilie321 commented Jan 17, 2018

i think they have some faulty irfs on this boards or the value is other. no overheat

@Miq1

This comment has been minimized.

Copy link

Miq1 commented Jan 18, 2018

Did you encounter any problems since you replaced the MOSFET?

@ilie321

This comment has been minimized.

Copy link

ilie321 commented Jan 18, 2018

none

@nickm324

This comment has been minimized.

Copy link

nickm324 commented Jan 24, 2018

I have hooked up the limit switches and they all seem to work just fine with homing and hard limits enabled. But now I face a new issue that I am getting false triggers during running a job and Grbl says Hard Limit error. I have read alot about adding a cap to take care of the noise that is triggering the false trigger event but not sure how to wire it with the woodpecker. Any help would be much appreciated.

@Miq1

This comment has been minimized.

Copy link

Miq1 commented Jan 24, 2018

The Woodpecker board has already caps on the limit switch ports, as you can see from the schematic ilie321 posted some days ago.

@nickm324

This comment has been minimized.

Copy link

nickm324 commented Jan 24, 2018

Ok thats odd then cause I am constantly getting false triggers. Any ideas why that could be?

@komradebob

This comment has been minimized.

Copy link

komradebob commented Jan 24, 2018

@longjohn119

This comment has been minimized.

Copy link

longjohn119 commented Jan 24, 2018

Not just the stepper motors but also the stepper motor wires ..... If they are bundled together and in parallel then it can induce noise into the switch wiring. One simple trick that often helps is to twist your stepper motor wires ... Look at the photos in komradebob's post from November 9 for a good example of how to do it

@komradebob

This comment has been minimized.

Copy link

komradebob commented Jan 24, 2018

@nickm324

This comment has been minimized.

Copy link

nickm324 commented Jan 25, 2018

Ok, thanks for the info. I will go back and organize the wiring better and and I am no electronics whiz do you mind telling me which side to put the cap, NO or ground side?

@FixerDave

This comment has been minimized.

Copy link

FixerDave commented Feb 26, 2018

have the same CNC (router + Laser) with the Woodpecker CNC GRBL 0.9, but the program is different (old version than Candle 1.1.7, GRBLCONTROL 0.8).
I download and instal Candle 1.1.7 but the "control manual" don´t work
Can you help me ?

Same issue... seems to be the controller board grbl version. GrblControl worked fine, until it crashed loading an NC file I wanted to run. After some futzing around, I discovered that Candle did not work but Grbl Panel did work (with one slight oddity) and did load my NC, so I'm running that (path of least resistance)

As for that oddity, the first time I connect Grbl Panel, it turns my spindle motor on... disconnect and reconnect, and everything is fine. It's consistent. Also, when I start GrblControl, it reports the Home position as when the controller board fired up. Grbl Panel reports Home as when I hit that connect button. Thus, Grbl Panel, and presumably Candle, somehow reset the control board while the old GrblControl does not. It's probably that reset that's causing the issue.

But, anyways, thanks to everyone for all the info. I've got a pile of limit switches, and I now know the connector pinout to wire them up, and that they'll likely work if I remember to set the proper gcode on the controller. "Enabled the Hard limits, boolean ($21=1) and connected a Normally Open switch..."

@donovanlaoh

This comment has been minimized.

Copy link

donovanlaoh commented Mar 22, 2018

Hi All,

I'm very new to this world of cnc, but i love to make something with arduino. I bought my first cnc engraving from aliexpress : https://www.aliexpress.com/item/CNC-3018-with-ER11-Diy-mini-CNC-Laser-Engraving-Machine-3-Axis-Plastic-Acrylic-Pcb-PVC/32848631081.html?spm=a2g0s.9042311.0.0.V71Fhh

img_20180322_124037

After i received it, i try to build it and it's done successfully. But the problem start when i tried to engrave something. The machine stop working randomly with the spindle still running. I use some app like source rabbit, candle, grbl control and universal g code sender. i use the supplied g code sample ( text : "Iphone"). Sometimes it's done sometimes it's not. After one week trying to change any configuration and still randomly stop working, finally i found this thread about limiting switch with woodpecker board, related to CH340 chip that being used that caused error.

img_20180322_124048
my limit switch.

From this thread i found that using bluetooth HC-05 as serial input is the most possible option i have to bypass the CH340 chip. So i did some testing with multitester and found the line of digital pin 0 and digital pin 1. I try not to solder it directly to the chip because i'm afraid it will burn the entire Atmega328 chip. so i found another spot to solder it with safe.

img_20180322_124609 copy
Here are my woodpecker board version and RX TX pin.

My bluetooth HC-05 has been set to BAUD 115200.

img_20180322_131117 copy
Another connection pin for HC-05

After doing this modification, i connect the grbl through bluetooth COM Port, and try to send the gCode. The result is satisfying, every job is done successfully. Sometimes the machine paused about 1s, but it will continue and finish the job.

My Spec:

Macbook pro mid 2012, Windows 7 Ultimate (only for doing cnc and some window specific app.) and here are my GRBL setting. I use Candle for sending GCode. My woodpecker board has been flashed successfully with GRBL 1.1f.

2018/03/22 13:07:29 - $0=10
2018/03/22 13:07:29 - $1=25
2018/03/22 13:07:29 - $2=0
2018/03/22 13:07:29 - $3=5
2018/03/22 13:07:29 - $4=0
2018/03/22 13:07:29 - $5=0
2018/03/22 13:07:29 - $6=0
2018/03/22 13:07:29 - $10=3
2018/03/22 13:07:29 - $11=0.010
2018/03/22 13:07:29 - $12=0.002
2018/03/22 13:07:29 - $13=0
2018/03/22 13:07:29 - $20=0
2018/03/22 13:07:29 - $21=1
2018/03/22 13:07:29 - $22=1
2018/03/22 13:07:29 - $23=3
2018/03/22 13:07:29 - $24=25.000
2018/03/22 13:07:29 - $25=500.000
2018/03/22 13:07:29 - $26=250
2018/03/22 13:07:29 - $27=3.000
2018/03/22 13:07:29 - $30=1000
2018/03/22 13:07:29 - $31=5
2018/03/22 13:07:29 - $32=0
2018/03/22 13:07:29 - $100=800.000
2018/03/22 13:07:29 - $101=800.000
2018/03/22 13:07:29 - $102=800.000
2018/03/22 13:07:29 - $110=1500.000
2018/03/22 13:07:29 - $111=1500.000
2018/03/22 13:07:29 - $112=1500.000
2018/03/22 13:07:29 - $120=40.000
2018/03/22 13:07:29 - $121=40.000
2018/03/22 13:07:29 - $122=40.000
2018/03/22 13:07:29 - $130=300.000
2018/03/22 13:07:29 - $131=150.000
2018/03/22 13:07:29 - $132=44.000

I hope it will helps other that find difficulties with this Chinese Woodpecker board.

@CoolZeroNL

This comment has been minimized.

Copy link

CoolZeroNL commented Apr 2, 2018

ilie321 commented on 17 Jan:
https://s3.amazonaws.com/linksprite/cnc/schematic+2.pdf
--

Nice, thanks this helps alot but.
@ilie321 would you also want to share the eagle files?

@ilie321

This comment has been minimized.

Copy link

ilie321 commented Apr 2, 2018

I found it on Internet is not mine

@biasedlogic

This comment has been minimized.

Copy link

biasedlogic commented Apr 2, 2018

important!
This PCB has a bug: the AVCC pin of the uC is not connected to power. You need to patch it, else all signals interfacing the analogue port (PORTC) will be erratic...

@CONSULitAS

This comment has been minimized.

Copy link

CONSULitAS commented May 27, 2018

important!
This PCB has a bug: the AVCC pin of the uC is not connected to power. You need to patch it, else all signals interfacing the analogue port (PORTC) will be erratic...

@biasedlogic
Thank you for the hint. For which reversion of the board?

There are a lot. Only a few Examples:
V 0.9 here
V 2.6 http://www.cnc-club.ru/forum/viewtopic.php?f=147&t=16449&start=20#p390328
V 2.8 http://ejs.seniejitrakai.net/2018/01/21/woodpecker-2-8-grbl-board-and-isp-connector/
V 2.9 https://de.aliexpress.com/item/GRBL-0-9J-USB-port-cnc-engraving-machine-control-board-3-axis-control-support-laser-engraving/32785635479.html
V 3.0.2 #336 (comment)

@biasedlogic

This comment has been minimized.

Copy link

biasedlogic commented May 27, 2018

@CONSULitAS there are many versions, but many are based off the same schematic. Since the silkscreen printed version may not be unique across board designs there's only one thing left: check your board. Two out of two i had in my hands were wired wrong

@spankywetfish

This comment has been minimized.

Copy link

spankywetfish commented Sep 4, 2018

I managed to flash my WP 3.1 to grbl 1.1f using Xloader.
After trying at 115200 which is the baud used when using Candle etc. and being unsuccessful, i changed the baud within Xloader to 57600 and it uploaded straight away.

@alexkelik

This comment has been minimized.

Copy link

alexkelik commented Oct 14, 2018

img_20181014_150655
Need these pin routing assignment, so i can use my offline grbl controller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment