Author Topic: Attempt at LinuxCNC (formerly EMC)  (Read 4122 times)

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4682
  • Country: us
  • Republic of Vermont
Attempt at LinuxCNC (formerly EMC)
« on: September 05, 2014, 09:35:27 AM »
This may be a short attempt, too since I don't have any even reasonably modern computer to spare for it.

To start at the beginning, I have run old fashioned TurboCNC on the rare occasions I try to mill something via CNC, so I hadn't hit the snag I did this week with it. Using Sketchup and Sketch-U-Cam I wanted to cut out some 15/16" circles and small screw holes in a 1/16" aluminum sheet panel.

When I tried to run a test, the holes ran way below the proper feed rate and it gummed up the cutter, and well you can imagine, it wasn't pretty.

After checking out the G-code I've found that circles are written as a series of arcs -- Sketchup shows circles on screen as segmented line figures of say 25 pieces, and though SketchUCam writes these as true G3 arcs instead of straight lines, the number of segments stays the same. Because TurboCNC applies its acceleration factor at the start of any segment, the net result is that a 25 arc circle is composed of 25 starts and stops with acceleration applied -- the net result is a drastically lowered average feed rate.

It appears that TurboCNC doesn't use a look ahead buffer and doesn't compensate for this kind of situation, while other CNC programs do -- notably Mach 3, which everyone seems to use. But with Mach 3's cost of $179 it's just not something I can afford now -- I do realize the trial version is free, but I know I'll want the non-crippled features, and I don't want to start down that path and get committed to it.

Also Mach 3  seems to need a computer more modern than I have available, and even buying a used computer would just add to the total cost, as well as make redundant what I already have -- thus more useless storage or another disposal of perfectly usable gear. I hate to do that kind of thing unless I absolutely have to.

So I've been looking at LinuxCNC. I already run Puppy Linux as my standard op system anyway and have for years. It seems there's just a chance that my available hardware can run LinixCNC, so what the heck -- it's free, and open source, give it a try.

It does use Ubuntu as an operating system which I'm not fond of. I started with Linux a 5 years ago running Ubuntu -- but it seemed slow and bloated, wanted late hardware and required frequent updates (which broke my system one too many times). After 6 months I discovered and switched to puppy linux which was light and fast ,easily customized, ran well on anything, could run well as a "frugal" install and wasn't dumbed down. And I never looked back.

So the idea of returning to an even later (and presumably larger) Ubuntu OS for a simple CNC controller doesn't have a lot of appeal for me. But hey, lets try it and see. I do note that the latest version of LinuxCNC seems to be written for a Debian core OS, so that might have more appeal. I tried Debian back in the dark ages, but never got far with it.

Anyway test subject for this (at present) is going to be my 1998 IBM Thinkpad 600E which runs TurboCNC fine now. It's been hacked up to an overclocked Pent 3 with more than stock memory (484 megs if I remember correctly).

 Yes I know, a laptop is generally wrong for any CNC program, etc., and this one is particularly old and abused with soldered wrap wire, cut traces, and a modded bios. But some of the latency reports on the LinuxCNC show similar era Thinkpads actually usable, so I have a slight hope in this. Hey -- this is MadModders, right? Not Sanemodders!  :)


As a start I've downloaded the 2.6 version with the Debian OS, and the 2.5 version with the 8.04 Ubuntu OS with earlier kernel -- hoping that one or the other will run on my old hardware.

I love it when a Plan B comes together.

Offline awemawson

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4753
  • Country: gb
  • East Sussex, UK
Re: Attempt at LinuxCNC (formerly EMC)
« Reply #1 on: September 05, 2014, 10:16:33 AM »
I'll be watching this with interest. Some time ago I down loaded it and got horribly tangled up, not being particularly into unix in it's many forms
Andrew Mawson
East Sussex

Offline Brass_Machine

  • Administrator
  • Hero Member
  • *****
  • Posts: 5122
  • Country: us
Re: Attempt at LinuxCNC (formerly EMC)
« Reply #2 on: September 05, 2014, 10:26:33 AM »
Hey Steve,

I have no input on the LinuxCNC. I do want to try it someday though. But I can say this, yes generally a laptop is not good for CNC... however, I use one for my mill. I have an old Dell that I use and it hasn't given me any problems.

Eric
Science is fun.

We're all mad here. I'm mad. You're mad.

Offline awemawson

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4753
  • Country: gb
  • East Sussex, UK
Re: Attempt at LinuxCNC (formerly EMC)
« Reply #3 on: September 05, 2014, 11:05:38 AM »
I think that the laptop issue is largely one of how the ports are implemented. The parallel port often hasn't a full 5v swing only 3.3v on some, and if you are using it to drive your system break out board you may well be in trouble. Similarly the serial ports very often don't give 12-0-12 which can muck things up.
Andrew Mawson
East Sussex

Offline Brass_Machine

  • Administrator
  • Hero Member
  • *****
  • Posts: 5122
  • Country: us
Re: Attempt at LinuxCNC (formerly EMC)
« Reply #4 on: September 05, 2014, 11:12:10 AM »
Yup. I actually have an older dell desktop that I will be moving over to when I start upgrading the mill.
Science is fun.

We're all mad here. I'm mad. You're mad.

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4682
  • Country: us
  • Republic of Vermont
Re: Attempt at LinuxCNC (formerly EMC)
« Reply #5 on: September 05, 2014, 12:21:09 PM »
Those port problems aren't present for me on this Thinkpad because it is currently driving machines under TurboCNC with no problems.

The other problems I've seen mentioned are due to interrupts, and shared video memory. We'll see.

Current progress:

I burned a liveCD R/W of the 8.04 Ubuntu/EMC2.5 version and booted it in the Thinkpad. MAN that was slow loading!!!! I'm used to puppy linux again, whose liveCD loads rather quickly -- natch since the whole OS and apps takes up only 100 megs of a CD, and it loads the system easily entirely into RAM for even a 128 meg equipped oldie. No more CD accesses after loading, so runs like a flash.

Not so Ubuntu -- constant CD accesses while running programs. Yuck. I mean it must have taken 15 minutes to load off disk! and then ran like a hog.

BUT.................When I did the latency tests I got very good figures!!! And when I ran the EMC program I ran ! So I have hope at this point, that if install to the HD the OS loading will be tolerable, and the CNC program itself might actually work.  Fingers crossed.


Next step is installing without clobbering my Win98SE installation (w/TurboCNC and a bunch of legacy stuff I don't want to lose) or clobbering a pre-existing Puppy linux installation.

In fact on this same computer there is actually an old Ubuntu (ver 7.4?) installation as well. That one can go bye bye. Should be interesting. Ubuntu's install script, as I remember it likes to erase whole partitions without much explanation  or less drastic options.
I love it when a Plan B comes together.

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4682
  • Country: us
  • Republic of Vermont
Re: Attempt at LinuxCNC (formerly EMC)
« Reply #6 on: September 05, 2014, 05:57:26 PM »
As I thought, there were some problems installing Ubuntu over pre-existing OS's on this computer, but nothing that didn't work out in the end.

The main problem at first turned out to be a loose memory stick -- I was only showing 128k, and that turned out to be insufficient for the installer -- it hung about half way through the wizard questions. Cleaning contacts and re-seating memory worked. I guess I've been running Turbocnc with 128K -- which is no problem for that DOS based program.

With about 290K free now the installer didn't halt, but it definitely wanted to partition the drive, and format it, too. Nuhnuhnnuno! It reallyt doesn't have an option to bypass the partitioning and formatting questions, so I took a chance and specified the same partition size as already existed, with the same name, and same ext3 format, and checked a box not to re-format it. The wizaard then asked me if I was sure I didn't want to re-format, warning that conflicting system files would be erased -- which was fine with me. I did want to get rid of the old 7.10 Ubuntu system just not my data -- which I had wisely kept in a different partition.

The installer then proceeded to check for  existing operating systems, and actually asked me if I wanted to keep my old personal settings -- that was nice, so i said yes to that. Finally I was greeted with:


I love it when a Plan B comes together.

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4682
  • Country: us
  • Republic of Vermont
Re: Attempt at LinuxCNC (formerly EMC)
« Reply #7 on: September 05, 2014, 06:14:58 PM »
After about a half hour install, I was told to reboot, and popped the CD out of the drive.

Rebooting produced a reasonably responsive system -- boot to password screen was 60 seconds, and after entering username and password I was in the Ubuntu 8.04 desktop in another minute.

I checked and all my pre-existing partitions operating systems (other then Ubuntu 7.10) and data were intact. One slight hitch -- Grub (the startup module which allows you to boot into alternative OS's) had been re-written to only point to the new OS. However, I had anticipated this by saving a copy of the old Grub on another partition. I just have to restore the entries to a file called menu.lst, and we should be good to go multibooting to the various other OS's. I'll be able to boot to Win 98, MSDOS, and two pre-existing versions of puppy linux on this 1998 computer!

Clicking on the Program menu showed  a CNC category with entries for a full user manual, a latency test program, the CNC program itself and a G-code reference guide, as well as a getting started document. Of course I went straight to the CNC program, and it opened quickly. I loaded a test G-Code part program (the one I had failed to get TurboCNC to maintain feed rate on) and it popped up in the perspective simulation window:



I used a CNC machine configuration profile for a simulated mill, which actually just pipes the parallel port output to the speaker, so you can hear the stepper pulses for the various axes -- kinda cool creepy music while you watch the animation of the cut. It seemed to work well. The next step will be inputting the actual hard configuration parameters of my actual machine and controllers and testing it out for real.

I love it when a Plan B comes together.

Offline Joules

  • Hero Member
  • *****
  • Posts: 727
  • Country: gb
Re: Attempt at LinuxCNC (formerly EMC)
« Reply #8 on: September 06, 2014, 01:11:27 PM »
I've been a LinuxCNC/EMC2 user for about 5yrs....   NOTE, I am a user not a programmer.  I set it up for my cnc router, had loads of problems till I got the printer port card sorted and working on PCIe.  It runs on a dedicated PC box, nothing fancy and I feed it with output from CamBam.  The design work is in Rhino and output to CamBam as DXF.  Never had a problem with the software, its always done what I needed.  As before, I'm not a power user, it does what I need for business.






              Joules
« Last Edit: September 06, 2014, 02:18:16 PM by Joules »
Just get doing and make swarf, you can decide what its going to be later.   :thumbup:

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4682
  • Country: us
  • Republic of Vermont
Re: Attempt at LinuxCNC (formerly EMC)
« Reply #9 on: September 06, 2014, 09:06:33 PM »
Excellent Joules! Mine is a gantry style, too -- quite similar.

I've got it moving axes now, but am having problems understanding and adjusting it's "home" position. It seems you have to set this outside of the running program in another program called stepconf.

There doesn't seem to be a button to set a current position as the home position in the running CNC program itself -- but maybe I am missing something (probably!)

And even in the stepconf program when I set the home to where I think it should be -- just a little inside the limit switches, near 0,0,0 it seems to end up somewhere else.

Example:

I set home to .010 on the X axis in stepconf, but when I hit "Home" the X axis starts moving to the right and only stops when I hit the halt button.
I love it when a Plan B comes together.

Offline awemawson

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4753
  • Country: gb
  • East Sussex, UK
Re: Attempt at LinuxCNC (formerly EMC)
« Reply #10 on: September 07, 2014, 04:33:59 AM »
Does it possibly hold two different values, 'zero origin', and 'home' rather like doing an origin shift on some systems ?
Andrew Mawson
East Sussex

Offline Joules

  • Hero Member
  • *****
  • Posts: 727
  • Country: gb
Re: Attempt at LinuxCNC (formerly EMC)
« Reply #11 on: September 07, 2014, 06:51:11 AM »
Yep,
      Andrew is pretty much right...  As to homing and limit switches !!!    Whats the point, on my router the switches are magnetic reed attached with doubles sided tape, far from accurate and to be honest I did't even notice the magnets had fell off the tape as I never use them.   Since in CAD I always use a 0,0,0 origin for my drawings I carry that through to the router and have the centre of the bed 0,0,0.  My machine has a 1000mm x 600mm working area (plus 3mm clearance).  So if I do set things up I move the gantry to within 1.5mm of one end ZERO my position, then give it a positive or negative 300/500 to move it to the centre and re ZERO the settings using the manual control panel, select X,Y or Z and press the Home axis, that sets your local home to zero.  Note the target marks next to your XYZ co-ordinates.  LinuxCNC won't progress if they are not set.

Since I use odd bits of material I tend to zero on the work piece than try to set the material to a bed location that way I can just zero in the middle then run the gantry round to make sure I have enough room for the job.  Z is always zero to the stock surface so no confusion over that.

You input G0 commands in the MDI screen (F5) to move around.  Here I have a wireless mouse and keyboard that are used right next to the work for setting up.  Must make a control pendant at some point in time.
Just get doing and make swarf, you can decide what its going to be later.   :thumbup:

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4682
  • Country: us
  • Republic of Vermont
Re: Attempt at LinuxCNC (formerly EMC)
« Reply #12 on: September 07, 2014, 08:17:47 AM »
Joules, that's pretty much the same way I used to do it in TurboCNC. Also drawing from 0,0,0.

I shouldn't have bothered trying to use the limit switches as home switches (one of the options in LinuxCNC). Last night I just changed the configuration to plain limit switches and no home switches, and things seemed to work -- I was able to home. where I wanted to. I ran the laptop here in the house -- so could only simulate a cut, but will hook it to the mill in about an hour or so nd try cutting a part (out of foam sheet first).

Thanks for your suggestions and help, Joules. :beer:


I'd still like to understand what I was doing wrong in setting a home position with the combined limit and home switch option, but at least it all seems to be workable now without home switches enabled.

And it's odd -- maybe it's just because I was used to it, but I like the old DOS TurboCNC interface better than LinuxCNC's. In TurboCNC Hitting f8 put you into a jog screen where you could do all kinds of stuff, including zeroing axes, homing, jogging, overriding limits, saving position, etc, so just one screen and multiple keys for doing things manually.  Then hit ESC and back to the main panel for running and editing programs, setting configurations, etc.

I really miss the "Zero all axes" button in TCNC.

The Home button in LCNC (at least with the home switches enabled) only seems to move an axis to whatever pre-set Home there is. It doesn't set a new home. There doesn't seem to be a button to set a new Home. And I'm unclear about what "unhoming" means. There's a dropdown option for that.

I especially don't like having to go to a separate program to make a configuration change (like setting a Home position), and since it's a wizard, you have to wade through a bunch of questions to get to the parameter screen you really want to change. Change it, and then scroll through more screens to save it eventually, close the program and re-open the CNC program. Long process for just changing a single config parameter while testing.

I'm sure that there must be other quicker ways to do this -- I just don't know them yet.

I'm reading the full user manual now, and it probably will make more of the operation clear, than the Getting Started manual.

On the plus side, the writing style is excellent, and it's neat to find that there are many variations to the GUI available. The program now seems to run well on my ancient laptop, and I really do appreciate the graphic display of the cut in progress in 3D perspective -- something TurboCNC naturally couldn't do. There's also a nice program in LCNC for determining your max speed and max acceleration possible. And with a lookahead buffer, the average speed should be much closer to the specified feed speed -- which is why I am making the switch in the first place.

Biggest complaint so far:

I really hate Ubuntu on this laptop. It's slow as molasses in January!

Please, please somebody, recompile this for Puppy Linux.......  :)


« Last Edit: September 07, 2014, 09:42:14 AM by vtsteam »
I love it when a Plan B comes together.

Offline Joules

  • Hero Member
  • *****
  • Posts: 727
  • Country: gb
Re: Attempt at LinuxCNC (formerly EMC)
« Reply #13 on: September 07, 2014, 11:05:05 AM »
Have you tried the live install of 2.6 based on Debian Wheezy...  I'm very pleased with it and moved away from Ubuntu.  It's stable and so far updates haven't caused any issues.  Dos TurboCNC was packaged with this machine, but at the time I was using Linux anyway so went straight for EMC2 and the steep learning curve.  Once things got working on a ratty PC I bought a new box to dedicate to the router, its all networked to my central storage so transferring things from the CAD station to the cnc router are across the network we have here.
Just get doing and make swarf, you can decide what its going to be later.   :thumbup:

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4682
  • Country: us
  • Republic of Vermont
Re: Attempt at LinuxCNC (formerly EMC)
« Reply #14 on: September 07, 2014, 11:42:31 AM »
Joules, nope didn't try the Debian version because it's even larger -- 1.1 Gig -- about double the size of even Ubuntu in fact-- won't even fit on an install CD. And I'm not sure I can boot from a DVD on this laptop.

I'm certain I can't boot from a thumb drive, which is the other claimed option.

I really don't see why we need a modern bloated Linux OS bundled with browser, mail, chat, full open office suite, etc to run a CNC program on only a dedicated CNC box. This should all be easily do-able on 10 year old single proc.  computers with parallel ports. Stuff going to the dump or hidden in closets is perfectly capable of doing this kind of task quite well.

The problemcomes from the developers choosing a large slow Linux OS's to compile it on, so older computers can't easily load the later versions, and are hampered in speed by the OS size and proc requirements. Currently:

Ubuntu 8.04 w/CNCLinux takes up 680 megabytes on CD.
Debian WCNCLinux takes up 1.1 Gig

By contrast, Puppy Linux loaded with 50 apps takes up a mere 100 megs on CD, and will run maybe 5 times as fast, for normal OS tasks. LinuxCNC could easily fit with it on a CD with plenty of room to spare.

Nothing wrong with LinuxCNC itself -- I just got finished cutting a foam test panel on the Thinkpad, and it works fine so far. I have to tweak my G-code a little, but that has nothing to do with LinuxCNC. LinuxCNC itself runs fine on old machines.

It's when I drop out of the CNC program into the OS that everything is painful. It takes an irritating amount of time to open the Stepconf program, or LinuxCNC itself, or load a part file into a directory -- just normal OS operations. Sometimes I think the computer has stalled, but waiting another minute reveals it's just running slow.

By comparison, I can boot into Puppy Linux on this same computer, and OS operations and apps run like it's a dual proc modern computer. Fast as you click on something it opens. No wait.

Well anyway enough of that subject. The good news is LinuxCNC works well on a very old dumpster computer -- even a laptop.

I'll probably try cutting aluminum today when the G-code looks good.  :thumbup: :beer:
I love it when a Plan B comes together.

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4682
  • Country: us
  • Republic of Vermont
Re: Attempt at LinuxCNC (formerly EMC)
« Reply #15 on: September 07, 2014, 06:47:49 PM »
Woohoo!!! It worked.  :ddb: :ddb: :ddb: :ddb: :ddb:

I love it when a Plan B comes together.