reading Pokeys pins

C Scripting questions and answers
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

I ran into a slight snag in my X center function..

Here's what I have going on now...

I created a new panel that has DRO's for x y and z backlash that of course only works with probing, and my jogging function..
Seems to work good with the Z probe so far got it to .002 now..

Z probing works good with every button press now no crashes...

Now the problem is with the X find center..
My code start off calling the Z probe function, just to make sure I know where the top of part is.. This works fine..

Now I move the X to half the length of the part plus overshoot, this also works good

Now I call the Z probing function again, I'm doing this to make sure you are off the parts edge, if probe is hit your X length is to small if not hit then probe the X..

The problem is when I call the Z probe function for the second time, it seems to ignore the probe hit and crashes into the part... the probe led lights.

I have looked at the code I don't see any reason for this, calling the same z probe function with 5 or 6 button presses works fine.
and the first call from the x centering function works fine, just not the second call from the x center function..

any thought on this one..
bet you where hoping I was done, well so was I, sorry

Gary
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Just to make sure it wasn't the script I wrote another one to probe the z its a short one not doing much just probing and returning..
and i called it twice for the x centering script..

got the same results probed great the first call, but crashes on the second, the second call to z probe the g31 z- moves the spindle down but doesn't stop on the probe being hit..

I tried yield(); and engine.programstop but no help..

It almost seems to me like if your still running in a function and make the second call to the z probe function something didn't get cleared out from the first call to z probe..

Making any sense?

tried a new approach
Put this in the script run window
This ran fine in the scripter.
probed good on both calls to Z_touch()

Z_touch(); // calls the global touch off function
Engine.GCode("G4 P4");
Z_touch();


then dropped a button on the screen and created a global lib script
and this also crashes the tool on the second call to Z_touch()

global TestP = function()
{
Z_touch(); // calls the global touch off function
Engine.GCode("G4 P4");
Z_touch();
};


Gary
Last edited by gburk on Mon Oct 07, 2019 12:30 pm, edited 1 time in total.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

Hmm, before I go digging, can you list the Ztouch script here..
Does sound like somethings screwy.. Ill try dropping it in a button to see..

Art
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

On a side note, I checked your step calibration scripts, math looks right in reading.. :)

Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Thanks for checking the math..

Here is the Z probe script that has problems with being called twice from a function...

Gary
Attachments
ZeroToProbe.zip
(1.24 KiB) Downloaded 170 times
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Not sure if you need the panel but here it is just in case.

Gary
Attachments
probingpanel.zip
(69.52 KiB) Downloaded 173 times
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Decided to try not calling the Z probe function from the X center function and just added some of the z probe code to the x centering function so it all was in one function..

I probed down hit the part top and retracted to .250. this worked good
Then I did a G01 X to move off the part but I used a small value so when I Z probed down now to see if I was off the part it would hit the part
and it did hit the part but same problem didn't stop crashed the part..

so not sure why it doesn't like to do a Z g31 correctly twice.. in a lib function..

works fine if I do a button press, it probes z and retracts then exits the function.
Hit the button again and it will Z probe fine tried the button press 10 times in a row and worked every time..

Gary
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Last attempt.. for now

I loaded the lib function X centering into the script window
Then I rem // out the global function, and the start and end brackets.

I ran the script in the script window, it seemed to work there.
probed down hit probe retracted, then G01 over in the X axis no problem, now I probed down again in the Z hit part and retracted fine, the second probe on z would show as an error, "that you are not off the parts edge", then it would rapid back to X start position.. it all seemed to work fine..

I don't know of any other test to try..
But to me it all points to the lib function's not probing twice, but probes twice fine in the scripter and button presses... 

Gary
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Thanks Gary..


Ill see what I can find..

Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Ok thanks,

One new question, how do you change the colors in the panel the background of the panel, other than loading a bitmap image?
Some how one of my panels got changed to a light grey, and i see no color option except to load a new image, and i can't duplicate the default colors if i create a new image..

Thanks gary 
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Ill have to check Gary, Im not sure top of head. Ill post shortly.

Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Thanks

I did a different test with the probing..

I loaded the x center script in the script window, and at the end i add  Xcenter(); to run it

then ran the script.. it did the z probe OK twice both were called with a call to the Z_probe() function.. then exited the xcenter because  the second probe was hit and not off the parts edge.. worked ok..

what i am finding now, even in the script run window..
is if the second probe doesn't hit top of part and is off the edge of the part, then the script continues on.
the next line is for the X to G31 back hoping to hit the parts edge and trigger the probe.
but Its seems like all G0 G01 G31 are not executed now the is no axis movement, all my print statements display but nothing moving..
But if i replace the g01 g31 g0 with a RapidTo FeedTo, the axis's will move..

Just another thing to look at..

Gary
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

  I suspect all those are related. Thx for the clues, they point to the way the system
cancels a probe if its called while already hit..

Art
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

  I used the following as my test function .. it screwed up when the probe was added after the g1's
by erasing the g1's. The new code now injects the probe only after any previous g1's gave been completed.
The block after a probe in a script is still necessary. Ill have it posted in about 20 minutes.

>>global ProbeTest = function()
{
  Engine.GCode("G31Z-10");
  block("MotionStill");
  Engine.GCode("G1X20");
  Engine.GCode("G31Z0");
  block("MotionStill");
  Engine.GCode("G1X0");
 
};

Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Been working on it, had some problems with my scripts, was still getting Way off feed rates and after the script finished I was having to hit Estop and then hit it Again or I couldn't jog any axis with your on screen jog buttons...

So I decided to go back to square one, I uninstalled auggie and gear and deleted all the folders, found one strange thing it was also showing auggie 3.6c as installed but couldn't get rid of it, so I deleted all reference's to gear and auggie in the system registers.. that seemed to work..

Reinstalled it again..

Now I'm working on the scripts again from scratch have the Z Touch off working, and about 1/4 way though the X centering, been adding it in small bits and then testing it..
So far so good haven't had a feed rate problem yet, or a jog problem, I guess if I do it this way, if I do run into the jog or feed rate or G1  problems I will be able to point you to were they started..

Hopefully by tomorrow  night I will have the X center finished or Broken..

Gary
Post Reply

Who is online

Users browsing this forum: No registered users and 71 guests