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

Guess I should have put on my glasses found it..

set to pin 19 false g31 z-10 the dro moves to -10 but if I trigger the probe doesn't stop keeps running
set to pin 19 true and I get no dro moment stays at 0,,

I also tried to set metric to false but doesn't seem to set if I close the planer and go reopen it its back to true

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 »

Hi Gary:

  If the probe wont run if inverted then the level is being remembered but
the initial true or false must be defaulting wrong. Ill fix that up and start checking why
your pins dont seem to register...

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 »

Hi Gary:

  Turned out to be a lib out of date and a setting internally.
Ive now tested with a simulated probe (two wires :) ), and
verified the probing works. Ill try to have the fixed version
out tomorrow. Thanks for the tests, I appreciate it.

Thx
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:

  Forgot to mention, the incoming fix will also make the scripts work
and fix the blocking and such...

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

Re: reading Pokeys pins

Post by gburk »

did you happen to check why I can't change from metric to inch I set it to false and it always seems to revert back to true

I also got the test board for pokeys together today have been testing with mach4 mach3 and auggie
have set it up for the motors ribbon to screw and have the probe and optic homing on the board
worked with all except probe on auggie..

seeing you wrote mach3 have a question with probing. on mach4 I invert pin19 but on mach3 it has to be non inverted and in mach3 the probe led flashes all the time
but not in mach4 it still seems to trigger ok in mach3 just concerned I may get a false trigger 

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 »

Gary:

>>why I can't change from metric to inch I set it to false

  Still working on that one, but it should be fixed by release as well.
Mach4 must use a different paradigm as probe normal.  I wasnt involved
so hard to sat. If the probe led flashes a lot, It sounds like mach3 is seeing
it as noisy.. not sure why.

  Ill try to have it out by late tomorrow with the appropriate fixes..

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 managed to get it out earlier. Version 3.4 is now online for Auggie.

1) Fixes your metric true/false selection. (Due to a recent change, unintended consequences..)
2) Fixes the Probe and all IO from Motion Pokeys.
3) Fixes Script calls and blocks. 

Tested probing on pin19 with both inverted probe and standard probe.

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

Re: reading Pokeys pins

Post by gburk »

Art

tested it out metric is working so is probing only problem I am seeing is when I enter a g31 z-10 is the screen dro seems to only display the z value in chuncks
first display will show 0.254 then no display till 0.508 forget exact value,  am I making sense the dro seems to pause and only display every move of .254 or so

the script I have running does print out a message that pin19 was hit every time I trigger the probe so its defiantly reading pin19 now
the script loads with the lib

do you think my script could be slowing things down messing up a steady dro screen update, because I'm checking status of pin19

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

Re: reading Pokeys pins

Post by gburk »

Art

Sorry went back and turned off my script to read pin19 and the dro is displaying correct now and when I trigger probe it stops so seems to be working ok

so it looks like the script is taking up to much time and slowing things down

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

Re: reading Pokeys pins

Post by gburk »

Art
hooked up a motor now and seems with g31 move the is single stepping barely moving, way behind the dro distance.

if I enter a g0 move the motor moves normal revs up and spins good it seems like g31 isn't sending the correct steps or pulse's as the g0 at least that's
what it looks like to..

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 »

Gary:

  Earlier ( 2 tests back ) you experienced this one..

>>Sorry went back and turned off my script to read pin19 and the dro is displayin g correct now and when I trigger probe it stops so seems to be working ok ,so it looks like the script is taking up to much time and slowing things down

  So at this point the DRO appeared to work OK.. It looks like the script may have been too busy..
You next got..

>>hooked up a motor now and seems with g31 move the is single stepping barely moving, way behind the dro distance.

  Does this mean the DRO still seems OK for speed, but the motor seems not to follow it? At least not at the right feedrate from the G31 move? Does it then move OK if followed with a G01Z10 or whatever?
  The DRO updates as the Pokeys sends new position information so Im not sure what could make the motor lag the DRO. Ill have to give this one some thought. Let me know the answer to question above and any other interesting test data you may have. Id be interested in knowing is the motor only lags in G31 but
other moves are fine. Did position get lost as it did the probe move, thinking it moves 30mm for example
when it only moved 5..?

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 »

Hi Gary:

  I hooked it all up here, the table seems to probe fine in the X and Y axis, I cant test
the Z on mine for technical reasons at the moment, but as far as I can see it
all seems to be running at speed during the probe and after...

Let me know what you find, it may be some setting or another ..

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

Re: reading Pokeys pins

Post by gburk »

Sorry Art;

Probably left to many messages and am confusing you?

1 ? I am finding that running a script to check the probing pin19 must take to much time from the gui and that's why the main screen dro only updates after the axis has move around 0.254?
without the script the screen dro updates fine?

2 ? I am probing now on the X Axis Setting?s for xaxis are ENB = TRUE, REV = FALSE, STEPS PER   
= 2500.000000 , MAX ACC = 19.999001, MAX VEL = 1000.00000, SLIMITS = FALSE,  HOMING REV = TRUE,  HSPEED = 20,  HOME RET SP = 50,  MAP MOTOR 1.

3 - Maybe taking a break and rebooting the computer was what I needed, motor seems to be running fine now with both g0 and g31 the g31 runs at a slower speed but I assume you have the feed rete set lower for probing I did try F100 and ran a little faster so looks good...

have you figured a way yet to read a register or variable to get feed back to see if the probe was hit or went to the enter axis travel distance?.
looks to me like in a script it may be to slow for probing, but seeing your programing over the years you may have a way...

thanks gary

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

Re: reading Pokeys pins

Post by gburk »

Art

maybe you can use the scripting I did a little more research and tried using the yield() after the print line in my script and now the dro's display correctly
and when I hit the probe I get the printed message pin19 hit I may get the message printed twice but the dro is running steady now..

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 »

Hi Gary:

  Thx, good to know. A script shouldn't take any time at all if it uses a line like

Block("MotionPin19");

  that stops the script altogether until Auggie sees pin19 toggle, at which point the
script will continue onwards..

  The script command

a = GlobalGet("ProbeHit");

  will make "a" true if the probe hit on the last G31.

x = GobalGet("ProbePos0") will return the X position of the hit.  1,2,3 will give you y,z,a axis positions
where the probe hit and before decelerating.

  If your just doing a zeroing to a touch plate you may want a script something like this one
designed to be called from a zeroed Z axis position somewhere less than 1" above the touchplate.
User is expected to zero axis when it stops. Because it rises off plate at such a slow feedrate
you will stop withing a step or so of probe hit. If you make the feedrate of rise F1, youd probably
stop exactly on the zero point.

global function ZeroToPlate()
{
  GlobalSet("ProbeInvert",0); //set probe to normal state
  Engine.GCode("G31Z-25F100"); //probe 25mm down in Z
  Block("MotionStill"); //wait for all motion to stop, no system delay for this.
  if( !GlobalGet("ProbeHit"))
    { print"No hit on probe ..Try again closer to plate.");
      return;
    } //we didnt hit the probe during the move
  GlobalSet("ProbeInvert",1); //invert probe switch
  Engine.GCode("G31Z0F10"); //probe upwards slowly till switch releases
  Block("MotionStill"); //wait for all motion to stop, no system delay for this.
  if( GlobalGet("ProbeHit"))
  {
      print("Zero Axis, probe complete.");
      GlobalSet("Zero3",1); //this will zero axis #3-Z (the numbering starts at 1 for X in zeroing
                                      //function even though some other functions start with 0 for X
  }
    else { print(" Error in touchoff" ); };

}

    Thats off top of head, untested so you may find lots of syntax errors there.. :)
Art




 
Post Reply

Who is online

Users browsing this forum: No registered users and 59 guests