Slot program built with old macro bolt hole program.

Share and discuss macro programs here

Slot program built with old macro bolt hole program.

Postby Daniel T. » Sat May 03, 2008 8:29 pm

Hey all,
Names Daniel, And I'm one of Scotts biggest fans :). I wanted to say that if there's anyone using the Eagle controllers, or most of the newer fanuc controllers that support macro B, Will have no problem using NcPlot for there Macro solutions. Before I was introduced to NcPlot, I knew very little about programming macros, and everything I done was with regular G codes format. As you know, standard G codes have there limitations on what you can, and can't do. That's where Macros come in at.

I run a large Horizontal boring mill at work that has an eagle controller on it that Scott has just recently done a retro on (You Rock Scott!!!). It runs windows so I can use NcPlot on it while I'm waiting on long runs to complete. So to keep from falling a sleep while the process is running, I proceed to expand my knowledge with macros so I don't loose my job (hehe). Any hoot, I've had this macro bolt hole pattern macro that I use allot for drilling and tapping bolt holes. And I was Wondering if I could create a slot program to produce slots within the angles that the bolt macro created. I was told by one of my machinist buddies at work that has been doing this stuff way longer than I have, that it can't be done. I was determine to prove him wrong.

I almost gave up cause of all the incremental moves that was involved in doing it. To create a slot on a angle is pretty complicated in incremental moves. especially from a circle center, Which I might add is incrementally produced also. So that means, not only can I create slots on a radius evenly spaced, But I can also leave the X Y zero co ordinance at the original position, and force my slots to be manipulated at any x y co ordinance on the part being machined. I'm all about working on a baseline (hehe again). To create the slot, I had to produce an incremental point to a variable for each point I wanted to move to. Once the variables were set for those points, I moved to them points in absolute to produce the slot. while maintaining my original angle for each slot.

I personally do not have any use for this type of program, and I have decided to share it with the NcPlot community, In case someone out there might have a good use for this program. Not to mention how well it shows off NcPlots simulation capabilities. It's endless what you can do with this program. you can control the amount, the length, the width, the starting angle, the space of the angled slots, the dept, how many steps to finish dept of each slot. You can also add tool diameter, and the program makes up the difference on the slot so no tool compensation is required.

I am in no means an expert at macros, and there's probably an easier way to do this. for those who recognize that, please do share your input with me. All comments are welcome. For me, this is a big accomplishment in learning Macros. but no where near what I know this format is capable of doing. And please excuse my typing errors and such. I'm a machinist, not a journalist (hehe)..

here is a pic of the sim from NcPlot
http://www.freewebs.com/wdtr62/slots.jpg

heres the program. Just copy and paste to NcPlot

O63(BOLTHOLESLOTTEST )
G90
M3S200

(SLOT_WIDTH)
#130=1.0
(TOOL_DIAMETER)
#131=.625
(ANGLE_FOR_SLOT_POINTS)
#132=90

(DO_NOT_INCLUDE_RADIUS_ON_SLOT_LENGTH)
(SUBTRACT_THE_RADIUS_FROM_SLOTS)
(SLOTS_ARE_CREATED_FROM_CENTER_OF_CIRCLE)

(SLOT_START_RADIUS_POINT)
#4=5.118
(SLOT_LENGTH_IN_RADIUS)
#8=7.118

(LOCATE_X_AND_Y_ANYWHERE_FROM_X_Y_COORD)
(X_STARTING_POINT)
#24=0
(Y_STARTING_POINT)
#25=7.874

(Z_CLEARANCE_POINT)
#27=3.0

(Z=DEPTOFHOLE)
#26=.520
(RETURN_POINT)
#18=.1

(PLUNGE_FEED)
#10=#9/2
(FEEDRATE)
#9=1.2
(DEPT_STEPS)
#17=.1

(A=START_ANGLE)
#1=0
(B=INC_ANGLE+/-)
#2=45
(NUMBERS_OF_SLOTS)
#11=8

(SET_SLOT_WIDTH_FOR_TOOL_OFFSET)
#130=#130/2-#131/2

G0Z#27
G0X#24Y#25
GOTO5

N20
(CREATE_SLOT)
G91
#150=#5+#130*SIN[#1+#132]
#151=#6+#130*COS[#1+#132]
#152=#12+#130*SIN[#1+#132]
#153=#13+#130*COS[#1+#132]
#154=#5+#130*SIN[#1-#132]
#155=#6+#130*COS[#1-#132]
#156=#12+#130*SIN[#1-#132]
#157=#13+#130*COS[#1-#132]
G90
#16=#17
WHILE[#16LT#26]DO2
G0X#5Y#6
G1Z-#16F#10
G1X#150Y#151F#9
X#152Y#153
G3X#156Y#157R#130
G1X#154Y#155
G3X#150Y#151R#130
G1X#5Y#6
G0Z#18
#16=#16+#17
END2
G0X#5Y#6
G1Z-#26
G1X#150Y#151F#9
X#152Y#153
G3X#156Y#157R#130
G1X#154Y#155
G3X#150Y#151R#130
G1X#5Y#6
G0Z#18
GOTO3

N5
(MACRO)
#7=1
G91
WHILE[#11GT0]DO1
#5=#24+#4*SIN[#1]
#6=#25+#4*COS[#1]
#12=#24+#8*SIN[#1]
#13=#25+#8*COS[#1]
G90X#5Y#6
G0Z#18
GOTO20
N3
G0Z#27
#1=#1+#2
#11=#11-1
END1
G0Z#27
M30
Daniel T.
 
Posts: 1
Joined: Mon Jan 28, 2008 11:22 pm

Postby RichardF » Sun May 04, 2008 6:25 am

Well done Daniel.

So to keep from falling a sleep while the process is running, I proceed to expand my knowledge with macros


I have sometimes the same 'problem'. Since my machine at work has a Heidenhain TNC430 control which has those slot-macros onboard I actually don't need macro programming knowledge but its a good way of learning g-code programming.
With NCPLOT I can even simulate 4-axis-programs form the Heidenhain-control ( after some changes of course) but this is great software and I like it.

Thanks for sharing your macro with us

Richard
RichardF
 
Posts: 24
Joined: Thu Dec 14, 2006 1:53 pm
Location: Bavaria, Germany


Return to Macros

Who is online

Users browsing this forum: No registered users and 1 guest

cron