Limit switches & auto tool height setter?

Discussion of tinyG control platform
SwissFreek
Posts: 43
Joined: Wed Apr 23, 2014 3:42 am

Re: Limit switches & auto tool height setter?

Post by SwissFreek » Sun Jan 25, 2015 3:07 pm

On my TinyG I have NC switches on X and Y, and Z max. I want a touch plate on Z min. My kludge solution thus far has been to create a macro in Chilipeppr. The macro zeros the machine as normal (X min Y min Z max), then travels to a spot on my waste board, resets Z min as a limit switch, sets the switches to NO, and changes the seek and latch velocities to 100 and 20 respectively (they are normally 1000 and 100 on my machine), then initiates a Z zero call. Once the machine finds zero I send a G10 P1 L2 Z-4.59 call to account for the thickness of the plate and 3mm of backoff, and finally the macro resets the switches and speeds to their original values. My Z touch plate is a piece of copper PCB wired directly to Z min and ground is wired to an alligator clip on the tool. It all works perfectly most of the time. I was meaning to write a post on it but I was having issues with consistency in ChiliPeppr running the macro (it seems to sometimes skip lines it is sending to the machine?), and also wanted to mill out a spot on my board to embed the touch plate and make it permanently fixed.

I'm sure there is a better way to do it. I've been reading up on the G30 command, for example, as well as considering resoldering all my limit switches to be NO and save some lines on the macro. But that's what I've got going so far.

khauser24
Posts: 30
Joined: Mon Dec 01, 2014 12:41 am

Re: Limit switches & auto tool height setter?

Post by khauser24 » Mon Jan 26, 2015 1:27 am

Any low power general purpose transistor will do. If you need to I can probably create a circuit. I have very little expertise, but I think this one is pretty solvable.

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

Re: Limit switches & auto tool height setter?

Post by cvoinescu » Mon Jan 26, 2015 10:40 am

Or you could just wire the switches NC to VDD instead of GND, and add pull-down resistors (between the inputs and GND). The only problem is that the TinyG already has built-in pull-up resistors, so you'll need your pull-downs to be at most 20% of that value.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

sdumond
Posts: 58
Joined: Sun Feb 01, 2015 1:12 am

Re: Limit switches & auto tool height setter?

Post by sdumond » Sun Mar 01, 2015 2:21 pm

I am adding normally closed limit switches to SH2 and have tinyg. Do I wire one wire to the min/max and the other to ground? The dang setup just assumes you know.

















so

SwissFreek
Posts: 43
Joined: Wed Apr 23, 2014 3:42 am

Re: Limit switches & auto tool height setter?

Post by SwissFreek » Sun Mar 01, 2015 4:49 pm

sdumond wrote:I am adding normally closed limit switches to SH2 and have tinyg. Do I wire one wire to the min/max and the other to ground? The dang setup just assumes you know.

so
That is correct. Each switch will have one wire in the respective X/Y/Z Min/Max depending on which switch it is, and all of them will have the second wire going to ground. Most likely you'll have to combine the wires prior to the board since you can really only put a wire or two in the screw terminals. There are several ground ports, though, and any of them will work.

Carl Fisher
Posts: 127
Joined: Fri Mar 07, 2014 1:36 pm

Re: Limit switches & auto tool height setter?

Post by Carl Fisher » Mon Mar 02, 2015 12:57 am

Jim wrote:
khauser24 wrote:If it helps you can use a simple transistor to make a NC out of a NO. Here's a sample circuit: http://www.instructables.com/id/Make-a- ... ds-sort-o/
That's very interesting. But, not being an electronics engineer, I wouldn't know what kind, size, etc. of transistor to use.

Thanks anyway and I will keep this filed away if some revelation comes about.

I haven't actually wired this up yet, but supposedly this will work. Any cheap transistor should do the trick. This one calls out an 2N2222.

Image

sraney
Posts: 43
Joined: Thu Mar 13, 2014 9:57 pm

Re: Limit switches & auto tool height setter?

Post by sraney » Mon Jul 27, 2015 6:37 pm

Did this work for you? I'm about to do the same. I'm just worried about the speed of the 2N2222 reacting fast enough to tell my TinyG to stop dropping the Z axis; it should be good, but I'm just paranoid. I could just wired it up and put my touch plate on a block of foam and see if it works.

Jim wrote: I haven't actually wired this up yet, but supposedly this will work. Any cheap transistor should do the trick. This one calls out an 2N2222.

Image
-- sraney
---------------------------------------
  • break nothing but silence
  • take nothing but pictures
  • leave nothing but footprints

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

Re: Limit switches & auto tool height setter?

Post by cvoinescu » Mon Jul 27, 2015 7:50 pm

The 2N2222 is hundreds of thousands of times faster than it needs to be for that application.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

cmcgrath5035
Posts: 61
Joined: Thu Oct 31, 2013 6:56 pm
Location: Florida, USA

Re: Limit switches & auto tool height setter?

Post by cmcgrath5035 » Mon Jul 27, 2015 8:12 pm

Review this https://github.com/synthetos/TinyG/wiki ... witch-type

I have not tried it(I don't probe) but understand that this resolves the NC / NO conundrum when probing executes.

So no inverter circuit required with up to date tinyG FW (440.16 currently)

I would try it with just the clip lead and the probe block to be sure.
ShapeOko (V1) SN 1462
Dual 820mm Y, Double X, ACMEZ. V2 Motor Plates
TinyG V7 Controller; DUE and tinyGV9 test bed for tinyG2

sraney
Posts: 43
Joined: Thu Mar 13, 2014 9:57 pm

Re: Limit switches & auto tool height setter?

Post by sraney » Mon Aug 10, 2015 9:00 pm

This gCode command "38.2 Z" works great after upgrading the TinyG firmware. Doing the TinyG's firmware upgrade was a whole new bag of worms under Windows 8.1

I did run into a problem while issuing the G38.2 command from the default Z Home position, its about 2+ inches over the worksurface. I believe I might be tripping a 30 second timeout as the spindle drops down the searching for the touch plate. I have only issued this command at a very slow 0.05mm, so it should take about 70+ seconds to reach the touch plate. I've tested it 40+ times and It always stops at 30 seconds If I manually drop the Z to about 10mm over the touch plate and issue the gCode command it works perfectly.

I wonder if this is the same command used in ChiliPepper's touch plate option. I think there is a way to monitor ChiliPepper's serial line.

I also did not test the other axis touch probes, not even sure the the TinyG supports the the same command on the X, Y, or A axis's. I'm not eve sure what you might use these for.

Thanks again!

BTW: I used this site to understand the G38.2 command a bit more http://www.edingcnc.com/wiki/index.php? ... -g382-g421
cmcgrath5035 wrote:Review this https://github.com/synthetos/TinyG/wiki ... witch-type

I have not tried it(I don't probe) but understand that this resolves the NC / NO conundrum when probing executes.

So no inverter circuit required with up to date tinyG FW (440.16 currently)

I would try it with just the clip lead and the probe block to be sure.
-- sraney
---------------------------------------
  • break nothing but silence
  • take nothing but pictures
  • leave nothing but footprints

Post Reply