Page 1 of 4

PCB Auto-Leveller for ShapeOko / TinyG

Posted: Fri Jul 11, 2014 3:55 pm
by jlauer
I wanted to announce a new PCB Auto-Leveller available inside the ChiliPeppr Hardware Fiddle. You need a TinyG with the latest firmware because it has a new probing command available in it that was worked up for the Othermill guys who embed TinyG in their machine. For those of you on Shapeoko, which I think is a great platform for PCBs, you can now have the same great capability of auto-levelling your PCB.

Visit http://chilipeppr.com/tinyg to use the Auto-Level feature.

Here's how it works.

Load your Gcode for your PCB by dragging/dropping your file into the browser. I typically use Eagle and PCB-Gcode to generate the Gcode for the PCB.

Image

Then click "Auto-Level" in the upper left corner in the workspace toolbar. You'll get a new Auto-Level widget showing. You will also see that your Gcode is surrounded by a Probe Area Matrix. This shows where the probe locations are and how many. If you want to increase/decrease the probe spots for better resolution of your PCB warpage, adjust the "Steps Every" value.

Image

Then run your probe job. As the probes occur, the matrix is updated with the warpage. You can exaggerate the warpage by choosing 10x, 50x, 100x in the pulldown menu to better visualize the data. This screenshot is at 100x exaggerated.

Image

Then send your newly modified Gcode to your workspace and run your job.

Image

New Z data is added to every G0/G1 line. For lines that have Z's those are modified. Comments are placed into the Gcode so you can see where the commands were added or modified.

Image

Enjoy.

Re: PCB Auto-Leveller for ShapeOko / TinyG

Posted: Sun Jul 13, 2014 8:25 pm
by Xaracen
This looks very interesting! I am running my shapeoko with grbl 0.9f which has a probe function. I can run the json server and connect to grbl, and can also load up my F-Engrave gcode file into the chilpeppr browser page.
I haven't tried anything else yet, though I can select the Autoleveller function. I am wondering how much of this could be made to work with my grbl/shapeoko. That will come down to how close TinyG and grbl are in their implementations of Gcode functions.

I think I might be playing with this for a while.

Re: PCB Auto-Leveller for ShapeOko / TinyG

Posted: Sun Jul 13, 2014 8:28 pm
by jlauer
Xaracen wrote:This looks very interesting! I am running my shapeoko with grbl 0.9f which has a probe function. I can run the json server and connect to grbl, and can also load up my F-Engrave gcode file into the chilpeppr browser page.
I haven't tried anything else yet, though I can select the Autoleveller function. I am wondering how much of this could be made to work with my grbl/shapeoko. That will come down to how close TinyG and grbl are in their implementations of Gcode functions.

I think I might be playing with this for a while.
This can absolutely be used with Grbl. Can you try something? Can you fork the TinyG widget and tweak all the TinyG specific parsing to match Grbl parsing and then fork the TinyG Workspace and create a workspace called chilipeppr.com/grbl and then we all have ourselves a Grbl version of ChiliPeppr?

Re: PCB Auto-Leveller for ShapeOko / TinyG

Posted: Sun Jul 13, 2014 8:32 pm
by jlauer
Also, here's a Youtube video of the full walk through.


Re: PCB Auto-Leveller for ShapeOko / TinyG

Posted: Mon Jul 14, 2014 8:07 am
by Xaracen
I have a fair bit of reading to do before I try that in earnest, but I am more than happy to look around the site and get myself up to speed with it.

Re: PCB Auto-Leveller for ShapeOko / TinyG

Posted: Mon Jul 14, 2014 8:22 am
by mauri
Hello

it's just great!

is there a possibility to take the Code "offline", i mean let it run without a internet connection.
perhaps with with a local webserver?

Mauri

Re: PCB Auto-Leveller for ShapeOko / TinyG

Posted: Mon Jul 14, 2014 3:23 pm
by jlauer
Check out some strategies described at https://github.com/synthetos/TinyG/wiki ... chilipeppr

Re: PCB Auto-Leveller for ShapeOko / TinyG

Posted: Wed Jul 16, 2014 4:45 pm
by Xaracen
I've started annotating the javascript file in the newly forked TinyG widget, noting which bits need adapting, and any impact on other aspects like the contents/layout of the widget display, etc. Lots of good info in the existing annotation. And I've had a good look round various other files too, trying to build up a good idea of how everything hangs together. This also involved wandering around in Github/grbl, and elsewhere, as much to get an idea of not just what grbl and TinyG do in nit-picking detail, as to why they do what they in the way that they do. Several bits will need visited several times until it sinks in properly.

For example, grbl's planner is self contained and doesn't provide any reports on its progress, taking fresh commands from the serial input buffer as it clears enough room in the planner's own buffer, so it doesn't need any external (to grbl) management like flow-controlling input from the host computer based on monitoring queue sizes. As long as the sender doesn't continue to send commands to grbl's serial input buffer without having received an "ok" from grbl to the last command or block sent, it won't get into any difficulties.

As another example, grbl doesn't automatically send out status reports on a timed basis. If you want regular updates on status, you have to ask it regularly. This also means that generally, a grbl widget doesn't need to send out startup commands every time it first connects, as it does for Tinyg, though perhaps a user-configurable setup to do this could be useful. Grbl already supports startup blocks defined and stored in grbl which are preserved between reboots/resets.

So many of the fields of the TinyG widget screen are irrelevant because grbl simply doesn't provide the relevant data, and would need to be amended to reflect what grbl actually does provide. In fact the XYZA display would already show much of what the grbl widget would show once the grbl personalisation is done.

PS, Just because I am having a look shouldn't put anyone else off having a go themselves, I may be some time! I have a lot to catch up on.

Re: PCB Auto-Leveller for ShapeOko / TinyG

Posted: Wed Jul 16, 2014 5:10 pm
by jlauer
I agree with your take. Watching for the "ok" response from Grbl would be the right technique. So, that planner buffer progress bar would really be a count of lines sent over to Grbl and then OK responses received back. If there are too many commands queued up, the Grbl widget would fire off a "plannerpause" signal via the chilipeppr.publish() method just like the TinyG widget fires off the signal when it sees that the planner buffer is at 12 (or 10) or below.

The UI elements of the TinyG widget should get modified to show whatever data Grbl shows, or for starters, just get rid of all of those UI elements and leave it really simple. They're not important for functioning, they're just nice to have.

I really think only the TinyG widget needs modified. All other widgets are pretty generic.

Re: PCB Auto-Leveller for ShapeOko / TinyG

Posted: Wed Jul 16, 2014 5:58 pm
by jarretl
Hey jlauer & xaracen, I have some questions for both of you re: grbl on chilipeppr.
I didn't want to hijack this pcb thread, so I started a new thread under GRBL: http://www.shapeoko.com/forum/viewtopic.php?f=3&t=3826
-J.