GearHeads Corner
May 19, 2019, 05:48:58 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: 1 ... 13 14 [15]
  Print  
Author Topic: reading Pokeys pins  (Read 3096 times)
0 Members and 1 Guest are viewing this topic.
ArtF
Administrator
Hero Member
*****
Posts: 5250



View Profile
« Reply #210 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
 
 
Logged
gburk
Full Member
***
Posts: 109


View Profile
« Reply #211 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



« Last Edit: May 17, 2019, 07:29:42 PM by gburk » Logged
gburk
Full Member
***
Posts: 109


View Profile
« Reply #212 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
Logged
ArtF
Administrator
Hero Member
*****
Posts: 5250



View Profile
« Reply #213 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


Logged
gburk
Full Member
***
Posts: 109


View Profile
« Reply #214 on: Today at 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

Logged
Pages: 1 ... 13 14 [15]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!