reading Pokeys pins
Re: reading Pokeys pins
Art
I have all my scripts turned off and your default screen running.
and only the script spindlelib-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
I have all my scripts turned off and your default screen running.
and only the script spindlelib-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
Re: reading Pokeys pins
Gary:
Lets back this up a touch. I havent used the 0-10 volt myself, I use only the
PWM signals themselves. You wont want to use the LaserSpindle library, the
rtSpindle stuff ( Real-Time-Spindle) is a very fast PWM controller 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 controlling 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 rtLaserSpindle, its a special internal
control and you wont use it.
When SetSpindleState( state ) is called, you dont need to call
SpindleOn() or SpindleOff(), instead you need to simple call a
function that sets a pwm to the channel controlling the 0-10 volts.
inside SetSpindleState( state )
{
if ( state == 0): SetPwmDuty( channel, 0);
if (state == 1): SetPwmDuty( channel , properspeeddutycycle);
}
So get the pokeys so you know the right channel is controlling 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 LaserSpindle library, you will
be turning that off and simply recoding its calls as a general cnc instead
of photo laser engraver.
Art
Lets back this up a touch. I havent used the 0-10 volt myself, I use only the
PWM signals themselves. You wont want to use the LaserSpindle library, the
rtSpindle stuff ( Real-Time-Spindle) is a very fast PWM controller 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 controlling 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 rtLaserSpindle, its a special internal
control and you wont use it.
When SetSpindleState( state ) is called, you dont need to call
SpindleOn() or SpindleOff(), instead you need to simple call a
function that sets a pwm to the channel controlling the 0-10 volts.
inside SetSpindleState( state )
{
if ( state == 0): SetPwmDuty( channel, 0);
if (state == 1): SetPwmDuty( channel , properspeeddutycycle);
}
So get the pokeys so you know the right channel is controlling 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 LaserSpindle library, you will
be turning that off and simply recoding its calls as a general cnc instead
of photo laser engraver.
Art
Re: reading Pokeys pins
Art
Thanks will start over and shut down all my scripts to test spindle only i'm not totally sure but in the pokeys configuration 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
Thanks will start over and shut down all my scripts to test spindle only i'm not totally sure but in the pokeys configuration 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
Re: reading Pokeys pins
Art
I think you mat have me on the right track here is the script
I called it with
SetSpindleState (0); this changed the voltage from .222 to .442
SetSpindleState (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 adjustments
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 spindleaxis = 5;
global speeddutycycle = 100;
global SpindleControl = Motion();
global SetSpindleState = function(state)
{
if ( state == 0)
{
SpindleControl.SetPWM( channel, spindleaxis);
}
if (state == 1)
{
SpindleControl.SetPWM( channel , speeddutycycle);
}
};
Thanks gary
I think you mat have me on the right track here is the script
I called it with
SetSpindleState (0); this changed the voltage from .222 to .442
SetSpindleState (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 adjustments
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 spindleaxis = 5;
global speeddutycycle = 100;
global SpindleControl = Motion();
global SetSpindleState = function(state)
{
if ( state == 0)
{
SpindleControl.SetPWM( channel, spindleaxis);
}
if (state == 1)
{
SpindleControl.SetPWM( channel , speeddutycycle);
}
};
Thanks gary
Last edited by gburk on Mon May 20, 2019 5:38 am, edited 1 time in total.
Re: reading Pokeys pins
Gary:
>>SpindleControl.SetPWM( channel, spindleaxis);
You have the right idea, but the wrong parameters. The "SpindleControl" is just a
hook to the Pokeys, so thats correct. But the call is actually..
SpindleControl.SetPWM( 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
commandspeed = GlobalGet("SpindleSpeed"); //this will be the Gcode commanded last speed
percent = (commandspeed / 20000) * 100;
SpindleControl.SetPWM( channel, percent );
Add a function so that S calls are handled as in..
global SpindleSpeed = function( speed )
{
/*power is automatic in laser spindle mode..
no need to specify, in laser mode, spindle
power is a function of augmentation */
//but in CNC , we need to set the dutycycle to proper speed.
percent = (speed / 20000) * 100; //0-100% linearized to 0 - 100%
SpindleControl.SetPWM( 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 linearizing just
from min to the max.. many ways to do that I think.
Art
>>SpindleControl.SetPWM( channel, spindleaxis);
You have the right idea, but the wrong parameters. The "SpindleControl" is just a
hook to the Pokeys, so thats correct. But the call is actually..
SpindleControl.SetPWM( 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
commandspeed = GlobalGet("SpindleSpeed"); //this will be the Gcode commanded last speed
percent = (commandspeed / 20000) * 100;
SpindleControl.SetPWM( channel, percent );
Add a function so that S calls are handled as in..
global SpindleSpeed = function( speed )
{
/*power is automatic in laser spindle mode..
no need to specify, in laser mode, spindle
power is a function of augmentation */
//but in CNC , we need to set the dutycycle to proper speed.
percent = (speed / 20000) * 100; //0-100% linearized to 0 - 100%
SpindleControl.SetPWM( 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 linearizing just
from min to the max.. many ways to do that I think.
Art
Re: reading Pokeys pins
>> You have the right idea, but the wrong parameter s. The "SpindleControl" is just a
>>hook to the Pokeys, so thats correct. But the call is actually. .
>>SpindleControl.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 / MaxSpindleSpeed 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 Constantly to update the rpm dro?
With mach4 I have it connected with the smoothstepper 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
>>hook to the Pokeys, so thats correct. But the call is actually. .
>>SpindleControl.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 / MaxSpindleSpeed 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 Constantly to update the rpm dro?
With mach4 I have it connected with the smoothstepper 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
Re: reading Pokeys pins
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 calculations? Mach4 may use it for constant speed PID
loop or something, but other than perhaps a speed indication 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 periodically for a count, divide by time passed and youd get a fairly accurate
indication 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 information 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 correction 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..just 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
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 calculations? Mach4 may use it for constant speed PID
loop or something, but other than perhaps a speed indication 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 periodically for a count, divide by time passed and youd get a fairly accurate
indication 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 information 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 correction 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..just 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
Re: reading Pokeys pins
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 frustrated 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
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 frustrated 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
Last edited by gburk on Wed May 22, 2019 7:40 am, edited 1 time in total.
Re: reading Pokeys pins
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 approximation..
Art
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 approximation..
Art
Re: reading Pokeys pins
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
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
Re: reading Pokeys pins
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 approximation 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
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 approximation 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
Re: reading Pokeys pins
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 smoothstepper 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 smoothstepper 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 constantly..
make sense?
Thanks gary
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 smoothstepper 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 smoothstepper 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 constantly..
make sense?
Thanks gary
Re: reading Pokeys pins
Hi Gary:
I suspect neither program will use it. The smoothstepper is likely feeding
it into a counter and then sending a calculated 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 conversation, 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
I suspect neither program will use it. The smoothstepper is likely feeding
it into a counter and then sending a calculated 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 conversation, 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
Re: reading Pokeys pins
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 smoothstepper 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
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 smoothstepper 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
Re: reading Pokeys pins
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
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
Who is online
Users browsing this forum: No registered users and 1 guest