Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: M250cnc on August 19, 2008, 12:48:53 PM
-
Is it possible to edit the routine. If yes please mention how. ;D
I am using version 2.63 and what i do not like is it uses the current feedrate.
I want to SET a feedrate of MY chosing.
All help appreciated.
Phil_H
-
Ok, I'm sure Greg (greolt) or "poppabear" will be along to help with this shortly, but here's my code (which is like Gregs):
Rem VBScript To center probe inside a pipe
If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty
Code "(Probe plate is grounded, check connection and try again)"
Else
FeedCurrent = GetOemDRO(818) 'Get the current settings
XCurrent = GetDro(0)
YCurrent = GetDro(1)
Code "G4 P1" 'Pause 1 second to give time to position probe plate
Code "F4" 'slow feed rate to 4 ipm
Rem Probe Left
XNew = Xcurrent - 3 'probe 3 inches to left
Code "G31 X" &XNew
While IsMoving() 'wait for the move to finish
Wend
XPos1 = GetVar(2000) 'get the probe touch location
Code "G0 X" &XCurrent 'rapid move back to start point
Rem Probe Right
XNew = XCurrent + 3 'probe 3 inches to right
Code "G31 X" &XNew
While IsMoving()
Wend
XPos2 = GetVar(2000)
XCenter = (XPos1 + XPos2) / 2 'center is midway between XPos1 and XPos2
Code "G0 X" &XCenter 'rapid move to the x center location
Rem Probe up
YNew = YCurrent + 3
Code "G31 Y" &YNew
While IsMoving()
Wend
YPos1 = GetVar(2001)
Code "G0 Y" &YCurrent
Rem Probe down
YNew = YCurrent - 3
Code "G31 Y" &YNew
While IsMoving()
Wend
YPos2 = GetVar(2001)
YCenter = (YPos1 + YPos2) / 2
Rem move To the center
Code "G0 Y" &YCenter
While IsMoving ()
Wend
Code "F" &FeedCurrent 'restore starting feed rate
End If
Now notice where it says "Code "F4" 'slow feed rate to 4 ipm" ?
I believe that's where you change your feed rate but obviously try it first!
Dave
P.S. just a warning, going too fast can screw up the "touch" accuracy if I'm not mistaken! Proceed with caution!
-
Thanks for that Dave.
It was the built in probe routine that i was after changing but i will try that one.
I agree about speed being important if i go too slow i get an error, and if i go too fast i **** myself ;D hence my desire to hard code it.
Then i will not have to go thought it again if i have the speed incorrect.
As your using IPM's you must be the other side of the pond although brought up on imperial i prefer M & M's
I actually find 200 MM PM is best "8 IPM"
Phil_H
-
Indeed I am Phil but I still love M&M's ...... especially the green ones :D
-
Ok, I'm sure Greg (greolt) or "poppabear" will be along to help with this shortly, but here's my code (which is like Gregs):
Woah!!!! I don't think my name should be mentioned in the same breath as Poppabear's ;D ;D
I have to ask him the most basic questions. ;D ;D And I have never seen that code before. Never even tried centring routines before. ;D
Phill what code are you asking about? Can you open it in an editor? Look for an F command and change it to what you want.
If it has none then G31 will use the last used feedrate. But adding a line should be no problem.
Also see the following two line in Budman's code,
FeedCurrent = GetOemDRO(818) 'Get the current settings This one near the sart
Code "F" &FeedCurrent 'restore starting feed rate This one near the end
They restore the feedrate to what it was before running the routine.
Greg
-
Indeed I am Phil but I still love M&M's ...... especially the green ones Cheesy
I love em all. ;D
Phill what code are you asking about? Can you open it in an editor? Look for an F command and change it to what you want.
(http://www.pmcb.co.uk/3DProbe1.jpg)
(http://www.pmcb.co.uk/3DProbe2.jpg)
As i say its the one that's inbuilt but having tried the one posted by Dave AKA budman68 i think that one is better as you don't have to unload your gcode to run it.
I applied the code to the centre button on the offsets page.
I did try with no success to change the X & Y DRO's to zero at the end of the routine. :-[
Phil_H
-
Phill
Budmans script does not zero X and Y at the end. It leaves that up to the operator.
If you want it to do so then just add these couple of lines to the last bit.
Rem move To the center
Code "G0 Y" &YCenter
While IsMoving ()
Wend
Code "F" &FeedCurrent 'restore starting feed rate
DoOEMButton ( 1008 )
DoOEMButton ( 1009 )
End If
Greg
-
Thanks Greg
Phil_H
-
So Sorry, Greg, you are correct, that was "erniebro"s code over at the CNC Zone. :P