How to move main spindle specific num. of rotations at a feedrate (Siemens 840D)
Close
Login to Your Account
Likes Likes:  0
Results 1 to 13 of 13
  1. #1
    Join Date
    Dec 2018
    Country
    UNITED STATES
    State/Province
    Michigan
    Posts
    128
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    26

    Default How to move main spindle specific num. of rotations at a feedrate (Siemens 840D)

    My machine has a Siemens 840D controller. Is there a way to do the following?

    I want to spin the main spindle at a slow rate, say about 10 rpm, but only for EXACTLY 5 rotations while having the Z2 axis move in synchronization with that - at a specific feedrate, say 0.050"/rev.

    G95 is feed per revolution mode, so "G95 G1 Z2=-0.25 F0.050" would move Z2 the correct distance per rev of the spindle, but I don't want to just turn the spindle on because I want to command it to rotate exactly 5 revolutions and then stop.

    And now that I think of it, the 5 rotations is what is important, not so much the speed of the spindle...

    I am not sure how to do that. Any ideas?

    -Tom

  2. #2
    Join Date
    Mar 2008
    Location
    vacaville ca
    Posts
    464
    Post Thanks / Like
    Likes (Given)
    62
    Likes (Received)
    127

    Default

    spos[1]=0
    g91
    g1 c360 f.2
    g1 c360 f.2
    g1 c360 f.2
    g1 c360 f.2
    g1 c360 f.2

    something like this

    and for the z2 look in trailon or coupde. there's sections in the manual about motion couplings.

  3. #3
    Join Date
    Dec 2018
    Country
    UNITED STATES
    State/Province
    Michigan
    Posts
    128
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    26

    Default

    I should have known you would reply :-)

    Ah, I didn't realize I could command spindle positioning at a feed rate, cool.

    Coupdef appears to be only for spindles. I want the main to spin, sub to be fixed. Looks like TRAILON may be what I want though! I hadn't seen that in the manual before. Need to figure out how to set the coupling factor since one is rotation and the other is in/rev...

    Thanks, once again!

    -Tom

  4. #4
    Join Date
    Mar 2008
    Location
    vacaville ca
    Posts
    464
    Post Thanks / Like
    Likes (Given)
    62
    Likes (Received)
    127

    Default

    not sure if this will work but try

    spos[1]=0
    g91
    g1 c1 360 f.2 z2=-.5

    and see if the z2 interpolates with the c movement

    if for some reason the control doesn't like the 360
    just break it into 180's

  5. #5
    Join Date
    Dec 2018
    Country
    UNITED STATES
    State/Province
    Michigan
    Posts
    128
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    26

    Default

    Actually, even G1 C360 F0.2 fails. It says: "10862 Channel 1 block master spindle is axis of path".

    I tried SETMS(2) above this and the program runs and doesn't fault but nothing moves...


    Quote Originally Posted by pcasanova View Post
    not sure if this will work but try

    spos[1]=0
    g91
    g1 c1 360 f.2 z2=-.5

    and see if the z2 interpolates with the c movement

    if for some reason the control doesn't like the 360
    just break it into 180's

  6. #6
    Join Date
    Dec 2018
    Country
    UNITED STATES
    State/Province
    Michigan
    Posts
    128
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    26

    Default

    Phil,
    This moves the correct Z2 distance for number of spindle movements that I need but I don’t have control over how fast the spindle turns. It isn’t particularly fast so it may work for my purposes but would be better if I could control the speed.

    TRAILON(Z2,C,-0.0543)
    SPOS[1]=0
    G91
    C360
    C360
    C360
    C360
    C360
    TRAILOF(Z2,C)

    -Tom

  7. #7
    Join Date
    Mar 2008
    Location
    vacaville ca
    Posts
    464
    Post Thanks / Like
    Likes (Given)
    62
    Likes (Received)
    127

    Default

    I'm thinking thats not all the code, are you setting a g94? and if there's a g1 and no f set it will look at the last f that was set. I don't think it will go program to program but if you had a previous tool with a feedrate it will use that. like the drilling cycle, there's no feed withing the cycle so you add it to the rapid move. so the cycle will pick it up.

  8. #8
    Join Date
    Dec 2018
    Country
    UNITED STATES
    State/Province
    Michigan
    Posts
    128
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    26

    Default

    Quote Originally Posted by pcasanova View Post
    I'm thinking thats not all the code, are you setting a g94? and if there's a g1 and no f set it will look at the last f that was set. I don't think it will go program to program but if you had a previous tool with a feedrate it will use that. like the drilling cycle, there's no feed withing the cycle so you add it to the rapid move. so the cycle will pick it up.
    You are right. This allows me to control spindle speed.


    TRAILON(Z2,C,-0.0543)
    SPOS[1]=0
    G94 F2000 (feed must be in radians or degrees per min or something)
    G1 C0
    G91
    C360
    C360
    C360
    C360
    C360
    TRAILOF(Z2,C)

    Thanks,
    -Tom

  9. #9
    Join Date
    Dec 2018
    Country
    UNITED STATES
    State/Province
    Michigan
    Posts
    128
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    26

    Default

    Quote Originally Posted by tome9999 View Post
    TRAILON(Z2,C,-0.0543)
    SPOS[1]=0
    G94 F2000 (feed must be in radians or degrees per min or something)
    G1 C0
    G91
    C360
    C360
    C360
    C360
    C360
    TRAILOF(Z2,C)
    So it turns out this code is alarming on the last C360 command before the TRAILOF. It says “Z2 on soft limit switch”. It is no where near the limit so I am not sure what is going on...

  10. #10
    Join Date
    Mar 2008
    Location
    vacaville ca
    Posts
    464
    Post Thanks / Like
    Likes (Given)
    62
    Likes (Received)
    127

    Default

    is there any d numbers set? and are you bringing rhe z2 into a position before you start?

  11. #11
    Join Date
    Dec 2018
    Country
    UNITED STATES
    State/Province
    Michigan
    Posts
    128
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    26

    Default

    Quote Originally Posted by pcasanova View Post
    is there any d numbers set? and are you bringing rhe z2 into a position before you start?
    No d numbers as this is a test program so no tool loaded. I am sending Z2 to its home at 29.6110 at program start and it moves forward (towards main spindle) from there 0.355” on the 5th revolution. When the fault appears Z2 is at 29.256 (29.6110 - 0.355)...

  12. #12
    Join Date
    Mar 2008
    Location
    vacaville ca
    Posts
    464
    Post Thanks / Like
    Likes (Given)
    62
    Likes (Received)
    127

    Default

    try moving
    g0 g53 d0 z2=28

    then start your code and see if it still alarms

  13. #13
    Join Date
    Dec 2018
    Country
    UNITED STATES
    State/Province
    Michigan
    Posts
    128
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    26

    Default

    Quote Originally Posted by pcasanova View Post
    try moving
    g0 g53 d0 z2=28

    then start your code and see if it still alarms
    That worked AND revealed a typo that was causing Z2 to move in the wrong direction. DUH.
    Thanks,
    -Tom


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •