Hello Guest it is November 22, 2019, 07:10:11 AM

Author Topic: reference X and Y axis then move X and Y to center of table  (Read 2788 times)

0 Members and 1 Guest are viewing this topic.

reference X and Y axis then move X and Y to center of table
« on: March 29, 2013, 11:00:13 AM »
My 3D printer has an 8 x 8 inch bed
Before each printing session I reference the X and Y axis and then jog to the center of the bed at X4 and Y4 then zero out the X and Y axis dro's

I would like to add a button that does all this automatically but I am not sure how to use Function refX and function refY in a VB script

The basics of the operation would be

refX
set X dro to zero
refY
set Y dro to zero
G0 X4 Y4
set X and Y dro to zero

Thanks for any help on this

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: reference X and Y axis then move X and Y to center of table
« Reply #1 on: March 29, 2013, 12:04:02 PM »
Give this a whirl, there are MANY ways to do this .This is just a replication of how you described the motion.

Dobutton(22)   'RefX
While Ismoving()
Wend
SetDro(0,0)
DoButton(23)   'RefY
While Ismoving()
Wend
SetDro(1,0)
Code"G0 X4 Y4"   'move to new location
While Ismoving()
Wend
SetDro(0,0)
SetDro(1,0)
END
Re: reference X and Y axis then move X and Y to center of table
« Reply #2 on: March 29, 2013, 12:55:23 PM »
Excellent, it works perfectly

thank you so much!
Re: reference X and Y axis then move X and Y to center of table
« Reply #3 on: March 29, 2013, 01:03:59 PM »
I spoke too soon
It worked fine before I had loaded some metric G code

I work mostly in inches on Mach3

After running your code I loaded some G-code that was metric and instead of moving X and Y 4 inches it moved 4 millimeters

Not sure how I can do this with imperial and metric
Is there a way to figure this out before the machine proceeds with the first lines of code?
Re: reference X and Y axis then move X and Y to center of table
« Reply #4 on: March 29, 2013, 01:11:03 PM »
Give this a whirl, there are MANY ways to do this .This is just a replication of how you described the motion.

Dobutton(22)   'RefX
While Ismoving()
Wend
SetDro(0,0)
DoButton(23)   'RefY
While Ismoving()
Wend
SetDro(1,0)
Code"G0 X4 Y4"   'move to new location
While Ismoving()
Wend
SetDro(0,0)
SetDro(1,0)
END

Just add this to TP's cool solution

Code "G20"
Dobutton(22)   'RefX
While Ismoving()
Wend
SetDro(0,0)
DoButton(23)   'RefY
While Ismoving()
Wend
SetDro(1,0)
Code"G0 X4 Y4"   'move to new location
While Ismoving()
Wend
SetDro(0,0)
SetDro(1,0)
END
Re: reference X and Y axis then move X and Y to center of table
« Reply #5 on: March 29, 2013, 01:16:00 PM »
Thanks, that did the trick

I loaded some metric Gcode and it worked perfectly
This saves me several steps having one button that does it all

I appreciate the help guys