Limit Switch Debugging.

Discussion of tinyG control platform
Post Reply
pastprimitive
Posts: 34
Joined: Wed Aug 13, 2014 4:31 pm
Contact:

Limit Switch Debugging.

Post by pastprimitive » Wed Aug 27, 2014 4:39 pm

What's the recommended way to test my limit switches on my tiny G. I have 4 installed right now for the min & max for my X & Y. I wired them as NC, ground to the ground pin, and other side to the min, max pins, etc... I used cat 5e for the wiring from the limit switch to the Tiny G. I disabled the Z-axis limit switches.

They seem to be throwing alarms in tgFX.
ShapeOko 2 6095. Double Y-Axis Nema 23s (140oz/in), X & Z Nema 23 (262oz/in), TinyG, 500W DC Brushless Spindle w/ 48VDC 10A Supply, Acme Lead Screw, 24VDC 10A Supply, Threaded Inserts Table, Auto-tool height setter.

aldenhart
Posts: 132
Joined: Tue Apr 10, 2012 2:17 pm

Re: Limit Switch Debugging.

Post by aldenhart » Thu Aug 28, 2014 2:01 am

here are some various steps to try in order:

Try configuring the switches as homing only first. Run homing to make sure it works. Then try enabling them for limit, one at a time, and running a job with a spindle running. Most of the time it's spindle noise getting into the switch lines that cause the switches to fire. Sometimes its the motor lines themselves. Try to reduce the electrical noise from the spindle if you can. What kind of a spindle are you running? Brushless DC spindles are electrically quietest. You might also try moving the switch wiring as far away from the motor wiring as possible. I know there's not much leeway. Try wiring the switches with shielded cable (I don't think Cat5 is shielded) Ground the shield at the TinyG end and leave it floating at the switch end. You can also try running the motor wiring in a shielded cable - grounded at the TinyG end. Sometimes this matters. Worse come to worse disable the switches for limit and just use them for homing.

pastprimitive
Posts: 34
Joined: Wed Aug 13, 2014 4:31 pm
Contact:

Re: Limit Switch Debugging.

Post by pastprimitive » Thu Aug 28, 2014 10:56 pm

Thanks!

Yesterday I spent the day tweaking my setup, and discovered that it was a windows driver issue! I was using an out of date FTDI driver, and while the board looked like it was getting chars, something was going wrong windows side (no surprise there) and that coupled with a loose stepper motor wire on my x axis terminal block... All combined to give me very confusing results. Once I upgraded the driver, and tightened a terminal on my x axis motor everything was hunky dory. Actually didn't need to do any changes to my wiring setup (THANKFULLY).

The Cat 5e that i have is not shielded, but I figured combining it's twisted pairs, with my already shielded stepper motor cabling that was floating connected to the TinyG ground I'd be good. And coincidentally I happily had planned on using a DC brushless spindle on this machine. I have a manual mill that has a DC brushless motor and it's so whisper quiet. So I had to have it for this since my last CNC router was a Colt Bausch Palm Router, and was loud, even inside my 3/4" particle board and sound padded enclosure. I'm glad to know the extra dollars were well worth it for noise reduction as well.

So now I have 6 limit/home switches standing by to stop me from destroying my machine. My last cnc machine had 0 limits and 0 homing switches. I'm glad to be done with that nonsense.

I was curious. I read through the documentation and it says to not double up switches on the Tiny G terminals. I was assuming that was just for NO switches which obviously would not work well doubled up;) But wouldn't NC switches be fine. For example I'd like to run another switch for an auto tool height setter off my Z-min pin on the tiny G that I can move around my work piece on a decently long piece of cable.

Any reason not to do that?

Also since I have my z-min set as a home/limit it could serve as a very nice e-stop button.
ShapeOko 2 6095. Double Y-Axis Nema 23s (140oz/in), X & Z Nema 23 (262oz/in), TinyG, 500W DC Brushless Spindle w/ 48VDC 10A Supply, Acme Lead Screw, 24VDC 10A Supply, Threaded Inserts Table, Auto-tool height setter.

aldenhart
Posts: 132
Joined: Tue Apr 10, 2012 2:17 pm

Re: Limit Switch Debugging.

Post by aldenhart » Fri Aug 29, 2014 1:31 pm

Glad you worked out the issues. The point on not doubling up is that each switch is detected independently and reacted to independently. This helps in homing, but it's also important to know how to recover from the case where the machine is parked on a switch at the start of homing. It needs to know which axis/direction to move to get off that switch.

As for probing, it's most common to use the Zmin switch.

If you need a separate switch for an emergency use Amin or Amax. Also, that's not a proper eStop. An emergency stop is supposed to work even if the controller has gone insane, so eStop must physically disconnect power to the motors. Otherwise there is no guarantee that the stop will actually work. This is standard CNC practice, and TinyG is no exception. You will notice that there is no input called eStop on the board. This is deliberate. Another way to do this is to wire the reset line out to a switch and simply do a board reset. That's still not technically an estop, but it's better than relying a limit switch for this function.

pastprimitive
Posts: 34
Joined: Wed Aug 13, 2014 4:31 pm
Contact:

Re: Limit Switch Debugging.

Post by pastprimitive » Tue Sep 02, 2014 9:37 pm

I'll implement that setup, thanks again.
ShapeOko 2 6095. Double Y-Axis Nema 23s (140oz/in), X & Z Nema 23 (262oz/in), TinyG, 500W DC Brushless Spindle w/ 48VDC 10A Supply, Acme Lead Screw, 24VDC 10A Supply, Threaded Inserts Table, Auto-tool height setter.

Herby53
Posts: 7
Joined: Sat May 03, 2014 8:21 pm

Re: Limit Switch Debugging.

Post by Herby53 » Wed Sep 03, 2014 8:19 pm

aldenhart wrote:Glad you worked out the issues. The point on not doubling up is that each switch is detected independently and reacted to independently. This helps in homing, but it's also important to know how to recover from the case where the machine is parked on a switch at the start of homing. It needs to know which axis/direction to move to get off that switch.

As for probing, it's most common to use the Zmin switch.

If you need a separate switch for an emergency use Amin or Amax. Also, that's not a proper eStop. An emergency stop is supposed to work even if the controller has gone insane, so eStop must physically disconnect power to the motors. Otherwise there is no guarantee that the stop will actually work. This is standard CNC practice, and TinyG is no exception. You will notice that there is no input called eStop on the board. This is deliberate. Another way to do this is to wire the reset line out to a switch and simply do a board reset. That's still not technically an estop, but it's better than relying a limit switch for this function.
I posted some questions in Synthetos Forum three days ago but got no answer.
My setup: Shapeoko 2, TinyG v8, 400W Spindel with speed controler, 2 Power supplies 24V and 48V.

Understand I right, that the e-stop-button must be realized wiring the TinyG reset line?
If eStop is touched there is a continuous reset. Do not damage this the board? Which pins must be soldered - J15?
Is it also possible to interrupt the main power with the eStop button?

Thanks for assistance

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Limit Switch Debugging.

Post by cvoinescu » Wed Sep 03, 2014 8:48 pm

The board should not be harmed by continuous reset.

Usually, an e-stop switch has two sections, one normally closed and one normally open. I would wire the positive pole of the motor power supply through the normally closed contact, and use the normally open contact to short the reset input to GND. This stops the machine both by removing power to the motors, and by killing the controller. If the spindle relay or speed control is also powered from the motor power supply, this should also turn off the spindle, by removing both the control signal, and the power for the relay input. It would not protect against a stuck relay (the spindle would stay on), but that's a little more complicated to protect against (you'd need a second relay).

You could also cut the AC power input to the two supplies, instead of the DC motor supply, thus eliminating the spindle relay as a single point of failure and increasing safety. However, in my opinion, unless you knew exactly how to wire mains voltage safely, having mains voltage near the low-voltage DC signals would actually be less safe.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Post Reply