Thanks: 0
Likes: 0
Needs Pictures: 0
Picture(s) thanks: 0
Results 1 to 6 of 6
-
4th March 2011, 05:36 PM #1
Laser edge finder - scripting help
Boys,
I am going to mount (finally) the cross hair laser I bought to my mill and what I need is a sample script which I can use to offset the machine in the x and y axis so the bit will be over where the cross hair was.
I would also like it to set both axis to zero after the movement is complete.
Of course I am using Mach3, so I suspect this will be a VB script.
Any help appreciated and rewarded with beer. Must come and collect in person. Will not ship under any circumstance.
Michael
-
4th March 2011 05:36 PM # ADSGoogle Adsense Advertisement
- Join Date
- Always
- Location
- Advertising world
- Posts
- Many
-
4th March 2011, 06:57 PM #2Senior Member
- Join Date
- May 2010
- Location
- Brisbane
- Posts
- 107
theres a really good post on cnc zone about this. search for 'aussie tool zero setter'. i have a bookmark at home that i will get ya when i get home.
-
4th March 2011, 07:12 PM #3
Found it and of course it was written by Greg, the man that just completes task after task after task.
But this was for a plate, so i'll have to see if i can adapt it for a laser only solution
Here is the link for future people
Another Aussie Auto Tool Zero Setter - CNCzone.com-The Largest Machinist Community on the net!
Update:
The link i'm after can be found here:
http://www.machsupport.com/forum/ind...,10841.10.html
Describes exactly what I want to do. An important post advises people that the laser case is positively charged, so to use this with a BoB, you need an insulator if it is to get connected to the metalwork of the machine.
I just tested my unit and I realised this is correct. I just wasted my time machining a nice holder out of Aluminum (Bugger). Next job tomorrow is to make one from Cedal.
/M
-
4th March 2011, 08:30 PM #4
Here is a post extracted from the above link posted by tweakie. This is the base code for the macro
--- Start Quote ---
I have added two buttons to the Mach screen one titled 'Laser ON/OFF' and used Scott's VB script to perform this function. The other button is titled 'Home to Laser' and uses the following script.
Xs=GetOemDRO(59) 'Xscale DRO
Ys=GetOemDRO(60) 'Yscale DRO
Xmove = -72.8719 * 1/Xs 'move distance adjusted for X scale factor
Ymove = 10.7156 * 1/Ys 'move distance adjusted for Y scale factor
DeActivateSignal(OUTPUT5) 'turn off laser
Code "G91 G0 X" &Xmove & "Y" &Ymove ' makes an incremental move the distances that you set
While IsMoving () ' waits while that happens
Wend
Code "G90" 'goes back to absolute moves
DoOEMButton (1008) 'zero X DRO
DoOEMButton (1009) 'zero Y DRO
As I use the DRO Scale settings to scale my engraving work to fit the size of the blank I have included a calculation to position the cutter relative to the laser irrespective of the scale settings.
--- End Quote ---
-
5th March 2011, 08:16 AM #5SENIOR MEMBER
- Join Date
- May 2005
- Location
- Cockatoo Vic
- Posts
- 996
There was a thread I started about lasers,
Another Aussie Adventure in Laser Zero Finding - CNCzone.com-The Largest Machinist Community on the net!
Here is the code I use for an on screen button to turn the laser on or off,
If IsOutputActive(OUTPUT4) Then
DeActivateSignal(OUTPUT4)
Else
ActivateSignal(OUTPUT4)
End If
This code is to move the axis to take up the position of the laser and turn the laser off. It also asks whether or not to zero the X and Y,
DeActivateSignal(OUTPUT4) 'Turn laser off
Code "G91 G0 X -33.2 Y -57.5" ' put the relevant offset amounts here
While IsMoving ()
Wend
Code "G90" 'set things back to absolute
Msg = "Zero X and Y DROs?" 'question for message box
Style = 4 + 32 + 0
Title = "Laser Zero"
Response = MsgBox(Msg, Style, Title)
If Response = 6 Then 'if reponse is yes then zero the DROs
SetOEMDRO (800,0)
SetOEMDRO (801,0)
End If
-
8th March 2011, 12:07 PM #6
Thanks guys for the feedback. Worked a treat.
I found trying to edit the screen on Mach3 (ie standard 1024 screen set) is limited. It seems most of the buttons are reserved and not editable. is this correct, which i suspect implies I need to make my own screen set from scratch
I used the Klaus editor. Is this the better one out there? Seems cumbersome to me
PS; Found my X4 has no spare output from the BoB. Bugger, so I have it wired to an external power supply which is not the best as I wanted to control it all through MACH3. I am going to have to investigate whether I can get another BoB which can fit in between the current unit so I can try and break out the pins which are not currently used.
/Michael
Similar Threads
-
A centre finder
By powderpost in forum WOODTURNING - GENERALReplies: 11Last Post: 23rd March 2008, 07:49 AM -
Centre Finder
By Black Ned in forum HOMEMADE TOOLS AND JIGS ETC.Replies: 2Last Post: 21st January 2008, 10:11 PM -
For the scripting gurus out there
By Toolin Around in forum NOTHING AT ALL TO DO WITH WOODWORKReplies: 9Last Post: 16th February 2007, 08:08 PM