What's new
What's new

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

tome9999

Aluminum
Joined
Dec 7, 2018
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
 
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.
 
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
 
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
 
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...


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
 
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
 
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.
 
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
 
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...
 
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)...
 








 
Back
Top