reading Pokeys pins
Re: reading Pokeys pins
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
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
Re: reading Pokeys pins
Gary:
Can you attach that script as a file, I cant copy from the editor, it adds spaces and such and makes it impossible to run without a lot of debugging..
Art
Can you attach that script as a file, I cant copy from the editor, it adds spaces and such and makes it impossible to run without a lot of debugging..
Art
Re: reading Pokeys pins
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
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
Re: reading Pokeys pins
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
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
- Attachments
-
- script.zip
- (2.69 KiB) Downloaded 209 times
Re: reading Pokeys pins
Thx Gary:
Ill check it out
Art
Ill check it out
Art
Re: reading Pokeys pins
Gary:
Found it. Limit was 9999 characters, I have increased it by a factor of 10,
I will do a release of the new version by next weekend.
Art
Found it. Limit was 9999 characters, I have increased it by a factor of 10,
I will do a release of the new version by next weekend.
Art
Re: reading Pokeys pins
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
if you have time and could check why the g code rewinds on the first m6 before you post the new update..
Thanks gary
Re: reading Pokeys pins
Gary:
Ill see if I can duplicate that again.
Art
Ill see if I can duplicate that again.
Art
Re: reading Pokeys pins
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 suggestion as how to tune it or do you think the KB spindle speed controller pots will need adjustment...
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 adjustment to get PWM from pokeys working better?.
Thanks gary
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 suggestion as how to tune it or do you think the KB spindle speed controller pots will need adjustment...
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 adjustment to get PWM from pokeys working better?.
Thanks gary
Re: reading Pokeys pins
Gary:
You will need to scale it for proper use. The number you send to
the SetPWMDuty call is 1.0 for full speed.
If you script in the test window and do a Motion.SetPWM(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 = CalledForSpeed / ActualRecordedMaxSpeed;
SetPwmDuty( n, duty ).
so if you had a S5000 call, the script would calculate
float duty = 5000 / 20000;
SetPwmDuty( 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
You will need to scale it for proper use. The number you send to
the SetPWMDuty call is 1.0 for full speed.
If you script in the test window and do a Motion.SetPWM(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 = CalledForSpeed / ActualRecordedMaxSpeed;
SetPwmDuty( n, duty ).
so if you had a S5000 call, the script would calculate
float duty = 5000 / 20000;
SetPwmDuty( 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
Re: reading Pokeys pins
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
zerotohundred = (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 Smoothstepper 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
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
zerotohundred = (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 Smoothstepper 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
Re: reading Pokeys pins
Gary:
Your formula is correct, I had mistakenly thought it was
set for 0-1 as a range, but I checked and your right, I
implemented 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 suspecting 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
conversion 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
zerotohundred = (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 conversation then as that really
dictates how you need to proceed.
Art
Your formula is correct, I had mistakenly thought it was
set for 0-1 as a range, but I checked and your right, I
implemented 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 suspecting 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
conversion 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
zerotohundred = (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 conversation then as that really
dictates how you need to proceed.
Art
Re: reading Pokeys pins
Art
I will check it again but I did do some voltage tests before connecting 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 controller 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 adjustment.
With the smoothstepper 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
I will check it again but I did do some voltage tests before connecting 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 controller 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 adjustment.
With the smoothstepper 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
Last edited by gburk on Thu Aug 08, 2019 12:55 pm, edited 1 time in total.
Re: reading Pokeys pins
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 controller
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 / (actualdistancemoved / 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 stepsPerUnitSet 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 = stepsPerUnitSet / (actualdistancemoved / distancecalledfor);
3) enter newsteps as steps/unit
Art
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 controller
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 / (actualdistancemoved / 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 stepsPerUnitSet 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 = stepsPerUnitSet / (actualdistancemoved / distancecalledfor);
3) enter newsteps as steps/unit
Art
Re: reading Pokeys pins
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 smoothstepper 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
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 smoothstepper 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
Last edited by gburk on Fri Aug 09, 2019 1:39 am, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 1 guest