Announcement

Collapse
No announcement yet.

Getting started with LinuxCNC and a lathe

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting started with LinuxCNC and a lathe

    Hopefully there is a linuxCNC guru here that can point me in the right direction. I have a Sieg C6 lathe with stepper motors on Z and X. I have a 60 notch encoder wheel with quadrature encoding and an index pulse. I have LinuxCNC set up on a Ubuntu box and a parallel port to break out board and stepper drivers. What I hope to do is use the axis gui with NGCGUI and some simple macros. Configuration seemed straight forward. Port test shows all the right pins are flashing in the correct sequence when I rotate the spindle. I set home limits in the config file. I can hit the power button, home the axis, touch off the axis, and I can use the arrow keys to step the motors. This all works correctly. What I do not seem to be able to do is move the motors under any sort of automatic control or get the manual tool change dialog to pop up. When I use the NGCGUI macros for something like facing it prompts me for the parameters and lets me click the "create part" button but almost immediately it indicates it is done and asks for the next set of parameters. Nothing ever moves no matter what parameters I put in. The status line at the bottom indicates no tool loaded but nothing I can do will get me a prompt where I can tell it that the tool is ready to go.

    Any ideas what obvious step I have missed? Thanks in advance.....

    Brian

  • #2
    It took me about a year to get comfortable with LinuxCNC. You seem to have gotten through the hard part -- getting it set up, more or less.

    I haven't had much luck with the macros, there's not enough documentation and the macro code is too complicated to be obvious, though I'm sure a person would eventually figure them out if you played around with it for a while. But I prefer to use manual g-code commands under the MDI menu for simple moves.

    When you start LinuxCNC, certain things have to be turned on before the stepper motors will run:
    -- the software emergency stop switch is in the "off" position by default. Toggle it to turn it on. It's the "X" on the left side of the menu bar.

    -- the software "machine power" switch is in the "off" position by default. Toggle it to turn it on. It's right next to the emergency stop on the menu bar.

    -- by default, the motors will not respond to commands until the axes have been homed -- though you said that you were able to home the axis. Alternatively you can change your INI settings so that homing is optional.

    Once those 3 things have been taken care of, then the motors should respond to G-code commands. Go to MDI and type in a simple move, just to see if they respond ?

    The tool change command is M6 T# G43. If you type that into MDI the tool change dialog should pop up ?

    You probably already know these things but I am covering basics since you are new to LinuxCNC.

    BTW, is LinuxCNC recognizing your spindle encoder and displaying the RPM?
    Last edited by MTNGUN; 06-29-2015, 11:04 AM.

    Comment


    • #3
      Also, when you first start up LinuxCNC, if you go to the MDI menu, the command line background will be shaded a light blue/grey. The shading means it is not ready to run yet and the motors will not respond to commands.

      After things have been turned "on" as discussed previously, the MDI command line changes to white background, meaning motors are now ready to run.

      Comment


      • #4
        Originally posted by MTNGUN View Post
        Once those 3 things have been taken care of, then the motors should respond to G-code commands. Go to MDI and type in a simple move, just to see if they respond ?

        The tool change command is M6 T# G43. If you type that into MDI the tool change dialog should pop up ?

        You probably already know these things but I am covering basics since you are new to LinuxCNC.

        BTW, is LinuxCNC recognizing your spindle encoder and displaying the RPM?
        That is exactly what I was looking for! I will give it a try later today. I woke up this morning thinking about checking the RPM readout. There is a lot of documentation which I find quite readable but I do not see very much of the end user hand holding with "do this" followed by a screen shot followed by "now do this" and another screen shot common with a lot of windows SW. It almost feels like there are a few very dedicated hard core contributors to the official project but not a huge number of users. (or at least users willing to post their experiences independently). Thanks again and I will update when I have tried the above.

        Brian

        Comment


        • #5
          There is also a LinuxCNC heading in the CNCzone and there are a couple of experts there may help also.
          Max.

          Comment


          • #6
            Originally posted by MaxHeadRoom View Post
            There is also a LinuxCNC heading in the CNCzone and there are a couple of experts there may help also.
            Max.
            The linuxcnc forum is a great place for help. linuxcnc.org (bigjohnt is a regular and he wrote the majority of the lathe ngcgui routines, he also is a member here)

            There is also the IRC chat channel for linuxcnc but that is more hardcare users, still it usually gives instant support.

            Comment


            • #7
              Ok, M6 worked fine and popped up a dialog box as described. G0 and G1 both work. Where do I find the RPM display? I was assuming on the DRO page but I don't see it. Is that the R: entry on the top right? When I try a G95 I get an error message indicating that the command is invalid with a spindle speed of zero so I think I am getting close to the problem. I do not have any sort of CNC controlled spindle. How do I tell LINUXCNC that I am controlling the spindle manually and to just look at the input coming from the lathe? Clicking the stop button or the spindle left and right do nothing. Nor do the + and - buttons.

              Brian

              Comment


              • #8
                Originally posted by bhowden View Post
                Ok, M6 worked fine and popped up a dialog box as described. G0 and G1 both work. Where do I find the RPM display? I was assuming on the DRO page but I don't see it. Is that the R: entry on the top right? When I try a G95 I get an error message indicating that the command is invalid with a spindle speed of zero so I think I am getting close to the problem. I do not have any sort of CNC controlled spindle. How do I tell LINUXCNC that I am controlling the spindle manually and to just look at the input coming from the lathe? Clicking the stop button or the spindle left and right do nothing. Nor do the + and - buttons.

                Brian
                No rpm probably because you didn't specify any speed. Try M6 S1000 (1000rpm) WRONG, SEE EDIT !
                Last edited by Sparky_NY; 06-30-2015, 07:53 AM. Reason: Wrong info ! Try M3 S1000

                Comment


                • #9
                  Originally posted by Sparky_NY View Post
                  No rpm probably because you didn't specify any speed. Try M6 S1000 (1000rpm)
                  So I assume that will have linuxcnc thinking I am turning at 1000 rpm. How or where do I read what linuxcnc is getting back from the index and quadrature pulses?

                  Brian

                  Comment


                  • #10
                    Originally posted by bhowden View Post
                    So I assume that will have linuxcnc thinking I am turning at 1000 rpm. How or where do I read what linuxcnc is getting back from the index and quadrature pulses?

                    Brian
                    I made a dumb mistake in the above post. M6 is the toolchange command, nothing at all to do with speed. What I mean't to post was to try M3 S1000 which is spindle on forward and 1000 rpm.

                    As for rpm feedback, the quadrature pulses are not used for rpm readout, only fine feedback info for threading etc. The index is what is used for a rpm display. To get a rpm display it has to be setup in the hal file and a onscreen readout of some sort setup. Did you use stepconf to do your original setup/hal file? If you did there are a couple of checkboxes that will create either a pyvcp or other rpm display box onscreen. A realtime rpm display with index feedback is not needed for operation. On a lathe, the spindle encoder IS needed for threading operations though.

                    Here is some info http://linuxcnc.org/docs/html/hal/pyvcp.html
                    Last edited by Sparky_NY; 06-30-2015, 08:06 AM.

                    Comment


                    • #11
                      It can be challenging to get the spindle speed indication working right in LinuxCNC, that's why I asked about it.

                      Let's see if I can find a pic of the RPM display. Upper right corner.


                      My tach is different than yours -- just a single sensor -- so your setup will be different than mine, and you may need to ask for help on the LinuxCNC forum. I ended up having to add a software debounce to my tach signal to get it to work reliably.

                      Comment


                      • #12
                        Since the tool change and G0 moves work OK in MDI, it sounds like your setup is decent. If you are still having issues with the macros then your best bet is to ask the author of the macros, who I think is Big John.

                        I can't remember what sort of issues I had with the lathe macros, but it seems like the macros assumed certain parameters that were different than my normal operating parameters. LinuxCNC has quite a few initialization settings that are typically customized for a particular machine or particular program, it can be confusing trying to keep them all straight. For that reason I find it easier to write my own programs for frequently used operations like threading.

                        Comment


                        • #13
                          OK, that all makes sense. I have been editing my ini file so am a bit reluctant to re-run stepconfig on my configuration. I ran stepconfig on a new config and found the check boxes you mentioned. Sure enough, I had not seen them. The files generated match the documentation link you provided (I like it when that happens!) Unfortunately it generated half a dozen files so it is going to take me a bit to figure out which bits I need to cut and paste. It might take a couple of days to get back to this but I will report back with what happened.

                          Brian

                          Comment


                          • #14
                            Originally posted by bhowden View Post
                            OK, that all makes sense. I have been editing my ini file so am a bit reluctant to re-run stepconfig on my configuration. I ran stepconfig on a new config and found the check boxes you mentioned. Sure enough, I had not seen them. The files generated match the documentation link you provided (I like it when that happens!) Unfortunately it generated half a dozen files so it is going to take me a bit to figure out which bits I need to cut and paste. It might take a couple of days to get back to this but I will report back with what happened.

                            Brian
                            Sounds like you are well on your way ! Guys like you make guys like me look bad ! My learning was much longer and more painfull.

                            Comment


                            • #15
                              Originally posted by Sparky_NY View Post
                              Sounds like you are well on your way ! Guys like you make guys like me look bad ! My learning was much longer and more painfull.
                              It sure isn't feeling quick right now! I got the spindle speed panel to display and added the hal commands to make the display follow the spindle speed so I am confident all the hardware is correctly connected. I have been assuming that the correct way to move the Z axis at a feed rate tied to the spindle speed is to use G95 so I have been trying variants of:
                              G95 X1 Z+1 F.002 followed by
                              G95 X1 Z-1 F.002 to move it back to where I started.

                              This does move the carriage the direction and distance I would expect but the F parameter and the spindle speed do not have any effect on the speed of the carriage. So I guess my questions for today are:
                              Should I be trying to use G95 or is there a better way to do this?
                              Am I specifying the F parameter correctly? I was hoping my example meant 0.002" per revolution.
                              Do I have to add something to the HAL file to somehow map my spindle speed to something in addition to the spindle speed readout?

                              Again, thanks in advance for all the help and encouragement.

                              Brian

                              Comment

                              Working...
                              X