586,190 active members*
4,024 visitors online*
Register for free
Login
Results 1 to 19 of 19
  1. #1
    Join Date
    Aug 2005
    Posts
    25

    G90/G91 in canned cycles

    Using Camsoft CNC Pro v15.8
    I am trying to use G90 or G91 with G81. I am having problems and wondering if anyone out there has succeeded in doing so.

    G54
    G0 X-4 Y-1 X1
    G90 G81 Z-1 R.15
    X-3
    G91 X-1
    X-2
    G90 X-20
    G80

    I want to maintain the drill cycle in Abs at all times, but at times want to move between holes in Inc then back to an Abs move. That being said, there may also be times when I want the drill cycle to be in Inc mode. (separate drill cycle)

    I have played around with it for several days and feel like beating my head against the wall. Camsoft tech is helpful, but busy and several timezones away. Any other help would be great.

  2. #2
    Join Date
    Apr 2003
    Posts
    332
    Alfalfa,

    Switching X,Y,Z to incremental could be done easily if you customize your drilling macro to trap for both modes. The X,Y abs/inc positions are going to be taken care of themselves but making a change within the canned cycle is going to affect the Z unless you customize the macro to keep track of Z.

    You will find canned cycle drilling macros for both abs and inc G81 in the MACRO.MAC file of V15.8 but you would have to combine them to be able to switch modes while still in the cycle.

    Most of us would advise you to pick one method or the other so an easier method would be to simply place a G81 on the G91 line to start a new canned cycle in incremental. This would be easier to do because you can add logic to call the macro of your choice when the drilling cycle starts rather than trying to trap for a mode switch or mixture. Just remember to add G90 after the end of the cycle or else the X,Y and Z's will continue to be incremental.

    Tech Support
    CamSoft Corp.
    (951) 674-8100
    [email protected]
    www.cnccontrols.com
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  3. #3
    Join Date
    Mar 2004
    Posts
    1543
    Just another note.

    I see you don't have a feed rate in your G-code. The control will just sit there and appear hung up (feed is 0).

    DAMHIKT (Don't ask me how I know this)

    Karl

  4. #4
    Join Date
    Aug 2005
    Posts
    25
    Right, it should include a Fcode, I forgot to add it. My main concern is switching between G90/G91. Also, on a slightly different topic, has anyone ever done a 5 axis mill using camsoft??

  5. #5
    Join Date
    Mar 2004
    Posts
    1543
    Camsoft:

    I went looking throught the new default CBKs in 15.8 for one that uses the [G81 incremental] macro in macro.mac and also G98 and G99. Couldn't find anything. It would be real nice to inspect a CBK that can use drill cyles in either G90 or G91 <absolute incremental>modes and also in G98 or G99 modes<return to Z or R plane> There's four combinations here, and at least on first look, I don't see how to handle this.

    IMHO, this should be included as standard stuff.

    Karl

  6. #6
    Join Date
    Aug 2005
    Posts
    25
    I would have to humbly agree with Karl.

  7. #7
    Join Date
    Apr 2003
    Posts
    332
    Check yourself for bites...

    The drilling routines are right there in the Default.CBK and Macro.MAC files.

    In the Default.CBK you will find these pre-written macros and G codes
    [G81]
    [G81 INCREMENTAL]

    \998=1 ' return to initial point in canned cycle
    -----G98
    \998=0 ' return to Rapid plane in canned cycle
    -----G99

    The MACRO.MAC file has several alternatives plus each CBK made up for various machine types and models have there own variations.

    [G73HighSpeed] 'G73 High Speed Deep Hole Drilling Cycle
    [Bolt Hole Drill G181] ' Drilling of bolt patterns
    [G83Standard] ' Description of G83 Deep Hole Drilling Cycle
    [G83FeedDown] ' Description of G83 Deep Hole Drilling Cycle (Feed Down)
    [G98 SET] ' Sets initial point in canned cycle
    [G98 RETURN] ' Return method for G99 in G90 or G91 modes
    Also the other canned cycles G82 through G89 are there as well.

    We have been approached with over 40 varieties of drilling cycles over the years. We say to each his own, so we have been modulizing these canned cycles to call macros so each user can swap out the defaults with their own.

    The provided drilling routines take care of the drilling cycles in G90 or G91 and also G98 or G99 modes but the original question posed to merge or mix the routines without ending the current cycle to start a new cycle has not been done. It can be done, but it would take some one to merge them together.

    Tech Support
    CamSoft Corp.
    (951) 674-8100
    [email protected]
    www.cnccontrols.com
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  8. #8
    Join Date
    Apr 2003
    Posts
    332
    Geof,

    The power is in the knowledge that you can...

    However, you're right we don't have it setup this way now. When asked in the past we just told people to begin another G81 but people tend to use cad/cam systems more these days that post in one format so when asking around here no one could even remember the last time we were asked. The X,Y take care of them self, so only Z would need to be kept track of if someone wanted to add it. There's a memo now suggesting this for the version.

    Tech Support
    CamSoft Corp.
    (951) 674-8100
    [email protected]
    www.cnccontrols.com
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  9. #9
    Join Date
    Mar 2004
    Posts
    1543
    I took a second look at default.cbk tonight. I'm 2000 miles from my control so I can only inspect logic. The code run during G81 is below.

    My concern is with G98 <return to initial level> and G99 <return to R level>. It looks like if you call a G81 in G90 mode the drill cycle will always run in G99 mode. If you call a G81 in G91 mode the drill cycle will always run in G98 mode.Look at the last line of [[G81]], it commands a rapid to the R plane. And, look at the last line of the [[G81 INCREMENTAL]], it commands a rapid to the inital level.

    Logic is needed in these two macros to check for G98 and G99. All the other drill macros need a similar modification. I see \998 is used for other purposes, I'd suggest a different variable.

    Karl








    Gcode.fil

    IF \774=1 THEN GOTO :INCMODE
    IF\775=0THEN\776=z:[G81]:\775=81:EXIT
    IF\775=81THEN[G81]
    IF\775=82THEN[G82]
    IF\775=83THEN[G83]
    IF\775=84THEN[G84]
    IF\775=85THEN[G85]
    IF\775=86THEN[G86]
    IF\775=87THEN[G88]
    IF\775=88THEN[G89]
    EXIT
    :INCMODE
    IF\775=0THEN\776=z:[G81 INCREMENTAL]:\775=81:EXIT
    IF\775=81THEN[G81 INCREMENTAL]
    IF\775=82THEN[G82 INCREMENTAL]
    IF\775=83THEN[G83 INCREMENTAL]
    IF\775=84THEN[G84 INCREMENTAL]
    IF\775=85THEN[G85 INCREMENTAL]
    IF\775=86THEN[G86 INCREMENTAL]
    IF\775=87THEN[G88 INCREMENTAL]
    IF\775=88THEN[G89 INCREMENTAL]
    -----G81


    \998=1 ' return to inital point in canned cycle
    -----G98
    \998=0 ' return to Rapid plane in canned cycle
    -----G99




    macro.fil

    [[G81]]
    ' G81
    ISTHERE Z;\400;\401
    IF\400>0THEN\776=\401
    DECELSTOP
    RAPID x;y;r
    GO x;y;\776
    DECELSTOP
    RAPID x;y;r

    [[G81 INCREMENTAL]]
    ' G81
    ' Call this routine from the GCODE.FIL file when in incremental mode
    ' R value for rapid clearance plane is incremental from the current Z position
    x=0:y=0:z=0:r=0
    ISTHERE X;\400;\401
    IF\400>0THENx=\401
    ISTHERE Y;\400;\401
    IF\400>0THENy=\401
    ISTHERE Z;\400;\401
    IF\400>0THENz=\401:\776=\401
    ISTHERE R;\400;\401
    IF\400>0THENr=\401:\778=\401
    DECELSTOP
    RAPID x;y;0
    DECELSTOP
    RAPID 0;0;\778
    GO 0;0;\776
    DECELSTOP
    RAPID 0;0;{0-(\776+\778)}

  10. #10
    Join Date
    Jan 2006
    Posts
    7
    You'll find good examples of G98,G99 and G83 in the Default.cbk file. This will show you how it was done in case you wanted to add it to any new canned cycles you or anyone else wrote but you can always do as I have. Place a [G98 Set] call as the first line in your canned cycle and a [G98 Return] call at the end just before EXIT. I saw you posted some camsoft internal logic but that may be copyrighted. I think you should just ask camsoft for these macros so you can make all your canned cycles this way.

  11. #11
    Join Date
    Aug 2005
    Posts
    25
    Mr. A raises a good point that should be clarified as I know none of us want to be violating copyright laws. Camsoft - is it OK to post portions of internal code such as we have been doing in this thread? I believe that this is a great way to 1- have more than 1 or 2 minds working on something. 2 - get ideas for new upgrades (for Camsoft) 3 - pass on useful tips/solutions/workarounds for common or not so common issues that arise.

    AL


    De Oppresso Liber - Is 61:1-4

  12. #12
    Join Date
    Apr 2003
    Posts
    332
    alfalfa,

    This is a touchy situation and for the most part we see that it really does help people. Speaking without the authority to say so, we would say legally speaking do not post CamSoft internal logic routines on a public forum. Some material is copyrighted by 3rd parties and much of it we ourselves should get written permission to publicly pass it along or hand out. Most people already have what they're looking for anyway. They just don't know where to find it and can view the logic for themselves if a poster wanted to point out to them as to where to find it. For people that can't find it they could ask us. We do have a full tech staff here.

    On the other hand there are many very clever people out there. We are amazed sometimes at what has been done and can safely suggest that if you are the owner of the logic or wrote it your self then by all means post it. Much of what we add to our own files is that of our customers sharing these routines with us freely.

    The benefits of what people have learned and shared with us over the years using CamSoft has snow balled into a vast library of routines spread over many computers here at our offices that even we can't keep track of what we have to offer sometimes.

    This is your forum to discuss ideas with others. We are always listening to the discussions so we will step in and provide accurate information and also post routines or logic to straighten out any discussion that is mis-informing people. We honestly have seen much of this but we can't comment of every little thing. If you are serious and the answer is important to you please contact us directly. Depending on what you guys ask we can certainly post the logic legitimately.

    Tech Support
    CamSoft Corp.
    (951) 674-8100
    [email protected]
    www.cnccontrols.com
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  13. #13
    Join Date
    Jun 2005
    Posts
    26
    Regarding you reference to G98 and G99 codes in the Default.cbk. I can't find them in my CNCLite. My system keeps crashing the Z axis into the upper limit on a G81 call. The Fanuc Pst is adding a G98 call to set the default height, but my system ignores it. Can anyone suggest how I can write a custom G98 code to remedy this?
    Any help would be greatly appreciated.
    Thanks

  14. #14
    Join Date
    Mar 2004
    Posts
    1543
    Quote Originally Posted by Tom Long View Post
    Regarding you reference to G98 and G99 codes in the Default.cbk. I can't find them in my CNCLite.
    There are three versions of Camsoft for CNC; lite, plus, and pro. I've only used pro; my limited understanding is that CNC lite doesn't have a Gcode.fil and you can't change G codes directly. I may be all wet here. Search through you CNC files to see if you can find Gcode.fil

    I bet Camsoft has a clever way to solve your issue if you can't edit your Gcodes.

    Karl

  15. #15
    Join Date
    Jun 2005
    Posts
    26
    Thanks for the quick reply. Regarding the Gcode.fil, CNCLite does have one and G98 is listed as a user customizable file, but no logic is included.
    I have been working with Camsoft Tech Support. They suggested contacting Mastercam for a custom G code. Problem is that my Mastercam is old and not on Maintenance, so Mastercam can't help me unless I bring Maintenance up to date. And that's defintely not in the budget.

    If I had any idea what the G98 should look like, I could add it. I'm just not software literate - ergo the plea for help. Do you know what the G98 and G99 codes should contain?

  16. #16
    Join Date
    Mar 2003
    Posts
    4826
    Tom,
    When I started off with CNCLite, I could not figure out any method of writing logic in the gcode.fil and have any guarantee about when it would execute. That is to say, I believe that there is certain logic built in to CNCLite that executes some sort of rudimentary, but hidden commands. So this begs the question, does the logic you add to the gcode file execute before or after the Camsoft logic (whatever it is?) I could be wrong, or things may have changed since back then. Also, using variables is a bit of a crapshoot when you don't know what ones are in use, and how they are used.

    So, that is why I went to CNC Professional, because then, what you see in your gcode file is what gets executed.

    Basically, G98 and G99 have to store an axis position for your G8x cycles. So there has to be a common variable used in your G8x macros, and in the G98, G99 to store and recall a particular position at a particular moment. The Z axis would normally be positioned at the rapid plane before calling the cycle. A clearance plane (R is the common standard definition) is defined as well, and the movement between the Rapid plane and the R plane is executed at rapid speed before the feed drilling motions begin.

    So for example you might have a Rapid plane of Z1.0" and a clearance plane of R.05, while the actual part surface begins at Z0.

    With G98, the cycle completes a hole, and the tool retracts to the Rapid plane.

    With G99, the cycle completes one hole but then the tool rises only to the R plane, followed by a movement to the next hole. So this saves a bit of extra motion and time.

    Standard type format for these cycles might look like this:
    G98 G81 Z-1. R0.05 F4.
    G99 G81 Z-1. R0.05 F4.

    Now in practice, when you use a G99, you might want to end the last hole by calling the drill cycle once more, with a G98, in order to get the drill back up to the Rapid plane. However, in most CAM systems, the tool motion can be programmed (in the post) to return the tool to the Rapid plane anyways, so this saves you the trouble of doing what I just stated.
    First you get good, then you get fast. Then grouchiness sets in.

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  17. #17
    Join Date
    Apr 2005
    Posts
    51

    Smile

    Mr Tom

    I don't know much about G98 but I study the Camsoft logic. I now have CNC Professional real version. Started with teaching package and Lite. With Lite I remember it does have GCODE.FIL file and also G98. You can add logic in here like CNC Professional to customize or make any G and M codes. Mr Hu is right to. The G and M codes are a fixed set like a Fanuc in Lite. But will still allow you to customize the G and M codes if you need to change them like you with G98. Mr Hu said G98 is just for saving a little time to were it retracts. I think so. But you say it moves to your upper limit. Mastercam write out Fanuc code like G98 G81 Z-.25 R.06

    In CNC Lite the R is the rapid clearance plain like Mr Hu said. This is already working in Lite. The tool will go to the Z position you write after R first and then rapid out to this after drilling hole. ? May be your R is too large so it moves to the upper limit.

    I know one trick for you. You can write in G98 the places you want to go. Very easy to learn. Use the lower case letters like r or z to set the positions you want to move to in G98. The logic in the GCODE.FIL file will run first before it does the drilling. You write like this.

    r=.1
    -----G98

    This will make the rapid plane set to .1 you can also do math here on the z or r moves to change to what you want. I learn because I study. You can do custom G code better in Professional version, but you can fix your problem to where it moves so it moves to upper limit no more.

    Carlo

  18. #18
    Join Date
    Apr 2005
    Posts
    51
    I find one more logic command you can use.

    I read you can use the ISTHERE command to tell if there is a G98 in the current G code line in the GCODE.FIL file above G98. This way you can use IF THEN to decide what to do.

    buona fortuna

    Carlo

  19. #19
    Join Date
    Mar 2004
    Posts
    1543
    Quote Originally Posted by Tom Long View Post
    If I had any idea what the G98 should look like, I could add it. I'm just not software literate - ergo the plea for help. Do you know what the G98 and G99 codes should contain?
    I'm no where near any of my machines, manuals, etc. IIRC, G98 and G99 are used as a modal command for drill cycles. They call out where the tool returns to at end of cycle; Z0 or R plane value.

    I'm almost certain the code in G98 and G99 just sets a variable to 0 or 1. Then in the drill cycle macro [[G81]] thru [[G86]] it looks at this variable to command the drill position at the end of the macro. At least for my pro version, Camsoft has included many default .cbk files. Not all of them included these Gcodes and macros, but some did. Did you know you can just use notepad to read a .cbk file? I'd open every file and search for G98 - I bet at least one .cbk has all this work already done for you.

    If you're still stuck, email me off list in about a week.

    Karl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •