Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: LowryIndustries on August 18, 2013, 02:40:57 AM

Title: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: LowryIndustries on August 18, 2013, 02:40:57 AM
I would like to manually set Current Position, Machine Coord, and Work Offset to zero and have found no way to do so.

My machine is a Bridgeport Series II running Mach3 Ver. R3.042.038 on a good XP system.  The Bridgeport has built in x and y axis position displays so all I have to do is startup the machine and jog the bed to the correct x and y positions, then press RefAllHome to zero Current Position to that location. 

Or so one would think.  When I press RefAllHome I notice my x axis moves a slight bit resulting in the Current Position changing slightly.  When I move the bed so Current Position is back to zero I find that either or both the Machine Coord and Work Offset isn't at zero.  I want them all at zero.  I want to simply move the bed to any location and set that location to zero for all.

The settings Copy G54 from G59.253 is not checked, Persistent Offsets and Persistent DRO's is checked.
G54 is set to all zero's.

This should be easy.  It's not.  I'm totally stumped.
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: Hood on August 18, 2013, 04:15:35 AM
If you press RefAll and your machine has no Home switches set up then Machine COORDs will be set zero (or the value you have in Home Off) at the position you are presently at.
If your Work Offset is not also zero (ie the DROs do not read zero in Mach) then press the Zero at the side of each DRO and that will set them Zero.

You mention the axis moves slightly when you press RefAll, are you meaning it physically moves or just the DRO? If the former then it should not do that and would seem to be an issue with your config, so attach your xml if that is the case.


Hood
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: LowryIndustries on August 18, 2013, 04:50:41 AM
Thank you very much for your help.  I hope this reply gets to you.  My first reply timed out on this end so I am trying again.

You are correct that my machine has no home switches on the x and y axis, only on the z.

I have attached the xml file because when I start up Mach3 the x axis moves slightly.  This happens during the time Mach3 is loading and not at any other time.
Then - I press the reset button to enable Mach3 control and jog the axis back to the right place.
Then - I press the RefAll to set the coordinates to zero.

This all works just fine except now the Machine Coord, and Work Offset settings are off by the amount I moved the x axis to return to my intended zero.

So as a recap, the x axis bumps a step or two when Mach3 is loading.
Returning the x axis to where I want it to be and pressing RefAll sets Current Position to all zeros, but now the Machine Coord, and/or Work Offset is off by the exact distance I moved the x axis.

Wow.
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: LowryIndustries on August 18, 2013, 04:55:31 AM
I would have thought there would be some way of forcing all the settings to zero by just moving the axis where you want them to be and pressing a button to reset Current Position, Machine Coord, and Work Offset to zero at that location.
Apparently not, which I find astounding.
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: Hood on August 18, 2013, 05:28:03 AM
When you start Mach there is a good chance your axes will move slightly, that is why you should really use an accurate method of homing the machine if you are wishing the position to be accurate from session to session.

Moving the X to where you want zero to be and pressing RefAll should set both machine coords and work coords to zero, assuming you have no work offset, which in the xml you attached is true. I have tried it with your xml and it does do exactly as it should.


Now to your next post, you can quite easily add a button to the screen or even modify the RefAll button to do a RefAll then Zero all axes work offsets. However doing it the standard way with accurate home switches would be the best all round way to do things I would think, it is the only way you will always be sure that you are exactly the same position each time you start Mach and home.
 Altering the RefAll script will assure that machine coords and offset coords will be zero when you press the button but that will not ensure that your machine is in the same position it was yesterday when you did that, unless you have a fool proof way of knowing you are exactly in the same position when you press the refall every single time.

Hood
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: LowryIndustries on August 18, 2013, 06:01:15 AM
Thank you for your timely and sage advice. 

I, by good fortune, have a highly accurate method of homing the machine.  Built into the mill is a precisely accurate mechanical position readout, allowing me to position the bed to exactly the same position repeatedly.  It is foolproof.

Therein lies my problem.  When I exit Mach3 I make sure the bed is positioned precisely where I want it.  When I start Mach3 the bed moves slightly.  So I reposition the bed to where I want it before pressing ResAll.  Pressing ResAll jogs the bed to precisely where it moved to when Mach3 started and sets Current Position, Machine Coord, and Work Offset to zero at that location, not at the location I moved it to.  When I return the bed to the location it was in when I pressed ResAll, the Machine Coord and/or Work Offset is changed by the amount the bed originally moved.

I have a feeling I am going to have to make a video to show what is going on.
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: Hood on August 18, 2013, 07:32:35 AM
Pressing RefAll should NOT move the X or Y axis at all as you do not have Home switches set for the X or Y. The only axiis that should move when you press RefAll is the Z axis.
If your axes are moving (other than Z) then it would seem you have possibly got custom script in the RefAll button.

Hood
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: LowryIndustries on August 19, 2013, 03:21:39 AM
Thank you again for your help yesterday, and I think I have narrowed down where the problem is.

It's the machine coord setting.  When I start Mach3 the machine coord setting isn't zero.  It's -.0005 every time no matter what I do.  

If I have AutoZero enabled for the axis, when I RefAll the axis will move till machine coord is at zero and then clear the Current Position.  Problem is, the axis is no longer where I want it to be.  I don't want that.  I have already set the axis to where I want it before I start Mach3.  If I jog the axis back to where I want it to be and then press RefAll again, the Machine Coord and Work Offset is not zero.

If I disable the AutoZero in Homing & Limits, then when I RefAll the axis doesn't move but the Current Position and Machine Position isn't set to zero either.  Current Position and Machine Position stays at -.0005.

What I need is a macro or some-such to force Current Position, Machine Position, and Work Offset to zero.

Any suggestions?  
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: Hood on August 19, 2013, 03:38:02 AM
I will say again, your Axes should NOT move when pressing RefAll if you do not have Home switches configured for the axes.
AutoZero simply tells Mach to set Zero (or Home Off value) to the machine Coords DROs when you reference the machine.

You seem to be saying that when you press RefAll not only does the Z axis physically move but the X and Y do as well. Z moving is correct as you have a Home switch designated in Ports and Pins for that but X and Y should not physically move.

Your xml shows you have the macropump enabled and also you are using a Vista pendant, could these be your issue?
Are you pressing RefAll on the screen or is it a function of the Pendant? If screen can you tell me what the script is in the button please.
Can you also tell me what is in the macropump, maybe zip and attach it.

hood
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: Hood on August 19, 2013, 04:14:50 AM
One last thing, your xml seems to suggest you are using the parallel port (no device listed for controller) is that the case?
Just that if that is the case then there are no ports and pins chosen for the axes and that can not be correct if using the parallel port.
 I am wondering if you are  using an external controller or possibly have attached the wrong xml?
Hood
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: LowryIndustries on August 19, 2013, 04:45:30 AM
I think we are starting to get there.  You mentioned "AutoZero simply tells Mach to set Zero (or Home Off value) to the machine Coords DROs when you reference the machine."

I think that you are absolutely right.  My problem is when my Mach3 starts up the Machine Coord is set to X = -0.0005 even before I press the Reset button.  I cannot phantom why it is doing that, but it is.  This is why when I RefAll, the axis moves.  Mach3 is starting up with a Machine Coord not zero and is zeroing to the machine coord dro, which is taking the table off the zero I want.

When I press the ResAll, it's from the screen, not the Pendant (which is an excellent pendant, btw.  Highly recommended).

Here is the contents of Macropump.m1s
If GetUserLED (1010) Then
  If Not IsActive (Input2) Then
    DoOEMButton (1003)
    Message “Program Stopped Spindle Fault”
  End If
End If

As far as the parallel port, I am using a Derek Hillbilly bob board which works very well.  Surprisingly well.  I don't think this is the source of the problem given that Mach3 starts up with the machine coords as noted above, even before I press Reset.  If there is some way to make Mach3 start with machine coords set to zero, then my problems go away.

Still cannot imagine why it is so difficult to move the bed to any location I wish and press a button to force Current Position, Machine coord, and work offset to zero at that location. 

I really appreciate your help. 
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: LowryIndustries on August 19, 2013, 04:47:06 AM
And here is a screenshot of the diagnostics page right after starting up and before pressing reset.

Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: LowryIndustries on August 19, 2013, 04:48:55 AM
If there is any way to make that Machine Coord come up zero every time I start Mach3 no matter the x,y,z coordinates, then I'm good to go.
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: Hood on August 19, 2013, 05:17:19 AM
Ok as I keep saying the Axes should NOT move when you RefAll if there is no Home switch set for that axis. All that will happen is the Machine Coords will be set Zero (or the value you have in Home Off)
However now you have mentioned you are using the HillBillyBob I now realise (and should have noticed) that you are using MaxCL mode.
That may be your problem as I have no idea how that mode operates with regards to referencing the machine.
 As mentioned previously what you are experiencing is not normal, what you are wanting and expecting is, however as you are using MaxCL mode then it may just be the way it behaves.

I will have a look later at MaxCL mode, when I get some time, however I think it has designated pins for home switches so even if you dont have them set then it may still register them and act on them or it could even be because the pin you have set for Z is actually a pin meant for all home switches. I am just thinking out loud but will check later and see if that is indeed the case.

Hood
 
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: LowryIndustries on August 19, 2013, 05:23:28 AM
I can live with it if I have to, although I would rather not. 

Goes right back to my first question.  Is there a macro or routine which can set Current Position, Machine Coord, and Work Offset to zero?
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: Hood on August 19, 2013, 05:31:57 AM
Your first questions answer is that the RefAll should do exactly what you want and thus no need for a macro.
Current position and current work offset are one in the same in this situation, as far as I see, and if you do not have any values set for the work offset then that will be the same as machine coords, under normal circumstances of course ;) Looks like MaxCL may not be normal though ::)

It would have been very simple to make a macro up to do what you wanted if under normal circumstances but my point is there should be no need to do it as that is the default way Mach does it.
With your situation it is likely still possible but I will have a look later and see if I can work anything out with MaxCL that will mean you can use Mach normally without having to resort to scripting as that will be the most sensible option.

Hood
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: Hood on August 19, 2013, 05:49:10 AM
Ok just looked, MaxCL states pin 12 is for Home and Limit switches, ie it would seem it is the input you would use for ALL axes.
 I would say that means RefAll will not act correctly for you as you are not wanting X or Y to move.
As a test can you disable the Z limit input and see if it helps, Z of course will not move but it will possibly make X and Y work as you want, expect and how Mach normally works.

Let me know what happens when you do that, please, and we can then go from there.
Hood
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: LowryIndustries on August 21, 2013, 01:55:12 AM
I should have something for you tomorrow.
I again appreciate the help.

One thing, though.  My mill has a very accurate tool changer which I use on every job.  And I mean very accurate, to around .001" repeatably.  The current part I am making uses 6 different tools, and I need 7 of these parts.  I only have to set the tool height once and I'm off and running!

It's wonderful.  Of course it only works because Z sets to a repeatable and reliable zero stop on RefAll.

So eliminating this Z movement is a non-starter.  Not having the Z home would be even worse than the x axis moving.  The cure worse than the disease.

It seems the best solution is to have a routine that forces the current position, workspace, and machine coord to zero, which is where we started.
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: Hood on August 21, 2013, 02:48:01 AM
You may or may not be able to do as you want, it all depends on your findings with disabling the Z home switch input and also a further test I will ask you to do if that is successful.
Hood
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: LowryIndustries on August 21, 2013, 02:49:00 AM
Ok, thank you.  I will let you know tomorrow.
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: LowryIndustries on August 22, 2013, 05:38:59 AM
Ok, I tried what was suggested to no avail.  Disabling the z limit input and then doing a RefAll still didn't zero either the machine coord or work offset (if not zero). 

What I am also going to try is posting a script I wrote to see if it is a reasonable script and if it will work with my version of mach3.
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: Hood on August 22, 2013, 05:59:15 AM
Ok so do the X and Y still move?
If they do I dont think there is much you can do.
If they dont then it may be possible to modify your RefAll button to only home Z and just have Mach set the X and Y zero.

If you let me know whether X and Y still move with Z Home disabled.

Hood
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: LowryIndustries on August 22, 2013, 12:56:28 PM
Thank you again.

What I have observed is I when have Z home enabled in Ports and Pins and Z Auto Zero enabled in Homing/Limits with X and Y Auto Zero DISABLED in Homing/Limits allows me to home the axis wherever I desire without the x and y axis moving.

So I wrote a script which replaces Hiddenscript.m1s to operate RefAll.  The first section of the script is exactly what was there originally and the second part is supposed to set the values in Machine Coord, work offset, and current position to zero.

It should work but as of yet is does not seem to.  I don't know if it is because of a problem in the script or if in version of Mach3, R3.042.038.

I cannot at this time build and test a upgrade to Mach3 because I need to use the system.  Later on I may be able to build a newer system.

Here is the script:

DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )
DoOEMButton(133)
DoOEMButton(134)
DoOEMButton(135)

Xaxis = 0
Yaxis = 1
Zaxis = 2
SetMachZero(xaxis)
SetMachZero(Yaxis)
SetMachZero(zaxis)
Const XaxisMultiFunctionOEMDRONum = 800
Const YaxisMultiFunctionOEMDRONum = 801
Const ZaxisMultiFunctionOEMDRONum = 802
SetOEMDRO(XaxisMultiFunctionDRONum, 0.0000)
SetOEMDRO(YaxisMultiFunctionDRONum, 0.0000)
SetOEMDRO(ZaxisMultiFunctionDRONum, 0.0000)

Thank you again!
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: Hood on August 22, 2013, 01:19:02 PM
OK if you can get it so Z homes and X and Y dont move then the following should work.
DoButton(24)
SetMachZero(0)
SetMachZero(1)
DoOemButton(1008)
DoOemButton(1009)

Hood
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: LowryIndustries on August 22, 2013, 04:39:05 PM
It didn't work, but I suspect it has to do with the version of mach3 I am using instead of any fault with the code.

What I am doing now is ordering a backup PC which I will convert to the latest version of Mach3.  This way I can keep working without loosing any more days, and have the original system as a backup which is always a good idea anyhow.

Thanks, and I will let you know how it goes!
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: Hood on August 22, 2013, 04:41:16 PM
Hopefully it will work but I am suspecting it may have more to do with you running MaxCL mode rather than the version of Mach, hopefully not though.
Hood
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: LowryIndustries on August 22, 2013, 04:43:58 PM
I will let you know!

Thank again for your help.  At the very least I found out how to keep the axis from moving when I RefAll the system (disable x and y homing) and I am now searching on how to eliminate posting G54 in Mastercam, which then will allow me to set the home where I want it and not have any G54 calls to mess it up.

(Crossed fingers)
Title: Re: How to manually set Current Position, Machine Coord, and Work Offset to zero.
Post by: BR549 on August 22, 2013, 06:32:33 PM
You CAN reset the Machine Cords  to ZERO from a button press or Mcode.  EVEN IF you have homes or NOT.

OOPS I see yall figured that out, (;-)

(;-) TP