GearHeads Corner

General Category => C Scripting - 101 => Topic started by: gburk on November 27, 2018, 09:00:43 PM



Title: reading Pokeys pins
Post by: gburk on November 27, 2018, 09:00:43 PM
I put this in a new library I know I am doing a lot wrong don't seem to be able to trigger the pin when I trigger it with my switch i'm sure its being triggered
I have other software that is reading it correct high or low..

so far the only script I have had any luck with is putting a button on screen and getting it to print when pressed but I assume it because the script is in the screen script
and not the library.

How far off am I  ???

global ServiceIO Pin19 = function()
{
  while(1)
    {
       print("IoPin19");
       block("IOPin19");
       //do what you wish to happen
       // on pin19 change here.
    }
};

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on November 27, 2018, 09:13:50 PM
Hi Gary:

 Ill look this up in the morning and show you how to do what I think
your trying to do. Do you have 2 pokeys, a master and an IO one, or just one
pokeys and your trying to trigger on its pin19?

Art


Title: Re: reading Pokeys pins
Post by: ArtF on November 28, 2018, 09:49:21 AM
Hi Gary:

  The syntax you need is

global ServiceIO Pin19 = function()
{
  while(1)
    {
       print("MainPokey sPin19");
       block("MotionPin 19");
       //do what you wish to happen
       // on pin19 change here.
    }
};



   You have it correct except that Auggie will control up to
two Pokeys at once. The main pokeys is a 57CNC type,
while the IO pokeys can be almost any type. So to block
 on the 2nd pokeys is your original code, while the main one is called with
MotionPin 19. The two pokeys are refered to as Motion and IO.

 The above script will block on pin19
of the 57cnc.

  Also, if you add this script to the GCode library for example,
you should call it in the library at the end with
ServiceIO Pin19(); to start it up as the library is added.

  Im still looking into the question of probing for you. When I wrote
Auggie it was with the intent of creating a cnc controlle r of
basic abilities which is why I didnt add threading or probing,
while the code exists for both in the engine, I knew from Mach3's
developme nt that few used probeing or threading and they tended
to create the most support, so for Auggie I didnt support the more
obscure functions that caused all the tech support.

  Auggie is pretty powerful for laser as I use it frequentl y for that myself,
and its pretty good at general things in cnc, but I tend to use
Mach3 myself for milling, though a special copy of my own design.

  It may , however, be possible to give access to the probing calls
via script, if I can do that I will turn on an interface for it, and then the G31
command could be scripted to do a probe. Any GCode not handled by Auggie
will elicit a call to a Script under that Gcodes number. For example, as
Auggie has no internal hook for G31, it will at the right time in the code
call for a script called "GCode31", and if the GCode library has such a
named function it will be executed.

  So Ill check to see if I can do that this week, its all a question of
how much code would be required to give access to that function
as Im deeply into some pwm work to enhance laser engraving

Thx
Art



 


Title: Re: reading Pokeys pins
Post by: gburk on November 28, 2018, 10:34:12 AM
Thanks Art

I will try it later, I have only on pokeys57c nc..


Title: Re: reading Pokeys pins
Post by: gburk on November 28, 2018, 03:07:02 PM
Ok I made the changes to the code as per your suggestio n, but doesn't seem to trigger the pin or at least see it being triggered, I don't get the printed message displayed from the code.

I did create a library folder called pokeys57 and added the script to that library also have it turned on and checked
you said maybe put it in the gcode library does it need to be there ?.

or could I be missing something else.

tested the pin in mach3 and mach4 today and both read the pin so I sending the signal correctly .

also some times when I boot auggie  it asks if I want to use pokeys config or auggies I have been choosing pokeys..

Im supprised no one has asked for probing but I guess auggie is mostly for laser and I mostly use the mill...
I have problems with pokeys and mach3 probing no matter what I change in the config the probe led flashes on and off looks like a false trigger constantl y
if I invert the pin the led stays on but on flashing but mach3 thinks its triggered ...
Mach4 seems to read it ok no flashing but I don't have mach4 on the mill's computer. 
and I like the scripting better in auggie not a fan of lua…

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on November 28, 2018, 03:33:53 PM
Gary

 
I talked to Mat, the pokeys firmware author and he tells me its a normal buffered waypoint move
that I set to a probeing state to make probeing work, Ill take a look at it. The pokeys stops motion
and switches to internal; planner waiting for the trigger point to be read.

  Your script shouldnt have to be in the Gcode library, can be in any. If you run it from
the script window does the script running led flash showing one is running? Ill take a look at the
block triggerin g code to see why it might not answer.

Art
 

   


Title: Re: reading Pokeys pins
Post by: gburk on November 28, 2018, 05:59:08 PM
Not sure which led but when I run it in the script window I get the message  end of mdi script run no led's flashing

also having jog problems now only will jog one direction and only .010 distance can't jog past that.. or the other direction .

also do you have it setup to read the homing pins or will that also need to be done with a script?.. haven't got that far yet so going to ask before I start on the homing..

Thanks gary 


Title: Re: reading Pokeys pins
Post by: ArtF on November 28, 2018, 08:35:22 PM
Gary:

 Homing should work fine. Also, turn off softlimit s, it may be those that are affecting you, until homing is setup, turn off softlimit s in the config.
That will probably fix your jogging.

Art


Title: Re: reading Pokeys pins
Post by: ArtF on November 28, 2018, 08:36:46 PM
Gary:

  Test homing in the pokeys setup program, it should work there, if so it should work in Auggie.  I use
it daily.

Art


Title: Re: reading Pokeys pins
Post by: gburk on November 29, 2018, 08:12:31 AM
homing pins are showing being triggered in pokeys...

I have been looking for a doc file to show how dome of the build in commands are used haven't found one the file in the auggie folder shows the calls but not how to use them
like what they may need to be passed to then or read from them say like  SetStateM ask that's all that's in the doc file but not what to pass to it like maybe the led variable name
and a value to set it just an example, is there a doc file with how values need to be passed and read from the built in functions?

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on November 29, 2018, 08:36:57 AM
Hi Gary:

 Check the AuggiePro grammersG uide.chm file in your folder. It shows erxamples of all the script calls and hwo they are
used in general.

Art


Title: Re: reading Pokeys pins
Post by: ArtF on November 29, 2018, 08:42:57 AM
Gary:

  That help file is only complete through the direct Engine commands, its parameter s are not entered forthe other groupings . IF you see one of interest
that isnt complete, yell and Ill fill it in. Im looking at completei ng that list and removing obsolete groups such as the contour drawing groups and such.
Too much was added into auggie that it didnt need, so much is being removed.

Art


Title: Re: reading Pokeys pins
Post by: ArtF on November 29, 2018, 08:48:20 AM
Gary:

  One final thought, make sure you read the code contained in the default libraries, they are the best example of how
to use the various calls. Most of them are used in one way or another in the examples shown. You get a pretty good
idea how to script from those scripts. You can see some of them instantia te functions and also call them to run at startup
by simply calling the declared function in the library file.

   
Art


Title: Re: reading Pokeys pins
Post by: gburk on November 29, 2018, 01:07:29 PM
Ok did a button to call this script

The Word help prints to the screen but the led doesn't turn on.

I created a led with the var name to XhomeTest

global Main_BUT_ 20 = function( current )
 {
 print("Help");
 led = Led("XhomeTest");
  led.SetSt ateMask(1);
  //sleep(30);
  //led.SetStateMask(0);  //this makes the LED turn off, then on again in 3 seconds.

 return;
 };

So doing something wrong sorry for all the questions once I wrap my head around this stuff I should be good to go..
I didn't see anything like this in the scripts in the script folder...

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on November 30, 2018, 07:37:34 AM
Hi Gary:

    Your problem is the name of the led, your using the led variable name , not the actual led id name.
Start the scripter with the scripter checkbox in config dropdown. Turn on the scripter with its power button.

  At this point you can right click any LED and its identifie r will be shown. In the case of your XhomeTest youll see
a name like LED_USERP ANEL_6 or some such thing. Thats the identifie r needed for getting an LED hook.

 The variable name can be used with variable manipulat ion routines. As you type the right LED identifie r it will
autocorre ct in the window your typing it in.

Art




Title: Re: reading Pokeys pins
Post by: gburk on November 30, 2018, 02:25:07 PM
I guess I'm to old for this but any way I started the script edit and when I right clicked the led I got
Main_LED_ 0:XhomeTest
I got the same type of name on all the led's, but the buttons did look like I was getting the right names back

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on November 30, 2018, 03:40:31 PM
Gary:

   SO to connect to that LED youd use
the name Main_LED_ 0 ,

led = Led("Main_LED_ 0");
led.SetSt ateMask(1);

 the variable name is XHomeTest . Not all items have a variable name.
 I think the statement XHomeTest = 1 shoud turn it on as well without
having to get an LED hook for it. Generally a variable named object can
be refered to in script by its variable name instead of getting a hook and
using that. Ill have to test thats true in the case of LED's, its been awhile
since Ive done screen edits.

Art
 


Title: Re: reading Pokeys pins
Post by: ArtF on November 30, 2018, 03:49:22 PM
Hi Gary:

 I went back and edited to refresh myslf on how it works.

To set or get and LED's value, if it has a variable name, you can use

x = GlobalGet("MotionCon nected");
print("Led = " + x);
GlobalSet("MotionCon nected",1);


 This will show you the motioncon nected LED and set it to on if your in sim, replace
its varaible name with any you use and the globalGet / GlobalSet should work for you
for getting and settign any variable.


Art


Title: Re: reading Pokeys pins
Post by: gburk on November 30, 2018, 08:19:49 PM
Ill try it I was confused as to how it knows which led  is ("Main_LED_ 0"); all the leds on the main screen had the same name except the :XhomeText The Estop led had Main_LED_ 0:Estop

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on November 30, 2018, 11:14:52 PM
Gary:

 While normally all LEDs will have names that are different, when the system see's they have a variable name,
it doesnt try to rename them to different primary names. this has to do with the rather complex system of naming
which is necessary as various modules could share a led name internall y. At startup various id's are checkled in
order and apparentl y it ignores the naming once it see's it has a variable name instead.  (Its been awhile since
Ive been in there..).
  I tested the script I posted, should work OK.. Still dont know why the block didnt work, more testing req

Art


Title: Re: reading Pokeys pins
Post by: gburk on December 01, 2018, 01:04:15 PM
Yes Art That script seems to work my led will flash and also it will turn off..

Thanks gary

PS I'm sure I will be back for more advice



Title: Re: reading Pokeys pins
Post by: gburk on December 01, 2018, 08:57:01 PM
New question go figure..

Is there a way to call a lib script from the button script...

Say I have a button it turns on the led and prints a message now in the same button script I want to call a script in the gcode lib like an mcode script I created Mcode330 or whatever ?

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on December 02, 2018, 10:42:27 AM
You asked me to check the pokeys config program to see if pin 19 is being triggered and it is, still can't seem to get auggie to read a trigger on pin 19..

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on December 04, 2018, 02:05:49 PM
Sorry art another question problem even though I haven't sorted out reading pins but homing problem
I see the homing led lights up if I trigger the home switch but it keeps flashing while its tripped the led doesn't say lit but flashes

But the motor does stop and reverses direction I assume its back off  the problem when the motor reverses it never stops just keeps running
in the opposite direction I have soft limits off.. and switch untrigger ed now..

any suggestio ns how to stop the back off distance?...

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on December 07, 2018, 11:27:55 PM
Gary:

   You need to tell the pokeys to backoff the switch. Its a new setting in the pokeys engine config, if you test home on the
engine config page in Pokeys and it works, it should work the same in Auggie. Should be easier to test in the pokeys
software as it shows you what its doing on each stage.

 Im doing some work in Auggie this week, Ill see what I can find on pin19, I need to hook one up to see..

  Art


Title: Re: reading Pokeys pins
Post by: gburk on December 08, 2018, 01:38:55 PM
Thanks art did get homing working,
mad a little progress can make a new button and led and get buttons to turn on and off the led also can turn on a relay with button press..

Still haven't sorted out how to read a pin if trigged.

I tried to look at any scripts you have installed but couldn't fine one I know you reading pin triggers like turning on the homing led when hit but couldn't find the script you are using to do it looked at the all the scripts I could find...

Also is it normal for the homing led to blink on and off when the switch to not triggered mine seems to do that, but when its triggered it stays lite no flashing. ..
funny because I have been having the same problem with the probe led in mach3..

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on December 08, 2018, 04:01:22 PM
Hi Gary:


  Some functions like home are done by hardwire, there is no script. The pokeys for example reports homing as done or not and triggers
internal calls as its a priority function. The flashing shouldnt occur..do esnt here. Mine is either off or on. Ill take a look to see what may cause that symptom.

  For other inputs the software checks each pin and does an internal signal to Unblock using the words as we described earlier inj this thread. I just need to hook up something to trigger to see why it isnt calling you when the pin is triggered .

  Is it possible you wrote and forgot a script trying to light the home led? It woudl create a flashing as the system tried to reset it back to zero when not homed. Checking the software I cant fing anything to cause it to flash unless you checked an opion in its propertie s to tell it to flash when inactive
or something . (But its complex in there and I may be missing it..).

  When you actually home sucessful ly, a signal is sent to scripts called "HomedAxis". So a block on "HomedAxis" should trip a script when a home occurs,
thought that doesnt tell you anything about which home it was. A call to GlobalGet( "Axis1Home d" ) will tell you if that axis is homed.

  You get a similar call when a pin goes active.. named MotionPin 19 for example, though as I recall it can be off by a pin # as I used to count 0 as first pin.
I thought that changed but you may want to try "MotionPin 18" or "MotionPin 20" just in case soemthing is one off in there. Ill check this as soon
as I can get to hooking up a cable int here to use a pin.

Thx
Art


Title: Re: reading Pokeys pins
Post by: gburk on December 08, 2018, 06:56:29 PM
I noticed if I use m8 or m9 its calling SetMistFl ood()

I changed the code to getrelay and if its on with setrelay the m8 seems to turn it on, but m9 doesn't I know is going though the function to the turn off relay I have it printing showing turning off but doesn't go off... if i call m8 again it shuts off,  i tried my own m8 call function but looks like the SetMistFl ood() overrides it..

also i see variables IOpins setup in system variables But nothing for MotionIO would that matter when you are trying to get the MotionIO pin status

also i will try a different # if you start at 0 then i try 18..

I also didn't write any scrips to turn on or off homing or the leds..

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on December 08, 2018, 09:48:49 PM
forgot I ran the pokey configura tion and the home pin works ok led stays lite or stays off no flashing. .

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on December 08, 2018, 10:15:34 PM
Hi Gary:

>>I noticed if I use m8 or m9 its calling SetMistFl ood()

  Yes certain functions such as spindle, flood and mist are considere d systemic and have their own script, it can be changed but not
replaced. Can you post the script your using for flood and mist, I may see something easier.

>>also i see variables IOpins setup in system variables But nothing for MotionIO would that matter when you are trying to get the MotionIO pin status

In the Motion library there is a global variable declared as Pokeys1 . global Pokeys1 = Motion();
So you shoudl be able to use
 
  PinState = Pokeys1.G etPinDig( 19 );


 
>>I also didn't write any scrips to turn on or off homing or the leds

   I cant understan d why its flashing. It may be the screen set has that LED set to flash in its propertie s. Youd have to open the DROPanel screen from panels to see if its led propertie s are telling it to flash.

Art


Title: Re: reading Pokeys pins
Post by: gburk on December 09, 2018, 11:17:43 AM
//Set mist/flood control
//1 = mist, 2 = flood, 0 = off
global SetMistFl ood = function( relayNumb er )
{
    //Relay # 1-4
    //print("Flood change");
 
OnOrOff = MyMotion. GetRelay(relayNumb er);
  if (OnOrOff == 0)
  {
  MyMotion. SetRelay(relayNumb er,1);
  print("M8 Flood Relay Turned ON");
  GlobalSet("FloodOnLE D",1);
  }
   else
    {
     MyMotion. SetRelay(relayNumb er,0);
     print("M9 Flood Relay Turned OFF");
     GlobalSet("FloodOnLE D",0);
    }
 };

If I call m8 the relay go's on, if I call m9 the relay stays on but it does do the print M9 flood relay turner off, if I call m8 a second time the relay turns off ok..

I will check to see if the led is set to flashing. .

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on December 09, 2018, 11:29:11 AM
Gary:

I believe the function gets a 0,1, or 2 in the parameter s to indicate if this is an M7,m8 or M9. They way the commands for mist,flood work
is SetMistFl ood(0) shoudl turn on whatever relay mist is contollin g, a 1 to turn on the flood relay and a m9 to turn them both off.
Various machines use various logic for this , my script dopesnt actually use mist,flood but Id think its more..

//Set mist/flood control
//1 = mist, 2 = flood, 0 = off
global SetMistFl ood = function( desiredst ate )
{
     
   MistRelay = 1;
   FloodRela y = 2;

 
  if (desiredst ate == 0) //mist
{
    MyMotion. SetRelay(MistRelay,1);
    print("M7 Mist Relay Turned ON");
   GlobalSet("FloodOnLE D",1);
}

 if (desiredst ate == 1) //flood
{
    MyMotion. SetRelay(FloodRela y,1);
    print("M8 Flood Relay Turned ON");
   GlobalSet("FloodOnLE D",1);
}

 if (desiredst ate == 2) //flood,mist off
{
    MyMotion. SetRelay(MistRelay,0);
    MyMotion. SetRelay(FloodRela y,0);
    print("M9 Flood and Mist Relays Turned ON");
    GlobalSet("FloodOnLE D",0);
    GlobalSet("MistOnLED",0);
}
 
};

Art


   


Title: Re: reading Pokeys pins
Post by: gburk on December 09, 2018, 12:35:51 PM
Ok thanks will try it out

Here is a script to read pin19 doesn't work

  global MyMotion = Motion(); //Will not exist unless lib is loaded
 
global  MonitorPi n19 = function()
{
  while(1)
  {
    print("Pin 19 Check");
    block( "MotionPii n19");  //pokeys57 Pin19
   //
   //  when you reach here, its because pin9 has changed..
    pinstate = MyMotion. GetPinDig (19); 
    if( pinstate == 1 )
    {
          print("Pin 19 Changed");
         //do what you need to do. Take not that if you change pin9, youll get called again..
         //so make sure you dont get into a loop where your change makes this gets called which then changes it..etc.. .
    }
  }
 
};
MonitorPi n19();

prints the first print statement but never seems to read the pin when hit so never get the pin 19 changed message..

You were right the led in the homing was set to blink so fixed now...

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on December 09, 2018, 01:02:30 PM
Art

Tried the relays as your post but doesn't work,
m8 I get nothing no relays on and no printed message

m7 I get the printed message but no relays on

M9 I get the printed message but there isn't any relays on so don't know it that will turn them off..

in the script I first sent the relays did go on and off...
Not sure what the major change would have been to effect that..

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on December 09, 2018, 01:54:52 PM
I printer out the (desiredst ate)
and I get 3 when m8 is run
and also when I run m9 it seen to run twice first its = to 2 then it must run a second time and it = to 0;;

make sense?

But the relays still don't turn on makes no sense to me using the same MyMotion. SetRelay(MistRelay,1); command as the script I sent you
and mine turns them on and off... as far as I can tell the only differenc e is in mine its using the m8 as the relay number and looks like to # 3
so its sending #3 as the relay #

in your script its using 1 and 2..

//Set mist/flood control
//1 = mist m7, 3 = flood m8, 2 and 0 = off m9
global SetMistFl ood = function( desiredst ate )
{
   print("M Number = ",desiredstate);
   MistRelay = 1;
   FloodRela y = 2;
 
  if (desiredst ate == 1) //mist
{
    MyMotion. SetRelay(MistRelay,1);
    print("M7 Mist Relay Turned ON");
    GlobalSet("FloodOnLE D",1);
}
   if (desiredst ate == 3) //flood
{
    MyMotion. SetRelay(FloodRela y,1);
    print("M8 Flood Relay Turned ON");
    GlobalSet("FloodOnLE D",1);
}
   if (desiredst ate == 2) //flood,mist off
{
    MyMotion. SetRelay(MistRelay,0);
    MyMotion. SetRelay(FloodRela y,0);
    print("M9 Flood and Mist Relays Turned OFF");
    GlobalSet("FloodOnLE D",0);
    //GlobalSet("MistOnLED",0);
}
};


Title: Re: reading Pokeys pins
Post by: ArtF on December 09, 2018, 02:48:54 PM
Hi Gary:

 I think we may be using differern t versions, I just refreshed the download to be sure so please reinstall auggie. If you changed
and screens but didnt rename them, do that first as it will overwrite changes you made to my screens.

   Hers is the script I just tested as working, But read on after..

global SetMistFl ood = function( state )
{
    //1 = CW, 2 = CCW, 0 = off
     
   
    if( state == 0)
      {
          Pokeys1.S etRelay(1,0);
          Pokeys1.S etRelay(2,0);
      }
     if( state == 1)
      {
          Pokeys1.S etRelay( 1,1 );
      }
      if( state == 2)
      {
          Pokeys1.S etRelay( 2,1 );
      }
 
print( "flood/mist state: " + state );
   
};

  The relays in a pokeys arent in bit order, so auggie sees them as different numbers.

auggies Relay 1 is Pokeys OC2
            Relay 2 is Pokeys OC1
            Relay 3 is Pokeys hard relay 1
            Relay 4 is Pokeys hard relay 2


   Now this script assumes a relay for mist, one for flood and turns them both off on m9. This is conventio nal with
some cnc systems where one relay turns on the mist pump, and the second speeds it up. M9 then turns off both relays.
I jst tested this and it seems to work fine.

Art


Title: Re: reading Pokeys pins
Post by: gburk on December 09, 2018, 06:53:33 PM
That works now had a different version of auggie

do you think reading the pins may work now also, haven't tried that yet with this version..

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on December 09, 2018, 07:24:30 PM
nope pin state never seems to change
when first run it prints pin 19 check
but never seems to change the pinstate

global  MonitorPi n19 = function()
{
  while(1)
  {
    print("Pin 19 Check");
    block( "MotionPin 19");  //or you cold use IOPin9
   //
   //  when you reach here, its because pin9 has changed..
    pinstate = Pokeys1.G etPinDig(19); 
    if( pinstate == 1 )
    {
          print("Pin 19 Changed");
         //do what you need to do. Take not that if you change pin9, youll get called again..
         //so make sure you dont get into a loop where your change makes this gets called which then changes it..etc.. .
    }
  }
};
MonitorPi n19();

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on December 09, 2018, 07:59:57 PM
sorry for all the messages
It almost seems like once auggie is booted it checks the pin 19 script then and not again...

this is what I have found I boot auggie pin 19 not shorted I get the message pin 19 change then pin 19 checked
if I boot auggie with pin 19 shorted I only get the message pin 19 checked

after the initial booting of auggie and received the message at boot
that's the end doesn't see a short or no short almost seems like its not running after auggies first boot

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on December 09, 2018, 10:21:01 PM
Hmm..

Does sound like a script that is stopping. The script you have shoudl be

global  MonitorPi n19 = function()
{
  while(1)
  {
    print("Pin 19 Check");
    block( "MotionPin 19");  //or you cold use IOPin9
   //
   //  when you reach here, its because pin9 has changed..
    pinstate = Pokeys1.G etPinDig(19); 
    print("Pin 19 Changed");
    //do what you need to do. Take not that if you change pin9, youll get called again..
    //so make sure you dont get into a loop where your change makes this gets called which then changes it..etc.. .
   }

};

   Probably wont make a differenc e, but the == 1 is nbot needed to check for a change. So long as the block is signaled, you should
get a message. Ive been fighting some hardware issues, but Ill see if tomorrow I can find out why it may only run the once..

Art


Title: Re: reading Pokeys pins
Post by: gburk on December 10, 2018, 09:09:22 AM
I tested without the if pinstate == 1 and I think it may be needed

when I booted auggie I got both printed messages pin 19 changed first then pin 19 check
it didn't matter if the pin was shorted or open same order of messages. ..

So I think it may be need if I remember correct when I had the pinstate == 1 check it would switch the order of the printed message depending if the pin was shorted or open

Gary   


Title: Re: reading Pokeys pins
Post by: ArtF on December 10, 2018, 10:59:42 AM
Hi Gary:

  I added thius to my motionio library..

global  MonitorPi n19 = function()
{
  while(1)
  {
    print("Pin 19 Check");
    block( "MotionPin 19");  //or you cold use IOPin9
   //
   //  when you reach here, its because pin9 has changed..
    pinstate = Pokeys1.G etPinDig(19); 
    print("Pin 19 Changed to state " + pinstate);
   
  }
};

  And though I cant yet hook up a pin19 to my system, I did config the pokeys so that pin19 is a digitial output.
I then changed the code in auggie so that as it reads the incoming pin states, it toggles pin19 to 0 as long
as the ctrl key is held, this allowed me to test the script. Its responds properly and shows the message that
the pin has toggled and its state.

  Take note though, that youd miss fast presses, this is a slow way to read an input, fine for switches and knobs
but youd never be able to probe with it, probing is a hardwired fucntion due to its complexit y and timing
requirmen ts. Ive checked on adding it, but it looks complex enough that I dont think its feasable for the
small amount of people that use auggie or would use it for probing.

Art


Title: Re: reading Pokeys pins
Post by: gburk on December 10, 2018, 06:02:27 PM
I understan d thanks for giving it a shot let me know if anything changed

Gary


Title: Re: reading Pokeys pins
Post by: gburk on February 23, 2019, 05:08:13 PM
I see you decided to give probing a try in the new release great...

Have a request to be added if possible as you progress with probing.

I have requested pokeys developer s to add some probing return codes for mach4's register's and they have done so not working correct yet but close..

Code that if probe is hit send a say 1 that can be read from a script or to the probe status register or -1 if no probe hit my reason for this is if probing for the center of a block
and you enter a distance that is to small, what I do is use a g31 not a g1 to move the probe down so if the probe returns a -1 I know probe wasn't hit
and then will do the move towards the part, but if I get a value of 1 I know the probe was hit going down and I am not off the block edge and I will send a message
stock size to small enter a lager size retract to start z Hight and back to we probe move x and y started.

I find doing this the probe doesn't crash into the part on the z down move..

make sense?

thanks art
gary     


Title: Re: reading Pokeys pins
Post by: ArtF on February 23, 2019, 05:27:04 PM
Gary:

  That will be in the next release. After a G31 motion, you will be able to do something
like this..

Engine.GC ode("G31Z-20");
h = GlobalGet("Probehit");
if( h )
{
  px = GlobalGet("ProbeX"); //etc for each axis you wish to use..
}

   The probe hit variable will tell you if the probe actually hit.
It should be possible to easily script a button to do something like
find the center of a hole. I haven't done much testing with scripts
doing repetitiv e calls as yet, so be cautious about the use of G31,
it should now be safe for zeroing. I already get back a 1 or -1 for
hit or miss I just haven't passed them back to the user yet.

Art

 


Title: Re: reading Pokeys pins
Post by: gburk on February 26, 2019, 03:56:26 PM
have you come up with a solution to read the pokeys pin 19?

I tried the code we were working on but still no go to read a probe hit..

thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on February 26, 2019, 08:40:25 PM
Gary:

 Im not sure why pin 19 wont trigger as yet for you.

Have you set the probe as pin 19 in the config/planner area?
What then happens if you enter G31Z-10 when Z is zero?
Does it move?

 Lets start there to see whats up..

Art


Title: Re: reading Pokeys pins
Post by: gburk on February 27, 2019, 08:32:12 PM
G31Z-10 works started at 0 and went to -10

but not sure on setting pin19

I looked in the auggie configura tion but did not see where to set the pins

checked with the pokeys config program and pin 19 is set and does trigger when viewing with their pin monitor

I do have homing working ok with optic sensors and motors moving good

thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on February 28, 2019, 08:09:44 AM
Gary:

  In the config, the one where you set your steps/unit and such. select the
planner page. On that page is a setting for the probe pin selection . There is also
one to select if its a normally closed or open called "Probe Invert".
 
  Set that to pin 19 and see if a G31 responds different ly. Try it with probe inverted true and false
the G31 should move in one setting, and not the other. If it seems to probe or not probe
properly, let me know what happens..

Art


Title: Re: reading Pokeys pins
Post by: gburk on February 28, 2019, 02:16:23 PM
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   


Title: Re: reading Pokeys pins
Post by: ArtF on February 28, 2019, 02:48:15 PM
Hi Gary:

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

Art


Title: Re: reading Pokeys pins
Post by: ArtF on February 28, 2019, 05:34:44 PM
Hi Gary:

  Turned out to be a lib out of date and a setting internall y.
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 appreciat e it.

Thx
Art


Title: Re: reading Pokeys pins
Post by: ArtF on February 28, 2019, 05:35:45 PM
Gary:

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

Art


Title: Re: reading Pokeys pins
Post by: gburk on February 28, 2019, 07:45:23 PM
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


Title: Re: reading Pokeys pins
Post by: ArtF on February 28, 2019, 08:39:48 PM
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 appropria te fixes..

Art




Title: Re: reading Pokeys pins
Post by: ArtF on February 28, 2019, 09:01:11 PM
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, unintende d consequen ces..)
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


Title: Re: reading Pokeys pins
Post by: gburk on March 01, 2019, 02:46:14 PM
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 


Title: Re: reading Pokeys pins
Post by: gburk on March 01, 2019, 03:00:14 PM
Art

 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

gary


Title: Re: reading Pokeys pins
Post by: gburk on March 01, 2019, 04:18:51 PM
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 


Title: Re: reading Pokeys pins
Post by: ArtF on March 01, 2019, 05:10:01 PM
Gary:

   Earlier ( 2 tests back ) you experienc ed 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 informati on 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 interesti ng test data you may have. Id be intereste d 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


 




Title: Re: reading Pokeys pins
Post by: ArtF on March 01, 2019, 07:53:50 PM
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


Title: Re: reading Pokeys pins
Post by: gburk on March 02, 2019, 12:58:14 PM
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.0000 00 , MAX ACC = 19.999001, MAX VEL = 1000.0000 0, 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 programin g over the years you may have a way...

thanks gary

 


Title: Re: reading Pokeys pins
Post by: gburk on March 02, 2019, 02:34:50 PM
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 


Title: Re: reading Pokeys pins
Post by: ArtF on March 02, 2019, 09:46:16 PM
Hi Gary:

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

Block("MotionPin 19");

  that stops the script altogethe r 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 decelerat ing.

  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 touchplat e.
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 ZeroToPla te()
{
   GlobalSet("ProbeInve rt",0); //set probe to normal state
   Engine.GC ode("G31Z-25F100"); //probe 25mm down in Z
   Block("MotionSti ll"); //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("ProbeInve rt",1); //invert probe switch
   Engine.GC ode("G31Z0F10"); //probe upwards slowly till switch releases
   Block("MotionSti ll"); //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




 


Title: Re: reading Pokeys pins
Post by: ArtF on March 02, 2019, 09:47:32 PM
BTW:

  Do not use G43 at this time, I just fixed a problem with zeroing
when toollengt hoffset is in effect and it affects the zeroing.. Next update
should fix that issue.

Art


Title: Re: reading Pokeys pins
Post by: gburk on March 03, 2019, 08:36:17 AM
Art

For some reason I'm having a problem creating panels, I tried to make a panel with 3 buttons and 3 labels
when in panel mode and scripting, then when I go to edit a script it shows no buttons only the labels all as main label 0
if I put a script into the label its there every time I load the panel thought panel create mode but no buttons and 1 did give the buttons a number 1 to 3

if I go back to the main screen I have the panel placed on the screen ok now I script edit from the main screen still shows all labels under that panel
but  it didn't carrier over the scripts  from the panel edit screen create mode.. and of course the buttons don't work, I guess because its only picking up the labels no buttons

I have created panels with  buttons from older versions of auggie with no problems
let me know if I'm doing something wrong … or something has changed

thanks gary 


Title: Re: reading Pokeys pins
Post by: gburk on March 03, 2019, 11:26:25 AM
here is the script that works

global  FloodOffO n = 0;
global  MonitorPi n19 = function()
{
  //Pokeys1.SetPinDig( 19 , 0 ); // turn off pin 19, ( assumed to be digital output)
 
  while(1)
  {
    print("Pin 19 Check");
    block( "MotionPin 19");  //or you cold use IOPin9
 
   //
   //  when you reach here, its because pin9 has changed..
    pinstate = Pokeys1.G etPinDig(19); 
    print("Pin 19 Changed");
    yield();
         //do what you need to do. Take not that if you change pin9, youll get called again..
         //so make sure you dont get into a loop where your change makes this gets called which then changes it..etc.. .
  }
};
MonitorPi n19();

should I replace yield with a block?

also trying to wrap my head around global vars
I set global  FloodOffO n = 0;

if I use FloodOffO n in button script and change its value to 3, when I call the button script a second time the value is back to 0 
so I assume setting it as a global then its not changeabl e ? 

also is it possible to read the encoder pins I think pin13 as a one rev index rpm?

thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on March 03, 2019, 02:11:16 PM
Art

put this in lib
 global ZeroToPla te = function(a,d,f)
{
   print("a = ",a);
   print("d = ",d);
   print("f = ",f);
   GlobalSet("ProbeInve rt",0); //set probe to normal state
   Engine.GC ode("G31Z-25F100"); //probe 25mm down in Z
   Block("MotionSti ll"); //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("ProbeInve rt",1); //invert probe switch
   Engine.GC ode("G31Z0F10"); //probe upwards slowly till switch releases
   Block("MotionSti ll"); //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" );
};
}; 

called from button

ZeroToPla te (1,2,3);


its strange I was in simulator mode pressed the button
and the z moved to -25

can't get it to work a second time in simulator or with pokeys
it does print 1 2 3 but no axis movement
so I know its calling the function just strange it worked once

do you suggest a better way to call the function?

thanks gary




Title: Re: reading Pokeys pins
Post by: ArtF on March 03, 2019, 04:18:19 PM
Hi Gary:

   Im sim mode the G31 will not function. ITs because half of the probe work is done in
the Pokeys itself. The simulator probably didnt understan d the PROBE type trajector y
and simply passed it on as a feed move. Trouble is, the pokeys needs to shut off the
probeing mode. Sim mode wont do G31's as a result..

>should I replace yield with a block?

  In your example, you can remove the yield(). the next line encounter ed is
to print "ProbeChec k" and then it blocks anyway. So replacing yield with block
would break it as it would need two probehits ..one for each block.

 A yield simply passes control back to the program so it can process other
threads and then immediate ly returns. So yields are good practise if doing
a long calculati on as you can pass control back every once in a while to
allow auggie to work, but in the case of a block, the program stops entirely
until the event occurs.

 >>if I use FloodOffO n in button script and change its value to 3, when I call the button script a second time the value is back to 0 
so I assume setting it as a global then its not changeabl e ? 

  Ill have to check this.  Ill get back to you.

 I think you can get encoder count... but not the index pin itself, typically they
pass so fast youd never see it. Ill check what the call is for the count.

Art




Title: Re: reading Pokeys pins
Post by: ArtF on March 03, 2019, 04:33:03 PM
Gary:

>>For some reason I'm having a problem creating panels, I tried to make a panel with 3 buttons and 3 labels when in panel mode and scripting, then when I go to edit a script it shows no buttons only the labels all as main label 0 if I put a script into the label its there every time I load the panel thought panel create mode but no buttons and 1 did give the buttons a number 1 to 3
 
  This one gets confusing . Originall y I was adding scripts to the panels and sub screens that were hard
coded by the panel designed into the panel itself. That script could then be overridde n if one
wished by editing it in the screen containin g the panel. This virtual override was thought to be
safer but I found it too confusing . So when you design a panel, just name the various interface s
by a variable name and dont do any scripting . When the panel loads the label names and such
will be decorated to stop duplicati ons, but the variable names will be fine.

  So, if for example you have a DRO on a Zeroing panel, just give it a variable name of
m_MyZeroX DRO for example. Then once the panel is saved and is part of a screen, add your
scripts to any library file (or make a new library file for that panel.). Adding a
function like

global function m_MyZeroX DRO( value )
{
}

  Should then make that function get called when the dro is typed into. You can
send to it as well with GlobalSet("m_MyZeroX DRO",value) or get from it with
GlobalGet ..

   Its the best way to attach scripts to objects, I highly advise not hard scripting in the
panel designer, its very messy unless your me and know all the strange interacti on
with the virtual override system.

  On your question about  FloodOn, did you mean you created a global variable named
FloodOn or were you trying to access an internal var of that name. (There is no var
of that name internall y.). There is a script to set flood mist in the Gcode library
which you can call from a script of your own as well. I didnt add any way I dont
think to check the current state. The GCode library hardcodes what relays to use
with flood and mist. So I guess you could check the relay state in a script to
see if its on or off.

Art




Title: Re: reading Pokeys pins
Post by: gburk on March 03, 2019, 05:42:10 PM
Art

yes I created a global var FloodOnOf f
I have a button to turn on flood relay  and a led I was trying to set global FloodOnOf f = 0
then if I hit the flood button FloodOnOf f  would = 0 and relay would turn on and change FloodOnOf f = 1 and when button again relay would shutoff and  FloodOnOf f set back to 0 but when I set FloodOnOf f to 1 it always reverts back to 0 so of course the second button press won't shut off the relay
I worked around this by using getrelay instead.

is there a way for engine.gc ode('G31',axis,'-25F100') to except a value like axis ='Z'
so I will call the probe function like probing("Z',10,100)
then probing function start like probing(axis,distance,feedrate)}{
also doesn't seem to be a way to set the var axis to a char on the receiving function it  receives 'Z' as an int..

as far as the probing routine it will not run as long as pokeys is connect
the g31 may not work in  simulatio n but I can get the dro running to -25 in simulator

but I have to have the script loaded in local edit then run the script hit stop once or twice
then hit my button script and then the z dro runs to -25

but just can't get to work with pokeys connected

thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on March 03, 2019, 09:00:43 PM
Hi Gary:

>>yes I created a global var FloodOnOf f ....

    As I recall there's some strange syntax possible here, Id have to see the code for it.
You wouldn't use GlobalSet or GlobalGet for actual script globals, only for Auggie internals .
For a script global you'd declare it in a global scope.. like before the function declarati on..

ex:
(In a loading library like Gcode or System)

 global FloodOn = 0; //declare script global in global scope outside of function.

 global function FloodOnOf f( state )
{
    if(...)
      FloodOn = 1; //should be able to simply use the global name here.. no GlobalSet or get required.
}

>>is there a way for engine.gc ode('G31',axis,'-25F100') to except a value like axis ='Z'
>> so I will call the probe function like probing("Z",10,100)
 
  All variables are automatic . so for example..

global function Probing( axis, dist, feedrate )
{
   string = "G31" + axis + " " + dist + "F" + feedrate;
   print( string ); //as a test
   Engine.GC ode( string );
}

to use:
  Probing( "Z" , -10, 100 );

  Again, top of head so excuse me if Im off a bit on syntax.


>>as far as the probing routine it will not run as long as pokeys is connect
>>the g31 may not work in  simulatio n but I can get the dro running to -25 in simulator

  I verified that simulatio n will not run G31, effects are unknown  so it may explain lockup
or strange effects.

>>but I have to have the script loaded in local edit then run the script hit stop once or twice
>>then hit my button script and then the z dro runs to -25
>>but just can't get to work with pokeys connected

   Make sure your script and globals are in a library checked to be loaded. Libraries are
reinitial ized each reset of system to ensure all globals are current and all scripts are
registere d. If it doesnt recognize a script, lets find why. If the script is recognize d,
but the probe just doesnt move, it may be the probe is already being seen as hit.
The ProbeInve rt and GlobalSet("ProbeInve rt", n ); will have an effect. Make sure
that a G31 entered in single line MDI works, if no motion occures, change the setting
of ProbeInve rt in the settings. If the probe moves, then the probeinve rt is set correectl y.

  Ignore the results of sim test, it doesnt show anything usefull.

  Just to be clear, the script commands GlobalSet and GlobalGet are used only
with Auggie internals, theres about a hundred of them that may be used. All
others are simply used as script names for direct reference .

Art



Title: Re: reading Pokeys pins
Post by: gburk on March 03, 2019, 09:38:14 PM
Art

I wasn't using globelset  or get for the flood, but don't need it anyway using getrelay and that works fine...

I tested the probe script again with pokeys on engine.gc ode doesn't seen to work with g31 I get no motor movement
I changed the engine.gc ode form g31 to g0 and motors ran fine so I'll leave this one up to figure out I'm kind of lost now..

but the g31 and probe hit do work from single line mdi.

thanks gary     


Title: Re: reading Pokeys pins
Post by: ArtF on March 04, 2019, 07:04:37 AM
Hi Gary:

 >>I wasn't using globelset  or get for the flood, but don't need it anyway using getrelay and that works fine...

   Ahh, ok. Sorry if I explain too much at times or much such assumptio ns, Ive been doing support
now for decades and Ive found too much is better than too little.

 >>I changed the engine.gc ode form g31 to g0 and motors ran fine so I'll leave this one up to figure out I'm kind of lost now..but the g31 and probe hit do work from single line mdi.

  Could be me, Ive been testing from mainly the single line MDI myself. Though I did also
test the Engine.GC ode.. I will check to see why the script may have broken..

Art



Title: Re: reading Pokeys pins
Post by: ArtF on March 04, 2019, 07:27:49 AM
Gary:

 Just tried this in the script window. Can you try it and tell me what it does?

Engine.GC ode("G31Z-25F500");
axis = "Z";
string = "G31"+axis+"0" + "F" + 100;
print(string);
Engine.GC ode(string);

  On the toolpath screen you should see the line printed
as "G31Z0F100" as well..

Art


Title: Re: reading Pokeys pins
Post by: gburk on March 04, 2019, 10:41:34 AM
Art

Tried it in the script window G31 Doesn't move the dro's or motor the same results as running though the lib script
I changed to G0 and the motor ramped up to -25 and then ramped to 0 and I did get the printout on the display screen
with both g0 and g31..

gary


Title: Re: reading Pokeys pins
Post by: ArtF on March 04, 2019, 11:19:36 AM
Thats what Id expect if the ProbeInve rt was set wrong. But then it wouldn't
work in GCode single line mdi if that were true.

  The script I listed was one I tested on my machine.. so it must be a setting somewhere ..
Ill give it some thought and look in the code to see why it may not go.

Art


Title: Re: reading Pokeys pins
Post by: gburk on March 04, 2019, 12:56:17 PM
I have the probe active high low problem with mach3 and 4, mach4 needs it set high mach3 needs it low not sure what auggie has it set at but when its triggered my script to read pin19 is triggered ..

I removed the print statement s for the pin19 script and replaced it with an led on screen seems to work ok...

gary

 


Title: Re: reading Pokeys pins
Post by: ArtF on March 04, 2019, 04:32:52 PM
Gary:

   Auggie assumes Active High, but if in the config/planner you set
ProbeInve rt, Auggie will then assume active low.
  The trigger of a script will happen no matter if it toggles from
a 1 to a 0, or a 0 to a 1. Either will trigger a script.

  So if a g31 is sensed, and the probe is sensed as already hit,
no motion will occur. It will just trip right at start.

  So I need to confirm..

 A GCode single line MDI of G31 works?
 A script call to G31 doesn't?

  Are both true?

Thx
Art


Title: Re: reading Pokeys pins
Post by: gburk on March 04, 2019, 04:54:20 PM
Yes both are true.

I will change the setting in the planner and see if that has any effect..

Have a question I thought you were not going to add the probing. What changed your mind? I'm not complaini ng I'm enjoying testing it, maybe more fun for me than you

but thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on March 04, 2019, 05:17:16 PM
Art

Its a good thing I went back to the planer everythin g was changed no probe set... so its a different story now... I retested it in the script and worked g31 and stopped with probe hit...

it does also work in the lib script but not correct I have to do edit on the lib script and while its loaded in the scripter I run the lib script it doesn't do anything but if I hit my probe button that is calling the same script it will do the g31 so it does seem to be working now my fault I didn't realize the planner got reset somehow..

so guess just have to figure why I can run the script just from a button press, and have to run it in the scripter first...

I guess for some reason when screen editing or adding panels may reset the planner only thing I can think of after you fixed it not to reset to metric and that was working I didn't think to check it again my bad...

gary   


Title: Re: reading Pokeys pins
Post by: gburk on March 04, 2019, 05:30:30 PM
Art

Tested some more  I don't think its reading the probe hit correct  if( !GlobalGet("ProbeHit")) it always thinks this is true and the next line prints out no probe hit
so the script never makes it past here, tried both true and false on the probe invert..

I am seeing a message now I assume you are displayin g saying probe hit or something like that don't rem for sure but its not in the script.

gary


Title: Re: reading Pokeys pins
Post by: gburk on March 04, 2019, 06:40:22 PM
here is a copy of what I have in the lib

 global mytable = table( "X", "Y", "Z","A" );

 global ZeroToPla te = function(axis,dir,feedrate)
{
   if ( axis < 1 || axis > 3 )
    {
      print("Error: Axis can only be 1 X, 2 Y, 3 Z");
      return;
    }
   print(mytable[axis]);
   axis = mytable[axis-1]; //X = 1 Y = 2 Z = 3 A = 4
   print("a = ",axis);
   print("d = ",dir);
   print("f = ",feedrate);
   GlobalSet("ProbeInve rt",0); //set probe to normal state
   string = "G31"+axis+"-25" + "F" + 100;
   print(string);
   Engine.GC ode(string); //probe 25mm down in Z
   block("MotionSti ll"); //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("ProbeInve rt",1); //invert probe switch
   Engine.GC ode("G31Z0F10"); //probe upwards slowly till switch releases
   block("MotionSti ll"); //wait for all motion to stop, no system delay for this.
   xcor = GetAxisPo s( 1 );
   print("xcor = ",xcor);
   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" );
};
};

this is the button

global Probepane l_BUT_2 = function( current )
{
print("Probing");
ZeroToPla te(1,2,3);
return;
};

still have to run the script in the scripter then hit the button for the g31 to work

gary


Title: Re: reading Pokeys pins
Post by: ArtF on March 04, 2019, 09:02:44 PM
Hi Gary:

   The setting may have changed because of my fixes. Wrong values were being set and
the fix fixed it, but couldn't fix any corrupted settings.

Ill post your script below and comment on it..

global mytable = table( "X", "Y", "Z","A" );

global ZeroToPla te = function(axis,dir,feedrate)
{
   if ( axis < 1 || axis > 3 )
    {
      print("Error: Axis can only be 1 X, 2 Y, 3 Z");
      return;
    }
   print(mytable[axis]);
   axis = mytable[axis-1]; //X = 1 Y = 2 Z = 3 A = 4

>>Care advised here, axis is originall y typed as an integer and
>> the above line changes it to a string character . May work, but
>>not safest thing to do.Try not to override a variable type once declared.

   print("a = ",axis);
   print("d = ",dir);
   print("f = ",feedrate);
   GlobalSet("ProbeInve rt",0); //set probe to normal state
   string = "G31"+axis+"-25" + "F" + 100;
   print(string);
   Engine.GC ode(string); //probe 25mm down in Z
   block("MotionSti ll"); //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("ProbeInve rt",1); //invert probe switch
   Engine.GC ode("G31Z0F10"); //probe upwards slowly till switch releases
   block("MotionSti ll"); //wait for all motion to stop, no system delay for this.
   xcor = GetAxisPo s( 1 );
   print("xcor = ",xcor);
   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" );
};
};

this is the button

global Probepane l_BUT_2 = function( current )
{
print("Probing");
ZeroToPla te(1,2,3);
return;
};

>>All looks good really.  Is the ProbePane l_BUT_2 the variable name of that button
or the auto created name of the button?
Are these scripts in the Gcode library or library stored in the screen button LIB section
or is it written in the large script editor reached through the config ribbon panel?
 
Art.



Title: Re: reading Pokeys pins
Post by: gburk on March 04, 2019, 10:07:14 PM
 I was pretty sure axis had to be a char so I setup the table so I could use a axis letter related to the motor number, and I could not figure a way to pass a char from the button to the function I tried passing "X" but the function was receiving it as a ascii number and not the char..

I'm not sure if the  ProbeHit is getting the right value
I tried this script in in the scripter an changed  ProbeInve rt from 0 to 1 but X = 0 no matter what, don't even know if it is workable like this,  but worth a try did with probe open and closed...
 
  GlobalSet("ProbeInve rt",0);
   x = GlobalGet("ProbeHit");
   print("probe hit = ",x);

the probepane l_BUT is the auto created name

I didn't want to mess with you scripts in the gcode lib so I made my own lib tree and have them there.

the script itself is stored in with my library scripts  in LIB


never used the scripter from ribbon panel but will check it out..

the only thing stored in the button script is the call to probe function

gary


Title: Re: reading Pokeys pins
Post by: ArtF on March 05, 2019, 07:35:25 AM
 Gary:

   >> I was pretty sure axis had to be a char so I setup the table so I could use a axis letter related to the motor number, and I could not figure a way to pass a char from the button to the function I tried passing "X" but the function was receiving it as a ascii number and not the char..

   There is a .ToChar() function, but it doesnt matter, the way you have it seems to work fine in that regard.

>> GlobalSet("ProbeInve rt",0);
   x = GlobalGet("ProbeHit");
   print("probe hit = ",x);


   Probehit doesnt work that way. It isnt the state of the probe, just a boolean
of if the probe was hit on the last g31 move. When a g31 is commanded the
probehit is set to 0. If the probe is hit during a G31 move, it gets set to true
and stays that way until the next G31 is commanded . SO probehit can only
be queried after a probe and its a message to tell you if the probe actually hit,
this is safer than just reading the probe as it is possible in some circumsta nces
for a probe to hit, and then release during decelerat ion. This allows you to KNOW
that it hit at some point during that move.

  GlobalGet("MotionPin 19") should tell you the current state.

x = 0;
while(x < 60)
{
    print( GlobalGet("MotionPin 19"));
    sleep(500);
    x = x + 1;  // x++ is not allowed in script--note
}
   try something like above in your script window and see if it prints 1 or 0
when the probe is pressed or released. If the rest condition is 0 and the hit
condition is 1, then probeinve rt is set right for "stop on hit", if hit condition
is 0, then probeinve rt is set for "stop on release of probe".

 Note:  The print mechanism will not print the same message more than once.
If it sees the print is for a line that matches the last print statement, it will ignore
it as a safety to ensure a scripted print loop is not occuring. . Early on it was easy
to lock yourself up with looping on a print statement, this should no longer occur
but has this side effect. Its worth noting. :)

Art





Title: Re: reading Pokeys pins
Post by: gburk on March 05, 2019, 09:16:47 AM
I already have a script running that checks the state of motionpin 19 I am using it to trigger an led on off when pin19 is triggered . works fine

I was just trying to see if    x = GlobalGet("ProbeHit"); was working it doesn't seen to change state I always get no probe hit in the probe script so if the probe was hit the script still ends there and will not finish the rest of script or should I not use "ProbeHit" and use a check on motionpin 19 in the scripts

have you figured out why I need to run the script in the scripter before I can get it to run with the button press..
it doesn't seem to do anything run from the scripter I just get message mdi run mdi end then I can do the button press and all the print statement s show and the motor moves..

thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on March 05, 2019, 10:54:58 AM
I chanced it to check pin19
it seems to work if I hit the probe it continues to the line probe hit if I let run to end of travel distance prints no probe hit.
it prints the line probe hit but doesn't do anything after it seems to ignore the next engine.gc ode with or without the pause line.. 

global ZeroToPla te = function(axis,dir,feedrate)
{
   if ( axis < 1 || axis > 3 )
    {
      print("Error: Axis can only be 1 X, 2 Y, 3 Z");
      return;
    }
   print("a = ",axis);
   print(mytable[axis]);
   axis = mytable[axis-1]; //X = 0 Y = 1 Z = 2 A = 3
   print("a = ",axis);
   print("d = ",dir);
   print("f = ",feedrate);
   GlobalSet("ProbeInve rt",0); //set probe to normal state
   string = "G31"+axis+"-25" + "F" + 100;
   print(string);
   Engine.GC ode(string); //probe 25mm down in Z
   block("MotionSti ll"); //wait for all motion to stop, no system delay for this.
   pinstate = Pokeys1.G etPinDig(19);
   if( pinstate )
  //if( !GlobalGet("ProbeHit"))
    {
      print("No hit on probe ..Try again closer to plate.");
      return;
    } //we didnt hit the probe during the move
    print("hit on probe");
    sleep(500);
   GlobalSet("ProbeInve rt",1); //invert probe switch
   Engine.GC ode("G0X3F100"); //probe upwards slowly till switch releases
   block("MotionSti ll"); //wait for all motion to stop, no system delay for this.
   xcor = GetAxisPo s( 1 );
   print("xcor = ",xcor);
   if( GlobalGet("ProbeHit"))
   {
      print("Zero Axis, probe complete.");
      GlobalSet("Zero1",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" );
};
};

gary


Title: Re: reading Pokeys pins
Post by: ArtF on March 05, 2019, 11:24:48 AM
Hi Gary:

 >> sleep(500); this is sleep for 500 seconds. Its probable that you didnt wait the 8 minutes to
see if the rest of the script runs..

Im not sure why you have to call it in the scripter before the button will work. I typically
use a variable name in a button. Id try setting the button to a variable name and
rename the script Probepane l_BUT_2 to that variable name. Its possible theres some bug
in the label to script functiona lity, but I know the variable to script works as most of mine
tend to use it.

Art


Title: Re: reading Pokeys pins
Post by: gburk on March 05, 2019, 01:17:38 PM
Art

I may be lost here a bit..

If I am I panel edit and set the button id 2 and var name to Zprobe

now I go to script edit the button name is removed there's no button name.. without the var name the button is main_pane l.BUT2 in the panel script
I save the panel and run auggie again

hit the probe button and the script is gone, so I go to script edit in main auggie there is no button name there either.
so here is where I'm lost if the button name is gone how would I call the buttons with its var name  when button is pressed if there is no button name in the script editor for that panel button now .

don't know if this makes sense, bottom line is if var name set then no button name anymore.
and when I had a button name I couldn't see how to change the button name. endless I can go into the script folder and edit it manual ? as long as that wouldn't mess something else up

thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on March 05, 2019, 02:10:11 PM
After messing around some more Not sure if this is how you wanted me to set it up but

I created a global function with the buttons var name and that works when I press the button now.
and I added the call to  ZeroToPla te(1,3,100); from the global button press

but still won't run endless I run it in the scripter first...
and also still won't run the second engine.gc ode() or any thing after that line...

gary


Title: Re: reading Pokeys pins
Post by: gburk on March 05, 2019, 04:33:22 PM
art yet another message hope you like reading  :D

I got the script to run some of the problem was I copy this  xcor = GetAxisPo s( 1 ); from the doc file and just realized it needed the enging  xcor = Engine.Ge tAxisPos( 1 );

now the script will run to the end...

still some strange behaver I still need to run the script first though the script RUN to work,

if I press button and let run to the full distance entered for the axis I would have to do the script RUN first before every button press and I find if I have X-25  it stops at different distances usably at -28 after the first run.. I find the same when reversing if 1 have X3 It will run to X3 the first time but run again seem to stop at X0 this is all without hitting the probe....

if I run the script though script RUN then do a button press X-25 Axis starts running then I hit probe it stops ok pauses and then starts to reverse I hit the probe it stops and ZEROS the X axis.
the strange part is as long as I hit the probe while axis is running, I only have to run the script thought the script RUN Once as long as I keep hitting the probe while running I can just use the button.

here is the latest script   

 global mytable = table( "X", "Y", "Z","A" );
 global ZeroToPla te = function(axis,dir,feedrate)
{
   if ( axis < 1 || axis > 3 )
    {
      print("Error: Axis can only be 1 X, 2 Y, 3 Z");
      return;
    }
   print("a = ",axis);
   print(mytable[axis]);
   axis = mytable[axis-1]; //X = 0 Y = 1 Z = 2 A = 3
   print("a = ",axis);
   print("d = ",dir);
   print("f = ",feedrate);
   GlobalSet("ProbeInve rt",0); //set probe to normal state
   string = "G31"+axis+"-25" + "F" + 100;
   print(string);
   Engine.GC ode(string); //probe 25mm down in Z
   block("MotionSti ll"); //wait for all motion to stop, no system delay for this.
   pinstate = Pokeys1.G etPinDig(19);
   if( pinstate )
  //if( !GlobalGet("ProbeHit"))
    {
      print("No hit on probe ..Try again closer to plate.");
      return;
    } //we didnt hit the probe during the move
    print("hit on probe");
    sleep(0.5);
   GlobalSet("ProbeInve rt",1); //invert probe switch
   string = "G31"+axis+"3" + "F" + 100;
   print(string);
   Engine.GC ode(string); //probe upwards slowly till switch releases
   block("MotionSti ll"); //wait for all motion to stop, no system delay for this.
   xcor = Engine.Ge tAxisPos( 1 );
   print("xcor = ",xcor);
   pinstate = Pokeys1.G etPinDig(19);
   if( pinstate )
   //if( GlobalGet("ProbeHit"))
   {
      print("Zero Axis, probe complete.");
      GlobalSet("Zero1",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" );
   };
};

thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on March 05, 2019, 09:00:22 PM
Gary:

  I think I see the problem. If the probe isnt hit the engine is left in Pokeys control
with the engine in a probe state. Thats weirding things up internall y. It probably
explains the final problem you have any why if you hit the probe every call all
is fine. I will fix this tomorrow by ending the probe state in the engine when MotionSti ll
is signaled if probe is in effect. That should fix the issue. I appreciat e your work in defining
it. Ill notify on this thread when I post the fix.

Art


Title: Re: reading Pokeys pins
Post by: ArtF on March 06, 2019, 09:55:36 AM
Gary:

  Auggie 3.5 is online. It fixes a problem where if the probe didnt hit, the engine
was left in a probing condition until the start of the next move. Now, just prior
to MotionSti ll being signaled to the scripts, the probing , if in effect, is terminate d
properly so its ready for any command.

  Let me know if this fixes your problem..

Thx
Art


Title: Re: reading Pokeys pins
Post by: gburk on March 06, 2019, 11:26:25 AM
ok art will try it, thanks

I think the most annoying part right now is having to run the script first in script RUN before the button press
and I may have to run it again after running probe it seems to random. I may get 2 or 3 probe runs before I have to run in the script RUN.

a couple questions on the screen edit.

if I change the font size it always converts back to 9 doesn't seem to want to stay at the size I entered..

also is there a way for a button to swap to a different screen say I want a button for probing and then that button will show a probing screen...

Ok Tried it out still have to run in script RUN first it reacts a little different now,
if I let run to the end in -25 direction first run engine I get the messge probe stop before complete I then zero the axis and won't run again until I run it again with script run, now say I run the -25 again I go a Radom distance and keep the probe shorted I have the reverse set to 3 and let run till end I get the same message probe stop before complete but funny thing I don't need the run it again with script run just a button click will rerun now.. the only real problem I see reversing is a lot of time if I don't release the probe it seems to just keep going I have it go as far as 20.. not good if maybe a probe got stuck or for some reason  stayed grounded won't break probe in that direction but would slam the axis if you didn't have that much travel distance. .

when the probe is triggered and released that seems ok   
it does stop and zero the dro correctly .. and for the most part a don't have to rerun the script before a button press
hope this helps

thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on March 06, 2019, 08:50:48 PM
Gary:

 
>>if I change the font size it always converts back to 9 doesn't seem to want to stay at the size I entered..

  Try saving the screen after changing the font, as I recall that can be a bit difficult to keep stuck..

>>also is there a way for a button to swap to a different screen say I want a button for probing and then that button will show a probing screen...

  You can use panels with multiple pages...b ut I dont think I made a facility to swap full screens.

>>Ok Tried it out still have to run in script RUN first it reacts a little different now,
>>if I let run to the end in -25 direction first run engine I get the message probe stop before complete

  Thats a normal message if the probe doesnt hit.. though Ill change that to "Probe motion complete, no hit."
 
>>I then zero the axis and won't run again until I run it again with script run

  So this is the button? And it wont run again till after a script run from the script tab?

, now say I run the -25 again I go a Radom distance and keep the probe shorted I have the reverse set to 3 and let run till end I get the same message probe stop before complete but funny thing I don't need the run it again with script run just a button click will rerun now..

  So if Im reading this right, you try it and hit the probe after a short distance, it stops and reverses.
You keep the probe held, so it continues raising until end of probe up command, stops with
same terminati on message, and button now works fine. ?

>> the only real problem I see reversing is a lot of time if I don't release the probe it seems to just keep going I have it go as far as 20.. not good if maybe a probe got stuck or for some reason  stayed grounded won't break probe in that direction but would slam the axis if you didn't have that much travel distance. .

  It shouldn't be possible for it to move more than the commanded motion.. If the probe doesnt
release it should only go back up to start zero?

>>when the probe is triggered and released that seems ok   
it does stop and zero the dro correctly .. and for the most part a don't have to rerun the script before a button presshope this helps

  So do I have this right, problem only seems to happen still if the probe doesnt hit
during the probe command?

Art



Title: Re: reading Pokeys pins
Post by: gburk on March 07, 2019, 01:13:44 PM
 ..You can use panels with multiple pages...b ut I don't think I made a facility to swap full screens.

ok I know multiple pages, I thing is when you create one like the Diags pages is if I change the text to Probing I need to make the button big or the text will be cut off
only show the bottom half of the word

thought about creating a dialog but your examples are not in the lib. and I tried messing with it but seems like some of commands you used in the video are not working off the top of my head one was the buttonono ff..

 .. So this is the button? And it wont run again till after a script run from the script tab? 

Correct.
to be clear the button does run on every press all the print statement s display the messages on screen just no motor movement till I re run the script tab..

..  So if Im reading this right, you try it and hit the probe after a short distance, it stops and reverses.
..You keep the probe held, so it continues raising until end of probe up command, stops with
..same terminati on message, and button now works fine. ?

..  It shouldn't be possible for it to move more than the commanded motion.. If the probe doesnt
..release it should only go back up to start zero?

That what I would think but I have has the dro's go as far as 20, and the reverse distance is hard coded not a var and is set to 3..
so I have no reason for this one, so far its only if the probe it not released. I will try later and swap the direction s go to pos then neg;



.. So do I have this right, problem only seems to happen still if the probe doesnt hit
..during the probe command?

It seems that way so far when probe is hit stops then reverses and when I release the probe it stops and then zero's the axis dro..

Ok I tested it going pos then reversing to neg exactly the same results, except not if if runs all the way to 25 I have to re run the script tab
and if I hit the probe and it reverses to -3 its fine don't need to re run the script tab.
so looks like as long as there is a probe hit its ok.
But this doesn't explain why I need to run the script tab first to get things going I don't see anything in the script that looks like the problem..

are you going to do away with this command  GlobalGet("ProbeHit") and stick with the pin19 check?

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on March 07, 2019, 02:37:44 PM
Gary:

>>are you going to do away with GlobalGet("ProbeHit")...

  No, they have different uses. ProbeHit is just and indicator that
the last probe was sucessful l and the cooridnat es stored can be validly read
as that hit point. If fals,e the last probe wasnt sucessful l.

 Your pin19 check is just a check realtime on pin19. Probehit will work
no matter what pin is used.

  It sounds like something bad is still going on if a probe isnt hit..
Ill have to dig into it.  it may take a couple days as Im in the middle of some
other code.

Thx
Art




Title: Re: reading Pokeys pins
Post by: gburk on March 07, 2019, 02:43:24 PM
no problem take you time I'm in the middle of getting the routing done on the board I'm working on want to get it out tomorrow to have a prototype built..

gary


Title: Re: reading Pokeys pins
Post by: gburk on March 12, 2019, 12:01:31 PM
Got back to testing :

I seem to have a issue with homing also seems when I first boot auggie and then do a home it always seems to set the axis to a value other than 0 then if I home again its ok sets dro to 0..

also I don't think GlobalGet("ProbeHit") works correctly I get the same value if hit or not,, that's the reason I went to checking pin19...

also having problem figuring out the way mach and work cord work...

I created a small global script to move the x-1 and then to x1 I  home the x first then jog x to say 2" and then zero the work cord for x, now i run the script then hit the button
it seems to run fine go's to -1 then back up to 1.. now if I zero the x again and press the button it runs to -2 and then back to 0 but the mach cord seems to go -1 and then up 1 they seem to loose sink.
also if I set the work cord to .250 after a move to -1 in a script then send a move to 1 I would think it would move to 1 but not finding that the case... never moves to 1..

also not sure if I am correct  but myxmachin ecoord = Engine.Ge tTruePos( 1 ); should return the mach cord
and usercoord = Engine.Ge tAxisPos( 1 ); the work cord. I find both to return the work cord.. same values..

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on March 13, 2019, 04:28:37 PM
Hi Gary:

  Ive confirmed some of this and fixed it already. It seems I added a few bugs in adding probing,
and in the case of GetTruePo s , I had never used it so I missed a section I should have rem'ed out
to stop offset comp. , I will put out a new version tomorrow after I run some verificat ion tests.

Thx
Art


Title: Re: reading Pokeys pins
Post by: ArtF on March 14, 2019, 09:33:28 AM
Gary:

  New Auggie is online..

Notes:

   I found and fixed a problem with Probehit and with syncing after a probe. Problem was
the planner was syncing before the final position was read. I tested this with a script..

Engine.GC ode("G31X50");
block("MotionSti ll");
if( GlobalGet("ProbeHit") )
{
  print("Probe was hit");
}
else
{
 print("Probe not hit");
}
Engine.GC ode("G1X0");

   It is consitant and shows probehit or not, and always returns to
0.
  I cant repeat the homing issue, mine homes and reads all zero's afterward s.
The work coordinat es seem to be fine here, I tested with a script that
moved from -3 to 3 three times. It stops at 3.0 , if I then zero the script
still moves from -3 to 3 as new coordinat ed. Work coordinat es are the normal view,
the machine coordinat es are the raw coordinat es the pokeys sees itself at, the
work coordinat es are, like in mach3, just that with offsets applied.

Let me know how you make out..

Art




Title: Re: reading Pokeys pins
Post by: gburk on March 14, 2019, 02:04:44 PM
Ok Seems good haven't run a lot of test but no problem now when axis runs to end with out a probe hit I tested your code in the script run..

and I ran this thought global with a button press it also ran good no problem, running and returning to 1,
still have to run the script in the script run before It will run with a button press but now I only have to run it once, so that's good, but is there a way so it doesn't have to loaded into the script edit and run first?.

I had to invert my probe other wise it was always  triggered,,

also when probe is hit the axis doesn't stop dead it moves past the probe hit, it looks like enough to crash into the switch's..
will test some more with some added code to see if backing off will  see the switch being released ok.

I'm using Inch not metric.. hence the different numbers from you code.
   
global ZeroToPla te = function()
{
print("probe test");
GlobalSet("ProbeInve rt",0);
Engine.GC ode("G31 X-3 F100");
block("MotionSti ll");
if( GlobalGet("ProbeHit") )
{
     ProbePos = Engine.Ge tAxisPos( 1 );                 // Get probe position
     print("Probe Position = ",ProbePos); // show probe position
  print("Probe was hit");
}
else
{
 print("Probe not hit");
};
Engine.GC ode("G1X1");
};

gary


Title: Re: reading Pokeys pins
Post by: gburk on March 14, 2019, 04:27:41 PM
Art

Ok the problem I'm having is - if I have a touch off  plate say .250 thick now I probe to plate then set axis dro to .250 at plate  then I want to retract to 1.0 when I do a g1 x1 it go's to 1.6 even higher over 2.0, it seems not to know its sitting at .250 after I set the dro to .250, if I remember right that would work in mach3 or you could set axis to 0.0 and move touchplat e - 1.. then set dro to 1, making any sense?.

Gary 


Title: Re: reading Pokeys pins
Post by: ArtF on March 14, 2019, 08:15:15 PM
Gary:

>>also when probe is hit the axis doesn't stop dead it moves past the probe hit, it looks like enough to crash into the switch's..will test some more with some added code to see if backing off will  see the switch being released ok.

  This is typical with probes. You dont want to simply stop, steps could be lost. So typically when the
probe is hit, it trips to a decelerat ion phase, then stops. That why if you then get the probe hit points
from a script you'll see they are not the final rest position. Two things you can do for that is to either
probe at a lower feedrate, or set axis accelerat ion to a higher value.

    Normally Auggie is 6th order for motion, BUT when a probe trips to hit status during a probe,
the pokeys switches to internal planner and slows down based on the setting of accel. Its a mach3
type of bang bang slowdown trajector y. The slower you go the faster you stop.

   That why typically one would feed in a little quick, the plate would be on a spring so allow for the
slight crash, and then you'd withdraw very slowly to stop one step within leaving the plate.Tha t would
be considere d zero.

>>k the problem I'm having is - if I have a touch off  plate say .250 thick now I probe to plate then set axis dro to .250 at plate  then I want to retract to 1.0 when I do a g1 x1 it go's to 1.6 even higher over 2.0, it seems not to know its sitting at .250 after I set the dro to .250, if I remember right that would work in mach3 or you could set axis to 0.0 and move touchplat e - 1.. then set dro to 1, making any sense?.


  That ones weird. I specifica lly tested that here to ensure it still moved to proper position
after a hit. Yes, you should be able to set the dro to .250 and then G1 to x0; Ill test that
again tomorrow to see what might be going on. This is on the work coordinat es tab right?
Not the machine coords tab? Sounds like we're close anyway...


Art



Title: Re: reading Pokeys pins
Post by: gburk on March 15, 2019, 10:06:55 AM
Art

>This is on the work coordinat es tab right?
>Not the machine coords tab? Sounds like we're close anyway...

Yes word cords,
also I don't think I can read the mach cords in a script I think I had said this one before

if I use gettruepo s not sure if command is correct don't rem off top of my head but it returns the same value as the getaxispo s work cords ,,

I will try slowing probe down, and or a higher accelerat ion..

when probe is it are you returning the probe position with a call, or just using getaxispo s?,,
 

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on March 15, 2019, 10:31:31 AM
Gary:

 I should have mentioned, I fixed also the GetTruePo s() to give you back the machine coordinat es.
When you probe, if it hits the end position is the actual stop position not the probe position.
 To get the probe hit position, you call GetGlobal("ProbePos0"); (for x)

  After the axis has decelerat ed, the planner position is set to the last position of actual motion.
If you wish to go to the point it hit at, you should be able to do a g1 move to the ProbePos0 in
your case. Take note the probe may or may not unactivat e as that point in space will be the trigger
position of the probe switch so various factors may make it too close to release.

  It sounds to me like you may be hitting some sort of race condition where the last coordinat e
hasnt updated to the planner before calling for the G1 after the probe. You might want to add
a yield(); just before the g1. A yield is just a way of lettign auggie catch up with any tasks its
doing so if one suspects your going to fast in commands, a block for "motionsti ll" or a yield()
is a good way to make sure things sync up.. It may not help, but as I found mine to be accurate
each time I think it may be the speed of my system vs yours perhaps. This type of thing is hard
to find  but there are many threads running doing various tasks so I worry about syncing at
times , and a yield may help.

  psuedo code example..
{
   Engine.GC ode("G31X10F50");
   block("MotionSti ll");
   if( GlobalGet("ProbeHit")
    {
       yield();
      ProbePos = GlobalGet("ProbePos0");
      Engine.GC ode("G1X" + ProbePos );
      print( "Probe Successfu ll. Zero Me.");
   }
   else
   {
       print( "Probe Failed.To o far away, zero me and try again.");
   }
       

}


Art




Title: Re: reading Pokeys pins
Post by: gburk on March 15, 2019, 10:58:40 AM
Art

Set the probe speed lower and its a lot better, should be good enough not to go way past the end stop..

You are mostly right the system is not updated fast enough now that the probe is running slower, I can see it better looks like if probe is hit at -0.430 or so when I do a g1 x1 it retracts to +1.4 or so for some reason it seems to be adding the current pos to the 1 for retract make sense ?

will test the new stuff..

tested you code work good but I added so to set axis to .250 and the retract to 1 but still go's past one to 1.3 or more heres the code maybe I am doing something wrong still added another yield for testing but made no differenc e..

also looks like gettruepo s is working now.

   GlobalSet("ProbeInve rt",0);
  Engine.GC ode("G31 X-3 F10");
   block("MotionSti ll");
   if( GlobalGet("ProbeHit"))
    {
     yield();
     ProbePos = GlobalGet("ProbePos0");
     Engine.GC ode("G1X" + ProbePos );
     block("MotionSti ll");
     xpos = Engine.Ge tAxisPos( 1 );
     print("Probe Successfu ll. Zero Me. "+xpos+"  probe pos "+ProbePos);
     Engine.Se tAxisPos( .250, null, null, null );
     yield();
     Engine.GC ode("G1 X1 F50");
     block("MotionSti ll");
   }
   else
   {
     print("Probe Failed.To o far away, zero me and try again.");
   }
     
 
Gary
 

Gary 


Title: Re: reading Pokeys pins
Post by: ArtF on March 15, 2019, 01:16:41 PM
Gary:

  Try this script for me. I ran it several times with probe hit and no probe hit, it returns to X=0 every time.
Id like to know if your does different . There's a bit of a dance going on when a probe is hit. First, the program stops motion.It clears the planner of any subsequen t moves. It then flags the system to refresh the planners current position to wherever it stopped. The next move in the script is to move to x=0.

   Now if the move to x=0 happens before the probe internals have reset the planner, it may still think its at
the last commanded position, which is the norm. This means if the probe stopped you at x= .5, but didnt set the planner to .5, it will still think your last move ended at X10, or whatever the stop was. So a move to x1 may move 9 units up. But if the planner knows it stopped at .5, then it should move only .5 to get to zero.Your symptoms seem to show its stopping on the probe, but not resyncing to the actual position the
machine coordinat es are now at. Im just not sure why mine works..bu t perhaps both of ours work
on this script but fail on yours. Let me know what this simple script does..



Engine.GC ode("G31X10");
block("MotionSti ll");
if( GlobalGet("ProbeHit") )
{
  print("Probe was hit");
}
else
{
 print("Probe not hit");
}
Engine.GC ode("G1X0");

  Does it always end at x=0 on the work coordinat e display?

Thx
Art



Title: Re: reading Pokeys pins
Post by: gburk on March 15, 2019, 06:54:33 PM
Art

ran the script 10 or 15 times let it run to end 5 time always returned to 0, hit probe at different distances and always returned to 0

then added the line to set axis position to .250, let it run to end g31x10 then set the position to .250 so now axis position is set to .250 and then the g1x0 runs  but go's past 0  to -9.9498.

so far as I can tell right now its good endless you reset the work position from where it stops. does the same thing if you hit the probe but stops at different - positions I assume it reversing to the - value from the probe hit so if I hit the probe at 3.467 when  axis reset to .250 it travel's to -3.467 not exactly the back distance but in the area
 
hope this helps a little
 
thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on March 15, 2019, 07:16:23 PM
Gary:

 Thx, that points to the error, I must not be resetting the planner after the scripted Axis position
set. Ill fix that up. Thx for your tests, when I wrote Auggie I put in a lot of code that has never
been tested, I added it just in case. Much of this problem seems related to simply being
untested code.  Comes from writing a controlle r in a year. :)

 Ill let you know when the fix is online.

Art


Title: Re: reading Pokeys pins
Post by: gburk on March 16, 2019, 08:35:19 AM
Ok thanks

Hopefully you have some code to read the encoder pins13  I would like to be able to setup the pin for spindle index  1 rev per if possible.
and also be able to  use pin17 for pwm output 0-10v for the spindle speed  control.. but first things first lets get probing going first..

I know I keep bring this up but is there a way to get the global script running so I don't have to run it first in the script edit then use the button.

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on March 16, 2019, 12:17:11 PM
Gary:

  I believe you can poll the encoder counts from the pokeys, but I dont think you can
the index. Ill have to look up what informati on the pokeys sends back on that.

  You can use any PWM channel you like. Examples of that are in the laser control
library as I use that library to control pwm power for the lasers.

 As to the problem with the script having to be run before the button call to it will
function, Im still not sure whats going on there. I'll take a look to see how one of mine
works and perhaps we can figure why yours doesn't mimic it..

Art


Title: Re: reading Pokeys pins
Post by: gburk on March 16, 2019, 04:03:24 PM
Art

I don't own a laser so that Greek to me right now...

I did look at the laser lib didn't see anything for pwm only turning on and off relays for air blow…

looked in the gcode lib that had some on pwm spindle speed don't look like its functiona l and looks like you need a real high spindle speed over 25000 to get it to return a value other than 0 not sure on how you are sending the pwm pulse. I'm used to just sending m3 s3600, or similar. right now I do have m3 and m8 working for turning on the spindle relay and coolant and m5 and m9 to turn off relays.

I thought I read some where that you are using motor 8 for laser control, I may be wrong.

I think pin17 is just a pwm pin for 0 to 10 v output I tried setting pin17 but haven't any luck changing the voltage output...

But this is a later problem  :-\

One thing at a time first probing, we are almost there, just a couple things not quite right, but I know you will get it...

Gary
   


Title: Re: reading Pokeys pins
Post by: ArtF on March 18, 2019, 04:44:11 PM
Gary:

 Just uploaded a new Auggie that should rest the planner after you use SetAxisPo s so that
subsequen t moves do not overrun. Let me know if this fixes the current script problem.

 I use motor channel 8 for realtime pwm control, but this isn't how you'd do it for a spindle,
in that case youd call the PWM script calls to set up a channel , a base frequency and an output
level. We'll go into that after this probing is all settled..

Art


Title: Re: reading Pokeys pins
Post by: gburk on March 18, 2019, 07:35:26 PM
Ok will test it out

I think the PWM channel is 5 if I'm reading things right but after probing is going...

Gary


Title: Re: reading Pokeys pins
Post by: gburk on March 19, 2019, 07:29:14 PM
Art

Here is some numbers I am getting all are with g31 x-3 and retract after probe is hit I set the axis to .250,  then do a g00 x1

Probe run started at 0  - hit at -.3955  reset to .250 retracted to  0.6255           - started at positive hit at negative ended at positive
Probe run started at .6455  - hit at -.3802  reset to .250 retracted to  1.2758     - started at positive hit at negative ended at positive
Probe run started at 1.2758 - hit at -.2863  reset to .250 retracted to  1.8120    - started at positive hit at negative ended at positive
Probe run started at 1.1820 - hit at +.5002  reset to .250 retracted to  1.5681   - started at positive hit at positive ended at positive

Seems close to before I think is there a way to tell if the version of auggie has changed.. ..

I thought I left a message last night about this but don't see it, that's a good thing I was having all kinds of problems last night
estop getting triggered off every time I had the line to setaxispo s(.250) in the code, if I removed it all was good, now decided to try again tonight and I don't seem to be having the problem maybe I was having a computer gulch …

looked at the way I have mach4 setup for my spindle I am using ob5(10) step/dir and ob5(10) set to motor5 with the smoothste pper


Thanks gary



Title: Re: reading Pokeys pins
Post by: ArtF on March 23, 2019, 08:50:10 AM
Gary:

   Thx, I neglected to update the version number. Ill have to do some checking to see why its the same.
Ill be away though until a week from Monday getting some sun. Ill fix this up when I return;
 It does look like nothing changed.. which is odd as I reset the last position during any SetAxisPo s call..

 Sorry for the delay on this reply, I didn't get a message on this post for some reason.

 Sounds like your driving your spindle with step pulses from Mach3, if so we'll set it on
an axis and use the FreeAxis calls to simply set a frequency . That can be added into
the spindle off and on calls as far as making the spindle work at any frequency . The FreeAxis
axis ( 4 of them) can be used individua lly at any frequency output and can be left as simply
frequency instead of step counts.

Art


Title: Re: reading Pokeys pins
Post by: gburk on March 23, 2019, 12:00:19 PM
Ok Thanks

Your coming to the sun i'd like to get out of the sun, been getting way to hot for me in the summer and winter! down here in Florida can't even work in the garage most of the time.

have a great trip...

gary


Title: Re: reading Pokeys pins
Post by: ArtF on March 23, 2019, 05:22:43 PM
Gary:

 Im freezing. .  .. Be back in a week..

Art


Title: Re: reading Pokeys pins
Post by: gburk on April 02, 2019, 03:39:49 PM
Hi Art

Had a couple questions before I forget I will ask,,

I haven't figured out a way to setup say 10 buttons with the same id name and a different id number
and press any of the ten buttons and then read the id number, can't figure out how to read the id number..
that way hopefully I could just use the id number and a case: statement to do as I want.

also you have a toolbox, can you use the toolbox to keep tract of your current tool# maybe to do a tool change
and change to a tool you may select form the toolbox?

also getting gcode errors created with cambam..
Error--44,  G2 X1.547 Y-0.1575 I-0.0305 J0.0
I have other gcode errors but just showing you this one for now.

And i did get the problem fixed about having to run scripts first in the script run screen..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on April 02, 2019, 05:38:21 PM
Hi Gary:

   What was the scripting problem with the button.. (just so I know..)..

I just got back and Ill fix up the last probe issue this week. ..


kk,buttons. ..You cant really call their ID.. a button will send out a state of 1 when pressed, and 0 when released.
They cant be named the same either or they'll all press when you press one.  I do recall making a group button
sequence though,where one buttons turns off all others in the group, Ill have to look up how exactly I did that at the time.

There is no real toolbox in Auggie, I didn't implement one really, Auggie's point was to be fairly simplisti c
so a tool table wasnt set up as I didnt want the complexit y. You may find command hooks simply to stop errors
but theres likely no underlyin g functiona lity.

   Is that error perhaps due to the G91 mode for absolute or increment al arcs? There is a list of errors,
Ill take a look at error 44 to see exactly what it is.. I just got in so Im still a bit jetlagged and Im
not sure top of head..

Art


Art


Title: Re: reading Pokeys pins
Post by: gburk on April 02, 2019, 08:16:15 PM
Did you have a great trip?

Wasn't expecting a response so soon, I'm getting to that age if I don't  post the message when info is on my mind, it may be lost or forgotten by tomorrow ???

Not really having a scripting problem with the buttons

just was hoping there would be a way to read the button id number so if they were all named with the same var name I could use just one button global function for all the buttons in a panel, say I had 16 buttons to do a tool change I would press button for tool1 then move x y z to save position, now move my tool rack in and rotate to tool1. make sense? I figured a case: statement would make it a little easier then creating a global function for each button,..

Just was checking to see if it was in your code, when I create a button I see when editing that button there is a value for a id number in there also.

Toolbox really wouldn't make a big differenc e to me just checking.

Gary

   


Title: Re: reading Pokeys pins
Post by: ArtF on April 02, 2019, 08:20:44 PM
Hi Gary:

>>Did you have a great trip?

   It was great. Jamaica is nice and hot this time of year. :)

>>Wasn't expecting a response so soon, I'm getting to that age if I don't  post the message when info is on my mind, it may be lost or forgotten by tomorrow Huh

  Welcome to my world.

>>Not really having a scripting problem with the buttons

 No, I meant the reason why you used to have to run the script before the button script would work..I
was curious as to why that happened.

>>just was hoping there would be a way to read the button id number so if they were all named with the same var name I could use just one button global function for all the buttons in a panel, say I had 16 buttons to do a tool change I would press button for tool1 then move x y z to save position, now move my tool rack in and rotate to tool1. make sense? I figured a case: statement would make it a little easier then creating a global function for each button,..

  There is a way to do that, I just cant recall at the moment.  Ill take a good to look to see how I used to do that..
 
>>Toolbox really wouldn't make a big differenc e to me just checking.

  Yeah, a toolbox was one of those things I figured if one need sit, theres always Mach3 or 4.. :)

Art
 


Title: Re: reading Pokeys pins
Post by: gburk on April 03, 2019, 12:45:06 PM
Art

>It was great. Jamaica is nice and hot this time of year
Probably hotter than here in Florida we have had a couple good weeks high 70's low to min 80's and not humid, only time of year I like being out but went and had rotators cuff surgery in late January so haven't done much since, this is the time of year I ride my horse and work in the garage, but not this year and if a few week to a month it will be to hot.. but then you'll be able to go out and do stuff and I'll be stuck inside :'(.     

> No, I meant the reason why you used to have to run the script before the button script would work..I
>was curious as to why that happened.

I'm not totally sure but I think, when I created a script folder and had the scripts off the folder tree then I checked the script but not the script's main folder also
is when I had to run them in the script window... I'm pretty sure I was just checking the script but not the scripts main folder... not a good exaptatio n hopefully you
can get what I'm trying to say.. 

> Yeah, a toolbox was one of those things I figured if one need sit, theres always Mach3 or 4..

Yes I figure if I can get a tool change to work, I will know what tool is in what position anyway just won't work for other people but something they could start from..

I seem to have problems with mach4 things work then I edit the screen now it busted a lot of times won't even boot anymore and makes no sense I don't change any of the scripts, had a hell of a time getting the spindle working in mach4, easy in mach3, after many headaches did get it working but I think I already stated this in another post  I used ob5(10) for motor 5 and and in the spindle setup set this to ob5(10) and used then set to pin 1 for step and pin 16 for dir it works spindle relay kicks on and speed adjusts fine.

Creating a dialog can't seem to find a command to AddDRo is that in auggie? I see AddButton and many others are there.

also I have a dialog created  and ended with WaitDialo g.DoModel ess("none"); and also a button that call another global function this works great, now if I am in the called global function and I want to add or change the Addstatic text lines is that possible. I haven't been able to figure it out.. WaitDialo g.AddStat icText doesn't seem to work..
in the function call from the button..

also I don't think the dialog is being killed I have a button that calls a dialog, now that dialog has a button that calls a function if there is an error the function calls another dialog, when I close the last dialog it go's back to the calling dialog but never finishes the function that was running before the error...
and now if I hit the stop or rewind the mdi doesn't react I have to hit EStop… is the dialog still running even though the window is closed?

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on April 06, 2019, 09:26:10 AM
Hi Gary:

  I just uploaded version 3.6 of Auggie, it fixes your probing issues. I wasnt correctly setting the
engines current coordinat e when you Used SetAxisPo s(...).

  Getting your spindle to work shouldn't be too bad. If you use the pokeys to setup a PWM channel,
then tell Auggie to set that channel (in the Spindle on and off scripts) to a PWM % of 0 - 100%
with the SetPWMDut y script call it should pretty much do it. You will need to get the current spindle speed
and make whatever scaling you wish for your spindle to make it a demand of 0 - 100% though.
 
  Dialogs I haven't used in quite a while, but in looking to the code, when the script is deleted, the dialog is
closed and killed. If you close a dialog but are still in a script, it will not actually be deleted until the script
ends. I didn't envision a dialog being created in a script that never actually ends. So creating a new dialog
each time may fill you up in memory. Its possible anyway. There is no way to re display the dialog once
a user closes it. Its probably best to make a separate script that creates a dialog, waits while the user uses it,
then sets some globals your main script can read. It can then be called by your main script, it will close
and delete itself when it exits, and the main script never has to exit for the dialog to be deleted.

  Dialogs dont have DRO's, they are basically a windows dialog, and have text boxes, which can show numbers
so are kinda windows versions of DRO's.

  Im kinda impressed you got dialogs running, I figured they were more my own domain and YaNvrNo's as the complexit y involved was higher than I figured any general user of Auggie would get to. YaNvrNo was the
main tester and retester in Auggies developme nt so other than he or I some of the more esoteric
functions of Auggie I figured would never be used. Scripting in the Gcode for example is another one.


 Anyway, test this latest version, I suspect your probe will work fine now, and I can tackle your spindle
or whatever thing your focusing on at the moment. :)

Thx
Art











Title: Re: reading Pokeys pins
Post by: gburk on April 06, 2019, 04:56:21 PM
Art

Tested the new version it looks good, I have setup a panel with a few dro's Retract height, Travel distance, Touch Off plate thickness ..
So I have changed there values a few times and it seems to probe ok and returns to Retract height consisten tly so if I probe to the Travel distance hit probe
then reset dro to Touch off plate thickness it has so far always reset to the right plate thickness, and now it will also retract to the retract height correctly ..
probe to 2" hit probe at .75 then dro resets to .25 then retract to 1" now dro shows 1" so far every time..

As for the dialog I will try a better explanati on!

I am working on doing a manual tool change
So I created a  DoModeles s dialog because it doesn't lock up the gui and I can have the dialog on screen that displays a message to jog to a safe x y z position and also have a button (Z touch off) so after you have changed the tool you can put you touch off plate back on part and hit the button to probe the Z and reset the Z position for the new tool Hight. Problem is from the button I am calling a function to save all the work positions turn off the spindle and flood now call the Z touch to probe the Z
After the call to do the Z touch off it should return from when I called the z touch off, so I can reset the new z position  and jog back to the X Y Z original positions
turn on spindle and flood.
The problem I am having it doesn't seem to return to finish anything after the call to function Z touch off, doesn't complete script..
I have tried killing the dialog myself at end of script, but problem doing that its dead, so I have to run it again in the script edit run again..
Make any more sense?

Also I am back to the problem I thought was fixed, I have to run the probing script in the script edit run first or it won't run..
the strange thing is it seems to run the script, I have a few print statement s in the script, they are being displayed but the motors and dros do not move
until I run the script in the script edit.. then motors and dros move..

Will worry about spindle later... just had some time on my hands so messed with dialogs

Did you think to check on how you could read the button id numbers?.

Here is an edit to message
I think the probing is working again without running the script first made one change not sure why it made it work again
If I didn't hit the probe and g31 ran to end of travel say 3", the script would not run again endless I reran it in the script edit, I have it sending the message probe not hit enter a higher value and returning a -2 so I added the code for the axis to return to the start of the probe position Right now its the Z height just before the return -2.
Now I don't have to run the script in the script edit anymore seems to run every button press...
Have any thoughts on that?
 

Thanks gary

     
   


Title: Re: reading Pokeys pins
Post by: ArtF on April 06, 2019, 08:21:20 PM
Gary:

   You may have to post your dialog code so I can see it. I recommend any dialogs be made
as a library file of their own. Makes it easier to post for debugging or for others to use..

As to buttons as group buttons.. Here is the method I have used. You have to use a script
to initializ e your buttons as a group..

Imagine I have 3 buttons and their ID's on your screen are Main_BUT_ 1 , 2 ,3 and 4.

First we identify a master of the group. We'll use button #1 here..
 
global MPG1group = Button("Main_BUT_ 1");

 
  Now we tell Auggie to add the rest of the buttons to our group, meaning only 1 may be pressed
at any time and one will always be pressed. ( Like selecting modes or axis)..

for( x = 2; x < 4; x = x + 1)
{  //connect each button as a slave of this master
    MPG1group .SetGroup ("Main_BUT_" + x);
}

//finally set the state of the group

MPG1group .SetState (0); //this turns on the first button, all buttons should now act as
                                    // a group of buttons, one turning off all others when it turns on.

Note:  Set all buttons to non-toggle button so the state toggle each press.

  You can see this work in the MPG panel stored in the example panels.

Art






Title: Re: reading Pokeys pins
Post by: gburk on April 07, 2019, 11:03:59 AM
Hi Art

Here is a mess not good looking code but been hacking it up and down, don't know if you will be able to follow it with not all the peace's I am going to zip up my
scripts and panels and hopefully post a link for you to download the hole mess..

So back to the buttons should I give them a id number and a variable name? or just leave the button named as there default names..?

I have tried to look at the scripts for jog panel I assume that's the mpg you are referring to but they don't show up in the scripter so you I may need a little help finding them how about a auggie for dummies doc.  ???

// Library Toolwait
// Created  Thursday, April 04, 2019
// Author  Gary       -- Do not edit above this line
 
 //  Enter Global vars below this line.
//  the librarian no matter where they are, but its easier
//  to find and edit them in one spot.
   
   
   
 //The 6 lines previous to a function will appear as 
 //comments to help users to understan d the parameter s   
 //required for use by each function, so try to   
 //always add as clear a set of instructi ons in these 
 //lines as an aid to fellow traveller s.   
 // 
global WaitDialo g = Dialog();                                         
global ToolWait = function()
{
if ( WaitDialo g != null )
{
  if ( WaitDialo g.IsOpen() )
  {
  return;
  };
};
 
//global WaitDialo g = Dialog();
 
WaitDialo g.SetRect ( 25, 20 );
WaitDialo g.SetTitl e( "Maunal Tool Change " );
WaitDialo g.NextPos ition( 5,5,80,50 );
WaitDialo g.AddStat icText( " Manual Tool Change now Jog to a safe X Y Z Position");
WaitDialo g.NextPos ition( 5,15,80,50 );
WaitDialo g.AddStat icText( " After new Tool is Inserted  PRESS Touch OFF Z");
WaitDialo g.NextPos ition( 40,50,60,70 );
WaitDialo g.SystemB uttonsOnO ff(false);
WaitDialo g.AddButt on("Touch OFF Z","MyToolCha nge");
WaitDialo g.DoModel ess("none");
};
 
global ProbeErro rDialog = Dialog();
global MyToolCha nge = function()
{
Touch_OFF = ZTouchOFF();
yield();
  print("Touchoff 4 "+Touch_OFF);
 if (Touch_OFF == -1 || Touch_OFF == -2 || Touch_OFF == -3 )
 {
if ( ProbeErro rDialog != null )
{
  if ( ProbeErro rDialog.I sOpen() )
  {
  return;
  };
};
//  global ProbeErro rDialog = Dialog();
  ProbeErro rDialog.S etRect( 15, 10 );
  ProbeErro rDialog.S etTitle( "Probe Error " );
  ProbeErro rDialog.N extPositi on( 5,5,80,50 );
   if (Touch_OFF == -2)
   {
    ProbeErro rDialog.A ddStaticT ext( "Error Probe not HIT Try jogging closer to Part");
   }
    else if (Touch_OFF == -3)
    {
     ProbeErro rDialog.A ddStaticT ext( "Error Probe");
    }
     else if (Touch_OFF == -1)
     {
      ProbeErro rDialog.A ddStaticT ext( "Error Probe not known");
     };
   ProbeErro rDialog.D oModal("none");
   return;
  }
  return;
};

thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on April 07, 2019, 11:18:58 AM
Gary:

 Thx, Ill check the dialog to see what I think.

 For the buttons example, the MPG panel, you can use the screen loader to load the MPG.panel,
once loaded if you open the scripter and checkout the main init script for that panel youll
see how the buttons are joined together.

   You dont need to do this in an init script stored in the panel or screen though, thats just
how I used to do it. Id set each Button with an ID name. Then once your screen is loaded, look
at the name the editor gives you because it may decorate the name with MAIN_ as it loads.

  Then in a library script make a global function that uses SetGroup and such to define those
buttons as being joined. Right after defining that function, call it.

ex: (assuming the end name of the buttons are Main_MYTO OLBUTS_1 through 4)

global MYgroup = Button("Main_MYTO OLBUTS_ 1");

Global MyGroupof Buttons = function()
{
 
    for( x = 2; x < 5; x = x + 1)
  {  //connect each button as a slave of this master
       MYgroup.S etGroup ("Main_MYTO OLBUTS_" + x);
  }
 
   MYgroup .SetState (0); //this turns on the first button, all buttons should now act as
                                    // a group of buttons, one turning off all others when it turns on.
}

MyGroupof Buttons();  //now call it  right after defining it so its in effect from the start


global Main_MYTO OLBUTS_1 = function( state )
{
    if( state) dothis
    else
    dothis
}


  You may now make scripts named as the buttons ID name and they will be called
when a button is pressed, and all other buttons will turn off. Above is untested, just out
of mind but its how it should work.

Art




Title: Re: reading Pokeys pins
Post by: gburk on April 07, 2019, 06:53:35 PM
Art

Tested out the buttons a bit, not having any luck,  I have 16 buttons and it seems like auggie has named them all the same "ToolChang er_BUT_0" with or without a name var, I tried with a var name of tool1 to tool16 got the same results.. .

You said load the mpg as a screen don't see how to load the panel as a screen and I don't see a mpg panel or screen the only panel with mpg is the jogpanel. .

also can auggie return 4 values from a function I seem to get compile errors when I am trying to return 4 values, like return x,y,z,a; ?

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on April 07, 2019, 08:11:21 PM
Gary:

   Ill check the buttons tomorrow to see why the numbers are sticking .. It is possible I didnt
include the MPG panel in the release, Ill check that too.
  The buttons shouldnt have the same ID, I think you need to set each button to a different
ID number as you create them. Ill run a test and see.. You should be able to just enter an ID number instead of a variable name as you make the button.

  You cannot return  more than 1 item from a function unless the item is a table of values.
You can set multiple globals while in the script though... .

Art


Title: Re: reading Pokeys pins
Post by: gburk on April 08, 2019, 08:21:55 AM
Hi Art

I figured that  when you created a button and could give it an id name and id number there would be a way to retrieve either or both

This is what i had in mind but i am assumming the button id number can not be read.
Button.ID number is there just for example, Make any sense
All the button tool id names are Tool1 and idNumbers from 1 - 16
so all tool names are the same so doesn't matter what button that's pressed it will go to the same function but with its own id number the only one on the stack..
it could be read..

//Get button ID Number

global Tool1 = function( state )

{
 
  Tool = Button.ID Number("Tool1")   
  switch( Tool )
   
{
       
case 1:
{
 //Too11
 return;
}         
case 2:
{
 //Tool2
 return;
}
case 3:
 {
  //Tool3
 return;
 }



};
};
 
just rambling on and on :-\

ok I will try it as a table I have had some trouble when setting global var they seem to want to change back to what its value when declared at originall y  I will also try that again,

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on April 08, 2019, 08:43:19 AM
Gary:

   Unfortuna tley the way the buttons are joined is simply a mechanism to ensure other buttons
in the group turn off so that one button is always exclusive ly on in the group.
 You still need a script for each button as there is no way to tell which one was pressed other
than it calls its own script. Each script though could set a global to a set number, and then call
the same function as all the other buttons where it does a switch statement on that global.

  I know it seems like a lot of scripts, but their really all the same with the minor change of what
the script sets the global to. Scripts dont take much memory so having lots of them doesnt really
run into troubles in my experienc e so far.

  Globals will get set back if the scripting system resets. Doesnt usually happen during use, but
when editing and checking in scripts and such a global reset occurs and the scripting system
will reinitial ize back to its original state with the declared variables .

Art


Title: Re: reading Pokeys pins
Post by: gburk on April 08, 2019, 11:30:39 AM
Yes I kind of figured that not a big problem.. . just running though my head,,

I did notice a funny thing with the dialog when I run the first dialog with the touch off button and let it run to the end I will get the error dialog close out the error box and hit the ztouch button again same thing let it run to error now the second time it displays the error dialog it has 2 of the ok buttons and 2 of the cancel buttons displayed .. Strange

I tried the return mytable; that seems to work fine...

The only problem with buttons is auggie only giving them all the same name all 16 are ToolChang e_BUT_0

I am planning on connectin g to mill tomorrow and see how the z probing works in real life..

But now I seem to have the problem again with having to run the probe script in the edit run first.. I thing I did say it seems to run all my print statement s and are shown on screen in the probe script
but no motor movement till I run the script in the script run..
Also is doing the same thing in any of the button toolchang e scripts.

and tried setting up FreeFeed to move 6 and 7 they move but dro's are not moving to entered feed to position and I always get a buffer over run or under run forget which one.



Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on April 08, 2019, 08:14:11 PM
Gary:

 >>The only problem with buttons is auggie only giving them all the same name all 16 are ToolChang e_BUT_0


 Did you set the ID numbers to numbers 1 - 16, the _0 shoudl be _1 , _2 etc is the id numbers are set...

Art


Title: Re: reading Pokeys pins
Post by: gburk on April 09, 2019, 07:31:14 AM
No I removed the id numbers and added the id names, that works I can call the button function with the id name and all have a different name..
but still have to run the script first before I hit a button almost seems if you don't run it in the script edit first the Engine.co de isn't run it will show all the print statement s in that script but no motor movement. .

I am finding more g code errors seems to mostly be this type of code
on different lines.. also looks like its being displayed incorrect ly on the screen slots and holes in wrong places..
would you like a copy of the complete g code file?.. to look at
Error--44,  N2205 G2  Y-1.0185  I0.0000  J-0.0895

also here is the code I am getting buffer underrun
//Engine.FreeSetAxisType( 6, 0 );
   //Engine.FreeSetAxisType( 7, 0 );
   //Engine.FreeFeed( null, RackMovei n, RackRotat e, null);
   //block("MotionSti ll");

can I use 8 dro's and run all 8 motors from the main dro's and home? or do I have to rub from freeaxis I only see home and zero 1-4?.

Thanks gary



Title: Re: reading Pokeys pins
Post by: ArtF on April 09, 2019, 07:59:40 PM
Gary:

   >>it will show all the print statement s in that script but no motor movement. .

  Have you jogged and such before pressing the button? By  that I mean do we know all motor motions are
working prior to the button being pressed? Im just trying to figure out why no motion is occuring, its
as if there is some condition stopping it from running the motions if the print statement s are happening .

Error 44 is  "Radius different from start and end in Arc" , this almost always means a mismatch
in increment al vs absolute arc settings. Does the code have a G90.1 in it for abs or G91.1 for increment al
in it? You may need to add it to your postproce ssor depending on your arc generatio n. Post
your Gcode file and Ill check what errors I get.. or add G90.1 to the file and see if it, or G91.1 fixes those
G2/G3 errors.

>>also here is the code I am getting buffer underrun
//Engine.FreeSetAxisType( 6, 0 );
   //Engine.FreeSetAxisType( 7, 0 );
   //Engine.FreeFeed( null, RackMovei n, RackRotat e, null);
   //block("MotionSti ll");

   This one is my fault. I recently sped up Auggies engine by
slowing threads when the trajector y buffers were empty. I neglected
to look at the FreeTraje ctories as well, so any free motion fails at the moment. I fixed
this as I found the reason and my system runs the above commands
fine. I will recompile a release for you tomorrow that fixes the free axis
planner.  You can use FreeSetWo rkPos(..) to set a zero on any free axis.
  You can drive all 8 motors if you wish, BUT, the two planners,
one for axis 0-4 and the other for axis 5-8 are separate planners. They act
independa ntly so one has no idea what the other is doing. They are fine for
tool changers or conveyors and such but you cannot do synced motion
between the two. I think home will work with free axis if they are properly
set up to use home switches.

Art
 









Title: Re: reading Pokeys pins
Post by: gburk on April 09, 2019, 09:15:45 PM
Art

Ok I only want to use the freeaxis's for hopefully later on if we can figure out how to set motor 5 for spindle, I plan on using 6 and 7 for the auto tool changer positions .

I did get it to move on motor 6 and 7 but like I said I have buffer underrun error's, and doesn't move to the correct entered distances ..
and if I rapid the x y z and free rapid 6 and 7 they all move and after all axis's reach there final distance, then I will do a rapid to return to start position only with x y z but the 6 and 7 also move back with the x y z it seems like a random distance. . hopefully that's part of the problems you said should be fixed...   

also I if I print out zeroing axis numbers when I zero Y it shows axis number 4 and when I zero A it show axis number 8, X and Z seem to be the correct numbers being sent to your script updating onzero ..

didn't get it hooked up to my mill today forgot I hadn't wired the estop switch yet, but got that working today, and auggie reads it, so if thing go array I can kill it now.

Thanks gary



Title: Re: reading Pokeys pins
Post by: ArtF on April 10, 2019, 07:05:23 AM
Gary:

   You can mix the freeaxis, so using motor 8 for spindle as a frequency output
should be fine. Im sure we'll run into one bug or another along the way but
that part shouldnt be too bad.
 
   SetFreeAx isPos() shoud be the one that can set their axis to zero. Ill run a test when I build the
release later today.

Art


 


Title: Re: reading Pokeys pins
Post by: gburk on April 10, 2019, 11:31:27 AM
Art here a copy of the gcode hopefully I inserted it right..

Yes I already have the setfreeax ispos figured out it works

Code:
N5 (File Name = lathemountmotor on Wednesday, January 23, 2008)
N10 (Default Mill Post)
N15  G91.1
N20 M5 M9
N25 M6 T1(TOOL Change 3/16 endmill)
N30 G43 H1
N35 G0  Z0.1000
N40 M3 S2200
N45  X0.6290  Y0.9290
N50 G1  Z-0.0100  F5.00
N55  X1.2100   F9.00
N60 G0  Z0.1000
N65  X0.6290
N70 G1  Z-0.0200  F5.00
N75  X1.2100   F9.00
N80 G0  Z0.1000
N85  X0.6290
N90 G1  Z-0.0300  F5.00
N95  X1.2100   F9.00
N100 G0  Z0.1000
N105  X0.6290
N110 G1  Z-0.0400  F5.00
N115  X1.2100   F9.00
N120 G0  Z0.1000
N125  X0.6290
N130 G1  Z-0.0500  F5.00
N135  X1.2100   F9.00
N140 G0  Z0.1000
N145  X0.6290
N150 G1  Z-0.0600  F5.00
N155  X1.2100   F9.00
N160 G0  Z0.1000
N165  X0.6290
N170 G1  Z-0.0700  F5.00
N175  X1.2100   F9.00
N180 G0  Z0.1000
N185  X0.6290
N190 G1  Z-0.0800  F5.00
N195  X1.2100   F9.00
N200 G0  Z0.1000
N205  X0.6290
N210 G1  Z-0.0900  F5.00
N215  X1.2100   F9.00
N220 G0  Z0.1000
N225  X0.6290
N230 G1  Z-0.1000  F5.00
N235  X1.2100   F9.00
N240 G0  Z0.1000
N245  X0.6290
N250 G1  Z-0.1100  F5.00
N255  X1.2100   F9.00
N260 G0  Z0.1000
N265  X0.6290
N270 G1  Z-0.1200  F5.00
N275  X1.2100   F9.00
N280 G0  Z0.1000
N285  X0.6290
N290 G1  Z-0.1300  F5.00
N295  X1.2100   F9.00
N300 G0  Z0.1000
N305  X0.6290
N310 G1  Z-0.1400  F5.00
N315  X1.2100   F9.00
N320 G0  Z0.1000
N325  X0.6290
N330 G1  Z-0.1500  F5.00
N335  X1.2100   F9.00
N340 G0  Z0.1000
N345  X0.6290
N350 G1  Z-0.1600  F5.00
N355  X1.2100   F9.00
N360 G0  Z0.1000
N365  X0.6290
N370 G1  Z-0.1700  F5.00
N375  X1.2100   F9.00
N380 G0  Z0.1000
N385  X0.6290
N390 G1  Z-0.1800  F5.00
N395  X1.2100   F9.00
N400 G0  Z0.1000
N405  X0.6290
N410 G1  Z-0.1900  F5.00
N415  X1.2100   F9.00
N420 G0  Z0.1000
N425  X0.6290
N430 G1  Z-0.2000  F5.00
N435  X1.2100   F9.00
N440 G0  Z0.1000
N445  Y-0.9290
N450 G1  Z-0.0100  F5.00
N455  X0.6290   F9.00
N460  X1.2100   
N465 G0  Z0.1000
N470 G1  Z-0.0200  F5.00
N475  X0.6290   F9.00
N480  X1.2100   
N485 G0  Z0.1000
N490 G1  Z-0.0300  F5.00
N495  X0.6290   F9.00
N500  X1.2100   
N505 G0  Z0.1000
N510 G1  Z-0.0400  F5.00
N515  X0.6290   F9.00
N520  X1.2100   
N525 G0  Z0.1000
N530 G1  Z-0.0500  F5.00
N535  X0.6290   F9.00
N540  X1.2100   
N545 G0  Z0.1000
N550 G1  Z-0.0600  F5.00
N555  X0.6290   F9.00
N560  X1.2100   
N565 G0  Z0.1000
N570 G1  Z-0.0700  F5.00
N575  X0.6290   F9.00
N580  X1.2100   
N585 G0  Z0.1000
N590 G1  Z-0.0800  F5.00
N595  X0.6290   F9.00
N600  X1.2100   
N605 G0  Z0.1000
N610 G1  Z-0.0900  F5.00
N615  X0.6290   F9.00
N620  X1.2100   
N625 G0  Z0.1000
N630 G1  Z-0.1000  F5.00
N635  X0.6290   F9.00
N640  X1.2100   
N645 G0  Z0.1000
N650 G1  Z-0.1100  F5.00
N655  X0.6290   F9.00
N660  X1.2100   
N665 G0  Z0.1000
N670 G1  Z-0.1200  F5.00
N675  X0.6290   F9.00
N680  X1.2100   
N685 G0  Z0.1000
N690 G1  Z-0.1300  F5.00
N695  X0.6290   F9.00
N700  X1.2100   
N705 G0  Z0.1000
N710 G1  Z-0.1400  F5.00
N715  X0.6290   F9.00
N720  X1.2100   
N725 G0  Z0.1000
N730 G1  Z-0.1500  F5.00
N735  X0.6290   F9.00
N740  X1.2100   
N745 G0  Z0.1000
N750 G1  Z-0.1600  F5.00
N755  X0.6290   F9.00
N760  X1.2100   
N765 G0  Z0.1000
N770 G1  Z-0.1700  F5.00
N775  X0.6290   F9.00
N780  X1.2100   
N785 G0  Z0.1000
N790 G1  Z-0.1800  F5.00
N795  X0.6290   F9.00
N800  X1.2100   
N805 G0  Z0.1000
N810 G1  Z-0.1900  F5.00
N815  X0.6290   F9.00
N820  X1.2100   
N825 G0  Z0.1000
N830 G1  Z-0.2000  F5.00
N835  X0.6290   F9.00
N840  X1.2100   
N845 G0  Z0.1000
N850  X-1.2100
N855 G1  Z-0.0100  F5.00
N860  X-0.6290   F9.00
N865  X-1.2100   
N870 G0  Z0.1000
N875 G1  Z-0.0200  F5.00
N880  X-0.6290   F9.00
N885  X-1.2100   
N890 G0  Z0.1000
N895 G1  Z-0.0300  F5.00
N900  X-0.6290   F9.00
N905  X-1.2100   
N910 G0  Z0.1000
N915 G1  Z-0.0400  F5.00
N920  X-0.6290   F9.00
N925  X-1.2100   
N930 G0  Z0.1000
N935 G1  Z-0.0500  F5.00
N940  X-0.6290   F9.00
N945  X-1.2100   
N950 G0  Z0.1000
N955 G1  Z-0.0600  F5.00
N960  X-0.6290   F9.00
N965  X-1.2100   
N970 G0  Z0.1000
N975 G1  Z-0.0700  F5.00
N980  X-0.6290   F9.00
N985  X-1.2100   
N990 G0  Z0.1000
N995 G1  Z-0.0800  F5.00
N1000  X-0.6290   F9.00
N1005  X-1.2100   
N1010 G0  Z0.1000
N1015 G1  Z-0.0900  F5.00
N1020  X-0.6290   F9.00
N1025  X-1.2100   
N1030 G0  Z0.1000
N1035 G1  Z-0.1000  F5.00
N1040  X-0.6290   F9.00
N1045  X-1.2100   
N1050 G0  Z0.1000
N1055 G1  Z-0.1100  F5.00
N1060  X-0.6290   F9.00
N1065  X-1.2100   
N1070 G0  Z0.1000
N1075 G1  Z-0.1200  F5.00
N1080  X-0.6290   F9.00
N1085  X-1.2100   
N1090 G0  Z0.1000
N1095 G1  Z-0.1300  F5.00
N1100  X-0.6290   F9.00
N1105  X-1.2100   
N1110 G0  Z0.1000
N1115 G1  Z-0.1400  F5.00
N1120  X-0.6290   F9.00
N1125  X-1.2100   
N1130 G0  Z0.1000
N1135 G1  Z-0.1500  F5.00
N1140  X-0.6290   F9.00
N1145  X-1.2100   
N1150 G0  Z0.1000
N1155 G1  Z-0.1600  F5.00
N1160  X-0.6290   F9.00
N1165  X-1.2100   
N1170 G0  Z0.1000
N1175 G1  Z-0.1700  F5.00
N1180  X-0.6290   F9.00
N1185  X-1.2100   
N1190 G0  Z0.1000
N1195 G1  Z-0.1800  F5.00
N1200  X-0.6290   F9.00
N1205  X-1.2100   
N1210 G0  Z0.1000
N1215 G1  Z-0.1900  F5.00
N1220  X-0.6290   F9.00
N1225  X-1.2100   
N1230 G0  Z0.1000
N1235 G1  Z-0.2000  F5.00
N1240  X-0.6290   F9.00
N1245  X-1.2100   
N1250 G0  Z0.1000
N1255  Y0.9290
N1260 G1  Z-0.0100  F5.00
N1265  X-0.6290   F9.00
N1270  X-1.2100   
N1275 G0  Z0.1000
N1280 G1  Z-0.0200  F5.00
N1285  X-0.6290   F9.00
N1290  X-1.2100   
N1295 G0  Z0.1000
N1300 G1  Z-0.0300  F5.00
N1305  X-0.6290   F9.00
N1310  X-1.2100   
N1315 G0  Z0.1000
N1320 G1  Z-0.0400  F5.00
N1325  X-0.6290   F9.00
N1330  X-1.2100   
N1335 G0  Z0.1000
N1340 G1  Z-0.0500  F5.00
N1345  X-0.6290   F9.00
N1350  X-1.2100   
N1355 G0  Z0.1000
N1360 G1  Z-0.0600  F5.00
N1365  X-0.6290   F9.00
N1370  X-1.2100   
N1375 G0  Z0.1000
N1380 G1  Z-0.0700  F5.00
N1385  X-0.6290   F9.00
N1390  X-1.2100   
N1395 G0  Z0.1000
N1400 G1  Z-0.0800  F5.00
N1405  X-0.6290   F9.00
N1410  X-1.2100   
N1415 G0  Z0.1000
N1420 G1  Z-0.0900  F5.00
N1425  X-0.6290   F9.00
N1430  X-1.2100   
N1435 G0  Z0.1000
N1440 G1  Z-0.1000  F5.00
N1445  X-0.6290   F9.00
N1450  X-1.2100   
N1455 G0  Z0.1000
N1460 G1  Z-0.1100  F5.00
N1465  X-0.6290   F9.00
N1470  X-1.2100   
N1475 G0  Z0.1000
N1480 G1  Z-0.1200  F5.00
N1485  X-0.6290   F9.00
N1490  X-1.2100   
N1495 G0  Z0.1000
N1500 G1  Z-0.1300  F5.00
N1505  X-0.6290   F9.00
N1510  X-1.2100   
N1515 G0  Z0.1000
N1520 G1  Z-0.1400  F5.00
N1525  X-0.6290   F9.00
N1530  X-1.2100   
N1535 G0  Z0.1000
N1540 G1  Z-0.1500  F5.00
N1545  X-0.6290   F9.00
N1550  X-1.2100   
N1555 G0  Z0.1000
N1560 G1  Z-0.1600  F5.00
N1565  X-0.6290   F9.00
N1570  X-1.2100   
N1575 G0  Z0.1000
N1580 G1  Z-0.1700  F5.00
N1585  X-0.6290   F9.00
N1590  X-1.2100   
N1595 G0  Z0.1000
N1600 G1  Z-0.1800  F5.00
N1605  X-0.6290   F9.00
N1610  X-1.2100   
N1615 G0  Z0.1000
N1620 G1  Z-0.1900  F5.00
N1625  X-0.6290   F9.00
N1630  X-1.2100   
N1635 G0  Z0.1000
N1640 G1  Z-0.2000  F5.00
N1645  X-0.6290   F9.00
N1650  X-1.2100   
N1655 M5 M9
N1660 M6 T2(TOOL Change 3/16 endmill)
N1665 G43 H2
N1670 G0  Z0.1000
N1675 M3
N1680  X-0.9108  Y1.0185
N1685 G1  Z-0.0100  F5.00
N1690  X-0.6440   F9.00
N1695 G2  Y0.8395  I0.0000  J-0.0895
N1700 G1  X-1.2340   
N1705 G2  Y1.0185  I0.0000  J0.0895
N1710 G1  X-0.9108   
N1715 G0  Z0.1000
N1720 G1  Z-0.0200  F5.00
N1725  X-0.6440   F9.00
N1730 G2  Y0.8395  I0.0000  J-0.0895
N1735 G1  X-1.2340   
N1740 G2  Y1.0185  I0.0000  J0.0895
N1745 G1  X-0.9108   
N1750 G0  Z0.1000
N1755 G1  Z-0.0300  F5.00
N1760  X-0.6440   F9.00
N1765 G2  Y0.8395  I0.0000  J-0.0895
N1770 G1  X-1.2340   
N1775 G2  Y1.0185  I0.0000  J0.0895
N1780 G1  X-0.9108   
N1785 G0  Z0.1000
N1790 G1  Z-0.0400  F5.00
N1795  X-0.6440   F9.00
N1800 G2  Y0.8395  I0.0000  J-0.0895
N1805 G1  X-1.2340   
N1810 G2  Y1.0185  I0.0000  J0.0895
N1815 G1  X-0.9108   
N1820 G0  Z0.1000
N1825 G1  Z-0.0500  F5.00
N1830  X-0.6440   F9.00
N1835 G2  Y0.8395  I0.0000  J-0.0895
N1840 G1  X-1.2340   
N1845 G2  Y1.0185  I0.0000  J0.0895
N1850 G1  X-0.9108   
N1855 G0  Z0.1000
N1860  X-1.0714  Y-1.0185
N1865 G1  Z-0.0100  F5.00
N1870  X-1.2140   F9.00
N1875 G2  X-1.2140  Y-0.8395  I-0.0000  J0.0895
N1880 G1  X-0.6240   
N1885 G2  Y-1.0185  I0.0000  J-0.0895
N1890 G1  X-1.0714   
N1895 G0  Z0.1000
N1900 G1  Z-0.0200  F5.00
N1905  X-1.2140   F9.00
N1910 G2  X-1.2140  Y-0.8395  I-0.0000  J0.0895
N1915 G1  X-0.6240   
N1920 G2  Y-1.0185  I0.0000  J-0.0895
N1925 G1  X-1.0714   
N1930 G0  Z0.1000
N1935 G1  Z-0.0300  F5.00
N1940  X-1.2140   F9.00
N1945 G2  X-1.2140  Y-0.8395  I-0.0000  J0.0895
N1950 G1  X-0.6240   
N1955 G2  Y-1.0185  I0.0000  J-0.0895
N1960 G1  X-1.0714   
N1965 G0  Z0.1000
N1970 G1  Z-0.0400  F5.00
N1975  X-1.2140   F9.00
N1980 G2  X-1.2140  Y-0.8395  I-0.0000  J0.0895
N1985 G1  X-0.6240   
N1990 G2  Y-1.0185  I0.0000  J-0.0895
N1995 G1  X-1.0714   
N2000 G0  Z0.1000
N2005 G1  Z-0.0500  F5.00
N2010  X-1.2140   F9.00
N2015 G2  X-1.2140  Y-0.8395  I-0.0000  J0.0895
N2020 G1  X-0.6240   
N2025 G2  Y-1.0185  I0.0000  J-0.0895
N2030 G1  X-1.0714   
N2035 G0  Z0.1000
N2040  X0.7865
N2045 G1  Z-0.0100  F5.00
N2050  X0.6441   F9.00
N2055 G2  Y-0.8395  I0.0000  J0.0895
N2060 G1  X1.2340   
N2065 G2  Y-1.0185  I0.0000  J-0.0895
N2070 G1  X0.7865   
N2075 G0  Z0.1000
N2080 G1  Z-0.0200  F5.00
N2085  X0.6441   F9.00
N2090 G2  Y-0.8395  I0.0000  J0.0895
N2095 G1  X1.2340   
N2100 G2  Y-1.0185  I0.0000  J-0.0895
N2105 G1  X0.7865   
N2110 G0  Z0.1000
N2115 G1  Z-0.0300  F5.00
N2120  X0.6441   F9.00
N2125 G2  Y-0.8395  I0.0000  J0.0895
N2130 G1  X1.2340   
N2135 G2  Y-1.0185  I0.0000  J-0.0895
N2140 G1  X0.7865   
N2145 G0  Z0.1000
N2150 G1  Z-0.0400  F5.00
N2155  X0.6441   F9.00
N2160 G2  Y-0.8395  I0.0000  J0.0895
N2165 G1  X1.2340   
N2170 G2  Y-1.0185  I0.0000  J-0.0895
N2175 G1  X0.7865   
N2180 G0  Z0.1000
N2185 G1  Z-0.0500  F5.00
N2190  X0.6441   F9.00
N2195 G2  Y-0.8395  I0.0000  J0.0895
N2200 G1  X1.2340   
N2205 G2  Y-1.0185  I0.0000  J-0.0895
N2210 G1  X0.7865   
N2215 G0  Z0.1000
N2220  X1.0715  Y1.0185
N2225 G1  Z-0.0100  F5.00
N2230  X1.2140   F9.00
N2235 G2  Y0.8395  I0.0000  J-0.0895
N2240 G1  X0.6241   
N2245 G2  Y1.0185  I0.0000  J0.0895
N2250 G1  X1.0715   
N2255 G0  Z0.1000
N2260 G1  Z-0.0200  F5.00
N2265  X1.2140   F9.00
N2270 G2  Y0.8395  I0.0000  J-0.0895
N2275 G1  X0.6241   
N2280 G2  Y1.0185  I0.0000  J0.0895
N2285 G1  X1.0715   
N2290 G0  Z0.1000
N2295 G1  Z-0.0300  F5.00
N2300  X1.2140   F9.00
N2305 G2  Y0.8395  I0.0000  J-0.0895
N2310 G1  X0.6241   
N2315 G2  Y1.0185  I0.0000  J0.0895
N2320 G1  X1.0715   
N2325 G0  Z0.1000
N2330 G1  Z-0.0400  F5.00
N2335  X1.2140   F9.00
N2340 G2  Y0.8395  I0.0000  J-0.0895
N2345 G1  X0.6241   
N2350 G2  Y1.0185  I0.0000  J0.0895
N2355 G1  X1.0715   
N2360 G0  Z0.1000
N2365 G1  Z-0.0500  F5.00
N2370  X1.2140   F9.00
N2375 G2  Y0.8395  I0.0000  J-0.0895
N2380 G1  X0.6241   
N2385 G2  Y1.0185  I0.0000  J0.0895
N2390 G1  X1.0715   
N2395 G0  Z0.1000
N2400  X-0.8790  Y-0.0000
N2405 G1  Z-0.0100  F5.00
N2410 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2415 G1  X0.5001   
N2420 G2  Y-0.3790  I0.0000  J-0.3790
N2425 G1  X-0.4999   
N2430 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2435 G0  Z0.1000
N2440 G1  Z-0.0200  F5.00
N2445 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2450 G1  X0.5001   
N2455 G2  Y-0.3790  I0.0000  J-0.3790
N2460 G1  X-0.4999   
N2465 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2470 G0  Z0.1000
N2475 G1  Z-0.0300  F5.00
N2480 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2485 G1  X0.5001   
N2490 G2  Y-0.3790  I0.0000  J-0.3790
N2495 G1  X-0.4999   
N2500 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2505 G0  Z0.1000
N2510 G1  Z-0.0400  F5.00
N2515 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2520 G1  X0.5001   
N2525 G2  Y-0.3790  I0.0000  J-0.3790
N2530 G1  X-0.4999   
N2535 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2540 G0  Z0.1000
N2545 G1  Z-0.0500  F5.00
N2550 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2555 G1  X0.5001   
N2560 G2  Y-0.3790  I0.0000  J-0.3790
N2565 G1  X-0.4999   
N2570 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2575 G0  Z0.1000
N2580 G1  Z-0.0600  F5.00
N2585 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2590 G1  X0.5001   
N2595 G2  Y-0.3790  I0.0000  J-0.3790
N2600 G1  X-0.4999   
N2605 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2610 G0  Z0.1000
N2615 G1  Z-0.0700  F5.00
N2620 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2625 G1  X0.5001   
N2630 G2  Y-0.3790  I0.0000  J-0.3790
N2635 G1  X-0.4999   
N2640 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2645 G0  Z0.1000
N2650 G1  Z-0.0800  F5.00
N2655 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2660 G1  X0.5001   
N2665 G2  Y-0.3790  I0.0000  J-0.3790
N2670 G1  X-0.4999   
N2675 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2680 G0  Z0.1000
N2685 G1  Z-0.0900  F5.00
N2690 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2695 G1  X0.5001   
N2700 G2  Y-0.3790  I0.0000  J-0.3790
N2705 G1  X-0.4999   
N2710 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2715 G0  Z0.1000
N2720 G1  Z-0.1000  F5.00
N2725 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2730 G1  X0.5001   
N2735 G2  Y-0.3790  I0.0000  J-0.3790
N2740 G1  X-0.4999   
N2745 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2750 G0  Z0.1000
N2755 G1  Z-0.1100  F5.00
N2760 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2765 G1  X0.5001   
N2770 G2  Y-0.3790  I0.0000  J-0.3790
N2775 G1  X-0.4999   
N2780 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2785 G0  Z0.1000
N2790 G1  Z-0.1200  F5.00
N2795 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2800 G1  X0.5001   
N2805 G2  Y-0.3790  I0.0000  J-0.3790
N2810 G1  X-0.4999   
N2815 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2820 G0  Z0.1000
N2825 G1  Z-0.1300  F5.00
N2830 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2835 G1  X0.5001   
N2840 G2  Y-0.3790  I0.0000  J-0.3790
N2845 G1  X-0.4999   
N2850 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2855 G0  Z0.1000
N2860 G1  Z-0.1400  F5.00
N2865 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2870 G1  X0.5001   
N2875 G2  Y-0.3790  I0.0000  J-0.3790
N2880 G1  X-0.4999   
N2885 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2890 G0  Z0.1000
N2895 G1  Z-0.1500  F5.00
N2900 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2905 G1  X0.5001   
N2910 G2  Y-0.3790  I0.0000  J-0.3790
N2915 G1  X-0.4999   
N2920 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2925 G0  Z0.1000
N2930 G1  Z-0.1600  F5.00
N2935 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2940 G1  X0.5001   
N2945 G2  Y-0.3790  I0.0000  J-0.3790
N2950 G1  X-0.4999   
N2955 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2960 G0  Z0.1000
N2965 G1  Z-0.1700  F5.00
N2970 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N2975 G1  X0.5001   
N2980 G2  Y-0.3790  I0.0000  J-0.3790
N2985 G1  X-0.4999   
N2990 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N2995 G0  Z0.1000
N3000 G1  Z-0.1800  F5.00
N3005 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N3010 G1  X0.5001   
N3015 G2  Y-0.3790  I0.0000  J-0.3790
N3020 G1  X-0.4999   
N3025 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N3030 G0  Z0.1000
N3035 G1  Z-0.1900  F5.00
N3040 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N3045 G1  X0.5001   
N3050 G2  Y-0.3790  I0.0000  J-0.3790
N3055 G1  X-0.4999   
N3060 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N3065 G0  Z0.1000
N3070 G1  Z-0.2000  F5.00
N3075 G2  X-0.4999  Y0.3790  I0.3790  J0.0000  F9.00
N3080 G1  X0.5001   
N3085 G2  Y-0.3790  I0.0000  J-0.3790
N3090 G1  X-0.4999   
N3095 G2  X-0.8790  Y-0.0000  I-0.0001  J0.3790
N3100 G0  Z0.1000
N3105 M5
N3110 M30


The probe I used inside was N/O the touch probe on the mill is N/C same with estop
also I think I had to change GlobalSet ("ProbeInve rtet",0); to 1 and then had to inverted the probe in the planer.

But all homing worked fine...

Then problem with probing was I have to run  script many times in the script edit first,
and I did check to see if the motors would jog  they did jog ok but still had to run the script before,
now to the real strange stuff when I hit the probe  button and it decided to run function ran good
but that was a hit and miss sometimes wouldn't run even after running in the script edit run.
But if it did run it would start the probe and stop when the probe was hit, and retract correctly
Like I said the only differenc e from inside the house is the inverting of the probe and estop... 

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on April 10, 2019, 08:44:47 PM
Gary :

 New version is online that fixes the FreeAxis, and also fixes the Gcode errors. Your GCode is
increment al IJK, so you ned G91.1 at the front. You should also remove the G43H1 from the code,
Auggie doesnt handle the G43 at this point and you may get strange results.

  The errors were because your postproce ssor puts out lines like N1678 X2 F60 , where mine would
put out N1678 G1 X2 F60 .. Either is legal, but a bug stopped your version from running properly.
So an error was generated after any such line. It is now fixed and your test file loads fine.

  Im still not sure why the scripts and such are acting weird. On the right side of the screen is a
Pokeys state number displayed in a single 2 digit DRO. When you press EStop youll see the
Pokeys change state .. can you tell me what the number is while your estopped and then while jogging
in normal operation . That state number may show why the scripts are failing to move. I believe it
normally shows 0 in estop and 3 in normal run condition . Also, there is a diags button on the screen
that shrinks the main screen and displays any hold condition s that are pending.. anything strange on that
screen? Does the queue depth on that screen show that commands have been queued up for motion
but are holding for some reason? Take a snapshot of it if it looks different when the script doesnt run
than when it does.

Art


Title: Re: reading Pokeys pins
Post by: gburk on April 11, 2019, 05:10:07 PM
Art

The FreeRapid  seems to work the dros move ok may stop just a tad short 4 would stop at 3.995 or 998
I don't see a command to read the dro GetFreePo s ony SetFreePo s?

Is it better to use GlobalGet("Axis3CurP os"); for the current pos or use Engine.Ge tAxisPos( 3 )

The G code works no errors at least in the one you edited I will check some others, I never edited the postproce ssor always worked in
mach3 4 so didn't bother I used cambam mostly and the mach3 post, also have used sheetcam and lazycam… and not changed there post either.
( Made using CamBam - http://www.cambam.co.uk )
( firepocke t21 8/31/2016 4:22:20 PM )
( T0 : 0.375 )
( T4 : 0.25 )
G20 G90 G91.1 G64 G40
G0 Z0.125
( T0 : 0.375 )
T0 M6
( Profile1 )
G61 G17
Error--44,  G2 X1.547 Y-0.1575 I-0.0305 J0.0
G2 X-0.695 Y0.0595 I0.0125 J0.0
What would cause the first G2 line to error
but not the second they are both the same except for the direction s and distance?

Had to run the pokeys config invert pin 19 probe.
And use the  GlobalSet("ProbeInve rt",0); set to 1 for probing down Z not sure if that was your original plan or it maybe doesn't how you set it ?

If I hit EStop I get the value 3 on and 0 off
when I press the Z probe button I still get all the info from the probing function printed to screen but no motor movement and no dro change either
in the diags Queue I get 0 as the value nothing changes..
Now if I run the script first the motors move and the dro's move and the only change now in the diags  is that the Queue now = 1 and also the hold for all still LED flashes..
these are the only changes I see..

Thanks Gary

 


Title: Re: reading Pokeys pins
Post by: ArtF on April 11, 2019, 08:24:24 PM
Hi Gary:

  Ill run a check on that code and see.

>>Had to run the pokeys config invert pin 19 probe.
>>And use the  GlobalSet("ProbeInve rt",0); set to 1 for probing down Z not sure if that was your original plan or >>it maybe doesn't how you set it ?

  Auggie  assumes the probe is normally open. If it sees a state of 1 it figures thats a hit. If the probe is normally closed, then the setup for ProbeInve rt should be set to true in the config/planner.

GlobalSet("ProbeInve rt",0) sets the probe to the config settings, GlobalSet("ProbeInve rt",1) sets the probe to the opposite of config settings. So if it seems backwards to you, just set ProbeInve rt to true in the config, then you wont have to set the global inversion which is only meant for probeing off really..

  I still cant think of why your motion doesn't occur by button. It may be the gcode is in G80 mode.. Try a g1x0
in the single line mdi to see if the button then works.. Ill run some tests as well, but I cant see duplicate that one yet..

Art

 


Title: Re: reading Pokeys pins
Post by: ArtF on April 11, 2019, 08:37:00 PM
Gary:

>>this code..

( Made using CamBam - http://www.cambam.co.uk )
( firepocke t21 8/31/2016 4:22:20 PM )
( T0 : 0.375 )
( T4 : 0.25 )
G20 G90 G91.1 G64 G40
G0 Z0.125
( T0 : 0.375 )
T0 M6
( Profile1 )
G61 G17
Error--44,  G2 X1.547 Y-0.1575 I-0.0305 J0.0
G2 X-0.695 Y0.0595 I0.0125 J0.0

  This code doesnt have a starting point. There is no G0 or G1 prior to the G2's, so Im assuming
the start position is 0,0. In which case the g2 is not an increment al arc. The line fails with
an error -44 ( arc radius to start != arc radius to end.).  Im not sure whats causing that to fail..
is it a snippet of other code? Its an unusual start..

Art


 


Title: Re: reading Pokeys pins
Post by: gburk on April 12, 2019, 11:47:30 AM
ok art

I just took a similar dxf file and ran it though sheetcam it had
quite a few lines that didn't start with g0 or g1 only x-1 y1 or started with Z1
and auggie seemed to read it fine...

I fist gcode file I showed you I don't remember what I created it with its date was 2008. I did use D2nc for a few cam files I may have used that..

the cambam one was i just created also...

i'll keep messing with it I don't see anywhere in the post to change the lines with no g0 or d1 to be created..

I tried the dialog again I think for some reason its not closing or being killed after I have run though the 2 dialogs and closed them with a ok or cancel button
I can't rewind the m6 call, tried stop and rewind but on go I have to hit estop first then I can rewind and run the m6 line again...

let me know if you find anything on the running the scripts first.. if you need any other info let me know also..

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on April 12, 2019, 02:04:52 PM
Thanks Gary:

 Ill run some tests. You dont normally need a g1 before an arc, but all arcs have a starting
position , so unless the start position is 0,0,z you need one. The arc in that particula r
file does have a start specified, and 0,0,z doesnt make sense in that arc. The reason the
second one didnt error out, is that the prior position was set as the end of the first illegal
arc, so the next arc is fine. Only the original arc fails due to wrong start position.

Ill keep looking for why the scripts may do that.. and Ill take a look at the dialog, sorry
but I hadnt yet looked into that one..
Art
 


Title: Re: reading Pokeys pins
Post by: ArtF on April 12, 2019, 02:29:56 PM
Hi Gary :

  Looked at your dialog code.. comments below after >>'s

// Library Toolwait
// Created  Thursday, April 04, 2019
// Author  Gary       -- Do not edit above this line
 
 //  Enter Global vars below this line.
//  the librarian no matter where they are, but its easier
//  to find and edit them in one spot.
   
   
   
 //The 6 lines previous to a function will appear as 
 //comments to help users to understan d the parameter s   
 //required for use by each function, so try to   
 //always add as clear a set of instructi ons in these 
 //lines as an aid to fellow traveller s.   
 // 
global WaitDialo g = Dialog();                                         
global ToolWait = function()   
{
   if ( WaitDialo g != null )
   {
     if ( WaitDialo g.IsOpen() )
    {
      return;
     };
   };   
   WaitDialo g.SetRect ( 25, 20 );
   WaitDialo g.SetTitl e( "Manual Tool Change " );
   WaitDialo g.NextPos ition( 5,5,80,50 );
   WaitDialo g.AddStat icText( " Manual Tool Change now Jog to a safe X Y Z Position");
   WaitDialo g.NextPos ition( 5,15,80,50 );
   WaitDialo g.AddStat icText( " After new Tool is Inserted  PRESS Touch OFF Z");
   WaitDialo g.NextPos ition( 40,50,60,70 );
    WaitDialo g.SystemB uttonsOnO ff(false);
    WaitDialo g.AddButt on("Touch OFF Z","MyToolCha nge");
    WaitDialo g.DoModel ess("none");
};

 >> OK, end of function ToolWait. .
 
global ProbeErro rDialog = Dialog();
global MyToolCha nge = function()
{
   Touch_OFF = ZTouchOFF();
   yield();
   print("Touchoff4 "+Touch_OFF);
    if (Touch_OFF == -1 || Touch_OFF == -2 || Touch_OFF == -3 )
   {
     if ( ProbeErro rDialog != null )
     {
        if ( ProbeErro rDialog.I sOpen() )   
                                                       
       {
            return;
       };
    }; 
  global ProbeErro rDialog = Dialog();
  ProbeErro rDialog.S etRect( 15, 10 );
  ProbeErro rDialog.S etTitle( "Probe Error " );
  ProbeErro rDialog.N extPositi on( 5,5,80,50 );
  if (Touch_OFF == -2)
  {
    ProbeErro rDialog.A ddStaticT ext( "Error Probe not HIT Try jogging closer to Part");
  }
   else if (Touch_OFF == -3)
   {
     ProbeErro rDialog.A ddStaticT ext( "Error Probe");
    }
     else if (Touch_OFF == -1)
     {
      ProbeErro rDialog.A ddStaticT ext( "Error Probe not known");
     };
   ProbeErro rDialog.D oModal("none");
   return;
  }
  return;
};

 >>It all looks good. But its hard to say why it doesnt return. Id do a couple things..
 >>First, Id try a DoModeles s on the error dialog, it may be doing a modal from within a modeless
>> that is killing you. The yield probably isnt necessary, Id make it a Block("MotionSti ll") instead,
>>it should be more reliable to the situation al wait in this case. At what point does it lose it?
>>Does it ever open the error dialog?

Art


Title: Re: reading Pokeys pins
Post by: gburk on April 12, 2019, 08:30:06 PM
Art

Yes the error dialog does run

>>First, Id try a DoModeles s on the error dialog, it may be doing a modal from within a modeless
Tried DoModel when first dialog run and I hit Ztouch off button  I let it run till z max down distance so it errors out
Now the error dialog is displayed I hit ok, and don't close the original dialog and hit touch off z it runs to end and errors out
this time the error dialog doesn't display, and same problem I have to estop to rewind the m6 t3 call..

if I use DoModal I get the exact same results except when I run the Ztouch off button for the second time when it errors out I
get the error dialog now, but it displays 2 ok buttons and 2 cancel buttons weird! still have to hit estop to rewind..

>> that is killing you. The yield probably isnt necessary, Id make it a Block("MotionSti ll") instead,
Ok

>>it should be more reliable to the situation al wait in this case. At what point does it lose it?
Ok, can't tell where its loosing it most of the time it runs to end and all dialogs look closed at least not being displayed on the screen just no rewind till estop.
no errors messages from auggie..

>>Does it ever open the error dialog?
Yep stated above :o

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on April 13, 2019, 06:17:50 AM
Gary:

   The dialog problem may have do with scope. A dialog really should
be deleted after use. But a global isnt, and I suspect a modeless isnt
either. Normally, in script the variables are deleted when the script
ends or during a clean up cycle when it finds its too full of unused
variables . Im not sure what happens with modeless or as in the following code..

global ProbeErro rDialog = Dialog(); //so a global definitio n of a ProbeErro r dialog,
                                                    //this will stay in scope andnever go away till
                                                    //scripts are reset.
                                                    //Id get rid of this line

global MyToolCha nge = function()
{
   Touch_OFF = ZTouchOFF();
   yield();
   print("Touchoff4 "+Touch_OFF);
    if (Touch_OFF == -1 || Touch_OFF == -2 || Touch_OFF == -3 )
   {
     if ( ProbeErro rDialog != null )
     {
        if ( ProbeErro rDialog.I sOpen() )   
                                                       
       {
            return;
       };
    }; 
  global ProbeErro rDialog = Dialog();  //another definiton of the same, may have
                                                       // bad effects , perhaps this shouldnt be
                                                       //global.
  ProbeErro rDialog.S etRect( 15, 10 );
  ProbeErro rDialog.S etTitle( "Probe Error " );
  ProbeErro rDialog.N extPositi on( 5,5,80,50 );
  if (Touch_OFF == -2)
  {
    ProbeErro rDialog.A ddStaticT ext( "Error Prob

.....

ProbeErro rDialog.D oModal("none");
   return;

}  //if not global the error dialog should now be closed and deleted so it can
be made again..

    With ProbeErro rDialog being non global, it should be deleted when the script ends. So Id call it ( the errorDial og ) as modal and then it will return to the calling script, and finally be deleted at end of script... . or so the theory goes..
I dont think Id make the error dialog global as its fully made and init'd in the call to it.
    Modeless calling is likely what is causing the strangnes s, I will look in the
code to see how the destructi on works, but generally global's are never deleted.
 Using Dialogs in Windows has similar effects at times depending on when you create them, and how you deleted them.

Art



Art



Title: Re: reading Pokeys pins
Post by: gburk on April 13, 2019, 04:04:20 PM
Art

Tried the errordial og as not global I think your right its closing now and I don't get the 2 oks and cancel buttons showing up on a second call to errordial og.
But the problem with the m6 call still there I have to hit estop to rerun the m code. the stop or rewind don't react till the estop is reset...

What is the command to read the ok and cancel buttons to see which one was pressed?

Curious What program you using for cam?

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on April 13, 2019, 08:05:48 PM
Hi Gary:

>>Curious What program you using for cam?

  I usually use Vectric for my mill, I use Vexx for Gcode for my laser generally, but I sometimes just code up a routine to give me what I want on a one off basis.

>>But the problem with the m6 call still there I have to hit estop to rerun them code. the stop or rewind don't react till the estop is reset...

   It seems to me the basic macro for m6 does a pause after its call, it requires one to press run again to start the program after the toolchang e. Perhaps there some interplay there.

>>What is the command to read the ok and cancel buttons to see which one was pressed?

  There is none. All dialogs are based on scripts for any object or button you place. The system buttons of OK or Cancel are typically handled by the return value.
  Ill have to check , but usually the return from a DoModal is checked to see if
its a 1 or zero. If 1, it was OK, if 0 it was cancel. There is no real feedback in
a do Modeless, and cancel or OK is usually enough, you dont need both as each do
basically the same thing..

Art







Title: Re: reading Pokeys pins
Post by: gburk on April 13, 2019, 09:12:07 PM
Art

>> It seems to me the basic macro for m6 does a pause after its call, it requires one to press run again to start the program after the toolchang e. Perhaps there some interplay there.

I think you may be right, there is a delay before my dialog loads seems like a few sec's maybe less haven't timed it, but seems to continue without the keypress I will check further .

I have another strange problem, only seems to happen in the probing lib, if I try to use a global table I have created in another lib, I get a compile error
I have a global Zreturn = table(-1,-2,-3,-4,-5,0,0); I can do most anything with the table in other library's but not the probing
if I just do a myreturn = Zreturn; I will get a compile error.. I can't see any reason for it the probe script runs fine and compiles till I try any call to one of my global tables.

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on April 14, 2019, 07:07:01 AM
Gary:

>>Zreturn = table(-1,-2,-3,-4,-5,0,0); I can do most anything with the table in other library's but not the probing if I just do a myreturn = Zreturn;

  Is the myreturn variable declared previousl y as anything other than a table?
I dont use tables generally, so I'm not much of an expert on how monkey-script
handles them.  If the compilati on fails on that line, I would think its
having trouble convertin g the table to Zreturn because it sees them as
incompati ble for some reason. If Zreturn hasnt been seen, then it will
auto convert to a table variable. 
  As Auggie resets it first loads the libraries and executes them all in order
to set global variables as global. The second time through it can then use
those variables for compilati on of the various scripts. If the checkmark s in the
library are on, and none of them have changed to X's, then the library is
signallin g its satisfies that everythin g looks good. Whenever you check in a library
make sure it shows up with a checkmark on it, not an X.. (just a note..)

  So Im not sure why you'd get a compilati on error just on that one usage
of the variable.

  As to the pause in the M6, if you check the toolchang e script in the system
library you may find a Stop call or some sort of wait that is making it pause till
run is pressed again. I seem to remember doing that so I could always just
press run again after a tool change. I believe M6 is one of those controls
that is scripted in system lib to perform the way I like, but it may not match
what you may want to do.. Perhaps the two are conflicti ng?

Art

 


Title: Re: reading Pokeys pins
Post by: gburk on April 14, 2019, 08:15:20 AM
 >>Is the myreturn variable declared previousl y as anything other than a table?

No not declared more that once, the strange thing I can use it  any other lib
Even if I try to create a new variable table say with any random name in the probe lib it gives a compile error and soon as I run it..
I want to be able to return 2 values from a probing function and I though you said a table was the only way,

Zreturn does create in a different lib but still can't use in the probe lib even a whattable = Zreturn[0]; would error
 
>>make sure it shows up with a checkmark on it, not an X.. (just a note..)
funny thing is No X's

>>So Im not sure why you'd get a compilati on error just on that one usage
>>of the variable.

global ProbeRetu rn = table(0,0,0,0);
Ok exact error is script fails compilati on
check back in and No X's for any lib's, bring back to in to edit global table still there try running again and get same error
Endless its reporting a false error

>>  As to the pause in the M6, if you check the toolchang e script in the system
>>library you may find a Stop call or some sort of wait that is making it pause till
>>run is pressed again. I seem to remember doing that so I could always just
>>press run again after a tool change. I believe M6 is one of those controls
>>that is scripted in system lib to perform the way I like, but it may not match
>>what you may want to do.. Perhaps the two are conflicti ng?

I changed most of the M6 function commands but off the top of my head there may still be a Stop Engine in there I will look...

I did remove the call to my dialog from the m6 and it seemed to run fine, stop and rewind were ok didn't have to estop
So looks like its something to do with the dialog getting something in auggie stuck or messed up but I can't see where
all the dialogs close just can't rewind or run again till estop hit.

Gary

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on April 14, 2019, 10:02:04 AM
Gary:

>>I want to be able to return 2 values from a probing function and I though you said a table was the only way,

  Well, there are other ways. You can just use two global values at the top of the script so
any function can set them. Its why I dont use tables, Im lazy and tend to just use
Global variables . I tend to use the script editor itself when developin g anythign complex, it has better erros and debugging so you can see in realtime what the problem is with compilati on and fix it. Using the script tab you dont get as much debug info on whats
going on.

    My use of dialogs has been restricte d to ones showing videos or asking for an entry so
Im not sure of all the interacti ons with the system , your touring unknown country
for the most part.   The script editor may help in identifyi ng whats wrong with the
compilati on at least..

Art


Title: Re: reading Pokeys pins
Post by: gburk on April 14, 2019, 11:58:15 AM
Art

I removed     //Engine.StopProgram(); line to test that didn't make a differenc e still no stop rewind.

Maybe you have another way to stop and wait for input and get input...

I don't see any other way to do the manual tool change and then do a touch off with the new tool and then reset the Z position. . to the new tool Hight..

I will try to run it though the script editor debugger and see what I find

if you are retuning 2 global variables i'm not sure how, as far as I can tell the return statement will only return 1 value return x,y; doesn't seem to work..
if it's a global table I can return all the values.

Just a quick update I am going to assume its the script edit run , somehow seems that's the problem, I put the line global TestRetur n = ProbeRetu rn; at the beginning of the probe library and a print(TestRetur n[1]);,  ProbeRetu rn has been declared as a table in another library I get compilati on error from the script edit when I hit run.
Now if I run the same code in the scripter debugger I get no compilati on errors and the correct value printed -2 form TestRetur n[1]
So This one I have no idea, I leave this one for you.
   
Getting strange behavior when trying to run  some Gcode when I load the gcode I get no errors, when I run it I cutter comp errors and compile errors, the code runs at the to and  after first t4 m6, it stops, and I hit run it runs, but the second tool change it stops and I get the dialog continuin g job stopped at it shows the work and mach coordinat es and  what line to continue from I can enter any line number and then it seems to be running but gcode never continues past the tool change line...
Now if I stop all and rewind it seems that the Z axis gets lost if I click on the Z axis DRO to change to number 1.0 it changes to 0.0 if I change it to 2.0 it changes to 1.0
and so on... most of the time its 1 off the value I enter but only after running the gcode file..

I assuming auggie doesn't like g40 g41 ?


Gary


Title: Re: reading Pokeys pins
Post by: ArtF on April 14, 2019, 09:15:36 PM
Hi Gary:

>>I removed     //Engine.StopProgram(); line to test that didn't make a differenc e still no stop rewind.
>> Maybe you have another way to stop and wait for input and get input...
>>I don't see any other way to do the manual tool change and then do a touch off with the new tool and then reset >>the Z position. . to the new tool Hight..
>>I will try to run it though the script editor debugger and see what I find

    No, I think the script dialog for input should work. IF the scripter doesnt help, zip up all
your script library and Ill see if I can simulate it here.

>>if you are retuning 2 global variables i'm not sure how, as far as I can tell the return statement will only return 1 >>value return x,y; doesn't seem to work..
>>if it's a global table I can return all the values.

  You dont need to return globals, you just set them..

global MyProbeX = 0;
global MyProbeY = 0;

global MyProbe function()
{
...
...
  MyProbeY = 10;
  MyProbeX =  5;
}

global SomeOther Function = function()
{
   if( MyProbeX == 10) ....
}

  Any other script will now see the two variables as 10 and 5, nothing has to be returned. Thats
why I tended to use them as it was easier to simply declare a bunch of globals and not worry about returns.

>>Just a quick update I am going to assume its the script edit run , somehow seems that's the problem, I put the line global TestRetur n = ProbeRetu rn; at the beginning of the probe library and a print(TestRetur n[1]);,  ProbeRetu rn has been declared as a table in another library I get compilati on error from the script edit when I hit run.
Now if I run the same code in the scripter debugger I get no compilati on errors and the correct value printed -2 form TestRetur n[1] .So This one I have no idea, I leave this one for you.

 Hmm , sounds like the script using ProbeRetu rn is being installed before the one that declares it. Ill have to do some checking to see how that can happen, the system loads twice to catch such things. IT might be best to simply send me your libraries and see if I can make them run. Might show me why its off..
   
>>Getting strange behavior when trying to run  some Gcode when I load the gcode I get no errors, when I run it I cutter comp errors and compile errors g40 g41 ?

  Its part of Auggies spec that it doesnt do cutter comp. G40,41 will cause errors and failures. It's whole design was
to try to eliminate the things most cnc hobbiests dont use and add things that others couldnt do. Cutter comp
is large enough a ball of worms it was left  out purposely .

Art


Title: Re: reading Pokeys pins
Post by: gburk on April 15, 2019, 09:37:02 AM
Art

I can't even declare the  global MyProbeX = 0 at the start of the probing lib I get the same error as the table, I will try it in a different lib and see if I can change it in the probe function. ..

I changed the post processor not to use g40 41 42 and 43...

but I get strange errors the gcode loads ok and look right in the display, but I will get an error script fails compilati on same message will display 4 or 5 time
log shows
27:46:292  Script fails compilati on.
27:46:292  See log for errors.
27:46:308  error (1) parse error, expecting `';''

it doesn't happen with all gcode files...
also still seems to get stuck on the second t4 m6 call seems like every thing gets lost there and if I hit run it will jog and when finished jogging then jogs back and stops for a tool change again its back on the same line, will not continue past the second m6 line..

I setup a global var in another lib it compiles ok
now I put this in the Zprobe function  and get the compilati on error still
ZprobeRet urnPos = GlobalGet("ProbePos2");
almost seems like I cant call any global var form that function. .

Update may have fixed using global in the probing lib, haven't seen this one yet but first time for everythin g  it may have been a bad keyboard noticed some strange things happening when hitting keys swapped out the key board and now I can add global's to the probe lib...

thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on April 20, 2019, 05:01:11 PM
Code:
Hi art

Have a macro question I assume auggie doesn't use g83 peck drilling....

so I created a macro G888 to do peck drilling it works but when I am done and exit the G888 function the go code stops and doesn't continue to next line
I put a Engine.StopProgram and it will return to the next line in the g code but it sits and waits for the run to be pressed is there a way around that..

Also is there a way to stop the dialog that pops up at tool changes and seem to popup at other times I hit the run.. it must be built into auggie it show the work and mach cords and ask line # to run from..

Here is the code

[codeglobal DrillPeck = function(x,y,z,s,r,d)
{
  for( pecking = 0; pecking <= d; pecking+=s)
  {
   print("Peck Drilling X "+x+" Y "+y+" Z "+z+ " R "+r+" S "+s+" D "+d+" Pecking = "+pecking);
   Engine.GCode("G90 G01 Z-"+pecking);
   block("MotionStill");
   Engine.GCode("G91 G01 Z"+r);
   block("MotionStill");
  };
  yield();
 Engine.StopProgram();
};
 
global GCode888 = function()
{
   print( "GCode peck drill is being executed. ");
   print( "The following paameters were on the line.");
   print( "-999999 means the parameter was not used.");
   print("X:" + ParmsXYZ[0] + " Y:" + ParmsXYZ[1] + " Z:"+ ParmsXYZ[2]);
   print("AQL is :" + ParmsAQL);
   print("PRI is :" + ParmsPRI); //P Step distance // R Retract Hight
   print("JKD is :" + ParmsJKD);
   print("UVW is :" + ParmsUVW[0] + ", " + ParmsUVW[1] + ", " + ParmsUVW[2]);
   print("H is :" + ParmsH[0]);  //H max Z distance down
  DrillPeck(ParmsXYZ[0],ParmsXYZ[1],ParmsXYZ[2],ParmsPRI[0],ParmsPRI[1],ParmsH[0]);
};

And in the gcode call like this

T7 M6
( Drill1 )
G17
M8
M3
G888 X-0.4456Y-0.5138Z0.4456P0.03R0.250H.125 (P = peck distance R = Retract Distance H = Distance to Drill)
G888 X0.4384Y-0.5138Z0.4456P0.03R0.250H.125
F10.0
M9
( Drill2 )
G0 Z0.125
( T6 : 0.25 )
T6 M6
M8
M3
G888 X0.4384Y-0.5138Z0.4456P0.03R0.250H1.0
G888 X-0.4456Y-0.5138Z0.4456P0.03R0.250H1.0
M9]


Also is there a way to have auggie invert the estop so pokeys config doesn't have to be run switches get changed from no or nc,
and also with the probe if the probe pin 19 get inverted to also change the GlobalSet("ProbeInve rt",0); so now ProbeInve rt 0 would be inverted so if using probe that n/closed and then switch to a touch plate that may be n/open you wouldn't have to go into the script every time and change ProbeInve rt 0 to 1 or 1 to 0..
make any sense sometimes my expiation s are a little cloudy, maybe all the time..

Thanks gary 


Title: Re: reading Pokeys pins
Post by: gburk on April 25, 2019, 10:57:23 AM
Hi Art

I modified the post processor in sheetcam and that seems to be working ok in auggie the only time I seem have trouble is during a tool change m6 call and I think it has something to do with the dialog that auggie displays and it looks like it has saved  x y z positions not current positions and when you hit ok to continue it is jogging to those positions sometimes the z would be to low so on the next move the tool could break off..

But it looks like I don't need the peck drill script with sheetcam , I will need it with cambam…

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on April 28, 2019, 07:25:23 AM
Hi Gary:

 Sorry for the delay, my developme nt computer blew its OS drive this week. Ive just now
come back up to snuff..

 Ill take these one at a time..

>>27:46:292  Script fails compilati on.
>>27:46:292  See log for errors.
>>27:46:308  error (1) parse error, expecting `';''
>>it doesn't happen with all gcode files...

   This does sound like a script error in syntax somewhere . Id advise trying single line Gcodes
until you knbow what causes it. If the M6 causes it for example, look to all scripts called
by M6 and call them in the script window till we know which one exactly is missing the ";"
 

>>I setup a global var in another lib it compiles ok
>>now I put this in the Zprobe function  and get the compilati on error still
>>ZprobeRet urnPos = GlobalGet("ProbePos2");
>>almost seems like I cant call any global var from that function. .

  and ZprobeRet urnPos  is defined as a global in an earlier file? Ill do some checking on the order
of execution .. But finding the ";" syntax may solve it, if the syntax error is found in the file, it may
have stopped the global from being defined. A syntax error is a non recoverab le fault for that file.
This may be a clue the bad script is in the same file as the global?
 

Art


Title: Re: reading Pokeys pins
Post by: ArtF on April 28, 2019, 07:42:10 AM
Gary:

>>Also is there a way to stop the dialog that pops up at tool changes and seem to popup at other times I hit the run..

  That would be the "continue" dialog. It doesnt pop up unless it senses the current position
is not properly registere d as a start position. Let me check to see why it pops up on you,
I never see it unless I stop a program and tell it to restart. I think the M0 may be stopping
the program without regard to continuin g, it may instead need an M1 which  should tell
it to stop temporari ly ( pause) till its told to run. Running from stop will open
a continue dialog as its not sure where your starting from.

>>Also is there a way to have auggie invert the estop so pokeys config doesn't have to be run switches get changed from no or nc,

   The polarity of the Estop switches are set by the Pokeys. I use whatever it is set to. If the pokeys software is expecting a no, thats what Auggie uses. If its mismatche d with Mach3, I suspect Mach3
must override the settings of the Pokeys engine, or the engine setting is ignored in Mach3. To fix this
you should only have to open the Pokeys software, chck the setting of "Invert Estop" on that page so
that the estop works and resets properly. At that point Auggie should see the same thing.


>>and also with the probe if the probe pin 19 get inverted to also change the
 GlobalSet("ProbeInve rt",0); so now ProbeInve rt 0 would be inverted so if using probe that n/closed and then switch to a touch plate that may be n/open you wouldn't have to go into the script every time and change ProbeInve rt 0 to 1 or 1 to 0..make any sense sometimes my expiation s are a little cloudy, maybe all the time..

  In Auggie, you set the probe to whether its normally Open or closed with the planner setting of "ProbeInve rt", this isnt the same as the script setting. The planner setting in the config basically
tells Auggie if you want "normal" out of the box behaviour to be be a contact of normally open
or normally closed.

  The Script Call to GlobalSet("ProbeInve rt",true) is a different setting, it means to now
use the opposite of the planner setting. In other words you use it to temporari ly swap
the pins so that you can probe off a plate instead of probing to it. After that move youd
then tell it GlobalSet("ProbeInve rt",false) to set it back to "normal" which is whatever the
config planner setting is. So setting the planners config of "ProbeInve rt" is the way to
set the normal condition . The last script call setting is forgotten upon restart.

  Ill check the code this week to find out how to properly pause a program instead instead
 of stopping it. I think the continue dialog occurs if the postion at last stop changed
prior to hitting run, but Ill check to be sure.

Art





Title: Re: reading Pokeys pins
Post by: ArtF on April 28, 2019, 11:03:38 AM
Gary:

  In looking into why the "Continue" dialog opens after your scripts I figured Id explain how it work.

When you press run there are quite a few different things that will happen depending on context. IF the Tab window is on scripts for example it runs the script, if on MDI, it runs depending on the tab as to if its
single line or multiple line MDI . In Gcode though, it does a few checks. If your last end point is the same as the current start point, then it wont open the "continue" window. If it senses though, that you are in
a different coordinat e that when you last ended a move, it will bring up the "continue" dialog to ensure
a smooth motion to the start of the move. This is in case you have jogged or something .

  This is why in a default M6 call, the tool changes, the system waits for a run to be pressed in
order to start up on the next gcode line when RUN is pressed, and when you press RUN, the
dialog doesnt open, it just runs.

  In your case, your moving the coordinte s , so the system thinks your starting from a new
location. Try adding a Gcode("g1...") call to your new coordinat es (( in essense a non move)
which will set the system so it thinks the last end was your new coordinat es. When you next press
run the dialog shouldnt open.

  I will add a command I think to disable the "continue dialog", or find soem way to properly
sync the last move so you wont have it open. I call to the planners sync() routine would stop
it from happening so it may be I only need to add a Sync Command after coordinat es
have been changed. 

Thx
Art


Title: Re: reading Pokeys pins
Post by: gburk on April 28, 2019, 01:41:32 PM
Hi Art

Glad to here you are up and running again...

I will try one thing at a time I think I keep getting ahead of my self OCD!

As for the Continue dialog it only pops up during a M6 Tool change, and right now I have removed any scripts I was working on for M6 calls and I am using only the ones you had in the scripts.. maybe be easier to trace down..

hers an example of what continue dialog displays on the very first M6
Mach cord X -0.4450 Y -0.6963 Z -0.3312 A 0.0000
Work cord X 0.0000 Y 0.0000 Z 0.0000 A 0.0000

auggies DRO's show X = 0.0000 Y = 0.0000 Z = 0.5000

I sent the Z axis to .5 before the M6....

As far as what's script is causing the ; error I don't know here is a clip from the error file. it error as soon as the g code is loaded seems like its in the screen regen
The image looks correct on the screen not messed up, looks like the correct tool path I guess is what I meant to say..

 15:56:507  --System -- User has Regened the toolpath. 
15:56:585  Script fails compilati on.
15:56:585  See log for errors.
15:56:600  error (3) parse error
15:56:600  error (3) parse error
15:56:600   Script OnRegen() Called
15:56:600  error (1) parse error, expecting `';''
15:56:600  Script fails compilati on.
15:56:616  See log for errors.
15:56:632  error (1) parse error, expecting `';''
15:56:632  Script fails compilati on.
15:56:632  See log for errors.
15:56:647  error (1) parse error, expecting `';''
15:56:647  Script fails compilati on.
15:56:663  See log for errors.
15:56:679  error (1) parse error, expecting `';''
15:56:741  Script fails compilati on.
15:56:741  See log for errors.
15:56:757  error (1) parse error, expecting `';''
15:56:772  Script fails compilati on.
15:56:772  See log for errors.
15:56:804  error (1) parse error, expecting `';''
15:56:819  Script fails compilati on.
15:56:819  See log for errors.
15:56:835  error (1) parse error, expecting `';''
15:56:866  Script fails compilati on.
15:56:866  See log for errors.
15:56:897  error (1) parse error, expecting `';''
15:56:929  --System -- User has Regened the toolpath. 
15:56:929  GCode file loaded.
15:56:929  Processin g Paths

do you think not having a space between line number and g code could be a problem example
N220G00G4 3Z0.8000H 2
or space
N230 S2500M03

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on May 01, 2019, 12:56:27 PM
hi art

Have a thought on what maybe part of the problem with having to run the LIB script first before it works...

I have the tool script with 16 buttons only testing on button one right now..

If I boot auggie and press tool button 1 the only thing in the script that runs are the freeaxis's I have a Engine.Fr eeRapit(null,4,4,null); and also a Engine.Ra pitTo(2,2,2,null); the free axix's dro's run up to 4 4 the X Y Z axis's show no movement. .. no dro's moving...

Now if I run the script in the edit run all axis's move... Not sure if this helps at all but just something I am seeing going on... and it looks like the script was compiled on boot up..

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 03, 2019, 05:55:32 AM
Gary:

>>N220G00G4 3Z0.8000H 2

  Spaces shouldnt matter. But the G43 could trip an error.  G43 is not yet implement ed for use, its there and will take the H2 to mean 2mm offset to the Z height, not add the tool#2 height. As there is no tool table,
G43 wont work the way it will in Mach3 for example.

   Do the script ";" errors only happen in certain gcode programs? If so, post the Gcode
so I can test that to see why the error.  It does look as if that error is related to some script
that is failing.

>>g to run the LIB script first before it works...

  It sounds as if the script is fine, but for some reason your motion is inhibited after you
start up. Since the freeaxis are running, the script must be. SO we need to figure out
why the main axis are ignoring your calls, and not tripping an error.

 Are your tool buttons in one library file folder of their own? Can you zip it up so
I can simply unzip that folder to add it to my own? If so perhaps I can test
it that way to find why that weird stoppage at first.
  Have you found doing anything else fixes it? Does , for example, loading and
running a Gcode program that doesnt use any of your scripts first, then allow
the scripts to run right away?

Art
 



Title: Re: reading Pokeys pins
Post by: gburk on May 03, 2019, 04:09:37 PM
Ok at I attached more than you asked for but what the heck

my panels and scripts also the gcode I have been having a problem with..
you are right not having a space between the line numbers didn't matter I have them spaced in the copy of the gcode.

yes they are in a library of there own..

I don't think any of the gcode use's any of my scripts except m6 and I have shut that lib off and was just using the you library calls...

I don't think I will be able to use any m6 call from my library endless  I can turn off your dialog that pops up on most of the m6 calls so if I use the dialog I created and it pops up so does yours and that makes things not react as I would like not sure but your dialog is sending the axis's other that were I would like to go with mine..

also when the auggie first boots should it display the message system reset scripting two times?.

also one thing I just realized is when I call the tool button script and the free axis starts running the e stop is off that doesn't seem right to be runing the free axis without turning on the estop this could be a disaster. ..

did a little more testing and the free axis only runs in simulator mode but not the x y z with the rapid moves with the button press - endless the script is run first
now in motion mode only the x y z run and not the free axis's with the same button press script and doesn't matter if you run script first still no free axis move..
still get buffer under run error


Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 06, 2019, 08:08:46 PM
Hi Gary:

 Thx, just got the files, Ill see whats up tomorrow. Just had my floors sanded so I was kicked out of home
for a few days till they dried.

>>also when the auggie first boots should it display the message system reset scripting two times?.

  Yes, its a bit of a trick. The first time its finding globals and such used by other files, it allows globals
to be seen by files that use them before they are declared.
 
>>still get buffer under run error

   Thats usually when you exceed 125Khz the Pokeys is maxed for.. but give me a couple days
and Ill know more about your scripts.

Art


Title: Re: reading Pokeys pins
Post by: ArtF on May 06, 2019, 08:16:00 PM
Gary:

   I think I see many of your script  errors. Many lines of the Gcode header include lines
such as

{0.25 inch} in the comments. In Auggie , when it see's a {} in the code, it thinks your
adding a Cscript. Scripts can be mixed with Gcode in Auggie by adding any script call
or special function to the file inside {}'s.

 However.. these are inside a comment, and I will see about turning off
script recogniti on inside a comment block. I hadnt had that error prior
to now so didnt see it.  The errors though wont affect the run, they just
trigger a lot of warnings while loading the file. Ill fix that little bug up first.

Art


Title: Re: reading Pokeys pins
Post by: ArtF on May 07, 2019, 11:11:11 AM
Gary:

   Ive fixed the scripting errors on load, Scipt "{}"s will be ignore if inside a comment.

I need your screenset to test with your dialogs though. I have your panels, but in the Screens folder
should be the screen you have setup using those panels.Ca n you drop it here?

Thx
Art


Title: Re: reading Pokeys pins
Post by: gburk on May 07, 2019, 05:50:56 PM
Ok Art

Here's the screen

Hope this helps...

I see the {} in the gcode so it's not being ignored event though it's inside () I think that  I used victric to generate that gcode I looked at cambam and sheetcam it doesn't look like they put the {} anywhere in the gcode
I removed the {} from victric's post processor so shouldn't add to gcode now..

I know the scripts are a mess keep adding and changing so go easy on me :)

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 07, 2019, 07:42:55 PM
Gary:

 I haven't updated the program yet on the web, so only after next release will it ignore the {}'s.
Ill keep back any release till Im finished analysing your screen..

Thx
Art


Title: Re: reading Pokeys pins
Post by: ArtF on May 08, 2019, 07:05:18 AM
Gary:

 I just uploaded Auggie 3.6b , test it and see what it foxes and what it doesnt.

  You shouldn't get that dialog anymore, it will skip that call if the axis position was just changed
by a script call such as your scripts. The Dialogs will not have any more than 1 OK and cancel
button combinati on.  I dont seem to have a problem getting motion right off if I press for a Z-Touch
or such. Let me know whats going on and we'll go from there.

Thx
Art


Title: Re: reading Pokeys pins
Post by: gburk on May 08, 2019, 01:55:05 PM
Art

I Still seem to have to run the scripts first for the toolbutto ns and probe to work or there's no motor movement, and also the dialog to continue still pops up on some m6 calls

and I am getting no free axis movement with the freerapid now at all...

I am going to move all the code to another computer and see if I get any better results.. .

thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 08, 2019, 02:05:21 PM
Gary:

>>I Still seem to have to run the scripts first for the toolbutto ns and probe to work or there's no motor movement, and also the dialog to continue still pops up on some m6 calls

  Can you give me a sequence here. For example, you start program, load a Gcode file, then what is the sequence where nothing happens?  What button do I need to press to simulate what your doing? Do I need to load a file to see this or doe yours not move if you simply press the Tool#1 button for example?

>>and I am getting no free axis movement with the freerapid now at all...

  I havent touched anything on the freeaxis. Other than dialog changes and scripting errors I havent
modified anything to do with freeaxis settings.

>>I am going to move all the code to another computer and see if I get any better results.. .

  I cant see that making much differenc e, the Freeaxis is probably some configura tion thing.
Do you get any error when trying to turn on a free axis?

thx
Art


Title: Re: reading Pokeys pins
Post by: gburk on May 08, 2019, 03:34:05 PM
Art

You are right same results on different computer. .

I boot auggie, and I do not load any g code files, I hit estop and then hit tool1 button I get all the print messages in the script but no movement.
then I try the z probe button same results.

now I load the lib for toolbutto ns and run the script and now I get motor movement fine.. but no freerapid movement only x y z..

now I hit the z probe button again still no movement. ..
so I load the  probing script and run it, and now I get z axis movement. .

make any more sense

also don't seem to be able to get free axis movement at all now in simulator or motion mode..

The auggie dialog to continue seems to only happen while running g code file on a T M6 line

Thanks gary


Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 08, 2019, 05:43:47 PM
Gary

   I found an issue in script init sequence. So now, using your scripts and panel,
I start up, press Tool #1, the freeaxis move as I assume youve told them to,
and the z axis probes.

  Ill put this online tomorrow and we'll see where you stand then. Nothing Ive done
affects the Free axis though, and before I fixed the init, the free axis only moved
when I pressed the button.  So Im unsure why your free axis have stopped.. check
their config..m aybe you changed something in testing..

Art


Title: Re: reading Pokeys pins
Post by: ArtF on May 08, 2019, 07:54:21 PM
Gary:

 New version is online that should correct your scripts not starting up.
I tested by simply starting up, and pressing tool#1 button. All involved axis
seemed to do what they should including freeaxis.
 
  Let me know if this seems to fix most script items. Your dialogs should only
have proper OK and cancel buttons, and motion should be possible right
after startup.

Art


Title: Re: reading Pokeys pins
Post by: gburk on May 09, 2019, 03:45:22 PM
Ok Art

The startup works fine now boot auggie and hit estop press tool1 and x y z run fine. and z probe
But still no free axis's moving I checked the config and it looks good for all 4 of the free axis's don't see any changes..

I tried running Engine.Fr eeRapid(null,3,2,null); alone from the script window and run it, but there was no movement. ..

Thanks gary

 


Title: Re: reading Pokeys pins
Post by: ArtF on May 09, 2019, 04:15:45 PM
Gary:

  Do you get an error if you use FreeSetAx isType(..)?

In the pokeys softwares config for its engine, did the 3-axis checkbox get checked.T hat would switch
it to a 3 axis controlle r with no freeaxis.

  Did this happen in testing or immediate ly after one of my updates? Shouldnt be too hard
to track this down, though I may have to add a couple log mesages to trace whats happening .
Mine seem to run fine as soon as I press Tool#1 button.

Thx
Art




Title: Re: reading Pokeys pins
Post by: gburk on May 09, 2019, 06:43:36 PM
Art

That was it somehow pokeys config was changed, auggies was good, so fixed the pokeys config and now the free axis is working..
I'm thinking mach4 must have changed things in the pokeys config..

Sorry for not checking that..

Is there a way to have the free axis wait for motionsti ll the block("MotionSti ll") doesn't seem to wait for the free axis to stop
so the free axis is moving and the next script line is to move x y z and it starts and finishes before the free axis 6 and 7 finish moving..

I am not clear on what you meant to only use the ok cancel buttons in the dialog, you don't want me to call a function with a button I created in the dialog ?.

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 09, 2019, 08:18:35 PM
Hi Gary:

>>That was it somehow pokeys config was changed, auggies was good, so fixed the pokeys config and now >>the free axis is working.. I'm thinking mach4 must have changed things in the pokeys config..

   It  probably was. Mach uses the Pokeys with a different paradigm, it contains the config inside mach and programs the Pokeys to match. Auggie expects the Pokeys to be configure d and doesn't store its
informati on for the most part. It does keep some and will reprogram a bit, but mostly leaves the pokeys
as it is, which allows it to use any Pokeys without regard to type as long as it has a motion engine (internal or external). Some of the configura tion changed after Auggie was written so there is a bit of a problem if
your switching between programs, but if you get used to what changed, its usually only 1 or two settings. If you get a warning that your pokeys isnt the same as Auggies config, it may be safer to select "Use Auggies data" and then check the pokeys config if anything doesn't seem to work. If you change the PoKeys config using their software, make sure you "Send to PoKeys" to keep it saved on the device. I dont switch anymore,
my 2 machines in house are runnign Auggie, and I run Mach3 in my workshop, so I dont run into this, but
when I did share between Auggie and Mach4, I got used to what changed and coudl quickly refix for Auggie by running Pokeys and changing one or two settings.

>>Sorry for not checking that..

   lol, no problem. Its all very complex really and you've dug in very well I think. Almost all of your troubles
were in the end my fault as the functions for them were never tested in the context of general cnc , but mostly only on lasers. Ive used Auggie hundreds of hours on Lasers so I knows its operation is basically
sound and does great motion, but as your probably one of the first to get this deep into general CNC
youll probably hit more things as you go. Ill fix them as I can find them, but always keep in mind
Auggie was meant to be a simple controlle r, not as complex as Mach3. (Though to be honest its damn near that complex as myself and YaNvrNo went a little nuts while we tested and developed it. For a free
controlle r its fairly powerfull for Laser use. ). I typically run these days at 25000 mm/min which is pretty
fast for what its doing. I never planned on offsets , which really complicat e a planner and which CAM does
better in my view, nor did I allow for G43, though to be honest it is there, just mostly untested.
 
>>Is there a way to have the free axis wait for motionsti ll the block("MotionSti ll") doesn't seem to wait for the free axis to stop so the free axis is moving and the next script line is to move x y z and it starts and finishes before the free axis 6 and 7 finish moving.

  Yes, use "FreeStill" to block on, you can block on either or both. If you command a freeaxis move and want to wait for it, just block on "FreeStill" instead of "MotionSti ll". The 4 "free" axis are simply a duplicate of the
first axis planner with a few changes such as being able to configure any of them to be constant frequency
outputs. This can lead to some confusion due to the amount of variation possible in the configura tion of
these. You can double these up by the way, it should be legal to execute a

Block("MotionSti ll");
Block("FreeStill);

  in a script, or you can make a global script , name it WaitForAl lToStop() and put those two calls in it. 

>>I am not clear on what you meant to only use the ok cancel buttons in the dialog, you don't want me to call a function with a button I created in the dialog ?.

  No, I was only referring to the fact your error dialog , once opened, added another OK and cancel each time it opened, so I ended up with 10 OK's and 10 Cancel buttons on the dialog at once. This is repaired and only 1 OK and Cancel will ever appear at once. Ignore this if its never happened to you, its just something I noticed while testing your scripts.

  So, at this point add your Block("FreeStill") after your rack calls and such and it will wait till their done
to continue.

  Looks like your getting close anyway. Im not able to test exactly as you do as Im not configure d exactly
as you but I can usually synthesiz e an error if you can explain it to me sufficien tly.

Thx
Art





Title: Re: reading Pokeys pins
Post by: ArtF on May 09, 2019, 08:25:02 PM
Gary:

 By the way, Id recommend instead of using your tool panel the way you do, just instead use the main screen
and edit the 4 axis panel to add your toolpanel as one of its subpanels . That way it wont have to shrink the
screen to open up and just selecting the tab that will show up will get you immediate access to the toolchang er buttons without the screen having to reconfigu re.
  The scheme your using is instead similar to my Diags panel which also annoys by shrinking the screen
when it opens. Ive since learned its better and easier to simply add new panels as subpanels to
panels already on the screen. Auggies editor is better than Scream4, but still has its annoyance s.

Just an FYI.

Art


Title: Re: reading Pokeys pins
Post by: gburk on May 10, 2019, 08:26:44 AM
Art

FreeStill worked perfect, so looks like I can go on from here, with the tool change, and probing..

the main reason I was using my own display for tools and probe was the free axis display was small to read.. at least for me

and since I sent you my panels I have added the 8 axis dro's to the probe and tool panels and also 8 zero buttons, but I will add them to the free axis panel and see how it looks, for me bigger is better, as my eyes get older..   

I did have that problem with ok and cancel with the error dialog I think I mentioned it awhile back.. will check it out.

So next thing that may have to be ironed out would be the T M6 I will do some more testing and see what is causing me the most problems. ..

Did some testing on the m6, also don't see any buttons created with the error dialog should I turn off the ok cancel and just use the
x to close out the window..?

As for the m6 it seems good on the first m6 call my dialog pops up and then I close it out and hit run the gcode runs fine till the second T M6
at this point seems like auggie's continue dialog takes over, and mine never pops up again then when I hit continue some dro's move but the g code never
moves past this m6 line seems just to loop there and the continue box pops up again with same result stuck on the second m6 call..     


Thanks Gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 10, 2019, 09:53:33 AM
>>also don't see any buttons created with the error dialog should I turn off the ok cancel and just use the
x to close out the window..?

  No, just6 use as normal. I was getting multipel copies of OK and cancel, but it all seems OK
now here, do you still get too many OK buttons?

>>aAs for the m6 it seems good on the first m6 call my dialog pops up and then I close it out and hit run the gcode runs fine till the second T M6
at this point seems like auggie's continue dialog takes over, and mine never pops up again then when I hit continue some dro's move but the g code never
moves past this m6 line seems just to loop there and the continue box pops up again with same result stuck on the second m6 call..     

Thx, Ill run some tests. Glad to hear things are running better.

Art



Title: Re: reading Pokeys pins
Post by: ArtF on May 10, 2019, 11:36:06 AM
Gary:

 Version 3.6d is online for you.

   It should fix the warning dialog coming up after a toolchang e.

 There is an error in your scripts though. In the SetSpindl eState you have
a switch statement where you do a if( lookup("SpindleOn") SpindleOn();
  Same for off.
 These are not functions, SpindleOn and SpindleOf f are
global variables to indicate if the spindle is on or off. You dont need to
tell Auggie , it already knows the spindle is on or off, in your script
all you need to do is set the Pokeys relay or turn on a frequency or whatever
effect you wish from the fact that its on. Thats true of all script calls,
if they are system calls like M3,M5,M7 etc.. the system will set
the internal states itself, you need only turn on whatever relay
you wish for that state or set condition s as appropria te hardware
wise for your system for that call.

   Removing those switch statement s allows the scripts to run without
error as the script failure was causing a system stop.

Let me know how it goes. :)

Art


Title: Re: reading Pokeys pins
Post by: gburk on May 10, 2019, 05:31:56 PM
>>  No, just6 use as normal. I was getting multipel copies of OK and cancel, but it all seems OK
now here, do you still get too many OK buttons?

No i'm not, I think it was when using DoModeLes s now the error dialog uses DoModal seems to fix the button problem.

will check the spindle functions, that's the problem with jumping around to much before getting one function working correct> OCD < ???

looked at the spindle functions and I had them turned off so should not have had any effect, I will make the mods and turn back on later..

will check the new auggie compile out.

Ok here is what I am finding, load the g code run it hit the first T M6 call my dialog runs I change tool and hit the X and not probe don't have it connected right now.
and it runs to the next T M6 but now my dialog doesn't pop up anymore and nor does auggies, but the g code will continue to the next T M6 so we are no longer stuck in the loop at the second T M6.
But my dialog will not pop up anymore after the first time, I even hit estop rewinder and hit run and no pop up at the first T M6 call now.
The M6 Still stops the g code and waits for the run to pressed. i'm sure its running my function I see the messages being displayed just not the dialog.. 

Thanks gary




Title: Re: reading Pokeys pins
Post by: gburk on May 11, 2019, 06:57:15 PM
Art

Seeing there is no peck drilling yet... do you think this code is usable ?
Still in rough form and testing but just a thought.. .

// G888 P.25 H1 R.2
// G888 = Peck drilling Call with G888 H = Depth to drill R = retract hight P = Peck distance
global GCode888 = function()
{
  print("Peck Drilling");
  for( pecking = 0; pecking <= ParmsH[0]; pecking+=ParmsPRI[0])
  {
    if (pecking + ParmsPRI[0] > ParmsH[0])
    {
      pecking = ParmsH[0];
    }
   print("Peck Drilling  Z "+ParmsXYZ[2]+ " R "+ParmsPRI[1]+" Pecking = "+pecking);
   Engine.GC ode("G90 G01 Z-"+pecking);
   block("MotionSti ll");
   Engine.GC ode("G90 G01 Z"+ParmsPRI[1]);
   block("MotionSti ll");
   lastpos = pecking;
   sleep(2);
  };
  yield();
  print("Finished pecking to the depth of "+lastpos);
 Engine.St opProgram ();
};

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 12, 2019, 11:43:56 AM
Hi Gary:

  A 2 second sleep may be a bit much, but code looks good at a quick perusal.

Im analysing the dialog to see why it wont reopen, it may be better to keep the dialog
local inside a single global function. That way ach call opens a new one and the old one
will be autodelet ed after use.

 Ill let you know what I find.

Art


Title: Re: reading Pokeys pins
Post by: gburk on May 12, 2019, 03:31:11 PM
Art

Will give the local dialog, a try made a few mods to peck
I modified cambam post to use the G888 it seems to work but its putting the same G888 line twice in the g code file so i'll have to figure that one out.

Also the continue dialog is still popping up  random at some m6 calls not 100% sure but that seems to mess things up sends the axis's back to 0 the right back to where they were before the continue dialog then it loops there can't run past the m6 line if I single step it will run each line and the continue dialog doesn't pop up.

Tried removing the global from my dialog but didn't change anything. .

Think i'm getting ahead of myself again but I assuming auggie will not execute the G888 ?
It works fine In the MDI window, is there a way to have auggie read the script G888 while running the G Code file?

//G888 P.25 H1 R.2 I10
// M888 = Peck drilling Call with G888 H = Depth to drill R = retract hight P = Peck distance I Feed Rate
global GCode888 = function()
{
 NegValue = ParmsH[0];
 NegValue = ToInt(NegValue);
  if (NegValue < 0)
  {
   NegValue= math.abs(NegValue);
   print("ParmsH "+NegValue);
   ParmsH[0] = NegValue;
  }
   else if( NegValue == 0 )
   {
    return;
   };
//ok pos value lets do so pecking
  print("Peck Drilling ");
  for( pecking = 0; pecking <= ParmsH[0]; pecking+=ParmsPRI[0])
  {
    if (pecking + ParmsPRI[0] > ParmsH[0])
    {
      pecking = ParmsH[0];
    }
   print(" Pecking Z = "+pecking);
   Engine.GC ode("G90 G01 Z-"+pecking+" F"+ParmsPRI[2]);
   block("MotionSti ll");
   Engine.GC ode("G90 G01 Z"+ParmsPRI[1]+" F"+ParmsPRI[2]);
   block("MotionSti ll");
   lastpos = pecking;
   sleep(2);
  };
  yield();
  print("Finished pecking to the depth of "+lastpos);
 Engine.St opProgram ();
};

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 12, 2019, 08:07:40 PM
Gary:

   The continue dialog Ill add a switch to stop if one wishes to turn it off. I use it to start a file in the middle
or other location. Its purpose is to move safely to the previous lines end so a program can continue. This works
well as I never offset due to a tool change. Your offsets seem to affect it so Ill add a switch to turn it off
as a config item.

  If you create a Gcode script GCode888 it should be called if the Gcode has an G888 in it. Your log, if debug log is
turned on should show the Gcode being called, and should show the parameter s as they currently stand due to the call.
Does it show anything?

 (Im still checking the dialog cause.)

Art



Title: Re: reading Pokeys pins
Post by: ArtF on May 12, 2019, 08:12:13 PM
Gary:

 As an example, if I add a G666 to my Gcode file here, you can see it being executed on the toolpath screen and the data
its receiving . Try it and let me know if you get that text data showing 666 works..

Art
 


Title: Re: reading Pokeys pins
Post by: ArtF on May 13, 2019, 08:35:50 AM
Gary:

  Auggie is updated to  test version 3.6e for you to test.

I made some fairly drastic changes so there may be unexpecte d
results. I did get your dialogs working on every toolchang e, but
it was just the script I changed for that.

 The problem was the global nature I think of the dialogs. I changed
the one dialog to this for example..

global ToolWait = function()
{
  WaitDialo g = Dialog();   
  WaitDialo g.SetRect ( 25, 20 );
  WaitDialo g.SetTitl e( "Maunal Tool Change " );
  WaitDialo g.NextPos ition( 5,5,80,50 );
  WaitDialo g.AddStat icText( " Manual Tool Change now Jog to a safe X Y Z Position");
  WaitDialo g.NextPos ition( 5,15,80,50 );
  WaitDialo g.AddStat icText( " After new Tool is Inserted  PRESS Touch OFF Z");
  WaitDialo g.NextPos ition( 40,50,60,70 );
  WaitDialo g.SystemB uttonsOnO ff(true);
  WaitDialo g.AddButt on("Touch OFF Z","MyToolCha nge");
  WaitDialo g.DoModel ess("none");
};
 
   As the dialog isnt global it has an easier time dealing with it
at deletion time. Dialogs arent really very reusable in Monkey Script.

Try this new version, it seems to track better. Im sure there still exists
bugs and such, but lets see what this one does.

Art




Title: Re: reading Pokeys pins
Post by: ArtF on May 13, 2019, 10:06:23 AM
Gary:

   I found I had another weirdness in my scripts in that a G666 would stop the program. While I do make one
press run after a toolchang e, other scripts shouldn't require it. So version 3.6f is online which corrects this and
a few other small memory issues. I fond it now seems to operate as I expected it should. It will pause after
a toolchang e, but other Gcode commands you may add will not stop unless you call
for a programst op in the script itself.

  Good luck testing. Be cautious as I have rejiggere d a fair bit. At this point your testfile runs your dialog
on every toolchang e, and waits for run to be pressed afterward s. The continue dialog, should it appear,
has a cancel and continue button added so you can basically ignore it by pressing that when it appears.
I left it in because it IS handy if one wants to start a file in the middle.

 Let me know your experienc es.

Art


Title: Re: reading Pokeys pins
Post by: gburk on May 13, 2019, 10:38:39 AM
hi art

Thanks will test it out.. I found out why the G888 Wasn't running in the g code.. my error in script..

I attached the updated script and the g code file I ran in the air, and my dialog did pop up on tool changes never seen the continue dialog at all..

The only thing I see going on with this g code file is that it doesn't show up in the display window. most likely the G888 messing it up, but it did run ok..

I am assuming as long as nothing was weird going on then it didn't call the continue dialog..

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 13, 2019, 01:25:01 PM
Hi Gary:

  >>I am assuming as long as nothing was weird going on then it didn't call the continue dialog..

  I updated the executing line display, I think that was screwing with the continue dialog, it triggers
if you press run and the last line executed doesnt end at your current line. It then wants to safely move there
to continue the file.

>>he only thing I see going on with this g code file is that it doesn't show up in the display window. m

  The file doesnt show up? lol, Ill check that out.

Thx
Art


Title: Re: reading Pokeys pins
Post by: ArtF on May 13, 2019, 01:43:08 PM
Gary:

   The file shows up eventuall y, you have a 2 second delay sleep(2) after each peck, so in loading its executing that,
remove it and the file shows up almost immediate ly. Ill see some way to ignore a sleep while loading a file. While
loading the file is executed to make a toolpath so the sleeps make it slow to load.

  Other than that , I had to fix the SetSpindl eState to remove the calls to SpindleOn and SpindleOf f, then the file
runs as youd expect and I can see it pecking. File seems to run OK now.

Art


Title: Re: reading Pokeys pins
Post by: ArtF on May 13, 2019, 01:56:29 PM
Gary:

   I just upped version 3.6g. This fixes your sleeps slowing the load down. Sleep(x) will be interpret ed as sleep(0)
during a load ( essential ly a yield()), so the slowdown isnt very noticeabl e. The files loads very quick here now
and when running delays 2 seconds after each peck of the peck drilling as called for.

Art


Title: Re: reading Pokeys pins
Post by: gburk on May 13, 2019, 06:10:58 PM
Thanks art

The pecking has been a problem with me I keep finding new problems I think I fixed a couple more here I a new peck a also changed the sleep time..
and if the cam program put a -0.1 I was loosing the 1 so would not peck with the 0 value losing values after the decimal..
removed the yield... do you think I should remove the stop program also ?

 //G888 P.25 H1 R.2 I10
// M888 = Peck drilling Call with G888 H = Depth to drill R = retract hight P = Peck distance I Feed Rate
global GCode888 = function()
{
  HoleDepth = ParmsH[0];
  if (HoleDepth< 0)
  {
   HoleDepth = math.abs(HoleDepth);
  }
//ok pos value lets do so pecking
  print("Peck Drilling ");
  for( pecking = 0; pecking <= HoleDepth; pecking+=ParmsPRI[0])
  {
    if (pecking + ParmsPRI[0] > HoleDepth)
    {
      pecking = HoleDepth;
    }
   print(" Pecking Z = "+pecking);
   Engine.GC ode("G90 G01 Z-"+pecking+" F"+ParmsPRI[2]);
   block("MotionSti ll");
   Engine.GC ode("G90 G01 Z"+ParmsPRI[1]+" F"+ParmsPRI[2]);
   block("MotionSti ll");
   lastpos = pecking;
   sleep(.5);
  };
  print("Finished pecking to the depth of "+lastpos);
 Engine.St opProgram ();
};

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on May 13, 2019, 06:56:46 PM
Art

Tested new version Only main thing I see is when the g code file is loaded the G888 scripts seems be run also while the g code loads..

I uploaded The same g code file but did a little more on the post, so it should now have the X and Y moves before the peck starts..

Also I am not sure what I had changed while testing but I was getting the g code to display the paths but I lost it now no path display, but seems to run ok..

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 13, 2019, 08:02:04 PM
Gary:

 >>do you think I should remove the stop program also ?

  The stop program only tells the program to stop and wait for a press of run after
the peckdrill . It should be its only effect.

>>G888 scripts seems be run also while the g code loads..

  Did you mean it was actually moving the axis while loading? or just printing the messages?
All Gcodes have to run while loading, but in simulatio n, there should be no axis motion, but
any Gcode used will execute in sim as it has to to make the toolpath display properly. Each Gcode
file is parsed twice to create a toolpath and setup subroutin e locations and such. There shouldnt be
any motion though... but if you print in the script, that will print.



Art


Title: Re: reading Pokeys pins
Post by: gburk on May 14, 2019, 01:20:24 PM
Art

I went back and tested in motion mode and yes the Z axis was pecking while the G code file was loading.. .
That's if the estop was set if estop was off it only printed the pecking messages. .

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 14, 2019, 01:56:27 PM
Thanks Gary:

 Ill fix that up right away..

Art


Title: Re: reading Pokeys pins
Post by: ArtF on May 14, 2019, 02:44:16 PM
Gary:

 Version h is online, GCodes cannot now initiate motion during load.
It was already in effect for most other items, just missed that one.
Hadn't had GCode capabilit y in the scripts till now.

Art


Title: Re: reading Pokeys pins
Post by: gburk on May 14, 2019, 03:28:16 PM
Art

Good JOB No more pecking when g code loading.. .

Did you look at the pecking script do you think I should do anything different, I was thinking to except a positive or neg number and remove the Z- form the engine gcode ? I'm not a good programme r just hacking my way though and making a mess of things, but you get to fix the hard stuff. 

Also have you looked at the g code file and have any idea why it doesn't display the tool path, is it the G888 messing it up..

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on May 14, 2019, 05:32:03 PM
Art

Don't know what I did but the display seems to be working now  ???

When I first boot auggie and load a g code file then hit run it seems to do a m6 right away my dialog runs and I hit X end exit the code runs to the first M6 and runs my dialog again... a little strange but only happens on the first run its ok if I load a different g code and run it or stop and run same g code again..

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 14, 2019, 07:55:13 PM
Gary:

  Thx, Ill do a few test runs. Your getting closer anyway, at least these bugs are
slowly going away. Ive found a few more small ones along the way as well for
next release. Laser didnt stress Auggie the way trying general cnc does it seems.


Art


Title: Re: reading Pokeys pins
Post by: gburk on May 15, 2019, 11:03:28 AM
Art

I am guessing you weren't planning on cnc milling with auggie, jest got lucky and stumbled across a pain in the BUTT like me...
Do have more request but will give you a little break...

Gary


Title: Re: reading Pokeys pins
Post by: gburk on May 16, 2019, 04:30:23 PM
Art

I am lost on the spindle setup

It looks like the 0-10volt is on PWM5 Pin 17  I assume its needs this - SetPWMDut y_1(5,0) - to get going but how does it know pin 17 or is pwm channel 5 all that needed and is connected to pin 17, and what would be the max output value to get 10volts ?
if the max RPM was say set to 3000.
or am I way off base and need to approach it different ly Math is my weakest subject..

Thanks gary



Title: Re: reading Pokeys pins
Post by: ArtF on May 16, 2019, 08:55:46 PM
Gary:

  The Pokeys controls that voltage with PWM from 0 - 100%. Usually the Spindle is
controlle r by just that 0 - 100% setting.

  So to calibrate such a setting.. you set it for 100% and measure the spindle speed. You then
know 100% is ..say 20,000RPM. So then youd script it to put out an error if the requested
rpm is greater than 20,000 or just set 100%, other wise youd set the PWM
to a percentag e reflectin g the request. So

 newpwm = (requested RPM / 20000.0) * 100.0;

  That RPM would be a simple linear responce curve. One could get more complex I guess.
If you look in the library youll see I use a PWM channel for laser power, in the TestFire
library function it fires the laser with the sliders power for a set time. Youd setup
your Pokeys so a particula r channel controls the 0-10volts.
  You can test it just by using the script tab and sending PWM commands
to set various voltages. Then just set the pwm commands into the
SetSpindl eSpeed script..

Art
 
 


Title: Re: reading Pokeys pins
Post by: gburk on May 17, 2019, 07:21:57 PM
Art

Ok Still lost in space..
In the pokeys configura tion the pwm is set to pin17 (pwm 5)
Pdm period 50 and set to (us)

You have a few different scripts with the global SpindleOn() it looks link if I run SpindleOn() in the script window its turning on OC #5 that is in SpindleLi b-RelayOnly
I did change it to #5 so I do get the message Relay spindle was turned on OC #5. and I left the other scripts as they were..
If I hit the fire button I get the message spindle not turned on
So to get it to turn on and fire I have to change the   if( Engine.Ge tSpindleS tate() == 0 ) to == 1 now the auto on led lights and I get the message
Firing Test: Power and the time, when I press the fire button, but I get no voltage change on pin 17...
I also tried changing global LaserPWMC hannel = p.GetInt("Channel",5); to #5 is this correct.. .?

If I don't change anything and hit the fire button I see the onboard led for OC #4 light up...
But the is no OC led for PWM 5

Also I am running your default laser screen and have all my scripts turned off...

So Like you see i'm lost and most likely on the wrong path here..

Most likely getting you confused as well..

One other thing I see Axis 5 Dro moving when I hit fire and keeps running.. .

Thanks gary





Title: Re: reading Pokeys pins
Post by: gburk on May 18, 2019, 04:16:23 PM
Art

When I turn on the spindle I get the message channel 5 axis 5, this is confusing as far as I can see in your scripts its set to channel 4 axis 8..

and axis 5 starts running I don't see anywhere in the laser scripts that has this print message, so not sure where this channel and axis are being set I don't seem to be able to change it...

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 18, 2019, 05:34:18 PM
Gary:

 In my laser spindle script, I have

p = Profile("rtPWM");
global LaserAxis = p.GetInt("Axis",8);
global LaserMaxP ower = 100;  //max power = 100%
global LaserPWMP eriod = p.GetFloa t("Period",.0002); //for 5khz tickle 
global LaserPWMC hannel = p.GetInt("Channel",4);
//get a pokeys link for the spindle
global SpindleCo ntrol = Motion();

    This means the system starts up with getting these data items from
the profile under the heading rtPWM. The declarati on as in

global LaserAxis = p.GetInt("Axis",8);


  Means to set the LaserAxis to whatever is stored in the profile,  and
to use 8 as the axis is nothing has ever been set. The 8 is just a
default though. To change it it this type of use you can
simply change my declarati ons to

LaserAxis = 8; for example. It may be in your profile its stored as
a 5 and so doesnt use the 8 as default. Same thing with Channel
and such, they have defaults, but if set in the profile they can differ.

(You can open your profile, its just text and see if there are entries
for those variables unless you intend to use your own globals.).

Art




Title: Re: reading Pokeys pins
Post by: gburk on May 19, 2019, 08:54:24 AM
Art

I have all my scripts turned off and your default screen running.
and only the script spindleli b-laser turned on the profile for this setup shows axis 8 channel 4 how would I wire that to check output voltage when FIRE Held down?
tried the pins for OC4 + - and also the 0-10v pins... no power change

Now if I run my profile it show's axis 5 channel 5, I have the default laser screen loaded with myprofile and the same scripts loaded as your default screen that has the globals set for axis to 8 and channel to 4, but never changes form axis 5 channel 5 back to axis 8 channel 4.. do I have to save the screen for this... it doesn't change even if I run the script...

With both profiles the correct free axis show dro movement when I use SpindleOn();
But the M3 S has no effect, only using the command SpindleOn(); in the script window...

I had a feeling this was going to be a hard one for me to figure out..

Thanks gary



Title: Re: reading Pokeys pins
Post by: ArtF on May 20, 2019, 07:14:47 AM
Gary:

 Lets back this up a touch. I havent used the 0-10 volt myself, I use only the
PWM signals themselve s. You wont want to use the LaserSpin dle library, the
rtSpindle stuff ( Real-Time-Spindle) is a very fast PWM controlle r for a laser, it
modifies every ms, so its not good for spindle cnc use. We'll use a totally
different control for a cnc spindle.

  So lets first get the 0-10 volts working properly. If you have the correct
PWM channel, then changing its output from 0 - 100% in the Pokeys
software in its PWM config will change the voltage from 0 -10 volts?
 Does that much work?  We need to start at a point where we know
that the Pokeys is controlli ng the 0-10 volts. Then we need
to get to the point where a single script call in the script
window can change that voltage with SetPWM functions . From there
the spindle will not be hard.

You dont need to call any spindle function for that, as I
say we need to ignore the rtLaserSp indle, its a special internal
control and you wont use it.

  When SetSpindl eState( state ) is called, you dont need to call
SpindleOn() or SpindleOf f(), instead you need to simple call a
function that sets a pwm to the channel controlli ng the 0-10 volts.
   
inside SetSpindl eState( state )
{

  if ( state == 0): SetPwmDut y( channel, 0);
if (state == 1): SetPwmDut y( channel , properspe eddutycyc le);
 }

   So get the pokeys so you know the right channel is controlli ng the
0-10 volts.. and once thats definite, Ill guide you to finding what
number is the proper speed and how to send it to the pokeys
at the right time. But igfnore the LaserSpin dle library, you will
be turning that off and simply recoding its calls as a general cnc instead
of photo laser engraver.

Art


Title: Re: reading Pokeys pins
Post by: gburk on May 20, 2019, 10:27:31 AM
Art

Thanks will start over and shut down all my scripts to test spindle only i'm not totally sure but in the pokeys configura tion it show pin 17 pwm 5

so I assume I have to set the axis to 5 or 6 or 7 or 8 whichever I choose and the channel to 5, will start here... anyway.

guess I was steering you in the wrong direction ... sorry

Thanks art


Title: Re: reading Pokeys pins
Post by: gburk on May 20, 2019, 11:28:41 AM
Art

I think you mat have me on the right track here is the script

I called it with
SetSpindl eState (0); this changed the voltage from .222 to .442
SetSpindl eState (1); changed the voltage to 8.5 I think that's the max I seem to be able to output can't reach 10v even with mach4 and my pokeys has no trim pot so can't make any hardware adjustmen ts

Think i'm on the right track?

don't know if the axis is suppose to move like in your laser scripts but it doesn't...

global channel = 5;
global spindleax is = 5;
global speedduty cycle = 100;
global SpindleCo ntrol = Motion();
 
global SetSpindl eState = function(state)
{
  if ( state == 0)
  {
  SpindleCo ntrol.Set PWM( channel, spindleax is);
  }
  if (state == 1)
  {
  SpindleCo ntrol.Set PWM( channel , speedduty cycle);
  }
};

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 21, 2019, 12:44:10 PM
Gary:

>>SpindleCo ntrol.Set PWM( channel, spindleax is);

 You have the right idea, but the wrong parameter s. The "SpindleCo ntrol" is just a
hook to the Pokeys, so thats correct. But the call is actually. .

SpindleCo ntrol.Set PWM( channel,  dutycycle );

  So if you set 100, youll get full voltage, if you set 0, youll get 0vdc.
So, in the call you can do a

commandsp eed = GlobalGet("SpindleSp eed"); //this will be the Gcode commanded last speed
percent = (commandsp eed / 20000) * 100;
SpindleCo ntrol.Set PWM( channel,  percent );

  Add a function so that S calls are handled as in..

global SpindleSp eed = function( speed )
{
   /*power is automatic in laser spindle mode..
     no need to specify, in laser mode, spindle
     power is a function of augmentat ion */
  //but in CNC , we need to set the dutycycle to proper speed.

 
percent = (speed / 20000) * 100; //0-100% linearize d to 0 - 100%
SpindleCo ntrol.Set PWM( channel,  percent );

}; 

  Thats about all you need to make a spindle go, though you can be more
complex in its speed command, putting low limits and linearizi ng just
from min to the max.. many ways to do that I think.

Art




Title: Re: reading Pokeys pins
Post by: gburk on May 21, 2019, 07:22:19 PM
>> You have the right idea, but the wrong parameter s. The "SpindleCo ntrol" is just a
>>hook to the Pokeys, so thats correct. But the call is actually. .

>>SpindleCo ntrol.Set PWM( channel,  dutycycle );

Yes figured that out and had removed it...

>>global SpindleSp eed = function( speed )
>>{
>>   /*power is automatic in laser spindle mode..
 >>    no need to specify, in laser mode, spindle
>>     power is a function of augmentat ion */
 >> //but in CNC , we need to set the dutycycle to proper speed.

 
>>percent = (speed / 20000) * 100; //0-100% linearize d to 0 - 100%
>>SpindleCo ntrol.Set PWM( channel,  percent );

Yes already have this working also..
I have a setting for max spindle speed and replace the / 20000 with / MaxSpindl eSpeed that's in a dro I placed on the screen

haven't tried it on the mill yet but the voltage does go form 0 to 8.5 volt depending on the percent values...

so I think it will work I will try it on the mill in the next couple of days its been hotter that heck here weather people are talking about reaching 100 this week...

My next and hopefully the last function to get working, endless I find other problems along the way..
Is the spindle index, i'm not sure how you would connect it up with auggie  the pokeys doc's say it on pin 13 of the ultra fast encoder.. .
So I am not sure if a script would be fast enough for the index,  kind of like the probe routine i'm thinking, and it would have to be accessed Constantl y to update the rpm dro…

With mach4 I have it connected with the smoothste pper and I am using a c3 I think that's the board from cnc4pc maybe a c6 and just to a pin on the BOB I think i'm using pin 15.
Would I need the index board for pokeys also, it doesn't sound it from the docs but if that would make it easier then that's what I will do..

Thanks gary
 


Title: Re: reading Pokeys pins
Post by: ArtF on May 21, 2019, 09:09:03 PM
Gary:

  Great!, sounds like your about there. Spindle should be fine.

  >>Is the spindle index, i'm not sure how you would connect it up with auggie  the pokeys doc's say it on pin 13 of the ultra fast encoder.. .

  Are you looking to use the index for speed calculati ons? Mach4 may use it for constant speed PID
loop or something, but other than perhaps a speed indicatio n Im not so sure its usefull in
Auggie. I think the pokeys has a hi-speed counter or a high speed encoder input you could use
and sample it periodica lly for a count, divide by time passed and youd get a fairly accurate
indicatio n of speed.
   I havent used any index in the pokeys , I havent had a use for it, but if you can figure
out how to count it on the pokeys, you can likely get the informati on by script. Your right
about the index being too fast for Auggie to do anything with , it only converses with
the pokeys a hundred times a second or so.
  Spindle feedback, unless its for pid correctio n I never saw as being very usefull for
my own use. Let me know if you need any methods to read a count or anything, Im
pretty sure their all there though perhaps not doc'ed..

Glad to see things are coming along..ju st remember, use caution, I havent used the
program for much cnc , just laser. Your cutting new ground,but it was designed
to run near anything really..


Art


Title: Re: reading Pokeys pins
Post by: gburk on May 22, 2019, 10:13:52 AM
Art

My Thought is so I can see what RPM the spindle is turning and if I can read it close enough and compare it to want I want it to a just the current to correct the speed if possible, probably not or find a way to sink the two correct current to entered RPM..

Make any sense, wasn't sure if you may have the code already built into auggie…

Maybe just a way to display the RPM using the sensor..

Thanks You have been a great help and not getting to frustrate d  with me

one thing before I forget where you able to check why the m6 runs when I boot g code the g code never moves past the first line but the m6 is running moving the z to 1.0 which is what I have in the script hit run now and it runs ok stops as it should at m6..
I motioned this a while a go and forgot about it..

Gary     


Title: Re: reading Pokeys pins
Post by: ArtF on May 22, 2019, 08:32:42 PM
Gary:

  I think Ive fixed the script running during load but it may not be in your version.
Ill try to get a version out this week.

   You may be able to hook up the encoder of the spindle up to the
hispeed encoder input on the Pokeys, reading that will probably give a number we
can use to compute a speed approxima tion..

Art


Title: Re: reading Pokeys pins
Post by: gburk on May 23, 2019, 01:27:22 PM
art

When I made the BOB for my pokeys I have it with all ribbon cables in and screw terms out except for the homing and encoder those are the opposite's screw term in and ribbon out to the pokeys make sense to you if not I can try and post a pic of the board,

any way I have the index already on the board running to pin 13 of the encoder in pokeys and wire 7 of the of the encoder cable..

I just would need to know how to read it, thats way above my pay grade :)

I tested the relays on the mill and the flood and spindle power up great, so next I will check the spindle speed and see if I can get it moving it should work getting good voltage changes from the 0-10v output, will let you know how that gos..

thanks gary 


Title: Re: reading Pokeys pins
Post by: ArtF on May 23, 2019, 08:06:08 PM
Gary:

  Try as I might I cant find any way to read just an index and figure out speed.
There is no way it would be read fast enough by Auggie to know anything about speed.
In theory one could use such a signal to move the spindle until it stops on index..in other
words to use the index as a homing signal of sorts, but for counting speed its useless
unless the entire encoder is hooked up so that a count may be taken. Now if you hooked
the index instead to a connector pin that can be used as a counter you could at least count
the index pulses, so that dividing by time would give a good approxima tion of
actual speed. I cannot think of any way to use just an index signal though.. they are very short
and cannot be read by anything at any reliable speed.
  Im not sure how M4 could count speed with the index.. or mach3...

Art



Title: Re: reading Pokeys pins
Post by: gburk on May 24, 2019, 08:31:06 AM
Art

I'm not sure how mach3 or 4 do it haven't tried it with the pokeys yet, have read some messages that people have got it working..

I do have it working with the smoothste pper in both mach3 and 4 not sure if mach3 or 4 are taking care of it or the plugin's is doing the work..
but with the smoothste pper I am using a c3 index board from cnc4pc and just using any input pin.. and set that pin to index in the config..

not sure if auggie could handle the c3 board and set an input pin to whatever pin #, kind of like we did with the probe input pin 19..
and check that pin constantl y..

make sense?

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 24, 2019, 11:36:26 AM
Hi Gary:

    I suspect neither program will use it. The smoothste pper is likely feeding
it into a counter and then sending  a calculate d value to its plugin. There is
no way to monitor such a signal, its very short and can at up to 20Khz,
so the CPU couldnt do anything else but check it. Auggie only converses with
the pokeys around 100 times a second, hundreds of index's would have
happened between each conversat ion, so other than counting the index,
the signal has no use in that context. Its real use is to sync for threading
and such but for spindle speed its pretty much useless.

   Ive never used a c3 board so Im unsure what the hookup would be to that.
Ill do some reading..

Art


Title: Re: reading Pokeys pins
Post by: ArtF on May 24, 2019, 11:40:32 AM
Gary:

 YEs, just finished reading up on the c3, while it can take the index signal and send it to
a printer port, where mach3 could read it for example, or where a smoothste pper can
read and process it, the pokeys has no built in component to handle a count such as
that as far as I know. I think Mach4 is the same, its useful depending on the plugin.

Art


Title: Re: reading Pokeys pins
Post by: gburk on May 24, 2019, 04:33:09 PM
Art

I do have an encoder but haven't connected it up yet was going to use on lathe for threading, down the road a bit..

I hooked things up be messed up a bit hat the relays wire though the ssr output's and couldn't figure why they were not tripping dumb move..

But rewired for the onboard relays to my spindle and flood relays so will see it that's works better..

Also for the life of me I can't figure out why the pokeys enclosure is hot, it seems to have power running though the case, it doesn't show up in the house not connected to the mill, but i found out when i was going to plug in one of the home or probe plugs and i dropped it and the ground shield hit the corner of the case and sparked like crazy not sure why.. if i use my volt meter to the case and other end to mill table it shows 120volts. . but i never got shocked
Hoping someone will read this and maybe have some advise..

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 25, 2019, 10:33:59 AM
Gary:

   Sounds like maybe a grounding issue somewhere? What happens if you ground the case to the mill?
(Id hook a light bulb between the two myself to see if current flows..if not, its likely you should
add some grounds.)

Art


Title: Re: reading Pokeys pins
Post by: ArtF on May 25, 2019, 10:35:02 AM
Gary:

   Be cautious as you troublesh oot this grounding issue, its a pain to blow up your pokeys
by inadverte ntly feeding 110 to it..

Art


Title: Re: reading Pokeys pins
Post by: gburk on May 25, 2019, 05:48:01 PM
art

tried the light between the mill and case, it doesn't light so I guess thata s good thing..

But i'm thinking my spindle controlle r on the mill may have gone bad I thinks it a kb but I put in a hard place to get at under everythin g, go figure.

I thing I may have blown it up but not sure never heard any pop's or smoke, I think I may have connected the 0-10 to gnd and gnd to 0-10, think I wired the plug jack wrong.

Anyway if I put the spindle in manual mode and power it up I hear the fan go on if I turn the pot to on and spin it to max I here what sounds like a click in the controlle r maybe a relay, but no motor movement not even a hum.. so got something not so good going on..

pokeys is still fine, I still get a voltage change with m3 s2000 and off with m5...

Any suggestio ns on how to check the controlle r board?..
I wired the darn thing up so long ago I don't remember any of it...

Gary


Title: Re: reading Pokeys pins
Post by: gburk on May 25, 2019, 08:24:43 PM
ART

Still having so problems with the panels when placed on the main screen, they look fine in panel mode but some of them when place on the main screen the text is real small, I tried enlarging the panel on main screen but same small text almost un readable. ..

and it doesn't seem that I can change the text size from 9 to any other size it seems to have the option but doesn't save the changed text size always defaults back to 9. endless theres a trick im missing.. .

gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 26, 2019, 11:40:12 AM
Gary:
 Are you designing the panels to look HUGE in panel mode.
You should. The panel mode reflects the entire panel so should be
made to look huge. Change the text to the right size and then
 save that huge panel. Does it still look small text?
If so, on what kind of control?

 As to the controlle r for the spindle, if you did wire it backwards,
 you may have tripped an on board fuse if your lucky. Many have
them. As manual doesn't work its likely a bus voltage is down,
so a fuse sounds likely..

Art
 


Title: Re: reading Pokeys pins
Post by: gburk on May 26, 2019, 01:15:21 PM
Art

Yes when I create the panel its full screen so it huge..
Yes I am saving the panels but doesn't seem to make a differenc e as for the text size i'm fairly sure its changed back to the default size as soon as I hit the ok after changing the size..
 
I will attach the panel as soon as I get it zipped, its the spindle panel but different from the one I sent you awhile ago..

I.m working on pulling the controls from the mill just a pain I put everythin g under the mill inside the cabinet
will do some test when I get it out I don't see any fuses but hard to have good look where it is, will know better when I get it out. maybe a Mosfet

Gary 


Title: Re: reading Pokeys pins
Post by: gburk on May 26, 2019, 04:00:56 PM
ART

here is the panel

gary


Title: Re: reading Pokeys pins
Post by: Ya-Nvr-No on May 26, 2019, 07:20:38 PM
I find formattin g the text box shape, size and using \n for line feeds (splits long text lines up) is the biggest control of font size condition s.

Wished the fonts fit the text box a little tighter too, but I've learned ways around it. Sometimes makes it hard with the overlappi ng during creation and edits, but that's the challenge .

Photo shows how I used your probing panel for an alternati ve look.
couple of your panels back for you to see.


Title: Re: reading Pokeys pins
Post by: gburk on May 26, 2019, 09:08:01 PM
Art

I went back and tried that with the spindle.p anel it was a little better but not great, for some reason when I am editing the panel it fills the screen and every thing looks good, but when I go back to the main screen the panel doesn't seem to fill the panel box, the width is ok fills the panel but the height isn't filling the panel box
there is quite a bit of empty space on top and bottom, seems like that's the only panel I am having that problem with.

Did a little testing on the mill and i'm not sure what the problem is, turn the mill on in manual mode and I hear a relay clicking on the small fan comes on.
and the green led light up then if i turn the pot on the orange led lights up but no spindle even with the pot to max power, not sure how to test the pot.
but i am assuming it the controlle r i fried..

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 27, 2019, 04:58:59 PM
Gary:

 Sounds like its fried..bu t that may just be a fuse inside. I doubt the pot is bad,
seems unlikely. .

  Ill take a look at the panels and see what rules I used for sizing, though I
suspect changing anything in there may affect already designed screens. It
may just be its a zoomed panel rather than a shared one, they were always
harder to manage.

Art


Title: Re: reading Pokeys pins
Post by: gburk on May 28, 2019, 02:45:24 PM
Art

I tested the motor and I am getting a good ohm reading so I am going with its the controlle r...
ordering a new one today, so won't know if the spindle in auggie works till I get the new one bummer.

I made a completel y new spindle panel and I ended up with the same results, if I set it up as resizable it looks good on that screen just not on the main screen..
and I and assuming that the text resize doesn't work right now in the fonts ?.

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on May 28, 2019, 07:53:25 PM
Gary:

  Yes, very possible. Myself and Yanvrno realized at some point the fonts were a bit
flakey due to some technical factors. I havent worked on them as we typically worked around
the problem by using designs that didnt screw up, I was worried about breaking existing panels
and screens. I will take a look this week though to see if I can update them to be a bit
safer. The system "tries" out a font sizing of the text and adjusts it to just fit in a window,
it some cases it can fail, Ill see if I can figure out why in this case. If I can fix it
without breaking predefine d screens Ill make a change.

Thx
Art


Title: Re: reading Pokeys pins
Post by: gburk on May 29, 2019, 03:32:38 PM
art

ok thanks I can set the panel to resizable forget the exact command but that will work, guess it really won't matter to much with the screen panel for spindle
the main thing is I get it to work correct with the m3 seeing the g code will be calling it most of the time screen panel was there mostly for testing.. 
but won't know till I get the new controlle r..

gary


Title: Re: reading Pokeys pins
Post by: gburk on May 31, 2019, 11:00:46 AM
Art

I think I seen you using a poscope in one of you video's..
How is it? is it worth the purchase. .

Gary


Title: Re: reading Pokeys pins
Post by: gburk on June 04, 2019, 01:52:02 PM
Art

Got the new kb controlle r working on wiring it up a lot different than the old board hopefully I will get it right if not kaboom >:(
hoping to have it back in tomorrow and will see if auggie works I know I have the pokeys wired right now anyway..

Gary 


Title: Re: reading Pokeys pins
Post by: ArtF on June 06, 2019, 08:39:43 AM
Gary:

 Never tried a PoScope. I have a  bench scope and a small pocket scope
thats usb I use in tight situation s, but I havent tried a PoScope.

  Ill keep cross my fingers crossed for you.

Art


Title: Re: reading Pokeys pins
Post by: gburk on June 06, 2019, 01:11:39 PM
Art

I think you will be happy, I have the new kb wired up and tested it with auggie and the spindle is working m3 S it is changing the speeds ok and m5 shuts it down so will m3 s0.. I haven't tested what the RPM's are yet ended up needing a battery for my rpm reader.. will let you know in the next day or 2 how close it is compared to what I set it to with the m3 S code..

Also I am thinking of setting up CW and CCW spindle I have m4 working, my question is, I still have problems figuring out how to set pins from high to low.
Like if a wanted to control a relay not on board, I need to send 5+ to trigger the relay would SetPinDig GetPinDig be the proper way to read and write to the pin#?.
I know with the probe you have pin19 built into auggies config..

Ok I hooked up pin28 from the lcd 16pin plug and 5+, if I power on pokeys I get nothing from the pin no voltage if I set to 0 or 1 from auggie, now if I run the pokeys config I see the pin28 is set for digital out, but still no voltage change from auggie, but if I invert the pin in pokeys config it will start to work with auggie I can invert it again and still works I can close out the pokeys config and it works great, but if I power the pokeys off and back on its back to not working seems like I allways have to make a change to the pin in pokeys config for it to start working, Any thoughts on this?..


have you had a chance to check the g code m6 running when g code file first loaded..

Thanks gary 


Title: Re: reading Pokeys pins
Post by: gburk on June 12, 2019, 12:58:59 PM
Art

I think we have discussed this before dialogs.

anyway if I remember there is no way to read which button was pressed Ok or Cancel correct?

and if I create my own button, is there a way to close the dialog when button pressed?..

dialog doesn't seem to close endless you hit Ok Cancel or the X..

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on June 13, 2019, 12:56:37 PM
Hi Gary:

 >>would SetPinDig GetPinDig be the proper way to read and write to the pin#?.

  Yes, Those should set any pin. I dont use any myself though, both my systems
are using the relays as the only output. But, on my test rig, I can turn on or off an LED
on a pin I set with those calls. Im not sure why you need to set it in pokeys though,
I dont. Did you tell the pokeys to save the config when you set it to digtial?
Is it still set to digital out when you next run Pokeys again?

  Last test I did , the M6 didnt run on load, I did add a kill for that but now
Im not sure if I released that version. I will check it and release a version
today or tomorrow just so we're sure. I turned off all macro calls during load
as a safety as I recall.

  As to the Dialog issue, I dont think you have much choice as it is implement ed,
the user has to press OK or cancel to exit and close the dialog. I will add a Close()
command for you today , call if from any script that dialog is calling from a button
or item.

  Should be out within a day or two..

Art
 


 


Title: Re: reading Pokeys pins
Post by: gburk on June 13, 2019, 03:23:00 PM
Art

Some of my problem setting relays other than the 2 onboard is for some reason pokeys is outputtin g at least 1.6v from a pin before I trigger it..

for example if I use the LCD pin28  opps I forget if I had the other wire to gnd or +5 but anyway it would have 1.6v pin not triggered and for the relays I was using that was enough to trigger the relay on, so as soon as I powered pokeys the relay set if I triggered the relay it would jump to +5 so it was working.. I also tried the SSR output and I was getting the same voltage results..

The two onboard relays work fine, problem is I have 2 relays for power to the spindle m3 m4 and 2 for forward and 2 for reverse.. . SSR relays
I just ordered a couple DTDP I am going to try hopefully that will eliminate 2 relays..

I don't know to much about the oc1 2 3 4 outputs is it possible to use them?.

And a close() for the dialog would be great thenks

Gary 


Title: Re: reading Pokeys pins
Post by: ArtF on June 14, 2019, 01:16:22 PM
Gary:

 New Auggie is online. It has a Close() command for dialogs
as a test, its untested as of yet.

  As to the voltages, that really sounds dodgy, if your connected to the
pokeys ground you should have 0 volts to the pin, or 5, but it may be your
requestin g too much current. The outputs are pretty low ma capabilit y
so wiring can count. Are you triggerin g with a transisto r circuit?

oc's should work, though I havent used them I dont think..

Art


Art


Title: Re: reading Pokeys pins
Post by: gburk on June 14, 2019, 02:57:16 PM
Art

Thanks will test the close().

I'm not sure but sleep on it, and went back to testing voltage now the SSR is working fine 0 to 5v..

I think you may be right the pokeys may not be able to handle the voltage output to relays from the LCD pins.. I tested again and received 4.6v not connected to relay when I hooked up the relay it dropped to almost nothing and relay didn't trigger..

OC'S question are they PWM, I can turn them on but no voltage change.. would I need a PWN to voltage board?.

Tested the Close(), doesn't seem to work I may be using it wrong..
I created a global dialog
I also created a button call.
I press the button and it does call the function correct.
I put a ProbeLeng thDialog. Close(); in the function but doesn't close it..
I assume the only way I can close a dialog from another function is it has to be global..

There already was a Close statment in auggie before but not sure what it's use was intended for.


Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on June 14, 2019, 08:13:10 PM
Art

Did a test with the g code, I attached a copy..

It's still running the m6 t when g code first loaded, brings up my dialog and retracts to 1" but the g codel stays at the first line of the code.. first line is hi lighted.

gary


Title: Re: reading Pokeys pins
Post by: ArtF on June 15, 2019, 07:08:10 AM
Gary:

   Thx, I had lost that file, Ill retest and fix the m6 start.. Ill check the close as well..

 >>I think you may be right the pokeys may not be able to handle the voltage output to relays from the LCD pins.. I tested again and received 4.6v not connected to relay when I hooked up the relay it dropped to almost nothing and relay didn't trigger..

   Yeah, there's not enough current to push a relay with a pinout, it has only enough for an
LED or signal , running an opto is one way to make it drive a relay.
 OC's are open collector outputs, they are like pins with opto's added so that you can draw
enough current for a relay for example.  You put 5 volts for example on one side of
a relay, and the other side can be hooked to an OC output. There are 4 OC's, and
you can script call them with  Pokeys.Se tOC( int oc, int state).

   Note: to do this you need to make sure whatever power supply is driving the relay
must share the same ground as the pokeys..

Art


   These 4 exist mainly to drive relays..

Be a day or two till I can test the M6.. Ill get back to you soon.

Art

 


Title: Re: reading Pokeys pins
Post by: ArtF on June 15, 2019, 07:16:45 AM
Gary:

 Small correctio n. According to the manual the OC's are all
galvanica lly isolated from the pokeys. So each OC has its own
ground, OC- to be hooked to the ground of the supply driving the
relay from the OC+. The OC command basically if set to state:1
will short those pins OC+ and OC-. Current will flow from OC+ to OC-
when the they are shorted.

  You can think of it as a transisto r with the OC+ being the collector,
the OC- a grounded emitter, and the state is the base.
 So in short this would be an NPN transisto r with emitter ( OC-) to
be connected to your power ground and the collector (OC+) to
be connected to one side of the relay. The other side of the coil to
power supply +.

Art
 
supply grund, and the collector (OC+)


Title: Re: reading Pokeys pins
Post by: gburk on June 15, 2019, 06:11:29 PM
Art

Thanks the oc's work wired up per your direction s and relay gos on and off..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on June 15, 2019, 08:29:48 PM
Gary:

 Is it actually opening a dialog on load? I cant find any bad behaviour there, it loads that file and does nothing till I press run and the first dialog opens. What happens there exactly?


 ..

  Your right on the close function, it would have to be a global dialog at that point as a
button code has no way of knowing its parent. Im finding it difficult to find
a way of allowing  a close command that will work. Ill keep dwelling on it.

 I think I will have to add a sim = GlobalGet("Simulatio n") as a command so that
a script can be self aware that its being called during a load. It occurs to me there
are time you want to define motion during a load so it shows up in a toolpath,
and other times you may not want to activate during a load.. so the above command
would at least allow that. Im not sure I can do a close..bu t Ill see what I can think of..

Art


Title: Re: reading Pokeys pins
Post by: ArtF on June 16, 2019, 07:07:13 AM
Gary:

  In order to solve the issue of allowing your button script to close a dialog,
the following change has been made. It will be in the next release in a few days.

When adding a button, if you wish it to close the dialog after running your script,
make the call like this..

WaitDialo g.AddButt on("Touch OFF Z_close","MyToolCha nge");

  Note the buttons name has "_close" appended to the end. This text will
not show up in the actual button , but is a tag telling the system that this
button, after being processed, should then do an implicit OnCancel() to
close the dialog. This will close it just as if the user had pressed the
cancel button with no other effect.

  Note:  Using _close appended to any control, checkbox, edit window..
anything. . will cause the dialog to close if that function script  is called.
 Ive tested this with your Gcode file, seems to work fine. I still
dont see any run on load of the tool change though.


Art
 


Title: Re: reading Pokeys pins
Post by: gburk on June 16, 2019, 09:42:12 AM
Thanks Art

What I am getting when the g code loads is the m6 call seems to run instantly, and the dialog appears and the z axis dro runs to 1"
and that's how I have the m6 script setup it jogs to 1" to do manual tool change..

you are right the code doesn't run, till run is pressed, other that the m6 for some reason, I can hit run now and it will run fine.. jest worries me it does the m6 when g code loaded it could move the axis and mess up things if you don't have the tool in a safe place first …

I will test it again and let you know the sequence of what exactly is going on.. 

As for the dialog would it be easier to add getting feed back form the OK - Cancel Buttons they close the dialog and then you could react if cancel do this if ok do that.

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on June 16, 2019, 01:12:16 PM
Art

Ok A clearer picture of what's going on.
I load the g - code it loads fine no call to M6.. good

Now I press RUN it runs to the first M6 call does what its suppose to do, my dialog pops up I close my dialog and now I see the message End of g code run then press RUN the g code seems to rewind and go back to first line.
Now I hit Run again and it stops again at the first M6 my dialog pops up again I exit it, hit Run and now it runs fine, starts running the rest of the g code

Also is there a way to have the g code start running when I close the dialog box so I don't have to keep hitting the RUN button?.

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on June 21, 2019, 07:09:07 PM
Gary:

 New version is online of Auggie. The "_close" added to any dialog handler's function name  will
tell it to close that dialog when the handler is called. Its like appending a call to OnOK or OnCancel.

   I'm not seeing any ill behaviors per say on this version running your file. IT does stop
after each peck drill, but the script calls StopProgr am so Id expect that. The only other
stop is after a tool change and that's a safety of sorts. I will see if I can add a continue
script call to help if one wants to continue after an automated tool change.


Art


Title: Re: reading Pokeys pins
Post by: gburk on June 22, 2019, 02:37:26 PM
Art

The G code seems to run fine now no problems when first loading G code with m6..

I'm not sure how exactly you setup the _close, doesn't seem to work it I use dialog._c lose(); or dialog("_close")  in some of my stuff OnCancel is setup like
CDialog::OnCancel();  so not totally sure how game monkey is handlinin g it...

Can it be closed in the function called by the dialog.bu tton press?.

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on June 22, 2019, 04:14:15 PM
Gary:

 I used it in testing by simply renaming your Z touchoffb utton dialog handler
setting when you added the button to this..

WaitDialo g.AddButt on("Touch OFF Z_close","MyToolCha nge");

The button will still read "Touch Off Z" when displayed on the dialog,
and the script MyToolCha nge will be called, but the OnOK routine
which will close the dialog will be called when the MyToolCha nge Script
has completed its run.

   So if you change any buttons declarati on to having _close added
to the buttons label, that buttons becomes an OK button with your label
and your script.

Art



Title: Re: reading Pokeys pins
Post by: gburk on June 22, 2019, 06:34:14 PM
Art

I Get it now and tried it and it does work.. But Always a But

Now when I run the g code and I get the m6 the dialog pops up but the g code keeps running, so the g code isn't stopping and waiting for the button press the g code continues to run even with the dialog waiting for the button press, the dialog does close when I hit the button..

Sorry I guess I just make problems

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on June 22, 2019, 08:02:35 PM
Gary:

   Its likely due to some changes I made in the logic to keep things running unless told otherwise .
In your toolchang e script, call StopProgr am() and see if that fixes things. It should work like your
peck drilling does, it stops after its call due to the StopProgr am() you put in the script. I
removed the toolchang e autostop unless there is no tool change script, if none exists, it
stops on the M6, if a script exists, its up to the script to call StopProgr am if it wishes the
program to stop. Unfortuna tely, a dialog opening is seen as the calling script terminati ng,
so its assuming your doing an auto tool change with no interacti on, the calling script
is finished so it just continues . Add the StopProgr am() call and it should stop.

  Downside is youll have to press run after your dialogs are complete. I will try to add a
continue() call, but its complex in there in its interacti ons so I'm trying not to hurt
scripts I or others have, so you may not have a continue real fast..Im still testing for
ramificat ions.

Art


Title: Re: reading Pokeys pins
Post by: gburk on June 23, 2019, 08:45:13 AM
Art

Will check that out,

Would it just be easier just to add a way to read the OK and Cancel buttons and then call a function depending on the choice?.

I put a Engine.St opProgram (); in the tool change dialog function but didn't have any affect g code sill keeps running with the dialog screen just waiting for input

thank gary


Title: Re: reading Pokeys pins
Post by: ArtF on June 23, 2019, 11:56:19 AM
Gary:

 For techincal reasons, as the system creates OK and cancel, they really cant be easily hooked.
This makes them kinda useless in my view, better to simply label a button as "OK_close"
and turn off system buttons. Works the same really.

 Ill check why that stop doesnt occur..

Art


Title: Re: reading Pokeys pins
Post by: ArtF on June 23, 2019, 08:22:04 PM
Gary:

 For the life of me I cant repeat it. If I load all is fine, I press run and I can see internall y
the program stop get set. Then a script tells the Z to G1 to 1.0, then another G1Z.125,
then the dialog appears and the program waits for a run command.

  Im not sure what script is telling it to go up, I just verified
its coming in from a script. It then immediate ly does a g1 to z.125 and stops for the run.

  So Im not sure exactly whats going on, Ill keep looking..

Art


Title: Re: reading Pokeys pins
Post by: gburk on June 24, 2019, 08:26:57 AM
Art

DoManualT oolChange is sending the script to 1" then calls the wait dialog for tool change..

I tested it again with the same g code I sent you.. I hit RUN the code start running the Z retracts to 1" then the code continues to Drill pecking and my dialog pops up
and sits there but g code is still running doing the pecking never stops and wait for a button press.

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on June 24, 2019, 03:43:58 PM
Gary:

 Does it stop after each line of pecking the way mine does?

Art


Title: Re: reading Pokeys pins
Post by: gburk on June 24, 2019, 05:14:41 PM
Art

Just keeps pecking the g code doesn't stop does the 4 pecking lines then continues to the cutting the recess the dialog pops up at the m6 lines but the g code keeps running.

it was working ok in the last version of auggie just had the problem when g code loaded running m6 and then g code being rewinded to first line.
That's fixed..

Gary


Title: Re: reading Pokeys pins
Post by: gburk on June 24, 2019, 06:19:27 PM
Art

Sorry I take that back, I went back and reran the g code it still rewinds but now on the first Press of the RUN button  the code then hits the m6,  it then rewinds the g code. but does the z move to .125 and then to 1"  then the tool change dialog pops up. and I am now back to the first line of g code

Now I have to hit the RUN button  z moves to .125 then the code runs to the same m6 call z moves to 1" again and the tool dialog pops up
but now the g code doesn't stop keeps running though all the pecking lines even with the tool change dialog waiting for a key press..

Hopefully this is a little clearer I stumble on words ???

And almost forgot the reason the pecking seems to stop is I have a sleep in the script made it easier to read the prints on the screen..


Gary


Title: Re: reading Pokeys pins
Post by: ArtF on June 24, 2019, 07:50:06 PM

Ill rerun my tests Gary, my pecking stops entirely, but the script has a
call to StopProgr am() so mine stops and never restarts. Its possible
my scripts ara bit different than yours at this point, but Ill try a few runs to see
where that move to 1" is coming from, I only traced it till I saw it came from
a script.
  Ill narrow it down a bit more.

Art



Title: Re: reading Pokeys pins
Post by: ArtF on June 24, 2019, 08:07:17 PM
Gary:

   A new version is online 3.62-debug , this is a much larger file as it
is compiled in debug mode.

  What I find here is the file stops as it should at the m6, as well as the
pecking stops it due to the programSt op() in there. (At least on mine.)

   Now testing this is hard here, because while I have your scripts, my system
isnt set as your in many ways, and I use a debug version as I test your scripts on
a 56e connected by USB and for some reason my system wont run the 56e on usb
in release mode, only debug. (My compiler is using usb for arduino config
and I suspect its interferi ng in my testing. )

  I found I had autotoolc hange unchecked here, so it was the manual tool
 change script that was causing the Z to go to 1 after the dialog opened.
I checked auto and that stopped and the file simply stops.

 SO I need to know if debug and release work the same, let me know what
this one does. Also, in testing I did see a failure immediate ly after load on
the first press of run the line numbers didnt track. Im looking into that
but I noticed after rewinding and restartin g it worked as expected. So
theres a bug in there somewhere . Im still looking.

Art


Title: Re: reading Pokeys pins
Post by: gburk on June 25, 2019, 01:37:33 PM
Art

Ran the debug version with the g code a couple time...

on the Run press it runs to m6 rewinds doesn't stop starts running again from first line and never stops running at any m6...

and I miss understoo d you on stopping in the pecking I thought it was stopping during pecking not when it was exiting the pecking script
yes I still have the programSt op() in mine I also have it in the manual tool change but has no effect anymore with the g code the script runs hits the programSt op() but doesn't stop just keeps running.

Not sure maybe that could be broken now?..

also noticed one differenc e in the debug ver when I booted auggie the blue script led was lit so i assume some script was running it didn't shut off till i hit stop

Will test some more..

Thanks gary



 


Title: Re: reading Pokeys pins
Post by: gburk on June 25, 2019, 03:26:39 PM
Art

I think I found the problem with the m6 its my ERROR in script, I was trying to have the g code continue to run after my tool change dialog was closed with the button press so I didn't have to hit the run button after the dialog box was closed so I had stuck a     //GlobalSet("Execute",1); in there when it exited the manual tool change script I REMed it out now it stops at the dialog box and M6, SORRY MY BAD

The G code still Rewinds on first M6, but if you stop the G code and rewind it, Then it runs fine so seems like happens only on first run of G code..

So no that I don't seem to be able to use     //GlobalSet("Execute",1); or I need to put in a different part of code, any suggestio ns as to how to make the g code continue after I close the dialog without having to press RUN also??

And the blue led only flashes in simulatio n mode not in engine, you may have it setup that way
I get there error in the error file
 25:13:150  Simultion Mode Active
25:13:150  Changing Enabled state of one or more motors
25:13:150  Pokeys section inited.
25:19:649  error (3) parse error

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on June 25, 2019, 07:22:31 PM
Gary:

>> M6, SORRY MY BAD

  Never a big deal.. :)

 >> //GlobalSet("Execute",1);

  Awesome, you figured out how to make it run anyway, I had forgotten
that command. OK, so basically you want that to happen after the dialog
is closed, or at least while its closing, so Id add it to the end of whatever scripts
are named with _close in their name tag. You just need to figure out what the
final thing your doing is, and put the  GlobalSet("Execute",1); at the
end of that. I think that should work.

  I'm still searching for why the startup error. Too many changes lately so
Im probably leaving some variable unset.. Ill grok it eventuall y.

Art


Title: Re: reading Pokeys pins
Post by: ArtF on June 25, 2019, 07:30:37 PM
Gary:

 Just a note, Ill release the proper release compilati on on next update,
that will make the program much smaller, though space doesn't really
matter to most anymore in days of terabyte drives.

  Auggie is both experimen tal and free so it has no real developme nt
pressure on it so dont feel bad about all the versions, each one typically
makes it run a bit better in the end. I appreciat e all the testing you did
to find the problems you found. :)

Art


Title: Re: reading Pokeys pins
Post by: gburk on June 26, 2019, 10:18:24 AM
ART

Thanks
>> M6, SORRY MY BAD

>>  Never a big deal.. Smiley

Felt bad and stupid that I had you trying to figure out something that wasn't there..

I thought I had the  GlobalSet("Execute",1); after the StopProgr am but it wasn't stopping I will double check and get back to you...

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on June 26, 2019, 10:32:13 AM
Art

I'm fairly sure the is the script M6 Starts and Ends with but as it is the Stopprogr am doesn't stop maybe you see something im messing up

 global DoToolCha nge = function( tool )
{
    //XcurPos = (Engine.Ge tAxisPos(1));
    //YcurPos = (Engine.Ge tAxisPos(2));
    //ZcurPos = (Engine.Ge tAxisPos(3));
    currentPo s = AxisCurre ntPos();
    print("currentPo s X = " +currentPos[0]);
    print("currentPo s Y = " +currentPos[1]);
    print("currentPo s Z = " +currentPos[2]);
    sleep(.5);
    GcodeRetu rnToPos = ("G01 X"+currentPos[0]+" Y"+currentPos[1]+" Z"+currentPos[2]+"F10");
    Engine.GC ode("m9");
    Engine.GC ode("m5");
    block("MotionSti ll");
    if (GlobalGet("AutoManua lDRO") == 1)
    {
     DoAutoToo lChange( tool );
     Engine.GC ode(GcodeRetu rnToPos);  //Move axis to safe posistion's
     block("MotionSti ll");   
     return;
    }
      else
       {
        DoManualT oolChange ( tool );
        print("Change done");
        //Engine.GCode(GcodeRetu rnToPos);  //Move axis to safe posistion's
        //block("MotionSti ll");
       };
    print("Change now to Tool " + tool + "requested");
    Engine.St opProgram ();
    GlobalSet("Execute",1);
};

all the scripts are just rough drafts, figured not worth polishing up till most of it runs though OK.. make sense

I tried moving the  Engine.St opProgram (); and GlobalSet("Execute",1); to different positions in the script but doesn't stop  running seems like as long as there's a  GlobalSet("Execute",1); in the script it over rides the  Engine.St opProgram ();..


Gary


Title: Re: reading Pokeys pins
Post by: ArtF on June 26, 2019, 05:41:35 PM
Gary:

>>Engine.St opProgram ();
>> GlobalSet("Execute",1);

  You can think of GlobalSet("Execute",1) as the opposite of StopProgr am();

  Your stopping it, but then telling it to press the Execute button. This starts it again
unless its in a state where it cant. You should use one or the other, but not both.

Using GlobalSet("xxx",1) with any button named "xxx" is the same as pressing the button.

Art
 


Title: Re: reading Pokeys pins
Post by: gburk on June 26, 2019, 08:28:48 PM
Art

So if I wanted to stop the program from running when I call the tool change dialog, and when I press for Example the Z button and do a Z_close
then exit the dialog now I would like the program to continue running, without having to press the RUN button.

I did figure Exicute,1 and stop program where the opposite's, that's why I thought it would work, so if I am getting this correct now, StopProgr am() doesn't in reality stop execution at that line,  even though I sent the StopProgr am() it still runs the next line of code the Exicute,1 acts like I never had the stopprogr am() line there
so the program keeps running. and never Stops.
At least that's how it reacts in my script..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on June 26, 2019, 08:34:14 PM
Gary:

 Just for archival purposes, Ill add a small explanati on of how this all works
when scripting ..

 Imagine we have Gcode as follows

G0X0Y0
M6T7
G1X6

  this will eventuall y parse to as follows

G0X0Y0 //move to 0,0
T7 { run script for tool number change , run first due to system priority over an m6}
M6 { Run script for tool change, but also the stoprogra m variable is auto set to true. }
//will wait for execute now as programst op was set internall y as a tool safety
g1x6 //move on next execute.

Somewhere around 10 times a second Auggie does a routine called SyncOps
internall y. This is when it executes scripts for a time slice, executes special
commands like StopProgr am or Execute or any button name set to 1.

Normally, execution of any script tells Auggie to wait for that script
to finish before going to the next one. So if, say in the M6 script,
you do a .StopProg ram(), the variable StopProgr am internall y is set
to be executed on next syncops. If you then add a GlobalSet("Execute",1),
the variable Execute is set to true for next SyncOps.

  You have no way of telling in what order such commands will
excute. They may not be in the order given as they are queued until the
next SyncOps. So its possible it may execute(), then stop() internall y
as opposed to stopping, then executing .

  So, a stopProgr am() should be the last command in the script.. or a yield()
should be done after the command, this pauses the script until the next
syncops. A yield() really only exists for this purpose, its kinda like a flush()
operation to be sure everythin g system-wise has been interpret ed.

  If you need the script to continue after the StopProgr am(), you may want to
call a GoParalle l(), which then detaches that script from the running program
allowing it to stop, but your script to be running.

  Its possible during the process of stopping a program, it may decide to kill
running scripts in some circumsta nces. It will not terminate a Parallel script
until an Estop or program end I believe.

  This is all very complex in there ( I dont know what I was thinking. .. )
so unknown interacti ons can happen in some situation s. When things
get weird, try adding yields after system commands to see the effect, it
sometimes helps, if it doesn't, remove it as being unnecessa ry.

Art
 

  
  



Title: Re: reading Pokeys pins
Post by: gburk on June 27, 2019, 12:17:47 PM
Art

I think I get it's like pulling and pushing from to the stack.

GoParalle l() was one thought but it also seems to have a time restraint so not sure if that will work but I will try it out..

The problem with having to get things done at any speed may be a problem. when I open the tool change dialog who knows how long it would take to jog the axis's change the tool retouch off the tool and then exit the dialog  and continue the g code..

I will test out the yield() also...

Thanks for the expiation it was very clear..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on June 27, 2019, 02:24:58 PM
Gary:

 Kinda like a stack, but the highest priority will be done first in the case of syncing commands like
stop or start.. Id do a program Stop as you make the dialog, and add the Execute,1 to the dialog that handles the final step before you exit. If youve added moves they will be completed before
the program actually starts. It wont start till all moves are done .. So as you make the toolchang e dialog, add the stop, then a yield(), then allow the dialogs to do their thing but in the final script
do the execute,1 .. that should work.. but then should is a big word..


Art


Title: Re: reading Pokeys pins
Post by: gburk on June 27, 2019, 05:33:07 PM
Art

I think that's the way I had it Stop when creating dialog in the start of the function, then execute.1 when leaving the tool change function and that should bring you back to the g code, the problem I was getting any time you called the script, and were in any of the script functions being used by the m code call it always seemed like execute.1 took preferenc e over the StopProgr am and just by passed it like wasn't there..

I think I will just change the dialog to say when finished press the RUN button...

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on June 28, 2019, 08:44:13 AM
Gary:

 In checking, I told to stop the program even if a script exists
in a tool-change. So the stop Program shouldn't be required. Just an
execute,1 in the final button call of the dialog.

 It may be that the system sees a script still running from the previous run.
 (The script your currently in..) and is refusing the RUN button being pressed
as its waiting for a script to complete.
 So it may be necessary to do a GoParrall el(),Yield() at the start, that way
the execute wont see any scripts currently running.

  The GoParrall el will remove the script from the running scripts list, probably
best to simply add that at the start of your toolchang e script so it starts up
as a system script, is removed from the running program stack, the Yield()
after the GoParrall el will ensure the program is stopped, waiting for an
execute when your script tells it to. Then in your final script of the tool
change, put the execute,1 at the end of it. The program now having nothing
to do at that point and seeing no scripts in the program stack should
be in a state where it will accept a press of the run button.

Art
 


Title: Re: reading Pokeys pins
Post by: gburk on June 28, 2019, 10:53:24 AM
Art

Tried the GoParrall, yield() at the the start of the tool change script M6 and put the Execute,1 at the last line returning to the g code...

the dialog pop ups but the problem is the code doesn't wait for you to exit or close the dialog before continuin g, so the dialog is sitting on the screen waiting for some action Z_close or any dialog button press, but the script keeps running till it hits the Execute.1 and g code starts running again before you had a chance to jog axis and change the tool, or close the dialog.

It will stop as long as I don't have a Execute,1 anywhere in the script
I assume it still has run all the way though the scripts but its now waiting for the onscreen RUN button to be pressed..
I think that must be built into auggie.. but when I have Execute,1 anywhere in the scripts then  I no longer have to hit the RUN button..
and the g code starts running.



Thanks Gary 


Title: Re: reading Pokeys pins
Post by: gburk on July 02, 2019, 01:17:08 PM
Art

Been messing with the tool changer button scripts and if I use the Rapid moves I get strange behavior the x y z don't move but axis 6 and 7 do

I changed the rapids to Feedto and Freeto that seems to work better, I also have a Engine.GC ode move to return to the x y z start positions that I have zeroed out at start but the x y z seem to always return to .0330 not sure why.. here is a couple lines of code that seems to work, also when using the rapids and it was running rapids on the FreeAxis when I hit the EStop the Free axis keep running..

    Engine.Fe edTo(SafeX, SafeY, SafeZ, null);
   //Engine.GCode("G0 X"+SafeX+" Y"+SafeY+" Z"+SafeZ);
   //Engine.RapidTo(SafeX, SafeY, SafeZ); // move at current feedrate to safe position
   block("MotionSti ll");
   //yield();
   Engine.Fr eeFeed(null, RackMovei n, RackRotat e, null);
   //Engine.FreeRapid( null, RackMovei n, RackRotat e, null);
   block("FreeStill");
   //block("MotionSti ll");

Gary


Title: Re: reading Pokeys pins
Post by: gburk on July 02, 2019, 02:42:24 PM
Art

Ran into another problem, if I boot auggie and enable EStop then press the tool change button tool1, I get a crash I attached the screen capture of auggies error message, auggie shuts down when I close the error dialog..

But if I boot auggie enable EStop and then RUN the script in the script window I don't get a crash when I hit tool1 button..
This is a strange one...

Gary



Title: Re: reading Pokeys pins
Post by: ArtF on July 02, 2019, 07:02:37 PM
Gary:

 Thx, Ill see if I can reproduce ..

Art


Title: Re: reading Pokeys pins
Post by: gburk on July 02, 2019, 08:24:12 PM
Art

Sorry again seems like that's all I say to you ???

anyway I think the major problem was running the debug version.. .
I think I said when I first started with the debug ver that when booted in simulator mode that a script was stuck running and the script blue led keep flashing
when I hit Stop the script would stop but I would get the message scrip stopped with errors check log.. I am going to assume that script was messing things up.

So I went back to the last version of auggie no DEBUG, now it seems to be running Ok...

The only problem I seem to be having is if I use RapidTo or FeedTo the system seems to loose it position's
If I boot and the machine and work DRO's are set to 0.0 I run the script with Rapid or FeedTo and then Rapid or FeedTo back to 0.0 the machine cord's and work cord's change the machine may now be at .029 and the work at 0.029 and the more I run it the more they change and I always zeroed out the axis's before running again..
Also I start getting weird values when I read GetAxisPo s the first run it shows 0.0 now when I run it again I get unreadabl e values looks like 0.e0100 not exactly like that but you get the picture..

Now if I replace the Rapid and FeedTo with Engine.GC ode(gcode); it seems to run A lot better I don't seem to get weird numbers back from GetAxisPo s when I zero out the axis's before I rerun the script it seems to always show 0.

So not sure if it's me but this is my results..

Also is there a way to run FreeAxis With Engine.Gc ode(); or similar?  so far the only way I seem to be able to move the FreeAxis's is with the FreeFeed or FreeRapid .

Thanks gary


Title: Re: reading Pokeys pins
Post by: Mooselake on July 03, 2019, 10:20:11 AM
The only problem I seem to be having is if I use RapidTo or FeedTo the system seems to loose it position's

Any chance that's because your accelerat ion settings are too high?

Kirk


Title: Re: reading Pokeys pins
Post by: ArtF on July 03, 2019, 07:21:31 PM
Gary:

 Ill check the Rapid and Feedto to see why their different than Gcode..
and Ill re-release with release version, now that we've tested the debug.

  The reason you see that script is that one exists in the standard saved screen.
One of the panels calls a script that fails and then ignores it. I havent been
able to update the panel yet in the release, so if you enter in debug it logs it,
otherwise it doesn't. Its from an old panel and Ill see if I can update that
file in next release, Ill try for one this weekend. 

Art
 


Title: Re: reading Pokeys pins
Post by: ArtF on July 04, 2019, 10:40:44 AM
Gary:

  I found the crash was due to no tool number being set, it was defaultin g to tool #-1267 for some reason.. who knew.. I made it default to zero. No more crash.

  I cant find any real differenc e between rapidTo and Gcode calls for a rapid, but if it
works better Id stick to GCode. Unfortuna tly in the case of the freeaxis, there is no gcode
interpret er assigned, just a planner which is fed by freeFeed and Freerapid .

New version is online to fix the crash and it may also explain weird numbers in
some circumsta nces..

Art


Art


Title: Re: reading Pokeys pins
Post by: gburk on July 04, 2019, 11:23:19 AM
Art

Thanks will try it out and let you know how it go's

Gary


Title: Re: reading Pokeys pins
Post by: gburk on July 04, 2019, 04:37:42 PM
Art

Defiantly Seems a lot better I went back and tried RapidTo and don't seem to be losing place between the mach dro's and the work dro's
Only time it seems to mess up if you hit Estop then the mach dro's stop there and if you zero out the work dro's, then I hit tool1 button and the mach x dro is sitting at 2.0 and the tool1 button is script is set to send the x to 2.0 it doesn't move and the x work dro is sent to 0...

I don't see a command to set the machine cord dro's to a position. . only to get the truepos .

also if for some reason you hit the EStop say after the x y z have moved and its moving axis 6 and 7 everythin g stops as should be..
But if I hit EStop again the code doesn't run the 6 and 7 axis were Estop was hit but does continue running the script from the next line I have a rapidto there to return to the original position. . I would think you would have to hit RUN also in case you need to jog out of the way, kind of catches you by surprise Hit EStop and starts running right away, maybe hit EStop and should kill the script so you could start over... not sure how you have it setup.. or if i'm looking at the logic wrong.. most of the time I am..

Thanks gary   


Title: Re: reading Pokeys pins
Post by: ArtF on July 04, 2019, 08:16:37 PM
HI Gary:

  No , you have it right. There are very few safeties in the FreeAxis, it was a second planner
I tacked on because I could for running other motors or frequency channels.
  The only way to set machine coords is in a homed axis, same as Mach3,
Only homing will change the machine coordinat es. Various offsets are available
in the normal axis, I'm not even sure if they apply to freeaxis. Im a bit rusty
on some of the specifics of those interacti ons as I never use them with lasers.

  Glad its working better anyway.. that tooloffse t default could have been a
problem in many things.

Art


Title: Re: reading Pokeys pins
Post by: gburk on July 05, 2019, 07:06:31 PM
Art

Yes it does seem to be running better even with the rapidto, also I don't seem to be having the rewind on the first m6 call, I did end up removing the Enabling the RUN call so after the tool change dialog I just hit RUN and it seems to continue ok...

Now do you think it will matter much if I do a RapidTo() 2.0 and it stops at 1.994 it seems to do this on a regular basis but if I rapidto() back to 0.0 right after that it does stop right at 0...

checked the same code with Engine.GC ode and it didn't stop at 2 either stopped at 1.994..

Thanks gary



Title: Re: reading Pokeys pins
Post by: gburk on July 06, 2019, 07:50:05 PM
Art

Came across another problem maybe me don't know its a strange one and tried many time to get past it with no go..

So I have the tools buttons tool1 thought tool16

So I copied and pasted the code from tool1 to each tool function one at a time and compiling them as I do each one
Now I pasted the code to tool4 and I get compile errors..
I cut the code from tool4 and it compiles again no errors, so now I start pasting code into tool4 one line at a time and compiling it, so when I pasted about 10 lines and compile no I get the compile script error again I remove the last line and it compiles again.
So I typed a Rem line //testing error and compile it again and get compile error.

No matter what I type on the last line I get compile error...

So one though was the scripts may be limited to how many lines can be compiled. ..

Any thought on this I know its a strange one.

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on July 06, 2019, 08:09:26 PM
Gary:

 There may be a limit to a scripts size based on the language interface . I havent hit
one yet and Auggie deals with all Scripts as single CStrings() , which have a defined
limit of over 2 billion character s. However, monkey script itself may have some internal
limitatio n I am not aware of.
  Any idea of the number of character s you have when it fails? Is this failing in the Script
window on a run, or when checked back into the libraries?

Art


Title: Re: reading Pokeys pins
Post by: gburk on July 07, 2019, 09:15:20 AM
Art

It was failing when I added the code line the hitting RUN...

So of course it was bugging me all night, so first thing this morning I decided to delete the script file..
I then entered one tool change function at a time, it has a little less code per function now, and all 16 tool functions are working,,
don't know what will happen as I add more code to each function but will find out later...

anyway it does seem to be working now, i'm thing maybe some sort of a glitch somewhere in the code not one I was able to see
spent a lot of time on till I decided to delete old file and start again

You didn't mention if you thought that I would be alright running with the dos's not running to the values I entered 2 seems to stop at 1.994 does it with all the axis's
but if I enter for it to return to 0.0 it doe's ok

Gary


Title: Re: reading Pokeys pins
Post by: gburk on July 07, 2019, 07:54:16 PM
Art

It was working then I went to add or modify the code, if I check back in the lib I see no errors in the lib, but if I edit the lib and do a RUN I get compile erorrs

If I hit the tool1 button it runs OK except the machine and work cord seem messed up now if I set the dro's to 0 and them run the script, I added a print to show the start x y z axis positions i am getting them with GetAxisPo s(1 2 and 3) I don't get a 0 value I will get what seems random values one time I will get 0.033 but I don't get 0 even though the DRO's are set to 0

My thought is because I am getting the compile errors problem is I don't see anything wrong, only seems to happen after adding or editing the script, but once it starts I have to redo the entire script..

Do you think I should break up the tool chance script into 3 or 4 separate scripts, there is 16 functions in the script. I haven't tried that yet maybe next thing to try.

Thanks gary 


Title: Re: reading Pokeys pins
Post by: ArtF on July 07, 2019, 08:51:41 PM
Gary:

 Breaking it up will probably get it to run. I will check into the GetAxisPo s
to see what the error may be. Ill see if I can figure out why the limitatio n as well,
though I may not be able to do much on that score..de pends on its cause.

Art


Title: Re: reading Pokeys pins
Post by: gburk on July 08, 2019, 09:26:36 AM
Art

Update
I deleted the entire script and folder..
Started from scratch..
Now tool1 seems to be working getting the correct Positions values the only thing I see is I do a Gcode  or Rapid move on x y z then I do FreeTo
when it does the free move I get the message buffer underrun. . still seems to jog to the correct value though. and now returns to 0..
Still stops a little short of the distance entered seem to be the same every time

if I enter 2.0 axis go's to 1.9994 same for all axis's off just a tad..

I think a lot of the problems are from the scripts getting corrupted don't know why, have typed in some code into notepad++  and copy and pasted into auggie
just a thought..

I have had to redo the tool button scripts from scratch 3 or four times now confused as to why, I did split the tool change into two lib scripts one with tool 1-8 and the other with toll 9-16 will see how that go's..

The getaxispo s is ok I think when the script gets corrupted it for some reason messes that up also..

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on July 09, 2019, 07:21:44 PM
Art

Have a spindle problem, not sure if is me or something internal,

If I do a M3 S3000 the spindle and relays turn on as expected. . and the speed is ok.

Now if I do a M3 S0 it seems to mess up it looks like auggie is calling all the M3 functions over again, turning on relays again, and I get the message spindle turned on it should be turned off I have gone though the code and when I get the spindle speed = 0 I call the spindleof f() function it seems to turn off the spindle and relays but then it looks like it starting the M3 again and turning on the relays

M5 Works fine everythin g turns off.. Only problem is M3 with a value of 0.

not sure if i'm being clear?.

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on July 09, 2019, 08:02:58 PM
Gary:

  I think you'd have to add to the SpindleOn script a check of the speed, and if
its zero, just turn it off. I suspect auggie is getting fooled by the m3s0 and not
really knowing what to do. I dont think m3s0 is a typical command, though I can
see where it would have it uses.

Art


Title: Re: reading Pokeys pins
Post by: gburk on July 10, 2019, 08:51:38 AM
Art

Yes I already had a check for 0 if speed = 0 then SpindleOf f() it just reacts weird to m3 s0 its fine if m3 is >0 it runs the relays and spindle as expected. .

But if I enter a m3 s3000 all is good then if I enter another m3 with s0 is when it messes up.

I have nothing in the code for it to do anything other the relays and spindeoff with m3 s0.,,

Thats why I am thinking if you already sent an m3 s-speed, then another one m3 s0 the second m3 seems to rerun the m3 from the beginning  and not just change the speed... I attached the script..

Gary


Title: Re: reading Pokeys pins
Post by: gburk on July 10, 2019, 02:46:36 PM
Art

Did some more messing around with the m3 calls
best I can tell auggie calls, gobal SetSpindl eSpeed = function( speed ) is called first, I put a print statement in that function also a sleep(10)
I also put a print statement in global SetSpindl eState = function( state ) and a sleep(10).

it printed the print from gobal SetSpindl eSpeed = function( speed ) but the sleep didn't seem to have any affect there.. it printed the print from SetSpindl eState = function( state ) with no delay at all, but it did sleep after the print in SetSpindl eState = function( state ).

So it looks like every time a m3 is called it runs both functions so endless i'm not getting this, and i'm probably not, is if a m3 s200 is call the fist m3 call its good
Now if I call it again m3 s0 or any value it auggie is calling both functions again, so  the  SetSpindl eState = function( state ). is calling spindleOn again and it does set the speed to 0 but it is messing up the relays, that are set with the first  spindleOn call...

let me know if you get what I'm trying to say a little confusing

New update

made a few changes seems like it may work here is some of the code let me know if you think its Good or if I may have a problem with it somewhere down the road.
still have the long delays but seemed to do what I expected now..

global MySpindle Output = 5;
global MySpindle Axis = 5;
//global SpindleMO DE = 0;
global SpindleDe vice = Motion();
 
//Sets the Spindle speed, triggered by S3000 fo example
global SetSpindl eSpeed = function( speed )
{
    print("first speed");
    SpindleSp eed( speed );
};
 
//Set Spindle State.
global SetSpindl eState = function( state )
{
    if (SpindleMO DE == 0 || state == 0)
    {
    //1 = CW, 2 = CCW, 0 = off
    print( "Setting Spindle with " + state);
    sleep(10);
    switch( state )
    {
        case 1: {  if( lookup("SpindleOn")) { SpindleOn( ); }; }
        case 2: {  if( lookup("SpindleRE V")) { SpindleOf f( ); }; }
        case 0: {  if( lookup("SpindleOf f")) { SpindleOf f(); }; }
    };
   }
};
 
 
global SpindleOn = function()
{
    global SpindleMO DE = 1;
    FreeSetSp eed( MySpindle Axis, GlobalGet("SpindleSp eed")); //turn on spindle
    print("Frequency Spindle was turned on");
    print("Set to Frequency " + GlobalGet("SpindleSp eed"));
};   
 
//this is a relay spindle control,
//it will use only the OC output #1
//to control a relay to turn a simple
//on/off spindle, on or off.
 
global SpindleOf f = function()
{
    //FreeSetSpeed( MySpindle Axis,0); //turn off spindle
    print("Spindle speed zeroed turned off");
    global SpindleMO DE = 0;
   
}; 
 
//this is a relay spindle control,
//it has no speed control but this dummy
//routine will stop any error, and maybe
//test for zero speed.
 
global SpindleSp eed = function( speed )
{
    print("Entering SpindleSp eed function "+speed);
     sleep(10);
     if( speed != 0)
     {
      Maxspeed = GlobalGet("MAXspindl eSpeed");    // Max spindle speed
      zerotohun dred = (speed / Maxspeed) * 100;   // Get PWM5 value to set the spindle speed 0-100 for 0-10 volts
      SpindleDe vice.SetP WM( MySpindle Output, zerotohun dred  );
      print("Spindle Speed set to " + speed );
     }
      else
      {
      SpindleDe vice.SetP WM( MySpindle Output, 0 );
      print("Spindle Speed set to " + speed );
      };
};   

Is there a way to check to see if when sending an m3 if the S is sent also, from what I can tell if no S code sent its doesn't call the spindle speed function
but it still calls the spindleon with no speed setting so I can't check for 0 speed...
 

Gary



Title: Re: reading Pokeys pins
Post by: ArtF on July 11, 2019, 11:52:54 AM
Gary:

>>You didn't mention if you thought that I would be alright running with the dos's not running to the values I entered 2 seems to stop at 1.994 does it with all the axis's
but if I enter for it to return to 0.0 it doe's ok


  Yes, thats fine, its not unusualy to stop just short of a step. So you probably are
using 166.6 steps per inch or mm.. Mach3 does the same, it knows internall y where you are
as a number of steps, not a position really.

Im still reading your scripts, but the command m3 literally means turn
on spindle while S means set speed. Typically you turn it on and then only use
S commands to change the running speed. So M3S0 wouldnt be quite the same as
M5 as a stop. Speed is set first when command are on one line, this is just a priority
thing and the spindle speed has higher priority than spindle on.

  Now when you call M3, the spindle is set to on, then your script is called.
If the M3 is seen again it does the same. Now I could change this internall y
so that if M3 is called when the spindle is already running, the M3 could
be ignored. The S command will still work, you dont need an M3 before
every S command, just for the first turn on.

  That may be the best way around it.

Art


 


Title: Re: reading Pokeys pins
Post by: gburk on July 11, 2019, 12:42:25 PM
Art

Thanks I think I may have it figured out, not being a programme r I sometimes get lost in the logic maybe most of the time.
Anyway with a few global var, placed in the right spots I do have it running fine...

Now that I when from testing m6 to m3 I see that the g code I sent you has no S commands only m3 so spindle turning on but not moving..

So I had to edit cambams post again re ran it an now I have m3 S3000 in the g code,

I ran the g code it was looking good all relays turning on and off spindle flood exc.. tool change dialog also..

But seems like cambam left out the m8 after doing the two dill pecks cycles. so when it started to run the pocket holes no flood strange not sure if I can fix that in the post..

anyway seems like I got the m3 m4 m5 scripts going ok.. tool change seems ok also, so maybe I can clean them up a little now...

I'm sure I will have more questions, we came a long way..

Thanks again Gary


Title: Re: reading Pokeys pins
Post by: gburk on July 11, 2019, 01:40:28 PM
Art

Just an update I was able to get the m8 working right with cambam now...

But one problem, still having the m6 called twice on first run...

if I run stop and run the g code again its fine, seems only when the code is first loaded then run to runs the first m6 t twice..

Do you think the buffer underrun I get when running the freeaxis's will be a problem?..

told you I'd have more questions ..

do you want a new copy of the g code its not much different other than m8 is where it should be and m3 now has the S in the g code..

Also I don't think I ever mentioned this but 98% of the time when I shut auggie down it close's them reboots it's self..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on July 11, 2019, 07:50:50 PM
Gary:

>>if I run stop and run the g code again its fine, seems only when the code is first loaded then run to runs the first m6 t twice..

  Ill continue to try to find that one, I have seen it occur, just not repeatabl e for me for
some reason.

>>Do you think the buffer underrun I get when running the freeaxis's will be a problem?..

  Hard to say. Buffer Underrun means for some reason the system ran out of data
from a planner. OR it may feel its out of position, so let me know if you see
ill effects, as your doing mill work your stressing the program more than most
of us with lasers.

>>Also I don't think I ever mentioned this but 98% of the time when I shut auggie down it close's them reboots it's self..

  Sign of an internal memory fault as it shuts down, Some windows will restart the
program in such an event, others wont. I suspect the scripting has some dangling
memory at times, and as it trys to delete it at shutdown it creates a memory
fault. Doesn't matter at that point really, but windows see's it as an error and
restarts if the group policy tells it to.

Art






Title: Re: reading Pokeys pins
Post by: gburk on July 13, 2019, 04:13:18 PM
Art

I don't think there is much going on when I run freeaxis all other motion had stopped.., so far I haven't seen any problem with the buffer underrun message..

I have a pokeys board question don't know if you will have an answer...

I ended up putting 2 more relays in so if I wanted to switch from pokeys control to manual,  so the switch and relays turn on the spindle and forward relays but of course there still connected to the plugs in the pokeys relays.. so if there is no power going to the pokeys and I turn on the manual relays it seems to power up the pokeys I assume it is feeding back somehow though the pokeys relays and powering the pokeys board do you think it should back feed power to the pokeys and the pokeys power up like normal..  I know weird question if its there or not I will make it happen..

Gary


Title: Re: reading Pokeys pins
Post by: gburk on July 17, 2019, 01:01:22 PM
Art

Have a question about reading and writing to files,
How can that be handled with a script, I tried a few ways I have done it in c++ and c but not having any luck getting it to work..

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on July 17, 2019, 08:08:43 PM
Gary:

 Script commands do exist for several file interface commands
in script. What kind of file are we talking.. . text, binary, data, gcode?
 

Art


Title: Re: reading Pokeys pins
Post by: ArtF on July 18, 2019, 07:30:29 AM
Gary:

  As a general guide, if you look in the scripters command list
youll see many file functions . To access them you use this syntax..

myfile = system.Fi le();
myfile.Op en("*"); //using a * will open a search dialog. A name will open that file.

you may then use the other file primitive s on the myfile object.

Art


Title: Re: reading Pokeys pins
Post by: ArtF on July 18, 2019, 09:10:24 AM
Gary:

 Here is a sample script using the file system for spirals.
It is written by YaNvrNo awhile back during developme nt.

Art
 


Title: Re: reading Pokeys pins
Post by: gburk on July 18, 2019, 07:57:31 PM
OK thanks ART

at the moment I just wanted to save text file or read text files..

I am attaching another g code file its pretty busy has pocketing peck drilling and engraving, I did a dry run in auggie and it seemed to run fine but still calls the first m6 twice, maybe you can see something in this one you couldn't see in the other g code file I sent you..

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on July 23, 2019, 03:22:11 PM
Art

Is this a good way to read a file or do you suggest a different approach ?

global next_line = table();

myfile = system.Fi le();
myfile.Op en("*");
line = 0;
next_line[line] = myfile.Re adLine();
 while (next_line[line] != EOF)
   {
     line = line + 1;
     next_line[line] = myfile.Re adLine();
     if (next_line[line] == null)
     {
      exit();
     }
     print(next_line[line]);
   };
 
Gary


Title: Re: reading Pokeys pins
Post by: ArtF on July 23, 2019, 04:14:07 PM
Gary:

 Looks as efficient as any script ID write. Good job.

Art


Title: Re: reading Pokeys pins
Post by: gburk on July 23, 2019, 05:18:28 PM
Art

One problem on large files it seems to read the EOF before its read the whole file at least it exits the loop and stops printing

small files its good, don't see any errors popping up is there a buffer limit to a table ?..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on July 23, 2019, 07:21:44 PM
Gary:

 Im sure a limit may exist, but I dont think in this case, unless one line gets too
large it shouldnt run into memory problems.

  Your routine will skip the first line though... Id suggest the following change.
I might add the the null check may not be necessary as the print routine shouldn't
fail on a print(null) and it is possible for readline to return null without being at
the end of a file.

line = 0;
next_line[line] = myfile.Re adLine();
 while (next_line[line] != EOF)
  {
     print(next_line[line]);
     line = line + 1;
     next_line[line] = myfile.Re adLine();
     if (next_line[line] == null)
     {
       print("Null line found before end of file"); //can be ignored in many cases..
       exit();
     }
   };

Art
]
 


Title: Re: reading Pokeys pins
Post by: gburk on July 24, 2019, 09:24:42 AM
Art

I gave it a try same results, it seems its reading the end of file early...
It printed part of the file then quit, I assume it thought it read EOF, because it didn't print the null line..

it seems to run for a few second before it starts to print, I have no delays in there.. do you think its looping faster that it can print to screen..?

I will try looping with no print just storing the text lines in the table then print out the table in a loop worth a try..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on July 24, 2019, 09:44:02 AM
Gary:

 There shouldnt be any buffer limit for the file, but the table may have a
line limit. Try replacing the same table line each time and see if it reads
the entire file. Im not sure the error, I havent played with files much, just
scripting tests early on for putting out point clouds and such.

Art


Title: Re: reading Pokeys pins
Post by: gburk on July 24, 2019, 10:56:45 AM
Art

Will give that a shot, I added line numbers to the print, one file reaches line 48 before it thinks it is reading a null and the other file stopped at line 46 before nulling out of the loop..

so could be table does have a limit and one file has more char's per line than the other so reads a couple more lines..

tried printing the file and only using a var next_line no table clearing the var each loop but did the same thing..
I wouldn't think there is some sort of looping limit going on?. just a thought

Update I have tried a few different txt files now and seems to make it to line 50 then exits the loop no print output so its not getting  the null check just quits looping at or just under 50 lines of text..

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on July 25, 2019, 01:30:10 PM
Art

I tried a loop that should loop 200 times and reading the file but it seems after 50 line read it exits the loop it doesn't print any of my messages like it hit a null or EOF or file closed just exits the loop.. here is a sample..

 global next_line = table();
fileload = function()
{
myfile = system.Fi le();
myfile.Op en("*");
line = 0;
next_line[line] = myfile.Re adLine();
 dowhile (line !=200)
   {
     print("Line # "+line+"  "+next_line[line]);
     line = line + 1;
     next_line[line] = myfile.Re adLine();
     if (next_line[line] == EOF)
     {
      print("EOF Reached");
      myfile.Cl ose();
      print("File Closed");
      return;
     }
     if (next_line[line] == null)
     {
      print("Line = Null");
      myfile.Cl ose();
      print("File Closed");
      exit();
     }
   };
myfile.Cl ose();
print("File Closed");
 };

fileload();

this script also only print 49 or 50 lines

x = 0;
dowhile( x < 400)
{
 x = x + 1;
 print("X = "+x);
};

gary
 


Title: Re: reading Pokeys pins
Post by: gburk on July 28, 2019, 04:12:39 PM
Art

I removed the print during the loops, and only printed the last line read and line number when exiting the loop.
Its seems to finish looping this way, so it does seem that the print() is doing something to the loops if printing every line in the loop..
then it doesn't finish the loop or give an error either..

but read a 5000 plus line file not printing the lines only printed the last line on exit of the loop and it printed line 5082..



Gary


Title: Re: reading Pokeys pins
Post by: Ya-Nvr-No on July 29, 2019, 11:04:12 AM
have you tried a
sleep(.04); //of some micro second
after or before a line read?
sounds like reading of the file or printing is causing a buffer spooling/overload/limit of some kind.

I believe Art is off cruising on vacation.



Title: Re: reading Pokeys pins
Post by: gburk on July 29, 2019, 03:25:14 PM
Ya-Nvr-No

Thanks that seemed to fix it I thought there was a buffer problem but had no errors, I wouldn't use the print while loading a file normally but was testing to make sure the entire file was loaded, and it is..

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on July 30, 2019, 05:39:33 PM
Hi Gary:

   Sorry I missed that one, luckily YaNvrNo was around, he knows Auggie
pretty much as well as I and somewhat better in scripting . He was instrumen tal
in its developme nt. Im deep into serious math learning for an upcoming (perhaps)
module Im writing so Im a bit intermitt ant. When the math gets too deep
for me I tend to lose track and hadnt checked in a few days to see how this
thread was doing (for some reason it no longer sends me notificat ions on this
thread.).

  Glad the fix helped, probably the print buffer was filled and waiting for a sleep or
yield to get time to finish its work.

Art


Title: Re: reading Pokeys pins
Post by: gburk on July 30, 2019, 07:20:29 PM
Thanks art

I have run into a small strange issue when running a g code file it seems to run at a good speed then for no reason at least no one I see...
when it gets to running a profile it runs great then it hits a spot and the Feed rate seems to slow down in half it may make I or two passes then the feed rate go's back to normal, I have look in the g code file at the lines it seems to slow down but I don't see any thing different that could make it slow down so much..

The feed rate is constantl y changing form Z that I have at F10 and X Y at F30  it almost seems like it just all of a sudden reads the F10 and doesn't switch to F30 for the x y
the feed rate lines are always back to back Z F then change to X Y Feed,  looks like next time it gets to the next feed rate change it's back to normal
then maybe 3 or 4 passes it will do it again...

not sure if it me or a buffer problem  the g code file is over 5000 lines..

I did test this with motors connected and running but cutting air...

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on July 30, 2019, 07:38:28 PM
Gary:


 What is your look ahead set to? Try 500 or so. See if that cures it.
Auggie is different in the way it plans, it will achieve whatever speed it can
up to demanded feedrate speed by adding lines and re-planning after each line
to see if it can readjust the previous lines speeds to go faster. When it starts
to move it has already planned its stop. So, if lines get added, as they always
do it will look ahead about 1/2 second, lock up to there and replan the
rest of motion to ensure its going as fast as it can, while knowing exactly
when it will run out of commands and stop  with normal decel.

   Ive seen what you describe, usually in arcs as they can have a lot of
very tiny moves, the type of thing that used to make Mach3 stutter.
Setting a longer lookahead tunes it to that kind of code and allows much
smoother motion on micro gcode motions.

 

Art

 



Title: Re: reading Pokeys pins
Post by: gburk on July 31, 2019, 08:26:18 AM
Art

Ok will give it a try and let you know how it go's..

I was not getting alert messages for this site either, what I had to do was login to my internet provider account and shut off blocking or spam and then I started getting the alerts and all messages. .

Did the look ahead change and its fine now so that was the problem..

Gary


Title: Re: reading Pokeys pins
Post by: gburk on August 02, 2019, 04:12:06 PM
Art

I can't figure this out anything I enter below the last print line in this script I get compile error if I remove the line after the last print it complies fine..
and I don't see anything wrong with the code..

maybe it will compile for you, it imports into the LIB and doesn't show an error in the LIB only when I try to compile in the script window..

// Library Probing
// Created  Sunday, April 16, 2019
// Author  Gary       -- Do not edit above this line
// Z probe touch off                                             
  // ex: global mylibprob e = function(axis,distance,feedrate,touchPlate);
 
 //Z Axis probe, distance to move down, fast feedrate, slowfeed rate, touch off plate thickness if 0 no plate
 
 global ZreturnPo s = 0;
 
 global Z_ProbeTo uch = function(distance,Ffeedrate,Sfeedrate,touchPlate,retracthight)
{
   if ( Ffeedrate <= 0 || Sfeedrate <= 0 || distance <= 0 || retracthi ght <= 0  )        // Axis needs to be 1 to 3 feedrate can't be 0
    {
      print("Error: Sfeedrate - Ffeedrate - distance - retracthi ght all need to be higher than 0 "); // error wrong axis number or no feedrate entered
      return -1;                             // exit probing
    }
   
  XstartPos = GlobalGet("Axis1CurP os");     // 1 = X save the x start position
    YstartPos = GlobalGet("Axis2CurP os");     // 2 = Y save the y start position
    ZstartPos = GlobalGet("Axis3CurP os");     // 3 = Z save the z start position 
   
   print("distance = ",distance);         // just a test will remove
   print("Ffeedrate = ",Ffeedrate);         // just a test will remove
   print("Sfeedrate = ",Sfeedrate);         // just a test will remove
   print("touchPlat e = ",touchPlate);      // just a test will remove
   print("startheig ht = ",ZstartPos);      // just a test will remove
   print("retracthi ght = ",retracthight);   // just a test will remove
 
   GlobalSet("ProbeInve rt",0);   // set probe to normal state = false
   
   Gcodestri ng = "G90 G31 Z-" + distance + "F" + Sfeedrate;      // gcode string G31, axis Z, distance, feedrate
   Engine.GC ode(Gcodestri ng);                          // probe  DRO distance down in Z
   block("MotionSti ll");                             // wait for all motion to stop, no system delay for this.
 
   if( !GlobalGet("ProbeHit"))                         // If probe not hit Error
   {
     print("No probe Hit..Ente r a Higher Travel Distance or may have missed part/touchoff plate.");  // no probe hit probe stopped to high, travel distance to small or missed plate
     Gcodestri ng = "G90 G01 Z" + ZstartPos + " F" + Ffeedrate;    // gcode string G01, Z, Zstart Position, fast feedrate
     Engine.GC ode(Gcodestri ng);                         // Return to Z start Position
     block("MotionSti ll");                                // wait for all motion to stop, no system delay for this.
     return -2;                                           // we didnt hit the probe during the move, exit probing with ERROR code
   }                                                   
 
     print("Probe Hit");                               // Great probe was Hit
     sleep(0.5);                                    // lets take a short nap
     GlobalSet("ProbeInve rt",1);                           // invert probe switch 1 = true
     ProbePos = GlobalGet("ProbePos2");                       // Z probe Save position to probepos
     Gcodestri ng = "G31 Z" + ProbePos + "F" + Sfeedrate;      // gcode string G31, Z, slow feedrate just a short distance
     Engine.GC ode(Gcodestri ng);                             // probe upwards slowly till switch releases
     block("MotionSti ll");                                // wait for all motion to stop, no system delay for this.
 
       if( GlobalGet("ProbeHit"))                         // probe released upward travel all good
       {
        Engine.Se tAxisPos( null, null, touchPlat e );         // now set Z position to touchoff plate thickmess or 0 if none
        yield();                                              // take a break
        sleep(0.5);                                           // and a nap
        Gcodestri ng = "G01 Z" + retracthi ght +" F" + Ffeedrate;  // gcode string G01, Z, fast feedrate to retract height
          Engine.GC ode(Gcodestri ng);                             // do the retract
        block("MotionSti ll");                                 // wait for all motion to stop, no system delay for this., 1,
        print("Z Axis Height set, probe complete." + retracthi ght ); // yes show message Probe completed and retracted to                           
       }
       else                                                      // Looks like probe not released don't know why but ERROR it
       {
        print(" Error in Ztouch Backoff" );                // probe didn't open don't know why
        return -3;                                   // Return ERROR message
       };
  ZreturnPo s = GlobalGet("Axis3CurP os");             // 3 = Z save the z start position 
  return 0;                                          // No errors probe done return 0
};        
 

// Find the center of X!, probe the Z first why we want to know the Z zero so the probe can
// start below the parts surface the probe will move half the parts langth plus over shoot
// then the probe will do a g31 probe move down to make sure the probe if off the parts surface
// if the probe is hit than enter a larger distance for X length, if hit the probe will
// rapid move up to Z start position and then rapid back to X start position. now enter a
// larger X distance. .
// We do the g31 move down so the probe doesn't get bent or broke, the Z stops if the probe
// isn't off the part, and travels to the entered distance below surface to start the X probe
// Then g31 probe movers back to parts edge when hit rapids back and g31 probes again saves the
// X position rapids back on X then rapids up to Z start position, now rapids back to X start
// position now rapids to X- and repeats all the preious moves.. saves the X- posistion
// now the part center is half the distance between X and X-, probe rapids up to Z start
// position and to parts new center and the Z dro is set to 0.
 
global  ZeroXCent er = function(ZDisDown,FastFeed,SlowFeed,TouchOffPlate,retractheight,belowpart,xlength)
{
  print("Find the X center ");
  if (FastFeed <= 0 || SlowFeed <= 0 || ZDisDown <= 0 || retracthe ight <= 0 || belowpart <= 0 || xlength <= 0)        // Axis needs to be 1 to 3 feedrate can't be 0
  {
   print("Below part " + xlenght);
   print("Error:  Z Distance Down - FastFeed - SlowFeed - retractHe ight - below part surface need to be higher than 0"); // error wrong axis number or no feedrate entered
   return;                                        // exit probing
  }

 XstartPos = GlobalGet("Axis1CurP os");     // 1 = X save the x start position
   YstartPos = GlobalGet("Axis2CurP os");     // 2 = Y save the y start position
   ZstartPos = GlobalGet("Axis3CurP os");     // 3 = Z save the z start position 
 
  // touch off Z first and retract then do the X move to the X -pos first
 ZTouchOK = Z_ProbeTo uch(ZDisDown,FastFeed,SlowFeed,TouchOffPlate,retractheight);
   if (ZTouchOK != 0)  // if not 0 must have errored
   {
    print("Zprobe Touch Error Exiting X Centering " + ZTouchOK); // Show Error
    return -1; // Exit with Error
   }

   // Z probe done with no errors now lets try X probing
  print("Zprobe Finished No Errors Now moving X " + xlength);            // No Error Continue Probing
  Engine.Ra pidTo((xlength / 2) + belowpart, null, null, null);  // move to half the part langth plus a little
  block("MotionSti ll");

  ZTouchOK = Z_ProbeTo uch(ZDisDown,FastFeed,SlowFeed,TouchOffPlate,retractheight);
   if (ZTouchOK != 0)  // if not 0 must have errored
   {
    print("Zprobe Must have hit top of part enter a Larger X length Aborting X Centering " + ZTouchOK); // Show Error
    Engine.Ra pidTo(XstartPos, null, null, null);  // move to half the part langth plus a little
    block("MotionSti ll");
    return -2;  // Exit with Error
   }

  // now we will start the X probe to parts first edge probe not hit
  GlobalSet("ProbeInve rt",0);   // set probe to normal state = false
   
  Gcodestri ng = "G31 X-" + xlength/2 + "F" + Sfeedrate;  // gcode string G31, axis Z, distance, feedrate move back twards part
  Engine.GC ode(Gcodestri ng); // probe  DRO distance X-
  block("MotionSti ll");

   if( !GlobalGet("ProbeHit"))      // If probe not hit Error
   {
    print("No probe Hit..Ente r a lower xlength to far off parts edge.");  // no probe hit probe stopped to high, travel distance to small or missed plate
    Engine.Ra pidTo(null, null, ZstartPos, null);  // move back to safe z height
    block("MotionSti ll");
    Engine.Ra pidTo(XstartPos, null, null, null);  // move Back to X start position
    block("MotionSti ll");
    return -2;   // we didnt hit the probe during the move, exit probing with ERROR code
   }

// X probe was hit so far so good
  print("X Probe Was Hit Retractin g Z then moving to X+ Postition");
    XNegPos = GlobalGet("Axis1CurP os");     // 1 = X save the x start position
  Engine.Ra pidTo(null , null, ZstartPos, null);  // Rapid to Z safe Height
  block("MotionSti ll");
  Engine.Ra pidTo(XstartPos, null, null, null);   // Rapid to X start position
  block("MotionSti ll");

// now move to X+ position for next probe
  Engine.Ra pidTo(-(xlength / 2) - belowpart, null, null, null);  // move to half the part langth plus a little
  block("MotionSti ll");

// now we will start the Z probe to to make sure we are off part
  GlobalSet("ProbeInve rt",0);   // set probe to normal state = false
   
  Gcodestri ng = "G31 X" + xlength/2 + "F" + Sfeedrate;   // gcode string G31, axis Z, distance, feedrate move back twards part
  Engine.GC ode(Gcodestri ng);       // probe  DRO distance X-
  block("MotionSti ll");                    // wait for all motion to stop, no system delay for this.

  if( !GlobalGet("ProbeHit"))      // If probe not hit Error
   {
    print("No probe Hit..Ente r a lower xlength to far off parts edge.");  // no probe hit probe stopped to high, travel distance to small or missed plate
    Engine.Ra pidTo(null, null, ZstartPos, null);  // move back to safe z height
    block("MotionSti ll");
    Engine.Ra pidTo(XstartPos, null, null, null);  // move Back to X start position
    block("MotionSti ll");
    return -2;   // we didnt hit the probe during the move, exit probing with ERROR code
   }
// X probe was hit so far so good
  print("X Probe Hit");
    XPosPos = GlobalGet("Axis1CurP os");     // 1 = X save the x start position
};

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on August 02, 2019, 09:55:22 PM
Gary:

 Ill check the code, I may have length limits on the script screen, though I
didnt think I did... Ive never hit one, but I probably havent tried one that long..

Art


Title: Re: reading Pokeys pins
Post by: ArtF on August 03, 2019, 08:02:02 AM
Gary:

 Can you attach that script as a file, I cant copy from the editor, it adds spaces and such and makes it impossibl e to run without a lot of debugging ..

Art


Title: Re: reading Pokeys pins
Post by: gburk on August 03, 2019, 11:52:49 AM
Art

can do, I have figured out a work around for now, I worked on the scripts yesterday and created a lib for each function a lot of lib's but they seem to compile this way with no errors...

will upload later..

Gary


Title: Re: reading Pokeys pins
Post by: gburk on August 03, 2019, 12:09:13 PM
art

here is the file..

I did find one thing, as is it the file errors for me but if I remove all the rem // lines before the second function it compiles fine, also if I leave the rem// lines and remove 6 or 7 lines at the end of the function it complies, it really seems to me there is a limit to how many lines will compile.. .

gary


Title: Re: reading Pokeys pins
Post by: ArtF on August 04, 2019, 04:52:31 PM
Thx Gary:

 Ill check it out

Art


Title: Re: reading Pokeys pins
Post by: ArtF on August 04, 2019, 05:24:06 PM
Gary:

 Found it. Limit was 9999 character s, I have increased it by a factor of 10,
I will do a release of the new version by next weekend.

Art


Title: Re: reading Pokeys pins
Post by: gburk on August 04, 2019, 07:11:56 PM
art

if you have time and could check why the g code rewinds on the first m6 before you post the new update..

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on August 04, 2019, 07:55:47 PM
Gary:

 Ill see if I can duplicate that again.

Art


Title: Re: reading Pokeys pins
Post by: gburk on August 06, 2019, 03:35:01 PM
Art

Trying to get PWM spindle running correct.

I get the spindle and relays to turn on forward and reverse, but I need to set the S to over 700 or 800 before the spindle will start to spin
so any suggestio n as how to tune it or do you think the KB spindle speed controlle r pots will need adjustmen t...

It works fine in manual mode turning the manual speed pot.
I don't want to mess that up trying to tune the KB pots and messing up manual mode..
do you think I will mess manual up messing with the adjustmen t to get PWM from pokeys working better?.

 Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on August 06, 2019, 08:05:17 PM
Gary:

 
You will need to scale it for proper use. The number you send to
the SetPWMDut y call is 1.0 for full speed.
If you script in the test window and do a Motion.Se tPWM(n, 1.0)
where n is the channel, does the spindle go full speed?
 Does SetPWM(n,0) slow to a stop? When you set duty to 1.0,
the PWM should now be running at 100%.  You then measure
actual spindle speed, and in your spindle script on the S call
you would set the PWM to a scaled amount... as in

 float duty = CalledFor Speed / ActualRec ordedMaxS peed;
SetPwmDut y( n, duty ).

  so if you had a S5000 call, the script would calculate

float duty = 5000 / 20000;
SetPwmDut y( n, duty ); //which would set it to 25% with .25..

  So the question is, what do you get with a SetDuty to 1.0
or 0.0, that should be max and min of the pwm output. There are many ways
to do a scaling, some linear, some not, but you need to make sure the PWM
is actually having the proper effect first at 0 and 100%. If you have a voltmeter
at 100% it should read full voltage out for that pwm channel. See what you get as
outputs with those tests..

Art




Title: Re: reading Pokeys pins
Post by: gburk on August 07, 2019, 10:53:36 AM
Art

here is the voltage results I am getting out to the Mill from pokeys

I started at S300 = volts .590
S400 = .758 no spindle running yet
S500 = .928 no spindle yet
S600 = 1.101 no spindle
S700 = 1.283 spindle starts to turn checked with dig tach RPM = 150-152
S800 = 1.426 RPM = 350-355
S900 = 1.638 Didn't check RPM
S1000 = 1.817 RPM = 760-770s

zerotohun dred = (speed / Maxspeed) * 100;
this is the way I am getting the pwm value
speed = M3 S value
MaxSpeed = the max RPM allowed its read from a DRO that I entered the value 3500 MaxSpeed=3500.

I'm not good at math..

I also tried this with mach4 and ESS Smoothste pper with almost the same results..
So I assume I may need to adjust the KB pots max and min, I just don't want to mess up the manual control..

Hope this helps..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on August 08, 2019, 06:05:52 AM
Gary:

   Your formula is correct, I had mistakenl y thought it was
set for 0-1 as a range, but I checked and your right, I
implement ed it as 0 - 100, so your formula works fine.
 
  S1000 = 1.817 RPM = 760-770s

  So far, this looks typical for a non linear spindle
control, usually at low PWM they can be very off,
however the formula can be changed to take much
of that into account in Auggie if you know the numbers.
Can you tell me what S3500 does? Thats the most important
thing to know. If 3500 is your max, what does the
PWM put out at 3500. ( 100 being now sent to the pwm duty.)

  Im suspectin g its about 3.5 volts, the maximum output
of the pwm channel. So let me know if you do indeed
get 3.5 volts at S3500 in your current setup, and what speed
that makes the spindle run at.

  Many of these spindles take 5volt PWM, and you have only
3.5 volts. Usually the spindle has a control pot for that
, a gain or "P" adjuster to let it max out at 3.5 volts
instead of 5. Then there's a linearity pot to control
how linear it is over the range. There are also simple
conversio n circuits that can change the 0-3.5 to 0-5 volt
levels.

  It may not be necessary though, if the 3.5 volt output
S3500 is high enough in speed then the formula
 
zerotohun dred = (speed / Maxspeed) * 100;

  can be changed to be nonlinear over its range
to make things run closer to reality. Let me know the
voltage of the S3500 and the end speed, we'll
continue the conversat ion then as that really
dictates how you need to proceed.

Art

 


Title: Re: reading Pokeys pins
Post by: gburk on August 08, 2019, 12:25:18 PM
Art

I will check it again but I did do some voltage tests before connectin g it to the mill

and I think the pokeys is suppose to put out 0 - 10v spindle output, I never could reach that at max spindle rpm setting highest voltage
I was able to get was 8.4vdc I'm sure the original motor controlle r was 0 -10v not sure on the new KB will have to recheck that..
and the version of pokeys I have doesn't have a pot onboard for the spindle output volts adjustmen t.

With the smoothste pper and c82 bob, that also uses PWM for spindle I can reach 10.2vdc at max Spindle RPM

I will run a test on the mill and see what my dig tach read at max RPM.. and get back to you

I have a math problem for you, but I most likely will need the formula for dummies term...
I am setting up a new 3d printer and I had so 3/8-12 lead screws laying around so that's what I am using for the 2 Z motors
I need to figure the steps per mm there direct drive no pulleys, that's all the info I have on the screws there set at 32micro steps in the software

I went back and checked the KB manual and it looks like P1 and P2 should be getting a analog of 0 - 5v
maybe sending to much?..



Gary


Title: Re: reading Pokeys pins
Post by: ArtF on August 08, 2019, 08:59:34 PM
Gary:

  Sorry, I had forgotten the Pokeys had a spindle output, Im so used to
simply using the PWM channel outputs. So your using the pins 1,3 of the
10 volt spindle output?
   You have to make sure you use the Pin1 as ground for the spindle output
and not the pokeys ground. Im assuming all thats ok.. so the voltage should be
0 - 10, but I wouldnt be surprised by 0-8.4, a lot depends on current drawn.

  So I guess the question is, what is the max voltage you get when you send
100 to the duty cycle command, with and without the spindle controlle r
hooked up?

  If the book says 0-5 probably best not to go over, Id just use 0 - 50.0
as the duty cycle setting if thats the case. (or whatever duty cycle sends 5.0 volts.).

   If it IS set for 5 volts, that may be limiting the 0-10 as it would draw too
much current as the voltage gets above 5.

 Setting steps/inch or steps /mm is pretty simple. You dont need to do much math.

1) Set steps per unit to 1000 on the axis, and zero its position.
2) Command a 5" move. Measure the result distance moved.
3) calculate newsteps =  1000 / (actualdis tancemove d / 5.0);
4) Set steps/unit to newsteps.

  Once done, your pretty close. Now do a move of 10" as a test
and repeat the formula using what you now have entered in the
steps/unit setting. ( as in)

//repeat following until stepsPerU nitSet stops changing or changes very very little.
//the longer distance you move, the more accurate you will be. This will dial
in any system very quickly and is the only way I ever calibrate distance. It shows
up any errors that may exist.

1) Command 10" move
2) calculate newsteps = stepsPerU nitSet / (actualdis tancemove d / distancec alledfor);
3) enter newsteps as steps/unit

 
Art



 

 


Title: Re: reading Pokeys pins
Post by: gburk on August 09, 2019, 07:21:38 AM
Art

spindle voltage with or without being connect is the same doesn't see to drop when connected if it does it's only by .1 or so..

OK i'll cut the voltage down..

I know with mach4 and smoothste pper I get just over 10volts

The lead screws with 12 turns I assume is different, so my best bet would be a dial indicator and adjust it by distance traveled 
I have the steps set at just over 4000 but the screws seem to be noisy, I'll print something out from my delta printer to mount a dial gauge..

I just did the max rpm test

set S3500

voltage was 8.3
dig tach reading was 6670 - 6690 close to double.. can't say the tac is 100% correct either..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on August 10, 2019, 01:38:27 PM
Gary:

 So then your off by a factor of two, so changing the formula
to  duty  = (speed / 6680) * 100; sounds about right..

 You command 3500 and the formula provides a duty of 50.0,
command 6680 and you'll get 100.0 , which is whats giving you 6680
right now. So in the script where you control the spindle speed,
just do a check and set the duty cycle..

if( speed > 6680 ) speed = 6680;
SetPwmDut y( channel, (speed / 6680) * 100.0 );

  This is only a first order appoximat ion but should
be accurate enough. You can get more complex with
tables of values or nonlinear formulas for any
nonlinear speed relations hips, but typically a
first order is enough..

Art


Art




Title: Re: reading Pokeys pins
Post by: gburk on August 10, 2019, 04:05:48 PM
Art

I'm Not 100% sure you understoo d what I said, or i'm not getting what you saying

6680 is what the reading was from the hand held dig tach so there is no feedback going to auggie seeing that auggie can't read an index or rpm value.
so I don't think there is any way for me or auggie to test for speed > 6680... and that will change with all M3 S setting..

I think seeing that the speed is close to double form what I set in auggie M3 S3500 and spindle is running at 6680..
then most likely just divide the duty in half...

But do you think this will help at the low RPM's I can't get the spindle to turn at all till I send at least S700 so I have to send enough voltage to start the spindle and that's seems to be around 700 RPM and I forget but somewhere over 1volts

Not sure if this is correct thinking. or its messed up in my mind

Tested again S2200 is reaching max close to max voltage if 5v is max.. and a rpm reading of spindle at 4700 and 4.95v
the lowest speed is S500 and its voltage is 1.2 and 60 Rpm so it seems it does need at least 1,2 volts to get the spindle moving..

Gary


Title: Re: reading Pokeys pins
Post by: gburk on August 10, 2019, 06:21:06 PM
Art

Have Another script and panel for you to check out
Hoping the math is correct, its a start for auto calculati ng the motor steps per, for the entered distance and distance traveled and old steps..

Gary

 


Title: Re: reading Pokeys pins
Post by: ArtF on August 11, 2019, 11:09:29 AM
Hi Gary:

  I'm leaving in a couple days for Alaska, and wont be back for a couple weeks, so Ill
check it out then.

  As to Spindle Speeds.. What I was describin g is what you do when a S word is called
for it terms of setting the duty cycle..Il l elucidate ... :)

 Here is what I have for your spindle speed setting script.. Ill display just
the lines that set the Spindle speed when it see's a S word in the Gcode.



global SpindleSp eed = function( speed )
....
....
 zerotohun dred = (speed / 25000) * 100;
 SpindleDe vice.SetP WM( 2, zerotohun dred );

  speed is whatever your Gcode called for S word..
It seems, like most of us you have a minimum speed..
so the easiest way to handle it is as in ..

zerotohun dred = (speed / 25000) * 100;
SpindleDe vice.SetP WM( 2, zerotohun dred );

  The above assumes your max speed is at S25000 which then
translate s to 100.0 as a PWM setting, if you change 25000
to your actual max speed call this will then be accurate.

To check for a minimum you simple do this..

if( speed < 700 ) speed = 700;
zerotohun dred = (speed / 25000) * 100;
if( zerotohun dred > 100) zerotohun dred = 100;
SpindleDe vice.SetP WM( 2, zerotohun dred );

 So if the user enter S400, it will be translate d to S700
If he enters S56780 , the duty cycle will only be set
to 100, so max speed.

 SO the only number you need to figure out to make the above work
is the 25000 number, its probably more like 6000 for you. Just change the
25000 up or down until your upper S word is accurate. If the max your
spindle can do at 5 volts is 6680 RPM, just keep raising or lowering
25000 in the script until a call of S6680 is correct.

 As you say, Auggie doesnt read the speed so its all a matter of simply
scaling the users Sword to the proper duty cycle as above.. The 700
can be adjusted to whatever minimum speed actually makes the
spindle turn close to that speed.  This isnt unusual at all, most
spindle have no low end and are not very linear in control.

Art






 


Title: Re: reading Pokeys pins
Post by: ArtF on August 11, 2019, 04:32:31 PM
Gary:

 I should have mentioned, I updated Auggie for 10 times the script length as
a maximum. I still havent found that starting bug, but will search for it when
Im testing out your panels. :)

Art


Title: Re: reading Pokeys pins
Post by: gburk on August 11, 2019, 06:18:08 PM
Art

Thanks and have a great trip, I'm jealous I have always wanted to do the train ride up there.. maybe someday..

most likely will have plenty of stuff I messed up to bug you about on your return..

Thanks gary


Title: Re: reading Pokeys pins
Post by: Mooselake on August 11, 2019, 07:26:43 PM
Have a nice trip Art, and watch out for wild moose

Kirk


Title: Re: reading Pokeys pins
Post by: gburk on August 20, 2019, 04:04:04 PM
Art

Decided to give it a go in real life didn't go so good, the g code I am attaching doesn't seem to rewind, at first it was created with sheetcam. .

I ran the g code many times but just testing and seemed ok, I don't think the problem is the g code.

Here's what is going on with it,
I run the g code it go's ok but when my dialog pops up for a tool change, looks ok now I jog the z up to change the tool jog down to the parts surface set z to 0 and use the single line window to sent the z back to 1 g0 z1 now I exit the tool change dialog to hit the run button and its seems the g code has re wound.
doe's this every time.
Not sure where the problem is maybe I can't exit the g code window to the single line window and back again to the g code window..
any thoughts on this ONE.

Thanks gary   


Title: Re: reading Pokeys pins
Post by: BobL on August 21, 2019, 10:35:12 AM
Gary;

 I'm sure you already know Art is away on vacation, so I'm replying to say wish I could help with your code rewinding problem after a tool change, but this area of coding will definitel y require Art's expertise when he gets back?  I'll pass along the message when he gets back next week sometimes ..

Cheers
Bob


Title: Re: reading Pokeys pins
Post by: gburk on August 21, 2019, 12:30:13 PM
Bob

Yep knew he was gone but if I don't post things as I am testing and running into problems I seem to forget what was going on in a few days..

Thanks
Gary


Title: Re: reading Pokeys pins
Post by: BobL on August 23, 2019, 09:56:20 AM
Gary, thanks for your patience.

Cheers
Bob
 :)


Title: Re: reading Pokeys pins
Post by: gburk on August 25, 2019, 10:24:33 AM
Art

Did a test run on wood getting close ran ok, I don't have the steps dialed in 100% yet but heres a pic..

I think most of my problems are with the m6 dialog, I removed all the functions except the close dialog and seems to run a lot better..
It seems to me the dialog when called it pops up but still keeps running past the calling call so still executes every thing after its called till the end of the m6 call..
also found if I put say any engine gcode in the dialog close function it doesn't seem to wait on a MotionSti ll so if I say jogged to change the tool then exit the dialog and call a close function that wants to return to the Z X Y positions before the tool change all axis's move together  X Y and Z even with MotionSti ll after each g code move, I would like Z to move finish and then X Y move.. make sense?.
Also not sure what cause's the Z axis when jogging down to touch off top of part, it seems to jog ok but most of the time just before I near touching the part and tap mouse to jog it jogs and doesn't stop, it crashes the tool.. and I have to hit Estop..

But I haven't been getting the rewind problems now that i'm not doing to much with the toolchang e dialog just closing it, and using sheetcam  for the gcode
Gary


Title: Re: reading Pokeys pins
Post by: ArtF on August 26, 2019, 06:08:38 AM
Gary:

  It does sound like unexpecte d results of dialog operation . Never having been used
for the type of thing your doing I think your tests show they dont like running
in the context of a Gcode program.
  Ill schedule some time to run your examples to see if I can separate out their
spaces better. Its a very complex interacti on but it may be possible to add in
some sort of wait internall y for dialog completio n.

  Internall y, Auggie tags each 1ms waypoint with data as to what Gcode line
commanded it. As each executes, that data is checked to show what line is actually
running currently . (As you can imagine, the actual line running in the interpret er may be up to 500 lines ahead..).

  Im thinking this may be the root of the problem. As you command a move in the dialog
it is tagged with whatever line the dialog was on, but the interpret er may be several
lines ahead. The m6 dialog may have seen the current line executing as line 0 but was
called on line 10 for example when the interpret er was 10 lines ahead.  Ill take a close look in there to see what I can tag as special and to be ignored in setting the current operation line. Your experienc e is a good debugging indicator as to where the problem lies.

Art


Title: Re: reading Pokeys pins
Post by: gburk on August 26, 2019, 09:18:58 AM
Art

Thanks didn't think you would be back for a few days have a good trip?..

I have another question, it about jogging, is there a way to change jogging distance like micro steps maybe 0.001 0.010 for example
I have a hard time after I inset a new tool to jog down and touch off the part it always seems to move .1 or .200 when jogging and seems to do that always
when tool is just above the part and I hit the final jog button to touch off it jogs continuou s  till tool crashes and I have to hit estop or it will keep going

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on August 26, 2019, 09:11:31 PM
Gary:

  Ill take a look and see what I had put in for that possibili ty.

Art


Title: Re: reading Pokeys pins
Post by: gburk on August 28, 2019, 12:47:20 PM
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


Title: Re: reading Pokeys pins
Post by: ArtF on August 30, 2019, 01:25:23 PM
Gary:

   The granulari ty is what your describin g. What is your steps/mm ( or steps/inch?).

Internall y 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 increment s to .302, but this may or may not move anything as your
steps/unit may have a granulari ty 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



 


Title: Re: reading Pokeys pins
Post by: ArtF on August 30, 2019, 01:32:24 PM
Gary:

 When you put in the motions you describe, do you add the motionsti ll 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 processin g 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 MotionSti ll status...

As in

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


  Art




Title: Re: reading Pokeys pins
Post by: gburk on August 30, 2019, 01:43:44 PM
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

   


Title: Re: reading Pokeys pins
Post by: gburk on August 30, 2019, 02:03:59 PM
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.GC ode(ZStartPos);
yield();
block("MotionSti ll");
Engine.GC ode(XStartPos);
yield();
block("MotionSti ll");
Engine.GC ode(YStartPos);
yield();
block("MotionSti ll");

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


Title: Re: reading Pokeys pins
Post by: Mooselake on August 30, 2019, 05:48:37 PM
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


Title: Re: reading Pokeys pins
Post by: gburk on August 30, 2019, 07:13:38 PM
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   


Title: Re: reading Pokeys pins
Post by: ArtF on August 31, 2019, 07:08:52 AM
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 increment al jog,
 I assume your DRO is just tied to a G1 move button for the dro incrment?

Art


Title: Re: reading Pokeys pins
Post by: ArtF on August 31, 2019, 07:55:13 AM
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 restricte d 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 MotionSti ll 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 everythin g from dwell to toolchang es so its a pretty dramatic change.

 To test your problem I used


Engine.GC ode( "g1x10" );
Engine.GC ode( "g04P4" );
Engine.GC ode( "g1y10" );
Engine.GC ode( "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 operation s, use caution but I suspect
it fixes a great many script ordering functions and troubles youve had.

Ill post when fix in online.

Art
 
 


Title: Re: reading Pokeys pins
Post by: ArtF on August 31, 2019, 08:31:52 AM
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 considera tion. 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 toolchang ing issues..

Art


Title: Re: reading Pokeys pins
Post by: Mooselake on August 31, 2019, 04:26:43 PM
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


Title: Re: reading Pokeys pins
Post by: gburk on August 31, 2019, 07:21:56 PM
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 frustrati ng hobbie at times also have a couple 3d printers. .

Gary


Title: Re: reading Pokeys pins
Post by: gburk on September 01, 2019, 12:13:26 PM
Art

this is how I am exiting the toolchang e 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.

    GcodeRetu rnToPos[0] = ("G90 G01 X"+GlobalGet("Axis1CurP os")+" F20");
    GcodeRetu rnToPos[1] = ("G90 G01 Y"+GlobalGet("Axis2CurP os")+" F20");
    GcodeRetu rnToPos[2] = ("G90 G01 Z"+GlobalGet("Axis3CurP os")+" 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 MyToolCha ngeClose = function()
{
print("Exiting Manual Tool Change");
//print("Z position= "+GcodeReturnToPos[2]);
Engine.GC ode(GcodeRetu rnToPos[2]);
Engine.GC ode( "g04P4" );
//yield();
//block("MotionSti ll");
//print("Z position= "+GcodeReturnToPos[0]);
Engine.GC ode(GcodeRetu rnToPos[0]);
//yield();
//block("MotionSti ll");
//print("Z position= "+GcodeReturnToPos[1]);
Engine.GC ode(GcodeRetu rnToPos[1]);
//yield();
//block("MotionSti ll");
};

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.gc ode before the next one and it paused at the end of the first engine.gc ode so it waited a few after finishing to run the next line of engine.gc ode..

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.gc ode at the same time 

Thanks Gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 01, 2019, 08:37:06 PM
Gary:

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

Art


Title: Re: reading Pokeys pins
Post by: ArtF on September 02, 2019, 08:55:47 AM
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 coordinat es 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 coordinat e after the jog completes .

Art
 


Title: Re: reading Pokeys pins
Post by: gburk on September 02, 2019, 10:50:15 AM
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 toolchang e 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 automatio n 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


Title: Re: reading Pokeys pins
Post by: ArtF on September 03, 2019, 09:08:09 AM
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 recognize d 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 capabilit y?

Art


 


Title: Re: reading Pokeys pins
Post by: ArtF on September 03, 2019, 09:24:31 AM
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


Title: Re: reading Pokeys pins
Post by: gburk on September 03, 2019, 01:11:36 PM
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


Title: Re: reading Pokeys pins
Post by: Mooselake on September 03, 2019, 01:26:00 PM
Gary, what kind of load are you switching with those SSRs?  Do they need to be heatsinke d?  If you're blowing that many I'd suspect there's a problem with over stressing them.

Kirk


Title: Re: reading Pokeys pins
Post by: gburk on September 03, 2019, 03:56:36 PM
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


Title: Re: reading Pokeys pins
Post by: gburk on September 04, 2019, 01:52:06 PM
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


Title: Re: reading Pokeys pins
Post by: ArtF on September 06, 2019, 11:26:41 AM
Thx Gary:

 I think I know where the problem may lie..

Art


Title: Re: reading Pokeys pins
Post by: ArtF on September 06, 2019, 11:40:45 AM
Gary:

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

Art


Title: Re: reading Pokeys pins
Post by: gburk on September 06, 2019, 03:34:21 PM
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.gc ode same results..

I mounted the relays back and reconnect ed 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 continuou s 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 


Title: Re: reading Pokeys pins
Post by: gburk on September 06, 2019, 07:37:54 PM
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


Title: Re: reading Pokeys pins
Post by: ArtF on September 07, 2019, 10:31:04 AM
Gary:

  Sounds like a resistive probe, there shouldnt be any conductio n when its open..
Perhaps cleaning it well, hard to say.

 Im not sure about the jog tap, Ill look into that, essential ly the mouse is captured
when you press a jog button, so any release is seen and used to stop. I'll do a couple
tests to see what may cause that ..

Art


Title: Re: reading Pokeys pins
Post by: gburk on September 07, 2019, 06:49:50 PM
Art

Think I have the probe letting the signal though and the led lighting dim messed with it awhile and looks like I have that fixed..

Still some probing problems I have to assume there internal to auggie…

If I hit touch off Z it runs fine touches off then backs off and then retracts to the set Z height.. I need to set a slow probe feed rate at 5 no more then 10.
or seems to loose steps mostly on retract.
But if I Zero the z now and then run the touch off Z again the feed rates are off it probes to fast and retracts to fast so it misses steps retractin g..
The touch off Z script has the slow feed rate setting in it only, so I don't understan d how if the script is run the second time it isn't running at the slow feed rate
it seems to ignore the slow feed rate on the second run, not sure what feed rate its using but way to fast and not the setting in the script..

update: I sleep on it last night and tried again this morning same problem..
It probes down and touches off good, problems seem when its backing off to open the probe signal I set invert probe to 1 and save the probe hit position and then try to back off to that position and open probe contact.
Its had to tell what's  going on from there but I thought it was loosing steps retractin g, but in fact motor its skipping but it looks like from the dro  that its still trying to move down so crashing into touch plate.
maybe I should not try to backoff and invert the probe.. and use a different approach

Thinking maybe probe down touch off, then reverse to just for example to 0.02 re probe down touch off again and save that as the top of touch plates position then backup to 1.0,  form what I can see the problem starts trying to back off from the saved probe hit position maybe it didn't overshoot that position enough to backoff and release the trigger.. the BOB probe led does stay on so it looks like it not releasing

I can't test it simulatio n mode because I don't seem to have a way to simulate a probe hit, would be a safer way to test..

Any thoughts on this approach.   

Gary


Title: Re: reading Pokeys pins
Post by: gburk on September 08, 2019, 10:32:58 AM
Art

Ran it again by using G31 Z0.2 that should be upwards retract the dro may be sitting at -.6 or -.5 when the probe is hit going down but for some reason still want to move in the neg direction .. during retract do you think there's a problem with the G31 Code? I can't seem to get any consisten ce one time it may work usable on the first run then it just is all out of wacke doesn't seem to know where it is sitting and wants to move down instead of up.

Gary     


Title: Re: reading Pokeys pins
Post by: gburk on September 09, 2019, 08:29:48 AM
Art

Sorry for all the messages. .

I ran a few more test this morning..

The touch probe that has a high signal till its hit, seems to work fine I ran 10 Z touch offs and with no problems back off was good no crashes thank goodness tips are expensive ...

It seems the problem is doing a tool touch off to a touch plate, my touch plate is set to low signal.
If I run the z probe hold the plate in my hand and tap the tool it seems to work every time.
But when I place the tool plate on the top of the part solid surface, is when it messes up probe hits and stops like it should but doesn't reverse instead of reversing it plunges down crashes, I'm using a gnd signal for the probe..
all tests were run with the same script..
Touch off plate is isolated.

both probes go to the same connector on the BOB, haven't taken the touch probe apart so not sure of it setup but must be grounded till hit.
don't see how to do that with a solid touch plate..
Endless timing needs to be fast when its hit..
Also the feed rate still doesn't seem to change correct if I set it to 5 it shows 10 or more in the feed rate dro   
I'm not sure what to do now

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 10, 2019, 02:58:46 PM
Sorry Gary, Hurricane had me out of power for awhile..

 So the touch probe works.. but the touch plate doesnt? But it does when its in your hand..
Just not when its on the part. Your stumping me as to cause. Must be some sort of ground loop
where your 0vdc isnt the same as ground at that point. You must be in a bit of a floating
ground at that point maybe? What does a meter say across the probe when jogged down to touch it?


  Ill check the feedrate display when changed, what command are you using to change it?
A Gcode command or a SetFeedRa te command? Or a Feedrate = xxxx type of thing..

Art
 


Title: Re: reading Pokeys pins
Post by: gburk on September 10, 2019, 05:08:52 PM
art

So you got the hurricane and it missed me sorry. I know what its like not to have power have lost it for over a week a couple times wouldn't mind but when it 95 and no air real tuff to handle..

I found a work around for the Feed rate I removed it form the Engine.GC ode and added the Engine.Fe edRate() at that seems to set the correct feedrates now.
I don't thing the Feed rate is a problem when running a gcode file only seemed to happen in a script.

Also I seem to have a new problem, here go's if I use auggies jog panel and jog to say .6256 then I zero the axis.
Now I use my jogging panel and set it to travel .02 and hit the jog button the first move is to .6256 and not to .02 the second move will be correct and only move .02 I know it doesn't make sense, telling it to move .02 and jogging to the last jogged position. .

as for the probe you have it right holding the plate in air works fine.
I have it attached to a .250 piece of plastic. hoping to isolate it..
The probe does trigger when hit going down and it does stop moving, I have a 0.04 sleep there it seems to get confused and doesn't reverse direction and I don't think it is backing off to invert the probe signal

Thanks gary 


Title: Re: reading Pokeys pins
Post by: ArtF on September 11, 2019, 01:22:00 PM
Gary:

  I think I see the pattern. It has to do with the GCode interpret er not knowing where it is after a script move.
When you issue a G1X.5, it really translate s to G1X.5 Y(Lastknown Y) Z(LastKnown Z)..etc..

   When running Gcode it knows last position, apparentl y Im missing the resyncing on some script calls.
A Engine.GC ode call should get position synced at this point.  After a probe the position should
also be synced. Keyboard jog will sync as of a version or two back, so by your descripti on it may be the zero
axis that isnt. How are you zeroing it? On the screen button?

  Ill check why a Engine.Gc ode didnt sync your feedrate as well. Sorry for all these bugs but we havent been
interupti ng Gcode for script runs till you started along your path. We'll catch them one by one..

Art
 


Title: Re: reading Pokeys pins
Post by: gburk on September 11, 2019, 05:09:15 PM
Art

Thanks hope I'm not being to much of pest, seems for the most part that auggies has been working for what it was intended till I had to mess things up ???

As far as zeroing the axis I am using the button when jogging.. probing I am setting the position in the script
but if I do a Z touch off with the button, and then Zero the axis with the button I don't see the dro move to the wrong distance,  endless when I zero the axis after the z probe its messes something up I can't see?.

I added the Engine.Fe edrate() to the probing and that's seems to set it correctly just in the Engine.GC ode from a script is where I see the problem..

I made a new wire for the touch off probe but didn't seem to fix it plunging down after the probe hit...

Its may work one time correct then crash on the next 3 runs.. then work correct, I tried feedrates from 5 to 100 not much of a change..

Thanks gary


Title: Re: reading Pokeys pins
Post by: gburk on September 11, 2019, 06:57:52 PM
Art

Messed with the probe some more, did the probe plate touch in air holding with my hand again
It also messes up if you don't just tap the tool with the plate if you hold the plate so it contacts the plate for any longer than a tap and remove it does the same thing as if plate on top of part..

so from I can see now is if the plate is triggered and not released in a few m seconds it doesn't reverse and release the signal and then retract, it instead plunges down

if you tap and release the plate real fast in air its ok.. Not sure how to correct this on my end seems like some sort of timing problem..

Hopefully this is correct let me know you thoughts on this..

Gary   


Title: Re: reading Pokeys pins
Post by: ArtF on September 12, 2019, 12:32:20 PM
Gary:

 Isnt that timing in your scripts? As I recall Auggie only probes to the hit and stops.
So after the hit, the script changes the direction and the probe trigger level, then commands
a move away from the plate. Did you put any prints in there to see if the commands to
reverse are in proper order. It may be for example, that your probe for some reason see's
the hit and stops, but then the hit is released as capacitan ce in the circuit builds
up a charge so it no longer see a short. I can see where that may screw up the logic of a
script if it checks for the hi or low before changing direction . If the hit only makes it a short
for a short while until it charges up, then the move away may just not move at all as it sees
the reverse probe move as complete. All Auggie will do is probe till hit , whatever hit is defined as..
a short or an open..

Art


  Im not sure anymore what logic was used for the probing in the scripts. Print
statement s may help find out whats going on in this one..

Art


 


Title: Re: reading Pokeys pins
Post by: gburk on September 13, 2019, 03:57:09 PM
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


Title: Re: reading Pokeys pins
Post by: gburk on September 13, 2019, 06:03:46 PM
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


Title: Re: reading Pokeys pins
Post by: gburk on September 14, 2019, 01:02:45 PM
Art

Tested mach3 now also same results as mach4 probe worked ok, the only differenc e 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.gc ode  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 differenc e 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


Title: Re: reading Pokeys pins
Post by: gburk on September 14, 2019, 07:07:40 PM
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.GC ode running with the feed rate, now the feed rate is changing correctly in the script..

Am I making any sense?.

Thanks gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 14, 2019, 08:49:07 PM
Gary:

 :), ok. Lets make sure I understan d. 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
   


Title: Re: reading Pokeys pins
Post by: gburk on September 15, 2019, 09:24:31 AM
Thanks art

Try to clear up the reboot.

When I exit and close out auggie, it looks like its closed but the profile identific ation 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 identific ation 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


Title: Re: reading Pokeys pins
Post by: ArtF on September 15, 2019, 10:12:38 AM
Gary:

 Thx. Unfortuna tely 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 "Automatic ally 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 "ProbeInve rt" it inverted that setting.
  The trouble is, I connected the probeinve rt 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 "ProbeLeve l" 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 ProbeInve rt is now set to false on startup. It was remembere d 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 declarati on or it will be set to
the last runs value. ProbeInve rt however, will always start false. It will be remembere d
for the run though. If you drop an LED on the screen and give it a variable name of ProbeInve rt
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 immediate ly though, wait till the probe is done or at last moving before setting
ProbeInve rt 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 possibili ties.


Art
 


Title: Re: reading Pokeys pins
Post by: gburk on September 15, 2019, 07:17:19 PM
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 probeinve rt,0 before the first g31 and a block("MotionSti ll") after the g31, then a check to see if ( Globalget("ProbeHit") probe was hit
if it was I do another probeinve rt,1 and then try to reverse the probe direction with a g31 till probe triggers, and another block("MotionSti ll").
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 triggerin g 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.. 

 


Title: Re: reading Pokeys pins
Post by: gburk on September 16, 2019, 09:36:51 AM
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


Title: Re: reading Pokeys pins
Post by: ArtF on September 16, 2019, 10:49:49 AM
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 internall y for the probe, scripts werent, I find under the new code, this makes it work properly synced.

GlobalSet("FeedMaste r",0);
Engine.GC ode("G38Z-10F50");
block("MotionSti ll");
Engine.GC ode("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 FeedMaste r,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


Title: Re: reading Pokeys pins
Post by: gburk on September 16, 2019, 03:59:34 PM
Ok Art

Thanks sorry, looks like I opened a can of worms.

Would you rather I  use the G38 over G31?

G38.2 G38.4 a little less coding my be able to eliminate the "ProbeInve rt"

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 16, 2019, 07:41:17 PM
Gary:

  I may end up adding support for probe pullout, but Ill wait till I see what all these changes do.
I have recoded the sync after probe as well as sync after zero axis. Its a lot of changes so I may
just release it with this done to see how it reacts before I add more. Ill see if
 I can get it out tomorrow or Wed.   Im getting much better results so far but Im only
running my own script tests, we'll see how you do. :)

Art


Title: Re: reading Pokeys pins
Post by: gburk on September 17, 2019, 01:16:58 PM
Ok Art

Thanks, was only kidding about g38.2 g38.4 got distracte d by a gran kit running around and never got to add that to the message..

and forgot to go back and edit it oops..

not sure how different our scripts are but for the most part mine did work except for the touch plate probing.. . and jogging the zeroing axis..

I did try to fix the windows10 auto reboot, auggie still reboots after I close it sometimes not sure what else I can change in windows 10,
so far auggie seems to be the only program on my computer that does this..

and it does it on both computers I have it on they have different cpus one intel and the other amd, but both run windows 10


Gary


Title: Re: reading Pokeys pins
Post by: gburk on September 17, 2019, 01:52:41 PM
Art


GlobalSet("FeedMaste r",0); I added this to the probe script, don't think it fix's the problem it a strange one I tried things different ly this test..

I ran the z probe g31 z-1 F5 then retract to g0 Z+ZstartPos F30 it worked good in simulatio n, now instead of jogging, I manual entered a 0.1 in the Z axis DRO
then ran the probe again  it probed to 1 and retracted ok to 0.1 but the feed rates were off it showed 3.3 and then 33 on retract, so now I entered 0.2 in the dro
and the feed rate changed again now it was 6 and 36 on retrack.. strange that changing the DRO value would effect the feed rate..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 17, 2019, 02:37:30 PM
Gary:

>>g0 Z+ZstartPos F30

  You mean you used g1 right? go wouldnt respect the feedrate, it would go full out
and just change the feedrate.

Art


Title: Re: reading Pokeys pins
Post by: gburk on September 17, 2019, 06:05:03 PM
Art

yep G1 and had another typo it was 5.3 not 3.3 Feedrate it was always a littler higher than the value I had in the engine,gcode..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 17, 2019, 07:43:37 PM
 Gary
 
Ahh ok. I had assumed the error was the one I foudn where sometimes the F word was
ignored. The LED on FeedMaste r was out so it should have worked in the GCode
but was ignored.  This version has a lot of changes, should be out tomorrow and
we'll see how the syncing goes..

Art


Title: Re: reading Pokeys pins
Post by: gburk on September 18, 2019, 09:47:09 AM
Art

Of course I didn't think the whole feed rate thing though and said it only went higher, then I remembere d I never tried it changing the DRO in the - direction so gave it a shot entered a -0.1 and the feed rate that had 5 in the gcode changed to 4.5 so it it does go down if you enter a neg value in the Z axis DRO..

Also I have noticed in the multi line mdi it only seems to run the first line for me..
I entered G0 X1 line 1 G0 Y1 line 2 but only line 1 runs no matter how may times I hit the Run button.

Gary   


Title: Re: reading Pokeys pins
Post by: ArtF on September 18, 2019, 10:32:33 AM
Gary:

  I just uploaded version 3.65 , lets see how it does on all these things. Theres quite a bit
of new code and calls to ensure syncing in scripts. The only rule is the need for a block
on motionsti ll after a probe call. There is also a known bug that in GCode MDI you cannot probe
unless a G0 is the next move, this is being investiga ted.

  Be cautious, with this much code chang eI worry about unintende d consequen ces...

Art


Title: Re: reading Pokeys pins
Post by: gburk on September 18, 2019, 11:49:58 AM
Thanks art

Will give it a shot tonight when it cools down alittle..

So no new script calls functions variables  just use what I have been using..

in the MDI I didn't use the probe call just the GO on each line and only would run the first line...

Gary


Title: Re: reading Pokeys pins
Post by: gburk on September 18, 2019, 06:41:00 PM
Art

Did al little testing, its some what confusing to me, so I will try my best to explain..

The probeinve rt keeps it setting now when rebooting ..

Tested the probe in the MDI one line G31 Z-1 F10, second line G0 Z0 F30, started to probe with dro's set to 0 so it probed till touch plate hit and stopped, ran the second line and it retracted back to start position 0..

Ran with the probe button and got mixed results, sometimes it would only probe down a real short distance and then retract not hitting probe, one thing I did seem to find if I ran it first in the MDI then the button script it did probe down and retract ok.. but never the same results more that once or twice. then it would go back to the old way and hit plate and not retract it would dive into plate..

It still seems to me that the system is getting lost as to where it is, not sure if its still between the mach cord and work, but it seems to get thrown way off even though the DRO's are zeroed

Also I ran into a problem with the MDI at a point, it seemed to stop working the script button would still run and axis move but the G31 Z-1 in the MDI stop working no axis movement. .

I think you are close with the probing..

I also ran simulator mode and had a lot of problems in that mode same as machine mode  but I took it a little further and was finding that if I loaded a gcode file and ran it, it would run maybe 1/4 or more though the file then auggie would crash, and I would get the dialog with a bunch of error lines and when I close out the dialog auggie would shut down also, I tried 2 different gcode files and both crashed auggie. tried it 4 times and crashed 4 times, I used the same gcode files in that last version with no problems. also was having major problem like before with jogging it seems to loose position when axis zeroed..

I also get a message after I run the jog script, then try to jog with the jog buttons I get the message wrong state for jog on axis.
If I hit estop and then estop on it works again..

Let me know where I have you confused, and I will try to explain that area better...

I thinking maybe we should just try to get the axis's to be in sink with the dros first then go from there. this seems to me to be messing things up somewhat.
mostly with scripts. the script gcode moves seem to be way off.. and feed rates still off..

you may want to pull this version from the web site just incase running gcode may be a problem..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 18, 2019, 07:50:19 PM
Gary:

   Ill be running a lot of code tomorrow on my laser so I wont pull it till
I have. Your pretty much the only one running Gcode driven scripts so
our tests shouldn't affect anyone else.

  I would stay away from simulator mode, theres too many things not
hooked into it, such as probing, all bets are off in sim mode if you
use a probe as it may well confuse it badly. So lets stay on actual
hardware till we know whats going on.

Ok, so lets take it a touch at a time so I can try to figure out whats up,
I cannot duplicate your hardware and Im simulatin g a probe with a button
so we need it to be simple tests.

>>Tested the probe in the MDI one line G31 Z-1 F10, second line G0 Z0 F30, started to probe with dro's set to 0 so it probed till touch plate hit and stopped, ran the second line and it retracted back to start position 0..

 OK, so thats good, no problem there.

>> The probeinve rt keeps it setting now when rebooting .

  This too is good, that fix seems to work.

>>sometimes it would only probe down a real short distance and then retract not hitting probe

  This one bothers me, it shouldn't be possible unless some script code is causing the probe to be interrupt ed
somehow.  My probe always goes down till I hit the button, then stops. This is all controlle d by the pokeys
BUT I can see if the sync if off before the probe call, it may go down a short amount as it doesnt really know
the correct starting position, so something prior to the probe would have to be screwing the sync. Perhaps
zeroing the Z axis maybe. Though I added code to try to ensure that cant happen.

 This is all too scattersh ot though, I need you to make a script that fails that I can easily test and we know it
will fail. Something like... run this script  call , jog left once at .01 and then the probe in the script doesnt
go down. Lets get this down to one example, that I can easily test with set parameter . Its best if ,as you describe
you can show me how to make the probe not go down all the way, in that scenario I shouldnt even have
to press the button. Lets get it to display one problem so I can kill it and then move to the next ..and so
on, I find Im having trouble duplicati ng your issue because I dont follow your workflow.

  If I can make it fail, its usually easy to fix, the problem is Im fixing what looks like it may fail..ins tead of what
does fail. The probe invert I could see so it was easy to fix.

  So if Im following you, I can zero my DRO's, then use the probe button and it doesnt always go down
all the way? Is this while running code and after an M6 hit, or just the pressing the probe
button in standby?

 Im thinking if th eprobe doesnt go down all the commanded distance the only possabili ty
is the engine isnt synced, we just need to figure out whats unsyncing it..

Art
   

 

 So can you give me a scenario and a script that fail?




   


Title: Re: reading Pokeys pins
Post by: ArtF on September 19, 2019, 06:35:20 AM
Gary:

  On reflectio n on this, Id like for you to try an experimen t for me,
can you reproduce the problem without triggerin g the probe at all.
So put the device at a good height. Make a simple GCode program..
like

G0X0Y0
M6
G0X10Y10
G0x0y0
m30

  Then, in the m6 dialog run, test your buttons. Can you make the probe not go down far
enough..i f so I can reproduce it by following your instructi ons. I should
be able to fix whatever we find, and then we can see if the probe hit
works after we make sure no-hit scenarios work. Im just trying to cut
down on the possible things that can be biting us.

Art



Title: Re: reading Pokeys pins
Post by: gburk on September 19, 2019, 12:14:03 PM
thanks art

Will test it on the machine later today.

As for the probe testing its always been tested with the probe on screen button and scripts, not with the M6 dialog so lets say the M6 call isn't in play endless I am running a gcode file..

I did reinstall the last version of auggie last night and had no problem running the same gcode file in simulator mode. but as you request I will try all testing now in machine mode..

Will get back to you later, I had a feeling you would want to throw in the towel after my last message.. :o

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 19, 2019, 12:27:49 PM
Gary:
 I think I found the major source of all this. Try the version I just uploaded.
I found if I zeroed the axis the next probe wouldnt work, this has been corrected so
now after a jog and zero the probe works fine.
  Let me know of any change.. Good luck

Art


Title: Re: reading Pokeys pins
Post by: gburk on September 19, 2019, 01:28:04 PM
Art

Will give the new version a try,

Think I have a few issues to work out first, I had a few minutes and went out to test, I am having homing problem now its will home but not backoff, I will check the pokeys config to see if any thing changed, but I do get the message axis homed, but I can't jog down, once it homed and I try to jog I get the message wrong state for jog on axis so i'm stuck and can't move the axis endless I hit estop and re hit estop..

I'm hoping it just because it not backing off.. I have auggie reverse set to true, or is this option just for the direction of homing and not back off?.
I did run mach4 a few days ago maybe it changed the pokeys config.. but I have homing set to backoff in mach4

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 19, 2019, 02:15:59 PM
  Gary:

   Hmm, you may want to update just in case its that bad version doing it. I took out some changes and fixed
a couple bugs I could prove. I dont think it woudl affect your homing but you never know.

Art
 


Title: Re: reading Pokeys pins
Post by: gburk on September 19, 2019, 06:17:32 PM
Art

I installed the new version, and fixed homing it was a pokeys config that got changed and the logic was wrong and there were no backoff pulse's.. so now backs off, and that also fixed the jogging not working when homed looks like it has to back off and the home switch needs to go off, or jogging does not work.

here is the code I tested it with its in inch

G0X0Y0
M6
G0X2Y2
G0x0y0
m30

Ok first m6 dialog I just hit exit and continue button worked fine the x and y moved good and returned to 0.. no problems
Second run m6 dialog I hit the probe Z touch off button
Its setup to read the probe.pan el dros.
It reads the Z Max Travel distance its set to 1, in the engine.gc ode  I have the Z set to Z- it should it go down works for me
Also reads Slow and fast feed rates 10 is slow 30 is fast at least what I have them set at
and the Retract if probe not hit will be set to the Probe start position usably = 0  endless you start from a different position

That worked fine did, not hit probe but went to -1 and retracted to 0 and then x and y moved to 2 and back to 0..

I did not do any manual jogging for this test...

Is this what you were looking for..?

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 19, 2019, 07:56:48 PM
Gary:

 Yup, thats  what I needed. So all that worked well. Now try it with jogging after the probe, or before
and see if it fails or works..

Art


Title: Re: reading Pokeys pins
Post by: gburk on September 20, 2019, 08:28:25 AM
Art

Tested
1 - ran gcode then jogged while M6 dialog displayed, exited without probe and all when good returned to 0 then x2 y2 and back to 0

2 -ran gcode  then jogged with M6 dialog and then hit Z touch off button let it run in air and go to max distance, all went well then went to x0 y0 then x2 y2 and back to 0..

3- ran this test 5 times, ran the gcode at M6 dialog jogged z x y then hit the Z touch off button, and let the probe hit the touch plate, it stopped good and retracted to Z1 correctly it did not seem to mess up at all never seemed to get confused and dive into the part just hit and retract..

I did not use an probeinve rt with g31 to backoff the probe I have a g1 or G0 I forget Z-RetractHight, Also I haven't tried the probing yet with the on screen buttons.

It looks good so far, any other test you want to try before I get ahead of us.. it may be a good day for testing cooled off a little at least for 24hours

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 20, 2019, 09:42:27 AM
Gary:

 No, Id say test at will now. I think the error I found was instrumen tal in all your problems.
Thats not to say other problems dont exist, but I like the way its looking so go ahead and play.
If you see a problem, try to isolate it down to a procedure just like you did with these ones,
if I can repeat it, I can find it generally, though Im amazed how complex it is in there..wh at
was I thinking. .lol..

  Thats the problem with a program like Auggie, you soon start to forget exactly how you
did what you did. It has a whole lot of things going on at once and its enough to boggle
my head if I get too scattersh ot.. :)

  Good work on the testing, Ill have to add you to the credits for probe developme nt.

Art


Title: Re: reading Pokeys pins
Post by: gburk on September 20, 2019, 04:06:42 PM
Art

Thanks that sounds good..

I did test it with the Z probe screen button and that worked fine also..

I did find a couple times that the after the probe was hit and retracted, I could not jog with the jog buttons got the message again wrong state for jog on axis
but its had to pin point it only does randomly, I assuming its like the homing if I didn't back off the switch I would not be able to jog.. so my best guess auggie for some reason misses the probe state when it releases but not to often though.

Also not sure if the Feed Rates are changing correctly, when it start the probe G31 F5 it seems to chance to 5 every time but when I do the retract to G01 Z1 F30
the feed rate seems to change to 15.75 not 30 and does this every time.. doesn't effect the probing just letting you know..
 
One question will auggie loose its home position on estoping , am I still good with the last homed mach position?. when I hit estop again..

Also I though you had said I needed a G0 before the probeinve rt,1 is that still correct of can I replace the G0 retract with a G31 to check for a release on the probe..?.

Thanks gary

 


Title: Re: reading Pokeys pins
Post by: ArtF on September 20, 2019, 07:30:19 PM
Gary:

 >> I assuming its like the homing if I didn't back off the switch I would not be able to jog..

   Shouldnt affect it really. Unless the home switch is also set as a limit, it will be ignored except in homing.
If it does share as a limit, then yeah, bad things can happen if it doesnt retract. There is a state DRO on the screen
on the right, you may want to take notice and see what it is when it refused to jog, let me know and Ill
see why its sticking in that state.

>>One question will auggie loose its home position on estoping

  No. Homing changes the machine coordinat e and is the only thing that does. So Estops dont matter.

>>Also I though you had said I needed a G0 before the probeinve rt,1 is that still correct of can I replac

  No, all thats needed is a block on motionsti ll after the probe, you can then invert and probe off.

>> when it start the probe G31 F5 it seems to chance to 5 every time but when I do the retract to G01 Z1 F30
the feed rate seems to change to 15.75 not 30

 Ill do some checks and see if I can repeat this, so far I cant get it to happen. Its a weird one..I cant imagine how
that feedrate number is changing. . is there a 15.75 anywhere in later code?


Sounds like its getting better, we're close. :)

Art






Title: Re: reading Pokeys pins
Post by: gburk on September 21, 2019, 02:07:19 PM
Art

Will let you know what I see, The feed rate may only be in the G01 from the script and not the G31..
and as far as I know there is no other feed rate changes going on.

May take a couple days having computer problems that's connected to the mills, haven't seems this yet, when I power the computer on all the drive lights power the power light comes on and sometimes I here the bios beep, then all power go off, tried booting 20 times or so and shuts off a second or 2 after power on.
if anyone has run into this let me know..

Thanks gary



Title: Re: reading Pokeys pins
Post by: ArtF on September 21, 2019, 02:14:52 PM
Gary:

 Did over 10,000 holes drilled today with auggie so the base seems ok..

Sorry to hear about the cpu.. it sounds like maybe a device is screwed, Id unplug all the drives and
devices and see what it does..

Art


Title: Re: reading Pokeys pins
Post by: gburk on September 21, 2019, 06:04:04 PM
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


Title: Re: reading Pokeys pins
Post by: gburk on September 21, 2019, 07:01:55 PM
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


Title: Re: reading Pokeys pins
Post by: gburk on September 22, 2019, 09:03:16 AM
Art

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

Now I added the probeinve rt,1 and the G31 Z0.1 F5 then motionsti ll 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 probeinve rt,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 different ly.

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 22, 2019, 11:12:23 AM
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 immediate ly 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 programme d.

 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
 



Title: Re: reading Pokeys pins
Post by: ArtF on September 22, 2019, 12:30:00 PM
>>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


Title: Re: reading Pokeys pins
Post by: gburk on September 22, 2019, 04:57:36 PM
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 


Title: Re: reading Pokeys pins
Post by: gburk on September 22, 2019, 06:38:09 PM
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 probeinve rt,1 release on back off or not, there is not much room for improveme nt. maybe only a thousand or so.

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 22, 2019, 07:14:59 PM
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 decelerat ion, so that varies with speed of approach. With a low feedrate and
fair accelerat ion, 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 experimen ts. Here is a photo of one of yesterday s 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.01R9 5" which means laser a hole
at 10ms long at 95% power. ), I have a PWM reformatt er 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


Title: Re: reading Pokeys pins
Post by: gburk on September 23, 2019, 08:20:50 AM
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 probeinve rt.

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


Title: Re: reading Pokeys pins
Post by: ArtF on September 23, 2019, 08:17:15 PM
Gary:

 Ill let you know..


Art


Title: Re: reading Pokeys pins
Post by: ArtF on September 24, 2019, 09:55:09 AM
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 commandin g it to.

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

 gcode  = "G91 G01 X.1"; switch to incrmenta l,
Engine.GC ode(gcode);
gcode  = "G90";
Engine.GC ode(gcode);  //switch back to absolute.

  and I used -.1 for the negative jog, all worked as I expected. The G91 makes it temporari ly incrmenta l..

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


Title: Re: reading Pokeys pins
Post by: gburk on September 24, 2019, 12:54:06 PM
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


Title: Re: reading Pokeys pins
Post by: gburk on September 24, 2019, 06:30:21 PM
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


Title: Re: reading Pokeys pins
Post by: gburk on September 25, 2019, 01:38:28 PM
Art

I Think I Got jogging working, It was as I thought I was trying to make things way more complicat ed 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 


Title: Re: reading Pokeys pins
Post by: ArtF on September 25, 2019, 07:49:48 PM
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


Title: Re: reading Pokeys pins
Post by: gburk on September 26, 2019, 01:41:35 PM
Art

I will also check the globals, I think right now only thing is the probeinve rt,1 backoff but works without it, but I got the impressio n from you that the 0 position could be closer than my results.. .

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 27, 2019, 10:04:24 AM
Gary:

 Well, the ProbeHit positions registers tell you the actual position of the hit. It then decelerat es to zero speed.
So its all a function of speed. IF your moving very slow, the probe pretty much can stop instantly . If you
query the hit registers and do a g1 to that location, your about as accurate as you can get.

  So the routine should be

1) probe down.
2) If probehit is true, read hit registers and do a g1 to that location.


   Its probe condition at that point is unknowabl e, it may close or not depending on system flex,
tolerance etc... but thats about as accurate as you can get ..

Art





Title: Re: reading Pokeys pins
Post by: gburk on September 27, 2019, 07:03:58 PM
Art

Back to computer power shutting off while booting, think it may be that the water pump died I got into the bios for a few seconds  to I see the cpu temp going to 130 and raising them power shuts off..

any way I had copied all of auggies files and folders to a sd drive a couple days ago.
And I have an old laptop so I installed auggie and then copied all the files folders to laptop, but auggies configs are not being changed.

The steps are staying at installed version and not changing when I copy all the files over, what file stores this info..
I had all the steps set good I was getting very good travel distances, I really am hoping I don't have to recalibra te again..
Seeing I didn't write them down.. :-\

any suggestio ns..

Gary


Title: Re: reading Pokeys pins
Post by: gburk on September 28, 2019, 07:59:36 PM
Art

If I ProbeInve rt,1 should that chance it from false to true in the planner config The ProbePola rity doesn't seem to change back and forth from false to turn,
always stays the same as you set it in the config.. so if I want to invert it to back off it doesn't seem to be inverting ..

Not sure want you are seeing this but maybe that could be part of my back off problem..

I ran one line of code in the script window to ProbeInve rt,1 and them checked the config it was still false.. don't know if you are updating the config on every change or not.. just a thought..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 29, 2019, 11:39:25 AM
Gary:

 No, the probeinve rt is a modifier. You can GlobalGet its value as its just a global. If set to true, it inverts the config setting as it sends it to the pokeys, telling the pokeys to expect it to trip on the inverse of your config setting. Ill trace to see why it
may not be respondin g that way.

Art


Title: Re: reading Pokeys pins
Post by: gburk on September 29, 2019, 03:59:00 PM
Art

Not sure how to test to see if its set to true or false

tried this but always get a 0 value.

GlobalSet( "ProbeInve rt", 1 );
sig = GlobalGet("ProbeInve rt");
print("Probe"+sig);

also you didn't say as to what file the config is saved in.

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on September 30, 2019, 10:17:01 AM
Gary:

 Think I see the issue.. Ill get back to you soon.

Art


Title: Re: reading Pokeys pins
Post by: gburk on September 30, 2019, 12:39:19 PM
Art

Thanks,

I would like you to check out this panel and script for auto calculati ng the steps, may save me some time recalibra ting the axis's, mainly check my math ???
it seems to work just needs some polishing up as long as the math is correct..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on October 02, 2019, 10:29:56 AM
Gary:

 Can you try this script and tell me if it prints 1 , then 1 ..

GlobalSet("ProbeInve rt", 1);
test = GlobalGet("ProbeInve rt");
print( test);
GlobalSet("ProbeInve rt", 0);
test = GlobalGet("ProbeInve rt");
print( test);

Art


Title: Re: reading Pokeys pins
Post by: ArtF on October 02, 2019, 10:43:45 AM
Gary:

 Sorry, I meant it prints 1, then 0, repeating each time. IT does that here and Im wondering if its just
a version mismatch between us or something ..

Art


Title: Re: reading Pokeys pins
Post by: gburk on October 02, 2019, 04:51:30 PM
Art

Ok That seems to works I get 1 then 0..

So it looks the same as the code I was trying and didn't seem to change to one at all, so what is the differenc e with the code?..

So then it must be working ?, i'm guessing my problem is when I reverse back off to the probe hit position, its not backing off far enough to trigger the probe off, and that's what is messing things up for me, because the next line of code is looking for the probe release and not getting it. so it thinks there is a back off error.
Doe's this sound like possibly the problem..

One other thing should it show a 1 true in the config, till its set to 0 false or auggie is rebooted?

Gary
 


Title: Re: reading Pokeys pins
Post by: ArtF on October 02, 2019, 09:11:54 PM
Gary:

 Probe invert will reset to false on startup. I suspect its because
your assuming the probe will stop in the same state that activated it.
Its not unusual for a probe to stop and be "unknown" in its state because its
on the hairy edge of making or not. It can be so close its making and
unmaking with vibration of the machine. Best now to assume a state.
You can ask it though by asking for GetPinDig on whatever the pin is, I fixed
that call so its accurate.

   Try a simpler test, make just a probe that probes down, then dwells for a second,
and then inverts the probe and probes upwards. Id bet the simple script runs fine,
but some logic in the entire script sequence is a bit flawed. You said you always read
0 for probeinve rt even if you set it to true, so look for some other script line that is
resetting it to false. It shouldnt go false unless Auggie is reset by script library reset
or restart,,

Art


 


Title: Re: reading Pokeys pins
Post by: gburk on October 03, 2019, 12:46:23 PM
Art

Ok will give it a shot got the new water pump so putting it in today and hoping the computer will run.

I am not clear on the ProbePrio rity  in the planner does than change when you probeinve rt or does that never change state endless you change it in the planner?

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on October 03, 2019, 02:07:55 PM
Gary:

 No, probe polarity never changes. It is the normal state of the probe , the invert only changes when you tell i tto, and always starts false.

Art


Title: Re: reading Pokeys pins
Post by: gburk on October 03, 2019, 06:18:30 PM
Art

Ok understan d the priority now..

here is a script I tried

GlobalSet("ProbeInve rt",0);
gcode = "F10 G31 Z-1";
Test = GlobalGet("ProbeInve rt");
print("Probe 0 = "+Test);
Engine.GC ode(gcode);
block("MotionSti ll");
gcode = "G4 P10";
GlobalSet("ProbeInve rt",1);
Test = GlobalGet("ProbeInve rt");
print("Probe 0 = "+Test);
Engine.GC ode(gcode);
gcode = "F10 G31 Z.1";
Engine.GC ode(gcode);
block("MotionSti ll");

I know a long dwell,
I started at Z0
when probe was hit Z DRO = -.5996
when probe backed off it released and stopped at -.5935

seems to work, like I had said I don't think I can get the probepos when hit and back off to that position, its just not backing off far enough to release the probe trigger.. in the script I set it to .1

it looks like it backed off .0061 before it released am I correct?....

or should I do a back off to where Z probepos was set, then set Z to 0 here, and then retract from here and not do a if ("ProbrHit") good it was hit ,or if not hit then back off error. most likely if I use the probehit position I will always get a back off error if backing off to that position.

It seems there will be a slight bit of differenc e from where it was first hit to where it was released, so now what value would you use for the Z 0
hit value or release value?.

Most likely not making sense...

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on October 04, 2019, 06:26:41 AM
Gary:

>>t looks like it backed off .0061 before it released am I correct?....

  Sounds about right, remember,  whether you back off with probe, or simply go to the hit point, your
within 1 step probably.  Probes are typically accurate to .001 or so, some much
more sensitive . This means you can never be sure if the probe is made or not
after a slow probe, since its that sensitive, the stop point could be a quantum
where the switch is buzzing closed or open due to vibration ..
  This is why I just probe down slow ( when I probe which is rare these days),
and accept the hit point as close enough, or pull back to the reported hit point
which is the exact step count where the pokeys saw the hit.
   

Art
 


Title: Re: reading Pokeys pins
Post by: gburk on October 04, 2019, 08:41:15 AM
Art

I think the best results are, to back off to the hit point... and not look for the probe to be released. ..

I added some code to the script I did a g01 Z +Zprobehitpos and set the dro to 0 then I manually  jogged up a little, and then sent a g01 Z0
The probe led lit when on top of plate  but I still could slide the touch plate without much trouble the tool wasn't so tight that it was forcing into the plate
If I Probeinve rt,1 and back off till probe releases then set Z to 0 do a manual jug up and then a g01 Z0 it stops just above plate the probe led doesn't light up
but I can't slide a piece of paper between the tool and plate.

So I am thinking I don't need to probeinve rt,1 and back off till release, it seems a little closer at the probe hit position that the back off..

or would you Zero at probe hit position, back off till released then g01 to retract Hight?.

or Zero at back off release position?

Thanks At least I think I have it figured out fairly good right now..

Yes back off with probeinve rt,1 was .0061
I also did a test that when I hit the plate i set Z to 0 and them g01 back off to the probe hit position and was getting between .0061 to .0066 on the dro

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on October 04, 2019, 08:57:22 AM
Gary:

 Any of those methods I think is fine..

 Your tolerance of .006 makes sense, thats one step of your motors. I wouldnt bother with invert myself,
its handy for auto measuring routines maybe, but just probing to stop and g1 to probe hit is about
as accurate as anyone needs.

  Thanks for all the testing, it made the scripting that much more stable..

Art


Title: Re: reading Pokeys pins
Post by: gburk on October 04, 2019, 11:45:38 AM
Art

Thanks for you work, to get it going.

I will work on cleaning up the z script and get the X centering to work for now.
then attach them to a message and you can look them over and leave them up or say OPPS you messed up..

Thanks for all your help..

When you get real board with not to much to do If you want to take on the task for spindle indexing I'll be around..

Gary


Title: Re: reading Pokeys pins
Post by: gburk on October 07, 2019, 01:20:35 PM
Art

I ran into a slight snag in my X center function. .

Here's what I have going on now...

I created a new panel that has DRO's for x y and z backlash that of course only works with probing, and my jogging function. .
Seems to work good with the Z probe so far got it to .002 now..

Z probing works good with every button press now no crashes.. .

Now the problem is with the X find center..
My code start off calling the Z probe function, just to make sure I know where the top of part is.. This works fine..

Now I move the X to half the length of the part plus overshoot, this also works good

Now I call the Z probing function again, I'm doing this to make sure you are off the parts edge, if probe is hit your X length is to small if not hit then probe the X..

The problem is when I call the Z probe function for the second time, it seems to ignore the probe hit and crashes into the part... the probe led lights.

I have looked at the code I don't see any reason for this, calling the same z probe function with 5 or 6 button presses works fine.
and the first call from the x centering function works fine, just not the second call from the x center function. .

any thought on this one..
bet you where hoping I was done, well so was I, sorry

Gary


Title: Re: reading Pokeys pins
Post by: gburk on October 07, 2019, 04:27:33 PM
Art

Just to make sure it wasn't the script I wrote another one to probe the z its a short one not doing much just probing and returning ..
and i called it twice for the x centering script..

got the same results probed great the first call, but crashes on the second, the second call to z probe the g31 z- moves the spindle down but doesn't stop on the probe being hit..

I tried yield(); and engine.pr ogramstop but no help..

It almost seems to me like if your still running in a function and make the second call to the z probe function something didn't get cleared out from the first call to z probe..

Making any sense?

tried a new approach
Put this in the script run window
This ran fine in the scripter.
probed good on both calls to Z_touch()

Z_touch(); // calls the global touch off function
Engine.GC ode("G4 P4");
Z_touch();


then dropped a button on the screen and created a global lib script
and this also crashes the tool on the second call to Z_touch()

global TestP = function()
{
Z_touch(); // calls the global touch off function
Engine.GC ode("G4 P4");
Z_touch();
};
 

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on October 07, 2019, 08:41:46 PM
Gary:

 Hmm, before I go digging, can you list the Ztouch script here..
Does sound like something s screwy.. Ill try dropping it in a button to see..

Art


Title: Re: reading Pokeys pins
Post by: ArtF on October 08, 2019, 08:50:43 AM
Gary:

 On a side note, I checked your step calibrati on scripts, math looks right in reading.. :)

Art


Title: Re: reading Pokeys pins
Post by: gburk on October 08, 2019, 12:32:31 PM
Art

Thanks for checking the math..

Here is the Z probe script that has problems with being called twice from a function. ..

Gary


Title: Re: reading Pokeys pins
Post by: gburk on October 08, 2019, 01:28:41 PM
Art

Not sure if you need the panel but here it is just in case.

Gary


Title: Re: reading Pokeys pins
Post by: gburk on October 08, 2019, 06:06:08 PM
Art

Decided to try not calling the Z probe function from the X center function and just added some of the z probe code to the x centering function so it all was in one function. .

I probed down hit the part top and retracted to .250. this worked good
Then I did a G01 X to move off the part but I used a small value so when I Z probed down now to see if I was off the part it would hit the part
and it did hit the part but same problem didn't stop crashed the part..

so not sure why it doesn't like to do a Z g31 correctly twice.. in a lib function. .

works fine if I do a button press, it probes z and retracts then exits the function.
Hit the button again and it will Z probe fine tried the button press 10 times in a row and worked every time..

Gary


Title: Re: reading Pokeys pins
Post by: gburk on October 09, 2019, 08:44:22 AM
Art

Last attempt.. for now

I loaded the lib function X centering into the script window
Then I rem // out the global function, and the start and end brackets.

I ran the script in the script window, it seemed to work there.
probed down hit probe retracted, then G01 over in the X axis no problem, now I probed down again in the Z hit part and retracted fine, the second probe on z would show as an error, "that you are not off the parts edge", then it would rapid back to X start position. . it all seemed to work fine..

I don't know of any other test to try..
But to me it all points to the lib function's not probing twice, but probes twice fine in the scripter and button presses..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on October 09, 2019, 11:53:05 AM
Thanks Gary..


 Ill see what I can find..

Art


Title: Re: reading Pokeys pins
Post by: gburk on October 11, 2019, 09:26:02 AM
Art

Ok thanks,

One new question, how do you change the colors in the panel the backgroun d of the panel, other than loading a bitmap image?
Some how one of my panels got changed to a light grey, and i see no color option except to load a new image, and i can't duplicate the default colors if i create a new image..

Thanks gary 


Title: Re: reading Pokeys pins
Post by: ArtF on October 13, 2019, 09:38:50 AM
Ill have to check Gary, Im not sure top of head. Ill post shortly.

Art


Title: Re: reading Pokeys pins
Post by: gburk on October 13, 2019, 11:48:53 AM
Art

Thanks

I did a different test with the probing..

I loaded the x center script in the script window, and at the end i add  Xcenter(); to run it

then ran the script.. it did the z probe OK twice both were called with a call to the Z_probe() function. . then exited the xcenter because  the second probe was hit and not off the parts edge.. worked ok..

what i am finding now, even in the script run window..
is if the second probe doesn't hit top of part and is off the edge of the part, then the script continues on.
the next line is for the X to G31 back hoping to hit the parts edge and trigger the probe.
but Its seems like all G0 G01 G31 are not executed now the is no axis movement, all my print statement s display but nothing moving..
But if i replace the g01 g31 g0 with a RapidTo FeedTo, the axis's will move..

Just another thing to look at..

Gary


Title: Re: reading Pokeys pins
Post by: ArtF on October 14, 2019, 07:47:47 AM
Gary:

   I suspect all those are related. Thx for the clues, they point to the way the system
cancels a probe if its called while already hit..

Art


Title: Re: reading Pokeys pins
Post by: ArtF on October 15, 2019, 11:47:33 AM
Gary:

  I used the following as my test function .. it screwed up when the probe was added after the g1's
by erasing the g1's. The new code now injects the probe only after any previous g1's gave been completed .
The block after a probe in a script is still necessary . Ill have it posted in about 20 minutes.

>>global ProbeTest = function()
{
   Engine.GC ode("G31Z-10");
   block("MotionSti ll");
   Engine.GC ode("G1X20");
   Engine.GC ode("G31Z0");
   block("MotionSti ll");
   Engine.GC ode("G1X0");
   
};

Art


Title: Re: reading Pokeys pins
Post by: gburk on October 16, 2019, 07:40:42 PM
Art

Been working on it, had some problems with my scripts, was still getting Way off feed rates and after the script finished I was having to hit Estop and then hit it Again or I couldn't jog any axis with your on screen jog buttons.. .

So I decided to go back to square one, I uninstall ed auggie and gear and deleted all the folders, found one strange thing it was also showing auggie 3.6c as installed but couldn't get rid of it, so I deleted all reference's to gear and auggie in the system registers .. that seemed to work..

Reinstall ed it again..

Now I'm working on the scripts again from scratch have the Z Touch off working, and about 1/4 way though the X centering, been adding it in small bits and then testing it..
So far so good haven't had a feed rate problem yet, or a jog problem, I guess if I do it this way, if I do run into the jog or feed rate or G1  problems I will be able to point you to were they started..

Hopefully by tomorrow  night I will have the X center finished or Broken..

Gary
 


Title: Re: reading Pokeys pins
Post by: ArtF on October 17, 2019, 10:50:13 AM
Gary:

 No rush. :)

 Big storm here, I may be offline if the trees' topple..

Art


Title: Re: reading Pokeys pins
Post by: gburk on October 17, 2019, 01:24:06 PM
Art

Good luck with storm.
Sounds like you need a generator, up there also..
I hate no power.

I will keep messing around..

Gary


Title: Re: reading Pokeys pins
Post by: gburk on October 18, 2019, 09:06:44 PM
Art

After a little testing the only thing so far I am finding, my be using variable names in the probing function. .

I wrote a script to probe Z back off jog X+ off the parts edge then probe Z but now its off parts edge, then probe X- and hit probe retract then jog X- to other side of part probe back X+ hit probe, retract then jog to parts center set X to Zero..
This seems to work now.

As long as I don't use variable names like ProbeFeed = 10; of Xlength = 2.5;
When I use the var name in a Engine.GC ode("F"+ProbeFeed+" G1 X"+Xlength);
It works the first 3 or 4 calls in the script, the Axis's move fine, but after 3 or 4th call to Engine() I get no Axis movement. ..
I printed out the value in Xlength before its move and value was correct just wouldn't move..
This maybe part of the problem that I was having with the way off feedrates ..

It works fine with no variable name Engine.GC ode("F10 G1 X2.5"); for example

So thinking maybe that could have be some of the problem, seeing I was always reading the DROS I have in my panel to variable names in the scripts..

Just a thought.

Gary 


Title: Re: reading Pokeys pins
Post by: ArtF on October 19, 2019, 01:14:20 PM
Gary:

 That sounds possible.  Ill look in the translati ons.. ITs odd though that the print statement s are correct.. I cant think of any interacti on
top of head that could cause such a thing..

Art


Title: Re: reading Pokeys pins
Post by: gburk on October 19, 2019, 04:59:59 PM
Art

Thanks I am going to run it a few more times tonight, both ways again var's and none.

will let you know what I find...

 Gary