Strange KmotionCNC behavior


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

Thread: Strange KmotionCNC behavior

  1. #1
    Member
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1723
    Downloads
    0
    Uploads
    0

    Cool Strange KmotionCNC behavior

    TK,

    I had a simple job was was to use a 90 degree vcarve bit to taper the top of some drill holes so taper screws would sit flush. It took only a few minutes to draw up the drawing and the g-code created was very short since it used canned cycles.

    I first positioned the MDF to cut and set my G54 location for X,Y at the corner of the material. Then I set the Z to the top of the material and normally that would be all I need to do except raise the Z up and press cycle start.

    Well I was so confident this would run perfect that I did not have my handle next to the estop button. Big mistake. The big plowed right through 1" MDF ruining the pieces. Ugh.

    I got another piece of material and just assumed I forgot to zero the Z on the top of the material. Well I did it again and zero'd it on the top of the material moved it up but this time set the feedrate to very slow. When I pressed cycle start I noticed the Z dro have something like 3.25 and it was only .5" above the material. I pressed halt then pressed rewind, then zero'd the Z axis again on top of the material and moved it up an inch and told it to run. This time it worked correctly and only went down -.215". I have studied this code and for the life of my can not figure out what I did wrong. The code is listed below and came right out of CAM program at work. I had it output generic FANUC three axis code since that has worked in the past for my simple three axis machine with the Kflop. Any idea of what caused this issue? I had a friend of mine who has a larger machine with a KFLOP test the same code and it did the same thing on his machine.

    Thanks for taking a quick look.



    %
    O0000(CNC-SUPPORT-COLUMN-3)
    ( T2 | 1/4 INCH ENGRAVING TOOL 90 DEGREE X .001 TIP LONG | H2 )
    N100 G20
    N102 G0 G17 G40 G49 G80 G90
    N104 T2 M6
    N106 G0 G90 G54 X.5 Y1. S6000 M3
    N108 G43 H2 Z.1
    N110 G99 G81 Z-.215 R.1 F5.
    N112 Y6.2813
    N114 Y11.5625
    N116 Y16.8438
    N118 Y22.125
    N120 Y27.4063
    N122 Y32.6875
    N124 Y37.9688
    N126 Y43.25
    N128 X3.825
    N130 Y37.9688
    N132 Y32.6875
    N134 Y27.4063
    N136 Y22.125
    N138 Y16.8438
    N140 Y11.5625
    N142 Y6.2813
    N144 Y1.
    N146 G80
    N148 M5
    N150 G91 G28 Z0.
    N152 G28 X0. Y0.
    N154 M30
    %

    Similar Threads:


  2. #2
    Community Moderator Jim Dawson's Avatar
    Join Date
    Dec 2013
    Posts
    5717
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    Just a guess is line N108. You could have a tool height offset in there for H2. It would add that offset to the zero height.



  3. #3
    Member
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1723
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    Jim
    You might be right I forgot to look at the tool table. Thanks for the idea, will let you know what I find



  4. #4
    Member
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1723
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    Jim,

    The issue has nothing to do with offsets in the tool table, I check there are no offsets on T1 to T4 the only thing populated is the tool size like 1/4" endmill, etc.

    He is used with the G43 tool offset command. Right before it gets into the canned drilling cycle.

    Russ



  5. #5
    Community Moderator Jim Dawson's Avatar
    Join Date
    Dec 2013
    Posts
    5717
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    G43 is tool height offset, is it possible that something is ''stuck'' in the program/controller somewhere?



  6. #6
    Member
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1723
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    My understanding this is used with drill cycles to take into the shape of a drill being pointed so it must go a little deeper to get to the drill diameter.

    Since this does the same thing on two machines so unlikely it is something stuck.

    Russ



  7. #7
    Community Moderator Jim Dawson's Avatar
    Join Date
    Dec 2013
    Posts
    5717
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    In that case, I have no idea. The code looks fine.



  8. #8
    Member
    Join Date
    May 2012
    Location
    canada
    Posts
    537
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    Are you sure you were using G54 when you set the height? Could you have been using another offset in a previous program? I agree its most likely line 106 or 108 when the offsets are applied.

    One issue i see with your program is at the end when it switches to G91 to home, its a good idea to switch back to G90 for safety sake otherwise the machine is left in incremental mode after running a program. Im not sure if setting up a job in incremental mode could cause some kinda strange problem, unlikely but could be possible.

    Never start a program with the tool close to the work. Always start from above and hit feedhold when tool gets close to work, estimate gap between tool and work and verify this with the Z position in KmotionCNC. To be safe you really need to do this at the start of every tool in a new program or new setup. Also it would be nice to check distance to go but this feature seems to be missing. Keep that one in mind for the future Tom, Thanks.



  9. #9
    Member
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1723
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    mmurray70,

    I only ran two programs, the first program used drill cycles with peck drilling to drill the holes. I kept that in a separate file since my machine does not have a tool changer. That program also did something strange like this as well. When I positioned the material in the machine and press zero for X,Y and then moved the spindle down to touch the top of the material and zero the DRO. At that point G54 is established in X,Y, and Z. I noticed that when the program told the machine to go the the first hole in this program it uses a G54 command to get there and that works perfect.

    N106 G0 G90 G54 X.5 Y1. S6000 M3

    The next two lines seem to be the issue at hand.

    N108 G43 H2 Z.1
    N110 G99 G81 Z-.215 R.1 F5.

    G43 Hn (Tool #n length comp On) reading on the internet this code is often used with drill cycles to compensate for the shape of a drill. The are sharp and pointy and you need to go deeper to get the hole to diameter.

    G99 is R Point returned used in drilling cycles to let it know how high to come up in a drilling cycle. The Dynomotion sites does not list this for KmotionCNC, maybe that is the issue?

    G81 is the canned drilling cycle, again KmotionCNC does not list this gcode on their website, but it does work once get set Z three times, so not sure if the website is just out of date.

    G81 X_ Y_ Z_ R_ L_ F_
    X,Y position of hole in XY plane
    Z end point of hole
    R retract plane
    L number of repetitions
    F feedrate

    Not sure if this is a KmotionCNC bug the code runs correctly in Mach4.



  10. #10
    Member
    Join Date
    Aug 2005
    Location
    United States
    Posts
    158
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    Quote Originally Posted by CNCMAN172 View Post
    G81 is the canned drilling cycle, again KmotionCNC does not list this gcode on their website, but it does work once get set Z three times, so not sure if the website is just out of date.
    Not sure if this helps or not ... 11.2 G81 Cycle ... but at least it is on the Dynomotion web site.



  11. #11
    Member
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1723
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    arvidj,
    Thanks for that link, seems like they have a link to the EMC website that details gcode. The page on Dynomotion website where I was looking is listed below.

    G Code Screen

    I found the link you provided they do explain their code is based on the open source EMC gcode interpreter like most companies so that makes sense. Thanks


    KMotion's G Code interpreter was derived from the Open Source EMC G Code Interpreter. Click here for the EMC User Manual (Only the G Code portions of the manual, Chapters 10-14 pertain to KMotion G Code)

    Russ



  12. #12
    Member
    Join Date
    May 2012
    Location
    canada
    Posts
    537
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    Quote Originally Posted by CNCMAN172 View Post
    mmurray70,

    I only ran two programs, the first program used drill cycles with peck drilling to drill the holes. I kept that in a separate file since my machine does not have a tool changer. That program also did something strange like this as well. When I positioned the material in the machine and press zero for X,Y and then moved the spindle down to touch the top of the material and zero the DRO. At that point G54 is established in X,Y, and Z. I noticed that when the program told the machine to go the the first hole in this program it uses a G54 command to get there and that works perfect.

    So what exactly was the problem? You mention it doing something strange and then towards the end of you post you say it works perfect?


    N106 G0 G90 G54 X.5 Y1. S6000 M3

    The next two lines seem to be the issue at hand.

    N108 G43 H2 Z.1
    N110 G99 G81 Z-.215 R.1 F5.

    G43 Hn (Tool #n length comp On) reading on the internet this code is often used with drill cycles to compensate for the shape of a drill. The are sharp and pointy and you need to go deeper to get the hole to diameter.
    G43 is used to compensate for different length tools used in the same program. Not to be confused with drill tip compensation as you mentioned above, that is commonly found in CAM software. Various tool lengths are stored in the tool table (There is a C program that you can setup as a user button to set these values) and at the start of a program or after a toolchange the proper offset is applied in the controller so it cuts at the right depth for that tool.

    For what you are doing right now, with no toolchanger, and not even manual toolchanges, you could try just deleting this line as you dont need really need it. It would be useful in the future if you start doing manual toolchanges.

    You mentioned there are no tool lengths populated in the tool table, im not sure if that could cause an issue maybe? Your trying to apply an offset in g code that isnt even there. Maybe try a very small value like 0.0001 for length in your tool table.

    Also one more thing comes to mind, make sure you have the right tool selected when you setup your job. For example if tool1 is selected in kmotioncnc on startup, and you zero out z and run the program which calls tool2 its going to be different. Maybe not actually in your case since your not using different tool offsets, but this is still a good practice.

    G99 is R Point returned used in drilling cycles to let it know how high to come up in a drilling cycle. The Dynomotion sites does not list this for KmotionCNC, maybe that is the issue?

    G81 is the canned drilling cycle, again KmotionCNC does not list this gcode on their website, but it does work once get set Z three times, so not sure if the website is just out of date.

    G81 X_ Y_ Z_ R_ L_ F_
    X,Y position of hole in XY plane
    Z end point of hole
    R retract plane
    L number of repetitions
    F feedrate

    Not sure if this is a KmotionCNC bug the code runs correctly in Mach4.
    G99 or G98 are used to specify what Z height the machine moves to when moving between holes in a canned cycle. G99 will move to the R plane between holes and G98 will move to the "initial" plane. For example with the following code:

    N090 G0 X0. Y0.
    N100 Z2.
    N110 G99 G81 Z-.215 R.1 F5.
    N120 X2.0
    N130 X4.0
    N140 G80

    With G99 the tool would move to a height of 0.1 between holes, with G98 instead of G99 the tool would move to the initial plane (current position when canned cycle is called) which is 2.0 in this case and move between holes then rapid to 0.1 and then drill hole and repeat. G98 will be safer around clamps if you set it up properly.

    There were some changes in the way G99 and G98 and G83 peck drill cycles are handled in the most recent version of kmotion. It works now the way a standard fanuc style controller would. But I dont think there are any changes that could explain your crash. G81 also works fine with kmotion, theres no reason to go back to mach 4. Theres some minor thing you are missing and when you figure it out you will be much happier overall with kmotioncnc.



  13. #13
    Member
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1723
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    mmurray70,

    Let me explain what happened since I might have rushed this at the beginning of the post. I had two different programs, which are very simple. The first program would go down a drill 18 holes and it used peck drilling cycle. That program also exhibited the same issues so the Tool Length offset issues does appear to be the common issue. Now back to what happened. When loaded the material to the table and secured it, then I jogged the spindle with a sharp bit over to find the relative X,Y of the job and then zero'd the DROs for X and Y. Now I have the G54 location for X and Y. Next I lowered the Z axis down to the top of the material and then zero'd the Z axis DRO. Now G54 is full established, I have X,Y, and Z defined for G54.

    Now I jog the Z axis up to maybe three inches above the material and press cycle start. The spindle starts and moves to the G54 XY position and then indexes over to the first hole all of that works perfect. Then Z starts coming down but I failed to reduce the feedrate so it plows right though a 1" thick piece of MDF before I could hit the estop.

    Now I have been running the CNC machines for over 15 years so I am by no means a newbee. The first though was damn you dumb ass you forgot to zero the Z axis before you started. Wrong.

    Next I load a new piece of material on the machine and re-establish the G54 location exactly as before. Then I jog Z axis up three inches above the material but this time I set the feedrate to a very slow speed. Then I press cycle start and have my finger on the feedhold button. The machine again moves to the correct G54 XY position and then indexes to the first hole so everything looks perfect. Then Z starts coming down and I notice the Z axis DRO has a reading like 3.25" and the bit is only 1/2" above the table. I realize this will crash right into the table again if I proceed. I press the halt button, rewind the gcode, then reset the Z axis to the top of the material, zero the Z axis DRO again, then job up a couple inches and press cycle start again. This time it start coming down slowly and I watch the DRO which looks correct, so it comes down and starts the drill cycle with the V carving bit which just creates the same profile as the top of a screw so it will be flush when the screw is inserted in the hole during assembly. The entire program runs all the way through and works correctly.

    Now the question is how come I had to zero the Z DRO repeatedly to get this to work correctly. I am certain you are correct that the tool offset that the CAM added must have pulled a number from somewhere to add to the Z axis DRO. I look at the tool table and the only offsets I can see in the tool table for KmotionCNC seem to be for X and Y, nothing for tool length that I could find. But I am sure if I kill that line as you suggested this will work perfect without any issues.

    Russ



    Tool Length Offsets
    Tool length offsets are given as positive numbers in the tool table. A tool length offset is programmed using G43 Hn, where n is the desired table index. It is expected that all entries in the tool table will be positive. The H number is checked for being a non-negative integer when it is read. The interpreter behaves as follows.
    1. If G43 Hn is programmed, A USE_TOOL_LENGTH_OFFSET(length) function call is made (where length is the value of the tool length offset entry in the tool table whose index is n), tool_length_offset is reset in the machine settings model, and the value of current_z in the model is adjusted. Note that n does not have to be the same as the slot number of the tool currently in the spindle.



  14. #14
    Member
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1723
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    Mmurray70,

    Not sure how I overlooked this unless my J version did not have tool length. This video shows I guy putting in tool length offsets automatically in Kmotioncnc. I will need to double check mine, but my guess is since mine was not populated that kmotioncnc used some unknown value for the offset, that seems to be the most logical issue.



    Russ



  15. #15
    Member
    Join Date
    May 2012
    Location
    canada
    Posts
    537
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    Im betting that you didnt select tool 2 in kmotioncnc prior to your setup. You ran the program, it switched tools in the program and was then off. You halted, tool 2 is now still selected from running the program, you rezero, this time with the right tool and you re run it and its fine. Is this possible?



  16. #16
    Member
    Join Date
    May 2012
    Location
    canada
    Posts
    537
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    Quote Originally Posted by CNCMAN172 View Post
    Mmurray70,

    Not sure how I overlooked this unless my J version did not have tool length. This video shows I guy putting in tool length offsets automatically in Kmotioncnc. I will need to double check mine, but my guess is since mine was not populated that kmotioncnc used some unknown value for the offset, that seems to be the most logical issue.



    Russ
    The tool length offset is the third column in the table in the video. Try adding a tiny number and see if it helps, cant hurt. If you want to start using offsets properly i attached the modified, simpler tooltableset program i use. You need to rename to .c instead of txt and configure as a user button. I added a shortcut key to mine and use the "insert" button on the keyboard.

    To use this program simply load tool, move to some common height point that you will touch all tools. This could be top of machine table, top of a gage or 123 block, top of a dial height setter (this is what i use, see pic for my homemade one) or anything really, As long as all tools are touched off the same thing. Then just run this c program and it will store length. Then as long as a tool is measured you can use it to set zeros the same as your normally would. You can reset your G54 with a single tool and all other tools move with it.

    You need to be extra careful with manual toolchanges that the toolnumber in kmotioncnc matches the actual tool.

    Attached Thumbnails Attached Thumbnails Strange KmotionCNC behavior-20170207_122442-jpg  
    Attached Files Attached Files


  17. #17
    Member
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1723
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    mmurray70,

    To be honest, I normally do not use the tool table. I run Mach3, Mach4, and KmotionCNC. This is probably a poor habit on my part, since I did not populate the tool table before I ran these jobs. I looked in the tool table and found no length or xy offsets populated. I had a 1/8" EM populated in T1 and a 1/4" EM populated in T2, nothing else. In these two programs I ran a drill bit and then a vcarving bit.

    When I first started the machine I ran the drilling program and saw this same behavior but caught it before any damaged occurred and resolved it the same way by setting the Z dro repeatedly to the top of the material. My guess is kmotioncnc is adding something to tool length offset if nothing is populated in the tool table, but that is just a guess, this could be a bug. I would think if no length value is in the table it would assume zero. TK might have a comment.

    Russ



    %
    O0000(CNC-SUPPORT-COLUMN-3)
    ( T2 | 1/4 INCH ENGRAVING TOOL 90 DEGREE X .001 TIP LONG | H2 )
    N100 G20 ( inch system )
    N102 G0 G17 G40 G49 G80 G90 ( Rapid positioning ON, XY Plane Selection, Cancel cutter diameter compensation, Cancel Tool length offset, cancel motion mode, Absolute)
    N104 T2 M6 ( Tool#2, tool change)
    N106 G0 G90 G54 X.5 Y1. S6000 M3 ( Rapid, Absolute distance, Work Present 1, XY position (.5,1), Spindle 6000, Spindle CW)
    N108 G43 H2 Z.1 ( tool length offset, H2 is not populated in tool table)
    N110 G99 G81 Z-.215 R.1 F5. ( R value return canned cycles, drilling canned cycle, Z depth = -.215", return to .1", Feedrate 5 )
    N112 Y6.2813



  18. #18
    Member
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1723
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    Thank you for the tooltableset file, I have a similar tool length gauge I got about a month ago but have not even used it yet. I will run some experiments, I think you might be correct, adding a tiny value in the tool length might fix the issue, not sure.

    Russ



  19. #19
    Member
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1723
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    mmurray70,

    Well I am feeling pretty stupid at this point. I went out to the check the version of Kmotion I was running which is older version 4.33C, and looked at the tool table again. Lo and behold when I populated it for a job long ago, I put the tool numbers in the wrong column. I had a tool length of 3 in the second tool position, which totally explains what happened. I need to get a new computer so I can run windows7 and the newer version of kmotioncnc with the screen editor and get current again. Thanks for the help.

    Russ



  20. #20
    Member
    Join Date
    May 2012
    Location
    canada
    Posts
    537
    Downloads
    0
    Uploads
    0

    Default Re: Strange KmotionCNC behavior

    Thats great, at least you found the problem. I had a feeling it was something minor and you would eventually find it. No need to feel stupid, we have all been there with a simple thing like that you just cant seem to figure out. At least you learned a little about offsets in the process

    This confirms what i said in post 15, you setup the job with tool1 probably, ran it and when the controller switched to tool 2 the height changed, then you retouched, this time with the proper tool offset loaded (since the program changed it for you when you ran it) and everything was fine.



Page 1 of 2 12 LastLast

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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Strange KmotionCNC behavior

Strange KmotionCNC behavior