Hello Guest it is August 06, 2020, 03:46:48 PM

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

0 Members and 1 Guest are viewing this topic.

Re: VB or Brains Question
« Reply #20 on: August 13, 2010, 02:30:17 PM »
They are all the same depth and feedrate.

We just make a layout program with a small bit first, then the operator changes the depth and feedrate for the drilling.

So one program will have only one G81 line followed by over 1000 X and Y position lines

Offline BR549

*
  •  6,932 6,932
    • View Profile
Re: VB or Brains Question
« Reply #21 on: August 13, 2010, 02:42:52 PM »
OK here is another way that is very close. This way the param values remain modal until you change them . You just have to add the M81 to each drill point.

HUM, BUT there is a "BUG" in MACH that prevents us from using this approach. When Mach see the empty Q parameter call it should call "null" BUT instead it calls  -1.  The P and R work as they are suppose to.     THat puts a monkey wrench in the works, Close but no cigar again.

G0X0Y0
M81 X1.000 Y1.000 P-1.000 Q0.010 R.500 F5 S1000
M81 X2.000 Y2.000
M81 X3.000 Y3.000
M81 X4.000 Y4.000
M81 X5.000 Y5.000 P-1.5
M81 X6.000 Y6.000 Q.1 R1.000 F4 S500
M81 X7.000 Y7.000
M81 X8.000 Y8.000


The Mcode M81 code is this:

'M81 , Macro for G81 function
SetVar(300,(Param1))
Sleep(10)
Setvar(301,(Param2))
Sleep(10)
SetVar(302,(Param3))
Sleep(10)

ActivateSignal(output3)
Sleep(1000)
Code"G0 Z#301"
While Ismoving()
Sleep(20)
Wend
Code"G1 Z#300"
While Ismoving
Sleep(20)
Wend
Code"G0 Z#302"
While Ismoving
Sleep(20)
Wend
DeactivateSignal(output3)
Sleep(1000)
End         
Re: VB or Brains Question
« Reply #22 on: August 13, 2010, 04:52:58 PM »
Hmmm, what about a M code that sets a flag or led that a brain could see and when set the brain would activate the clamps if the Z is moving in the down direction and deactivates if it is moving in the up direction.

I havent looked at the brains that much so I don't know if it can look for direction changes or not.

Offline BR549

*
  •  6,932 6,932
    • View Profile
Re: VB or Brains Question
« Reply #23 on: August 13, 2010, 06:02:20 PM »
I think we may be able to do some along that line we will have to built a routine modual that can TELL if the axis is moving down or UP or is not moving .

I'll take a look.

Offline BR549

*
  •  6,932 6,932
    • View Profile
Re: VB or Brains Question
« Reply #24 on: August 13, 2010, 07:46:32 PM »
IF we look at a Userled as a trigger and Zfeedrate as a trigger

Then look at  Zposition(a)  &  Zposition(b)   and

IF (Userled>0 )  AND  (Zfeedrate>0)   AND  (Zposition (a) > Zposition(b))    then  ActivateSignal(output3)

That should work as a brain to trigger the BedLock anytime all the conditions are met.

You would just need to turn on the UserLED by a Mcode  just before the G81 cycle.

Then if the led is on and the Zfeedrate shows movement AND the Positions show it is going DOWN then it turns ON the Bedlock. Otherwise the Bedlock is OFF



« Last Edit: August 13, 2010, 07:50:25 PM by BR549 »
Re: VB or Brains Question
« Reply #25 on: August 13, 2010, 08:18:31 PM »
So would I need to run that as a brain or as a pump script?

Offline BR549

*
  •  6,932 6,932
    • View Profile
Re: VB or Brains Question
« Reply #26 on: August 13, 2010, 10:17:06 PM »
I am testing it as a brain (;-) I will let you know if it works.

A vb script would be way too slow to sense the changes
Re: VB or Brains Question
« Reply #27 on: August 13, 2010, 10:37:16 PM »
Right on, thanks a lot for all the help.

Now if only single block worked with a canned drill cycle I would be all set  :)

Offline BR549

*
  •  6,932 6,932
    • View Profile
Re: VB or Brains Question
« Reply #28 on: August 13, 2010, 11:50:25 PM »
Single block does work with a canned cycle, But you have to turn it ON before the cycle starts. Mach runs a buffer system and you cannot undo the loaded buffer to be able to single block after the buffer has already loaded.

Re: VB or Brains Question
« Reply #29 on: August 14, 2010, 11:38:26 AM »
All the operators here are used to using single block to pause after the current hole to go for break.
It works well with our DOS and Fanuc controllers.

But when I test this with mach is will pause the hole, but then when you resume with a cycle start, it will just use the drilling feed rate to position to the next hole and not drill it. And then continues with this positioning and not drilling.