GCODE Step and Alignment Tool

wlanfox
Posts: 74
Joined: Sat Oct 20, 2012 10:49 am

GCODE Step and Alignment Tool

Post by wlanfox » Thu Feb 21, 2013 1:53 am

Hi,

I have been working on betters ways and techniques to align the spindle when going from file to file, specially for PCBs where accuracy is very important (the reason for this thread http://www.shapeoko.com/forum/viewtopic.php?f=28&t=1097). It occurred to me what I needed is a debugger like tool to allow me to control and adjust ShapeOko while running the program (GCODE) and even modify the GCODE itself; the same way I do for embedded programs and firmware. This tool also provides a platform to play whit visual alignment and OpenCV.

With nothing that I could find, I decided to create such a tool. For the past Month and 3 weeks I have been working on it. I think is ready for general use. Hope it will help others with their CNC alignment.

Note: OpenCV is not required unless you want to play with computer vision.

Note2: you only need gcs.py the rest is just the images sources, but they are embedded with in the python scrip. So you only need the one file "gcs.py" and of course dependencies like python and wx.Python.

Use case: The GCODE file is a drill program for a PCB, gcs will make it possible to set-up a break point right before the tool plunge. At this point with the jogging controls it is possible to lower the tool right before penetrating the surface to verify alignment is adequate. Once this is verify and or adjusted, the program can continue.

GCODE Step and Alignment Tool:

https://github.com/duembeg/gcs/tree/v1.0.0

Image
Last edited by wlanfox on Mon Feb 25, 2013 6:39 am, edited 1 time in total.

calica
Posts: 107
Joined: Wed Apr 11, 2012 8:13 am

Re: GCODE Step and Alignment Tool

Post by calica » Thu Feb 21, 2013 10:14 am

Just looking at the screenshot, is this a gcode sender for grbl? Can it work with other controllers? Does it just alter the xy and maybe z of later lines of gcode?

wlanfox
Posts: 74
Joined: Sat Oct 20, 2012 10:49 am

Re: GCODE Step and Alignment Tool

Post by wlanfox » Thu Feb 21, 2013 6:53 pm

calica wrote:Just looking at the screenshot, is this a gcode sender for grbl? Can it work with other controllers? Does it just alter the xy and maybe z of later lines of gcode?
Hi,

It basically opens the serial port and streams the Gcode, it is target at Grbl since I do check for some sort of response like "ok" Also for the "Grbl 0.8c" when opening the port to know controller is ready. You could remove these checks and just stream the Gcode.

I guess it could be a upgrade to abstract the interface so other can be added.

jsbannis
Posts: 80
Joined: Tue Apr 10, 2012 11:09 pm
Location: Chicago, IL

Re: GCODE Step and Alignment Tool

Post by jsbannis » Fri Feb 22, 2013 12:59 am

Well, looks like someone finally beat me to this. I've been contemplating a "gcode IDE" for a while now, but was having a hard time getting started. I guess I'll have to find some other way to add to the community. Too many software developers on this board :)
shapeoko #0057

wlanfox
Posts: 74
Joined: Sat Oct 20, 2012 10:49 am

Re: GCODE Step and Alignment Tool

Post by wlanfox » Fri Feb 22, 2013 1:02 am

Folks,

I added some tips on the GitHub wiki...

https://github.com/duembeg/gcs/wiki/Tips-and-Techniques

WillAdams
Posts: 8489
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: GCODE Step and Alignment Tool

Post by WillAdams » Fri Feb 22, 2013 1:33 am

jsbannis wrote:Well, looks like someone finally beat me to this. I've been contemplating a "gcode IDE" for a while now, but was having a hard time getting started.
What I'd really like to see would be a front-end which would allow:

- drawing and editing w/ a mouse/stylus
- instantiating the drawn paths as a G-Code program off to the side --- editing that would then update the drawing view
- for bonus points allow metapost or asymptote code as a starting point

William
Shapeoko 3XL #0006 w/Makita RT0701 Router w/0.125″ and ¼″ Elaire precision collets
Nomad 883 Pro #596 (bamboo)

Will Winder
Posts: 435
Joined: Fri Apr 20, 2012 2:40 pm
Location: Hudson, MA
Contact:

Re: GCODE Step and Alignment Tool

Post by Will Winder » Fri Feb 22, 2013 2:09 pm

WillAdams wrote:
jsbannis wrote:Well, looks like someone finally beat me to this. I've been contemplating a "gcode IDE" for a while now, but was having a hard time getting started.
What I'd really like to see would be a front-end which would allow:

- drawing and editing w/ a mouse/stylus
- instantiating the drawn paths as a G-Code program off to the side --- editing that would then update the drawing view
- for bonus points allow metapost or asymptote code as a starting point

William
I'm working on a fairly simple G-Code viewer, although I have no plans to make it interactive it would be a fairly simple extension to map a line of g-code to a line in the 3D model. The way I have it coded I think a thin CLI frontend could be made which could be controlled from a Python program.
ShapeOko #367: Dual-Y drive, Belt on outside, 1000mm Y-Axis, DW660 Spindle, Nema-23 X/Y motors.

Primary developer on Universal Gcode Sender.

wlanfox
Posts: 74
Joined: Sat Oct 20, 2012 10:49 am

Re: GCODE Step and Alignment Tool

Post by wlanfox » Fri Feb 22, 2013 9:41 pm

Will Winder wrote: I'm working on a fairly simple G-Code viewer, although I have no plans to make it interactive it would be a fairly simple extension to map a line of g-code to a line in the 3D model. The way I have it coded I think a thin CLI frontend could be made which could be controlled from a Python program.
That will be awesome and it will make for a great simulator, instead of opening a serial port I could stream to this program :), or maybe even stream to both the this program and serial interface. Very cool I am very interested to see where you go with this.

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

Re: GCODE Step and Alignment Tool

Post by cvoinescu » Sun Feb 24, 2013 7:31 pm

The G-code IDE is an excellent idea! It would be even more useful if it could feed the code into a simulator or visualizer, but as it is it's exactly what I've been looking for. Thank you!

I've downloaded it and I'm working my way through the dependencies.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

xpix
Posts: 218
Joined: Thu Sep 06, 2012 6:47 am

Re: GCODE Step and Alignment Tool

Post by xpix » Mon Feb 25, 2013 8:29 am

cvoinescu wrote:... It would be even more useful if it could feed the code into a simulator or visualizer, ....

Maybe this helps. I found this GRBL Streamer, he has a visualizer in python/opengl. I guess (im a perl developer) the class "class drawgcode(MyCanvasBase)" visualize the gcode. Maybe we can recycle this?

Image
Last edited by xpix on Mon Feb 25, 2013 11:16 am, edited 1 time in total.

Post Reply