GearHeads Corner
August 18, 2019, 06:44:41 PM *
Welcome, Guest. Please login or register.

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



View Profile
« Reply #345 on: August 08, 2019, 06:05:52 AM »

Gary:

   Your formula is correct, I had mistakenl y thought it was
set for 0-1 as a range, but I checked and your right, I
implement ed 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 suspectin g 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
conversio n 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
 
zerotohun dred = (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 conversat ion then as that really
dictates how you need to proceed.

Art

 
Logged
gburk
Full Member
***
Posts: 185


View Profile
« Reply #346 on: August 08, 2019, 12:25:18 PM »

Art

I will check it again but I did do some voltage tests before connectin g 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 controlle r 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 adjustmen t.

With the smoothste pper 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 Edit: August 08, 2019, 06:55:52 PM by gburk » Logged
ArtF
Administrator
Hero Member
*****
Posts: 5338



View Profile
« Reply #347 on: August 08, 2019, 08:59:34 PM »

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 controlle r
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 / (actualdis tancemove d / 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 stepsPerU nitSet 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 = stepsPerU nitSet / (actualdis tancemove d / distancec alledfor);
3) enter newsteps as steps/unit

 
Art



 

 
Logged
gburk
Full Member
***
Posts: 185


View Profile
« Reply #348 on: August 09, 2019, 07:21:38 AM »

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 smoothste pper 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 Edit: August 09, 2019, 07:39:01 AM by gburk » Logged
ArtF
Administrator
Hero Member
*****
Posts: 5338



View Profile
« Reply #349 on: August 10, 2019, 01:38:27 PM »

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;
SetPwmDut y( channel, (speed / 6680) * 100.0 );

  This is only a first order appoximat ion but should
be accurate enough. You can get more complex with
tables of values or nonlinear formulas for any
nonlinear speed relations hips, but typically a
first order is enough..

Art


Art


Logged
gburk
Full Member
***
Posts: 185


View Profile
« Reply #350 on: August 10, 2019, 04:05:48 PM »

Art

I'm Not 100% sure you understoo d 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 Edit: August 11, 2019, 08:51:13 AM by gburk » Logged
gburk
Full Member
***
Posts: 185


View Profile
« Reply #351 on: August 10, 2019, 06:21:06 PM »

Art

Have Another script and panel for you to check out
Hoping the math is correct, its a start for auto calculati ng the motor steps per, for the entered distance and distance traveled and old steps..

Gary

 

* Pokeys57CNC.zip (70.06 KB - downloaded 3 times.)
Logged
ArtF
Administrator
Hero Member
*****
Posts: 5338



View Profile
« Reply #352 on: August 11, 2019, 11:09:29 AM »

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 describin g is what you do when a S word is called
for it terms of setting the duty cycle..Il l elucidate ... Smiley

 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 SpindleSp eed = function( speed )
....
....
 zerotohun dred = (speed / 25000) * 100;
 SpindleDe vice.SetP WM( 2, zerotohun dred );

  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 ..

zerotohun dred = (speed / 25000) * 100;
SpindleDe vice.SetP WM( 2, zerotohun dred );

  The above assumes your max speed is at S25000 which then
translate s 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;
zerotohun dred = (speed / 25000) * 100;
if( zerotohun dred > 100) zerotohun dred = 100;
SpindleDe vice.SetP WM( 2, zerotohun dred );

 So if the user enter S400, it will be translate d 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






 
Logged
ArtF
Administrator
Hero Member
*****
Posts: 5338



View Profile
« Reply #353 on: August 11, 2019, 04:32:31 PM »

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. Smiley

Art
Logged
gburk
Full Member
***
Posts: 185


View Profile
« Reply #354 on: August 11, 2019, 06:18:08 PM »

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
Logged
Mooselake
Hero Member
*****
Posts: 555



View Profile
« Reply #355 on: August 11, 2019, 07:26:43 PM »

Have a nice trip Art, and watch out for wild moose

Kirk
Logged
Pages: 1 ... 22 23 [24]
  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!