Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: daybowbow on November 05, 2014, 09:46:21 AM

Title: Autozero and Coordinate issues are loading G-Code
Post by: daybowbow on November 05, 2014, 09:46:21 AM
I have a Chinese X6-1500gt USB and using Mach3 and I am having issues with the autozero function.

When I start my machine I use the zero the machine with a touch plate. I have it set up that it wll go to my zero plate, touch, then retract. It zeros well and it is accurate. I can hit go to home and it will go right about the work piece as desired. I can move it all around the work piece manually with jog and can zero it whereever I want up to this point.  I can zero all axis with no issues yet.

The issue arrises when I load a code to mill. When I do this all the axis of my machine go to different coordinates. These coordinates change from piece to piece that I load into mach3. All axis will no longer be zeroes to the corret location. Then after I load the piece and try to use the zero tool again to get it back to where I want it. 

It will do one of two things.
1. It will either plunge down in a feed rate much faster than it is supposed to use. It will disregard the touch plate signal when the tool touches it and keep going. Only stopping when I hit the E-Stop or turn off power to the stepper motors.
 
Or
2.  the other thing it will do is just not move down at all in the Z axis if I hit zero tool again. It wont let me jog the z axis either. But if I touch the probe to the z plate it will zero the piece and start retracting the z axis like it is supposed to.

I almost have to uninstall mach3 and install it again for it to start working correctly again. Turning off the program and restarting it does nothing to resolve the issues I am facing. Am I doing something wrong here? I am using vectric vcarce and aspire to make my parts that I am going to cut out. Mach3 is my program that I upload my gcode in to cut the parts. I am just confused on to why the machine will work great without issues when I first load up mach3. But after I load my gcode the script or the zero tool will not work correctly. Any ideas?

All I can really thing of is that in Aspire and Vectric that my default units are in inches and in mach3 my default unit is inches. However, I have cut out other pieces before I haven't had issues. However, these were piecs where I did not try to use the zero function as the pieces didn't require any tool changes. However my pieces are getting more complex and I am wanting to use large clearance tools and need to zero it correctly to produce a part that looks good.

Any help would be appreciated.
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: Vogavt on November 05, 2014, 11:12:21 AM
Are you in G54 mode when you start or does Vectric Post Processor change it to G55, G56, etc.?

IF not, I'd say you're looking at a reinstallation of Mach3. Might be the quickest way to get out of trouble.

You could spend a lot of time troubleshooting at a later time but only if it happens again.

Are you using the latest version?
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: daybowbow on November 05, 2014, 12:07:23 PM
This is one of the g codes I had been using.

Code: [Select]
( Magnet Holes )
( File created: Sunday, November 02, 2014 - 03:18 PM)
( for Mach2/3 from Vectric )
( Material Size)
( X= 4.000, Y= 6.000, Z= 0.756)
()
(Toolpaths used in this file:)
(Pocket 2)
(Tools used in this file: )
(1 = Ball Nose {0.125 inch})
N100G00G20G17G90G40G49G80
N110G70G91.1
N120T1M06
N130 (Ball Nose {0.125 inch})
N140G00G43Z0.8000H1
N150S12000M03
N160(Toolpath:- Pocket 2)
N170()
N180G94
N190X0.0000Y0.0000F50.0
N200G00X-0.0045Y0.3938Z0.2000
N210G1Z-0.0600F20.0
N220G1X-0.0030Y0.3923F50.0
N230G1X-0.0045Y0.3908
N240G1X-0.0060Y0.3923
N250G1X-0.0045Y0.3938
N260G1Y0.4063
N270G2X0.0095Y0.3923I0.0000J-0.0140
N280G2X-0.0045Y0.3783I-0.0140J0.0000
N290G2X-0.0185Y0.3923I0.0000J0.0140
N300G2X-0.0045Y0.4063I0.0140J0.0000
N310G1Y0.4188
N320G2X0.0220Y0.3923I0.0000J-0.0265
N330G2X-0.0045Y0.3658I-0.0265J0.0000
N340G2X-0.0310Y0.3923I0.0000J0.0265
N350G2X-0.0045Y0.4188I0.0265J0.0000
N360G1Y0.4313
N370G2X0.0345Y0.3923I0.0000J-0.0390
N380G2X-0.0045Y0.3533I-0.0390J0.0000
N390G2X-0.0435Y0.3923I0.0000J0.0390
N400G2X-0.0045Y0.4313I0.0390J0.0000
N410G1Y0.4438
N420G2X0.0470Y0.3923I0.0000J-0.0515
N430G2X-0.0045Y0.3408I-0.0515J0.0000
N440G2X-0.0560Y0.3923I0.0000J0.0515
N450G2X-0.0045Y0.4438I0.0515J0.0000
N460G1Y0.4563
N470G2X0.0595Y0.3923I0.0000J-0.0640
N480G2X-0.0045Y0.3283I-0.0640J0.0000
N490G2X-0.0685Y0.3923I0.0000J0.0640
N500G2X-0.0045Y0.4563I0.0640J0.0000
N510G00Z0.2000
N520G00Y0.3938
N530G1Z-0.1200F20.0
N540G1X-0.0030Y0.3923F50.0
N550G1X-0.0045Y0.3908
N560G1X-0.0060Y0.3923
N570G1X-0.0045Y0.3938
N580G1Y0.4063
N590G2X0.0095Y0.3923I0.0000J-0.0140
N600G2X-0.0045Y0.3783I-0.0140J0.0000
N610G2X-0.0185Y0.3923I0.0000J0.0140
N620G2X-0.0045Y0.4063I0.0140J0.0000
N630G1Y0.4188
N640G2X0.0220Y0.3923I0.0000J-0.0265
N650G2X-0.0045Y0.3658I-0.0265J0.0000
N660G2X-0.0310Y0.3923I0.0000J0.0265
N670G2X-0.0045Y0.4188I0.0265J0.0000
N680G1Y0.4313
N690G2X0.0345Y0.3923I0.0000J-0.0390
N700G2X-0.0045Y0.3533I-0.0390J0.0000
N710G2X-0.0435Y0.3923I0.0000J0.0390
N720G2X-0.0045Y0.4313I0.0390J0.0000
N730G1Y0.4438
N740G2X0.0470Y0.3923I0.0000J-0.0515
N750G2X-0.0045Y0.3408I-0.0515J0.0000
N760G2X-0.0560Y0.3923I0.0000J0.0515
N770G2X-0.0045Y0.4438I0.0515J0.0000
N780G1Y0.4563
N790G2X0.0595Y0.3923I0.0000J-0.0640
N800G2X-0.0045Y0.3283I-0.0640J0.0000
N810G2X-0.0685Y0.3923I0.0000J0.0640
N820G2X-0.0045Y0.4563I0.0640J0.0000
N830G00Z0.2000
N840G00Y0.3938
N850G1Z-0.1800F20.0
N860G1X-0.0030Y0.3923F50.0
N870G1X-0.0045Y0.3908
N880G1X-0.0060Y0.3923
N890G1X-0.0045Y0.3938
N900G1Y0.4063
N910G2X0.0095Y0.3923I0.0000J-0.0140
N920G2X-0.0045Y0.3783I-0.0140J0.0000
N930G2X-0.0185Y0.3923I0.0000J0.0140
N940G2X-0.0045Y0.4063I0.0140J0.0000
N950G1Y0.4188
N960G2X0.0220Y0.3923I0.0000J-0.0265
N970G2X-0.0045Y0.3658I-0.0265J0.0000
N980G2X-0.0310Y0.3923I0.0000J0.0265
N990G2X-0.0045Y0.4188I0.0265J0.0000
N1000G1Y0.4313
N1010G2X0.0345Y0.3923I0.0000J-0.0390
N1020G2X-0.0045Y0.3533I-0.0390J0.0000
N1030G2X-0.0435Y0.3923I0.0000J0.0390
N1040G2X-0.0045Y0.4313I0.0390J0.0000
N1050G1Y0.4438
N1060G2X0.0470Y0.3923I0.0000J-0.0515
N1070G2X-0.0045Y0.3408I-0.0515J0.0000
N1080G2X-0.0560Y0.3923I0.0000J0.0515
N1090G2X-0.0045Y0.4438I0.0515J0.0000
N1100G1Y0.4563
N1110G2X0.0595Y0.3923I0.0000J-0.0640
N1120G2X-0.0045Y0.3283I-0.0640J0.0000
N1130G2X-0.0685Y0.3923I0.0000J0.0640
N1140G2X-0.0045Y0.4563I0.0640J0.0000
N1150G00Z0.2000
N1160G00Y0.3938
N1170G1Z-0.2400F20.0
N1180G1X-0.0030Y0.3923F50.0
N1190G1X-0.0045Y0.3908
N1200G1X-0.0060Y0.3923
N1210G1X-0.0045Y0.3938
N1220G1Y0.4063
N1230G2X0.0095Y0.3923I0.0000J-0.0140
N1240G2X-0.0045Y0.3783I-0.0140J0.0000
N1250G2X-0.0185Y0.3923I0.0000J0.0140
N1260G2X-0.0045Y0.4063I0.0140J0.0000
N1270G1Y0.4188
N1280G2X0.0220Y0.3923I0.0000J-0.0265
N1290G2X-0.0045Y0.3658I-0.0265J0.0000
N1300G2X-0.0310Y0.3923I0.0000J0.0265
N1310G2X-0.0045Y0.4188I0.0265J0.0000
N1320G1Y0.4313
N1330G2X0.0345Y0.3923I0.0000J-0.0390
N1340G2X-0.0045Y0.3533I-0.0390J0.0000
N1350G2X-0.0435Y0.3923I0.0000J0.0390
N1360G2X-0.0045Y0.4313I0.0390J0.0000
N1370G1Y0.4438
N1380G2X0.0470Y0.3923I0.0000J-0.0515
N1390G2X-0.0045Y0.3408I-0.0515J0.0000
N1400G2X-0.0560Y0.3923I0.0000J0.0515
N1410G2X-0.0045Y0.4438I0.0515J0.0000
N1420G1Y0.4563
N1430G2X0.0595Y0.3923I0.0000J-0.0640
N1440G2X-0.0045Y0.3283I-0.0640J0.0000
N1450G2X-0.0685Y0.3923I0.0000J0.0640
N1460G2X-0.0045Y0.4563I0.0640J0.0000
N1470G00Z0.2000
N1480G00Y0.3938
N1490G1Z-0.3000F20.0
N1500G1X-0.0030Y0.3923F50.0
N1510G1X-0.0045Y0.3908
N1520G1X-0.0060Y0.3923
N1530G1X-0.0045Y0.3938
N1540G1Y0.4063
N1550G2X0.0095Y0.3923I0.0000J-0.0140
N1560G2X-0.0045Y0.3783I-0.0140J0.0000
N1570G2X-0.0185Y0.3923I0.0000J0.0140
N1580G2X-0.0045Y0.4063I0.0140J0.0000
N1590G1Y0.4188
N1600G2X0.0220Y0.3923I0.0000J-0.0265
N1610G2X-0.0045Y0.3658I-0.0265J0.0000
N1620G2X-0.0310Y0.3923I0.0000J0.0265
N1630G2X-0.0045Y0.4188I0.0265J0.0000
N1640G1Y0.4313
N1650G2X0.0345Y0.3923I0.0000J-0.0390
N1660G2X-0.0045Y0.3533I-0.0390J0.0000
N1670G2X-0.0435Y0.3923I0.0000J0.0390
N1680G2X-0.0045Y0.4313I0.0390J0.0000
N1690G1Y0.4438
N1700G2X0.0470Y0.3923I0.0000J-0.0515
N1710G2X-0.0045Y0.3408I-0.0515J0.0000
N1720G2X-0.0560Y0.3923I0.0000J0.0515
N1730G2X-0.0045Y0.4438I0.0515J0.0000
N1740G1Y0.4563
N1750G2X0.0595Y0.3923I0.0000J-0.0640
N1760G2X-0.0045Y0.3283I-0.0640J0.0000
N1770G2X-0.0685Y0.3923I0.0000J0.0640
N1780G2X-0.0045Y0.4563I0.0640J0.0000
N1790G00Z0.2000
N1800G00Y1.3269
N1810G1Z-0.0600F20.0
N1820G1X-0.0030Y1.3254F50.0
N1830G1X-0.0045Y1.3239
N1840G1X-0.0060Y1.3254
N1850G1X-0.0045Y1.3269
N1860G1Y1.3394
N1870G2X0.0095Y1.3254I0.0000J-0.0140
N1880G2X-0.0045Y1.3114I-0.0140J0.0000
N1890G2X-0.0185Y1.3254I0.0000J0.0140
N1900G2X-0.0045Y1.3394I0.0140J0.0000
N1910G1Y1.3519
N1920G2X0.0220Y1.3254I0.0000J-0.0265
N1930G2X-0.0045Y1.2989I-0.0265J0.0000
N1940G2X-0.0310Y1.3254I0.0000J0.0265
N1950G2X-0.0045Y1.3519I0.0265J0.0000
N1960G1Y1.3644
N1970G2X0.0345Y1.3254I0.0000J-0.0390
N1980G2X-0.0045Y1.2864I-0.0390J0.0000
N1990G2X-0.0435Y1.3254I0.0000J0.0390
N2000G2X-0.0045Y1.3644I0.0390J0.0000
N2010G1Y1.3769
N2020G2X0.0470Y1.3254I0.0000J-0.0515
N2030G2X-0.0045Y1.2739I-0.0515J0.0000
N2040G2X-0.0560Y1.3254I0.0000J0.0515
N2050G2X-0.0045Y1.3769I0.0515J0.0000
N2060G1Y1.3894
N2070G2X0.0595Y1.3254I0.0000J-0.0640
N2080G2X-0.0045Y1.2614I-0.0640J0.0000
N2090G2X-0.0685Y1.3254I0.0000J0.0640
N2100G2X-0.0045Y1.3894I0.0640J0.0000
N2110G00Z0.2000
N2120G00Y1.3269
N2130G1Z-0.1200F20.0
N2140G1X-0.0030Y1.3254F50.0
N2150G1X-0.0045Y1.3239
N2160G1X-0.0060Y1.3254
N2170G1X-0.0045Y1.3269
N2180G1Y1.3394
N2190G2X0.0095Y1.3254I0.0000J-0.0140
N2200G2X-0.0045Y1.3114I-0.0140J0.0000
N2210G2X-0.0185Y1.3254I0.0000J0.0140
N2220G2X-0.0045Y1.3394I0.0140J0.0000
N2230G1Y1.3519
N2240G2X0.0220Y1.3254I0.0000J-0.0265
N2250G2X-0.0045Y1.2989I-0.0265J0.0000
N2260G2X-0.0310Y1.3254I0.0000J0.0265
N2270G2X-0.0045Y1.3519I0.0265J0.0000
N2280G1Y1.3644
N2290G2X0.0345Y1.3254I0.0000J-0.0390
N2300G2X-0.0045Y1.2864I-0.0390J0.0000
N2310G2X-0.0435Y1.3254I0.0000J0.0390
N2320G2X-0.0045Y1.3644I0.0390J0.0000
N2330G1Y1.3769
N2340G2X0.0470Y1.3254I0.0000J-0.0515
N2350G2X-0.0045Y1.2739I-0.0515J0.0000
N2360G2X-0.0560Y1.3254I0.0000J0.0515
N2370G2X-0.0045Y1.3769I0.0515J0.0000
N2380G1Y1.3894
N2390G2X0.0595Y1.3254I0.0000J-0.0640
N2400G2X-0.0045Y1.2614I-0.0640J0.0000
N2410G2X-0.0685Y1.3254I0.0000J0.0640
N2420G2X-0.0045Y1.3894I0.0640J0.0000
N2430G00Z0.2000
N2440G00Y1.3269
N2450G1Z-0.1800F20.0
N2460G1X-0.0030Y1.3254F50.0
N2470G1X-0.0045Y1.3239
N2480G1X-0.0060Y1.3254
N2490G1X-0.0045Y1.3269
N2500G1Y1.3394
N2510G2X0.0095Y1.3254I0.0000J-0.0140
N2520G2X-0.0045Y1.3114I-0.0140J0.0000
N2530G2X-0.0185Y1.3254I0.0000J0.0140
N2540G2X-0.0045Y1.3394I0.0140J0.0000
N2550G1Y1.3519
N2560G2X0.0220Y1.3254I0.0000J-0.0265
N2570G2X-0.0045Y1.2989I-0.0265J0.0000
N2580G2X-0.0310Y1.3254I0.0000J0.0265
N2590G2X-0.0045Y1.3519I0.0265J0.0000
N2600G1Y1.3644
N2610G2X0.0345Y1.3254I0.0000J-0.0390
N2620G2X-0.0045Y1.2864I-0.0390J0.0000
N2630G2X-0.0435Y1.3254I0.0000J0.0390
N2640G2X-0.0045Y1.3644I0.0390J0.0000
N2650G1Y1.3769
N2660G2X0.0470Y1.3254I0.0000J-0.0515
N2670G2X-0.0045Y1.2739I-0.0515J0.0000
N2680G2X-0.0560Y1.3254I0.0000J0.0515
N2690G2X-0.0045Y1.3769I0.0515J0.0000
N2700G1Y1.3894
N2710G2X0.0595Y1.3254I0.0000J-0.0640
N2720G2X-0.0045Y1.2614I-0.0640J0.0000
N2730G2X-0.0685Y1.3254I0.0000J0.0640
N2740G2X-0.0045Y1.3894I0.0640J0.0000
N2750G00Z0.2000
N2760G00Y1.3269
N2770G1Z-0.2400F20.0
N2780G1X-0.0030Y1.3254F50.0
N2790G1X-0.0045Y1.3239
N2800G1X-0.0060Y1.3254
N2810G1X-0.0045Y1.3269
N2820G1Y1.3394
N2830G2X0.0095Y1.3254I0.0000J-0.0140
N2840G2X-0.0045Y1.3114I-0.0140J0.0000
N2850G2X-0.0185Y1.3254I0.0000J0.0140
N2860G2X-0.0045Y1.3394I0.0140J0.0000
N2870G1Y1.3519
N2880G2X0.0220Y1.3254I0.0000J-0.0265
N2890G2X-0.0045Y1.2989I-0.0265J0.0000
N2900G2X-0.0310Y1.3254I0.0000J0.0265
N2910G2X-0.0045Y1.3519I0.0265J0.0000
N2920G1Y1.3644
N2930G2X0.0345Y1.3254I0.0000J-0.0390
N2940G2X-0.0045Y1.2864I-0.0390J0.0000
N2950G2X-0.0435Y1.3254I0.0000J0.0390
N2960G2X-0.0045Y1.3644I0.0390J0.0000
N2970G1Y1.3769
N2980G2X0.0470Y1.3254I0.0000J-0.0515
N2990G2X-0.0045Y1.2739I-0.0515J0.0000
N3000G2X-0.0560Y1.3254I0.0000J0.0515
N3010G2X-0.0045Y1.3769I0.0515J0.0000
N3020G1Y1.3894
N3030G2X0.0595Y1.3254I0.0000J-0.0640
N3040G2X-0.0045Y1.2614I-0.0640J0.0000
N3050G2X-0.0685Y1.3254I0.0000J0.0640
N3060G2X-0.0045Y1.3894I0.0640J0.0000
N3070G00Z0.2000
N3080G00Y1.3269
N3090G1Z-0.3000F20.0
N3100G1X-0.0030Y1.3254F50.0
N3110G1X-0.0045Y1.3239
N3120G1X-0.0060Y1.3254
N3130G1X-0.0045Y1.3269
N3140G1Y1.3394
N3150G2X0.0095Y1.3254I0.0000J-0.0140
N3160G2X-0.0045Y1.3114I-0.0140J0.0000
N3170G2X-0.0185Y1.3254I0.0000J0.0140
N3180G2X-0.0045Y1.3394I0.0140J0.0000
N3190G1Y1.3519
N3200G2X0.0220Y1.3254I0.0000J-0.0265
N3210G2X-0.0045Y1.2989I-0.0265J0.0000
N3220G2X-0.0310Y1.3254I0.0000J0.0265
N3230G2X-0.0045Y1.3519I0.0265J0.0000
N3240G1Y1.3644
N3250G2X0.0345Y1.3254I0.0000J-0.0390
N3260G2X-0.0045Y1.2864I-0.0390J0.0000
N3270G2X-0.0435Y1.3254I0.0000J0.0390
N3280G2X-0.0045Y1.3644I0.0390J0.0000
N3290G1Y1.3769
N3300G2X0.0470Y1.3254I0.0000J-0.0515
N3310G2X-0.0045Y1.2739I-0.0515J0.0000
N3320G2X-0.0560Y1.3254I0.0000J0.0515
N3330G2X-0.0045Y1.3769I0.0515J0.0000
N3340G1Y1.3894
N3350G2X0.0595Y1.3254I0.0000J-0.0640
N3360G2X-0.0045Y1.2614I-0.0640J0.0000
N3370G2X-0.0685Y1.3254I0.0000J0.0640
N3380G2X-0.0045Y1.3894I0.0640J0.0000
N3390G00Z0.2000
N3400G00Z0.8000
N3410G00X0.0000Y0.0000
N3420M09
N3430M30
%
Does this tell you what you asked.
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: daybowbow on November 06, 2014, 02:47:16 PM
Anyone have any ideas?
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: Vogavt on November 06, 2014, 07:03:27 PM
Okay, a few more questions.

What material are you cutting?

If this is metal and as you stated you're in inches, then plunging into the material at a feed rate of 20 seems a bit fast to me. Guess it depends on your horsepower.

Have you been successful in the past?

If so, what has changed with your machine?

Other than missing the G54 parameter in the posted code, I think you're possibly looking at a reinstall.

But, it seems your macros for the probing have gotten hosed up. Can you reinstall the macros? You might try that before doing a fresh installation of Mach3.

From looking at the code produced by Vectric it looks straight forward.
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: ger21 on November 06, 2014, 07:22:16 PM
Post the auto zero macro that you're using.
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: daybowbow on November 06, 2014, 10:04:37 PM
This is the zero macro that I am using. But remember. The zero script works fine when the gcode is not loaded. I can use this script zero everything correctly. Move it to another point over and over and it will work. But as soon as I load gcode the coordinates all change. Then when I click the auto zero tool button it will mess up and not work. It will do the two things I described in my first post,

[ZeroCode]
Rem Probe Down by PEU (Based On Erniebro Work)
FeedCurrent = GetOemDRO(818)  'Get the current settings
ZCurrent = GetOemDro(802)
Code "G4 P1"   'Pause 1 second to give time to position probe plate
Code "F100"   'slow feed rate to 100 MM/MIN
GageH = GetUserDRO(1152)
ZNew = ZCurrent - 20  'probe down 20 mm
Code "G31 Z" &ZNew
While IsMoving()
Wend
Call SetDro (2,GageH)
FinalMove = GageH * 1
Code  "G0 Z" &FinalMove
Code  "G0 Z" &25
Code "F" &FeedCurrent    'restore starting feed rate   
[/ZeroCode]
To awnser all the questions

What material are you cutting?  - I am cutting wood for not. General small signs and knick knacks. State outlines.

Have you been successful in the past?  - I have been successful. But before what I was making didn't require tool changes that needed to be exact. For example. I would V-Carve some lettering, then use an end mill to cut out an outline. Now I am to the point where I need one end mill to clear out sections then a small ball nose or end mill to do some details and if I don't zero it exactly you will be able to tell in the final cut.

If so, what has changed with your machine?   - Back to what I said earlier. More advanced pieces.



Thanks for the feedback. Any more ideas?
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: ger21 on November 06, 2014, 10:14:36 PM
What are your Native Units set to?

Your auto zero script is set up to work in metric, but your G-code puts Mach3 in Inch mode.
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: daybowbow on November 07, 2014, 06:42:53 AM
My vectric files are in inches. I will try in metric. But I have cut in the past and it works great. Would it really cause they much of an issie
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: ger21 on November 07, 2014, 07:45:24 AM
Yes, as you've seen.

When you start Mach3, it's in Metric mode.
As soon as you load g-code, Mach3 is in inch mode. All the values in your auto zero macro are in metric, so it no longer works correctly.


If you're going to be working in inches, then you should have Mach3 configured in inches.
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: edoctoor on November 07, 2014, 08:08:36 AM
What are your Native Units set to?

Your auto zero script is set up to work in metric, but your G-code puts Mach3 in Inch mode.

Is there a way that the auto zero script can determine the current mode (inch or mm)
and use an IF statement to adjust the zero script to match?

I am new... and like Linux it seems that the lone user has to hope that they find
the right solution out of thousands of post scattered around the net.


Sorry for sounding a bit negative; I really am not, it is just that I have struggled with my very first part for a very long time as my first part has tool changes and I have a hobby cnc that doesn't have a tool changer... and too many expensive
peaces of wood have been tossed in the garbage due to the Z randomly loosing consistency after many hours of operation. Again thank you for your kind words and your helpful tips and tricks.. you are appreciated
more than you will ever know during our struggle with the start-up learning curve.

Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: ger21 on November 07, 2014, 08:44:16 AM
Quote
Is there a way that the auto zero script can determine the current mode (inch or mm)
and use an IF statement to adjust the zero script to match?

Yes, A good reliable auto zero macro will check for inch/metric (and many other program states) and use the appropriate values. When the macro is finished, it should return Mach3 to the state it was in when the macro started.
If you don't do this, sooner or later you will run into problems.

Shameless plug - my 2010 screenset includes macros that work with both inch and mm's, and automatically zero's the tools after tool changes. All you need to do is change the tool, and click cycle start. It uses a separate fixed plate mounted to your machine for a reference position.
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: edoctoor on November 07, 2014, 09:01:29 AM
Shameless plug - my 2010 screenset includes macros that work with both inch and mm's, and automatically zero's the tools after tool changes. All you need to do is change the tool, and click cycle start. It uses a separate fixed plate mounted to your machine for a reference position.

LOL Thanks for your Shameless plug and the link to it within yours signature ;-)

Please correct me if I am wrong:
Are new Mach 3 users suppose to pick a Screenset such as yours or
the one found at kd-dietz.com to get started with Mach 3

I ask because I am afraid to install a Screenset as I do not know if
they change the Mach 3 install and will force me to do a reinstall of Mach 3
should I decide that I don't like the color choices etc..

That said, how would one determine what is the best Screenset for
a manual tool change cnc such as mine?

I have changed the properties on my Mach3Mill icon on my desktop

I right clicked on the Mach3Mill icon and chose Properties and
Changed the line that says
C:\Mach3\Mach3.exe /p Mach3Mill
to
C:\Mach3\Mach3.exe /p MyProfileName
Then clicked on OK to save

Can this method also be used to change Screensets?

Lastly, where do I get the white papers for the auto zero macro to learn how to
answer the following question:

Is there a way that the auto zero script can determine the current mode (inch or mm)
and use an IF statement to adjust the zero script to match?
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: ger21 on November 07, 2014, 09:13:07 AM
To be honest, I would recommend using the default screenset until you're comfortable working with Mach3. Trying to learn mach3 with a custom screenset can be more difficult, as controls may be not where you'd expect them.

There are no screensets at kd-dietz.com. He has a screenset designer for creating your own screensets.

No, a screenset should not change your Mach3 install. However, my 2010 Screenset will replace your default M6 macros, as those are what handles the auto zero during toolchanges in my screenset.

Most screensets are just different graphics and layouts, and have no effect on Mach3 operation. Choosing one is a matter of personal choice. A few, like mine, have added functionality (auto zero).

What you've changed is your Profile, which is an .xml file that stores your settings. While the .xml file contains the current screenset associated with that profile, the screenset is changed from within Mach3, using the View menu, and Load Screenset option.
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: edoctoor on November 07, 2014, 09:35:18 AM
Since I can not edit/del my post that had the Auto-Zero script can someone please
remove that post due to that Auto-Zero script not working and I don't want someone
to use it thinking that there is something wrong with their cnc.. when in fact I posted
a script that needs much work.

Thank you for your very informative and honest reply.

If I understand you; I can create a profile called Ger21 and then somehow install your screenset
to that profile and try your screenset without risk or cost?

Due to the lack of funds, may I please ask one more time.

Where do I get the white papers for the auto zero macro to learn how to
answer the following question:

Is there a way that the auto zero script can determine the current mode (inch or mm)
and use an IF statement to adjust the zero script to match?

Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: ger21 on November 07, 2014, 09:55:40 AM
Something like this is what I use:


CurrentFeed = GetOemDRO(818)  ' Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48)   ' Get the current G90/G91 state


'//////// the block below will set all your reusable vars depending on Inch or mm.
'//////// this sets the vars so you only need ONE large block of probing code.

If GetOEMLED(801) Then  ' On = English Measure INCH

FirstProbeDist = 6.0 ' Probe down 6 inches
FirstRetractDist = 0.05 ' Then retract .05 inch
SecProbeDist = 0.25 ' Then probe down .25 inches
FirstProbeFeed = 10.0 ' First probe feed @ 10 ipm
SecondProbeFeed = 1.0 ' Second probe feed @ 1 ipm
ClearAllow = 0.125 ' Max Allowable Clearance = Z Machine Zero - .125in

Else ' Off = Metric Measure MM

FirstProbeDist = 150.0 ' Probe down 150mm
FirstRetractDist = 1.0 ' Then retract 1mm
SecProbeDist = 6.0 ' Then probe down 6mm
FirstProbeFeed = 250.0 ' First probe feed @ 250 mm/min
SecondProbeFeed = 25.0 ' Second probe feed @ 25 mm/min
ClearAllow = 2.0 ' Max Allowable Clearance = Z Machine Zero - 2mm

End If

'//////// Error Condition checking code

If GetOemLED(16)<>0 Then ' Check for Machine Coordinates
Code "(Please change to working coordinates)"
Exit Sub ' Exit if in Machine Coordinates
End If

If GetOemLED(825)<>0 Then
Code "(Z-Plate Grounded Check connection and try again)"
Exit Sub ' Exit if probe is tripped
End If

Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: ger21 on November 07, 2014, 09:56:55 AM
This thread has a lot of information that you may find useful.
http://www.cnczone.com/forums/cnc-wood-router-project-log/36099-another-aussie-auto-tool-zero-setter.html

Also look through the Mach3 programmer's reference manual.
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: edoctoor on November 07, 2014, 10:06:41 AM
Thanks... I knew your ger21 looked familiar as I have read a lot of your posts on cnczone ;-)
 
Many thanks

Edoctoor
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: edoctoor on November 07, 2014, 10:28:23 AM
I have found the white papers at www.machsupport.com/help-learning/product-manuals/

http://www.machsupport.com/wp-content/uploads/2013/02/Mach3_V3.x_Macro_Prog_Ref.pdf (http://www.machsupport.com/wp-content/uploads/2013/02/Mach3_V3.x_Macro_Prog_Ref.pdf)

It looks like 137 pages of very well written documentation; I shall have some fun and see if I am able
to patch your snippet of code to what I have already found and come up with a solution.
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: daybowbow on November 08, 2014, 11:19:00 AM
So I have fixed the issue it seems. With my original zero code I simply just generated the gcode in mm. Didn't mess anything up and the computer is running well after a fresh install. Thanks for all the help. I'm embarresed it was so easy
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: ger21 on November 08, 2014, 11:28:59 AM
You should try to avoid mixing units at all costs. While you may get away with it most of the time, sooner or later something will go wrong.
Title: Re: Autozero and Coordinate issues are loading G-Code
Post by: ZASto on November 09, 2014, 11:25:46 AM
Code from Blue Screen b Big Tex (with minor modifications by me):

Code: [Select]
Sub Main()
'made it a sub, so you can return on "show stopper" errors

'UPDATED TOOL CHANGE ZERO SETUP SCRIPT
'Option Explicit
'Written by Big-Tex December 29 2010
'Modified by Poppa Bear, added Greolt's and Arbo's changes 08Dec2010

Dim xjobcoord, yjobcoord, zjobcoord, xmachcoord, ymachcoord, zmachcoord
Dim ZNew, ZPlate, Zplatetomaterial,PlateOffset, ZMaterialmachcoord, Zplatejobcoord
Dim xprobeloc, yprobeloc,xtoprobe, ytoprobe
Dim FirstProbeDist, FirstRetractDist, SecProbeDist
Dim CurrentFeed
Dim CurrentAbsInc

xjobcoord = GetDRO(0) 'get current job coordinate for X
yjobcoord = GetDRO(1) 'get current job coordinate for Y
zjobcoord = GetDRO(2) 'get current job coordinate for Z
xmachcoord = GetOemDRO(83) 'get current machine coordinate for X
ymachcoord = GetOemDRO(84) 'get current machine coordinate for y
zmachcoord = GetOemDRO(85) 'get current machine coordinate for z
xprobeloc = GetUserDRO(1100) 'get x machine coord of fixed plate
yprobeloc = GetUserDRO(1101) 'get y machine coord of fixed plate
xtoprobe = (xprobeloc - xmachcoord + xjobcoord) 'calc x move to fixed probe
ytoprobe = (yprobeloc - ymachcoord + yjobcoord) 'calc y move to fixed probe
CurrentFeed = GetOemDro(818) 'get current feed rate
PlateOffset = GetUserDRO(1151) 'get plate offset DRO
Zplatetomaterial = GetUserDRO(1102) 'get calculated material offset from somewhere else?
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state


'//////// the block below will set all your reusable vars depending on Inch or mm.
'//////// this sets the vars so you only need ONE large block of probing code.

If GetOEMLED(801) Then 'ON = English Measure INCH
FirstProbeDist = 6.0 'first probe travel
FirstRetractDist = 0.1 'first probe retract travel
SecProbeDist = 0.25 'second probe travel
FirstProbeFeed = 12 'First Probe Feed Speed
SecondProbeFeed = 2 'Second Probe Feed Speed
Zretract = -0.5 'Z retract
Else 'OFF = Metric Measure MM
FirstProbeDist = 150.0 'first probe travel
FirstRetractDist = 3.0 'first probe retract travel
SecProbeDist = 6.0 'second probe travel
FirstProbeFeed = 300 'First Probe Feed Speed
SecondProbeFeed = 50 'Second Probe Feed Speed
Zretract = -12 'Z retract
End If

'//////// Error Condition checking code

If GetOemLED(16)<>0 Then 'Checks for machine coordinates
Code "(Please change to working coordinates)"
Exit Sub 'ERROR! exit the macro
End If

If GetOemLED(825)<>0 Then
Code "(Z-Plate Grounded Check connection and try again)"
Exit Sub 'ERROR! exit the macro
End If

'//////// Start Probing Code, Probe In -Z direction.FIXED PLATE
'//////// The vars will be Inch or Metric from above if/else statment

Code "G0 X" & xtoprobe & " Y" & ytoprobe 'move to fixed plate location
Code "F" & FirstProbeFeed 'slow down feedrate to 12 ipm, or 300 mmpm
Zplate = (GetDro(2) - FirstProbeDist) 'probe move to z - 6", or 150mm
Code "G90 G31Z" & Zplate 'FIRST Probe Operation!

While IsMoving()
Wend

Zplate = GetVar(2002) 'read the touch point
Code "G1 Z" & (Zplate + FirstRetractDist) 'retract above hit point +0.1" or +3mm

While IsMoving()
Wend

Code "F" & SecondProbeFeed 'slow down feedrate to 2 ipm, or 50 mmpm
Zplate = (GetDro(2)- SecProbeDist) 'probe move to current z - 0.25", or -6.0mm
Code "G90 G31Z" & Zplate 'SECOND Probe Operation!

While IsMoving()
Wend

Call SetDRO(2,Zplatetomaterial) 'this sets Z DRO to calculated material offset
Sleep(250) 'pause for Dro to update.
Code "G53 G0 Z" & Zretract

While IsMoving () 'wait for probe move to finish retracting
Wend

Code "G0 X" & xjobcoord & "Y" & yjobcoord 'returns to the previous X Y job location

While IsMoving()
Wend

Code "F" & CurrentFeed 'returns to prior feed rate

'//////// End Probing Code,

If GetOEMLED(801) Then 'ON = English Measure INCH
Code "(Z axis is now zeroed in English Units)" 'puts this message in the status bar
Else 'OFF = Metric Measure MM
Code "(Z axis is now zeroed in Metric Units)" 'puts this message in the status bar
End If

If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
Code "G91"
End If

Code DoButton(0) 'Cycle Start

End Sub

I've also modified other button scripts to deal properly with Inch and mm measurements according to units to which the Mach3 is set (OEMLED 801)