Mesa Setup Part 2: Software

Once I had the hardware set up, it was time to get things configured in Linux CNC.  I had already downloaded the live cd from www.linuxcnc.org.  The CD can be booted from in order to test LCNC on your system or you can use it to install Ubuntu and LCNC onto your hard drive. I took the latter course since there was no operating system pre-installed on my computer.

Firmware

The IO and Stepper config is done in a program called “LinuxCNC Pncconf Wizard.” The version I installed didn’t come with the 5i25 firmware preloaded, so I had to download it from Mesa’s site here. Then I copied the 5i25 folder containing 7i76x1.xml (among others) to lib/firmware/hm2.

A couple of notes for folks new to linux: It’s really picky about permissions. In order to copy the directory and make sure Pncconf Wizard has permission to use the files, you’ll want to open a terminal window and type sudo nautilus. You’ll be prompted to enter your password and then a browser window will open and you’ll have root (godlike) privileges. Once you copy the folder, you’ll have to right click the xml file for the 7i76 and click properties. Then click on the permissions tab and change the owner from root to whatever your username is. There’s also a handy little linux reference here.

LinuxCNC Point and Click Configuration Wizard

Setup for Mesa hardware is done through the PNCconf Wizard. This is a program under CNC in the Applications menu. The online documentation for this wizard is pretty good and answered a lot of my questions as I was clicking through it. I’ll just highlight a couple points I thought were interesting or difficult.

Computer Response Time

One is on the Computer Response Time box on the “Base Machine Information” window. There’s a button to test the latency of your computer, i.e. how long a request might wait before getting to the CPU. Here’s what the manual says about this box:

LinuxCNC requires and uses a real time operating system, which just means it has a low latency ( lateness ) response time when LinuxCNC requires its calculations and when doing LinuxCNCs calculations it cannot be interrupted by lower priority requests (such as user input to screen buttons or drawing etc). Testing the latency is very important and a key thing to check early. Luckily by using the Mesa card to do the work that requires the fastest response time (encoder counting and PWM generation) we can endure a lot more latency then (sic) if we used the parallel port for these things…

If you press the test base period jitter button, this launches the latency test window … We need to look at base period jitter. Anything under 20000 is excellent – you could even do fast software stepping with the machine 20000 – 50000 is still good for software stepping and fine for us. 50000 – 100000 is really not that great but could still be used with hardware cards doing the fast response stuff. So anything under 100000 is useable to us.

Other places in the documentation also refer to “software stepping” vs. “hardware stepping” where hardware stepping is when you have the system timing coming from the 5i25 clock instead of the cpu. This is all very interesting and it’s good to know that it’s not as critical since I’m not using software stepping.  However, it’s confusing that they call the parameter “Actual Servo Period” when it appears to also apply to systems using stepper motors. I still have a lot to learn about all of this…

image

My latency test results.

My latency test results.

Driver Timing

Another item I spent some time on was on the “X- axis configuration” page. There are parameters called “step on time”, “step space”, “direction hold”, and “direction setup.” These parameters are different for different stepper motor drivers. There’s a table here that lists quite a few drivers and their respective values. The KL5056 however is not on the list so I was left scratching my head. The documentation says you can make a high guess on these numbers and you’ll just be limiting the top speed of your machine. I was thinking I might have to try that until I found another driver that looked identical that WAS on the list. Further inspection revealed that even the datasheets are the same. Only the name is different, so I entered those values.

Edit Post ‹ CNC Table Build — WordPress

It’s ALIVE!!

When I was done with the wizard, I powered up the 48V power supply and opened LinuxCNC. I was able to deselect the emergency stop button and turn on system power. When I clicked the limit/home switch, I got a limit error exactly like I should.  Then I clicked on the x axis jog buttons and the motor buzzed to life! I have to say this was pretty gratifying after the amount of time I spent reading manuals and double checking connections and settings.

Later, I ran the default cut file and was able to watch the tool moving around on the screen corresponding to the movement of the x-axis motor I had hooked up.  I have no idea if it was turning at the right scale or the optimum speed. Like I said in part one of this post, the point of this test was just to make sure I could get the pc talking to the motors and switches. I’m counting on there being more hurdles and fine tuning after I get the rest of the fabrication done on the table and finally mount the gantry. Now I’m even more excited to get on with that part of the project!

Leave a Reply