585,668 active members*
4,353 visitors online*
Register for free
Login
Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2007
    Posts
    20

    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
    Join Date
    Nov 2007
    Posts
    1702
    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
    Join Date
    Oct 2006
    Posts
    586
    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
    Join Date
    Jan 2006
    Posts
    481
    LOL , this g code stuffing is going to my head

  5. #5
    Join Date
    Oct 2007
    Posts
    20
    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. #6
    Join Date
    Jul 2005
    Posts
    15
    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. #7
    Join Date
    Oct 2007
    Posts
    20
    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. #8
    Join Date
    Jul 2005
    Posts
    15
    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. Okuma will not write program
    By 60sMoparGuy in forum Okuma
    Replies: 4
    Last Post: 01-12-2014, 06:24 PM
  2. write a g code for an arc
    By frankshoreline in forum G-Code Programing
    Replies: 2
    Last Post: 04-25-2013, 08:50 AM
  3. Write program
    By mike sr1 in forum Tormach Personal CNC Mill
    Replies: 10
    Last Post: 02-11-2012, 11:17 PM
  4. Possible to write variables to a program?
    By Heavy D in forum G-Code Programing
    Replies: 2
    Last Post: 08-22-2006, 05:08 AM
  5. someone wanna write a program?
    By ljoe1969 in forum DIY CNC Router Table Machines
    Replies: 2
    Last Post: 06-07-2004, 01:47 AM

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
  •