Hello All,
This is my first post here. Hoping I can get some help.
I have been trying for some time now to get my gantry to autosquare. So far the only way I have been able to do it is by modifying the button code for the "Ref All Home" button. It works perfectly but for some reason the slaved motor (B) will not re-slave after the homing and squaring routine is finished. If I press the up arrow on the keyboard after the machine squares, the Y motor will take off and the B motor will not move and of course it twists the gantry.
I have a brand new purpose built PC running Windows 7, 32 bit. There is nothing else on the PC except Mach3.
I am running the latest Mach3 version and using the UC100 controller.
I have the latest plugin installed for the UC100.
I have a separate homing switch for each motor connected to separate pins.
I have the "Home Slave with Master Axis" unchecked in the general config file.
If I install the default button code for the "Ref All Home" button, the machine homes perfectly and the slaved motor remains active however it does not square the bridge. It also appears that it makes no difference what offset I enter for the slaved motor as the the gantry only moves off the homing switches equal to the offset entered for the Y motor ignoring the B motor offset.
I find it very hard to believe that I have not been able to find a fix for this. Contacting the makers of the UC100 provided no help so I don't know if this is a Mach3 problem or a UC100 problem but I do know that it is a problem and surely I'm not the only one that is experiencing it.
If there is anyone out there that knows how to fix this I would be eternally grateful. Other than the above mentioned problem, my machine runs great.
Below is the custom button code that actually squares the gantry but does not re-energize the B motor.
'Early versions of Mach had to make use of the
'following three lines of code after each command:
'While IsMoving
'Sleep(25)
'Wend
'This insured the command completed before going to
'the next line of code. Newer versions of Mach may
'not need this code or may need it in some places
'and not others.
'If the code seems to "hang" you will need to CTRL+
'ALT+DEL and end the task for Mach3
'Restart the software and run the code again. This
'time start back ticking some the the While IsMoving
'lines until the machine homes and squares up.
Dim boffset
Dim feedhome
boffset = 0.1 'change this value to adjust for squarness
feedhome = 5 'feedrate which to square the gantry
DoButton( 24 ) 'Home each axis normally
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )
DoOEMButton(133)
DoOEMButton(134)
DoOEMButton(135)
While IsMoving
Sleep(25)
Wend
DoOemButton(357) 'Deslave Axis
While IsMoving
Sleep(25)
Wend
DoOemButton(1007) 'Zero All Axis
While IsMoving
Sleep(25)
Wend
Code "F" & feedhome
While IsMoving
Sleep(25)
Wend
Code "G1B" & boffset 'Move the B axis a small amount to square the gantry
While IsMoving
Sleep(25)
Wend
DoOemButton(1007) 'Zero All Axis
While IsMoving
Sleep(25)
Wend
DoOemButton(358) 'Slave Axis
While IsMoving
Sleep(25)
Wend
message ("Homing Complete")