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 »

Thanks Art

I did setup a dro that I can enter a jog distance looks like 0.00000, but not sure how auggie handles real short distance's if I enter 0.00100 auggies X axis dro doesn't show any movement until I have jogged 3 or 4 times then it jumps to around .00630 and its usual 25 to 50 off.
if I have jogged say 3 times and that should be at .00300 auggie's x axis dro would display .00250 sometimes .00225...

haven't tried it on the mill having relay problems so no spindle again...

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:

  The granularity is what your describing. What is your steps/mm ( or steps/inch?).

Internally when you command a move it will move the waypoint location to your new
command. So lets say your at .301 and you command a .001 move. The waypoint
pointer increments to .302, but this may or may not move anything as your
steps/unit may have a granularity that says not enough distance has changed to
equal one step of your motor.  In other words if your steps/unit is 157 then your
minimum move distance is 1/157 = .0063 or so.

  Could it be that ? If not maybe I have a bug hiding in there somewhere..

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:

When you put in the motions you describe, do you add the motionstill calls
between them as well as a yield so the moves are processed.?
I havent checked this, but the Yield() may be necessary to allow the
engine to start processing the moves so it knows it isn't still so the
block works. Im worried speed makes it simply do it all at once as the
Gcode moves haven't yet started so it is still in MotionStill status...

As in

  Engine.GCode( "G1X10Y10");
  Yield(); //this may be needed to make the next block see its in a move.
  Block("MotionStill");
  Engine.GCode( "G1Z-.5");
  Yield();
  Block("MotionStill");


  Art


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

Re: reading Pokeys pins

Post by gburk »

Thanks art

will try the yield() and let you know how I make out..

as for my steps
X and Y off the top of my head are at 1600
and Z at 1800
The travel distance is real close but haven't really dialed it in yet will do that soon still messing with the forward and reverse relays I think one went bad..

Gary

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

Re: reading Pokeys pins

Post by gburk »

Art

Ran a test with the Z move then X then Y

all like this
I hit the m6 t the my dialog appears I then save the current Z X Y positions, now jog the z x y to a safe tool change position and change tool
jog tool down to the top of part set it to Z = 0 jog up to a safe position, then close the dialog.

Now I run something like this
Engine.GCode(ZStartPos);
yield();
block("MotionStill");
Engine.GCode(XStartPos);
yield();
block("MotionStill");
Engine.GCode(YStartPos);
yield();
block("MotionStill");

But it seems to run then all at the same time, I would like the Z Move to finish before the X and Y start..
Make better sense?.

Hopefully I will not be knocked off the internet when this hurricane hits us down here..

Thanks gary
User avatar
Mooselake
Old Timer
Posts: 531
Joined: Sun Dec 26, 2010 12:21 pm
Location: Mooselake Manor

Re: reading Pokeys pins

Post by Mooselake »

Where are you, Gary?  On the east coast?  We're in SW FL, on Pine Island near Ft Myers/Cape Coral and so far it look like it won't hit us too hard.  Our first hurricane, stocked the pantry and filled the Subaru.

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

Re: reading Pokeys pins

Post by gburk »

Small world kirt

I'm in cape coral near pine island off burnt store road nw cape...

Hoping we don't get hit, last one we had was a lot of flooding, and as usual they don't know exactly the direction its going..


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 for the test. I see what you mean , Ill do some tests and see why that is so
and attempt a repair.

  Your step numbers show you should move in .000625 intervals. Ill check mine
to see how it matches. I usually just use single line mdi to do incremental jog,
I assume your DRO is just tied to a G1 move button for the dro incrment?

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:
 
  I think Ive found our main issue. When reading Gcode there is a strict ordering
condition for execution of the queue, but that function was broken badly , I just didnt
see it as Gcode is restricted in order in other ways. Your scripts show it more clearly.

  Commands meant to be in order were being shoved to the bottom of the queue, instead
of to the top. This means when MotionStill consition was required, the command was simply
postponed to last and the next command allowed to execute.

A new version will be posted in a few minutes with this corrected. Let me know what you see
as a result. This affected everything from dwell to toolchanges so its a pretty dramatic change.

To test your problem I used


Engine.GCode( "g1x10" );
Engine.GCode( "g04P4" );
Engine.GCode( "g1y10" );
Engine.GCode( "g1z10" );

  The dwell happened after the x,y,z moves. (They did happen one after the other though..)

With the fix the dwell occurs after the X move. As this affects most operations, use caution but I suspect
it fixes a great many script ordering functions and troubles youve had.

Ill post when fix in online.

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:

Fix is online.

  Let me know how its works out. In regards to a previous question about order
of motion with the x,y and z, you shouldnt need any yields or blocks in that
question, three gcode lines following each other should move only 1 at
a time without any special consideration. Put a dwell between them if the
motions are short as a test. If they are small moves then its possible the DRO's
will all update at once, thats a matter of DRO timing, but the motion of the z
should have always ended before that x,y move. We may need to take
another look at that one.

This version should fix all manner of other errors though on your probing
and toolchanging issues..

Art
User avatar
Mooselake
Old Timer
Posts: 531
Joined: Sun Dec 26, 2010 12:21 pm
Location: Mooselake Manor

Re: reading Pokeys pins

Post by Mooselake »

gburk wrote: Small world kirt

I'm in cape coral near pine island off burnt store road nw cape...

Hoping we don't get hit, last one we had was a lot of flooding, and as usual they don't know exactly the direction its going..


Gary   
So anything we don't bring inside might end up in your yard?  Hope the latest forecast is right and it head up the east coast, will know around Monday.  This is our first hurricane here, and my first since about 1972 in Houston; that one went elsewhere and we only got some heavy rain, 24 inches in 24 hours iirc.

Never been this close to another Gearotic user, other than visiting Tweakie on a trip to England some years back.  We should think about getting together.  I'll try and remember to PM you after the storm is past

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

Re: reading Pokeys pins

Post by gburk »

Sounds good

I have been though 4 here the last one had the most flooding, it does look like we may get lucky on this one right now, but you are right won't be sure till Monday at some point..

I use a few of the cnc software, mach3 mach4 auggie, just a fun and frustrating hobbie at times also have a couple 3d printers..

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

Re: reading Pokeys pins

Post by gburk »

Art

this is how I am exiting the toolchange dialog
I removed all yields and blocks and put in looks like a pause..

this is called before the dialog saving the current positions and setting up the gcode to return to pos.

    GcodeReturnToPos[0] = ("G90 G01 X"+GlobalGet("Axis1CurPos")+" F20");
    GcodeReturnToPos[1] = ("G90 G01 Y"+GlobalGet("Axis2CurPos")+" F20");
    GcodeReturnToPos[2] = ("G90 G01 Z"+GlobalGet("Axis3CurPos")+" F20");

this is the close dialog
but before I closed it I may have jogged the axis's to make tool change then moved the Z down to re touch off top of part and set Z to Zero
now I want to return to start positions, they all do move back to start but all at the same time, I want to make sure the Z has moved first even has finished its move before x or y move I don't want to chance the tool dragging on the part..
Make more sense?

global MyToolChangeClose = function()
{
print("Exiting Manual Tool Change");
//print("Z position= "+GcodeReturnToPos[2]);
Engine.GCode(GcodeReturnToPos[2]);
Engine.GCode( "g04P4" );
//yield();
//block("MotionStill");
//print("Z position= "+GcodeReturnToPos[0]);
Engine.GCode(GcodeReturnToPos[0]);
//yield();
//block("MotionStill");
//print("Z position= "+GcodeReturnToPos[1]);
Engine.GCode(GcodeReturnToPos[1]);
//yield();
//block("MotionStill");
};

update
I tested it again and upped the P to 5000 and I just don't see any pause or wait time..

Also tested not being called from the dialog, ran the code in the script window and it was fine I may not even have needed the dwell pause ran each enging.gcode before the next one and it paused at the end of the first engine.gcode so it waited a few after finishing to run the next line of engine.gcode..

So to me it has something still to do with the dialog box code doesn't seem to want to pause or wait for the p4 at all and still Executes all the engine.gcode at the same time 

Thanks Gary
Last edited by gburk on Sun Sep 01, 2019 12:29 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:

Thx, much clearer. Ill try it in the closeDialog and see why its screwing up..

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:

  It was the jogging. In the context of running Gcode, the system was assuming the last point reached
was the last Gcode call. The next Gcode call would be from that point. When you jogged it displaced the
known coordinates to plan from. Try this new version online now one and see if its better. If
you jog, the Gcode pointer is updated to the new coordinate after the jog completes.

Art
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest