relay function with pokeys57u

Discussions and file drops for Auggie
Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: relay function with pokeys57u

Post by Richard Cullin »

script keeps getting killed ,  even if i leave SpindleControl.SetRealTimePWM in (set to another ch)

global SpindleOn = function()
{
    //turn on pwm realtime mode
    //called by engine , so no need to tell system
    //SpindleControl.SetRealTimePWM( true,
    //                              LaserPWMPeriod,
    //                              LaserAxis,
    //                              LaserPWMChannel );
    SetPWMDuty( 2,  6);
    print("Laser Spindle RT engaged");                               
};




error
0:21:147  Setting Spindle with 1 
40:21:147  Error in script run. Check log.!
40:21:148  Program Stopped!
40:21:148  Script killed or triggered exception,check log.


poscope don't really spell out the difference performance /ability wise between these modules , i thought i was just getting less fancy plugs and fittings
their comparison cross reference give no hint of this sort of issue , feeling a bit ripped off


Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: relay function with pokeys57u

Post by Richard Cullin »

what i saw
Attachments

[The extension pdf has been deactivated and can no longer be displayed.]

Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: relay function with pokeys57u

Post by Richard Cullin »

might this be a clue ,from PoKeys protocol specification pdf

General pin settings
PoKeys55, PoKeys56, PoKeys57 limitations
1. Pin codes used in PoKeys55 device are 0-based, e.g. pin 1 has pin code of 0, pin 55 has pin code of 54.
2. Analog input capable pins 43 to 47 have pin codes of 42 to 46.
3. Analog output capable pin 43 has pin code of 42.
4. PWM (pulse-width modulation) capable pins 17 to 22 have pin codes of 16-21 (PWM module outputs are in reversed order, e.g. pin 17 (pin coded as 16) is connected to PWM6 output ? see specifications below).
Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: relay function with pokeys57u

Post by Richard Cullin »

lasest scriopt still no go
global SpindleOn = function()
{
    //turn on pwm realtime mode
    //called by engine , so no need to tell system
    SpindleControl.SetRealTimePWM( true,
                                  LaserPWMPeriod,
                                  LaserAxis,
                                  LaserPWMChannel );
  Pokeys1.SetPWMPeriod(.000200);  // and  Pokeys1.SetPWMPeriod(2, .000200);  not sure of syntax

Pokeys1.SetPWM( 2, 1);
    print("Laser Spindle RT engaged");                               
}; 

Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: relay function with pokeys57u

Post by Richard Cullin »

some promise here , commenting the realtimepwm calls did the trick
now have pwm at pin20 ch2 off/on

global SpindleOn = function()
{
    //turn on pwm realtime mode
    //called by engine , so no need to tell system
  // SpindleControl.SetRealTimePWM( true,
  //                                LaserPWMPeriod,
  //                                LaserAxis,
  //                                LaserPWMChannel );
  Pokeys1.SetPWMPeriod(2,.000200);

Pokeys1.SetPWM( 2, 1);
    print("Laser Spindle RT engaged");                               
}; 

/*
  This is called by the system to turn off the
  Spindle, so, we'll just tell the engine
  to turn off realtime spindle mode
*/

global SpindleOff = function()
{
    //turn on pwm realtime mode
    //SpindleControl.SetRealTimePWM( false,
    //                              LaserPWMPeriod,
  //                                LaserAxis,
  //                                LaserPWMChannel );
    print("Laser Spindle RT dis-engaged");   
    Pokeys1.SetPWM( 2, 0);
}; 
Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: relay function with pokeys57u

Post by Richard Cullin »

i could have built 15 arduino clone laser controllers with the same limitation for the price of a pokeys57u delivered. its a totally pointless exercise unless it can do realtime pwm. the whole point was not to have to tediously modify gcode from vcarve /vexx etc  even for the most basic laser control .
worst christmas present ever.

global SpindleOn = function()
{
   //turn on pwm realtime mode
   //called by engine , so no need to tell system
  // SpindleControl.SetRealTimePWM( true,
  //                                LaserPWMPeriod,
  //                                LaserAxis,
 //                                 LaserPWMChannel );
  Pokeys1.SetPWMPeriod(0.000200);

  Pokeys1.SetPWM( 2, GlobalGet( "LaserMaxPower" ));
   print("Laser Spindle RT engaged");                                
};  
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: relay function with pokeys57u

Post by ArtF »

Richard:

    I have to apologize on this one myself, I neglected to notice the original script
was calling SpindleControl.SetRealTimePWM(..). I should have seen immediately
that the script that needed modifying was in the SpindleLibrary so the Pokeys1.
had to be the calling system locally.
  You did it properly in the end, and I suspect the 57U is as I thought incapable
of the PWM control. I used internal library names of SetPWMRealTime and SetPWM
in the code base and I got a bit confused between script library and internals as
I looked in the code. I see the problem now, and you solved it before I got there.

  The guys at Pokeys are pretty nice guys though, if you contact them and tell them
the doc's led you to believe the PWM you needed was in the 57U but in fact only the
57CNC would work, they would likely come up with a replacement or swap
for you, though I know shipping and such is a hassle as well. Tell them it was
for Auggie so the 57cnc is really needed.

  I use an arduino after my pwm output on the galvo laser now as you may have seen
in a  recent post on laser issues. The arduino takes in the pwm, and converts it to
a scale factored output for better depth resolution. (Code for that is in the thread.).

  Now if I could figure a way to send out the power for the next ms to another device,
which is basically what gets sent by Auggie during run, Id be happy to add it so any
Pokeys would have the capability with an added arduino or something...but I suspect the stream
Im sending is too time sensitive for me to get that additional IO time.

  Ask pokeys support if that 57u could be traded for a 57cnc, they may be willing
to help before we try to reinvent the wheel. I could I suppose add a 8 bit pin
coordinator to set 8 consecutive pins to a 0-100 power level in binary during run,
there wouldn't be any time loss that way in communications..(Though you'd lose
8 pins of IO.... The interface would be simple , Im thinking Id have to simply
dedicate 8 pins of IO for binary power output.. Youd have to add an arduino to read
the 8 pins and do a pwm based on them...Ill give it some thought, let me know
what the support guys say, and Ill look in the engine to see if I can dedicate
pins 1-8 for auxillary power output..


Art

 
   
Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: relay function with pokeys57u

Post by Richard Cullin »

posupport suggest that  PoExtBusOC16CNC  add on will allow Motion-synched PWM
what do you think ? i would rather have the full deal .
mind you a 57u version would be attractive to more users being 1/3 the cost of a 57cnc . i could easily pgm a pic chip to read the 8 pin pwm data
and provide the pwm signal.  i would be willing to provide pic code to auggie users

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

Re: relay function with pokeys57u

Post by ArtF »

Richard:

  Ahh yes, I had forgotten that option. Its true the extender is what makes a  57 what it is,
its basically the external engine for CNC. When added you basically have a 57. If you want
everything to work the same its probably worth getting.

  As to the pinout idea, I will look at adding it over the next couple weeks just in case
the issue arises again. Making a cheap arduino read an 8 bit input and making a pwm
from it is pretty east from there if one wishes to go that way.

  Going with the extender has other benefits though, top speed goes from 25K to 115K
I believe as well. ( The 57U only has internal planner doesnt it?). Auggie will use
the internal if there is no extended planner, but its much slower..

Art
Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: relay function with pokeys57u

Post by Richard Cullin »

thanks for that , i will get an extender.
i'm still interested in the 8 pin idea and happy to be a guinea pig if it will help
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: relay function with pokeys57u

Post by ArtF »

Ill let you know when the code is added.

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

Re: relay function with pokeys57u

Post by ArtF »

Richard:

  Bad news. I actually added the code to do the pinout idea before I found why
I didnt do it in the first place. Auggie works on a 1ms waypoint and sends up to
.5 seconds of forward information to the pokeys. The Pokeys deals out the motions
from those 500 waypoint packets in which are encoded axis moves and power
information. DigitialIO and analogue are sent every 50-100ms in a separate call
whenever there are enough packets in the pokeys queue to allow for the time
disruption.
  This means I cannot sync the pinouts to the motion point as I dont really know
it in realtime. The power byte was added by pokeys for me when I decided to
write auggie, they were very nice to adapt their firmware to my idea and I knew
the firmware space was tight so didnt ask for further byte operations.

  In the end it means the only control byte I have is power and only the
control microprocessor in the 57cnc or extender has the code to understand it.
Seemed like a good idea, I guess I should have wondered why I didnt do it
in the first place as its an obvious solution to many ills.

  Ill continue to give thought to the problem , perhaps I may think of something..

Art
Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: relay function with pokeys57u

Post by Richard Cullin »

the pobus16cnc extender is only 14 eur ,  so i guess it not a big deal  to add it to the 57u . [when you know its needed]
it may not be cost effective to develop an alternative when auggie works so well as it stands
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: relay function with pokeys57u

Post by ArtF »

Richard:

  Thx. I try not to get too obtrusive in the code base for Auggie, Ive forgotten
many of its development details and it works well enough that I dont have to
play too often in the code. Leave sleeping dogs lie is probably the
better option.. :)

Art
Post Reply

Who is online

Users browsing this forum: No registered users and 84 guests