reading Pokeys pins

C Scripting questions and answers
Post Reply
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

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
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

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 11:31 pm, edited 1 time in total.
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

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
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

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
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
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
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

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
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
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
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

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
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

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
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

Thanks, Ill check it out.

Ive found a few problems so far, one was reading digital pins, one was probe syncing. Gcode syned properly
but it waits internally for the probe, scripts werent, I find under the new code, this makes it work properly synced.

GlobalSet("FeedMaster",0);
Engine.GCode("G38Z-10F50");
block("MotionStill");
Engine.GCode("G1X5");

  The block is necessary as the script doesnt know the other axis end positions for the g1x5 move.
The block makes sure its still, and that makes the end probe position sync up.

  The FeedMaster,0 is there because the reason your feedrate is sometimes not working is that
the feedrate override is sometimes not working right. Im working on it now as well. Setting
it to zero manually makes your program feedrates work. It may be late week before Im done,
I seem to have a found a nest of snakes Id like to kill in there..

Art
Post Reply