Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: Adam_M on November 01, 2014, 11:25:28 AM
-
I'm pretty new to Mach and GCode so go easy on me please..
I'm trying to utilize BigTex's BlueScreen's Auto tool zero and I see that it says that it zeroed in "Metric" when I ran it.
I have 2 questions:
1) How do I edit the GCode in Bigtex's screen for the speed in which it auto zero's, etc.?
2) If I can't edit the GCode can I change it to inches?
Thanks,
-
I am not familiar with that screen but likely it is script in the button that you need to change, you will need to know VB for that. You can do it by going to config menu ten Edit Button scripts. All te VB buttons will be flashing, click the one you want and the editor will open with the script from that button ready for you to edit.
Hood
-
Ah, thanks Hood.. that should get me started.
Adam,
-
yes you have to go through vb to open the scrip the descend and retract speed is easy to find if I rember correctly it should not matter what the machine is set to as it has metric and inch settings in it
-
I'm trying to work through a problem with the Macro in Big Texas' Blue screen... it seems like the math is not calculating correctly. I'll try to explain what's happening..
I have set my plate offset to +.0625, I believe this is DRO(2), my settings are in inches.
In an attempt to Zero my "Z" axis after the initial touch off my "Z" jumps an inch "+" as it should but instead of heading back to the plate moving towards "-" or the touch-off plate it heads towards the "+" side. In stepping through the code associated with the "Z-" button on the screen the math seems to be incorrectly calculated and I'm uncertain as to why?
I stepped through the code and in this section ZNew was set to (.444...) it then bumps an inch towards the "+".
ZNew = GetVar(2002) 'read the touch point (current setting .444...)
Code "G0 Z" &ZNew +.1 'move back +.1 to hit point in case there was overshoot +.1
While IsMoving ()
Wend
Then it gets to this part and sets ZNew to (.77....) which I don't understand, why is ZNew increasing and not decreasing ?? The feed rate decreases as it should but instead of heading towards the touch-off plate it's going the opposite direction, I'm confused. ???
Code "F2" 'slow down feedrate to 2 ipm
ZNew = GetDro(2) - .25 'probe move to current z - .25 inches (current setting .77...)
Code "G31Z" &ZNew
Adam,
************************************************************************
Total Code
Rem VBScript To probe In the z axis
If GetOemLED(16)<>0 Then 'Checks for machine coordinates
code "(Please change to working coordinates)"
Else
If GetOemLed (825) <> 0 Then 'check to see if the probe is already grounded or faulty
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Else
Code "G4 P1" 'pause 1 seconds to give time to position probe plate
PlateOffset = GetUserDRO(1151) 'get plate offset DRO
CurrentFeed = GetOemDRO(818) 'get the current feedrate to return to later
Code "F10" 'slow down feedrate to 10 ipm
Rem Probe In the z direction
ZNew = GetDro(2) - 6 'probe move to current z - 6 inches
Code "G31Z" &ZNew
While IsMoving() 'wait for probe move to finish
Wend
ZNew = GetVar(2002) 'read the touch point
Code "G0 Z" &ZNew +.1 'move back +.1 to hit point incase there was overshoot +.1
While IsMoving ()
Wend
Rem End add lines
Rem .444 - .25 = .77***
Code "F2" 'slow down feedrate to 2 ipm
ZNew = GetDro(2) - .25 'probe move to current z - .25 inches
Code "G31Z" &ZNew
While IsMoving() 'wait for probe move to finish
Wend
ZNew = GetVar(2002) 'read the touch point
Code "G0 Z" &ZNew 'move back to hit point incase there was overshoot
While IsMoving ()
Wend
If PlateOffset <> 0 Then
Call SetDro (2, PlateOffset) 'set the Z axis DRO to plate thickness
Code "G4 P0.25" 'pause for Dro to update.
'ZNew = PlateOffset + 3.6315 'calc retract
'Code "G0 Z" &ZNew 'put the Z retract height you want here
Code("G53G0Z-0.5") 'Z retract
While IsMoving ()
Wend
Code "(Z axis is now zeroed in English Units)" 'puts this message in the status bar
End If
Code "F" &CurrentFeed 'returns to prior feed rate
End If
End If
-
ZNew = GetVar(2002)
This is the Z position at your touch plate, and will change every time you probe. It's in work coordinates, and the value can vary greatly, depending on the current Z offset.
Code "F2" 'slow down feedrate to 2 ipm
ZNew = GetDro(2) - .25 'probe move to current z - .25 inches (current setting .77...)
Code "G31Z" &ZNew
This is a second, slower probe move. DRO(2) is the current Z position, so it's probing down .25".
When you are stepping through the code, if your not actually probing, you may get strange results.
Also, make sure your in Absolute Mode (G90) when you run this macro, or you'll also get strange results.
-
Thanks Gerry,
This is a second, slower probe move. DRO(2) is the current Z position, so it's probing down .25".
Yes, exactly as I interpreted it. The problem is the Z axis is going up instead of down... which is why I'm confused???
Also, make sure your in Absolute Mode (G90) when you run this macro, or you'll also get strange results.
Can you tell me how to make sure I'm in the Absolute Mode (G90)?
Adam,
-
So let me see if I understand how this is working...
**********************************************************************************************************************************
ZNew = GetDro(2) - 6 'Reads the current Z from the DRO(2) or "DRO Z" and subtracts 6" from it. This is the range to search for the touch off plate
Code "G31Z" &ZNew 'Starts the probe headed towards -Z from the current Z
While IsMoving() 'wait for probe move to finish
Wend
ZNew = GetVar(2002) 'Found the touch point and set a variable GetVar(2002) to that touch point called ZNew
Code "G0 Z" &ZNew +.1 'move Z to ZNew + 1"
While IsMoving () 'wait for the process to take place
Wend
Code "F2" 'slow down feed rate to 2 ipm
ZNew = GetDro(2) - .25 'Set variable ZNew = the current Z read from DRO(2) or "DRO Z" and subtracts .25" from it.
'Would this make more sense to be the same as above, ZNew = GetDro(2) - 6 or at least greater than 1" to offset the 1" added to Z from above???
Code "G31Z" &ZNew 'Start another probe headed towards -Z from the current "DRO Z" that has been increased by 1" going -.25
While IsMoving() 'wait for the process to take place
Wend
ZNew = GetVar(2002) 'Found the touch point and set a variable GetVar(2002) to that touch point called ZNew
Code "G0 Z" &ZNew 'Move to GetDro(2) - .25, This should be Z zero I think????
While IsMoving () 'wait for the process to take place
Wend
-
'move Z to ZNew + 1"
The code is actually moving 0.1, not 1.
If it moved up, the second probe move would never hit the plate, as it only moves down 0.25.
This answers your next question.
ZNew = GetVar(2002) 'Found the touch point and set a variable GetVar(2002) to that touch point called ZNew
Code "G0 Z" &ZNew 'Move to GetDro(2) - .25, This should be Z zero I think????
While IsMoving () 'wait for the process to take place
Wend
When the probe hits the plate, it will overshoot a small amount from decelerating. The above moves it back to the point that it hit the plate. It's not Z zero. Z zero has not been set yet, and it should be set to the bottom of the plate. This is usually accomplished be setting this location to Z= Plate Thickness.
You can check if your in G90/G91 with
CurrentAbsInc = GetOemLED(48) ' Get the current G90/G91 state
-
Is there a trick when saving your edited macro?
When I edit the button macro and save it Mach doesn't seem to save it, its kind of spotty sometimes it does and sometimes it doesn't... Deleting all the macro information then re-pasting and exiting Mach seem to help so I'm guessing I'm missing something on "How to save your edits"?
Any information you can shed?
Thanks.
Adam,