586,035 active members*
3,754 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Dynomotion/Kflop/Kanalog > THREADING: How to add threading parameters to the Init file?
Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2004
    Posts
    235

    THREADING: How to add threading parameters to the Init file?

    Greetings All,

    This is for my Lathe CNC software RedCNC2L which I am developing. I am wanting to add the Single Point Threading or G32 (I think it is) today...
    ________________________________________

    I want to put the Threading settings into the Init. file.

    Does anyone have the threading parameters, or settings; in their Init. file? Have you done this??

    How do I add them to the Init. file? Or what would the code look like... to do so?

    Settings to add below.

    Do I need to add any other settings, to use the threading option. The spindle is controlled by a VFD, but not with the software; in this case. Just need to monitor the encoder for threading purposes.

    Thanks so much!!!
    __________________________________________________ ____________________________________

    Threading:
    Sensor Type: 1 (Encoder A+ & B+)
    Encoder Axis: 4 (Pins 14 & 15 JP7)
    Motion Filter Time: 0.1
    Update Time: 0.1
    Counts/Rev.: 20000

    Attachment 273208
    Robot & Machine Design - BLUECNC4, GreenCNC3, RedCNC2L, SilverCNC2; CNC Software!
    www.truemachinedesign.com - - - - - - - - - - - - - www.truemachineautomation.com

  2. #2
    Join Date
    May 2006
    Posts
    4045

    Re: THREADING: How to add threading parameters to the Init file?

    Hi jeffserv,

    There is a ConfigureSpindle Function defined in KMotionDef.h

    void ConfigureSpindle(int Type, int Axis, float UpdateTimeSecs, float Tau, float CountsPerRev); // configures for type of Spindle feedback


    In Your case you would call it with:

    ConfigureSpindle(1, 4, 0.1, 0.1, 20000); // configures for type of Spindle feedback


    You might also set the parameters from your App using a Console Script Command:
    Script Commands

    HTH
    Regards
    TK
    http://dynomotion.com

  3. #3
    Join Date
    Jul 2004
    Posts
    235

    Re: THREADING: How to add threading parameters to the Init file?

    Thanks,

    I have added channel settings, for Channel 1, where I have the encoder wired into now.

    Added:

    ConfigureSpindle(1, 1, 0.1, 0.1, 15000); // configures for type of Spindle feedback

    Added this just before Defining the Axis... I do see that I get the counts, from the encoder. In the Axis screen.
    But do not get any reaction from the G32 Z-1.0 F0.5 (20 TPI for 1.0 inch)...

    The channel 1 is setup as Encoder input and no output mode... does anything else in this channel need set? I also enable this channel.

    To recap: I set all the channel parameters, I configure the spindle; then I Define axis 0, 1, 2, -1.

    Any help, to get action will be appreciated.
    Robot & Machine Design - BLUECNC4, GreenCNC3, RedCNC2L, SilverCNC2; CNC Software!
    www.truemachinedesign.com - - - - - - - - - - - - - www.truemachineautomation.com

  4. #4
    Join Date
    May 2006
    Posts
    4045

    Re: THREADING: How to add threading parameters to the Init file?

    Hi jeffserv,

    Added:

    ConfigureSpindle(1, 1, 0.1, 0.1, 15000); // configures for type of Spindle feedback

    Added this just before Defining the Axis... I do see that I get the counts, from the encoder. In the Axis screen.
    Is Axis 1 Position counting? The pins you mentioned in your previous email were not the pins for an encoder input. The Console Command GetSpindleRPS should print the correct Spindle Speed as well.


    The channel 1 is setup as Encoder input and no output mode... does anything else in this channel need set? I also enable this channel.
    The InputChan0 parameter should also be set to the encoder input channel that the Spindle is wired to. The Axis should not be enabled.


    To recap: I set all the channel parameters, I configure the spindle; then I Define axis 0, 1, 2, -1.
    If Axis 1 is the spindle it should not be included in the Coordinated Motion System. Define the Coordinated Motion System as 0, -1, 2, -1

    HTH
    Regards
    TK
    http://dynomotion.com

  5. #5
    Join Date
    Jul 2004
    Posts
    235

    Re: THREADING: How to add threading parameters to the Init file?

    Quote Originally Posted by TomKerekes View Post
    Hi jeffserv,

    Is Axis 1 Position counting? The pins you mentioned in your previous email were not the pins for an encoder input. The Console Command GetSpindleRPS should print the correct Spindle Speed as well.


    The InputChan0 parameter should also be set to the encoder input channel that the Spindle is wired to. The Axis should not be enabled.


    If Axis 1 is the spindle it should not be included in the Coordinated Motion System. Define the Coordinated Motion System as 0, -1, 2, -1

    HTH
    Regards
    I had moved the wiring to bit 2 and 3 for the Encoder input on Axis 1.
    Yes the axis 1 is now counting. I can see this in the Axis screen.
    I did check, and InputChan0 is set to 1 on Channel 1.
    Removed from Coord Motion Sys.
    __________________________________________________ _______

    I have attached my Init. file for your review... I may have something wrong?

    What about the ch1->invDistPerCycle=1; setting. And the counts per Rev. Setting... should they be matched,
    or what is their relationship; if any??

    Again, thanks for your help!

    Thanks so much...!
    Robot & Machine Design - BLUECNC4, GreenCNC3, RedCNC2L, SilverCNC2; CNC Software!
    www.truemachinedesign.com - - - - - - - - - - - - - www.truemachineautomation.com

  6. #6
    Join Date
    May 2006
    Posts
    4045

    Re: THREADING: How to add threading parameters to the Init file?

    Hi jeffserv,

    The Init file doesn't enable Axes 0 and 2. Are you doing that some other way??

    Regards
    TK
    http://dynomotion.com

  7. #7
    Join Date
    Jul 2004
    Posts
    235

    Re: THREADING: How to add threading parameters to the Init file?

    Quote Originally Posted by TomKerekes View Post
    Hi jeffserv,

    The Init file doesn't enable Axes 0 and 2. Are you doing that some other way??

    Regards
    Yes,
    I enable them in this setup with F11 Keyboard button. Once my software is loaded. Hit it again, and it disables them.
    Robot & Machine Design - BLUECNC4, GreenCNC3, RedCNC2L, SilverCNC2; CNC Software!
    www.truemachinedesign.com - - - - - - - - - - - - - www.truemachineautomation.com

  8. #8
    Join Date
    May 2006
    Posts
    4045

    Re: THREADING: How to add threading parameters to the Init file?

    Hi jeffserv,

    Regarding invDistPerCycle: that isn't relevant to Threading.

    I don't think you answered my question regarding whether GetSpindleRPS reports a speed.

    I performed a test using KMotionCNC and it seems to work. You might try the same to help determine where the issue is. I did the following:

    #1 simulated quadrature counting on bits 2 and 3 (you should not need to do this if you have the Spindle running)
    #2 from KMotion.exe run your Init C program
    #3 enable axes 0 and 2
    #4 run KMotionCNC (with Tool Setup | Trajectory Planner | Threading Type = 0)
    #5 execute GCode G32 Z-1.0 F0.5 (20 TPI for 1.0 inch)
    #6 note that Z moves
    #7 stop "spindle" note Z stops
    #8 resume "spindle" note Z resumes and finishes.

    Regards
    TK
    http://dynomotion.com

  9. #9
    Join Date
    Jul 2004
    Posts
    235

    Re: THREADING: How to add threading parameters to the Init file?

    Greetings,

    Solved: I just cut a nice 1/4-20 Thread on my lathe using my software Red CNC 2L for lathe... which has at its heart... the KFlop Motion Control.

    ConfigureSpindle(1, 1, 0.1, 0.1, 15000); // configures for type of Spindle feedback

    This is the configuration that worked.

    What was wrong?

    1. The encoder signals needed to be reversed, direction was backwards. Or in other words, the count was going in the negative direction (minus), and the G32 did not like this. This just made the code G32 hang... and not move. Once I reversed these, the G32 software would go into the Threading "Geared" to the Spindle.

    2. Even though I don't, (Do Not); control the VFD for the Spindle, from my software or the KFlop on this machine. I still needed to tell the KFlop Motion board what RPM I was running.

    Note: The software does recognize and report the RPM in the KMotionCNC screen. So I wonder, if the software knows the speed... via the encoder... why does G32 not know this?? It seems it should be connected?

    Nevertheless, it works; I simply give the S74 command in my Gcode, based on the reported speed for 5 HZ on my VFD. I found that once I entered this. I got the correct thread pitch.
    Now if you don't put in a S74 command... to tell the KFlop what RPM you are running... then is will cut a thread... but not the one you are looking for... some Odd size. So it will fool you into thinking it is working. But it is not!

    So: Enter the Spindle Speed command...

    Then the G32 Z-1.0 F0.05 (Cut a 1/4-20 Thread)

    WORKED.... !!!! And boy it sure is exciting to get it working.

    The thread I just cut, is a good tight fit. So I believe I am on my way.

    BELOW IS A PICTURE OF MY CNC LATHE: BEFORE AND AFTER!
    IT IS A 1944 SOUTH BEND 9" AND IS NOW CNC CONTROLLED WITH THE KFLOP!!!
    AND NOW CUTS THREADS!!! YA!!!!!!!!!!!

    Attachment 273478Attachment 273480
    Robot & Machine Design - BLUECNC4, GreenCNC3, RedCNC2L, SilverCNC2; CNC Software!
    www.truemachinedesign.com - - - - - - - - - - - - - www.truemachineautomation.com

  10. #10
    Join Date
    May 2006
    Posts
    4045

    Re: THREADING: How to add threading parameters to the Init file?

    Hi jeffserv,

    Congrats!

    Regarding:

    The encoder signals needed to be reversed, direction was backwards. Or in other words, the count was going in the negative direction (minus), and the G32 did not like this. This just made the code G32 hang... and not move. Once I reversed these, the G32 software would go into the Threading "Geared" to the Spindle.
    I believe that makes sense. Since the motion is basically "geared" to the spindle it would be moving backwards to the beginning of the path. It might be M3/M4 issue as well. Threading should work either direction. I suppose we could handle that better.

    Even though I don't, (Do Not); control the VFD for the Spindle, from my software or the KFlop on this machine. I still needed to tell the KFlop Motion board what RPM I was running.
    Note: The software does recognize and report the RPM in the KMotionCNC screen. So I wonder, if the software knows the speed... via the encoder... why does G32 not know this?? It seems it should be connected?
    There is a difference between the desired spinde speed and the actual spindle speed. The motions (acceleration limits and such) are planned based on the desired speed. We don't assume that the actual speed is the desired speed (or even non-zero) when the motion is planned. So it ends up being required.

    Thanks for your patience
    Please post a video!
    Regards
    TK
    http://dynomotion.com

Similar Threads

  1. NPT Threading
    By brow318 in forum Tormach Personal CNC Mill
    Replies: 1
    Last Post: 09-21-2013, 02:28 PM
  2. threading
    By gtotten89 in forum Metalworking- / Woodworking Tooling / Manual Machining
    Replies: 8
    Last Post: 06-05-2012, 11:33 PM
  3. O.D. Threading
    By CitizenBrian in forum CNC Swiss Screw Machines
    Replies: 26
    Last Post: 04-23-2012, 05:11 AM
  4. Fanuc threading parameters
    By Scritchadolian in forum Fanuc
    Replies: 8
    Last Post: 08-01-2011, 11:08 PM
  5. Threading D2
    By Billet Sean in forum MetalWork Discussion
    Replies: 6
    Last Post: 05-02-2008, 06:40 PM

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
  •