After some initial tuning we did three test-prints today of a 10x10mm square, 30 layers, raising the z-axis by 0.5mm for each layer. We tried to set it up so that when the X or Y-axis moves 10mm, the extruder A-axis should also move 10 units. The way it is set up right now it might be extruding slightly too much plastic per mm. The maximum feedrate we tried was 600mm/min.
We printed the same geometry three times, here is the second try (in the first try the base/bed wasn't staying very fixed, so the print resembles the leaning tower of Pisa...)
Here is the third try. Now we are moving the Z-axis +0.5 mm during the last Y-axis move. This is at 600mm/min.
We were pretty happy with the print-quality so far, considering this is the first ever test of our extruder/xyz-table setup. Some tuning of how much plastic is extruded for each mm of xyz-feed, and perhaps a heated printing-bed, should improve the quality further. Next is learning to use one of the many STL to G-code CAM programs and filtering the G-code output so it is suitable for our EMC2 setup (the extruder is the A-axis, in absolute mode).
It's probably much easier to figure out the connections from the diagram below than to browse the text files. The square wave, which has a frequency proportional to the temperature, comes in on parallel port pin-13, and is connected to an encoder. The encoder has a velocity output which will be equal to the frequency of the square wave in Hz. This frequency is used as the feedback for a PID-component which compares the measured frequency against a set-point which is taken from a pyvcp slider. The pid output is used as an input to a pwm-generator, whose output needs an inverter, since the pwm-amplifier is active-low. The PWM is output on parallel port pin 9.
I wish there was a tool which would draw these HAL/pyVCP diagrams automagically from the source files. There is some work in that direction already: crapahalic and HAL with gschem.
I've upgraded Ubuntu and EMC2 on the Atom 330 machine I have for controlling the lathe. The Atom 330 is a dual-core chip, but with Hyper Threading the OS can see four cores. That's not good for real-time performance, so the first thing I did was turn off HT from the BIOS. Next I did a distribution upgrade to 10.04LTS which downloaded about 1 Gig in an estimated 9 minutes (2Mb/s is OK I guess...). I then used the emc2-install script which installs the real-time kernel and emc2, and finally I edited /boot/grub/menu.lst by adding "isolcpus=1" on the kernel line. This reserves one cpu core for real-time and the other for non-real-time tasks. Without "isolcpus=1" the latency-test jitter values were easily 10k and more with a light load on the machine. With one core dedicated to real-time the jitter numbers start out at around 4k at light load and double to 7-8k under heavy load.
Here are some selected screenshots:
Next stop is getting the X and Z servos moving, as well as the hefty 2 kW spindle servo.
This minimal example shows how a pyvcp button can be added to AXIS, wired to a toggle component, then to toggle2nist (which I wrote back in 2008), and then to halui pause/resume. This makes the momentary-on pyvcp button pause the program when pressed once, and resume the program when pressed again.
The wikipedia-police have immediately put it on the list of pages to be deleted ("unremarkable", "no third party references", "borderline advert", etc.). So I decided to collect some references. It is best to archive them here also, in case the wikipedia page does get deleted.
Leto et al., "CAD/CAM INTEGRATION FOR NURBS PATH INTERPOLATION ON PC BASED REAL-TIME NUMERICAL CONTROL", 8th INTERNATIONAL CONFERENCE ON ADVANCED MANUFACTURING SYSTEMS AND TECHNOLOGY JUNE 12-13, 2008 UNIVERSITY OF UDINE - ITALY, http://22.214.171.124/amst08/papers/art837759.pdf
Milutinovic et al., "Reconfigurable robotic machining system controlled and programmed in a machine tool manner", The International Journal of Advanced Manufacturing Technology, 2010, http://dx.doi.org/10.1007/s00170-010-2888-8
In 2006 I made optoisolator cards for the cnc-mill project, but now with the lathe I am using servo-drives and a VFD which mostly already have optoisolated inputs, so I will use these very simple breakout boards instead. There are two pitch-standards for the screw-terminals, an imperial one with a pitch of 5.08 mm (i.e. 0.2 inches), and a metric one with 5.0 mm pitch. These boards are for 5.0 mm.
By popular demand, a schematic which roughly shows the electrical connections of our cnc-mill setup. Most of it fits inside one box (also shown here). The m5i20 I/O connectors are on the left, followed by the optoisolator cards. E-stop chain in the middle, servo-amplifiers and motors to the right. Jog wheel at the bottom. The small VFD board I made later is not shown.
The servos are now almost ready to go on the mill. Some dry-running of EMC2, the servo electronics, and the VFD today. I've made this pyVCP panel for AXIS which displays the commanded and actual spindle RPM, the spindle current (in some uncalibrated unit), the PID outputs and following errors for X/Y/Z. The jog-pendant box shows the mode of the jogwheel (X-jog, Y-jog, Z-jog, Off, Feed-override, Spindle-override), and the jog-increment (0.01 mm above). The four pendant buttons are now wired to turn on/off the coolant (blue button), to start the spindle forward or stop it (yellow button), to step through the program (green button), and to pause/resume the program (red button).
A video of the setup. 0:00 Actors, in order of appearance: EMC2, jog-pendant, electronics box, limit-switch box, X/Y/Z servos, VFD, Spindle motor. 0:30 Running a program. Load-meters. Rotating servos. Rotating spindle. Note professional mount and axis-coupler for spindle-encoder. The encoder will eventually be mounted on the other end of the motor. 1:30 Load-monitor demonstration. Running the machine from (300,300,300) to (0,0,0) with a rapid move (6000mm/min or around 2400 RPM on the servo shaft) and watching the bar-graphs show the commanded PWM to the amps.
It's best to store all the working config files here in case of disk crashes or other data loss: