Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Chuck D on April 02, 2019, 09:13:41 AM

Title: New guy frustration LOL
Post by: Chuck D on April 02, 2019, 09:13:41 AM
I am new to the forum new to CNC and new to mach3 so here I am.
I bought a machine and I am now trying to configure mach3 and I am moving along slowly and having troubles with my probe/ touch plate.
Right now I am looking for a new script that will enable me to use the touch plate. The one that I got from YouTube seemed to work but it would send my spindle 6in off the material surface and when I tried to run code it ran the code 6 in off the work surface. So I want to find a new script and see if that was the issue.
any and all help is appreciated and I will do my best to learn to navigate the forums as soon as possible thanks for your patience and help.
I am in the United States. Mid Michigan to be exact
Title: Re: New guy frustration LOL
Post by: ger21 on April 02, 2019, 09:36:04 AM
Are you using the parallel port, or a motion controller?
If a motion controller, which one.

Most chinese motion controllers do not support the GetVar command properly, which most autozero macros use.
Title: Re: New guy frustration LOL
Post by: Chuck D on April 02, 2019, 09:45:53 AM
I have a Mach 3 motion controller called WHHC MKX-IV. Runs thru the USB
Title: Re: New guy frustration LOL
Post by: ger21 on April 02, 2019, 10:46:57 AM
Then make sure you do NOT use a macro that has GetVAR() in it.
Title: Re: New guy frustration LOL
Post by: reuelt on April 02, 2019, 02:19:03 PM
I am new to the forum new to CNC and new to mach3 so here I am.
I bought a machine and I am now trying to configure mach3 and I am moving along slowly and having troubles with my probe/ touch plate.
Right now I am looking for a new script that will enable me to use the touch plate. The one that I got from YouTube seemed to work but it would send my spindle 6in off the material surface and when I tried to run code it ran the code 6 in off the work surface. So I want to find a new script and see if that was the issue.
any and all help is appreciated and I will do my best to learn to navigate the forums as soon as possible thanks for your patience and help.
I am in the United States. Mid Michigan to be exact
Attached is Tool Probe VB code I use (but I use with Parallel Port).
You need to change 2 Z values to suit your plate thickness and retracting height (commented in RED)
Or get the idea and edit the code you already have.

Reuel
Title: Re: New guy frustration LOL
Post by: Chuck D on April 02, 2019, 02:27:02 PM
[quote
Attached is Tool Probe VB code I use (but I use with Parallel Port).
You need to change 2 Z values to suit your plate thickness and retracting height (commented in RED)
Or get the idea and edit the code you already have.

Reuel
[/quote]

Thank you... I think thats the one I have now, But I will try and compare it.
Title: Re: New guy frustration LOL
Post by: reuelt on April 02, 2019, 03:57:06 PM
'Alternative Probe z surface macro 
‘Test probe is working first before using this macro

FeedCurrent = GetOemDRO(818) 'Get the current settings, OEM DROs (818)=Feedrate DRO
ZCurrent = GetOemDro(802) 'OEM DROs (802)=Z DRO
GageH = GetOEMDRO(1001) 'OEMDRO(1001)=Gage Block Height
ZNew = ZCurrent - 6 'probe down max. 6 inches
Code "G90F5" 'slow feed rate to 5inches/MIN
SetOemDRO(818,5)
Code "G4 P1" 'Pause 1 second to give time to position probe plate
Code "G31 Z" &ZNew
While IsMoving()
Sleep(10)
Wend
Call SetDro (2,GageH) 'DRO(2)=Z DRO
FinalMove = GageH + 1 ‘move 1 inch above gage height
Code "G0 Z" &FinalMove
Code "F" &FeedCurrent 'restore starting feed rate
SetOemDRO(818,FeedCurrent)
Title: Re: New guy frustration LOL
Post by: Chuck D on April 02, 2019, 07:07:10 PM
I'll give you my run down....
After turning on machine
I hit Mach  cords and zero all home.
After it finishes moving, I click the xyz zero buttons.
Then I move spindle over material datum and line it up. And zero my x&y buttons
I get touch plate and hit Auto Tool Zero.
It touches, zips up 5" stops and creeps up one more. The Z drop says....1".
I load Gcode and press go.....
Spindle turns on, drops...1" and start running code....5" off material
Title: Re: New guy frustration LOL
Post by: joeaverage on April 02, 2019, 07:14:29 PM
Hi,
I rather think that Gerry has already alluded to the problem, your controller does not conform to Machs
expectation with regards the implementation of G31 probing. You may be required to touch off in Z manually
or buy a controller that does conform.

Craig
Title: Re: New guy frustration LOL
Post by: Chuck D on April 02, 2019, 07:19:20 PM
My machine came with a touch plate, and the vendor told me it works(but it's up to me to figure out the set up)
Title: Re: New guy frustration LOL
Post by: joeaverage on April 02, 2019, 07:22:41 PM
Hi,
then get the vendor to help.....he sold it....he should support it!

Craig
Title: Re: New guy frustration LOL
Post by: reuelt on April 02, 2019, 07:23:09 PM
I'll give you my run down....
After turning on machine
I hit Mach  cords and zero all home.
After it finishes moving, I click the xyz zero buttons.
Then I move spindle over material datum and line it up. And zero my x&y buttons
I get touch plate and hit Auto Tool Zero.
It touches, zips up 5" stops and creeps up one more. The Z drop says....1".
I load Gcode and press go.....
You need to load gcode file first.
Then move spindle over material datum and line it up. And zero my x&y buttons
get touch plate and hit Auto Tool Zero.
after the auto tool zero you need to click on
[   REN.   ]
[ Toolpath] button
before
you
Click on [cycle start]


PS
The alternative Macro does not use getvar()
Title: Re: New guy frustration LOL
Post by: ger21 on April 02, 2019, 07:24:36 PM
Change this:
ZProbePos = GetVar(2002)

To this:
ZProbePos = GetOEMDro(802)
Title: Re: New guy frustration LOL
Post by: Chuck D on April 02, 2019, 07:52:38 PM
Hi,
then get the vendor to help.....he sold it....he should support it!

Craig
I had my last conversation with the vendor yesterday. He told me that they set it up for x y and z to move properly and the rest is up to me.
Title: Re: New guy frustration LOL
Post by: joeaverage on April 02, 2019, 09:01:48 PM
Hi,
ah!  Very frustrating, my guess is that he does not know how of maybe it can't be done.
Gerry has given a suggestion that would avoid an unsupported instruction.....try it.

Craig
Title: Re: New guy frustration LOL
Post by: Chuck D on April 02, 2019, 09:14:26 PM
Ok Guys... I got it to work and made 5 identical cuts in a row.
I really want to try and see what you all have mentioned and suggested, but I need to get on my PC to do that. To hard on my phone to follow. I want to thank you all.
Title: Re: New guy frustration LOL
Post by: Chuck D on April 03, 2019, 07:12:43 AM
Change this:
ZProbePos = GetVar(2002)

To this:
ZProbePos = GetOEMDro(802)

Gerry, I want to thank you for commenting, I was not able to really look at your inputs last night as I was off the PC. I am not fully knowing what or where I would make those changes. Is it in the script itself? I will post what I scripted in...
I see what you are talking about, about midway down. So now I'll ask you if you think I should change that still? Here I will bring us all up to speed about where I am. I reloaded the below script, and the only other thing I changed was when I loaded Gcode file, and I now hit the Regen Toolpath button,as Reulet suggested. The spindle now comes down to touch plate and rises up 1", and then runs the code just fine. I made a simple file of a circle in a square and added my name inside the circle just for fun. The file runs every time. I will go out this morning and See if I can get it to cut proper again. I need lots of practice. I cant thank you all enough.
///////////
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state

If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P3" ' this delay gives me time to get from computer to hold probe in place
Code "G90 G31Z-5. F4" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the exact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, .587) ' change .060 to your plate thickness and then adjust for final accuracy
Sleep 200 'Pause for Dro to update.
Code "G1 Z1. F50" 'put the Z retract height you want here, must be greater than the touch plate thickness
While IsMoving ()
Wend
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Code "F" &CurrentFeed 'Returns to prior feed rate
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if applicable
End If
If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
Code "G91"
End If
If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
Code "G0"
End If
Title: Re: New guy frustration LOL
Post by: reuelt on April 03, 2019, 08:02:28 AM
This line :-
ZProbePos = GetVar(2002) 'get the exact point the probe was hit

according to Gary should be changed to

ZProbePos = GetOEMDro(802)  'get the exact point the probe was hit


(Actually if it is working now - change IMHO is optional - reason GetVar(2002) was not working was a bug in the earlier version of add-on for a Chinese motion controller where they by mistake used GetVar(2002) and SetVar(2002) to do some calculations.
His assumption that all GetVar(NNNN) functions are NOT supported is probably NOT CORRECT.)



Title: Re: New guy frustration LOL
Post by: Chuck D on April 03, 2019, 08:42:56 AM
I'll give you my run down....
After turning on machine
I hit Mach  cords and zero all home.
After it finishes moving, I click the xyz zero buttons.
Then I move spindle over material datum and line it up. And zero my x&y buttons
I get touch plate and hit Auto Tool Zero.
It touches, zips up 5" stops and creeps up one more. The Z drop says....1".
I load Gcode and press go.....
You need to load gcode file first.
Then move spindle over material datum and line it up. And zero my x&y buttons
get touch plate and hit Auto Tool Zero.
after the auto tool zero you need to click on
[   REN.   ]
[ Toolpath] button
before
you
Click on [cycle start]


PS
The alternative Macro does not use getvar()

Well...for some reason that worked last night, but not this morning.
I will edit the code and Gerry suggested, and try that.
(This morning...it acts as before, rising 5" and then cutting air)
Title: Re: New guy frustration LOL
Post by: ger21 on April 03, 2019, 09:08:31 AM
Quote
His assumption that all GetVar(NNNN) functions are NOT supported is probably NOT CORRECT

I have several thousand people using my 2010 screenset, and a large number of them with Chinese motion controllers find that the GetVAR is often not supported by most chinese controllers. I do not know which ones specifically do or do not.

ZProbePos = GetOEMDro(802)


Should work with all of them.

If it works, there's no need to change it. If it doesn't, then make the switch.
Title: Re: New guy frustration LOL
Post by: Chuck D on April 03, 2019, 09:11:32 AM
Quote
His assumption that all GetVar(NNNN) functions are NOT supported is probably NOT CORRECT

I have several thousand people using my 2010 screenset, and a large number of them with Chinese motion controllers find that the GetVAR is often not supported by most chinese controllers. I do not know which ones specifically do or do not.

ZProbePos = GetOEMDro(802)


Should work with all of them.

If it works, there's no need to change it. If it doesn't, then make the switch.
I am back to "Not working", so I will make the edit today. I don't understand the code...but I am getting more comfortable with the editing part. :) Thank you sir.
Title: Re: New guy frustration LOL
Post by: Chuck D on April 03, 2019, 09:43:03 AM
I made the change to the script as Gerry said, and it works now, Thanks again Gerry. I will keep all posted on my progress. I appreciate all inputs from the forum so far. This is my first post, I don't think it will be my last.
Gerry. On your signature line, you have listed a 2010 screenset. What is that?
Title: Re: New guy frustration LOL
Post by: ger21 on April 03, 2019, 10:15:41 AM
Quote
His assumption that all GetVar(NNNN) functions are NOT supported is probably NOT CORRECT.)

Or maybe it is.  >:D




Quote
Gerry. On your signature line, you have listed a 2010 screenset. What is that?

It's a different screen for Mach3. It also comes with macros that automatically zero the tool after a tool change. Click the link.
Title: Re: New guy frustration LOL
Post by: Chuck D on April 03, 2019, 10:18:40 AM




Quote
Gerry. On your signature line, you have listed a 2010 screenset. What is that?

It's a different screen for Mach3. It also comes with macros that automatically zero the tool after a tool change. Click the link.
[/quote]

Ok cool. Is that something that will work with my import unit? (:( )
Title: Re: New guy frustration LOL
Post by: ger21 on April 03, 2019, 10:34:15 AM
I can't guarantee that it will, but I do have a set of alternate macros without the GetVAR() that seem to work for most people with Chinese controllers. They are available for download separately on my site.
Title: Re: New guy frustration LOL
Post by: ger21 on April 03, 2019, 10:35:34 AM
Where in Michigan are you? I'm in the northern Detroit suburbs.
Title: Re: New guy frustration LOL
Post by: Chuck D on April 03, 2019, 11:30:07 AM
Where in Michigan are you? I'm in the northern Detroit suburbs.

Oh  great!!
I am just north of Lansing about 15mile. near St.Johns
Title: Re: New guy frustration LOL
Post by: reuelt on April 03, 2019, 03:25:26 PM
Quote
His assumption that all GetVar(NNNN) functions are NOT supported is probably NOT CORRECT.)

Or maybe it is.  >:D


Gerry,
Fred had a happy ending because he found "a USERDRO conflict" and not  "GetVAR() not supported by Chinese Motion Controllers"
Quote:-
"As I wanted to give you as many informations as possible including a copy of the scripts involved, I found the problem !
It was a USERDRO conflict.
the script of the "set variable position" is using the same default USERDRO of the VFD monitor:
x = GetABSPosition(0)
y = GetABSPosition(1)
z = GetABSPosition(2)
SetUserDRO 1000, x
SetUserDRO 1001, y
SetUserDRO 1002, z
Fred.
Endquote/
(https://www.machsupport.com/forum/index.php?topic=39662.msg266084#msg266084)

So if any two programmers was trying to read and write to the same "GLOBAL VARIABLES", there will be a problem.

Reuel


Title: Re: New guy frustration LOL
Post by: samusad on April 29, 2019, 05:44:45 PM
I also was disappointed with my STB5100 card, I tried following the tips of this topic but I was all messed up, I do not understand programming, I used my machine to do the pc with autoleveller and mach3 through the parallel port and XP,
now using windows10 and usb card did not work, please help me with a macro, that can work, until I got the probe down but it does not save anything on the mach3 and when it goes to cut the pcb it's like there is no autoleveller. any point on the board shows the same value as Z
Title: Re: New guy frustration LOL
Post by: joeaverage on April 30, 2019, 03:16:10 AM
Hi,
I use Autoleveller and find it works well. What version are you using AutlevellerAl or AutolevellerAE.
My preference is the AE version, it produces a file of probe data and THEN 'autolevells' the PCB.
It is plainly obvious that the probe data is being incorporated into your file.

Lots of Chinese made controllers do not handle probing at all well. It may be that your board is apparently
probing but not in fact producing any valid data. The AE version of Autoleveller allows you to inspect the probe data
and draws a 3D representation of the probed surface,  so you get a visual indication of the results.

Craig
Title: Re: New guy frustration LOL
Post by: samusad on April 30, 2019, 07:50:15 AM
I'm using this version AutolevellerAE-0.9.5u2.
can you show me your settings so I can tntar and see if it works with my STB5100 Chinese controller?
Title: Re: New guy frustration LOL
Post by: AD on November 02, 2019, 08:00:42 PM
Gerry, Chuck, Reuelt: Thanks so Much!!

Just opened basically the same issue looking for an Auto Tool Zero answer for China made boards (I have the infamous USB STB5100 Controller Board).

Luckily I stumbled on this topic and thanks to your work my problem is gone!

If you happen to go through Windsor, Can, PM me - buying a beer!
Title: Re: New guy frustration LOL
Post by: tonyfoale on November 26, 2019, 03:55:13 PM
Autoleveller is a great piece of software but when milling PCBs I prefer to hold the workpiece flat, eliminating the need for profile correcting software.  Simple vacuum chucks can do this extremely well.  I have made several for different size boards.  Here is a 20 minute video showing the smallest one,  the second half of the video shows measurements which illustrate just how flat the boards are held.
https://www.youtube.com/watch?v=Xn7rKm1RwYM
Title: Re: New guy frustration LOL
Post by: joeaverage on November 26, 2019, 05:34:52 PM
Hi,
my mill is flat to within 4um over its XY surface but the problem is the PCB blank material is not perfectly flat,
even with good name brand board you can expect up to 10um over 100mm deviation from flat.

A good vacuum chuck should 'pull' a PCB blank flat to within the flatness of the chuck.

I find that Autoleveller allows Z axis placement within 6um over the entire PCB blank despite the blank
having as much as 0.1mm warp/bow. Thus when I isolation route boards I command a Z axis depth of 0.05mm (50um)
( using 1oz or 35um copper PCB) and that results in perfect isolation WITHOUT undue cutting of the underlying fibreglass.

I have used vacuum but disliked the fact that if drilling through holes in your PCB then you lose vacuum. You can of course
drill holes last and retain the PCB with tape, after all the hole drilling is not especially sensitive to placement in Z but of course
is critical in XY. Additionally I found that having to make a different vacuum chuck for different sized boards tedious.

I use double sided tape to hold the board down onto a sacrificial polycarbonate carrier that fits into my mill vice. The polycarbonate
gets replaced every 50 boards or so. The double sided tape does a good job of holding the blank, it does not 'pull' it flat with anything
like the surety of vacuum, but still not bad. Then its probed using AutolevellerAE. For an 80x100mm the probing takes about four minutes.
Thereafter the isolation routing takes place in an identical fashion be it vacuum chuck or doublesided tape/Autoleveller.

All-in-all I find the doublsided tape/Autoleveller combination to be effective and fast, especially as almost ALL my boards are one offs,
without the overhead of the vacuum plant and vacuum tooling.

Craig
Title: Re: New guy frustration LOL
Post by: tonyfoale on November 26, 2019, 06:04:36 PM
I do not drill into the vacuum plate, that would be real dumb and after a few holes you would lose the vacuum anyway.
Title: Re: New guy frustration LOL
Post by: joeaverage on November 26, 2019, 06:41:42 PM
Hi,

Quote
I do not drill into the vacuum plate, that would be real dumb and after a few holes you would lose the vacuum anyway.

Yes, that is the point. Thus in order to do a PCB you have to remove it from the vacuum chuck after being isolation routed then
set it up on a spoil board with EXACT registration before you can drill the through holes. Considerable messing around.

I use 1/2 polycarbonate because I was given a whole bunch, as a spoil board. I anticipate that when I drill through holes the
underlying spoil board will get drilled a wee bit as well. Also when I run around the periphery of the board will an endmill to
cut/machine to final size likewise a groove will be machined into the spoil board. Because the blank is double sided taped to the
spoil board it does not shift and so I do not have to do ANY mid-process alignment/registration.

If I have to flip the board (two sided) I use registration pins, actually short lengths of 1.6mm welding wire, into holes drilled
while the board in in the upright position. Too easy!!!

Craig