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 »

Sorry Gary, Hurricane had me out of power for awhile..

So the touch probe works.. but the touch plate doesnt? But it does when its in your hand..
Just not when its on the part. Your stumping me as to cause. Must be some sort of ground loop
where your 0vdc isnt the same as ground at that point. You must be in a bit of a floating
ground at that point maybe? What does a meter say across the probe when jogged down to touch it?


  Ill check the feedrate display when changed, what command are you using to change it?
A Gcode command or a SetFeedRate command? Or a Feedrate = xxxx type of thing..

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

Re: reading Pokeys pins

Post by gburk »

art

So you got the hurricane and it missed me sorry. I know what its like not to have power have lost it for over a week a couple times wouldn't mind but when it 95 and no air real tuff to handle..

I found a work around for the Feed rate I removed it form the Engine.GCode and added the Engine.FeedRate() at that seems to set the correct feedrates now.
I don't thing the Feed rate is a problem when running a gcode file only seemed to happen in a script.

Also I seem to have a new problem, here go's if I use auggies jog panel and jog to say .6256 then I zero the axis.
Now I use my jogging panel and set it to travel .02 and hit the jog button the first move is to .6256 and not to .02 the second move will be correct and only move .02 I know it doesn't make sense, telling it to move .02 and jogging to the last jogged position..

as for the probe you have it right holding the plate in air works fine.
I have it attached to a .250 piece of plastic. hoping to isolate it..
The probe does trigger when hit going down and it does stop moving, I have a 0.04 sleep there it seems to get confused and doesn't reverse direction and I don't think it is backing off to invert the probe signal

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 »

Gary:

  I think I see the pattern. It has to do with the GCode interpreter not knowing where it is after a script move.
When you issue a G1X.5, it really translates to G1X.5 Y(LastknownY) Z(LastKnownZ)..etc..

  When running Gcode it knows last position, apparently Im missing the resyncing on some script calls.
A Engine.GCode call should get position synced at this point.  After a probe the position should
also be synced. Keyboard jog will sync as of a version or two back, so by your description it may be the zero
axis that isnt. How are you zeroing it? On the screen button?

  Ill check why a Engine.Gcode didnt sync your feedrate as well. Sorry for all these bugs but we havent been
interupting Gcode for script runs till you started along your path. We'll catch them one by one..

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

Re: reading Pokeys pins

Post by gburk »

Art

Thanks hope I'm not being to much of pest, seems for the most part that auggies has been working for what it was intended till I had to mess things up ???

As far as zeroing the axis I am using the button when jogging.. probing I am setting the position in the script
but if I do a Z touch off with the button, and then Zero the axis with the button I don't see the dro move to the wrong distance,  endless when I zero the axis after the z probe its messes something up I can't see?.

I added the Engine.Feedrate() to the probing and that's seems to set it correctly just in the Engine.GCode from a script is where I see the problem..

I made a new wire for the touch off probe but didn't seem to fix it plunging down after the probe hit...

Its may work one time correct then crash on the next 3 runs.. then work correct, I tried feedrates from 5 to 100 not much of a change..

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

Re: reading Pokeys pins

Post by gburk »

Art

Messed with the probe some more, did the probe plate touch in air holding with my hand again
It also messes up if you don't just tap the tool with the plate if you hold the plate so it contacts the plate for any longer than a tap and remove it does the same thing as if plate on top of part..

so from I can see now is if the plate is triggered and not released in a few m seconds it doesn't reverse and release the signal and then retract, it instead plunges down

if you tap and release the plate real fast in air its ok.. Not sure how to correct this on my end seems like some sort of timing problem..

Hopefully this is correct let me know you thoughts on this..

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:

Isnt that timing in your scripts? As I recall Auggie only probes to the hit and stops.
So after the hit, the script changes the direction and the probe trigger level, then commands
a move away from the plate. Did you put any prints in there to see if the commands to
reverse are in proper order. It may be for example, that your probe for some reason see's
the hit and stops, but then the hit is released as capacitance in the circuit builds
up a charge so it no longer see a short. I can see where that may screw up the logic of a
script if it checks for the hi or low before changing direction. If the hit only makes it a short
for a short while until it charges up, then the move away may just not move at all as it sees
the reverse probe move as complete. All Auggie will do is probe till hit , whatever hit is defined as..
a short or an open..

Art


  Im not sure anymore what logic was used for the probing in the scripts. Print
statements may help find out whats going on in this one..

Art


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

Re: reading Pokeys pins

Post by gburk »

Art

Hopefully its me, maybe when you figure out the setting the zero button to zero and it jogs or probes to the last jogged position may help..

I am going to try the probing with mach3 and 4 to see if works ok, that may at least tell me it not the BOB or wiring.. haven't had mach hooked up to the pokeys in a long time so anything can happen...

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

Re: reading Pokeys pins

Post by gburk »

Art

Tested with mach4 and all seems fine Z probing worked good both with the touch plate and the probe..
In mach4 the probe was non inverted signal, and with the touch plate I had to invert the signal but ran it 10 times with each probe, and no errors or crashing into the part or touch plate, so I have to assume the BOB and wiring is ok..

Also seems to back with the old problem with the probing script that it doesn't seem to run when auggie loads if I hit one of the probe buttons it prints out all the print lines but doesn't do anything no axis movement, if I run it in the script window it runs with the button presses now and every time till I exit and restart auggie then I have to rerun the script again..

Thanks gary
Last edited by gburk on Fri Sep 13, 2019 12:31 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

Tested mach3 now also same results as mach4 probe worked ok, the only difference in mach3 was the probe had it be inverted and touch plate no inverted..

Been testing the script in auggie for probing, I even deleted the old script and starting rewriting a new one line by line saving and then rebooting auggie and testing the button but it seems most of the time as I get to the part to set the probe to invert 0 and then the line of engine.gcode  this is when I seem to have the script not running anymore at boot up and have to run it in the editor first...

Also I removed all the sleeps and prints in the script, but still if the probe is contacted for longer than a quick tap it doesn't retract almost seems like it get lost there.

I really don't know what to change in the script to make it correct, only thing I can think of is making a spring release touch plate, to match the probe..
But if it works with 2 other software programs I assume its wiring is correct..
only difference I can see is in mach4 and 3 is the probe can be set to be inverted or not inverted and I assume keeps that logic till changed in the setting..

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

Re: reading Pokeys pins

Post by gburk »

Art

Really sorry for all the messages..

Did a lot more testing with the probe script, and having to run it in the script window first..
You will most likely think I'm crazy  :(
But I reentered the script line by line again, and checked script back in ran it and all was good.
Now I closed auggie,
Do you remember when I said a while back that 3/4 of the time auggie reboots itself after closing. thinking that may be the problem.
If I just continue loading auggie from there is where I think the script that's in the scripter window gets corrupt somehow maybe other scripts also don't know for sure..
the script will not run anymore after booting endless I run it in the scripter window.. and there may be other problems..

Now if I don't boot auggie  and hit exit, wait a couple seconds and then reboot auggie the script will run now, without having to run it in the script window first..

I did this line by line for the complete script and the whole script runs ok without needing to run in the scripter first..
It also seemed to fix the Engine.GCode running with the feed rate, now the feed rate is changing correctly in the script..

Am I making any sense?.

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 »

Gary:

:), ok. Lets make sure I understand. Your script works properly on reentry, but if you exit auggie it reboots itself,
and the scripts seem to fail.

>>Now if I don't boot auggie  and hit exit, wait a couple seconds and then reboot auggie the script will run now, without having to run it in the script window first..

  How do you mean, "If I dont reboot auggie", is it giving you a choice?

Im wondering the the polarity is getting screwed up. I suspect maybe the polarity setting isnt storing properly,
the way it should work is the setting under config is the permanent polarity at startup. When you call for
an inverted signal its only temporary until next startup or inverted again.

  I have an idea that maybe the polarity is somewhat random based on last setting. It would explain 
a lot as your symptoms seem to agree with the polarity not being as expected..

Ill check that..

Let me know what you mean by not rebooting auggie, Im curious as to how that works as it fixed
the feedrate as well.. thats kinda weird..

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

Re: reading Pokeys pins

Post by gburk »

Thanks art

Try to clear up the reboot.

When I exit and close out auggie, it looks like its closed but the profile identification dialog pops back up after auggie shuts down, it seems to reboot it on its own with the option to select your profile.. I never clicked on auggie to boot after closing it out..
If I select my profile and let auggie continue from here is what the scripts seem to get corrupted.

But if I exit the choose profile dialog now, its closes ok and if I wait a couple seconds and then reboot auggie double click auggie, the profile identification will display again, which it should I choose the profile and auggie loads and the scripts are running ok..

Just one more thing I only have to load auggie once, if it reboots itself and I continue the load form here, then the script that was in the scripter window will not work correct no matter how I load auggie after that..

Also I still think some problems still may be caused by where auggie thinks its axis position is, I seem to get the axis probing in the wrong direction after I do a manual jog and it doesn't move to entered distance when it does probe.

Also if I probe and it gives a backoff error the probe didn't reverse,  after this I get this error even if I jog off the part Zero the axis, then run probe again it seems to be stuck on the error it won't probe or move just get the backoff error message... seems like it may think the probe is still hit..

Hopefully this is a little clearer.

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:

Thx. Unfortunately windows tries top restart a program it thinks hasnt shut down properly.
This seems to cause trouble.. the following can turn it off in Win7..

Advanced System Settings (under Control Panel > System and Security > System)
Click the Settings button under the "Startup and Recovery" heading.
Disable the "Automatically restart" checkbox.

  Now, I did see what I think was happening. IT put in the probing only recently for you
and it was a bit confusing how I did it. You set a probe polarity in the setup and if you
set a global variable called "ProbeInvert" it inverted that setting.
  The trouble is, I connected the probeinvert variable to the setting, so when Auggie
shutdown it might, if it shut down properly, reset your polarity setting.

  So it has changed. I will publish this week and post the change here. In the new version
you need to first go to config and set the new variable "ProbeLevel" to the state
of a normal hit. Test this by trying an MDI line for a probe. If the probe doesnt move
go back and change that setting. If the probe does move then the system variable is
set properly and nothing can change it except the config.

  The Global Variable ProbeInvert is now set to false on startup. It was remembered as
most globals are from run to run. This is true of your scripts as well by the way, if you declare
a global and need it to start at a set value, set it in the declaration or it will be set to
the last runs value. ProbeInvert however, will always start false. It will be remembered
for the run though. If you drop an LED on the screen and give it a variable name of ProbeInvert
you will be able to see if your script has set it properly. Id suggest always setting it true
or false before the probe call just to be sure its what your expecting. Dont set it, call the
probe and unset it immediately though, wait till the probe is done or at last moving before setting
ProbeInvert again.

  This may stop the seemingly random probe behavior and we'll go from there as to the scripts.
Ill try to get it out by Wed. or so. Im still looking for other possibilities.


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

Re: reading Pokeys pins

Post by gburk »

Art

I am running windows 10 it may be a challenge to set it not to restart on updates, there is no check mark for the option will check further..

As the probe invert in the config it seems to be set at its last state, so if its last state was true, it will be true when you reload auggie..

I have a probeinvert,0 before the first g31 and a block("MotionStill") after the g31, then a check to see if ( Globalget("ProbeHit") probe was hit
if it was I do another probeinvert,1 and then try to reverse the probe direction with a g31 till probe triggers, and another block("MotionStill").
This seems where the problem's happen doesn't want to reverse either stops there with probe triggered or plunges down..

I already had a LED on screen to check for the probe triggering also have one on the breakout board..
The led triggers but doesn't go off. when hitting touch plate.
now this problem is mostly with the touch plate, and as far as I can tell has a low signal till the tool touches it.

The touch probe seems to have a high signal till it touches the part, but this seems to work most of the time.

But I do still see a problem with the GCode run from the script after jogging and zeroing the axis not traveling to the correct distance just seems like the last jog is not clearing out.. and when I run the script if I have g01 z1 it ignores this value and runs to the last jog position. whatever it may have been seems that auggie may save this position sometimes when I reload auggie and run the script it will go to the last position before exiting auggie.. 

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

Re: reading Pokeys pins

Post by gburk »

Art

May have come across the area where  running the jog button then zeroing the axis problem could be it seems like it jogs to the wrong position in user cord

It seems when I do a jog then zero the axis and then run the script, that it is now running to the machine cord and not the user

Zero axis then run script g31 z-1 only after the jog button and zero axis now it will run to 1 in mach cord but not in user, and then I reverse to 0 it go's to 0 in mach cord but not in user.

Just a thought

Gary
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest