Welcome, Guest. Please login or register.
Did you miss your activation email?
April 20, 2014, 09:00:57 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Support
| |-+  Downloads
| | |-+  MACH TOOL BOX
| | | |-+  Macro, Drilling, Bolt circle with MANUAL quill and spindle
Pages: 1   Go Down
Print
Author Topic: Macro, Drilling, Bolt circle with MANUAL quill and spindle  (Read 5908 times)
0 Members and 1 Guest are viewing this topic.
vmax549
Guest
« on: March 28, 2009, 09:27:13 PM »

Here is a macro to drill Bolt circles using a MANUAL quill and spindle. It will hold at each drill point and let you drill the hole then hit OK and it will move to the next location  and so on.

To use Move to the CENTER POINT of the bolt circle and call the macro and program the Arguments

NOTE: We are using Macro arguments directly into the macro with the PQR (;-)

IE: M2224 P4 Q0 R4      ( moves to 4 locations starting at 3 oclock at a 4" radius from the centerpoint stops anmd waits for you to drill then you click on OK to continue)

Argument assignments

P= Number of Holes
Q= Starting angle (0=3 oclock)
R= Radius of Bolt CIrcle



CODE EXAMPLE:


'Macro M2224  Bolt circle Drill Manual Quill/SPindle
Sub main
Dim P101 As Integer
Dim P11 As Integer

' M2224 Pxx Qxx Rxx
' R = Radius of Bolt Circle
' Q = Starting Angle (0= 3oclock -- Neg = CW)
' P = Number of HOLES
SetVAR(24,Getdro(1))
Setvar(25,Getdro(2))
Setvar(11, Param1())
SetVar(1, Param2())
SetVar(18, Param3())

Code" #101=0 (Initialize counter)"
Code" #102=#1 (Initialize current angle To A)"
Code" #103=[360 / #11] (Constant For incremental angular distance between holes)"
Code" G0 Z#104 X#24 Y#25"
N1:
Code" #110=[#24 + COS[#102] * #18] (Calculate X position for current hole based on current angle)"
Code" #111=[#25 + SIN[#102] * #18] (Calculate Y position for current hole based on current angle)"
Code" G0 X#110 Y#111 (Machine current hole)"
MsgBox "Drill HOLE    " &" Then Press OK to continue"
Code" #101=[#101 + 1] (Step counter)"
Code" #102=[#102 + #103] (Step current angle)"
P101= GetVAR(101)
P11= GetVAR(11)
While Ismoving()
Wend
If P101 <= (P11-1) Then GoTo n1 Else GoTo N99
N99:
Code" G0 Z#104 X#24 Y#25"
Code "M30"
End Sub

* m2224.m1s (1.05 KB - downloaded 260 times.)
« Last Edit: March 28, 2009, 09:29:42 PM by vmax549 » Logged
Overloaded
Global Moderator
*
Offline Offline

Posts: 3,901



View Profile
« Reply #1 on: March 28, 2009, 10:20:15 PM »

Now THAT is just slicker n' snot on a doorknob.
Just ran it in simulation...If I had Z set up on the knee I'd be using the heck out of this.
Thanks Mr. Parker,
RC
Logged

"I haven't failed. I've just found 10,000 ways that won't work."         Edison

"You cannot help men permanently by doing for them what they could and should do for themselves."
Abe Lincoln
vmax549
Guest
« Reply #2 on: March 29, 2009, 01:49:51 PM »

RC I work for a living like everyone else( not a MR or a SIR) 

 MOST just call me TP(;-)

(;-) TP
Logged
Overloaded
Global Moderator
*
Offline Offline

Posts: 3,901



View Profile
« Reply #3 on: March 29, 2009, 02:07:44 PM »

Thanks TP......keep up the good work.
RC
Logged

"I haven't failed. I've just found 10,000 ways that won't work."         Edison

"You cannot help men permanently by doing for them what they could and should do for themselves."
Abe Lincoln
Greolt
Global Moderator
*
Offline Offline

Posts: 917


View Profile
« Reply #4 on: March 29, 2009, 05:21:19 PM »

I have edited this post so as not to clutter up TP's excellent thread.

This is my attempt to alter TP's code to have it ask for the parameters.

I have blatantly used TP's other threads as a guide.

The good parts are all TP's.  The not so good bits are mine.  Grin Grin

This is simply a learning exercise for me. 

Thanks again for your efforts TP. 



'Macro M2224  Bolt circle Drill Manual Quill/SPindle
Sub main
Dim P101 As Integer
Dim P11 As Integer

Begin Dialog DiaLogName1 60,60,80,150, "Drill Circle"

TEXT 10,10,100,10, " Number of Holes"
TEXT 10,40,100,10, "Bolt Circle Radius"
TEXT 19,70,100,10, "Start Angle"
TEXT 18,82,100,10, "0 = 3 oclock"
TEXT 15,94,100,10, "CCW   0 - 360"

TEXTBOX 20,22,35,10, .Nholes
TEXTBOX 20,52,35,10, .RadBC
TEXTBOX 20,106,35,10, .Sangle

OKBUTTON 20,130,35,12
End Dialog

Dim Dlg1 As DialogName1
Dialog Dlg1
 
SetVAR(24,Getdro(1))
Setvar(25,Getdro(2))
Setvar(11, Dlg1.Nholes)
SetVar(1, Dlg1.Sangle)
SetVar(18, Dlg1.RadBC)

Code" #101=0 (Initialize counter)"
Code" #102=#1 (Initialize current angle To A)"
Code" #103=[360 / #11] (Constant For incremental angular distance between holes)"
Code" G0 Z#104 X#24 Y#25"
N1:
Code" #110=[#24 + COS[#102] * #18] (Calculate X position for current hole based on current angle)"
Code" #111=[#25 + SIN[#102] * #18] (Calculate Y position for current hole based on current angle)"
Code" G0 X#110 Y#111 (Machine current hole)"
MsgBox "Drill HOLE    " &" Then Press OK to continue"
Code" #101=[#101 + 1] (Step counter)"
Code" #102=[#102 + #103] (Step current angle)"
P101= GetVAR(101)
P11= GetVAR(11)
While Ismoving()
Wend
If P101 <= (P11-1) Then GoTo n1 Else GoTo N99
N99:
Code" G0 Z#104 X#24 Y#25"
Code "M30"
End Sub




« Last Edit: March 29, 2009, 06:52:04 PM by Greolt » Logged
Greolt
Global Moderator
*
Offline Offline

Posts: 917


View Profile
« Reply #5 on: March 29, 2009, 05:33:02 PM »

I see TP has posted an example of how to do it with a single text box on the other bolt hole circle thread.

I have edited the above post so as not to clutter this thread.

Greg


PS:  How do I have it enter a default value for a text box?  EG, zero for angle.
« Last Edit: March 29, 2009, 06:19:20 PM by Greolt » Logged
TDAY
Active Member

Offline Offline

Posts: 125



View Profile WWW
« Reply #6 on: July 31, 2009, 11:34:47 AM »

Hello all,
Just found out about this toolbax and the use of these macros.
I put the edited code into a button and this is VERY nice!
Was wondering if there is a way to maybe...."edit" this macro and others, and have it post a Gcode somewhere?
Or maybe a way to save what you entered before. So when you push the macro button and window pops up, everything you entered before would be there.
Thanks again TP for telling me about this. Smiley
Troy
« Last Edit: July 31, 2009, 12:16:56 PM by TDAY » Logged

"I try to put forth the effort,before asking a dum question"
http://homecncstuff.elementfx.com
vmax549
Guest
« Reply #7 on: July 31, 2009, 10:14:10 PM »

Troy the beuaty of Macros are they do not need to generate a separate Gcode file THEY are the gcode files with vars to define the function changes needed.

Yes you can store the variables MACH HAS A SECTION OF var #500-600 THAT ARE PERSISTANT and will stay put after mach shuts down. So it is possible.

AS to your idea, (;-)  Yes it can be done. Can you explain how you would use it?
Logged
TDAY
Active Member

Offline Offline

Posts: 125



View Profile WWW
« Reply #8 on: August 11, 2009, 06:54:01 AM »

Sorry, for just now responding but i didnt receive a email notifier,got it set to do it.
Anyhow,the reason to generate and store a Gcode, so if i have a small production run i dont have to re-enter the macro for every part.
Troy
Logged

"I try to put forth the effort,before asking a dum question"
http://homecncstuff.elementfx.com
darlly01
Active Member

Offline Offline

Posts: 26


View Profile
« Reply #9 on: September 11, 2012, 02:03:04 PM »

Hi to all,
this forum has a lot of experts. I'm new and getting all information to keep going with my projects. I need a help to do a Macro.
I found a macro to run a Powerpoint slides. It is working fine. It execute the slide show perfectly.
This is what I want to do: Computer showing the slides and when cylcle start button is pressed the slide show stop and the gcode is executed, when finish the gcode it start the slide show again. Please any help will be very great. thanks
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!