reading Pokeys pins

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

  Seems the DRO must be sending data after it gets an update command from the system
when the script demands a change.. but its the wrong data.. Ill investigate based on that..

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

Re: reading Pokeys pins

Post by gburk »

Art

Thanks as for the probe logic it seems to a problem, for me at least, if you are wanting to probe a small hole,
and you hit the probe and do a g1 back off, its hard to make sure you don't back off to much and hit the other side of the hole..

I have started to rewrite the scripts to do a G31 back off "ProbeInvert",1 then a G31 or g1 from there, works ok with the Z probe, working on the X now..
I think this should get me to an open probe state and i can go from there..

Any thoughts on a better way.?

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

Re: reading Pokeys pins

Post by gburk »

Art

It just looks like When auggig boots and reset's scripts, or if you check back in script, its doing some thing just a little different then when compileing the script in script RUN editor.

I was also noticing besides the feed rate being off, so are the Screen Axis dro's not much to worry about but off, then when you RUN the script the feed rates are right and so is the Axis dro's are also right on..

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

Re: reading Pokeys pins

Post by ArtF »


Gary:

    >>Any thoughts on a better way.?

I guess one way is to check the pin status to see if its hit, I repaired that as well so if you ask
the digital level of that probe pin you should get the right answer, it was broken but now reports
if the pin is high or low. Its a way to check if you backed off enough..but youd need to be carefull
that you didn't back off clear to the other side.
  The safest way for sure is to probe to side, reverse probe level , probe off, reverse level again,
then probe to other side. You could do a pin check every probe to be sure of if its in "hit" or not
based on level.

>>its doing some thing just a little different then when compiling the script in script RUN editor.

  Yeah, I'm still trying to understand why the differences.. though the home showed a clue, I was checking to make
sure no one homed while running a program, this made a script home fail because during a script, it sensed a program
was indeed running so it ignored the call. SO I removed that safety, ( Do NOT home by button during a run, it would actually try now..)

I suspect something similar somewhere, where I tried to make it safe in context of running vs idle and my
logic was faulty as I didn't include scripts in my considerations. Im checking to see where I did that..

Art



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

Re: reading Pokeys pins

Post by ArtF »

Gary:

Version d is online now. Auggie will drive you nuts with feed-rate messages, but their put onscreen for this test
so I can figure and prove exactly where they are coming from. It may be some sort of init failure on my part
in the scripting. (Scripting is incredibly complicated in its interactions with the system and the bugs your finding are
evidence of non-use since I wrote them, so this is all a test of how logical I was thinking when I wrote much of this
and I do apologize for some of the interactions. Things like probing I added just in case, but had no intentions
at the time of actually using them. I kinda marvel at the internal complexity of this beast now...and I thought
I took timing liberties with Mach3, Auggies internals make Mach3 look like a game of solitaire )

 
  So now when you command a feedrate change it will generate many messages that will show me the logical
flow from routine to routine and call to call, engine to engine and thread to thread.. It will tell me if its from a
script, or the DRO, when it was injected any why.  I suspect this is mostly the result of one bad logical
assumption on my part during development , I just cant quite grasp it yet, but feel we're close. :)

  Repeat the issue so you get those weird numbers, send me the log and I think Ill be able to say
with some certainly where the heck those weird numbers came from. Ill then turn down the priority
from 1 to 2 so they log only and do not print to screen. I use a priority system to determine if something
is printed, which leads me to another request, if your seeing a message too often that you feel
is disrupting to you, let me know and I can easily set it to a lower priority.

Thx

Art

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

Re: reading Pokeys pins

Post by gburk »

Ok Art

Will test it out later, and get back to you.

I did decide to go with probe hit probe then G31 back off till released once released i should be able to use another g31 to probe to other side,
and not have to use a G0 g1 to move off.. and take the chance of crashing..

So rewriting the scripts :o

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

Re: reading Pokeys pins

Post by gburk »

Art

Here is a couple logs the 2 that are have a name Norun were not run in the script run window, the other i did run a probing script first,
funny thing is it doesn't matter which probing script i run anyone seems to fix it them all..

Also not sure how you setup the prints, but the last print seems to run in a loop till i exit or estop auggie.

Gary.
Attachments
ErrorLog.zip
(8.39 KiB) Downloaded 208 times
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4501
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

New version uploaded to stop that loop.. Im still tracing the flow..

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

Think I found it. My version was defaulting to feedmode of FEED/Min while yours was
defaulting to TIME_INVERSE , a strange mode thats used for constant speed. It was only partially
defaulting to that however, so it was making up weird feedrates depending on Z and spindle speed.

  Tended to only happen when a script Gcode was sent..

This version will either fix it or tell me why. Its online now.

Art

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

Re: reading Pokeys pins

Post by gburk »

Art

Think you will be happy,
Ran 4 or 5 probes, and feed rates looked good
here is the error.txt file

Gary
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

Thx, it explains a lot. I run in debug mode for technical reasons here, it zeros variables. Release doesnt
and this particular value, FeedrateMode wasnt being init'd..

Ill keep my fingers crossed.

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

Re: reading Pokeys pins

Post by gburk »

Art

I have ran it many times now, and not seeing any feed rate problems..
Will let you know how things look when i get the back off's working in the x and y, have it going in z will test x y tomorrow, I think the code I added for back off's is right, but you know how that go's.

>>
>> I guess one way is to check the pin status to see if its hit, I repaired that as well so if you ask
>>the digital level of that probe pin you should get the right answer, it was broken but now reports
>>if the pin is high or low.

forgot to reply to this, what i have been doing is testing pin19
    pinstate = Pokeys1.GetPinDig(19); 
    //print("Pin 19 Changed");
    GlobalSet("ProbeLED",1);
    block( "MotionPin19");
not the complete script but as far as i know it has not stopped working, i only use it to toggle the probe hit LED on or off..

is there a better or faster way ?.



Thanks
Gary
Last edited by gburk on Sat Nov 09, 2019 2:14 pm, edited 1 time in total.
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

I seem to be having another small issue i can't figure out

right now it the bore or hole probe

I have an 1.5" hole i set the bore size to 1.5 this probe's and centers great every time and ZERO's the axis's
I also tried a .75 hole also worked fine every time.

but if i have one that is to .5 or below after it centers a axis it should Zero it, but this is a hit or miss, it seems to always move to the center but doesn't set the axis to Zero
its random sometimes it doesn't zero the X and sometimes i't's the Y.
I tried a pause before setting the axis to Zero
also tried both  Engine.SetAxisPos( 0, null, null, null );  and GlobalSet("Axis1CurPos",0);  or Axis2 get the same results.

This one is real strange don't know why it messes up on the smaller holes...

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

    pinstate = Pokeys1.G etPinDig(19);
    //print("Pin 19 Changed");
    GlobalSet("ProbeLED",1);  // I suspect you meant ", pinstate" rather than ,1?

  No, looks good.

>>but if i have one that is to .5 or below after it centers a axis it should Zero it, but this is a hit or miss, it seems to always move to the center but doesn't set the axis to Zero

  Strange symptom. Does the zero button work afterwards to set the zero?

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

Re: reading Pokeys pins

Post by gburk »

Art

I think i figured it out for now, i'm thinking the smaller the hole maybe its moving things to fast and loosing track, just a thought

I never thought to lower the feed rates, they were set at 10 slow probe and 40 for g01 moves, that works good for the holes larger than .5 or so
So i lowered the feed rates to 5 for slow probe and 20 for g01 moves and this seems to have fixed the problem Axis's get set to Zero correctly at these feed rates..

I think you can kill the print's to screen now also.

Gary
Last edited by gburk on Sun Nov 10, 2019 1:15 pm, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest