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 »

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: 4647
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: 4647
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
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Ok jog seems better as the dros but I think my mind is in a fog, and I am not getting the script code right.. so I am attaching the panel and scripts for jogging and the toolchange plus dialog... gcode moves seem the same from closing the dialog... I sure your mind is sharper that mine is right now, seems like everthing I touch breaks Starting to think SSR relays don't last replaced 3 in two weeks and need another, even bought a couple form automation direct thinking they would be better, nope both bad, wiring is correct they worked the way I have them wired for a couple weeks...

Also I think anything jog below 0.0005 will not update on the DRO ...

Thanks gary
Attachments
test.zip
(72.81 KiB) Downloaded 244 times
Last edited by gburk on Mon Sep 02, 2019 5:05 am, edited 1 time in total.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4647
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

A jog below 0.0005 would require a steps/unit of 2000 for that axis. The planner will
only update 1 motion of 1 step of your motors. So if your at 1600 steps/unit then
the minimum jog amount recognized will be .000625

Ill replace my scripts with your new ones in my test setup, but I cant exactly duplicate your
setup, so Ill see what they show.

  Seems strange for ssr's to go so much. Are you sure their high enough current capability?

Art


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

Re: reading Pokeys pins

Post by ArtF »

Gary:

  Ive added your jogging panel but you diodnt give me your scripts for the controls
of it. Ive been using my jog instead. Does it seem to work in order with my jogging
buttons? If so, what is the script your using for Jogyplus and such.

  If it doesnt work when using my buttons, describe the operation and Ill duplicate here
to see where Im missing the sync call.

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

Re: reading Pokeys pins

Post by gburk »

Art

Sorry my mind with the scripts has been in left field, think I have been abscessed with the SSR problems, and can't focus on anything else, OCD..
Seems what I been finding is the SSR relays at least some of them are staying closed so the current never stops flowing, I had 4 do this already..
Ordered 2 more If another one messes up i'm going back to no reverse, and will just make a mount to use a stepper on the spindle for threading..

As for the jogging with your jog panel it works my problem is I can't get it to single step or close to a single step when I am near the top of a part for touch off.
I think I did say before it seems like every time I am almost at the top of the part and try to jog to touch it seems that I hit jog arrow and it doesn't stop
dives into part and keeps going of course now missing steppes and I have to hit estop..

The main problem I have with your jog panel is not enough control for the short jogs, every time I hit a jog button it travels way to far..

I though the scripts for my jog were in the zip I will check and resend if not..

I haven't tried the probe to top of part from the dialog, maybe that would work better, but have to wait till new relays get here now :P..

I looked at the zip file on my end and it has the babystep.panel the jogging script also the testtool for tool change its a slimed down version.. and the dialog script.
so if you did get them all the jog should work. its not a good script but lets me move in smaller amounts also the first dro in the my jog panel is the jog amount so it won't move if you don't enter a value there.. like 0.0100 or whatever..

Gary
Last edited by gburk on Tue Sep 03, 2019 7:29 am, edited 1 time in total.
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 »

Gary, what kind of load are you switching with those SSRs?  Do they need to be heatsinked?  If you're blowing that many I'd suspect there's a problem with over stressing them.

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

Re: reading Pokeys pins

Post by gburk »

Kirt

There all mounted to heatsinks, don't think they even have run lone enough to overheat, but you know how hot it is down here right now..
They are all rated from 5-200 vdc and I don't think I pushing any more the 100vdc.


Just got the new relay and its working again, going to test them running just with a 12v motor in the house for a day or two and see how they heat up inside before I move them back to the mill..

Gary
Last edited by gburk on Thu Sep 05, 2019 9:18 am, 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


as for the m6 tool change it seems to work on first run the x y z jog back to start pos in the correct order...
if you hit stop and rewind then run again is when they all move at the same time..

just a couple more thoughts..

Thanks gary
Last edited by gburk on Wed Sep 04, 2019 3:10 pm, edited 1 time in total.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4647
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Thx Gary:

I think I know where the problem may lie..

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

Cant find your jogging scripts anywhere. There not in the panel and I cant find a script
for any of the buttons being registered. What I need to know is how are you doing the jog, with a Engine.FeedTo
or a .GCode(..) ? I need to trace that section to see why it might forget your position..

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

Re: reading Pokeys pins

Post by gburk »

Art

Sorry here are the scripts again they seemed to be there at least when it checked the zip before uploading..

I tried both Feedto, and engine.gcode same results..

I mounted the relays back and reconnected the spindle, so planning on testing it if it cools down some tonight when the sun go's down
I did test the m6 dialog with the Z touch off seems to work when dry running probe trigged good and retracted but, will need a real motion
test to see if it retracts and sets the new tool to the correct Hight.
will let you know how that go's..

also I had the problem with the jog not stopping again I'll be jogging then it seems to go into continuous mode I tap the jog button and it doesn't stop
I though it may be the mouse or computer but now i don't think so now it has happened on two different computers and with different mouse's it was only showing up in the Z jog but last night it did it in the X jog and this is in auggies jog panel..

Gary 
Attachments
Jog.zip
(5.03 KiB) Downloaded 252 times
Last edited by gburk on Fri Sep 06, 2019 12:15 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

Have connected and did a couple test, seems my steps were way off, I had the z set to 1800, well I had to set it to 16000 to move 1 inch seems close for the z now anyway..
Having a few probing issues my touch probe seems to be high and go's low when hit...

if I use an isolated touch plate its the opposite low then high when hit..
also seems even with the plastic between the touch plate and top of part I seem to get a slight signal going though to the breakout board the probe led light is real dim but does light up i'm not sure what would cause that.. if I remove one wire it gos off..
so sometimes I seem to be getting false signals..

one example is I probe down in the M6 call it touches off and stops fine but it looks like it may be getting a false trigger when it inverts and backsoff for the release signal.. and of course it stops there and doesn't retract to the correct Hight because it thinks there was an probe error...

making any sense to you..?

Gary
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest