PDA

View Full Version : Drill Offsets



nat_wheatley
05-08-2010, 09:53 AM
I'm trying to set the X and Y offsets for my 2 drills using the 'TS' command, which then uses the 'S_Center_inHole' file.

I've changed my drill plunge outputs from the original settings, so I've gone into the 'S_Center_inHole' file and changed the output in there to match. The problem is that when I run the file, in the software the output gets changed back to what it originally was. Not sure why my changes to the file aren't sticking. I can save and reopen the file, and the change is there, but when I un the file, it reverts.

nat_wheatley
05-08-2010, 11:23 AM
Here's the file. On the 'SO' commands, I change the 5's to a 7's, then save, but when I run the file it changes the 7's back to 5's:


'Initialize Variables
&Z_test_depth = -.130 / 2 'This is test depth that will be used when we've set Z height accurately
&start_X = %(1)
&start_Y = %(2)
&start_Z = %(3)
&startspeed_XY = %(71)
&startspeed_Z = %(73)
'Initialize some other variables that will be used
&leftstart = 0
&rightstart = 0
&bottomstart = 0
&topstart = 0
&Z_top_surface = 0

'Is slide valve off for drill number1(Up Position)?
Pause

SO,5,1 'Lower Drill

'You move the tip of
'You will need to move the tip of Drill #1 into the centering hole
Pause
MSGBOX ( Do you want to open the keypad? Press Esc when Done, YesNo, Start Keypad?)
IF &MSGANSWER = YES then GOSUB SHOWKEYPAD


MSGBOX ( Is the tip of the drill rod in the hole of the plate?, YesNo, Start Keypad?)
IF &MSGANSWER = NO then GOSUB SHOWKEYPAD



&start_X = %(1)
&start_Y = %(2)
&start_Z = %(3)

'Set up Speeds, etc
VS, .4, .4


'Do Centering
GOSUB Center_in_XY

'Clean Up
VS, &startspeed_XY, &startspeed_Z
MZ, 4
'X/Y Location Currently Displayed is Center of Hole
PAUSE
'We are done with Drill #1 and will find Next center
PAUSE
&xval = %(1)
&yval =%(2)
&setup_units = %(25)

&outname = C:\SbParts\Custom\xy_Offsets.tmp
OPEN &outname FOR OUTPUT AS #1
WRITE #1, &xval
WRITE #1, &yval
WRITE #1, &setup_units
close #1

SO,5,0 'Lower Drill



END


'----------------------------------------------------------------------SUBS

Center_in_XY:

'Move left and right to get end points of a chord; X center-point is at 1/2 this distance
If %(51) = 1 THEN GOTO ClosedExit
On Input(1,1) GOTO HitLeft
MX, &start_X - 2
GOTO FailedExit
HitLeft:
On Input(1,1)
&leftstart = %(1)
MX, &start_X
If %(51) = 1 THEN GOTO ClosedExit
On Input(1,1) GOTO HitRight
MX, &start_X + 2
GOTO FailedExit
HitRight:
On Input(1,1)
&rightstart = %(1)
MX, &start_X
&center_X = &leftstart + ((&rightstart - &leftstart) / 2)
MX, &center_X

'Move up and down to get end points of another chord; Y center-point is at 1/2 this distance
If %(51) = 1 THEN GOTO ClosedExit
On Input(1,1) GOTO HitBottom
MY, &start_Y - 2
GOTO FailedExit
HitBottom:
On Input(1,1)
&bottomstart = %(2)
MY, &start_Y
If %(51) = 1 THEN GOTO ClosedExit
On Input(1,1) GOTO HitTop
MY, &start_Y + 2
GOTO FailedExit
HitTop:
On Input(1,1)
&topstart = %(2)
MY, &start_Y
&center_Y = &bottomstart + ((&topstart - &bottomstart) / 2)
MY, &center_Y

RETURN

ClosedExit:
'Input Already Triggered -- Exit
PAUSE
END

FailedExit:
'Didn't seem to Make Contact in Expected Distance -- Exit
PAUSE
exit shopbot
END

SHOWKEYPAD:

SK

RETURN

dlcw
05-08-2010, 11:57 AM
Nat,

I had this problem also. I changed the plunge to SO,5 and the drill on/off to SO,6. It turns out that SB Control software - TS command - dynamically creates the center-in-hole file. It doesn't use the one you see on your hard drive. This drove me crazy. I finally stopped using the TS command and created my own center-in-hole and run that to center my drill. Works great!

nat_wheatley
05-08-2010, 12:19 PM
Thanks Don,

I'll modify the file and try running it alone (outside of the TS command). This definitely was (is) driving me nuts, it seemed like there was some 'black magic' going on...

Thanks again,

Nat