Hello Guest it is March 28, 2024, 05:10:11 AM

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

0 Members and 1 Guest are viewing this topic.

Offline Greolt

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

Yay!!!  It's easy when you know where to look.  ;D

Now it all makes sense

Thanks Scott

Offline Greolt

*
  •  956 956
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #51 on: April 04, 2007, 08:37:58 PM »

Hey Scott.  It works @$%&# fantastic.   ;D 

Don't know why it took me so long to get around to it.

I just modified your code to suit myself.  Easier to do after making the effort to understand it.  :)



PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO

If GetOemLed (825)=0 Then
DoButton ( 10 )
Code "G4 P0.25"
Code "G31Z-50 F400"
While IsMoving()
Wend
Code "G4 P0.25"
ZProbePos = GetVar(2002)
Code "G0 Z" &ZProbePos
While IsMoving ()
Wend
Call SetDro (2, PlateThickness)
Code "G4 P0.5" 'Pause for Dro to update.
Code "G0 Z20" 'Change the Z retract height here
Code "(Z axis is now zeroed)"
Else
Code "(Z-Plate is grounded, check connection and try again)"
Exit Sub
End If     


I put a DRO on the screen and also a big LED that I can see easily for the Probe.

My fear was that if an electrical or other fault happened and the switch failed it would drive
the spindle into the work and most likely break the tool.

So with the LED I just touch the plate to the tool before running script to satisfy myself that all is good. :D

Anyhow thanks for the help,  Greg

.
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #52 on: April 04, 2007, 09:56:10 PM »
Okay some one please post this in a place that everyone can find it !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

or just keep a link to it ;)
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #53 on: April 05, 2007, 01:46:16 AM »
any chance of posting the complete screen set as well as the code?
thanks,
chuck

Offline Greolt

*
  •  956 956
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #54 on: April 05, 2007, 04:50:58 AM »
I can do that Chuck.

But you really should have a go at making the alterations to your screen set.

Once you see how easy it is you'll be glad you did. And you will then find yourself doing all sorts of changes.

Download Screen4 and have a play with it. 

Open the 1024.set then "save as" so no matter what you do you can fall back to an unaltered screen.

Remember making a few changes is a lot simpler than designing a screen from scratch.

And if you have specific questions, then ask.  :)

If that little pep talk has fallen on deaf ears  ;D  then send me a PM with your email address and I will send it to you.

Greg

Offline Greolt

*
  •  956 956
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #55 on: April 05, 2007, 11:52:16 PM »
Well that little bubble of excitement didn't last long  :(

I found a bug which I don't expect will affect very many users.

Took me ages to figure out what was going on.  You'll understand why if you read on.  :)

Could not believe that I wasn't doing something stupid or that my macro was at fault.

Anyhow eventually I worked out what made things go pear shaped.

To do with slaved axis. I have X and A motors running my X axis in a dual drive setup.

The Auto Tool Zero works perfectly up until I jog or move the X axis by any method except homing.

After moving the X axis, it spits the dummy and does strange things and wont work again till I restart Mach.

Now what threw me is that a homing sequence does not have the same effect.

But then I thought about it  ::)  and a homing sequence treats the slaved axis separately so that the individual homing switches can do their thing.

Now I suppose because this will affect very few users, that it will not score highly on the "To Do List"

So until that happens my "Wizz Bang Zero Setter" will have to go on the shelf.  :'(


Now for the disclaimer   ;D  If I have done something supremely stupid and it is all my fault. 

I apologize profusely for casting aspersions on the very excellent Mach software.  8)

Greg
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #56 on: April 06, 2007, 10:33:33 AM »
So Slaving is not working after homing? I think that is the real problem that you are having...
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline Greolt

*
  •  956 956
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #57 on: April 06, 2007, 05:01:52 PM »

No not at all Brian.  Slaving is working no problem. And continues to work properly.

The Auto Tool Zero macro will work as it should repeatedly up until I do any X axis movement

As soon as the X axis moves then the macro plays up and will not work again until I restart Mach

The action that stops the macro working is X axis movement. Dual drive or slaved axis.

Now the interesting thing is that a homing sequence does not do it even though obviously the X axis has moved.

I am presuming that is because a homing move is not strictly speaking a slaved move.

Greg
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #58 on: April 06, 2007, 05:05:26 PM »
Could you try testing it with the X axis unslaved?
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline Greolt

*
  •  956 956
    • View Profile
Re: Set Z to zero automatically?Auto tool zero questions
« Reply #59 on: April 06, 2007, 05:19:02 PM »
OK I unslaved the X and A axis, restarted Mach, and the macro continues to work after any sort of move. No problems.

Re select slaving. Restart Mach.  And an X axis move means the macro no longer works.

Greg

EDIT:  I am just now heading out the door for a few days hang gliding vacation.

So don't think me rude if I don't reply.  :D
« Last Edit: April 06, 2007, 06:18:28 PM by Greolt »