Hello Guest it is January 24, 2020, 09:55:05 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - DWalsh62

Pages: 1
1
FAQs / Zeroing script for metric / imperial with sanity.
« on: January 26, 2012, 04:21:11 AM »
This has been beaten to death and there are many people offering a tool zeroing script in imperial and metric however this usually involves using their custom screens which may contain graphic with information or images that don't suit you.

Here is a script that does not require a custom screen set, I have added sanity to check things like G20/G21 mode, check tool selection, test if probe input is configured and probe wiring faults, will stop and restart spindle (in same rotation direction) and ask if you need/want to move X, Y or Z an to place the sensor on the work piece.

The script is included in this post as code so you can easily copy/paste it or make some modification before implementing it.

Code: [Select]
' Auto Tool Zero by Dale Walsh <dale@daleenterprise.com>

Dim Initial_Abs_Inc

Dim Initial_Feed_Rate

Dim Initial_G_State

Dim Initial_Machine_Coordinates_State

Dim Initial_Spindle_CW_State

Dim Initial_Spindle_CCW_State

Dim Initial_Spindle_State

Dim Initial_Tool_Offset_State

Dim Probing_Feed_Rate

Dim Guage_Block_Height

Dim Z_Probe_Pos

Initial_Feed_Rate = GetOEMDRO(818)

Initial_G_State = GetOEMDRO(819)

Initial_Machine_Coordinates_State = GetOEMLed(16)

Initial_Tool_Offset_State = GetOEMLED(28)

Initial_Abs_Inc = GetOEMDRO(48)

Guage_Block_Height = GetOEMDRO(1001)

If Guage_Block_Height <= 0 Then
Answer = MsgBox("A positive value must be entered for the Guage Block Height", 0, "Oh-oh")
Exit Sub
End If

If GetOEMDRO(824) <= 0 Then
Answer = MsgBox("A Tool has not been selected, select a tool and try again.", 0, "Oh-oh")
Exit Sub
End If

If IsSuchSignal(22) Then ' Check whether a probe input is defined..
If GetOEMLed(825) = 0 Then

Answer = MsgBox("Do you need to Move X, Y or Z ?", 4, "Do you need to Move")
If Answer = 6 Then
Message("Tool zeroing to Material was canceled so you can move.")
Exit Sub
End If

Answer = MsgBox("Place Sensor on work piece.", 1, "Is the Guage Block Sensor in place")
If Answer = 2 Then
Message("Tool zeroing to Material was canceled.")
Exit Sub
End If

Message("Tool zeroing to Material is requested.")

' Save settings for restoring later
Initial_Spindle_State = GetOEMLED(11)
Initial_Spindle_CW_State = GetOEMLED(164)
Initial_Spindle_CCW_State = GetOEMLED(165)

If Initial_Spindle_State = true Then  ' Spindle is running so stop it
If Initial_Spindle_CW_State = Initial_Spindle_CCW_State Then
MsgBox("Your running spindle is misconfigured -> clockwise = " &  Initial_Spindle_CW_State & " and counter-clockwise" &  Initial_Spindle_CCW_State & " , please fix this.")
Exit Sub
End If
DoSpinStop()
Sleep(500)
End if

' Turn off Tool Offset if it's on
Select Case Initial_Tool_Offset_State
Case True
DoOEMButton(136)
End Select

Select Case Initial_Machine_Coordinates_State
Case True
DoOEMButton(180)
End Select

'  Get current scale settings.
XScale = GetOEMDRO(59)
YScale = GetOEMDRO(60)
ZScale = GetOEMDRO(61)

'  Set scale to one to probe.
Call SetOEMDRO(59, 1)
Call SetOEMDRO(60, 1)
Call SetOEMDRO(61, 1)

Select Case GetOEMLED(802)
Case true ' Metric System
Probing_Feed_Rate = 150
Probe_Travel = 250
Case false ' Imperial System
Probing_Feed_Rate = 6
Probe_Travel = 10
End Select

DoOemButton(1010)
Code "G4 P1"

' Perform the probe
Code "G90 G31 Z-" & Probe_Travel & " F" & Probing_Feed_Rate
While IsMoving()
Wend

Z_Probe_Pos = GetVar(2002)
Code "G0 Z" &Z_Probe_Pos
While IsMoving()
Wend

Call SetOemDRO(802 , Guage_Block_Height)
Code "G4 P0.500"
Code "G28"
While IsMoving()
Wend

Message("Tool is now zeroed to Material.")

' Restore the original settings
Code "F" &Initial_Feed_Rate

Select Case Initial_Abs_Inc
Case 0
Code "G90"
Case 1
Code "G91"
End Select

Select Case Initial_G_State
Case 0
Code "G0"
Case 1
Code "G1"
End Select

Select Case Initial_Spindle_State
Case True ' Spindle is running so stop it
If Initial_Spindle_CW_State = true Then
DoSpinCW()
ElseIf Initial_Spindle_CCW_State = true Then
DoSpinCCW()
End If
End Select

' Restore the original Tool Offset state
Select Case Initial_Tool_Offset_State
Case True
DoOEMButton(136)
End Select

' Restore original  Machine Coordinates State
Select Case Initial_Machine_Coordinates_State
Case True
DoOEMButton(179)
End Select

Call SetOEMDRO(59, XScale)
Call SetOEMDRO(60, YScale)
Call SetOEMDRO(61, ZScale)

Else
'  Houston we have a problem
Answer = MsgBox("Guage Height Block is grounded, check connections and try again", 0, "Oh-oh")
End If
Else
Answer = MsgBox("Probe input is not defined in Port and Pins config, configure and try again.", 0, "Oh-oh")
End If

You can use the "Operator->Edit Button Script" menu option to install the script.

With minor modification you can also use it as a tool height setter.

2
FAQs / New configuration now homing issues.
« on: January 25, 2012, 05:21:40 AM »
I have been using Mach3 for some time, first with a Sherline mill then with a custom made cast steel VMC.

These machines had 20TPI screws and home switches and ref-all-home would break the switch contact and then backs off roughly 1/2 of a turn (0.0250in) and the switch requires only 0.0220in of travel to unload so this worked good.

Due to the need of a micro machine with high precision and accuracy I employed 50TPI 0.3750in DIA screws and home switches and now I am unable to home the machine since the 1/2 turn results in only 0.0100in of travel which is insufficient to unload the switches.

I have googled this to death and poured over the manual but I can't seem to find anything that tells me where to set the amount of back-off

Please do not offer solutions or ideas that do not involve config settings and if you don't know the answer please don't offer possible solutions to try, I don't have any more time to play with this and the frustration has gotten the better of me.

If you tell me there is no settings in the config for adjusting the amount of back-off I can accept that and resolve this another way which you may not like.

I see great potential with this software but it's short-comings are a pain in my ass and relying on you (ArtSoft) to provide a fix in a timely manner far exceeds the time I have to resolve this.

I have a history of fixing things on my own in a manner that offends the creators of the software because they wont resolve it in a timely manner and wont allow me access to the source to fix it so I end up doing the educational examination of the code by decompiling (yes I own IDA-Pro and know how to use it) and fixing whatever is wrong with it and while EULA's have provision that prohibit this, the DMCA has laws, rules and regulations that protect me from prosecution if I do it under certain conditions and at my age, I no longer care who I piss off when I need something fixed because it doesn't work right.

Yes, I have been threatened by many companies with lawsuits, have had legal departments harass me (Apple is a good example that comes to my mind) yet I have never been served or prosecuted, unlike most, I am not intimidated by lawyers or legal departments and a letter from a lawyer or legal department isn't worth the stamp they placed on it when they have no legal standing to prevent me from my intended goal, my thoughts, I will do it with your assistance, under an NDA if you are insecure or on my own if you wont fix it or allow me access to the code to fix it myself.

Bare in mind, if I do it on my own I am not bound by any obligations NOT to discuss the process, my results, concepts or the process involved but at least I have the courtesy of telling you in advance that it will be resolved even if you refuse to fix it or allow me under your control/supervision to fix it.

ArtSoft, not happy reading this??  I'm not happy that it's not working so we're even, if the solution isn't already available, what happens next is entirely up to you, this is not a feature request you can shelve till you're ready to add it, I need it now and don't care how it gets done or who fixes it as long as it gets fixed.

Pages: 1