Page 1 of 2

PCB depth sensing software for Grbl

Posted: Sun Aug 26, 2012 5:05 pm
by kosme
I am currently developing a fork of Grbl and its correspondig software for the PC that will allow to sense the surface of the clad board for uneveness and adjust the gcode acording to it. It is currently in alpha version but I hope to release a first version next week.

Kosme

Re: PCB depth sensing software for Grbl

Posted: Sun Aug 26, 2012 5:54 pm
by cvoinescu
Cool! Definitely something I would try if I had a ShapeOko. Unfortunately, I'm in batch #3.

Re: PCB depth sensing software for Grbl

Posted: Mon Aug 27, 2012 4:50 pm
by kosme
I don't really see being on batch 3 as such a big deal. Lots of stuff are getting improved and developed by people from previous batches that will make the life easier for people on future batches.

Kosme

Re: PCB depth sensing software for Grbl

Posted: Mon Aug 27, 2012 5:14 pm
by edwardrford
Hi Kosme! Welcome back.

I think cvoinescu was just eluding to they fact that batch #3 has not shipped yet, so the feature is something they can't use for themselves right now.

Regarding your software: I'm wondering how much of a stretch it will be to fork this into an 'auto sensing Z depth finder?'. I've been wanting something like that for the last few weeks in an attempt to get more predictable (and easier) re-zeroing of the z-axis after a tool change. Just a thought!

-Edward

Re: PCB depth sensing software for Grbl

Posted: Mon Aug 27, 2012 7:57 pm
by cvoinescu
I was indeed complaining, bitterly, about not having a ShapeOko to play with -- yet. And even after I get it, I won't be able to play, because I will be away from home until the 9th. Oh well.

Re: PCB depth sensing software for Grbl

Posted: Tue Aug 28, 2012 7:37 pm
by kosme
Edward, indeed this could be used for leveling the head after tool change, but right now I have to solve something that just appeared. The software and the firmware mod work fine together BUT the motors generate lots of electrical noise and that messes the sensing. Have to figure out how to filter the noise. Any suggestions anyone?

Kosme

Re: PCB depth sensing software for Grbl

Posted: Tue Aug 28, 2012 8:31 pm
by cvoinescu
How does your detector work? Are you simply detecting contact between the tool and the copper cladding of the PCB? If that's the case, a low enough pull-up resistor should eliminate most of the noise. There's no harm in sinking, say, 20 mA when the tool is in contact, so you could use a 220 ohm pull-up resistor to 5 V. Ideally, the input would be a Schmitt trigger. I'm not sure whether the pins of the microcontroller can be configured as Schmitt trigger inputs. If not, something like a 74HC14 should help tremendously. A small capacitor (100 pF) between the input and ground can't hurt. A resistor (say 100 ohm) in series with the input protects the pin somewhat, and, together with the capacitor, forms a low-pass filter that reduces noise even further.

Re: PCB depth sensing software for Grbl

Posted: Tue Aug 28, 2012 8:43 pm
by kosme
Thanks for the sugestion Cvoinesu, I will give it a try. Indeed the detector functions like you described. The analog 0 pin of the microcontroller is pulled up by the internal pull-up resistors and detects when the tool touches the copper cladding that is connected to GND. I implemented a "debounce routine" on the firmware and eliminated the noise that way.

Kosme

Re: PCB depth sensing software for Grbl

Posted: Tue Aug 28, 2012 9:53 pm
by cvoinescu
If it's an analog pin, you don't need the Schmitt trigger, just the three passive components. Assuming 10-bit conversion with VDD as reference, you can begin to register "touch" if the value drops below 512-H/2, and keep registering "touch" until the value raises above 512+H/2, where H is a suitable hysteresis value (H=768 should work). That's a software Schmitt trigger. I think you care only about the transition from "no touch" to "touch", so you don't even need a full debouncing routine: first time the analog reading drops under 128, that's when the tool touched.

Re: PCB depth sensing software for Grbl

Posted: Fri Nov 16, 2012 10:06 am
by PsyKo
Hi,

Any news on that topic ? I might be interested as well.

Thanks