reading Pokeys pins

C Scripting questions and answers
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4648
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

>>t looks like it backed off .0061 before it released am I correct?....

  Sounds about right, remember,  whether you back off with probe, or simply go to the hit point, your
within 1 step probably.  Probes are typically accurate to .001 or so, some much
more sensitive. This means you can never be sure if the probe is made or not
after a slow probe, since its that sensitive, the stop point could be a quantum
where the switch is buzzing closed or open due to vibration..
  This is why I just probe down slow ( when I probe which is rare these days),
and accept the hit point as close enough, or pull back to the reported hit point
which is the exact step count where the pokeys saw the hit.
 

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

Re: reading Pokeys pins

Post by gburk »

Art

I think the best results are, to back off to the hit point... and not look for the probe to be released...

I added some code to the script I did a g01 Z +Zprobehitpos and set the dro to 0 then I manually  jogged up a little, and then sent a g01 Z0
The probe led lit when on top of plate  but I still could slide the touch plate without much trouble the tool wasn't so tight that it was forcing into the plate
If I Probeinvert,1 and back off till probe releases then set Z to 0 do a manual jug up and then a g01 Z0 it stops just above plate the probe led doesn't light up
but I can't slide a piece of paper between the tool and plate.

So I am thinking I don't need to probeinvert,1 and back off till release, it seems a little closer at the probe hit position that the back off..

or would you Zero at probe hit position, back off till released then g01 to retract Hight?.

or Zero at back off release position?

Thanks At least I think I have it figured out fairly good right now..

Yes back off with probeinvert,1 was .0061
I also did a test that when I hit the plate i set Z to 0 and them g01 back off to the probe hit position and was getting between .0061 to .0066 on the dro

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

Any of those methods I think is fine..

Your tolerance of .006 makes sense, thats one step of your motors. I wouldnt bother with invert myself,
its handy for auto measuring routines maybe, but just probing to stop and g1 to probe hit is about
as accurate as anyone needs.

  Thanks for all the testing, it made the scripting that much more stable..

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

Re: reading Pokeys pins

Post by gburk »

Art

Thanks for you work, to get it going.

I will work on cleaning up the z script and get the X centering to work for now.
then attach them to a message and you can look them over and leave them up or say OPPS you messed up..

Thanks for all your help..

When you get real board with not to much to do If you want to take on the task for spindle indexing I'll be around..

Gary
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: 4648
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: 4648
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 312 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 325 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: 4648
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: 4648
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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest