Linux CNC

Advert

Linux CNC

Viewing 21 posts - 26 through 46 (of 46 total)
  • Author
    Posts
  • #516956
    SillyOldDuffer
    Moderator
      @sillyoldduffer
      Posted by Brian H on 02/01/2021 10:14:28:

      Linux is something I've heard about for years but about which I know very little. Can someone explain (in simple terms) what the advantages are of using Linux for CNC over any other system?

      Brian

      Edited By Brian H on 02/01/2021 10:15:05

      Money, flexibility and freedom!

      Apart from embedded computers used to work washing machines and doorbells, all computers need an operating system to manage and share the machine's resources. It organises thousands of programs to achieve the desired result, for example providing network services for internet browsing and email, whilst also printing, scanning, reacting to the mouse and keyboard, or whatever. Windows starts a few hundred processes before the user does anything.
      In the beginning, computers came with whatever operating system the manufacturer though best and chaos ensued because they were all different. Someone trained on an IBM370 couldn't switch to an ICL1906 without going on a course, and a program couldn't be transferred without major customisation. Nor could data.

      Today, although computers are much more standardised, there are still four main breeds, three of them related.

      • Microsoft Windows – proprietary, closed source, pay Microsoft money to license it. Although Windows dominates desktop computing, it's less successful elsewhere.
      • UNIX predates Windows, but early microcomputers weren't powerful enough to run it. Therefore Personal Computers came with a minimalist operating system, like MS-DOS, which allowed users to do useful work, but were very limited. As chips improved and got cheaper, Apple and Microsoft added graphics, but their machines and software were both primitive compared with the expensive 'big-iron' in the basement. However, Windows and Apple Mac both appealed to users and developed solid customer loyalty. Serious graphical users bought UNIX workstations, fast powerful, machines with disc drives and plenty of memory, but unfortunately about ten times more expensive than a fully fitted IBM PC. Progress marched on, blurring the differences. Today:
        • Apple use a UNIX-based operating system in head-on competition with Microsoft for the desktop, and – successfully – for the much more profitable smart phone market.
        • Linux, also UNIX-based, is popular with educated desktop users, but is most successful on servers and embedded applications requiring significant compute power. (Like routers, web-servers,  and entertainment centres. Most of the internet is provided by Linux,)
        • Android is the world's most popular operating system. It's a form of Linux customised to run mobile platforms like Smart Phones. Extremely successful.

      The advantage of Linux is it's powerful, open source, well understood by techies, and pretty much free. It's much studied, taught and developed in academia, so there is no shortage of expertise. It's standards based, and avoids developing software that only works with proprietary systems. If a weather bureau wishes to develop a super-computer, they can download and modify Linux source code without becoming embroiled with lawyers, commercial contracts and restrictive software licences. Same goes for businesses making network equipment, games consoles, electronic testers, and all forms of automation from robotics down. But there's a catch: this form of computer work isn't basic end-user desktop work where all the gory details are hidden from the customer. You can do whatever you want with Linux but the cost is having to learn the ropes.

      Important to know that the visible user-facing experience isn't the operating system, it's a shell. When people say they 'know' Windows, they probably mean they understand the user interface and some configuration details, not how it works under the bonnet. Nor do they need to.

      For ordinary use, desktop Linux is no more difficult than Windows, and is better in some ways, less well supported in others. But Linux is different and some people can't cope with it not being Windows. It's also a developer platform, meaning the user has to understand he may be dealing with a dead-end project or unstable experimental software. What you get ranges from rock-solid to downright flaky.

      CNC programs face a particular problem in that they have to respond fast enough to deal with real-world events, were slow reactions will cause damage. Windows and Linux aren't particularly good at this because they're designed to share resources equally amongst applications where tens of milliseconds or even longer delays don't matter. The operating system manages this with many queues, but queuing machine tool events may not be acceptable because motors have to move accurately,starting and stopping at the right time. Managing real-time events requires the operating system to be modified so that certain programs will jump queues. And/or fast hardware! Both Windows and Linux have real-time extensions, neither are 'easy'. Although there are several Real Time Operating systems, they come with other disadvantages, including high cost. Linux has more options, and can be modified, and is cheaper, hence a good option.

      Dave

      Edited By SillyOldDuffer on 02/01/2021 12:21:25

      Advert
      #516970
      Brian H
      Participant
        @brianh50089

        Many thanks for that excellent explanation Dave (SoD), it is very useful. I'm not yet at a stage where I would use CNC so I'm trying to learn all I can.

        Brian

        #516983
        Joseph Noci 1
        Participant
          @josephnoci1

          I don't really know the best way to do this, so if this is poor, could the moderators suggest otherwise, split it out, or whatever…

          I have a LinuxCNC system running, on my 32 bit machine, and driving my Router….!

          I would like to post here what I did, what to do , as a basic means of getting something like this running, that hopefully can help other who are battling as I was..

          The post is long, it also robs David Colwill of his post and thunder, and that is NOT what I wish.. So please , if its an issue, lets split it out – I just felt that yet another Linux (CnC) thread might make the rest of the forum readers a little ill..

          PART 1

          What I have –

          32bit mini-PC (used to have Win-XP on it)- It has :

          Intel Core-Duo T2300E CPU @ 1.6GHz – very basic CPU

          512MB memory

          1GB hard disc

          4 serial ports (irrelevant)

          2 Network ports – should have one at least

          4 USB ports – also, one advisable, USB type 2 is fine

          No parallel port.

          Here is what I did:

          First, found an old multi I/O card – 1 Par port, 4serial.. PCi plug format.

          Fitted that into the only PCi slot in the PC.

          Then downloaded this: (as suggested by Mike T – THANKS Mike!)

          **LINK**

          Then created a bootable ISO USB stick – To do this I used RUFUS (!)..

          Download it here:

          **LINK**

          Run it ( On Windows..) AFTER plugging in your USB stick – it will see the stick, show it in the top line called ‘DEVICE’

          Click SELECT tab, 2nd line on the right, navigate to the directory you saved the .ISO download, and select it. The 2nd line , on the left, now shows that file name. BE SURE you have the .ISO file.. Then, MAKE SURE the top line shows your USB stick as the target if you select your hard drive here, by-by windows…

          Then, ignore the rest – should not need to worry about, and click on START at the bottom. After a while the .ISO is created, click on close, remove the stick.

          Then on the target machine – boot into BIOS – when powering on, keep tapping away at the key that will boot into bios – it differs by machine type, and is either ‘DEL’, F1, F2, F4, F8 or F10….You’ve got to love the consistency..

          When In BIOS carefully go through the options, and find the BOOT setup – in there, set up to BOOT from USB – make it the first BOOT option. Exit and Save, then shut down

          Put the stick in the machine, and power on.

          An initial Debian linux boot page will appear, with some choices as to what to do – You can boot from the USB stick, run LinuxCNC from the stick, but there are limitations, and LCNC is painful enough without those…So, I suggest doing a clean install – choose either the Install with Text , or the Graphical install, and follow the instructions – that part is straightforward – you have to give a user names, passwords, etc – MAKE SURE you write them down and what they are, else you will re-install again..

          PART 2 follows

          #516984
          Joseph Noci 1
          Participant
            @josephnoci1

            PART-2

            When that is done, the installer will ask you to remove the USB stick, and will boot the new install from the disc. It will ask your login user names and password, and once up, you are able to get stuck into (learning about) LinuxCnC….

            Best is to first create a parallel port driven mill type setup to get the feel..

            Left click Top Left, Applications Menu

            Click LinuxCnC down the list

            Click Stepconfiguration Wizard in the pop-out.

            A SETUP program opens, taking you through the setup where you say which port pin drives which signal, if your machine is inch or metric, leadscrew setups, stepper pulses, gear ratios, etc….

            To get to grips with that is not too difficult – If you have used MACH3 etc, the concept is pretty much the same.

            The Documentation and getting started guide, under Applications Menu:

            >CNC

            >docs

            > getting started

            will guide you along – not too bad that stuff!

            On the page where you set up this pin to function mapping, is also the place to insert your par port address.

            If you have a Parr port on the motherboard, leave that set to 0.

            If you have a plug-in port board, start with it set to 0.

            Then, on the Axis pages of the SETUP program ( where you set up steps/rev, microstepping, leadscrew pitch, etc) there is a ‘TEST AXIS’ button. Click it and with a ‘scope of LED on the relevant STEP signal PORT output pins, ( that you just defined) , click and hold on the left or right green arrow – that will jog the axis, and you may see the pulse train of that step signal.

            IF you don’t, then there is most likely an issue with the par card port addresses, and that’s a bit of a pain..

            So, we need to find out what the address is –

            In Apps Menu (top left), select SYSTEM, then select TERMINAL

            A terminal screen opens – type in

            Lspci -v

            Then press enter

            A list of stuff scrolls down – look for the section referring to an I/O card or Multi controller, or parallel card, etc.

            It will look something like this –

            0000:01:0a.0 Communication controller:

            Netmos Technology PCI 9815 Multi-I/O Controller (rev 01)

            Subsystem: LSI Logic / Symbios Logic 2POS (2 port parallel adapter)

            Flags: medium devsel, IRQ 5

            I/O ports at b800 [size=8]

            I/O ports at bc00 [size=8]

            I/O ports at c000 [size=8]

            I/O ports at c400 [size=8]

            I/O ports at c800 [size=8]

            I/O ports at cc00 [size=16]

            PART 3 Follows

            #516985
            Joseph Noci 1
            Participant
              @josephnoci1

              PART 3

              PCi parallel port cards don’t work like the old ISA cards – they had port address like 0x278 or 0x378, etc…

              And since you cannot find such an address for the PCi card, you have to find the start memory address of the ports from the list in the terminal screen…BUT – you have NO idea which one it is, so…

              Start with the LOWEST number in the list –

              b800 in this case above –

              Take that value, and enter it in the SETUP app, pin-function definitions page, in the Par Port address field, in this form – 0xb800. Then go forward to the AXIS setup page, and try the TEST AXIS button again ( click and hold the left/right green arrows)

              If still NO PULSES –

              Go back to the Par Port pins setup page, and try another address –

              Next one = 0xbc00 ( remember, the actual numbers here will be the ones FROM YOUR BOARD via lspci -v)

              Repeat the process until you find the pins pulsing!

              If you don’t find the pulse, check again, carefully, that you have the correct pin mapped to the correct function ( eg, pin-1 = X step, etc), and try again.

              If you don’t succeed, post me here and I will try to help!

              If the pulses appear, complete the SETUP app, and you should find on the desktop a ‘My_Mill’ shortcut, click it to run, and the machine should come up…

              Obviously, there are a LOT of other things – you need to connect your motors and drivers and test that all first, you must have a configuration strategy for all the HOME switches, end-of travel switches, if you want them, ESTOP, etc, and they must all be mapped to I/O pins…

              But at least you should now have a running LinuxCnC setup, and you can start discovering how much you don’t know..

              What a journey – it actually is all very simple and why the geeks have to obfuscate it so, only they know!

              Joe

              Edited By Joseph Noci 1 on 02/01/2021 14:06:01

              #516988
              Frances IoM
              Participant
                @francesiom58905

                Joseph
                you can recover from forgetting a password by merely removing hard drive putting it in another Linux system + editing the password file – just look up documentation for Debian

                #516994
                Joseph Noci 1
                Participant
                  @josephnoci1
                  Posted by Frances IoM on 02/01/2021 14:13:53:
                  Joseph
                  you can recover from forgetting a password by merely removing hard drive putting it in another Linux system + editing the password file – just look up documentation for Debian

                  Thanks Frances.

                  However, you may know by now my feelings on the subject, and up to a few minutes ago, one machine with Linux in the house was one too many..!

                  thanks for the tip!

                  Joe

                  #516996
                  mike T
                  Participant
                    @miket56243

                    oops

                    Edited By mike T on 02/01/2021 14:37:02

                    #516998
                    David Colwill
                    Participant
                      @davidcolwill19261

                      Joe,

                      I have no objection to keeping everything here. It is more than possible that others will stumble across this and hopefully gain some useful info.

                      As for me I am fairly pleased with the days progress.

                      I have fiddled around with it and fitted a video card (thanks to the comment by Bayzle) as I was getting sporadic jitter that would flag up an alarm. That has now gone away although the max jitter is 35,000 ns.

                      I have had another dell which was much lower but haven't tried connecting that yet.

                      The screw cutting is coming along.img_20210102_141708.jpg

                      Not perfect but an improvement on yesterday.

                      It is an M12 x 1.5.

                      Speed was about 900 rpm.

                      I spent much less time today faffing around with the interface and it is starting to grow on me.

                      Regards.

                      David

                      #517018
                      Frances IoM
                      Participant
                        @francesiom58905

                        Joe
                        Linux will grow on you – make a copy (eg via dd tho double check your typing here dd is not forgiving when invoked as superuser) of the hard drive with your Linux system on to another drive of same size or larger – then just edit two files on the copy (/etc/hostname and /etc/hosts to the name of the new system and bingo you can now run 2 linux systems without any hard work!

                        #517038
                        SillyOldDuffer
                        Moderator
                          @sillyoldduffer

                          Rising to Joe's earlier comment:

                          And Dave (SOD!)

                          That's Cheating…first off there is ONLY ONE RPi version that you could download from the official download page, so probably difficult for that to not work? No confusion of how many bits, which version, which Linux, etc. But I don't like Pi…

                          If you install one of the PC ISO's and tell us what you did, now that would be nice…

                          ————————–

                          So I went to linuxcnc.org and downloaded LinuxCNC 2.8.0 Debian 10 Buster PREEMPT-RT ISO

                          Download slow, so I had coffee and did something else while the 2.2Gb iso dribbled down.

                          When it finished I used the Ubuntu Start Up Disk Creator to copy the ISO to a USB Memory Stick. This is like RUFUS except it's meant to copy Ubuntu isos. Didn't work, I think because the Ubuntu App is designed for Ubuntu images, and LinuxCNC is Debian.

                          Rather than download UNetbootin or one of the other graphical ISO copy utilities, I did the copy from the command line using standard system tools. (If you have prefer Windows, RUFUS is great.)

                          Geek way, at the $ prompt, enter lsblk

                          This lists the discs mounted on the system.

                          ddlinuxcnc.jpg

                          Near the end, the memory stick is identified as disk sdc. Note this can vary, depending on how many discs are mounted on the computer.

                          Next the ls ~/Downloads/*.iso command lists all the iso file in my Downloads directory. There's only one:
                          /home/dave/Downloads/linuxcnc-2.8.0-buster.iso

                          Then sudo dd bs=4M if=/home/dave/Downloads/linuxcnc-2.8.0-buster.iso of=/dev/sdc conv=fdatasync

                          which means:

                          • sudo – run the next command with admin privileges
                          • dd – file copy utility, more powerful than cp in that it can write to a disk rather than to a folder.
                          • bs=4M – write in 4Mb blocks, only because it's faster
                          • if=/home/dave/Downloads/linuxcnc-2.8.0-buster.iso – the input file is LinuxCNC
                          • of=/dev/sdc – the output file is the disc /dev/sdc, ie the whole memory stick.
                          • conv=fdatasync – don't finish until the disc confirms writing is complete

                          Warning! dd does exactly what you tell it. No safety net. If I accidentality typed sda rather than sdc it would overwrite my main fixed disc. The graphical tools all assume the user is an idiot and issue helpful warnings, or stop anything other than a USB stick being written.

                          ISO copied, I plugged the memory stick into an Acer 5742 Laptop, and switched on. The Acer is a 64-bit i5-480M.

                          I pressed F2 to get into the Boot Menu and confirmed the memory stick was the first bootable device. (This isn't always the case.)

                          Carried on and the laptop booted with the LinuxCNC splash screen:

                          dsc06370.jpg

                          Selected the Live Option, (ie run from the memory stick without installing anything), and got Debian, with LinuxCNC on the menu:

                          dsc06369.jpg

                          This is almost identical to the Pi4 version because both are Debian flavour Linux, except the Pi updated and set-up the network etc, whereas the Live Disc probably leaves all that until the full install.

                          Although running Live from a USB stick is fully functional, it's painfully slow. The purpose is to confirm stuff works rather than to provide a real system. If whatever fires up as LinuxCNC did above, it's probably compatible with the hardware and safe to install permanently.

                          Not tested the ISO on a Windows machine but the full install is probably capable of creating a dual boot machine with both Windows and Linux available. To do this, Linux will steal disk space from Windows and alter the hard drives boot sector. Done this several times without problems, but it can go wrong. Safer to dedicate a computer to LinuxCNC and not try to keep Windows as well.

                          Ought to mention installing software on Linux is usually much simpler than this fandango! Most software is available from a central repository. You just select what you want and the package downloads and installs automatically, including any dependencies. When upgrades become available, you're asked if you want to to take them, and can refuse.

                          It appears I've got LinuxCNC going on two different machines within a day without getting wrapped round the axle! The Pi install needed no special skills at all, and I only used the command line to show how it's done manually.

                          I think it was easy because I stayed mainstream – Pi4 is currently supported by linuxCNC, and my 64 bit laptop is compatible with the latest version too, even though it must be 10 years old. I suggest putting LinuxCNC on a 32 bit computer in 2021 isn't a good place to start because it makes hitting hard to understand compatibility issues more likely.

                          Dave

                          #517076
                          Bazyle
                          Participant
                            @bazyle

                            Mike, Joseph, I recall having to do something about modifying my initial linux installation with a Real Time Kernel (I think). It might have been something to do with the version of Linux I used (I can't remember and havn't dug the machine out yet) but i used a method of installation that downloaded itself off the internet after I had possibly used a small disc or card to start it off. I didn't have the oodles of memory or storage or something to pre-download it but did have a 350meg modem.

                            #517088
                            Frances IoM
                            Participant
                              @francesiom58905

                              S.O.D – think of dd as short for Disk Destroyer – at which mistake SOD is about all you can say

                              I suspect Joe’s mini ITX? boards are well over a decade old – I bought 5 or so as a leaving present to myself when I retired some years ago – highly reliable but not standard Intel86s and thus you needed the 32 i386 architecture but even then mine were too short of memory so are still running win98 mostly to service an old but good scanner.

                              Edited By Frances IoM on 02/01/2021 20:43:54

                              #517505
                              sam sokolik
                              Participant
                                @samsokolik60334

                                The main reason why there is only a pi4 version is it is the first pi that can really handle it… (main thing is that the ethernet controller is not connected though the usb bus anymore. This allows for actual realtime ethernet attached devices. (like the mesa 7i92 or such)

                                sam

                                BTW – David – what kind of encoder is on the orac?

                                #517600
                                Kiwi Bloke
                                Participant
                                  @kiwibloke62605

                                  Just a couple of points, because I don't think they've been mentioned yet [apologies if I've missed something].

                                  1. If you can persuade Windoze to pack all its files, etc. tidily onto the HDD, so that it can be partitioned without data loss, it's easy to set up a dual-boot, Windoze/Linux machine. You can then cause havoc on the Linux partition(s) with impunity. [Well, that was the case, and I'm pretty sure it still is – I know nothing of Windoze post XP, which is when I dumped the ghastly OS to be 100% Linux.]

                                  2. It's not universally known, but you can easily get the RPi, from 3B onwards (IIRC) to boot from a USB disk, so a used laptop HDD – or several – can be used for Linux experimentation, without fear of buggering up anything important. Far easier than using the SD card, in my experience.

                                  Joe. A man of your obvious abilities should convert to Linux immediately! It's the thinking man's OS, and isn't difficult these days. Since you can have Windoze and Linux on the same machine, you can still run your favourite, expensive, applications on that bloated, expensive OS, if you really need to… Oh, and for heaven's sake retract your offer of free RPi's, or I'll be sticking my hand out. Hang on to them – they are too valuable, once the Linux hump has been got over!

                                  Edited By Kiwi Bloke on 05/01/2021 10:24:20

                                  #517604
                                  David Colwill
                                  Participant
                                    @davidcolwill19261
                                    Posted by sam sokolik on 04/01/2021 19:57:49:

                                    BTW – David – what kind of encoder is on the orac?

                                    It has a slotted disc with 48 holes and an index, which seems to work fine.

                                    David.

                                    #517606
                                    Frances IoM
                                    Participant
                                      @francesiom58905

                                      K B
                                      The major problems I see in ‘selling’ Linux are (1) as in our Editor’s case the hassles in trying it many years ago when it was immature
                                      and (2) having spent much time in learning a system to want to give it up – “old dogs with new tricks” (I plead guilty here but WINE allows me to run old but comfortable to my use exWindows packages.

                                      I’ve already suggested he give the RPi package to youngsters at a school or college and see his gift be well used

                                      #517609
                                      Peter G. Shaw
                                      Participant
                                        @peterg-shaw75338

                                        Frances IoM,

                                        Completely agree with your comments, having been through that mill myself when Microsft stopped supporting XP.

                                        One thing I will say though is that there is a lot of support available on forums, but don't make the mistake I did of mentioning WINE on some of them – you will immediately experience the wrath of certain "Linux Fanboys" who object strenuously to anyone mixing Windows or DOS programs with their beloved Linux, even though the very fact that WINE exists demonstrates that there is a demand for it.

                                        Otherwise, make the switch, use WINE for those "can't do without" programs, even use DOSEmu or DOSBOX to run certain DOS programs, you will never regret it.

                                        Just for the record, I use WINE to run DesignCAD 3D Max 17.2, and DOSEmu to run Masterfile Professional, and old but nevertheless very good DOS based database program.

                                        Regards,

                                        Peter G. Shaw

                                        #517619
                                        Frances IoM
                                        Participant
                                          @francesiom58905

                                          Having attempted to ‘sell’ Linux I guess I can now raise a point – LinuxCNC runs ok as far as I can see but as yet nothing to connect but it won’t run on a Pi400. This has the same processor as the RPi4 tho can be faster as has a heatsink built in – however it advertises as an arm64 machine (ie under its true colours as a native 64 bit machine with 4 cores – however much to my surprise LinuxCNC can’t recognize it in this guise and the machine jams at the ‘get started’ page tho swapping the SD back to a RPi shows it is ok there.

                                          #517637
                                          Brian H
                                          Participant
                                            @brianh50089

                                            I have followed this fascinating topic with interest even though I do not have a present use for Linux but I'm interested in getting into CNC at some stage hence the interest.

                                            I've just realised that I have an unused Lenovo PC that was running Windows so I could put Linux on that to investigate. I'm assuming that I can just follow the advice given on here ( and then ask questions on here if/when it goes pear shaped.

                                            Brian

                                            #517641
                                            sam sokolik
                                            Participant
                                              @samsokolik60334
                                              Posted by David Colwill on 05/01/2021 10:39:58:

                                              Posted by sam sokolik on 04/01/2021 19:57:49:

                                              BTW – David – what kind of encoder is on the orac?

                                              It has a slotted disc with 48 holes and an index, which seems to work fine.

                                              David.

                                              That is an awesome count for printer port reading. The emco compact 5 pc's have 100 holes + index and they work great over the printer port.

                                            Viewing 21 posts - 26 through 46 (of 46 total)
                                            • Please log in to reply to this topic. Registering is free and easy using the links on the menu at the top of this page.

                                            Advert

                                            Latest Replies

                                            Viewing 25 topics - 1 through 25 (of 25 total)
                                            Viewing 25 topics - 1 through 25 (of 25 total)

                                            View full reply list.

                                            Advert

                                            Newsletter Sign-up