Sunday, June 11, 2017

LinuxCNC installation lessons learned

I'm posting this on the chance that somebody has similar troubles that I had this week getting LinuxCNC running again on a computer I had working before the hard drive crashed.  Hopefully someone with the same problem will find this page on Google.

It worked best for me to use the LinuxCNC 2.7 bootable DVD image and install in Failsafe mode.  Unfortunately, the defaults for "Guided partitioning" recommended for most users did not setup any partition to be "bootable".  I wasted more time than I like to remember figuring that out.  That's a problem if this is the only operating system the computer is using.  I wonder if this is some kind of inferiority complex that leads the authors of this Linux installation DVD to assume everyone who wants to use Linux still wants Windows on their computer, too.
I had to select Manual Partition instead.  I used Ext4 for Linux partition, making sure the partition was set to be "bootable". I also chose to format the partition and set mount point root "/".

The updates wouldn't install so instead I ran ...$sudo apt-get update

I have this CH352 PCI Parallel Port card:

I installed the parallel port driver from the CD that came with the card.  I created a file called parport_pc.conf in /etc/modprobe.d with one line:
install parport_pc /bin/true

When I ran ...$lspci -v
this was in the output:

00:09.0 Serial controller: Device 4348:5053 (rev 10) (prog-if 02 [16550])
 Subsystem: Device 4348:5053
 Flags: medium devsel, IRQ 17
 I/O ports at c880 [size=8]
 I/O ports at c800 [size=8]
 Kernel driver in use: serial

Even though it says serial, it's parallel.  Go figure.

To test the parallel port, I downloaded ptest.  Instructions for using it are found in the same link.
I replaced the address in ptest.hal with the second address above (0xc800) . I made sure the parallel inputs function.

Finally, I ran the stepconf Stepper configuration wizard.  I remembered some settings and had to rediscover others.  The way mine is set up, to home an axis to zero from positive positions (X & Y) I needed a negative homing velocity and then find the unlatch position in the opposite direction.  I have Z axis homing to zero from negative positions, so the homing velocity is positive.  My max velocities (0.3 inches per second) and accelerations (2 inch/s/s) are much slower than the defaults.

I am hopeful that someone finds these discoveries helpful, because it took me a week to figure this stuff out in my spare time, and I would love to save someone else some of that frustration.

CNC router: Upgrading the Z-axis - Alignment

I have noticed recently when planing a surface with a cylindrical cutter, there is a step of about .020 inch per inch in the Y direction.  My Z axis is not quite perpendicular to the Y.  I already want to redesign and rebuild the z axis because it is not stiff enough to resist cutting forces in the Y direction to my satisfaction.  As I design a new base for the Z axis, I need to get the mounting holes in the right place to correctly orient Z to Y.  My solution is a test plate with the following pattern:
The program puts center points for the two mounting holes along with a set of horizontal lines.
The G-Code is so simple, I just wrote it in a text editor.
I used the program to cut a piece of hardboard:
Then my computer crashed...
A week and a $10 hard drive later (Thanks, Habitat for Humanity Restore!), I drilled out the holes and mounted the board on the saw.  Then I fixed a pencil in a board and drove the y-axis to mark a line across the board:
As you can see by the angle between the pencil line and the horizontal groove, there's a bit of error in my original measurements, so this will help me get it right.