Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Fred_evans on November 27, 2019, 09:28:32 AM

Title: spindle speed doesnt reset (mach 3)
Post by: Fred_evans on November 27, 2019, 09:28:32 AM
Hello Everyone
I am trying out different tools with speeds and feeds to see the difference
in cutting
I have written the attached bit of code but wheb I run the code when
it hits the block M3 the speed runs away up to maximum speed (1700rpm)
Would some-one please look at the sample of code attached and tell me why it should be doing this?
( sorry i am battling to get the code to attach)
Title: Re: spindle speed doesnt reset (mach 3)
Post by: Fred_evans on November 27, 2019, 09:33:47 AM
Hello Everyone
I am trying out different tools with speeds and feeds to see the difference
in cutting
I have written the attached bit of code but wheb I run the code when
it hits the block M3 the speed runs away up to maximum speed (1700rpm)
Would some-one please look at the sample of code attached and tell me why it should be doing this?
( sorry i am battling to get the code to attach so am doing a copy paste)


% prepare
% take one cut along the diameter
G18 (xz plane)
G40 (cancel nose radius compensation)
G49 ( cancel tool offset -like at a tool change)
G80 (cancel all canned cycles)
G90 (absolute distance mode)
G95 (move in units per rev)
G80 (cancel canned cycles)
s300    (motor speed set to 300rpm)
f0.1   (cutting feed is .1mm per rev)
m03     (start motor forward)
g0 x58
g0 z5
% first cut
f0.1
g0 z1
g0 x58
g01 z-15
g0 x60
g0 z1
M30 ( end of program return to program top -same as m02)


Title: Re: spindle speed doesnt reset (mach 3)
Post by: Graham Waterworth on November 28, 2019, 09:59:53 AM
For a start the only place you should have % is the first and last line of your code.

Lathe has 2 spindle modes G97 constant speed and G96 constant surface speed.

In your code you have not told it which you want so it may be in G96 by default so as the diameter reduces the speed rises.

so I would try G97 Snnn M3 and see if that helps.

Title: Re: spindle speed doesnt reset (mach 3)
Post by: Fred_evans on November 29, 2019, 07:06:59 AM
Thanks Graham for your response- I will play this out on monday when I am back at the machine

regards
fred