Results 1 to 8 of 8

Thread: How to write a code program to cut threads

  1. #1
    Registered
    Join Date
    Oct 2007
    Location
    usa
    Posts
    20
    Downloads
    0
    Uploads
    0

    How to write a code program to cut threads

    I am a shop teacher just learning the CNC side of machining. I need to write a program to cut 1/2-13 threads for a school project. We do have a spectra light 400 lathe. We can use a cam product to draw and produce the cnc program automatically. It produces a canned cycle and when we put it into the lathe program it will not move in the z direction. The tool will move into the X position and the spindle will turn on. After talking to consultants they think there is something wrong with the lathe. Anyway I would like to try and write the code manually. I have a small understanding of the code and just need some help.

    Thanks.
    Jack


  2. #2
    Registered Donkey Hotey's Avatar
    Join Date
    Nov 2007
    Location
    USA
    Posts
    1,650
    Downloads
    0
    Uploads
    0
    Can you post the program output here?

    Are you totally new to G-code or just to the threading canned cycle? Do other XZ moves work correctly?

    It might be doing the positioning up to the point where the threads are supposed to start, turning the spindle on, then choking on the actual canned cycle that cuts the thread. That's my uninformed guess.
    Greg


  3. #3
    Registered jackson's Avatar
    Join Date
    Oct 2006
    Location
    United States
    Posts
    586
    Downloads
    0
    Uploads
    0
    IT DEPENDS ON IF YOUR CONTROL IS SET UP FOR SINGL OR DOUBLE LINE G76 IF THAT IS WHAT YOUR USING
    DOUBLE IS NORMALE FOR NEWER MACHINES

    G0G54T101
    G97S800M3
    X.55Z.1M8
    G76P020060Q100R.002(THE DECIMAL IN THE R ALSO DEPENDS ON THE MACHNE)
    G76X.421Z-1.P300Q150F.076

    SINGLE
    G76P020060X.421Z-1.D200F.076(I THINK ITS BEEN AWHILE SINCE I WROTE A SINGLE LINE )
    individual who perceives a solution and is willing to take command. Very often, that individual is crazy.


  4. #4
    Registered
    Join Date
    Jan 2006
    Location
    Australia
    Posts
    477
    Downloads
    0
    Uploads
    0
    LOL , this g code stuffing is going to my head


  • #5
    Registered
    Join Date
    Oct 2007
    Location
    usa
    Posts
    20
    Downloads
    0
    Uploads
    0
    I used spectracam to cut 1/2-16 threads. It works when I verified it. I loaded the cnc program into the spectra light turn program and it will verfify just fine but when I go to run the program the bit will move into the x axis but will not move on the z. So if there is someone out there to look at this file and see if some thing is not written properly. Sorry it has taken so long to answer.

    thanks.

    Jack

    N0 ; spectraLIGHT Turning Center
    N1 ; Single Tool Operation
    N2 ; Material Type: screw
    N3 ; Material Size: Z4 X0.5
    N4 ; Material Origin: Z0 X0
    N5 ; Units: Inch
    N6 ; External Tool #4: 'Threading Tool'
    N7 M03
    N8 M05
    N9 G05 ; Insert Tool #04
    N10 M03
    N11 ; Thread Cycle, Threading #1
    N12 S200
    N13 G04 F5 ; Dwell Five Seconds
    N14 G0 Z4 X0.25
    N15 G32 Z0.52 X0.2035 Q0.05 F0.077
    N16 G80
    N17 G0 X0.25 ; Retract
    N18 M02 ; End of File


  • #6
    Registered
    Join Date
    Jul 2005
    Location
    Canada
    Posts
    15
    Downloads
    0
    Uploads
    0
    Hi Jack,

    Last year I rebuilt an old Light Machines lathe for one of our local high schools that had a circa.1988 TMC1000 controller that had fried. I built them a new controller with 2 stepper boards and it runs on TurboCNC and G code through the parallel port ... I may be able to help ... or not!

    I have a couple of questions to try and get a grip on your problem;

    Does your lathe respond to jog commands from the keyboard in both the Z and X axis?

    Can you give the control an MDI command in the form of a single string on typed in G code? ie G00 X1.0 Z2.5 << and will both axis move?

    From your description of the problem it sounds like you may have a code problem with your G32 command. Am I right in assuming that your spectracam came with the lathe?


    Do you have a command reference for the acceptable parameters for your G32 (not all flavours of G and M code are created the same)?

    Check to see if your G32 parameters math the following for your command

    G32 Z0.52 (end value in z-axis) X0.2035 (max depth dia or rad - specify) Q0.05 (depth of cut - this could be the problem) F0.077 (feed for pitch).


  • #7
    Registered
    Join Date
    Oct 2007
    Location
    usa
    Posts
    20
    Downloads
    0
    Uploads
    0
    What did it cost to build the new controller? Do you do that for a living? I have an ENCO lathe I wanting to do something different with. Currently it is set up with the England standards of Z going in a negative direction. Or I guess + Z is out on the right end of the stock instead of next to the stock. Will your set up work on that?

    It was last fall since we tried the thread program so I have kinda forgotten about it. We ended up cutting them on the enco lathe.

    Let me know about the controller.

    Thanks.

    Jack


  • #8
    Registered
    Join Date
    Jul 2005
    Location
    Canada
    Posts
    15
    Downloads
    0
    Uploads
    0
    Hi Jack,

    See the PM I sent you, in short I used chips I had access to and the total cost was under $100 to make 2 driver boards, a breakout board, and drop in an indexer from CNC4PC to allow spindle sync for threading.
    As for the whole axis definition problem ... TurboCNC will let you name and swap the axis names and definitions and directions any way you like. Check out the site at www.dakeng.com - I'd say it's a must for any first time machine builder/converter. The same is true of Dave's site at www.hobbycnc.com.

    Rob



  • Similar Threads

    1. Mazatrol Program into a G Code Program
      By fuzzman in forum Mazak, Mitsubishi, Mazatrol
      Replies: 15
      Last Post: 09-25-2012, 11:27 AM
    2. Look at this code for cutting threads
      By jjenks in forum General CNC (Mill and Lathe) Control Software (NC)
      Replies: 0
      Last Post: 10-25-2007, 01:06 PM
    3. Possible to write variables to a program?
      By Heavy D in forum G-Code Programing
      Replies: 2
      Last Post: 08-22-2006, 12:08 AM
    4. someone wanna write a program?
      By ljoe1969 in forum DIY CNC Router Table Machines
      Replies: 2
      Last Post: 06-06-2004, 08:47 PM

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.