Hello Guest it is July 08, 2020, 07:53:08 AM

Author Topic: VB or Brains Question  (Read 13893 times)

0 Members and 1 Guest are viewing this topic.

Offline Hood

*
  •  25,846 25,846
  • Carnoustie, Scotland
    • View Profile
Re: VB or Brains Question
« Reply #10 on: August 12, 2010, 06:52:51 PM »
A few of the canned cycles are visible macros, G76 (m1076.m1s) and G83 (m1083.m1s) for example but I cant seem to locate the G81 so it may be coded internally into Mach.
 Suppose if you were good at VB (I am crap) you could write your own drill cycle macro with the clamp releases etc and just call it from your code.

Hood
Re: VB or Brains Question
« Reply #11 on: August 12, 2010, 07:37:51 PM »
Is it possible to make a G79 for example by making a m1079.m1s file?

Offline Hood

*
  •  25,846 25,846
  • Carnoustie, Scotland
    • View Profile
Re: VB or Brains Question
« Reply #12 on: August 12, 2010, 07:48:03 PM »
Afraid I dont know, I would imagine it would have to be linked to internally in Mach.
You should be able to do it by calling a m code instead of a G but that would likely require you to  have DROs to enter the data into similar to the wizard screens. Making a wizard may be another option but again my VB is crap so you would need help from others for that unless yours is good. I muddle through for the things I want but it takes me a long time of trial and error for anything thats more than basic.

Maybe Terry (BR549) will have other ideas or be able to advise on VB.

Hood

Offline BR549

*
  •  6,932 6,932
    • View Profile
Re: VB or Brains Question
« Reply #13 on: August 12, 2010, 09:24:47 PM »
What you would have to do is program a macro that does an actual drill cycle LIKE the G81 but it would include a clamp/unclamp function as part of the routine. You woul d also have to use Variables to be able to preset your hole locations. Then you could call the macro with Vars and have what you want .

You can also do the same thing using Gcode SUBS.

Each have their pitfalls and good points.

THAT is why I asked what is so important about being able to clamp/unclamp midcycle. I still don't understand the need to do that.

If you really have a need to do it we can help you work it out. BUT if you are doing it just because it seems cool to do so then I can point you to the resourses and answer questions as they come up.

Just a thought, (;-)
Re: VB or Brains Question
« Reply #14 on: August 12, 2010, 11:26:38 PM »
It is a feature that is critical to getting the machine working right.

The reason why it must be done mid cycle it to allow the machine to move to the next position.
The clamps are small hydraulic rams that hold the machine in position so that it won't move with vibration since it rides on a gear rack.

Here is the newer version of the machine
http://www.quickmill.com/products.php?show=machine&machine=8&nav=drilling

Offline BR549

*
  •  6,932 6,932
    • View Profile
Re: VB or Brains Question
« Reply #15 on: August 13, 2010, 10:57:33 AM »
OK the easy way (programmer,operator and machine) is to use Gcode and Mcodes that way it is easy to CAM the project and let the post write all the code.

G0 X1 Y1 (move to drill point)
M1001 (Lock Bed)
G81 X1.000 Y1.000  Z-1.000 R.5 F5  (drill Cycle)
G80 (cancell cycle)
M1002 (Unlock Bed)
G0 X2.000 Y2.000 (move to new drill point)
M1001 (Lock Bed)
G81 X2.000 Y2.000 Z-1.000 F5 (drill cycle )
G80 ( cancell cycle)
M1002 (Unlock Bed)
G0 X3.000 Y3.000 ( Move to new drill point)
M1001 (Lock Bed)
G81 X3.000 Y3.000 Z-1.000 F5 (drill cycle)
G80 Cancell cycle)
M1002 (Unlock Bed)
G0 X0.000 Y0.000  Move to new drill cycle )
etc
etc
etc

The mcodes code would look like this

'M1001 , Macro to lock bed
Activate(output3)


'M1002 , Macro to unlock bed
Deactivate(output3)

Output 3 would be wired to the bed lock controller


DOES that suite your needs or do you require something more. From here on out it gets more complicated for the Programmer/operator/machine

« Last Edit: August 13, 2010, 11:07:31 AM by BR549 »

Offline BR549

*
  •  6,932 6,932
    • View Profile
Re: VB or Brains Question
« Reply #16 on: August 13, 2010, 12:09:15 PM »
NOW another way is to use a Mcode to do the entire drill cycle including the lock unlock as one cycle. In this function we use 3 param calls from the macro to set things such as Zdepth Ztop and Retract height and Feedrate. In the example we use P= Zdepth Q= Ztop R= retract height and F=feedrate

THis IS a little simplier as you do NOT have to cancel the cycle before you move to the next location BUT you will have to modify the Cam post to use the Mcode in lou of the G81cycle


G0 X1.000 Y1.000
M2001 P-1.000 Q0.010 R.555 F5
G0 X2.000 Y2.000
M2001 P-1.100 Q0.010 R.555 F10
G0 X0.000 Y0.000


The Mcode code is this:

'M2001 , macro for G81 drill cycle
ActivateSignal(output3)
Sleep(1000)
Code"G0 Z" & (param2)
While Ismoving()
Sleep(10)
Wend
Code"G1 Z" & (param1)
While Ismoving
Sleep(10)
Wend
Code"G0 Z" & (Param3)
While Ismoving
Sleep(10)
Wend
DeactivateSignal(output3)
Sleep(1000)
End    
« Last Edit: August 13, 2010, 12:13:20 PM by BR549 »

Offline BR549

*
  •  6,932 6,932
    • View Profile
Re: VB or Brains Question
« Reply #17 on: August 13, 2010, 12:27:45 PM »
(;-) A little more testing shows we can combine a few things and make it better.

The mcode process (m2001) allows the positional date to process first( g0 x1 y1) then the Mcode runs such as

M2001 X1.000 Y1.000 P-1.000 Q.010 R.500 F20  S1000    (moves to the drill point FIRST then preceeds with the drill cycle)
M2001 X2.000 Y2.000 P-1.500 Q.010 R1.000 F5  S500

This simplifies the Gcode program a bit and still allows a self contained Drill cycle WITH lock and unlock as you need.

Re: VB or Brains Question
« Reply #18 on: August 13, 2010, 12:29:02 PM »
Is it possible to make the M code work like a canned cycle so that it is only called once?

I make the NC files and do the cam so its not a problem for me, but the operators are used to seeing it as a starting drill code then just X and Y positions.
And they change the feed and depth often, so having to change it for every liine wouldnt work.

Some programs drill 4000 holes for one job.

Offline BR549

*
  •  6,932 6,932
    • View Profile
Re: VB or Brains Question
« Reply #19 on: August 13, 2010, 01:44:16 PM »
Are all the holes in one program the same depth,feed retract etc ?? If so there is an easy way  Or if there are groups of the same do you group them as such?