Hello Guest it is March 28, 2024, 10:53:36 AM

Author Topic: Zero X & Y axis based on laser cross  (Read 8845 times)

0 Members and 1 Guest are viewing this topic.

Zero X & Y axis based on laser cross
« on: February 08, 2008, 06:34:47 PM »
I have fairly large table on my machine, and use different positions to clamp my material according to size.
I saw a video on Youtube about aligning the laser at the corner of the object to work on and then make that the center of the spindle, this would make this X0 Y0, if you know what I mean, an offset so to speak.

The problem is that I dont know how to set it up, and I do not want i to be a homing position as I only run softlimits and sometimes work the pieces out of True X0 an Y0

Could anyone point me in the right direction?

I havemade a seperate button in my Screenset for this so I can choose this whenever I want, but need some scripters to help me out her:)

Cory
« Last Edit: February 09, 2008, 05:18:03 AM by corydoras »

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Zero X & Y axis based on laser cross
« Reply #1 on: February 09, 2008, 09:34:23 AM »
Edited for double post, I gotta clear my desk up so I am not reaching over everything to type and inadvertantly clicking on my mouse with my elbow  :D
Hood

« Last Edit: February 09, 2008, 09:43:52 AM by Hood »

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Zero X & Y axis based on laser cross
« Reply #2 on: February 09, 2008, 09:42:17 AM »
Not sure I follow what you are meaning. Do you have physical limits? If not then how do you reference your machine? The machine needs to be referenced so that you can take advantage of SoftLimits. The reason for this is you need to tell Mach where the "true" zero position is (G53 Zero position) You can then move away and zero on a position you want your work to start at and that will  become your new working zero position (G54 )
Mach still knows trhe real zero position (G53) and with Softlimits correctly set will stop you from moving outwith this area. Your G54 zero position is not affected by your softlimits, what I mean by that is the softlimits do not change to the offset zero.
 Hope you follow as I am not the best at explaining things but I will try and give an example, I will just use X and Y axis to make things simpler for me.
 If you home your machine and it has a 1meter by 1 mete travel the G53 will be at the extreme end of each axis travel (your tool will be lower left corner). If you set up your softlimits  so that X minimum is 0 and X maximum is 1000mm then Mach will niot let you go outwith this, same for Y axis
 Now you then jog away from your G53 zero position to the corner of your material, say for example its  100mm on both x and Y and zero your DROs, this will now give you a work offset position of X0 Y0  and you can start your work from there. You can programme to move X and Y by minus 100 from this position but Mach will let you go no further, same applies for the positive direction, Mach will not let you go further than 900mm X and Y from your new zero position. This is because Mach still keeps a note of the "true" zero (G53)  and works out your softlimits from there.

Hope this is clear and helps a bit with your question, if not ask away again.
Hood

Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: Zero X & Y axis based on laser cross
« Reply #3 on: February 09, 2008, 10:02:00 AM »
I am trying a laser alignmentsystem on my lathe. (I am waiting for the laser to arrive).

I want my lathe to aliign three things.

An X0 psition for my forward tool post which will be the lathe centre.
At the back of the cross slide are two tool posts holding 1) a centre drill 2) drilling post to take drills up to 10mm
I therefore need two more positions - fairly accurately since they must be on the centre line of the lathe, the idea being these replace the tailstock and are G Codable.

I have selected some laser detectors - 5 mm lenses, schmitt trigger digital output (0 or 5v) and a laser transmitter (ex Maplin (UK))

My idea is to mount the laser on the cross slide, shining parrallel to the lathe centre, and mount the detectors at right angles near the chuck. The idea is the cross slide traverses and a bit of code will allow me to ref the x axis for the front tool post. If I want either of the drills in the drilling position, a bit of code can select the appropriaite detector and  move across to it.

I will have to see how it goes.








Not me driving the engine - I'm better looking.
Re: Zero X & Y axis based on laser cross
« Reply #4 on: February 09, 2008, 12:25:05 PM »
Hood:

I have homoing sensors on all axis, to reference against, and from there I have set my softlimits, and this works OK

What I am looking for is like you say set the tool on the corner of the material and Zero X & Y dros (not machine coor.), and work from here.

The thing is, that I have a laserpointer mounted on the side of my motormount on the z axis, aprox 49 mm on the X and 129 mm on the Y ofset from the tool.

So for conveniant use I want to jog the axis to get my laser pointer to the corner of the material and by a click of the "laser button" put on my sreen/layout execute the vb script taking the tool to t the position the laser was pointed and zero the dros for X & Y axis.

Hope this explains my problem better?

Cory

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Zero X & Y axis based on laser cross
« Reply #5 on: February 09, 2008, 01:59:13 PM »
Ah ok so its the VB you are needing to do this? Well afraid I am crap at VB so probably wont be able to help much, will think about it and if I can work it out I will post. Hopefully someone else will jump in and help you a bit more than me ;)

Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Zero X & Y axis based on laser cross
« Reply #6 on: February 09, 2008, 02:16:44 PM »
Oh well that was easier than I thought, well that is if its what you are wanting.
 What you need to do is add a button to your Mach screen, then make  sure you set it as a VB button. Save your screen and then load Mach, go to the Operator menu and choose to Edit button script. Your new button should be flashing and all you do is click on it then paste the following into it and save.

Call setOEMDro (800,-49)
Call setOEMDro (801,-129)

Obviously you will have to put the numbers in that your laser is away from the actual spindle center but you get the idea.
If I am again misunderstanding just shout and I will kick myself :)
Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Zero X & Y axis based on laser cross
« Reply #7 on: February 09, 2008, 02:32:14 PM »
OK just been messing a bit more, if you put the following into your VB button you will with first click of the button set the DROs to your lasers offset, then if you press again the actual mill should move to your new X0 Y0 position.
Be carefull though as I may be doing something wrong or stupid so be ready with the E-Stop.
Hood


Call setOEMDro (800,-49)
Call setOEMDro (801,-129)

If GetOEMDro (800) =-49 And GetOEMDro (801)=-129 Then
Code "G0X0Y0"
End If
Re: Zero X & Y axis based on laser cross
« Reply #8 on: February 09, 2008, 02:50:14 PM »
Re: Zero X & Y axis based on laser cross
« Reply #9 on: February 09, 2008, 03:10:17 PM »
Thank you both Hood And Overloaded.

Now we are on the same track:), the first press on the button only changes the DRO to the correct inputted value, but it doesnt execute the move.

Overload.......You ar spot on...That was the video I had seen

Here is the script, with a couple of message boxes added, In Norwegian:)

CAn you spot the problem with the script, and why it is not moving the axis?

Cory