This is a build of a CNC control box using a mini-itx VIA Epia EK 10000G mainboard and a kit from Probotix. Many times there are CNC boxes sold containing only the motor drivers and their power supplies, yet with no computer to handle the operation of the machine. This project was a testing ground to implement a truly complete solution in one box. These are my trials and tribulations.
control box
The box came out pretty good, yet it's stuffed to the max. I could improve air flow through the unit. It doesn't get that hot after a half hour milling task. All the fuses for the motor driver boards are located on the front of the unit for easy access, and I also wired in some panel mount LEDs to show everything is powered.
I wired one main power switch on the right, a momentary push button switch for the mainboard on the left, and an emergency stop switch for the motor control.
The 24 volt DC power supply that came with the Probotix kit allowed me to directly wire the DC-DC power converter of the mainboard. I used the PicoPSU 60W wide input range DC-DC power converter for the mainboard. The mainboard maxes at about 22 watts.
I went for a slim SATA hard drive because I didn't want a huge obnoxious IDE cable in the box, plus most of the hard drives I own now are SATA anyway. I could probably neaten and route all the cables in the box better.
Overall the unit is pretty slim. I did have to alter the mainboard slightly. I had to slim the height of the audio port which jutted out of the box. That didn't matter much because I could care less about having audio from the box.
machine side software
I had no problems setting up the bios for the mainboard, just had to check that the parallel port was configured correctly. The VGA display setting in the bios for VIA Epia EK 10000G mainboard does not offer a wide selection of resolutions. Unfortunately, the monitor I have paired with this mainboard does not particularly like this.
I installed Ubuntu and EMC2 onto the mainboard from a boot disc I had created. No problems. Next I ran a latency test for the mainboard and found it to be around 35,000 nano-seconds under heavy processing.
| Motherboard: | VIA EPIA-EK10000G |
| CPU: | 1 GHz Via Luke |
| OS: | Ubuntu 10.04 (Lucid Lynx) |
| Max Interval (1.0 ms servo thread): | 1028656 ns |
| Max Jitter (1.0 ms servo thread): | 35096 ns |
| Max Interval (25.0 us base thread): | 57195 ns |
| Max Jitter (25.0 us base thread): | 32356 ns |
See this extensive list for a comparision of other setups.
Setting up EMC2 with the configuration wizard was easy enough, although I did have to invert a couple of pins on the parallel port. I set up the steppers to run at eighth step. The wizard is extremely annoying when you want to edit a couple variables because it overwrites your entire .ini config file.
Right now I am using the AXIS interface for my mill tasks. I also setup the EMC2 .ini config file for image-to-gcode, which translates .png or .gif files to G-code. The AXIS user interface is fair and could be drastically improved. I would really love larger control buttons, the ability to change the layout colors and fonts, as well as a resizable display for the g-code. It would also be nice to edit the g-code right in the display and save it, instead of opening gedit, making changes, then re-loading the file in AXIS. Re-homing is annoying due to the nagging pop-up window. The message display is crufty and should be better integrated. Compared to the other interfaces that come with EMC2, it is the easiest to use and free.
I had some display issues with the AXIS 3d display. This was due to the crappy onboard video of the S3 Unichrome Pro VGA Adapter. From the EMC2 troubleshooting doc, it says to either try out a VESA driver, or install a software based OpenGL rendering package. I first tried the VESA driver route and found that it does not play well with my widescreen monitor (1440 x 900). I then installed the suggested OpenGL package, which fixed my issue.
I had to setup AFP (Apple Filing Protocol) using Netatalk on the Ubuntu CNC box to be able to mount the networked drive in OS X. This allows me to drag and drop files onto the Ubuntu CNC box's drive, ready for machining. These instructions are helpful in accomplishing this task, if you are not sure what you are doing.
I set up Ubuntu to launch EMC2 on startup. I also installed devilspie so the Axis window would launch fullscreen.
I have tried running EMC2 over ssh using X11 on a Mac. It does work but the delay in controlling the machine is much too painful. Maybe the encryption taking place over the ssh connection is causing the delay. Just some food for thought.
The terminal command I used for this is:
- yourdesignbox:~user$ ssh -X ipaddressofyourcncbox emc /home/youruser/emc2/configs/yourmill/yourmill.ini
design side software
Currently, most of my CAD work is being done in the pre-release of Rhino for OS X. As with any software still in development, it has its issues. Yet, it is very easy to use, native to the Mac, and can import and export a variety of file formats. Rhino on a Mac will only will work with 10.5 and up.
The only application that I have found that will export G-code on OS X is CAM Expert. This is the sole reason I use it. CAM Expert is a little rigid and takes some getting used to, but it does the job, albeit roughly. The layering system and tool palette could be improved a whole lot. CAM Expert is for PowerPC, and will not run on an Intel based Mac unless run through Rosetta. Oh yeah, 2-d work only.
I can now sit down at my OS X machine and design away, then dump the NC files across the network onto the dedicated Ubuntu CNC box.
I also did a little a bit of futzing with the CAM Expert package. If you hop inside the contents of the package (right click on the application, Show Package Contents) and look in Contents/Resources/machines, you can edit the defaults of the screen below. I editted the file gcode.cxm. Inside this file you will find some code that will alter the g-code output of the application. Altering this file makes it a bit easier when you find exactly how you wish to work. Read up on the configuration documentation before you make any drastic changes. Backup the original.
workflow
- OS X: Rhino: Design part.
- OS X: Rhino: Design toolpath.
- OS X: Rhino: Export DXF of toolpath.
- OS X: CamExpert: Open DXF of toolpath.
- OS X: CamExpert: Check to make sure the order of entities to be machined is correct. Manually re-order entities if necessary.
- OS X: CamExpert: Export g-code NC file and set up the correct parameters for the g-code file, save.
- OS X: Move NC file across network to Ubuntu CNC box.
- Ubuntu: EMC2 with AXIS: Open NC file.
- Ubuntu: Turn on CNC machine and spindle.
- Ubuntu: Run G-code sequence.
- Pray.
other workflow possibilty
There is the extremely obnoxious and painful route of using Blender with a G-Code generating python script. Bleecch. This would mean exporting a DXF file from a CAD application, importing via Blender, running the python script, then lastly, saving the NC file. I just can not stand to use Blender due to its horribly confusing user interface, non-native feel, and overall bloat.
I think there may be a plug-in for Google Sketchup to export g-code but I have not looked into this.
improvements
- PROBLEM: The back panel of the box is sloppy.
- SOLUTION: I should find a panel template for the mini-itx board I am using and create a G-code file for it.
- PROBLEM: An ugly parallel port cable connecting the mini-itx mainboard to the driver board just hangs out of the box.
- SOLUTION: There could be a better implementaion without the bulk of the cable. The Jonestown board has a parallel pinout, instead of a port on the backplane.
- PROBLEM: I have to turn on the power to the entire box, then boot the computer. This was done as a safety precaution.
- SOLUTION: Implement a single ON switch.
- PROBLEM: Takes too long to boot.
- SOLUTION: Slim down the Linux boot process, or move to a solid state drive.
- PROBLEM: VIA Epia EK 10000G mainboard VGA settings are limited. No DVI or HDMI output.
- SOLUTION: Use a mainboard with DVI or HDMI output, most likely will upgrade later.
- PROBLEM: The on-board graphics of this mainboard just plain suck, especially when running the plotting window in AXIS.
- SOLUTION: Install alternative OpenGL software rendering package. This may also resolve itself on a mainboard upgrade with a better graphics chipset.
future
All I want is a simple Cocoa application in which I can build and output an NC file. I may have to fire up Xcode, and start this process.
Machine control via USB would be nice. For the Mac there are a couple of options, Arduino, Basic Stamp, etc. Yet I would need to write specific communication protocols. The funny thing is I wired up my steppers with DIN cables. DIN cables are generally used for MIDI devices, which made me think I could possibly implement a solution using MIDI via USB. Also, I think MIDI Show Control might be a real time system. Hmmm. I would have to write some custom software, but I would rather do that than mess with microcontrollers. I have wanted to dive into Core Audio anyway, and playing my CNC machine like a instrument is much more fun and interesting.
These MIDI decoders from Highly Liquid look promising. The MD24 outputs 24 logic level signals, so it is essentially a parallel port. A USB MIDISPORT 1x1, connected to the MD24, outputting to 4 motor driver boards and a single relay board, and voila, 4 axis control with spindle on/off.
I no longer wish to rely on a mini-itx board, Linux, the parallel port, and EMC2. Taking this MIDI route allows me the freedom of solely using my Mac and creating some custom software. MIDI also allows me the freedom of using a plethora of hardware controllers, or building my own.
Since I am going to use MIDI as my communications protocol, the VVMIDI framework has been indispensible, opening up a whole new world for me. I wish I knew I of this sooner.
MIDILog is awesome as it allows you to see what is going on under the hood with your MIDI signals.
snoize also has some handy utilites.
I will most likely need to off load the generation of step signals to a motor driver capable of producing its own step signals. I would rather do this in hardware anyway, since it is a one time setup, and frees up the processor for other tasks. I do not care to write a step pulse train in software. This BSD-013G driver/controller board seems capable of doing that work. Yet it can only handle 1.5 Amps. Strangely, I can't seem to find many motor drivers with integrated stepping signal generators. The ones I do find are expensive and designed for industry.
I implemented this project here.