Hello Guest it is March 29, 2024, 09:03:39 AM

Author Topic: VB Script re G68 to edge find  (Read 11079 times)

0 Members and 1 Guest are viewing this topic.

VB Script re G68 to edge find
« on: May 13, 2006, 06:06:57 AM »
Hi please can anyone help. this is what i need to do, Use VB script attached to a button,
  probe touch on 2 places on one edge of work piece,
  use G68 to rotate program,
  set X axis to zero,
  also is G68 limited to only 1 decimal place.

             Many thanks Paul
                         From the uk
Re: VB Script re G68 to edge find
« Reply #1 on: May 13, 2006, 08:55:07 AM »
There is a wizard that I did in the files section of the Yahoo group. I never finished it but it is a good place to start... There is WAY more than the one decimal place, the display is set one there is about 32 decimal places in Mach3 :)

The point that I got to but didn't finish is the vector math that will put the 0,0 position in the intersection of the two points. I have stuff for that that I have done in C++ and I think if we ask nice Art will add it to Mach3 :) You will just have to pass the points to the function and you will get back the point in the X and Y where the corner of the part is.

Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: VB Script re G68 to edge find
« Reply #2 on: May 13, 2006, 10:28:27 AM »
Hi  Brian Thank you for your very fast response especially as its still breakfast time in the states. Unfortunately as a mechanical engineer new to CNC am finding VB scripting very hard to learn. I have downloaded your set Rotation. zip file from Yahoo site but don’t fully understand how to finish or implement it. Would be very grateful if someone could point me in right direction. Have spent many hours on line, reading up on this. Still long way to go. Changed  DRO 118 to display 4 dec places got that working ( that was easy bit ).

      Many Thanks Paul
Re: VB Script re G68 to edge find
« Reply #3 on: May 13, 2006, 09:38:03 PM »
If you would like to work with me.. After i get back from my trip to the workshop we could start making he code to do the fixture rotation! I don't have a probe set up on my mill at this point so I could use your help :) And I am a Mechanical Engineer so they can learn VB :) (There is light at the end of the tunnel)..
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: VB Script re G68 to edge find
« Reply #4 on: May 14, 2006, 07:54:59 AM »
Hi  Brian that sounds great, let me know what I can do to help.

        Many Thanks Paul
Re: VB Script re G68 to edge find
« Reply #5 on: June 14, 2007, 12:03:07 PM »
Hello Brian,
I was trying to make something like what you described on this thread, but instead probe 2 places on the x side, and 2 places on the y side.
The 2 places on the x side would help determine the angle of rotation for the G68, just by using trigonometry.

The 2 places on the y side will help determine the slope for a second curve, if you make the equation for the first curve equal to the equation of the second curve, you should be able to find an intersection of the two curves which should be the very corner of the stock.
My question is, how would you solve that equation in VB?

I think this would be a great addition to Mach!
Does G68 work in Quantum?
Regards
Fernando

vmax549

*
Re: VB Script re G68 to edge find
« Reply #6 on: June 14, 2007, 10:19:54 PM »
I have a set of Mcode macros that do CR with a probe. One of each direction X+,X-,Y+,Y- and Center of 2 holes if you are interested I can dig them out. I use them for different fixture setups, Very usefull critters for doing setups. Probes two points on the plane and calculates the angle then rotates from the first point.


I also have one to probe for the center of a circle and returns the diameter.(+-.0005") These Mcodes are self contained and can be run from the Gcode or MDI

One to probe the xaxis and returns to center and gives the distance between 2 points
one for yaxis"""""
ONe to probe the zaxis at 90deg to spindle for center and distance.

I am working on a CMM screen have most of it working just need to iron out the bugs.

Anyone good at building screens????


If someone could build a good looking CR screen you could assign them to buttons. I have a screen but it is ugly. It works but ugly (;-) TP

(;-) TP
« Last Edit: June 14, 2007, 10:27:41 PM by vmax549 »
Re: VB Script re G68 to edge find
« Reply #7 on: June 14, 2007, 10:31:07 PM »
Hey TP,
Does your set of mcodes work out the 0,0 point at the corner of a tilted part by probing two locations on x edge and 2 on y edge?
Regards
Fernando

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: VB Script re G68 to edge find
« Reply #8 on: June 14, 2007, 10:38:30 PM »
Look under the "conversational" Screen set I wrote, under Mach Screens.

On the second or 3rd page, there is a Section for figuring out the G68, no matter what quadrant you are in, just touch off the two corners of your vice or fixture.

If you need to just copy the DRO's, Buttons, and script that are in that section and paste them onto your screen and you could always access them.

Scott
fun times

vmax549

*
Re: VB Script re G68 to edge find
« Reply #9 on: June 14, 2007, 11:02:39 PM »
Fernando, it does not, but would not be that hard to add to it. Poppabears wizards work, Brians stuff is good. Maybe we just need to colaberate on this and get a good CR screen to add to mach. THen we can work on the CMM screen.

We just need someone to build us a killer screen so we can add our own objects and code, I have seen the code done several different ways but they all seem to work ok. I chose to work with Mcodes so I can call them from a gcode program or the MDI line.The problem with Mcodes is that you cannot stop in the middle of a macro to jog over to somewhere else to pick up another point. THat is where the screen would work better you could do what you wanted in segments and then push a button to complete the task.

NOTE: With the way MACH does the G31 motion, you have to account for the "lever travel" to trip distance to have an accurate measurement. With my probe and the 2"stylus it is .0075" plus the radius of the tip. If you change the length of the stylus you have to reapply the different lever ratio allowance to the code. It would be nice if we could get ART to change the G31 motion to trip,reverse,record the trip point on reset. It would also allow you to reverse the G31 direction without having to G1 off the trip point before you preceed. (can't g31 or jog off of a trip point) It makes using mach to do CMM work a real pain. If the motion were changed CMM would be a snap.

WARNING: WHen you rotate with G68. the jogging does not follow the rotated coordinate base it follows the Machine coordinate base. This can be very strange to jog around. THings do not move in relation to the fixtured part. I wiped out a very expensive probe the first time I rotated 45deg and went to jog away, hitting the fixture clamp. It may just be ME but be very carefull.

(;-) TP
« Last Edit: June 14, 2007, 11:29:40 PM by vmax549 »