PDA

View Full Version : writing a new SB program



foamman
08-23-2011, 09:39 PM
Hello again,
Can anyone think of way to write a program that could tell you if your machine has lost its XY or Z axis. I was thinking it would be like homing to the proximity switches (C3) or zero plate (C2) but in addition to setting the machine to zero it would also report how far off (if at all) the machine was before running the zero program. The thought being that if you suspected the machine of losing zero you could run the new program and if it proved to be off you could closely evaluate your part.

Any thoughts.

Thanks
Ben

Gary Campbell
08-23-2011, 10:32 PM
Ben....
One way this could be accomplished is by writing a variable just after the first prox hit on each axis. Then print the difference between that point and the X or Y rollback variable. Here is an example for the x with code pasted from the OEM XYzero file. Y will be similar. Make sure that you make a backup copy of the file prior to modifying it.


ON INP(&Xtrgt,&TrgtHIT) 'Set switch to nothing to turn off (OEM code)

&X_hit_pos = %1 (insert this line)
(do the same for the Y)



Just before the file ends, add this short sub routine:

TEST:
&X_error = &X_dist - &X_hit_pos
PRINT "X error is , &X_error"
PRINT "Y error is , &Y_error"

This will print the difference between your new position and the old on both axes. Or cut out the VA lines and make a test routine.

dave_k
08-24-2011, 12:21 PM
Thanks Gary... not going to apply it for what you wrote it for, I zero my Alpha with physical stops and always have from day 1, but that technique for a getting a query flipped light bulbs on in my head for other things I need feedback for. This is yet another example of little tidbits you pick up on this forum that may save you hours trying to re-invent the wheel.