Re: Touch-off plate for CNC router?
Your code looks ok. You need 'o100 sub' at the start and 'o100 endsub' at the end. Try your code.
However you don't actually use #2.
Also your rapid up at the end should just be G91 G0 Z20 because Z0 has been set to the correct height already
I would do:
[Code]
o100 sub
#1 = 1.47 (PLATE THICKNESS)
#2 = 2 (UP OFF PLATE FOR 2ND TOUCH)
G21 (metric)
(DEBUG,CHANGE TOOL AND PLACE TOUCH PLATE UNDER TOOL THEN PRESS START TO CONTINUE)
G10 L20 P0 Z0 (sets current position as Z0)
G38.2 Z-40 F250 (fast probe down to Z-40 at lowest)
G90 G0 Z[#5063+#2] (rapid back up to 2units above probe trigger point)
G91 G38.2 Z-3 F15 (slow probe down, note it only probes a little lower than the rapid up)
G10 L20 P0 Z#1 (set Z0 based on plate thickness)
G90 G0 Z20 (rapid up to Z20)
o100 endsub
(DEBUG,REMOVE TOUCH PLATE AND PRESS START TO CONTINUE)
[/code]
If you have further problems please attach your .ini, .hal and custom_postgui.hal
Re: Touch-off plate for CNC router?
[QUOTE=pippin88;1630544]
Also your rapid up at the end should just be G91 G0 Z20 because Z0 has been set to the correct height already
If you have further problems please attach your .ini, .hal and custom_postgui.hal[/QUOTE]
I figured oud yes, no problems with that everything works just great thank you verry much,
however ... G91 G0 Z20
on page 11 in this thread says that G10 is bether ... still don't know why ... ...
my G-code now looks like this
[code]
<pre>
o100 sub
#1 = 1.47 (PLATE THICKNESS)
#2 = 2 (UP OFF PLATE FOR 2ND TOUCH)
#3 = -3.5 (Distance to retouch)
#4 = 10 (offset 10mm - 1.47mm = 8.53 mm)
G21 (metric units)
(DEBUG,PROBE is ACTIVE)
G10 L20 P0 Z0 ( Set current Z position to 0 so that we will always be moving down )
G38.2 Z-60 F450 (1st probe move)
G90 G0 Z[#5063+2.5](move #2 above PCB plate for 2nd touch)
G91 G38.2 F150 Z#3 (retouch max -3.5mm)
G90 G0 Z[#5063+#4-#1] (Plate tickness + offset)
G10 L20 P1 Z10 (Set Z to current position = PCB + OffSet = 10mm )
(DEBUG,REMOVE TOUCH PLATE AND PRESS START TO CONTINUE)
o100 endsub
</pre>
[/code]
Re: Touch-off plate for CNC router?
Glad you got it working.
I like your use of declared parameters at the top of the code.
For others, the following is probably the simplest / cleanest code:
[B]This has not yet been tested, I'm currently building a new machine[/B]
[code]
o100 sub
#<plate> = 1.47 (plate thickness)
#<retouch> = 1 (distance to move up before slow retouch)
(Notes: This code does an incremental fast probe down, sets Z0 offset the declared #<plate> thickness, rapids up #<retouch> distance, then does a slow probe down a maximum of 0.5mm more than #<retouch>, then sets Z0 offset the declared #<plate> thickness, finally performing a rapid up to Z25 above material. G90 = absolute distance mode, G91 = incremental distance mode)
G21 (metric units)
(DEBUG,PROBE is ACTIVE)
G91 G38.2 Z-20 F50 (1st probe move, incremental move down max of Z-20 at 50mm/min)
G10 L20 P0 Z#<plate> (Set Z0 offset plate thickness)
G90 G0 Z#<retouch> (move #<retouch> distance above PCB plate for 2nd touch)
G38.2 Z-#<retouch>+0.5 F10 (slow second touch to max of #<retouch> distance + 0.5mm)
G10 L20 P0 Z#<plate> (Set Z0 offset plate thickness)
G90 G0 Z25 (rapid up to 25 above material)
(DEBUG,REMOVE TOUCH PLATE AND PRESS START TO CONTINUE)
o100 endsub
[/code]
Re: Touch-off plate for CNC router?
[QUOTE=pippin88;1630660]Glad you got it working.
[/QUOTE]
Heheh, tnx, i'm starting to learn programing G-code, and because i'm IT, I love to have varibles declared at the begining in case of making changes (diferent touch plate or something like that) ;)
1 Attachment(s)
Re: Touch-off plate for CNC router?
[QUOTE=pippin88;1630660]Glad you got it working.
For others, the following is probably the simplest / cleanest code:
[B]This has not yet been tested, I'm currently building a new machine[/B]
[code]
o100 sub
#< plate> = 1.47 (plate thickness)
#< retouch> = 1 (distance to move up before slow retouch)
(Notes: This code does an incremental fast probe down, sets Z0 offset the declared #<plate> thickness, rapids up #<retouch> distance, then does a slow probe down a maximum of 0.5mm more than #<retouch>, then sets Z0 offset the declared #<plate> thickness, finally performing a rapid up to Z25 above material. G90 = absolute distance mode, G91 = incremental distance mode)
G21 (metric units)
(DEBUG,PROBE is ACTIVE)
G91 G38.2 Z-20 F50 (1st probe move, incremental move down max of Z-20 at 50mm/min)
G10 L20 P0 Z#<plate> (Set Z0 offset plate thickness)
G90 G0 Z#< retouch > (move #<retouch> distance above PCB plate for 2nd touch)
G38.2 Z-#< retouch >+0.5 F10 (slow second touch to max of #<retouch> distance + 0.5mm)
G10 L20 P0 Z#< plate > (Set Z0 offset plate thickness)
G90 G0 Z25 (rapid up to 25 above material)
(DEBUG,REMOVE TOUCH PLATE AND PRESS START TO CONTINUE)
o100 endsub
[/code]
[/QUOTE]
i made quick test of your g-code ... LinuxCNC says "bad character '+'
so i made the change
<retouch> + 0.5 -> I made new variable -> #< 2nd> = [#< retouch> + 0.5] and then changed line
G38.2 Z-#< retouch>+0.5 F10 to
G38.2 Z-#<2nd> F10
And i deleted "Note" because i was getting error "Command too long"
END CODE:
[code]
o100 sub
#< plate> = 1.47 (plate thickness)
#< retouch> = 1 (distance to move up before slow retouch)
#< 2nd> = [ #< retouch> + 0.5 ]
G21 (metric units)
(DEBUG,PROBE is ACTIVE)
G91 G38.2 Z-20 F50 (1st probe move, incremental move down max of Z-20 at 50mm/min)
G10 L20 P0 Z#< plate> (Set Z0 offset plate thickness)
G90 G0 Z#< retouch> (move #<retouch> distance above PCB plate for 2nd touch)
G38.2 Z-#< 2nd> F10 (slow second touch to max of #<retouch> distance + 0.5mm)
G10 L20 P0 Z#< plate> (Set Z0 offset plate thickness)
G90 G0 Z25 (rapid up to 25 above material)
(DEBUG,REMOVE TOUCH PLATE AND PRESS START TO CONTINUE)
o100 endsub
[/code]
EDIT: I don't know why it doesnt show # < plate> ; # < retouch> ; # < 2nd> in code sections, so remember to delete blank space after '<'
bether to copy from attachment:
Re: Touch-off plate for CNC router?
folc, thanks for correcting that. Wasn't 100% sure on the correct syntax for adding to parameters.
The forum converts HTML automatically and if it doesn't recognise a tag it strips them. You can turn off this feature off when you post (have to 'go advanced'). I had to do it for my post above.
Re: Touch-off plate for CNC router?
I keep getting the error base-thread not found. addf failed.
When I comment this out. I get the error
parport.0.pin-15-in-out does not exist.
Prior to this I already had the hal meter seeing the pin-15 and the True when I touch the plate.
Thanks
Bob
[QUOTE=pippin88;1631894]folc, thanks for correcting that. Wasn't 100% sure on the correct syntax for adding to parameters.
The forum converts HTML automatically and if it doesn't recognise a tag it strips them. You can turn off this feature off when you post (have to 'go advanced'). I had to do it for my post above.[/QUOTE]
Re: Touch-off plate for CNC router?
I gaining some ground on this touch plate setup.
All the buttons show up. All buttons work except the Z-Axis Touchoff. I'm not sure what this is suppose to do.
When I manually hold it down the Z-Down it stops on the plate.
Every so often G92 keeps getting numbers in it. Oposite of the Z axis reading. Then if I home Z it changes and the G92 does also.
But the change is no where the 0.36 for the thickness of my plate.
Does the thickness have to be more?
When I try to load 100.ngc I get the error near line 2 of 100.ngc bad character '<' used.
Thanks
Bob
Re: Touch-off plate for CNC router?
If you copied the code from folc's post, then you need to delete the space after the lesser than character (space just before plate, retouch, and 2nd throughout the code)
Re: Touch-off plate for CNC router?
I'm using Linuxcnc 2.6.7 if that might have anything to do with it.
I used his o100 sub.txt file and checked for the spaces. None in there.
The only thing not doing anything is the Z-Axis Touchoff button. Is that suppose to auto set Z?
Thanks
Bob
Re: Touch-off plate for CNC router?
Bob,
[B]You'll need to post your .ini, .hal and any post_gui.hal files.[/B]
You may need to zip them for the forum to accept the upload.
"parport.0.pin-15-in-[B]out[/B]" is a problem, because a pin is either: In, Out, or In-not (signals when pin is not high).
Are you running servos or steppers?
You need to describe exactly what happens when you press the Z-Axis touchoff button.
Do nothing at all happen?
Does the Z axis move down?
etc.
1 Attachment(s)
Re: Touch-off plate for CNC router?
The pin 15 was a fat finger. Those other below are all fixed. I have all the buttons etc.
When I click the Z-Axis Touchoff button nothing happens. If I press Touchoff while the MDI tab
is forward it tells me I can't issue command while not homed. So I home all the Axis' and when I press
the touchoff it tells me Probe move on line zero would exceed joint 2's negative limit.
Every once a while G92 will get numbers the oposite of what Z-Axis is. I haven't been able to determin
what is causing this.
No Z-Axis does not move.
Zip file attached.
The paperwork says stepper motors.
It was a gift from my son a couple weeks ago. He didn't like me using the Pool Acid/ Preoxcide etching process.
It's one of those China 3020T-DJ routers. I didn't want to tell him those are mostly junk but this one seemed to be
the most popular to be fairly decent.
Told him I could have developed several dozen by now. But the little sample I did turned out really nice.
I was actually impressed how it looked. A couple spots were to high, so I will use the autoleveler and see what
it does.
Thank you.
[QUOTE=pippin88;1675048]Bob,
[B]You'll need to post your .ini, .hal and any post_gui.hal files.[/B]
You may need to zip them for the forum to accept the upload.
"parport.0.pin-15-in-[B]out[/B]" is a problem, because a pin is either: In, Out, or In-not (signals when pin is not high).
Are you running servos or steppers?
You need to describe exactly what happens when you press the Z-Axis touchoff button.
Do nothing at all happen?
Does the Z axis move down?
etc.[/QUOTE]
Re: Touch-off plate for CNC router?
I'll have a look at your files tomorrow.
I'm confused as to why G92 comes in to this. G92 offsets all coordinate systems and is usually used for gang fixture plates, or gang tooling. I don't know what you mean by G92 will "get numbers"? You tell LinuxCNC an offset / position via G92.
Unless you are doing something slightly tricky / multiple workpieces, then you should only be dealing with G54, the default world coordinate system. LinuxCNC manuals cover all the GCodes quite well.
With your Z axis: if it moves up, is that a positive move (numbers increase)?
All that the Z auto touchoff does is set Z0. It doesn't do anything for non-level workpieces such as warped pcb stock.
Re: Touch-off plate for CNC router?
Thanks, no problem, no rush. I have to head out in a couple hours myself.
I'm not sure why it gets numbers in it either. I issue a MDI command G92 Z0.000 and it zeros it out and I start over.
None of that tricky stuff. I have only done a small gray scale variant to learn it and a small 2"x2" test PCB. That's been all. Just those. Still learning it.
I did just did the update to LinuxCNC 2.6.7 because they said gmoccapy was in it, but that gives modual config errors. It's running ubuntu 10.04.
Been thinking of upgrading it to 12.04. I run 14.04 on my systems.
It's also on a stand alone 32bit system for the router, and there isn't anythign on it yet I need to worry about.
Re: Touch-off plate for CNC router?
Bob,
You are using classic ladder. I've never dealt with classic ladder.
I use the o subroutine method, which I find easier. I have a guide here: [url=http://7xcnc.com/software/probing/z-touch-plate/]7xCNC - Minilathe CNC :: LinuxCNC Z Touch Off Plate[/url]
What is the travel on your Z axis? LinuxCNC will give a travel error (Joint 2 means Z axis) if you try to get it to move past the travel area. The first move your code asks for is Z-50.
Re: Touch-off plate for CNC router?
From my sacrafice board all the way up/down is 54mm
From my main surface all the way up/down is 60mm
So I only selected 50 above and -5 below just to keep in inside it's range.
I'm not familiyar with the classic ladder. I think it might be a default of Linuxcnc.
It gives this error from any point I zero Z and then press your Z-Axis Touchoff, or touchoff Z from the manual.
I had the one from the page in 100.ngc when I first started working on it. After I used the download of all the files
when I saw you mentioned you like his.
I just tried your code in 100.ngc from your page and I removed all notes etc. I still get the line 2 error about
Bad character '<' used. There not a < in the file except
Line 1: <pre>
and last line: </pre>
and there is no space in either of those.
There is a space on line 2 between.
o100 sub
Does that space need to be taken away? Those are letter "o" in front of 100 on your page.
and second from last line
o100 endsub
[QUOTE=pippin88;1675310]Bob,
You are using classic ladder. I've never dealt with classic ladder.
I use the o subroutine method, which I find easier. I have a guide here: [URL="http://7xcnc.com/software/probing/z-touch-plate/"]7xCNC - Minilathe CNC :: LinuxCNC Z Touch Off Plate[/URL]
What is the travel on your Z axis? LinuxCNC will give a travel error (Joint 2 means Z axis) if you try to get it to move past the travel area. The first move your code asks for is Z-50.[/QUOTE]
Re: Touch-off plate for CNC router?
Bob, upload your complete config and o100 file please.
1 Attachment(s)
Re: Touch-off plate for CNC router?
Hasen't changed much since the last one. Only the 100.ngc has been changed so far.
Thanks
Bob
Re: Touch-off plate for CNC router?
Bob, there is nothing in the first config you posted that uses the o100 method, I think you are trying to mix two ways of doing this.
I'll have a look at that newer config you posted later on.
Re: Touch-off plate for CNC router?
I used all the files downloaded that folc uploaded to this. I tried to manually load 100.ngc file and got that error.
I don't know enough about this crazy machine. It's not critical. I can always manually setup the axis' to zero.
I'm happy that it's stopping when it touches the plate.
The auto leveler I was talking about was this one [url=http://www.autoleveller.co.uk/autoleveller-guide/]AutoLeveller Guide | Autoleveller[/url]
I haven't tried it yet but should be ready to in a couple days.