2014年1月25日土曜日

[RepRap PCB milling] How to compile "pcb2gcode" in Mac OS X Mavericks

My current project is creating the RepRap style PCB milling Machine.

One of my undergraduate student agreed to join this as his final project for the credit of graduation.

He designed the machine part.  Because his good skill on the engineering, it worked fine.  My part is for an electricity and the toolchain as softwares.

For designing the circuit board, I designed my own deliberative  one from Generation 7 v1.4.1, and Printrboard from the reason of availability of some parts in Japan.

This board is currently only a prototype, but when the PCB milling machine will worked, I will design more compact, and stable board that can build with it.

The toolchain is basically following the description of RepRap Wiki page.  But on my Mac, the recommented driver "CNCGcodeController" did not work.  It is a Java application, but I think the reason of the failior would be the serial communication class includes OS native code inside.  If so, the code should be re-written to be portable such as using RXTX serial communication class.

Then I installed "Printrun" on my Mac by following the instruction from source for Mac OS X in the README file.  It worked very fine with my choice of firmware "Teacup".

But due to Teacup firmware only accepts G-Code, and my targeting PCB Layout software "KiCad" does not support exporting G-Code directly for now, I needed to convert exported "Gerber" data into G-Code file.

There are several toolpaths is introduced in the Wiki page, but everything in the page but "pcb2gcode" didn't work or fit for my intention of using KiCad (Jan 10 2014 version) as a PCB design tool on my Mac.

I got the source code of pcb2gcode both from sourceforge and GitHub, but the development of this software looks not a hot recently.  The newest download on the sourceforge is dated 2012-07-02, and the head on the GitHub looks the same.

I had a trial of building with this code, but the code conflicts between recent Xcode 5.x toolchain and the boost.  In order to solve this, by looking at the discussions on StackOverflow, I made the replacing using shared_ptr feature from boost to std class, and port a template definition of dynamic_pointer_cast from boost (it is included in "shared_ptr.hpp").

The put my patch on my GitHub repository: https://github.com/tkamada/pcb2gcode

If there were a fail or something that I misunderstand, please post your issue message to my repository.