Announcement

Collapse
No announcement yet.

Getting started with LinuxCNC and a lathe

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

  • bhowden
    replied
    Originally posted by MTNGUN View Post
    As DJC pointed out, G94 and G95 are not movement commands, they are modes.
    Ah, the light goes on! Classic case of trying to fit all available data and advice into a preconceived notion. I did the G95 first as a separate command and then the G1. Now I get something like "Feed not valid with spindle stopped" and was about to start whining again when I remembered the rest of the advice you guys have been trying to give me. I tried again with a M3 S200 command and all is right with the world. The G1 command now works and the feed is proportional to the spindle speed.

    Thanks again for the all the patience and help.

    Brian

    Leave a comment:


  • MTNGUN
    replied
    Update: curiosity got the best of me so I just now fired up a lathe and tried G95.

    Using these steps:
    -- machine activated and spindle spinning
    -- G95
    -- M03
    -- G01 Z# F0.005

    That resulted in the error "Cannot feed with zero spindle speed in feed per rev mode" even though the spindle *WAS* spinning.

    So I tried again with an "S" Command:
    -- G95
    -- M03
    -- S450 G01 Z# F0.005

    And voila' ..... it worked ! And if I used the VFD to change the spindle velocity in mid-cut, the Z velocity would automatically increase or decrease to maintain the feed per rev.

    That doesn't answer all your questions but it should clear up the mystery of G95.

    Leave a comment:


  • MTNGUN
    replied
    Originally posted by bhowden View Post
    I would hope that the feed is calculated using the feed back from the actual spindle speed but then why would you even need the M3 command. Brian
    All I know is that G76 (threading) will not work without first doing an M3 to tell the machine that the spindle is on. This is true even if your spindle on/off is manual rather than controlled by the software.

    G01 works fine now but I am pretty sure that it is supposed to be independent of spindle speed.
    That depends on what mode the machine is in. In G94 mode a G01 should move in inches per minute:
    G94 G01 X# Z# F# ; moves F inches per minute

    In G95 mode G01 is supposed to move in inches per rev:
    G95 G01 X# Z# F# ; moves F inches per rev

    As DJC pointed out, G94 and G95 are not movement commands, they are modes.

    Leave a comment:


  • djc
    replied
    Originally posted by MTNGUN View Post
    ...Here is the documentation for G95, such as it is: G95 Gcode... If it is like G76 (threading), it may need to be told that the spindle is turned on (M3) before it will work.
    I think you are correct here. It is important to understand the difference between modal and non-modal G-codes (see for example http://emc.sourceforge.net/Handbook/node65.html).

    G95 shouldn't move anything in and of itself. Any movement you are seeing is because of a previous G01 in the file, that is still active. G95 just sets up a method (mode) of movement. For G95, the mode is inches per spindle revolution, as opposed to 'normal' movement which is inches per time period. G76 is a special case of G95 where the inches per revolution is additionally coordinated (indexed) with spindle position.

    Think of it in a similar way to the code for coolant; you can G01 with coolant on; you can G01 with coolant off. You cannot and should not cause movement just by turning coolant on or off.

    Leave a comment:


  • bhowden
    replied
    Originally posted by MTNGUN View Post
    Hmmm, I haven't used G95 yet so I may not be able to help with this.

    Well, when in doubt use a G01. If you figure out your G95 let us know how you did it.
    G01 works fine now but I am pretty sure that it is supposed to be independent of spindle speed. All the docs I could find indicate that it is a general purpose move with feed specified in inches (or mm) per minute so it would move at the same speed regardless of spindle speed (which is what it seems to do with my setup) but then so does G95 so clearly I am missing something.

    Perhaps I should be trying something like G76 but that seems more complicated than a straight move. I am also still a bit confused about the difference between the speed set with an M3 command and the actual speed reported by the spindle index sensor. I would hope that the feed is calculated using the feed back from the actual spindle speed but then why would you even need the M3 command.

    Brian

    Leave a comment:


  • MTNGUN
    replied
    Hmmm, I haven't used G95 yet so I may not be able to help with this.

    I presume it would go something like this?:

    G95 G01 X# Z# F0.002

    Here is the documentation for G95, such as it is: G95 Gcode. It doesn't offer much advice other than to mention that "motion.spindle-speed-in" needs to be connected.

    If it is like G76 (threading), it may need to be told that the spindle is turned on (M3) before it will work.

    Also, many of the G95 examples found online include an "S" command. I'm not sure if that is required?

    I searched for "G95" on the LinuxCNC forum and didn't find much. Apparently it is not commonly used.

    Should I be trying to use G95 or is there a better way to do this?
    Well, when in doubt use a G01. If you figure out your G95 let us know how you did it.

    Leave a comment:


  • bhowden
    replied
    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

    Leave a comment:


  • Sparky_NY
    replied
    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.

    Leave a comment:


  • bhowden
    replied
    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

    Leave a comment:


  • MTNGUN
    replied
    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.

    Leave a comment:


  • MTNGUN
    replied
    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.

    Leave a comment:


  • Sparky_NY
    replied
    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, 07:06 AM.

    Leave a comment:


  • bhowden
    replied
    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

    Leave a comment:


  • Sparky_NY
    replied
    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, 06:53 AM. Reason: Wrong info ! Try M3 S1000

    Leave a comment:


  • bhowden
    replied
    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

    Leave a comment:

Working...
X