Hello Guest it is July 23, 2019, 08:11:13 AM

Author Topic: turn: gcode or mach bug?  (Read 5059 times)

0 Members and 1 Guest are viewing this topic.

turn: gcode or mach bug?
« on: February 02, 2012, 06:47:02 PM »
Hi,
I'm puzzled....
I can't seem to get mach to plot what I think I have in my gcode. It could be a my code, it could be mach - I'm unsure.
My code plots as expected in other plotting tools.

I've attached notes with the code and pics of the plots I get in NCPlot and mach.
I'm looking for anyone that can tell me where I went wrong in the lathe gcode, or verify that what mach is plotting is incorrect.

Dave
Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
Re: turn: gcode or mach bug?
« Reply #1 on: February 02, 2012, 07:01:34 PM »
Hi Dave,
  Toggle the check box in the pic, see if it helps.
Regards,
Russ
Re: turn: gcode or mach bug?
« Reply #2 on: February 02, 2012, 07:21:05 PM »
Thank you !!   :D :D

I actually had that turn option checked - un-checked it and now I get what I expected.

I knew it had to be something, but I was not seeing what it was.

Dave


Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com

Offline RICH

*
  • *
  •  7,342 7,342
    • View Profile
Re: turn: gcode or mach bug?
« Reply #3 on: February 02, 2012, 09:19:30 PM »
Hey Dave,
If you want there is a write up called Mach3 Arc Motion in Members Docs. Has numerous examples and even fun programs to run for arc's on the lathe.

RICH
Re: turn: gcode or mach bug?
« Reply #4 on: February 02, 2012, 10:22:23 PM »
Rich,
That is a very useful document! Thanks for putting it together.
I've been trying to wrap my brain around the various combinations of tool post locations and config options etc.

Dave

Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com

Offline Hood

*
  •  25,849 25,849
  • Carnoustie, Scotland
    • View Profile
Re: turn: gcode or mach bug?
« Reply #5 on: February 03, 2012, 03:37:22 AM »
Just for your information since you are talking about Front/Rear toolposts. It doesnt matter what you have in the tool table as long as you stick to one or the other. If you try and set up offsets for tools with both front and rear selected for various tools you will end up in a mess and have some nasty shocks, so only use one or the other ;)
Hood

Offline RS

*
  •  9 9
    • View Profile
Re: turn: gcode or mach bug?
« Reply #6 on: February 03, 2012, 12:24:09 PM »
Rich,
    Could you please show me where that Mach3 Arc Motion article is?  I can't seem to find it.  I have been having a ton of problems with arcs.  I no longer get crop circles but on every small arc I draw, I get crop arcs.  I will attach an example of what is happening.  It doesn't seem to matter what tool I use or where the tool comes from.  Any ideas?  I am using bobcad.  My post processor is below.  I am using a Sherline 2 axis lathe.  I am a beginner.  Thank you.


 "Customization file for Mach3 1 Line format Lathe modifed by TV 06/23/11"
 "Used for general Mach3, inch"
 "no tapping cycle, G90,G94,G92, turn Groove, Face GR, turn cycle"

Post variables listed in PostVariables.txt


****Version number MONTH DAY YEAR****
1000. Version Information = Version Month Day Year? "9.3 06 11 2010"


0. File Header.
   user_comment_1,
   user_comment_2,
   user_comment_3,
   user_comment_4,
   user_comment_5,
   user_comment_6,
   user_comment_7,
   user_comment_8,
   user_comment_9,
   user_comment_10,
   user_comment_11,
   user_comment_12,
   user_comment_13,
   user_comment_14,
   user_comment_15,
   
1.
   "(BEGIN PREDATOR NC HEADER)"
   "(MCH_FILE=LATHE.MCH)"
    output_lathe_tool_list
   output_stock
   "(END PREDATOR NC HEADER)"
   " "

2. Start of program with turning cycles.

   program_block_1

"%"
"O",prog_n,"(",prog_name,")"
   n,"(DATE - ",output_date,", TIME - ",output_time,")"
   n,"(POST - HAAS LATHE )"
   
   " "

start_comment,comment2,end_comment
n,rapid_move,"G40","G95",measure_mode,movement_mode
n,t

n,s,spindle_on
n,"G00","G54",xr,zr
n,coolant_on


   
3. Tool change for turning cycles.

n,coolant_off

n,"M1"
" "

start_comment,comment2,end_comment
n,t

n,s,spindle_on
n,"G00",xr,zr
n,coolant_on


   
4. Next operation same tool turning.

n,s

n,"G00",xr
n,zr


5. End of turning cycles.

n,"M09"
n,"M05"

n,"M30"   
"%"

6. Next operation same tool facing.
n,s

n,"G00",zr
n,xr

7. Same operation same tool turning.
n,s

n,"G00",xr
n,zr


8. Set debug.
debug_off

9. Same operation same tool facing.
n,s

n,"G00",zr
n,xr

10. Cancel cutter compensation.
   "G40"

11. Cutter compensation left.
   "G41"

12. Cutter compensation right.
   "G42"

13. Tool length compensation.

20. Rapid move.
   n,rapid_move,xr,zr

21. Feed move.
   n,feed_move,cc,x_f,z_f,feed_rate

22. Dwell

25. Arc move.
   n,g_arc_move,x_f,z_f,arc_center,feed_rate

26. Auto cancel cutter compensation after last feed move.

58. Output before any cutting cycle.

59. Output after any cutting cycle.
   

60. Auto finish cycle for G71,G72,G73 for turning.
   n,"(Unsupported in Mach3, select Separate Moves in Posting Parameters)"

62. Start of rough (G71) turning cycle.
   n,"G77", "(This cycle is implemented by the macro M1077.M1S )"
   n,"(Edit the macro or select Separate Moves in Posting Parameters)"
   

63. End of rough (G71) turning cycle.


64. End of rough turning cycle separate moves.

66. Start of rough (G72) facing cycle.
   n,"G78", "(This cycle is implemented by the macro M1078.M1S)"
   n,"(Edit the macro or select Separate Moves in Posting Parameters)"
   
67. End of rough (G72) facing cycle



68. End of rough facing cycle Separate moves.

70. Start of finish (G73) turning cycle
   n,"(Unsupported in Mach3, select Separate Moves in Posting Parameters)"

71. End of finish (G73) turning cycle


72. End of finish turning cycle separate moves.

74. Start of groove (G75) turning cycle
   n,"(Unsupported in Mach3, select Separate Moves in Posting Parameters)"

75. End of groove (G75) turning cycle


78. Start of groove (G74) facing cycle
   n,"(Unsupported in Mach3, select Separate Moves in Posting Parameters)"

79. End of groove (G74) facing cycle



80. End of groove facing cycle separate moves.

82. Start of drill (G74) cycle
   n,"G83",groove_x_bottom,groove_z_bottom,peck_retract,program_block_5,feed_rate

83. End of drill (G74) cycle


84. End of drill cycle separate moves.

86. Start of threading cycles.

87. Start of thread (G76) cycle
   n,"G76",thread_x2,thread_z2,program_block_13,program_block_12,thread_first_cut_decimal,Thread_angle_in,"C.03",thread_last_cut,taper_height

88. End of thread (G76) cycle


90. End of thread (G33) cycle

91. End of threading cycles.

92. G32 line move.
n,thread_g33_gcode,thread_g33_xmove,thread_g33_zmove,thread_g33_feedrate

93. G32 thread cut move.
n,thread_g33_gcode,thread_g33_xmove,thread_g33_zmove,thread_g33_feedrate

100. Start of cutoff cycle

101. End of cutoff cycle

104. Start of auto finish no canned cycle.

105. End of auto finish no canned cycle.

108. Start of auto stock feed cycle.
"( FEED STOCK, NEED TO EDIT )"

n,rapid_to_position_z
n,rapid_to_position_x
n,rapid_to_stock_feed_z
n,feed_move,stock_from_x,stock_feedrate
n,"M11"
n,"G4","U1."
n,rapid_to_pickup_z
n,"G4","U.5"
n,"M10"
n,"G4","U1."
n,"G28","U0"
n,"G28","W0"
n,"M1"

109. End of auto stock feed cycle.

110. Tool list format.
"(LTOOL",t,ltool_home,"S",ltool_type,"O",ltool_cutting_angle,"I",ltool_ic,"A",ltool_angle,"C",ltool_corner_rad,"H",ltool_height,"D",ltool_diam,"N",ltool_orientation,")"

111. Stock definition.
"(SCYL S3 X0 Y0 Z", z_end_of_stock, "D",stock_diameter, "L",stock_length,")"
"(HCYL S3 X0 Y0 Z", z_end_of_stock, "D",stock_internal_diameter, "L",stock_length,")"

199. Not Used

220. Is X modal? y
222. Is Z modal? y
223. Are the g codes modal? y
224. Are the xy (or yz or xz) coordinates modal in arc milling? n
225. Are the g codes (G02 and G03) modal in arc milling? y
228. Output sequence numbers? n
230. Delete the decimal point? n
231. Delete leading zeros? n
232. Delete trailing zeros? y
234. Places before decimal point for reals? 1
235. Number of places for G and M codes? 1
236. Places after decimal for feedrate ? 3
237. Scale factor for feedrate ? 1
239. Add spaces to the program? y
241. Break arcs into quadrants? y
242. Arc center a=absolute, b=incremental, d=unsigned inc., e=radius? E
243. Break arcs into two pieces if greater than 180 degrees? y
247. Sign of X Spindle 1 (p = pos, n = neg, e = either, r = reverse)? e
248. Sign of X Spindle 2 (p = pos, n = neg, e = either, r = reverse)? e
249. Output X as a diameter or radius (d/r)? d

250. Use canned cycle for drilling? y
251. Use canned cycle for peck drilling? y
252. Use canned cycle for chip break? y
253. Use canned cycle for tap? y
254. Use canned cycle for bore #1? y
255. Use canned cycle for bore #2? y
258. Use two line canned cycle format? n

259. Depth format (d = default, t = trailing)? t
260. Amount to add to t to obtain t1? 0
261. Amount to add to t to obtain t2? 0
262. Value of t1 at t = 0? 0
263. Value of t2 at t = 0? 0
265. Places before decimal point for angles? 1

300. Number of places for sequence numbers? 1
302. Number of places for program number? 4

411. R value (Retract amount) for first line of 2 line rough cycle? 0.1
412. R value (Retract amount) for first line of 2 line groove cycle? 0.1
413. R value (Thread mach allowance) 2 line G76 cycle? 0.001

512. Tool number format (1=n, 2=n*101, 3=100*n+toffset, 4=toofset, 5=n*100)? 2
513. Number of digits for tool number? 4

517. Medium gear1 spindle speed? 901
518. Medium gear2 spindle speed? 10000
519. Medium gear3 spindle speed? 10000
520. Medium gear4 spindle speed? 10000
521. Medium gear5 spindle speed? 10000
522. Medium gear6 spindle speed? 10000
523. Medium gear7 spindle speed? 10000
524. Medium gear8 spindle speed? 10000
525. Medium gear9 spindle speed? 10000
526. High gear spindle speed? 10000


540. Number of decimal places real numbers metric ? 3
541. Number of decimal places real numbers inch ? 4
542. Number of decimal places angles ? 3
543. Number of decimal places for thread lead? 4

544. Auto output cancel offset (G40)(0=no, 1=On last feed move, 2=after last feed move)? 1

612. Reverse G2 and G3? n
613. Reverse the sign of I? n
614. Reverse the sign of K? n
615. Reverse the sign of Thread taper height (R)? n

635. Are Feed Rates modal? y

640. Check each output line with scripting? n

705. Symbol for lead? "F"
706. Symbol for IPR feedrate? "F"
707. Symbol for IPM feedrate? "F"
710. Begin comment character? "("
711. End comment character? ")"
712. Threading chamfer out start code? ""
713. Threading chamfer out end code? ""
714. Inch mode machining? "G20"
715. Metric mode machining? "G21"

720. Absolute coordinates? "G90"
721. Incremental coordinates? "G91"
722. Coordinate zero set? "G52"

725. End of file? "M30"
726. Stop? ""
727. Optional Stop? "M01"
728. Subprogram call? "M98"
729. Subprogram return? "M99"

739. Cancel wire offset? ""

741. Prefix for radius values? "R"
742. Prefix for arc Z center? "K"
743. Prefix for arc X center? "I"

750. Wire comp left? ""
751. Wire comp right? ""

756. Block delete? ""
759. Add these characters to the end of each line? ""

773. Coolant on String ? "M08"
774. Coolant off String ? "M09"

780. Symbol for Spindle Speed ? "S"
781. Symbol for Tool Number Prefix ? "T"
782. Spindle forward String ? "M03"
783. Spindle reverse String ? "M04"
784. Spindle off String ? "M05"
785. Symbol for CSS spindle speed? "G96"
786. Symbol for RPM spindle speed? "G97"
790. Prefix for canned cycle start line Number? "P"
791. Prefix for canned cycle end line Number? "Q"
792. Prefix for thread G76 first cut amount? "H"
793. Prefix for thread height? "K"
794. Prefix for thread angle in? "I"
795. Prefix for thread last cut amount? "B"
796. Prefix for thread machine allowance? ""
797. GCode for Rapid Move? "G00"
798. GCode for Feed Move? "G01"
799. GCode for Arc CW? "G02"
800. GCode for Arc CCW? "G03"
801. Prefix for X Move? "X"
802. Prefix for Y Move? ""
803. Prefix for Z Move? "Z"
804. Prefix for Rough Cycle depth of cut? "D"
805. Prefix for Rough Cycle stock allowance X? "U"
806. Prefix for Rough Cycle stock allowance Z? "W"
807. Prefix for Rough Cycle retract amount? "R"
808. Prefix for Finish Cycle stock allowance X? "U"
809. Prefix for Finish Cycle stock allowance Z? "W"
810. Prefix for Finish Cycle X stock amount for spring passes? "I"
811. Prefix for Finish Cycle Z stock amount for spring passes? "K"
812. Prefix for Groove Cycle retract amount? "D"
813. Prefix for Groove Cycle X bottom? "X"
814. Prefix for Groove Cycle Z bottom? "Z"
815. Prefix for Groove Cycle depth of cut? "K"
816. Prefix for Groove Cycle peck increment? "I"
817. Prefix for thread taper height? "T"

822. GCode for simple threading cycle? "G32"
823. Prefix for X depth for roughing cycle? ""
824. Prefix for Z depth for roughing cycle? ""
825. Prefix for groove dwell? ""
826. Prefix for groove peck clearance? "R"
827. Prefix for groove peck retract? "R"
830. Code for low spindle gear? ""
831. Code for medium1 spindle gear? ""
832. Code for medium2 spindle gear? ""
833. Code for medium3 spindle gear? ""
834. Code for medium4 spindle gear? ""
835. Code for medium5 spindle gear? ""
836. Code for medium6 spindle gear? ""
837. Code for medium7 spindle gear? ""
838. Code for medium8 spindle gear? ""
839. Code for medium9 spindle gear? ""
840. Code for high spindle gear? ""

841. Prefix for drill first peck amount? ""
842. Prefix for drill peck increment amount? ""
843. Prefix for Tool Home Number? ""

860. Standard Drill cycle live tool face? "G81"
861. Peck drill cycle live tool face? "G83"
862. High speed peck cycle live tool face? "G83"


880. Standard Drill cycle live tool diameter? ""
881. Peck drill cycle live tool diameter? ""
882. High speed peck cycle live tool diameter? ""
883. Tap cycle live tool diameter? ""
884. Boring cycle 1 live tool diameter? ""
885. Boring cycle 2 live tool diameter? ""
886. Boring cycle 3 live tool diameter? ""
890. Canned cycle cancel? "G80"

2001. Program Block 1.
   blnGroove = false

2002. Program Block 2. store current tool , not use
   tn = Lathe_GetToolNumber()

2003. Program Block 3. return current tool number, not use
   
   Lathe_SetReturnString("T" & tn & "00")
   

2004. Program Block 4.

2005. Program Block 5. return drill peck in form of Q
   q = Lathe_GetGrooveDepthOfCut()
   q = round(q,4)
   Lathe_SetReturnString(" Q" & q)
   

2006. Program Block 6.

2007. Program Block 7. return I.03 or I-.03 for G71 depends OD or ID, not used
   r = Lathe_GetRoughXAllowance()
   if r > 0 then
      Lathe_SetReturnString(" I0.03")
   elseif r <= 0 then
      Lathe_SetReturnString(" I-0.03")
   end if
      

2008. Program Block 8.

2009. Program Block 9. return true if groove tool
   blnGroove = true

2010. Program Block 10. not used
      if blnGroove = true then
         Lathe_ProcessPostLine ( "n,rapid_move,zh")
         Lathe_ProcessPostLine ( "n,rapid_move,xh")
         blnGroove = false
      end if

2011. Program Block 11.

2012. Program Block 12. return G76 thread pitch in form of P.05
   tfr = Lathe_GetThreadLead()
   tfr = round(tfr,4)
   Lathe_SetReturnString(" P" & tfr)
   

2013. Program Block 13. return spring pass in form of Q2.
   sp = Lathe_GetFinishNumberOfCuts()
   Lathe_SetReturnString(" Q" & sp)

2014. Program Block 14.

2015. Program Block 15.

2016. Program Block 16.

2017. Program Block 17.

2018. Program Block 18.

2019. Program Block 19.

2020. Program Block 20.

2021. Program Block 21.

2022. Program Block 22.

2023. Program Block 23.

2024. Program Block 24.

2025. Program Block 25.

2026. Program Block 26.

2027. Program Block 27.

2028. Program Block 28.

2029. Program Block 29.

2030. Program Block 30.

2031. Program Block 31.

2032. Program Block 32.

2033. Program Block 33.

2034. Program Block 34.

2035. Program Block 35.

2036. Program Block 36.

2037. Program Block 37.

2038. Program Block 38.

2039. Program Block 39.

2040. Program Block 40.

2041. Program Block 41.

2042. Program Block 42.

2043. Program Block 43.

2044. Program Block 44.

2045. Program Block 45.

2046. Program Block 46.

2047. Program Block 47.

2048. Program Block 48.

2049. Program Block 49.

2050. Program Block 50.

2051. Program Block 51.

2052. Program Block 52.

2053. Program Block 53.

2054. Program Block 54.

2055. Program Block 55.

2056. Program Block 56.

2057. Program Block 57.

2058. Program Block 58.

2059. Program Block 59.

2060. Program Block 60.

2061. Program Block 61.

2062. Program Block 62.

2063. Program Block 63.

2064. Program Block 64.

2065. Program Block 65.

2066. Program Block 66.

2067. Program Block 67.

2068. Program Block 68.

2069. Program Block 69.

2070. Program Block 70.

2071. Program Block 71.

2072. Program Block 72.

2073. Program Block 73.

2074. Program Block 74.

2075. Program Block 75.

2076. Program Block 76.

2077. Program Block 77.

2078. Program Block 78.

2079. Program Block 79.

2080. Program Block 80.

2081. Program Block 81.

2082. Program Block 82.

2083. Program Block 83.

2084. Program Block 84.

2085. Program Block 85.

2086. Program Block 86.

2087. Program Block 87.

2088. Program Block 88.

2089. Program Block 89.

2090. Program Block 90.

2091. Program Block 91.

2092. Program Block 92.

2093. Program Block 93.

2094. Program Block 94.

2095. Program Block 95.

2096. Program Block 96.

2097. Program Block 97.

2098. Program Block 98.

2099. Program Block 99.
Re: turn: gcode or mach bug?
« Reply #7 on: February 03, 2012, 12:52:11 PM »

Offline RICH

*
  • *
  •  7,342 7,342
    • View Profile
Re: turn: gcode or mach bug?
« Reply #8 on: February 03, 2012, 05:19:20 PM »
RS,
Quote
but on every small arc I draw, I get crop arcs
See page 11 in the write-up and last sentence may apply.

As far as Bobcad, haven't tried using it in "years", know nothing about it anymore let alone modifying it's pp.

RICH

Offline RS

*
  •  9 9
    • View Profile
Re: turn: gcode or mach bug?
« Reply #9 on: February 07, 2012, 09:57:28 AM »
Thank you for that link.  RS