Hello Guest it is March 28, 2024, 03:21:13 PM

Author Topic: Set Z to zero automatically?Auto tool zero questions  (Read 85087 times)

0 Members and 1 Guest are viewing this topic.

Re: Set Z to zero automatically?Auto tool zero questions
« Reply #40 on: March 17, 2007, 12:44:46 PM »
ok so Ive finally gotten around to trying this. I set everything up. added the script from earlier in this post to the "auto zero" button on the program run screen. I havnt made a touch plate yet so Im just holding the wires and tapping them together at the proper moment to test things( i know Im lazy). anyhow everything works great right up to when the controller retracts the z axis to its safe height. it always abruptly stops short of the set height. it always stops roughly at the same spot about .5'' short of the height. I tried changing the retract height and it in turn changed the spot where it is abruptly stopping at but still short of the height. Its quite a hard stop. its not tripping my estop or anything but it seems strange. any one got any ideas on how to fix this. I will post my  xml for all to look at

Offline Scott

*
  •  139 139
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #41 on: March 17, 2007, 06:07:09 PM »
GNBG,

Try changing your 'Safe Z Setup' to be in work coordinates and see if that helps.
Scott
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #42 on: March 17, 2007, 07:08:08 PM »
I got it to work by changing the retract move from a rapid to a feedrate move. not sure why that is but it works.
guess ill fool around with my motor settings and see if its a motor problem. or maybe noise.

Offline Greolt

*
  •  956 956
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #43 on: April 03, 2007, 04:11:40 AM »
Scott

Can you help me to understand your macro for tool height.

I have looked at the Wiki etc. and think I understand most of it but there are a few points that are eluding me  ;D

And maybe if Scott is not on line someone else may give me a few pointers. ;)

CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
PlateThickness = GetUserDRO(1151) 'You could put your z-plate thickness here instead
ProbeFeed = GetUserDRO(1152) 'You could put a probing feedrate here instead.


These User DROs are ones that you put in your screens with Screen designer I guess

Code "G90 F" &ProbeFeed

If GetOemLed (825)=0 Then
Code "G4 P5" 'Time to get to the z-plate


What is the value of P (seconds?)

Code "G31Z-5 F" &ProbeFeed
While IsMoving()
Wend


The following three lines is what I mostly don't understand

Code "G4 P0.25"   What is this pause for

ZProbePos = GetVar(2002) Don't know what "GetVar (2002)" is

Code "G0 Z" &ZProbePos  Don't understand this line. Maybe when the previous line is explained it will then be obvious  :)


While IsMoving ()
Wend
Call SetDro (2, PlateThickness)
Code "G4 P0.5" 'Pause for Dro to update.
Code "G0 Z2.0" 'Change the Z retract height here
Code "(Z axis is now zeroed)"
Code "F" &CurrentFeed
Else
Code "(Z-Plate is grounded, check connection and try again)"
Exit Sub
End If


I really want to get this going on my machine and also get some level of understanding of this stuff. :)

Thanks for any help,   Greg
« Last Edit: April 03, 2007, 05:55:14 AM by Greolt »
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #44 on: April 03, 2007, 07:30:55 AM »
yeah I never fully understood it either. but I cut and pasted it into the script editor for the auto z button on the program run screen and it works like a charm. I did slow the feedrate to 15 for my comfort and I just entered the plate thickness directly into the script where it sais you could put your plate thickness here. But If you asked me to write this script from scratch. Id have no idea where to begin. Im interested in learning more on this too. I have watched the video and browsed over the wiki. but Im affraid if your not coming from a place with at least some programing experience. the learning curve is a bit steep.

Offline Scott

*
  •  139 139
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #45 on: April 03, 2007, 07:47:39 AM »
Hey Greg,

Yes, the plate thickness and probe feed are added to the screen with a designer (Screen4 or waiting for the latest JetCam designer).

The value of P for me is in seconds, but you can also have it be set to milliseconds in 'General Config'.  This just give me enough time to get from the computer to the Z-plate and hold it in position.

The "G31Z-5 F" &ProbeFeed is a G-code probing cycle that records the position of the axis when contact is made.  The -5 value is just a amount that should allow it to reach the plate from any Z axis position it may be started at.  You can increase this if you have more travel because if it travels 5" without contact, the height won't be set.  I think I increased mine to 7"  If you work in millimeters, you will have to adjust some of these values.

The While IsMoving() is to keep the macro from continuing on until the previous requested action is completed.

The "G4 P0.25" pause is just to be sure that the position has had time to be recorded within Mach.

GetVar(2002) is a internal variable that is the exact position where the probe made contact, not where the axis stopped at.  Because the axis can't stop immediately, there can be a slight overrun.  Although, if your probe feedrate is slow enough (about 20ipm) it's almost unnoticeable.  When the macro runs, you can feel the slight adjustment made due to the difference between the axis position and where the probe actually hit at, which is what the Code "G0 Z" &ZProbePos line does.

Hope this helps to understand the flow of the macro.  I also have another one much the same that can be used to set X & Y to the inside corner of a jig/fixture or the outside corner of the material.

If you need help setting up a screen, just ask.

Regards,
« Last Edit: April 03, 2007, 07:55:19 AM by Scott »
Scott

Offline Greolt

*
  •  956 956
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #46 on: April 03, 2007, 04:41:05 PM »

Hey thanks for that Scott. I think I have now got that.

My problem is that I can usually get this stuff into my head, but can't for the life of me get it to stay there  ;D


Guynamedbathgate, I hear what your saying.  I really like to be able to understand why a thing works. :)


Any one know where I can find reference to "GetVar (2002)"   Is it in the Wiki or PDFs ?

Greg

EDIT,  I can't find the setting for time units "P" on the General Config page.  Is it still there?
« Last Edit: April 03, 2007, 04:46:25 PM by Greolt »

Hood

*
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #47 on: April 03, 2007, 04:56:14 PM »
Here you go.
Hood

Offline Greolt

*
  •  956 956
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #48 on: April 03, 2007, 11:01:33 PM »

OK I feel suitably chastised.   ;D

Plane as the nose on your face now that I see it. 

Thanks Hood

Offline Scott

*
  •  139 139
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #49 on: April 03, 2007, 11:28:19 PM »
Reference to GetVar (2002) is on the Wiki under "How to get data from a probe".  Waaay down at the bottom.  ;)
Scott