Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Waynec on January 10, 2009, 04:23:21 PM

Title: Mech Home before Go To
Post by: Waynec on January 10, 2009, 04:23:21 PM
A couple times now when I first start my Router (a modified Shopbot) I have forgotten to home the machine to mechanical zero, and pushed the GoTo button, expecting the machine to move to the Zero xyz work position that I had last time I worked.  Always, the Z axis is WAY OFF and I proceed to bury my spindle into the spoilboard.  In my case this means I lift the gantry off its rails.  No permanent damage yet, but I know this is not good for my spindle bearings at a minimum. 

So my question is, can I set up some sort of routine that forces me to mechanically zero my axis BEFORE I can do something stupid like push the GoTo button?  I only need this to happen on start up, not every time I use the GoTo button. 

Along that line, if I could set up a start up routine that engaged the mechanical home to limit switches routine, and then moved to a preset work zero location, and maybe poured me a cup of coffee? 

Would this require a VB script? 

Thanks as always.  As much as I love the flexibility, interface, and features of Mach 3, its this support forum that is really the best part.

Wayne C


Title: Re: Mech Home before Go To
Post by: Graham Waterworth on January 10, 2009, 05:03:28 PM
you could put this at the start of each program you have :-

G28.1 Z0
G28.1 X0 Y0

this will search the home position before it will cut anything.

Graham
Title: Re: Mech Home before Go To
Post by: Waynec on January 10, 2009, 09:10:41 PM
Graham, let me be sure I understand this.  When you say this will search the home position, does this mean the mechanical home at the limit switches?  Or the home position I create when I reset the axis' to zero at the corner of my work surface? 

Also, can I put this in the startup string in General Config or maybe in the post processor so that I can't somehow forget this? 

I hate to admit I need to make this idiot proof, but that's what I'm wanting to do. 

Thanks for your quick reply, BTW.

Wayne
Title: Its right in front of me.
Post by: Waynec on January 10, 2009, 09:21:55 PM
Well, posted too soon.  I looked at the GCode listings in Mach3, and I can see that its the mechanical home.   So, now of course I want to know if I can somehow get Mach 3 to do this when it opens.  For me this would work better than adding the lines to a file, something I'm sure to forget.  Normally this happens when.. oh wait.  It happens when I run my spindle warm up program.  So I can add these lines to this and probably eliminate the problem.  Brilliant!

But, is there a way to trigger that bit of GCode when I start up Mach 3?  Maybe add it to the startup string or activate it when I push the Reset button the first time?    Somehow, I'd like to make the startup mechanical homeing automatic. 

Thanks for your patience. 

Wayne
Title: Re: Mech Home before Go To
Post by: Overloaded on January 11, 2009, 12:21:20 AM
Hello Wayne,
   Here is an alternative that you might consider.
This ain't pretty but it seems to work OK.
I made my LOAD GCODE button a script button with this in it :

If Not GetOEMLED(807)Then
  DoOEMButton(216)
    End If
If GetOEMLED(807)Then
  MsgBox("REFERENCE THE MACHINE")
    End If     

It looks at the X reference LED. If it is NOT referenced, you will get the message pop-up.
If it IS referenced, it will go to your file list.
As long as you use the LOAD button, you will be forced to ref. the machine before you can load any code file.
Again, I don't know much about it but it seems to work OK here.
Thanks,
RC
Title: Re: Mech Home before Go To
Post by: Graham Waterworth on January 11, 2009, 05:25:53 AM
I understand what you are wanting to do, but it can be very dangerous to have the machine move at start up on its own.

It would be much better to do what Overloaded suggested but place his code in the 'Cycle Start' button or do as I suggested.

Ether way it will force you to home the machine.

Better safe than sorry.

As for making it idiot proof, it is becoming mandatory due to H&S and the fact we are breading idiots, no common sense any more just compensation claims, end of rant  ;D

Graham
Title: Re: Mech Home before Go To
Post by: Waynec on January 11, 2009, 11:47:53 AM
Thanks the both of ya.  After thinking about it I agree that I don't really want to have the machine start any motion that I don't trigger.  So the script will do the trick.    I'll go the Cycle Start route I guess.

Overloaded, when you say that the X axis is 'referenced' does this mean at the limit switch?    And so this means that the "Ref Machine" message will appear if the X axis machine coordinate is NOT zero?   That would make sense to me.  I just don't want to assume what these terms mean.

So that I understand this,  if the X axis is referenced to Zero, you can safely assume that the Y and Z axis have also moved to the limit switches since the homing movement order is Z axis, Yaxis and then X axis.    That's why you choose the X axis DRO.  Right?

You guys have supreme patience to all us intruder non-machinist types.  I'm a woodworker by trade, and a CNC router owner- a Shopbotter.  That may provide a clue about my mechancial apptitude.   Certainly not a lathe or mill guy.  Its a very different way of thinking about what CNC is. 

Anyway, I appreciate your help here.  I guess I'll be asking questions about how to install and test a script next.  Lemme see if I can RTFM and figure it out first.

Thanks again!

Wayne
Title: What the FFF?
Post by: Waynec on January 11, 2009, 12:27:31 PM
I'm back!  I just figured out how to install and test the button script you so generously provided.  It works on my test software only install, but one thing to clear up. 

I first opened my screen set in Screen 4, and looked at the Cycle Start button by double clicking.  The G Code function input box had 'fff' in it.  I went to Mach 3, and put the little script on the button, and removed the 'fff'.  Everything seemed to work, but I wonder if I'm turning off something that needs to be there.  Or is this some typo or errant key twitching on my part?

Does the 'fff' need to be in the GCode Function for the Cycle Start button? 

Thanks again for your help.

Wayne C



Title: Re: Mech Home before Go To
Post by: Hood on January 11, 2009, 12:31:36 PM
Nope, you just need the button enabled as a VB button so that you can enter the script from Mach.
Hood
Title: Re: Mech Home before Go To
Post by: Overloaded on January 11, 2009, 01:02:08 PM
Hi Wayne,
   The script just looks at the red/green led behind X at the axis DRO. Easy enough to include the others if you'd like, this was just as an example.
You will only get the message if the reference routine has not been executed. After referencing your dro might not be at zero, depends on your routine. It just looks for the GREEN led...not the dro value.
RC