reading Pokeys pins
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.
Re: reading Pokeys pins
Gary:
So then your off by a factor of two, so changing the formula
to duty = (speed / 6680) * 100; sounds about right..
You command 3500 and the formula provides a duty of 50.0,
command 6680 and you'll get 100.0 , which is whats giving you 6680
right now. So in the script where you control the spindle speed,
just do a check and set the duty cycle..
if( speed > 6680 ) speed = 6680;
SetPwmDuty( channel, (speed / 6680) * 100.0 );
This is only a first order appoximation but should
be accurate enough. You can get more complex with
tables of values or nonlinear formulas for any
nonlinear speed relationships, but typically a
first order is enough..
Art
Art
So then your off by a factor of two, so changing the formula
to duty = (speed / 6680) * 100; sounds about right..
You command 3500 and the formula provides a duty of 50.0,
command 6680 and you'll get 100.0 , which is whats giving you 6680
right now. So in the script where you control the spindle speed,
just do a check and set the duty cycle..
if( speed > 6680 ) speed = 6680;
SetPwmDuty( channel, (speed / 6680) * 100.0 );
This is only a first order appoximation but should
be accurate enough. You can get more complex with
tables of values or nonlinear formulas for any
nonlinear speed relationships, but typically a
first order is enough..
Art
Art
Re: reading Pokeys pins
Art
I'm Not 100% sure you understood what I said, or i'm not getting what you saying
6680 is what the reading was from the hand held dig tach so there is no feedback going to auggie seeing that auggie can't read an index or rpm value.
so I don't think there is any way for me or auggie to test for speed > 6680... and that will change with all M3 S setting..
I think seeing that the speed is close to double form what I set in auggie M3 S3500 and spindle is running at 6680..
then most likely just divide the duty in half...
But do you think this will help at the low RPM's I can't get the spindle to turn at all till I send at least S700 so I have to send enough voltage to start the spindle and that's seems to be around 700 RPM and I forget but somewhere over 1volts
Not sure if this is correct thinking. or its messed up in my mind
Tested again S2200 is reaching max close to max voltage if 5v is max.. and a rpm reading of spindle at 4700 and 4.95v
the lowest speed is S500 and its voltage is 1.2 and 60 Rpm so it seems it does need at least 1,2 volts to get the spindle moving..
Gary
I'm Not 100% sure you understood what I said, or i'm not getting what you saying
6680 is what the reading was from the hand held dig tach so there is no feedback going to auggie seeing that auggie can't read an index or rpm value.
so I don't think there is any way for me or auggie to test for speed > 6680... and that will change with all M3 S setting..
I think seeing that the speed is close to double form what I set in auggie M3 S3500 and spindle is running at 6680..
then most likely just divide the duty in half...
But do you think this will help at the low RPM's I can't get the spindle to turn at all till I send at least S700 so I have to send enough voltage to start the spindle and that's seems to be around 700 RPM and I forget but somewhere over 1volts
Not sure if this is correct thinking. or its messed up in my mind
Tested again S2200 is reaching max close to max voltage if 5v is max.. and a rpm reading of spindle at 4700 and 4.95v
the lowest speed is S500 and its voltage is 1.2 and 60 Rpm so it seems it does need at least 1,2 volts to get the spindle moving..
Gary
Last edited by gburk on Sun Aug 11, 2019 2:51 am, edited 1 time in total.
Re: reading Pokeys pins
Art
Have Another script and panel for you to check out
Hoping the math is correct, its a start for auto calculating the motor steps per, for the entered distance and distance traveled and old steps..
Gary
Have Another script and panel for you to check out
Hoping the math is correct, its a start for auto calculating the motor steps per, for the entered distance and distance traveled and old steps..
Gary
- Attachments
-
- Pokeys57CNC.zip
- (70.06 KiB) Downloaded 242 times
Re: reading Pokeys pins
Hi Gary:
I'm leaving in a couple days for Alaska, and wont be back for a couple weeks, so Ill
check it out then.
As to Spindle Speeds.. What I was describing is what you do when a S word is called
for it terms of setting the duty cycle..Ill elucidate... :)
Here is what I have for your spindle speed setting script.. Ill display just
the lines that set the Spindle speed when it see's a S word in the Gcode.
global SpindleSpeed = function( speed )
....
....
zerotohundred = (speed / 25000) * 100;
SpindleDevice.SetPWM( 2, zerotohundred );
speed is whatever your Gcode called for S word..
It seems, like most of us you have a minimum speed..
so the easiest way to handle it is as in ..
zerotohundred = (speed / 25000) * 100;
SpindleDevice.SetPWM( 2, zerotohundred );
The above assumes your max speed is at S25000 which then
translates to 100.0 as a PWM setting, if you change 25000
to your actual max speed call this will then be accurate.
To check for a minimum you simple do this..
if( speed < 700 ) speed = 700;
zerotohundred = (speed / 25000) * 100;
if( zerotohundred > 100) zerotohundred = 100;
SpindleDevice.SetPWM( 2, zerotohundred );
So if the user enter S400, it will be translated to S700
If he enters S56780 , the duty cycle will only be set
to 100, so max speed.
SO the only number you need to figure out to make the above work
is the 25000 number, its probably more like 6000 for you. Just change the
25000 up or down until your upper S word is accurate. If the max your
spindle can do at 5 volts is 6680 RPM, just keep raising or lowering
25000 in the script until a call of S6680 is correct.
As you say, Auggie doesnt read the speed so its all a matter of simply
scaling the users Sword to the proper duty cycle as above.. The 700
can be adjusted to whatever minimum speed actually makes the
spindle turn close to that speed. This isnt unusual at all, most
spindle have no low end and are not very linear in control.
Art
I'm leaving in a couple days for Alaska, and wont be back for a couple weeks, so Ill
check it out then.
As to Spindle Speeds.. What I was describing is what you do when a S word is called
for it terms of setting the duty cycle..Ill elucidate... :)
Here is what I have for your spindle speed setting script.. Ill display just
the lines that set the Spindle speed when it see's a S word in the Gcode.
global SpindleSpeed = function( speed )
....
....
zerotohundred = (speed / 25000) * 100;
SpindleDevice.SetPWM( 2, zerotohundred );
speed is whatever your Gcode called for S word..
It seems, like most of us you have a minimum speed..
so the easiest way to handle it is as in ..
zerotohundred = (speed / 25000) * 100;
SpindleDevice.SetPWM( 2, zerotohundred );
The above assumes your max speed is at S25000 which then
translates to 100.0 as a PWM setting, if you change 25000
to your actual max speed call this will then be accurate.
To check for a minimum you simple do this..
if( speed < 700 ) speed = 700;
zerotohundred = (speed / 25000) * 100;
if( zerotohundred > 100) zerotohundred = 100;
SpindleDevice.SetPWM( 2, zerotohundred );
So if the user enter S400, it will be translated to S700
If he enters S56780 , the duty cycle will only be set
to 100, so max speed.
SO the only number you need to figure out to make the above work
is the 25000 number, its probably more like 6000 for you. Just change the
25000 up or down until your upper S word is accurate. If the max your
spindle can do at 5 volts is 6680 RPM, just keep raising or lowering
25000 in the script until a call of S6680 is correct.
As you say, Auggie doesnt read the speed so its all a matter of simply
scaling the users Sword to the proper duty cycle as above.. The 700
can be adjusted to whatever minimum speed actually makes the
spindle turn close to that speed. This isnt unusual at all, most
spindle have no low end and are not very linear in control.
Art
Re: reading Pokeys pins
Gary:
I should have mentioned, I updated Auggie for 10 times the script length as
a maximum. I still havent found that starting bug, but will search for it when
Im testing out your panels. :)
Art
I should have mentioned, I updated Auggie for 10 times the script length as
a maximum. I still havent found that starting bug, but will search for it when
Im testing out your panels. :)
Art
Re: reading Pokeys pins
Art
Thanks and have a great trip, I'm jealous I have always wanted to do the train ride up there.. maybe someday..
most likely will have plenty of stuff I messed up to bug you about on your return..
Thanks gary
Thanks and have a great trip, I'm jealous I have always wanted to do the train ride up there.. maybe someday..
most likely will have plenty of stuff I messed up to bug you about on your return..
Thanks gary
Re: reading Pokeys pins
Have a nice trip Art, and watch out for wild moose
Kirk
Kirk
Re: reading Pokeys pins
Art
Decided to give it a go in real life didn't go so good, the g code I am attaching doesn't seem to rewind, at first it was created with sheetcam..
I ran the g code many times but just testing and seemed ok, I don't think the problem is the g code.
Here's what is going on with it,
I run the g code it go's ok but when my dialog pops up for a tool change, looks ok now I jog the z up to change the tool jog down to the parts surface set z to 0 and use the single line window to sent the z back to 1 g0 z1 now I exit the tool change dialog to hit the run button and its seems the g code has re wound.
doe's this every time.
Not sure where the problem is maybe I can't exit the g code window to the single line window and back again to the g code window..
any thoughts on this ONE.
Thanks gary
Decided to give it a go in real life didn't go so good, the g code I am attaching doesn't seem to rewind, at first it was created with sheetcam..
I ran the g code many times but just testing and seemed ok, I don't think the problem is the g code.
Here's what is going on with it,
I run the g code it go's ok but when my dialog pops up for a tool change, looks ok now I jog the z up to change the tool jog down to the parts surface set z to 0 and use the single line window to sent the z back to 1 g0 z1 now I exit the tool change dialog to hit the run button and its seems the g code has re wound.
doe's this every time.
Not sure where the problem is maybe I can't exit the g code window to the single line window and back again to the g code window..
any thoughts on this ONE.
Thanks gary
- Attachments
-
- XballscrewmountFinal.zip
- (6.03 KiB) Downloaded 227 times
Re: reading Pokeys pins
Gary;
I'm sure you already know Art is away on vacation, so I'm replying to say wish I could help with your code rewinding problem after a tool change, but this area of coding will definitely require Art's expertise when he gets back? I'll pass along the message when he gets back next week sometimes..
Cheers
Bob
I'm sure you already know Art is away on vacation, so I'm replying to say wish I could help with your code rewinding problem after a tool change, but this area of coding will definitely require Art's expertise when he gets back? I'll pass along the message when he gets back next week sometimes..
Cheers
Bob
Gearotic Motion
Bob
Bob
Re: reading Pokeys pins
Bob
Yep knew he was gone but if I don't post things as I am testing and running into problems I seem to forget what was going on in a few days..
Thanks
Gary
Yep knew he was gone but if I don't post things as I am testing and running into problems I seem to forget what was going on in a few days..
Thanks
Gary
Who is online
Users browsing this forum: No registered users and 2 guests