Hello Guest it is March 28, 2024, 07:46:25 PM

Author Topic: A question if I may... is there a way to default all axis to zero on startup?  (Read 3157 times)

0 Members and 1 Guest are viewing this topic.

have searched this forum and google in general for this, but maybe just haven't hit the right keyword sequence?  If I missed it, please rub my nose in it, and apologies in advance.

What I'd like to do: whatever position the cnc spindle is in at startup... I'd like that position to be defaulted to zero value for all 3 axis. 

I'm not interested in homing via limit/home switches and not asking about that. 

for example.  I'll have those three axis set to zero for my current spindle location.  I'll exit out of mach3 and go back in... when mach3 opens these values are set to some number.  I am guessing those numbers are based on where the soft limits are set and where the machine is in relationship to that.  What I'd like: for those values to be defaulted to 0 without having to go set zero on each axis manually. 

the reason?  well in case you care... I freq work off of a material zero that may not be able to be positioned over the machines actual center, and it may move around a lot. 
use case: I recently had a scenario where my machine was zero'd on all 3 axis... I wanted to shut down for a bit (many reasons for this... my garage power is such that running my cnc + my tablesaw + a vaccuum will result in tripping a breaker... so I am careful to not have all things running at once).  Went back to the machine and started mach3, forgot to set everything to zero (despite the fact that machine was at physical zero on my piece)... mistakenly started her up and ran the bit right through my piece.  this is/was all my fault... but if I was able to "automagically" have all 3 axis initialize to zero on startup... there would be much less chance of drilling into my work piece or burying a bit in my workpiece(when you hit goto zero but have not zeroed your axis prior), etc.

very much appreciate any info you might bestow.
Hi,
yes, <Ref All> and in the homing page set all three axes to Home In PLace.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Hi,
that won't really help much with the loss of reference however.

That's what happens if Mach crashes, you Estop or the power gets turned off. When you turn Mach back on it does not know where it is, really the numbers
from the last session are of dubious value, what happens if the machine has shifted between sessions? Also if Mach crashes or the power gets turned off what are the
chances that Mach can record it current position BEFORE it crashes/stops completely?

Loss of reference is a fact of life with Mach....and in fact MOST CNC machines. Any CNC machine that is either open loop, like Mach3/open loop steppers, OR, incremental encoder, like many servos,
when the machine is powered up it has no way to know where it is. You need to 'Reference' or 'Home' the machine to some defined and exactly repeatable position at the start of every session.

If you are lucky/wealthy enough to have servos with multi-turn absolute encoders, then when the machine powers up it knows exactly where it is. But the if you're wealthy enough to have servos
like that why are you pissing about with Mach3?

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Hi,
that won't really help much with the loss of reference however.

That's what happens if Mach crashes, you Estop or the power gets turned off. When you turn Mach back on it does not know where it is, really the numbers
from the last session are of dubious value, what happens if the machine has shifted between sessions? Also if Mach crashes or the power gets turned off what are the
chances that Mach can record it current position BEFORE it crashes/stops completely?

Loss of reference is a fact of life with Mach....and in fact MOST CNC machines. Any CNC machine that is either open loop, like Mach3/open loop steppers, OR, incremental encoder, like many servos,
when the machine is powered up it has no way to know where it is. You need to 'Reference' or 'Home' the machine to some defined and exactly repeatable position at the start of every session.

If you are lucky/wealthy enough to have servos with multi-turn absolute encoders, then when the machine powers up it knows exactly where it is. But the if you're wealthy enough to have servos
like that why are you pissing about with Mach3?

Craig
hello and thank you very much for the reply!!

"won't really help much" perhaps I didn't explain myself well - in my case it most definitely and completely would have helped.  my machine did not crash... I moved it to zero position specifically on purpose before shutting down.  I needed to shutdown machine to run my table saw w/o tripping a breaker.  After shutdown/startup... if machine comes back at zero my program runs and no issues whatsoever.  If it comes back thinking z axis is at +3", and I don't remember to zero (that is of course my folly) then when I start some code it's going to lower the z to my safe z above work piece -which would now plunge my bit through my workpiece.

I'm well aware that the gen convention is to home via limit switches... lets go ahead and assume that is not an option at present.  That would solve the issue and I fully acknowledge that.

we're not talking about mach having to know/record where the machine is, but rather assume it is at zero on startup.  Given that when it starts up it doesn't know where the machine is... doesn't it make more sense to default everything to zero instead of some random co-ords that by your own response/admission have nothing to do with actual location of machine?





Hi,

Quote
but rather assume it is at zero on startup

Then the procedure is:

Quote
yes, <Ref All> and in the homing page set all three axes to Home In PLace.

As I posted earlier, then set your work coords via a G54 or <Zero All>. If you have not previously recorded your G54 then you may be in trouble.

Craig


'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Hi,

Quote
but rather assume it is at zero on startup

Then the procedure is:

Quote
yes, <Ref All> and in the homing page set all three axes to Home In PLace.

As I posted earlier, then set your work coords via a G54 or <Zero All>. If you have not previously recorded your G54 then you may be in trouble.

Craig
awe snap... shame on me for making you repeat... that went over my head.  You are saying that if I set home in place is an option somewhere and it will default to zero on startup if I'm reading that right.  thank you very much. 
Hi,

Quote
You are saying that if I set home in place is an option somewhere and it will default to zero on startup if I'm reading that right

Not quite, but close. If you set Home in Place for all three axes then as the name suggests the if you <Ref All> the machine coordinates will all zero themselves
at the machines current location rather than driving all around looking for Home switches.

So the procedure is:
1) Power the machine up and Enable
2) <Ref All>
So this will mean that the machine coordinates are all now at zero at the machines current location. You now have to set the Work Coordinates, either using a previously saved G54
or by <Zero> for each axis. This last method assumes that the location at which you <Ref All>, ie machine coordinate zero, IS ALSO THE WORK COORDINATE ZERO.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Hi,

Quote
You are saying that if I set home in place is an option somewhere and it will default to zero on startup if I'm reading that right

Not quite, but close. If you set Home in Place for all three axes then as the name suggests the if you <Ref All> the machine coordinates will all zero themselves
at the machines current location rather than driving all around looking for Home switches.

So the procedure is:
1) Power the machine up and Enable
2) <Ref All>
So this will mean that the machine coordinates are all now at zero at the machines current location. You now have to set the Work Coordinates, either using a previously saved G54
or by <Zero> for each axis. This last method assumes that the location at which you <Ref All>, ie machine coordinate zero, IS ALSO THE WORK COORDINATE ZERO.

Craig
roger that.  sorry if I am thick... but just to be clear... if we have <ref in place> set for each axis... and we drive to the center of our workpiece and set all axis to zero... then we hit <ref all>... shutdown mach3, restart mach3... it should come up with mach3 displaying zero for all 3 axis?
Hi,

Quote
. and we drive to the center of our workpiece and set all axis to zero... then we hit <ref all>... shutdown mach3, restart mach3... it should come up with mach3 displaying zero for all 3 axis?

No, as I said earlier Mach cannot save its position between sessions, or at least not directly.

For users who have a defined and repeatable home position, it works. If you have home switches then at each and every start-up you <Ref All> and that would drive to the home
switches and set the MACHINE COORDINATES to zero. You would now jog to the centre of the part and <Zero> each axis . Now the WORK COORDINATES would display zero and the G54 data
would reflect where the Work Zero is relative to the Machine zero. If you shut down properly the G54 should be saved on exit.

At the next session you power up and <Ref All> per normal, ie your machine drives to its exactly and repeatably defined Home location. Now you can MDI, using G54, to the Work Zero.
That would put the machine exactly back at the workpiece zero position. But note this requires the the machine be able to UNIQUELY and REPEATABLY go to its home position

You can see that all this absolutely requires that you can drive the machine, either manually by jogging or by using Home switches, to a defined location. If you can't do that you're screwed.
There are a couple of workarounds that will do what you want, but they are a distinct procedure. I used to do it myself years ago, and if you followed the procedure perfectly it worked,
forget even one step and it fails.

Then I fitted good Home switches and I've never had a problem since. Also with a good homing procedure, ie Home switches, then Soft Limits work properly and they have saved my ass countless times before,
and still do.

The procedure is:
1) Drive to the Work Zero point of the part in the vice.
2) <Ref All>, with Home in Place set on each axis
3) <Zero> each axis in turn. This should set G54 as 0,0,0. That is to say that prior to shutdown the Machine Zero is exactly coincident with the Work Zero, and therefore G54=0,0,0
4) Depower the machine.

At the next session:
1) Power up and Enable
2) WITHOUT JOGGING OR ANY OTHER MOTION <Ref All>. This, provided the machine has not moved at all since the last session, will put the Machine Zero exactly where you left off last time.
3) Either <Zero> each axis, this will put the Machine Zero coincident with the Work Zero. You could use G54, but if you followed the shut-down procedure then G54 should be 0,0,0, the two methods should
result in the exact same thing.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Hi,

Quote
. and we drive to the center of our workpiece and set all axis to zero... then we hit <ref all>... shutdown mach3, restart mach3... it should come up with mach3 displaying zero for all 3 axis?

No, as I said earlier Mach cannot save its position between sessions, or at least not directly.

For users who have a defined and repeatable home position, it works. If you have home switches then at each and every start-up you <Ref All> and that would drive to the home
switches and set the MACHINE COORDINATES to zero. You would now jog to the centre of the part and <Zero> each axis . Now the WORK COORDINATES would display zero and the G54 data
would reflect where the Work Zero is relative to the Machine zero. If you shut down properly the G54 should be saved on exit.

At the next session you power up and <Ref All> per normal, ie your machine drives to its exactly and repeatably defined Home location. Now you can MDI, using G54, to the Work Zero.
That would put the machine exactly back at the workpiece zero position. But note this requires the the machine be able to UNIQUELY and REPEATABLY go to its home position

You can see that all this absolutely requires that you can drive the machine, either manually by jogging or by using Home switches, to a defined location. If you can't do that you're screwed.
There are a couple of workarounds that will do what you want, but they are a distinct procedure. I used to do it myself years ago, and if you followed the procedure perfectly it worked,
forget even one step and it fails.

Then I fitted good Home switches and I've never had a problem since. Also with a good homing procedure, ie Home switches, then Soft Limits work properly and they have saved my ass countless times before,
and still do.

The procedure is:
1) Drive to the Work Zero point of the part in the vice.
2) <Ref All>, with Home in Place set on each axis
3) <Zero> each axis in turn. This should set G54 as 0,0,0. That is to say that prior to shutdown the Machine Zero is exactly coincident with the Work Zero, and therefore G54=0,0,0
4) Depower the machine.

At the next session:
1) Power up and Enable
2) WITHOUT JOGGING OR ANY OTHER MOTION <Ref All>. This, provided the machine has not moved at all since the last session, will put the Machine Zero exactly where you left off last time.
3) Either <Zero> each axis, this will put the Machine Zero coincident with the Work Zero. You could use G54, but if you followed the shut-down procedure then G54 should be 0,0,0, the two methods should
result in the exact same thing.

Craig
well thank you very much for the detailed info.  at the least you've clarified a lot of things there and I appreciate you taking the time.  Honestly, hearing all that... finding my zero, returning to it... and remembering to zero all 3 on startup seems like fewer steps.  I hope I don't offend with that comment, because I really do appreciate the info and it will likely be even more valueable in the long run.  It does detail for me... that the only automated way to really return to a point is setting up limit switches.