173
« on: March 29, 2015, 11:27:49 AM »
Hello Chaps-
I am trying to learn gcode - please help
Below is a piece of code that I am practising my coding with
the plan is to bore a hole of 11.5mm out to 14.4 mm
Excuse all the remarks- they are just for my own reference
The feed is set to 0.1 mm per rev
A parameter called #1 contains the current cut size and is incremented each cut
at completion of each cut the tool backs off , moves to z home then back
to the x size that it was before backing out. ( this sets the DRO to
the size of the cut just taken so i can see what the size should be)
the spindle stops and the feed pauses so that i can check the size of the part.
I then press "cycle start" and it caries on again.
Note that feed is set to f0.1 mm per rev
But the feed changes of its own accord ( apparently at random downwards)
so that when i press "cycle start " again the feed is now .01 ??
can any of you tell me why it is doing this??
% filename is :- simple boresinglecut.tap
% program number:- 01001 (program number -put at start of program)
% Program name :- simple boresinglecut.tap
% Program description:- Makes a single cut in the bore according to parms set
% ----------SETUP STRING (INITIALIZATION)------
m05 (stop the spindle)
g18g21g40g49g61G80g95S1200
%g64 (constant velocity mode)
f0.1
g28
#1=11.5 (bore start dia)
m3 (start spindle forwards)
% start position
f0.1 ( feed o.1 mm per rev)
g0 z19 (start to clear front of boring bar)
g0 x#1 (START POSITION)
g0 z0.5 (move z closer)
g01 z-21 (bore to size)
g0 x[#1-0.5]z-20(backs off)
g53g0z0 (use machine coords to go to z home)
m05 (stop spindle)
g0x#1 (put tool back to show size on dro)
m00 (msg,stop and measure)
m3
#1=[#1+0.5] (reset diameter parm)
% start position
f0.1 (feed 0.1 mm per rev)
g0 z19 (start to clear front of boring bar)
g0 x#1 (START POSITION)
g0 z0.5 (move z closer)
g01 z-21 (bore to size)
g0 x[#1-0.5]z-20 (backs off)
m05 (stop spindle)
g53g0z0 (use machine coords to go to z home)
m00 (msg,stop and measure)
m3
#1=[#1+0.5] (reset diameter parm)
g0 z19 (start to clear front of boring bar)
g0 x#1 (START POSITION)
g0 z0.5 (move z closer)
g01 z-21 (bore to size)
g0 x[#1-0.5]z-20 (backs off)
m05 (stop spindle)
g28 (return home)
m00 (msg,stop and measure)
m3
#1=[#1+0.5] (reset diameter parm)
g0 z19 (start to clear front of boring bar)
g0 x#1 (START POSITION)
g0 z0.5 (move z closer)
g01 z-21 (bore to size)
g0 x[#1-0.5]z-20 (backs off)
m05 (stop spindle)
g28 (return home)
m00 (msg,stop and measure)
m3
#1=[#1+0.5] (reset diameter parm)