mung wrote:I also am starting to get the feeling that maybe this forum is not the place to be discussing how to compile EMC2.
Probably the project should be divided into :
1)getting the realtime kernel running and rtai compiled for the pi (handled on the pi forum)
2)compiling EMC2 for arm (handled on the EMC2 forum where there are experts that know about the system)
3)working out low level GPIO drivers and interfaces to EMC2 for the pi (handled on pi and EMC2 forums)
1) Realtime control is an interest of mine, so the first task was to compile a patched kernel. Using the latest ipipe patch from the Adeos team (this is the basis for both RTAI and Xenomai), 3.2.21 compiled without errors with the cross-compiler toolchain. A quick pass of the RTAI code shows significant bitrot for the arm architecture - Not insurmountable, but a debatable undertaking considering that Xenomai already works on many arm platforms and the team is very active in supporting the architecture.
2) Looked at the EMC2 code and it is real ugly and convoluted. The "build" system has all the hallmarks of a sick puppy up chucking every time it is let out the door. Forget cross compiling - This means having to compile on the Rpi and having ALL the development packages installed on your SD card or NFS mount. You'll then end up with a shedload of duff & cruft that makes no sense in having around on an embedded system. No point in having drivers for PCI cards when you don't have a PCI bus !
A better starting point may be grbl or parts from the RepRap project. There have also been other derivatives of the (original NIST) EMC code that might prove to be a more viable starting point.
3) The Rpi I/O is severely limited, but with the SPI/I2C bus handling the bulk of any non-critical (speed wise) I/O, there looks like there'd be sufficient pins left for three stepper motors. An alternative may be to use all the available I/O pins to implement a simple bus to communicate with an external FPGA board e.g.:http://papilio.cc/
. What ever route is followed for I/O, the driver need not be complicated (unless you really
want to follow the EMC2 model).
In closing, the Rpi has plenty of power to run as a realtime CNC control, onboard graphics adds to the appeal, as does the low cost. Interfacing is not an insurmountable obstacle, nor is the software - It really boils down to how much effort you are prepared to put in to get a project like this to fly.