relay function with pokeys57u

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

relay function with pokeys57u

Post by Richard Cullin »

i have started to build a second auggie laser , this time with a 57u.
the laser power on my 57cnc  uses
Pokeys1.SetRelay(2,1);  to control laser power on/off
i can't quite see how that translates to a 57u  , would/will it set a particular pin ?
i can't see any mention of what pin is used for the relays on the cnc57 in the pokeys docs
i don't really want to end up with different scripts for each machine
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 »

Hi Richard:

  As far as I know, the relays 1 & 2 are part of the cnc57's external engine circuitry..
though I could be wrong. The documentation for the 57cnc shows the mcu controlling
the relays rather than one of the dedicated IO pins. The same for the solid state relays.
  I dont think you can access them with a pin code when using a 57. At my end its setting
a command for the relay status which I suspect is a software function only for the
57 and 57db.

  The 57U will work for the most part in Auggie,in terms of motion and pwm power
settings but I dont think anything other than the 57cnc will allow pixel by pixel pwm control
that auggie uses for photoengraving or 3d laser engraving in multipass.

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:

  Ill make a note to release a new version of Auggie soon as I have fixed up a few bugs in
there over the last while to deal with some engraving issues.

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 looking art , i thought that maybe the case for the relay

worse still it seems the pwm ch to pin mapping is different


any thoughts on getting pwm running ?
Attachments
pokpwm.jpg
Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: relay function with pokeys57u

Post by Richard Cullin »

not really sure , i have made several new profiles
scripts set to ch2  , planner set to ch2  , pin20 is set to pwm
spindle engaged ,............... nothing no pwm
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:

  If you set the PWM to a pin and set the frequency to 5Khz,
then send to the pokeys and save the profile, can you measure
a PWM on that pin before running Auggie?

  I guess what Im asking is if the Pokeys is working and tested
with that pin before running Auggie?

If so, Ill take a deep dive into the code to see if the PWM code
is the problem or if my scripts and hardcoding are assuming
a 57cnc's interface. It may be we need a new scriptcall to
set the traditional pwm channels rather than the 1ms
protocol on it.

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

Re: relay function with pokeys57u

Post by Richard Cullin »

yes that works , as soon as auggie starts pwm stops
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 »

Hi Richard:

  Are you using the script function SetPWMRealTime(state,period,axis,channel) or SetPWM( id, duty);

  I think in the case of a 57U, the call SetPWMDuty( channel( 0-5), duty( 0 -100))
should work, but SetPWMRealTime will not. The Call GetPWMOut( id ( 0-5)) should send back the duty
cycle of that channel. Youd have to then set the spindleon/off scripts to call the SetPWMDuty between
tickle and required power.

Art






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

 
   
Post Reply

Who is online

Users browsing this forum: No registered users and 87 guests