Hello Guest it is September 20, 2019, 05:09:47 PM

Author Topic: Mach3 VB Script Help  (Read 12584 times)

0 Members and 1 Guest are viewing this topic.

Offline BR549

*
  •  6,898 6,898
    • View Profile
Re: Mach3 VB Script Help
« Reply #80 on: February 17, 2016, 01:22:48 AM »
Machine corrds are NOT always in Q1 and you are NOT simply working in Q1 IF you are probing at X0Y0 1 leg of X COuld be in Q1 and the second leg could be in Q2 OR several different combinations of Quadrants.

Either way YOU are working in Work corrd not machine corrds and all teh math is based on Work Coords(G90) or inc values (G91)

A classic example of teh %problem  . Remember you are dealing with an abs positional value (#2000). IF X1 = 1.000 then X1* .90 = .9 so your slow zone would be .10" and that seems resonable    NOW if you were probing at X30 then using the same formula  X1 *.90 = 27 so that gives you a slow zone of 3" .  The entire idea is to make everything consisitant . With using % it will depend on WHERE you are on teh table as to teh value you get.

You want your back off values to always be the same and teh Slow Zone distance to always be the same distance so that ANY variable induced by the probe will cancel itself out .

Gerry have you tried teh math based on teh exact same move (Center of X )  Do it in Q1 where both vlaues are + then do it in Q2 where both values are - and teh offset distance from Zero inverts but your probing routine order of moves stays teh same ( Probe left then right)

You will run into teh same problem solving angles for G68 rotation as the formula changes from Quad to Quad. You have to TEST teh values to find out what Quad you are actual in so you can use the correct formula.

IN this case (Center of X)  

IF X1 >0 AND X2 >0 then you are in Q1
If X1 <0 AND X2 <0 then you are in Q2

IF X1 <0 AND  X2 >0 then you are in both Q1 and Q2

In the case of Center of X in Q1

G91 G31 X-10  ( Probe left)
Assume X1 =3
G91 G31 X20  ( probe right)
 and X2 =6
X2-X1 = X3  ( Distance between X1 and X2)
     X3 = 3"
X3/2 = X4    ( 1/2 distance = distance from either of teh refpoints to teh center point)
     x4 = 1.5"
x1 + x4 = x5 ( Move from an ABS Ref point(X1) over to the center point)
     X5 = X4.5
G90
G0 X4.5   ( moves you to the center of X)

This will work no matter where you are in Q1 as long as you do not move outside of Q1.

To find a slow down zone

X2-X1 = X3
X3/2 = X4
X4-.050 = X5
X5 =1.450

or

(((X2-X1)- .100) /2) = 1.45


Just a thought, (;-) TP


Offline BR549

*
  •  6,898 6,898
    • View Profile
Re: Mach3 VB Script Help
« Reply #81 on: February 17, 2016, 01:15:34 PM »
Nissan you are correct with teh (X1+X2)/2  that will work in all quads. I was doing it in my head and SHOULD have done it on paper. It will solve for center of 2 abs positions even across Quads.  My appologies

(;-) TP

Offline BR549

*
  •  6,898 6,898
    • View Profile
Re: Mach3 VB Script Help
« Reply #82 on: February 17, 2016, 01:47:44 PM »
BUT that just seems to PUSH teh Quad problem to the next part of teh puzzle , Solving for teh inc move value from teh center point tot eh end point.

I solved that up front based on Q +/-  and it changed for Q1 to Q2.  It seems you still have to deal with Q any way you do it. Either up front or at teh tail end.

(;-) TP

Offline BR549

*
  •  6,898 6,898
    • View Profile
Re: Mach3 VB Script Help
« Reply #83 on: February 17, 2016, 02:17:43 PM »
OK It is doable on teh back end as well.

(;-) TP
Re: Mach3 VB Script Help
« Reply #84 on: February 28, 2016, 06:08:17 AM »
Okay I got side tracked for a bit. I was working on this tonight and I think I got it. It works off machine(Like Dros do what they should). This is used for me to square one of my clamps on my table, I don't have any of my clamps keyed so I have to dial them in straight every time I take them off. But my goal with this is to measure my most positive side then my most negative side and try and get them to zero out but with a probe not a dial indicator. That way, I tell it how wide to test and it'll touch, back off, move over, touch, back off,  retract Z and tell me the values. I can then tap my clamp left or right and just click the yes or no when the "Is fixture is squared?" question pops to run it again and again till I have it zeroed. Lol beats manually moving it left then forward by .0001 increments then zeroing then going to the other side and repeating 5 times. Now I just sit back and smack with a mallet. YAY!!!

I made one for X and Y


Oh  P.S. one of my Damn Drivers is broke all the sudden. I go to turn it on today and X and Z turn on but Y had no lights at all. I tried plugging the other axis' into it and nothing. tested my voltage getting 35.96V ??? ??? ???
« Last Edit: February 28, 2016, 06:14:27 AM by nissan20det »
Re: Mach3 VB Script Help
« Reply #85 on: February 29, 2016, 07:05:38 PM »
Here is the tested working versions! YAY!! my first successful script