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

Thread: Question about code line from CAM newbie

  1. #1
    BSF
    BSF is offline
    Registered
    Join Date
    Jan 2008
    Location
    USA
    Posts
    9
    Downloads
    0
    Uploads
    0

    Question Question about code line from CAM newbie

    I'm a true CAM newbie and trying to program my first part using SolidCAM. I have generated G-code using the program for the first time and have checked it line by line to make sure I understand everything. This one line is giving me problems. It's at the end of the header section. The only thing following it is M8 to turn the coolant on and then it goes into the operations, just a ton of G01 and G03 codes for programming linear and circular motion. Here is the line:

    G43 H1 D31 G0 X4.045 Y5.033 Z10 S39 M3

    1. My machine manual says G43 is for tool length compensation. SolidCAM knows what kind of tool I'm using, it's a 5/16" end mill that extends from the holder 2". Previosly in the header it called for this tool using the M06 T1 command. (There is only one tool used in this program) Question: I don't understand what the "H1" or the "D31" mean.

    2. The G0 code is clear enough, move to X4.045 Y5.033 Z10

    3. The S39 M3 is also bothering me. This is the only place in the code where the spindle is turned on and a speed is given. What in the heck does S39 mean? I would have expected S2000 or some kind of speed in that range.

    If someone could help me on questions 1 and 3 I would very much appreciate it. I'm nervous about running this program before understanding what this code line is doing.

    Thanks,
    -Brock


  2. #2
    Registered dcoupar's Avatar
    Join Date
    Mar 2003
    Location
    USA
    Posts
    2,502
    Downloads
    0
    Uploads
    0
    You don't state what machine and control you're using, so one can only assume...

    H1 is usually the tool length comp offset number that gets called by G43. Some folks store the distance from the tip of the tool to part zero in the offsets. Some store the length difference from the "reference" tool.

    D31 is usually the radius or diameter compensation offset number that gets called by G41/G42 (later in the program?). If your CAM system outputs the code for cutter centerline, enter the radius or diameter difference between the programmed tool and the actual tool in offset #31. If your CAM system outputs the code for "part profile", enter the radius or diameter of the cutter in offset #31.

    S39 could be either a speed "code" (some old machines used codes instead of RPM's). Or more likely you have your CAM system set to output Surface Feet Per Minute, but 39 SFM for a 5/16" endmill is only 477 RPM, so maybe it's a metric value (Surface Meters per Minute)?

    Good luck. If you need more help, give us a hint as to what machine and control you're using. Also, it would help if you could post a little more of the program code.


  3. #3
    Gold Member dertsap's Avatar
    Join Date
    Oct 2005
    Location
    canada
    Posts
    3,880
    Downloads
    0
    Uploads
    0
    its posting scary looking code ,it should look more like this

    G0 X4.045 Y5.033 S39 M3
    G43 H1 Z10

    http://home.columbus.rr.com/hputz/learningcncmill.html
    A poet knows no boundary yet he is bound to the boundaries of ones own mind !! ........
    http://microcarve.microcarve.biz/


  4. #4
    BSF
    BSF is offline
    Registered
    Join Date
    Jan 2008
    Location
    USA
    Posts
    9
    Downloads
    0
    Uploads
    0

    ...more detail about my CAM post question

    Thanks for the replies.

    I am using a 2003 Hurco VM1 which accepts what it calls (ISNC) - Industry Standard NC. The CAM software is set for "Fanuc" control, which was the most applicable looking selection available from the menu. The CAM software setting for material is "aluminum" so it should be basing the feeds and speed on that and the endmill with diameter 5/16". The units setting is set for inches, and everything looks logical when I run the simulation. My part looks like it should (starting from a 4" x 4" x 2.5" block) and the tool and toolholder looks like it should also, a CAT 40 toolholder with a 5/16" endmill. If you trust the simulation and trust that the "Fanuc" output will be accepted by the Hurco machine, everything SHOULD be fine. However, like I said above I wanted to check every line to make sure and this is the only one that I don't trust. Here is an excerpt of more of the code, taken from the beginning and down to where it's just going through the G00, G01 and G03 codes for movement all the way down to the end of the program where it's terminated with an M30.

    %
    O5000 (WELCOME_HOME2.TAP)
    ( MCV-OP ) (26-JAN-2008)
    (SUBROUTINES: O1 .. O0)
    G90 G17
    G80 G49 G40
    G54
    G91 G28 Z0
    G90
    M01
    N1 M6 T1
    (TOOL -1- MILL DIA 0.313 R0. MM )
    G90 G00 G40 G54
    G70
    G75
    G43 H1 D31 G0 X4.045 Y5.033 Z10. S39 M3
    M8
    (-----------------------)
    (F-PROFILE1-T1 - PROFILE)
    (-----------------------)
    X4.045 Y5.033 Z10.
    Z2.
    G1 Z-0.156 F2.598
    X3.522 Y5.398 F7.874
    G3 X0.478 Y5.398 R2.656
    ...and so on....


    There are no G41 or G42 codes called later in the program so I'm at a loss as to why it used a G43 command in the first place and why it called the radius/diameter offset #31.

    I am tempted to delete the G43 code unless someone thinks that's a bad idea.

    The next subject is the speed given as S39. I'm tempted to agree with your guess that this is a speed in surface meters per minute. I know the CAM software is set for inches but given that it's a European-written program, it appears that its typical default is metric. In fact, when programming the part (even though it's set for inches) on many occasions you have to override it's metric "guess" and put the inch value from the part such as maximum depth of cut for that operation. Metric surface speed is the only thing that would make sense given that would convert to about 1500 rpm. Also, see above where it gives the comment "(TOOL -1- MILL DIA 0.313 R0. MM )" after the tool change? See how it says MM at the end of that comment? That's troublesome... But it does say diameter 0.313 which is clearly inches (5/16") and not 0.313mm. The CAM simulation also confirmed for me that it was using a correctly-sized tool.

    I am tempted to change that code to:

    G0 X4.045 Y5.033 Z10. S1500 M3

    Any further input on these conclusions would be highly appreciated.
    Thanks,
    -BSF


  • #5
    BSF
    BSF is offline
    Registered
    Join Date
    Jan 2008
    Location
    USA
    Posts
    9
    Downloads
    0
    Uploads
    0

    ... one of the two questions solved

    I figured out what was wrong with the specified spindle speed. I had not defined my cutter material in the CAM program (it was actually set to "none") which is why the speed was so slow. I set the material to HSS and the speeds and feeds were recalculated when I re-did the g-code generation.

    I still have the question about the G43 code if anyone has further thoughts on that.

    Thanks,
    -BSF


  • #6
    Registered Mitsui Seiki's Avatar
    Join Date
    Feb 2007
    Location
    USA
    Posts
    464
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by BSF View Post
    I figured out what was wrong with the specified spindle speed. I had not defined my cutter material in the CAM program (it was actually set to "none") which is why the speed was so slow. I set the material to HSS and the speeds and feeds were recalculated when I re-did the g-code generation.

    I still have the question about the G43 code if anyone has further thoughts on that.

    Thanks,
    -BSF

    G43 is "Tool length compensation positive".G43 H1 get the tool length value from Tool offset#1.
    Tool length is the distance between spindle nose and tool tip.
    G49 cancel it.
    Stefan Vendin


  • #7
    Registered Mitsui Seiki's Avatar
    Join Date
    Feb 2007
    Location
    USA
    Posts
    464
    Downloads
    0
    Uploads
    0
    I think it should look something like this.

    O5000 (WELCOME_HOME2.TAP)
    ( MCV-OP ) (26-JAN-2008)
    (SUBROUTINES: O1 .. O0)
    G90 G17 G20 G80 G49 G40
    G0 G91 G28 Z0
    G28 X0 Y0
    M01
    N1 T1 M6
    (TOOL -1- MILL DIA 0.313 R0. MM )
    G90 G00 G54 X4.045 Y5.033 S2000 M3
    G43 H1 Z1.
    M8
    (-----------------------)
    (F-PROFILE1-T1 - PROFILE)
    (-----------------------)
    G1 G41 X4.045 Y5.033 D31(D1 is what it should be) F7.874
    Z2.
    Z-0.156 F2.598
    X3.522 Y5.398 F7.874
    G3 X0.478 Y5.398 R2.656

    .
    .
    .
    .
    Stefan Vendin


  • #8
    Gold Member dertsap's Avatar
    Join Date
    Oct 2005
    Location
    canada
    Posts
    3,880
    Downloads
    0
    Uploads
    0
    look at the link i posted , it will show you a proper format as well it will explain the codes
    S will be spindle rpm
    your d31 ,s 39 is to be determined by you and how you setup your tool prior to posting
    A poet knows no boundary yet he is bound to the boundaries of ones own mind !! ........
    http://microcarve.microcarve.biz/


  • #9
    BSF
    BSF is offline
    Registered
    Join Date
    Jan 2008
    Location
    USA
    Posts
    9
    Downloads
    0
    Uploads
    0

    ... some more clarification on the G43

    Hi Dertsap (and others),

    I studied the link you provided but it didn't answer my question. The example your link provided had a D31 following a G41 which makes sense. In other words, in your example, the cutter diameter offset number (D31) is used following the G41 command for cutter diameter compensation. The program gives the part edge which then must be offset by the cutter radius to yield the toolpath centerline.

    My problem (question) is that the G43 code in my program is not followed by a G41 or G42 anywhere. It does not make sense that a diameter offset (D31) is provided in that block. In other words, the CAM software must be outputting the toolpath centerline instead of the part edge (which would then need to be offset).

    The G43 code makes sense for length compensation, which apparently is what the H1 is for. In my case, I plan to zero the tool at the stock part origin which says to me that the offset should be zero.

    The Hurco VM1 setup screens are "part setup" and "tool setup". In both cases, I plan to park the tip of the tool at the part origin as it was defined in the CAM software.

    To me, this suggests that I do not need an offset and the G43 code in the program can be deleted. Or, I can use the format suggested by Mitsui Seiki and just do G43 H1 Z1. (Which I still don't understand what that achieves given that my tool offset is going to be zero as described in the previous paragraph...)

    Am I missing something?

    Thanks again, sincerely.
    -BSF


  • #10
    Registered
    Join Date
    Jul 2003
    Location
    New Zealand
    Posts
    1,137
    Downloads
    0
    Uploads
    0
    I'm also confused. Is this a Fanuc requirement?
    Unless you require something from the ordinary I question why the G43 and H1 are needed in the code at all.
    I've never included these in any code for my Fagor controller. The radius and tool length are in the table for the tool I'm using and this works fine. I zero the tool on the part as per drawing. Also when using G41/42 offset there is no problems.


  • #11
    Wanna be
    Join Date
    Mar 2004
    Location
    United States
    Posts
    551
    Downloads
    0
    Uploads
    0

    New guy confused as well

    G43 H1 D31 G0 X4.045 Y5.033 Z10 S39 M3

    I understand what this code is doing, but why? I am used to programming with a G43 H1 D1......If you are using tool 1 you should refer to height 1 and Diameter of 1. Keeps things alot easier in my mind.

    G43 being tool lenght offset, H being height of tool one, and d1 being the diameter. The D does not really belong in this line at all. It should be proceded by a G41 or G42 for tool diameter offset. Kinda crazy code if you ask me.

    Again, i am used to Haas and others are of course different. Is the D31 specific to your controller in some fashion other than cutter comp?

    Dan
    Check out what I am working on at www.routerbitz.com!


  • #12
    Registered Mitsui Seiki's Avatar
    Join Date
    Feb 2007
    Location
    USA
    Posts
    464
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by BSF View Post
    To me, this suggests that I do not need an offset and the G43 code in the program can be deleted. Or, I can use the format suggested by Mitsui Seiki and just do G43 H1 Z1. (Which I still don't understand what that achieves given that my tool offset is going to be zero as described in the previous paragraph...)
    -BSF


    The reason I wrote G43H1Z0.1 is that I have always measured my tools away from the machine in a tool presetter.
    It's a habit.
    You don't have to use G43 .
    Stefan Vendin


  • Page 1 of 2 12 LastLast

    Similar Threads

    1. How to get rid of line numbers in NC code
      By mcoughlin in forum CamWorks
      Replies: 1
      Last Post: 04-16-2007, 11:30 PM
    2. Seeing what line of code the machine is at?
      By greasetattoo in forum Carken Products (Deskam, DeskCNC etc)
      Replies: 6
      Last Post: 03-04-2007, 02:47 PM
    3. G-code ploter with line number annotated?
      By webcruiser8 in forum G-Code Programing
      Replies: 3
      Last Post: 09-21-2006, 06:49 AM
    4. G-Code Line Numbers?
      By Imagineering in forum G-Code Programing
      Replies: 3
      Last Post: 08-17-2005, 08:26 AM
    5. Perhaps a bug in simple one line code??
      By thuffner3 in forum TurboCNC
      Replies: 3
      Last Post: 02-02-2004, 09:21 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.