Problem Spindle Control Follow-up


Page 1 of 2 12 LastLast
Results 1 to 20 of 23

Thread: Spindle Control Follow-up

  1. #1
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Spindle Control Follow-up

    Tom

    Thank you so much for the help , i think i have it where it is workable , now to set it up in Kmotion.exe

    i have set up M3,M4,M5 and S in the tool setup , using your example in the CSS folder and the Motor starts and changes direction . but it doesn't Stop or display speed.

    i have the FACTOR set at 50 holes*4 edges = 200/60 or should i be using a different format as i read somewhere 1=3750 or 20157 = 3750

    i think i have read so many posts and guides now that i am confusing myself.

    I have also used the basic control example for spindle control , exactly as in the Manual just changing the bits to 154 and 155 and DAC =0

    the spindle also starts both CW and CCW but doesn't stop or display speed . when i start the spindle it also goes full speed even if i set S=500 in the gcode

    (Edit Png shows min 0 and max -2047 ,, i have tried with these values transposed and outcome is the same)

    regards

    Sean

    Similar Threads:
    Attached Thumbnails Attached Thumbnails Spindle Control Follow-up-kmotion-toolsetup-jpg  


  2. #2
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Hi Sean,

    No writing to the DACs is another method that can be used if you don't have any feedback. We went through all the trouble to get the spindle so it could be commanded like an axis so the axis would write to the DAC to maintain exact speed and ramp in a controlled manner and so forth. So configure to use the C Programs that do Jogs to an axis as described here. Note it describes to set USE_POS_NEG_VOLTAGE to 0 if you have a system like yours that can only use positive voltages for both directions.

    To have KMotionCNC display actual Spindle Speed configure KMotionCNC | Tool Setup | Trajectory Planner | Threading as described here.

    Regards
    TK http://dynomotion.com


  3. #3
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Tom

    first link doesn't seem to work https://www.cnczone.com/forums/newre...reply&t=422508

    Sean



  4. #4
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Hi Tom

    Same result as my previous try's , will turn on ok, but not stop ,
    with trajectory screen @ 200 cnts/rev ,kmotion screen reads 70 rpm when S is set to 100rpm actual spindle speed 3750rpm

    Sean

    Attached Thumbnails Attached Thumbnails Spindle Control Follow-up-trajectory-screen-jpg  
    Attached Files Attached Files


  5. #5
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Opps here

    Regards
    TK http://dynomotion.com


  6. #6
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Tom

    #define PC_COMM_CSS_S 113 // S speed setting in inches/sec

    Wasn't in the PC-DSP.h that i could find . i have added it and the change from CW to CCW is slower now like it is ramping down the speed and then back up rather than an instant relay change over , but the spindle speed doesn't actually change .



  7. #7
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Quote Originally Posted by TomKerekes View Post
    Opps here
    This is the article that i have been following since last Friday , have tried all methods suggested and cannot get S to change it is always full speed in kmotion.exe ,. jog3=?? and DAX0=?? works over the full speed range in console

    Have today removed everything inc Kmotion from the PC , reinstalled Kmotion ,so starting afresh and have only DAC0 connected and is the same



  8. #8
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Hi Sean,

    #define PC_COMM_CSS_S 113 // S speed setting in inches/sec

    Wasn't in the PC-DSP.h that i could find . i have added it
    That's very strange are you sure? What Version of KMotion are you using?



    This is the article that i have been following since last Friday , have tried all methods suggested and cannot get S to change it is always full speed in kmotion.exe ,
    The Tool Setup Screen you posted yesterday was all wrong as it was setting IO Bits and DACs rather than running C Programs as described in the article. Please re-post how you have now configured your Tool Setup | M0-M3 screen.

    Regards
    TK http://dynomotion.com


  9. #9
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Quote Originally Posted by TomKerekes View Post

    That's very strange are you sure? What Version of KMotion are you using?
    Version 435f i have used find command in word (Edit -Notepad) on both PC-DSP.H files one in DSP-KFLOP and DSP-KMOTION folders and that line is not present



    Quote Originally Posted by TomKerekes View Post
    The Tool Setup Screen you posted yesterday was all wrong as it was setting IO Bits and DACs rather than running C Programs as described in the article. Please re-post how you have now configured your Tool Setup | M0-M3 screen.
    screen shot of the Tool setup page attached

    Sorry i attached the other one yesterday was long day, i set up like that because i wanted to see if i could set speed on the KMOTION screen with spindle set as DAC0 , worked in console but not KMOTION

    and with drive set as Axis 3 JOG functions work in console but not in KMOTION

    Both setups just give a full speed motor regardless of S= in KMOTION

    Attached Thumbnails Attached Thumbnails Spindle Control Follow-up-trajectory-screen-exec-prog-jpg  
    Last edited by sean69_uk; 07-23-2021 at 02:43 PM.


  10. #10
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Hi Sean,

    Version 435f i have used find command in word (Edit -Notepad) on both PC-DSP.H files one in DSP-KFLOP and DSP-KMOTION folders and that line is not present
    Its in DSP_KFLOP\PC-DSP.h line 248

    Spindle Control Follow-up-pc_com_css-png

    The configuration of the Actions looks now correct.

    What prints on the Console?

    I realize now we may have a problem running in one of the directions. With USE_POS_NEG_VOLTAGE set false the programs will always Jog positive. But with different CW CCW bits set the Spindle will run negative and the encoder will count negative. This will result in a positive feedback runaway. I think in one case we will need to reverse the input gain.

    But I would expect one direction to work correctly. Have you tried starting from stopped each direction?

    Are you able to control the Spindle both directions from the Console using Jogs and setting the CW and CCW bits? You might want to Zero the axis before starting.

    Regards
    TK http://dynomotion.com


  11. #11
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Good Morning Tom
    Quote Originally Posted by TomKerekes View Post
    Its in DSP_KFLOP\PC-DSP.h line 248
    Found it thank you

    Quote Originally Posted by TomKerekes View Post
    What prints on the Console?
    Screenshot of console attached

    Quote Originally Posted by TomKerekes View Post
    But I would expect one direction to work correctly. Have you tried starting from stopped each direction?
    yes i have started both directions from stop , and as you have stated in CCW, position and counts are same direction and CW counts stay positive encoder goes negative

    Quote Originally Posted by TomKerekes View Post
    Are you able to control the Spindle both directions from the Console using Jogs and setting the CW and CCW bits? You might want to Zero the axis before starting.
    Yes i can control the spindle in both directions from the console using DAC0 and JOG3

    FROM THE CONSOLE
    i Think it is a scaling error somewhere as any thing above JOG3 = 250 goes full speed , At JOG3 = 200 Spindle is stable at 3000 Rpm (maximum speed is 3750)

    FROM KMOTION
    S=200 goes full speed in both directions and console says jogging spindle @ 300 counts/sec

    OFF Button clears both bits but doesn't stop the spindle

    hope this is more helpful

    Sean

    Attached Thumbnails Attached Thumbnails Spindle Control Follow-up-spindle-console1-png  


  12. #12
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Tom

    Note as wouldn't let me edit above post

    Spindle max 3750rpm with motor @ 7150 rpm



  13. #13
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Hi Sean,

    FROM THE CONSOLE
    i Think it is a scaling error somewhere as any thing above JOG3 = 250 goes full speed , At JOG3 = 200 Spindle is stable at 3000 Rpm (maximum speed is 3750)
    I agree.

    200 should be 1 rev/s or 60RPM so its off by a factor of 50. Is the Input Gain still 0.02? Post your Configuration Screen and Init C Program.

    Regards
    TK http://dynomotion.com


  14. #14
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Tom

    Yes Scaling is still -0.02 as in the step/response screen that gives the encoder the correct reading on the axis screen


    Config and Init File attached

    Sean

    Attached Thumbnails Attached Thumbnails Spindle Control Follow-up-spindle-config-png  
    Attached Files Attached Files


  15. #15
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Hi Sean,

    Those look to be both as expected. I was thinking the default of 1.0 vs 0.02 would be a factor of 50 as observed but that should actually make it run 50X slower not faster. Maybe only 1 hole is being picked up by the sensors? That would cause a factor of 50 faster.

    You'll have to do some trouble shooting and sanity checks.

    You might:

    #1 cycle power on KFLOP

    #2 Run the Init Program from KMotion.exe

    #3 set whatever Direction Bits needed to run positive

    #4 Record from Axis Screen Dest and Position (should be near zero)

    #5 Command Jog3=100 on Console. Should be 30RPM but you indicated this runs spindle at 1500 RPM. Time this for 1 minute. Do you have another means of measuring RPM?

    #6 Command Jog3=0 on console for to stop. (note approximately how long to stop)

    #7 Record from Axis Screen Dest and Position (if running @ 1500 RPM that would be 1500 revs x 200 counts/rev = 300,000 counts)

    Regards
    TK http://dynomotion.com


  16. #16
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Quote Originally Posted by TomKerekes View Post
    Those look to be both as expected. I was thinking the default of 1.0 vs 0.02 would be a factor of 50 as observed but that should actually make it run 50X slower not faster. Maybe only 1 hole is being picked up by the sensors? That would cause a factor of 50 faster.

    You'll have to do some trouble shooting and sanity checks.
    Don't think its just picking up one hole , if we take measurement below 1680rpm @ jog3=100, 50 holes in disk

    (1680 x 50) / 60 = 1400 . scope measured 1.34 - 1.42 KHz

    Quote Originally Posted by TomKerekes View Post
    You might:

    #1 cycle power on KFLOP

    #2 Run the Init Program from KMotion.exe

    #3 set whatever Direction Bits needed to run positive
    Done
    Quote Originally Posted by TomKerekes View Post
    #4 Record from Axis Screen Dest and Position (should be near zero)

    #5 Command Jog3=100 on Console. Should be 30RPM but you indicated this runs spindle at 1500 RPM. Time this for 1 minute. Do you have another means of measuring RPM?
    I Don't have another tachometer that works . i have set up a closed loop maxon motor today and checked my Tacho (smiths industries mechanical tachometer) .

    JOG3=100 measured 1710rpm on the spindle , against the maxon motor 1710rpm =1685 rpm[/QUOTE]

    Quote Originally Posted by TomKerekes View Post
    #6 Command Jog3=0 on console for to stop. (note approximately how long to stop)

    #7 Record from Axis Screen Dest and Position (if running @ 1500 RPM that would be 1500 revs x 200 counts/rev = 300,000 counts)
    Dest = 6072 Position = 6083 1min run + approx 3 secs to stop (screen shot attached )

    so we are about 50 times slower as you pointed out.


    Sean

    Attached Thumbnails Attached Thumbnails Spindle Control Follow-up-spindle-1min-stop-png  


  17. #17
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Hi Sean,

    Duh of course, I wasn't considering properly the Input Gain of 0.02

    1500 revs x 200 counts/rev x 0.02 scale = 6000 Position units

    Please include * 0.02 in the FACTOR. Or change the 200 to 4.0 (the decimal can be important to force floating point math).

    Also change the Trajectory Planner Threading Configuration from 200 to 4 to correct the RPM readout, There are 4 units per rev.



    On a side note somehow I think missed this earlier scope trace.

    Spindle Control Follow-up-spindle-encoder-trace-jpg

    One thing I see it that the sensors are not indicating a good 90 degree phase shift well. Towards the middle they are almost in phase which could cause errors or counting backwards. You might try to adjust that.

    Regards
    TK http://dynomotion.com


  18. #18
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Quote Originally Posted by TomKerekes View Post

    Please include * 0.02 in the FACTOR. Or change the 200 to 4.0 (the decimal can be important to force floating point math).
    i cant seem to find where the FACTOR value is is the 200 that needs changing V =200 in the step/response screen ?

    Quote Originally Posted by TomKerekes View Post
    Also change the Trajectory Planner Threading Configuration from 200 to 4 to correct the RPM readout, There are 4 units per rev.
    This works perfectly


    Quote Originally Posted by TomKerekes View Post
    On a side note somehow I think missed this earlier scope trace.

    Spindle Control Follow-up-spindle-encoder-trace-jpg

    One thing I see it that the sensors are not indicating a good 90 degree phase shift well. Towards the middle they are almost in phase which could cause errors or counting backwards. You might try to adjust that.
    i will check into this , also on the last check when i was measuring the frequency , trace was a little noisy



  19. #19
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Hi Sean,

    In MySpindleDefs.c change

    #define FACTOR (200/60) // to convert RPM to counts/sec (counts/rev / 60.0sec)

    to

    #define FACTOR (4.0/60.0) // to convert RPM to units/sec (units/rev / 60.0sec)

    Regards
    TK http://dynomotion.com


  20. #20
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: Spindle Control Follow-up

    Tom

    Works almost perfectly :-) , thank you

    S =1000

    in CCW ramps up nicely to roughly 1200 then down to 900 and then stabilizes at 1000 +/- 20 rpm and ramps down to Zero when the off Button is pressed .

    CW just runs away as count is wrong direction

    Sean



Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Spindle Control Follow-up

Spindle Control Follow-up