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

Got to run think its going to be hit or miss now runs once not the next time the only thing I found was the water level was low its water cooled and was not pumping cpu was getting hot right away filled it up and got it to run for now..

The first probe run the g31 f5 was good, the g01 on retract changed to 15.33 instead of 30..
also the first run I got the jogging message and had to hit estop I don't see a state dro on the main screen I do see a run state in the dialogs with the homing limit led's and that was at 0
The dro on the main screen  to the far right that has no name over it showed 3

Not much help..

I don't think the feed rate is off in a loaded gcode file it seems to change ok, so maybe just in the scripts G01.

Going to run the gcode file that crashed in simulator mode and see how that go's on the mill.. cutting air

10,000 holes is there enough time in a day for that many holes ??? ???

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

Re: reading Pokeys pins

Post by gburk »

Art

Ran the gcode file its around 1300 1400 lines, the file ran no crashes, I did see the feed rate dro mess up around line 900 it went to 4.0 that's what I have the z moves set at and 15.0 for the x and y and it stayed at 4.0 the rest of the file run, im not sure if the x and y really slowed down to 4 , its hard to tell when running but maybe just the feedrate dro wasn't getting updated anymore.

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

Re: reading Pokeys pins

Post by gburk »

Art

In probing I was using g01 to retract and no probeinvert,1 with g31 to see the probe release...

Now I added the probeinvert,1 and the G31 Z0.1 F5 then motionstill it doesn't seem to move the Z up at all it stays hit, and seems to skip that code or just not run  it, or because its triggered its reading that line as probe triggered, the lines after that look for if (Global("ProbeHit")).

I assumeing,  it doe's read that line as the probe being hit so it runs the code from there, so I am not sure if probeinvert,1 is switching the logic to wait for the probe to open correctly.

One good thing it still go's up when it reached the g01 so no crashes..

let me know if it should be done differently.

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

Re: reading Pokeys pins

Post by ArtF »

Hi Gary:

  It does sound as if a bug is in the swapping of invert, Ill run some tests here to see why.

As to the feedrate, feedrate is special in that it updates immediately as the queue runs, That means
after each line is placed in the planner, the feedrate is updated to that lines feedrate if commanded.
As the queue can be far ahead, you may see the feedrate of some future line displayed even though the
moves are all properly programmed.

As an example.

G1 X20 F1
G1 X30 F2
  G1 X40 F4
  G0x50
  G1 X60 F60 
...
  G1 X50F100

  If you ran the above code the feedrate dro would read 40 almost instantly, but each move
will be done in the correct feedrates. Its because with lookahead the display may be
100 moves ahead of you. In thgis case the g0 causes the queue to wait till done
so it diosplay 40 until then, and then displays 100 pretty much right away as it queues
up the rest fo the moves.
Im not sure thats whats up with feedrate, but its an oddity you should
be aware of.

  G0's or modal calls terminate a queue until its empty so feedrate will display the feedrate of the line
before any g0 or modal call.

Art


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

Re: reading Pokeys pins

Post by ArtF »

>>10,000 holes is there enough time in a day for that many holes Huh Huh

  only with a galvo laser doing 10 ms drilling shots.. :)


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

Re: reading Pokeys pins

Post by gburk »

Art

I never messed with a laser Most likely won't read some stuff on the laser's but i'm thinking it would be way to much money for a hobby at last one that can cut metal.

Messed with the baby stepping function seems to work now, I'm missing something in the code to go pos and neg, if I step pos to at .001 to .1 and then hit the neg button, it go's past 0 to -.1 plus .001 so didn't reverse just 0.001..

Making any sense?

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

Re: reading Pokeys pins

Post by gburk »

Art

Did some Z probing test to see how close the tool is to the top of part after the probe hit and G01 retract to 1" and a touch plate thickness of .475
this is all in the probe button function and reading the probing dro's for the values..

I didn't have any feeler gauge's handy but after the retract to 1.0 I removed the touch plate and sent the Z to 0, it was really good as far as I am concerned
the tool wasn't pressing into the top of part I could still move the part slightly, but I couldn't fit a peace of paper between the tool and top of part..

I don't know if it would get any better with the probeinvert,1 release on back off or not, there is not much room for improvement. maybe only a thousand or so.

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

>> don't know if it would get any better with the probeinve rt

  Yes, generally with fast hardware your within 1 step when a probe hits, if you move back to the probe hit point,
otherwise your within 1 step plus deceleration, so that varies with speed of approach. With a low feedrate and
fair acceleration, youll be within a few steps even without a reverse probe. Thats good enough for most people.

  The jog is odd.. I have your jog screen so Ill check why it goes back so far. It doesnt make much sense, if the
planner wasnt syncing it should fail while jogging forward. First press in negative should only go back .001
from .1.

>> read some stuff on the laser's but i'm thinking it would be way to much money for a hobby at last one that can cut metal.

  It would be. We who play with lasers generally cut paper or wood.  While 3d engraving is fun
with lasers, Im playing with hole sizes in materials as experiments. Here is a photo of one of yesterdays tests
in a piece of normal paper.  This has about 2000 holes I think.. not really sure, each is .2mm in diam. The colors
are because the paper is standing against my monitor screen as the photo is taken. It took about 8 minutes I think
to do all the holes. ( In auggie a laser hole is drilled by a modified G04 "G04P.01R95" which means laser a hole
at 10ms long at 95% power. ), I have a PWM reformatter on mine which then reduces the power to a setting
at the laser, these holes were done at 10% power. ) There is a secret module in vexx that produces Gcode for laser
drilling any matrix of holes at any power and time length in any shape and drills them in an order that allows previous
holes to cool down by drilling the furthest next hole next. :)

Art


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

Re: reading Pokeys pins

Post by gburk »

Art

Thanks,

Hard to see the holes really small. but cool.

The only real thing I could see myself doing with a laser is engraving, could put one of them together cheep enough for plastic or wood, but also running out of room in a two car garage, with two mills a lathe 2 3d printers and all kinds of tools or toys.. wife would not be happy can't park her car in there, anymore stuff may not be able to walk though it  ;D

Will wait and see what you come up with probeinvert.

I assume my problem with the jog is i'm not zeroing or setting position's correct, maybe one of the global var's..

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

Ill let you know..


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

Re: reading Pokeys pins

Post by ArtF »

Gary:

  I didnt play with the script to figure out where its wrong, but I traced and coudl see whan the neg
button is pressed, it goes all that distance because the script is commanding it to.

I modified the script to test for sync as follows..

gcode  = "G91 G01 X.1"; switch to incrmental,
Engine.GCode(gcode);
gcode  = "G90";
Engine.GCode(gcode);  //switch back to absolute.

  and I used -.1 for the negative jog, all worked as I expected. The G91 makes it temporarily incrmental..

Id suggest you try making the jog using G91.. but what you have will work if the logic bug is sorted
out to figure out why the first press of neg goes to -2 after the last posative set it to 2.0 on a jog..

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

Re: reading Pokeys pins

Post by gburk »

Art

Thanks I Do think if I remember right that I tried G91 but I will double check and make sure,,

I also am sure you will figure things out.

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

Re: reading Pokeys pins

Post by gburk »

Art

Went back and tried G91 again I didn't see any change's

I Still Think I'm Messing up on the way I am jogging up and then down, but that doesn't explain why the G90 and G91 are not jogging to different positions..

OK if I have a .0020 distance entered to move the X I hit the jog X+ it moves to .0020, now if I hit the jog X- it moves to -.0037 this is with G91
I ran the same script with G90 and they were exactly  the same values.

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

Re: reading Pokeys pins

Post by gburk »

Art

I Think I Got jogging working, It was as I thought I was trying to make things way more complicated than need to be, so removed most of the global's
and just used the engine,gcode without trying any fancy stuff and it seems to jog correctly now..
The only thing I left in the script was reading the jog distance dro..

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

Yes, thats what I found, the error was somewhere in the script logic.

Just a note, and Im not sure this is it, but if you declare a global variable, you
dont need to global it again.. it may have no effect or it may screw up , Im not sure,
but globals should be declared as such, and then used as a variable..

Example:

global MyGlob = 0;

function foo( var )
{
  MyGlob = 6; //not "Global MyGlob = 6";

}

  Im not sure if using global again makes a duplicate variable or not.. Id have to check..

Glad its working though, sounds like almost all the weirdness is gone..



Art
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests