Does KmotionCNC simulator support trajectory planner?


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

Thread: Does KmotionCNC simulator support trajectory planner?

  1. #1
    Registered
    Join Date
    Aug 2006
    Location
    USA
    Posts
    21
    Downloads
    0
    Uploads
    0

    Default Does KmotionCNC simulator support trajectory planner?

    Hi,
    Is it possible to see the result of what trajectroy planner does on KMotionCNC simulator?
    I'm trying to simutate 1x1 square corner roundings with 0.3 corner tolerance and 1deg facet angle.
    But corners still looks sharp. Or simulator can only show G code input?

    Another question(s) about KLP:

    - how the output paths differ with same KLP and different acceleratios? i.e for higher acceleration corner rounding is more (more error) or less?
    - if we feed Gcode with shorter lines (points) in theory it should be higher frequency and smoothing should be better and less error. Is that true?
    If so what can be the practical limits

    Our paths are highly nonlinear so has to be Gcoded as points. While speeds are on the high side (320inch/min, accelerat ~1g) so looking how is best to prepare code for kflop.
    Does KmotionCNC simulator support trajectory planner?-screen-png

    Similar Threads:


  2. #2
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2958
    Downloads
    0
    Uploads
    0

    Default Re: Does KmotionCNC simulator support trajectory planner?

    Hi funding33,

    Is it possible to see the result of what trajectroy planner does on KMotionCNC simulator?
    I'm trying to simutate 1x1 square corner roundings with 0.3 corner tolerance and 1deg facet angle.
    But corners still looks sharp. Or simulator can only show G code input?
    The Simulator doesn't perform Corner Rounding, Collinear Tolerance Filtering, or Trajectory Planning. It only shows the raw GCode input. You would need to run a dummy Job to see the result.



    - how the output paths differ with same KLP and different acceleratios? i.e for higher acceleration corner rounding is more (more error) or less?
    The KLP low pass trajectory filtering basically results in lag time. I think the position error will be roughly:

    Does KmotionCNC simulator support trajectory planner?-accel-png

    where t is the KLP time

    Here is an example with t=0.003 and a=30in/sec2 which computes s=0.000135 which is approximately the error shown in this actual data capture:







    if we feed Gcode with shorter lines (points) in theory it should be higher frequency and smoothing should be better and less error. Is that true?
    I'm not sure there is a simple answer. Corner rounding should provide similar smoothness without excessive GCode. If the GCode lines are too short they can become noisy due to round off errors. Note its important to create GCode with lots of precision ie 6 or more decimals if possible.



    If so what can be the practical limits
    KFLOP can receive and process ~2000 linear segments/sec at a sustained rate.

    HTH



  3. #3
    Registered
    Join Date
    May 2012
    Location
    canada
    Posts
    331
    Downloads
    0
    Uploads
    0

    Default Re: Does KmotionCNC simulator support trajectory planner?

    Quote Originally Posted by TomKerekes View Post
    The KLP low pass trajectory filtering basically results in lag time. I think the position error will be roughly:

    Does KmotionCNC simulator support trajectory planner?-accel-png

    where t is the KLP time

    Here is an example with t=0.003 and a=30in/sec2 which computes s=0.000135 which is approximately the error shown in this actual data capture:



    Tom,

    I have a sort of related question. So it looks like the code is ran through the trajectory planner, and then the low pass filter (time lag) is applied to the output after right? Would it be possible to have a low pass filter applied first and then ran through trajectory planner after?

    Ive had a few issues with poor performance surfacing, slowing way down because of tiny segments in the code that are sometimes unavoidable. I was thinking if a low pass filter were applied first it would eliminate much of these tiny segments or at least smooth them, and if this smoother path was then ran through the trajectory planner it should run much faster. Any thoughts on this?

    Mark



  4. #4
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2958
    Downloads
    0
    Uploads
    0

    Default Re: Does KmotionCNC simulator support trajectory planner?

    Hi Mark,

    I have a sort of related question. So it looks like the code is ran through the trajectory planner, and then the low pass filter (time lag) is applied to the output after right? Would it be possible to have a low pass filter applied first and then ran through trajectory planner after?

    Ive had a few issues with poor performance surfacing, slowing way down because of tiny segments in the code that are sometimes unavoidable. I was thinking if a low pass filter were applied first it would eliminate much of these tiny segments or at least smooth them, and if this smoother path was then ran through the trajectory planner it should run much faster. Any thoughts on this?
    Interesting idea. But I'm not quite sure how that would work. There is no concept of time until after things are planned.

    The Collinear Tolerance should eliminate the unnecessary tiny vectors.



    And then the corner rounding should provide smoothness. And give you to control over the amount of allowed error.

    Do you have an example of GCode that caused you problems? And your settings?



  5. #5
    Registered
    Join Date
    May 2012
    Location
    canada
    Posts
    331
    Downloads
    0
    Uploads
    0

    Default Re: Does KmotionCNC simulator support trajectory planner?

    Quote Originally Posted by TomKerekes View Post
    Hi Mark,

    Interesting idea. But I'm not quite sure how that would work. There is no concept of time until after things are planned.
    Could it be planned, filtered then re-planned? Send it through twice? I guess you would want to ignore acceleration the first time, just use feed rate and the low pass filter to calculate a smoother path, then run this smoother path through the trajectory planner again to figured out accelerations etc. I have no idea if any of this is possible for you or not, but I bet it would work really well.

    Seems like the industrial controllers work this way. They definitely round things a lot more at faster feed rates. Which is exactly what the KLP filter does, but the industrial controllers seem to round things off the same way and then use this smoother path to go faster. And in our case we are calculating a smoother path, but still using the painfully slow acceleration from the original path.

    May not be easy for you to add, but if you could somehow add this in a future release it should make a world of difference to anybody doing alot of 3d surfacing or mold work.



  6. #6
    Registered
    Join Date
    May 2012
    Location
    canada
    Posts
    331
    Downloads
    0
    Uploads
    0

    Default Re: Does KmotionCNC simulator support trajectory planner?

    I found an old part that was giving me grief last year. See attached test.txt for g code, and attached trajectory planner settings. The tool path is terrible I know, but i feel like it would run much better it were handled like i mentioned above. Even the old 90's fanuc I used to run at my last job would likely do much better because it simply ignores a lot of the small stuff. That old fanuc would sometimes come up 0.050 or 0.060 thou short or even more on surfaces when you program fairly fast, another sign of smoothing. We would always have to extend surfaces past the part to get it to cut properly. We had a newer Mazak and you could tell it was still smoothing things a little at higher speeds, but much less then the fanuc, it was far more accurate.

    This toolpath in this test starts off decent with nice round transitions between each line but after an inch or so the transitions from line to line get messed up and my machine slows way down trying to follow every detail. A little bit of smoothing before calculating acceleration would go a long ways in this case i think.

    Attached Thumbnails Attached Thumbnails Does KmotionCNC simulator support trajectory planner?-test-jpg  
    Attached Files Attached Files


  7. #7
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2958
    Downloads
    0
    Uploads
    0

    Default Re: Does KmotionCNC simulator support trajectory planner?

    Hi mmurray70,

    That GCode is very nasty. But allowing more segments to be combined and more rounding smooths it significantly. I took a section of ~ 700 lines of the code and run time decreased from 43.2sec to 36.2sec with an allowed tolerance of 0.006 inches. I used:

    Does KmotionCNC simulator support trajectory planner?-tpsettings-jpg

    See Plots with various settings





  8. #8
    Registered
    Join Date
    May 2012
    Location
    canada
    Posts
    331
    Downloads
    0
    Uploads
    0

    Default Re: Does KmotionCNC simulator support trajectory planner?

    Quote Originally Posted by TomKerekes View Post
    Hi mmurray70,

    That GCode is very nasty. But allowing more segments to be combined and more rounding smooths it significantly. I took a section of ~ 700 lines of the code and run time decreased from 43.2sec to 36.2sec with an allowed tolerance of 0.006 inches. I used:

    Does KmotionCNC simulator support trajectory planner?-tpsettings-jpg

    See Plots with various settings

    Yeah that certainly makes a difference. Looks like the whole tool path is getting shifted around though (especially in the Z) which would result in a fairly messed up surface with a tolerance of 0.006.

    Having it smooth based on time like the KLP filter would have two huge advantages. Number one would be it only causes an error in corners or curves and very quickly moves to the exact path when moving straight. Since all these transitions are made off the part slightly, the part would still be cut almost exactly to original size. And number two, if there was some feature you wanted to be sure was cut very accurately you can just program that feature a little slower.



  9. #9
    Registered
    Join Date
    May 2012
    Location
    canada
    Posts
    331
    Downloads
    0
    Uploads
    0

    Default Re: Does KmotionCNC simulator support trajectory planner?

    So Tom have you given this any more thought? Would it be possible to do something like this someday or is it way to complex? Have it process the path twice maybe? Would be awesome if there was a way to add a low pass filter directly into the trajectory planner in kmotioncnc.

    Heres a pic of that path and also showing the part. As you can see if a LPF were used all the smoothing would be done off the part and while actually cutting the part it would be following the original path almost identical. Most cnc operations would work really well with a low pass filter too. Cutting larger arcs would not show much error, straight sections would be machined perfectly, outside corners would be very good. Only place you would really notice it would be inside corners and very small arcs/helixs. So it should run much faster and smoother without showing much error in most situations.

    Attached Thumbnails Attached Thumbnails Does KmotionCNC simulator support trajectory planner?-gcode-jpg  


  10. #10
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2958
    Downloads
    0
    Uploads
    0

    Default Re: Does KmotionCNC simulator support trajectory planner?

    Hi mmurray70,

    I was testing a few ideas. But I don't see how any algorithm could know what is important to you and what is not. How would it know the Z movements are not important.

    Actually KMotionCNC V4.34 has a form of GCode "smoothing" but for a somewhat different purpose. We used it for creating smooth 6 axis robotic motions given specified positions (poses). See the example below spooning sugar (start at 2 minutes)



    To generate the motion a several poses were entered as GCode Positions. If the raw GCode was executed the motion would be piecewise linear and very jerky and awkward. To smooth motion select the GCode in the GCode Editor, right click - Transform, and set the 6-axis smoothing value to a value > 1. The path is then recursively smoothed N times. Each pass subdivides each line into 2 lines then smooths all points with a 3 point filter.

    current smoothed point = (previous point + 2 * current point + next point) / 4

    Below is a simple path smoothed 0, 1, 2, and 3 times

    Does KmotionCNC simulator support trajectory planner?-s0-png
    Does KmotionCNC simulator support trajectory planner?-s1-png
    Does KmotionCNC simulator support trajectory planner?-s2-png
    Does KmotionCNC simulator support trajectory planner?-s3-png

    This isn't ideal for your situation as it assumes the original GCode has similar segment lengths. Note the selected GCode to smooth must be a continuous path of G1 commands.

    I modified the algorithm to first divide each segment into somewhat equal lengths that you can specify. Each original segment is subdivided into N segments where N is the smallest integer that makes the segment lengths less than the value specified. In your example data with 747 segments, specifying a value of 0.0003 inches creates 50,951 segments.

    I then tried various filters.

    #1 run length averaging.
    #2 original recursive 3 point passes (described above resulting in something similar to Gaussian Filter)
    #3 IIR type Low pass filter

    After smoothing the segments are recombined into a more reasonable number of segments using a specified collinear tolerance. With your data the and a collinear tolerance of 0.0003 the number of segments reduced from 50,951 to 471 segments (less than original).

    Does KmotionCNC simulator support trajectory planner?-newtransform-png

    I could post the program if you would like to play with it.

    Below are some results for different Tau lengths for the IIR Low Pass Filter





  11. #11
    Registered
    Join Date
    May 2012
    Location
    canada
    Posts
    331
    Downloads
    0
    Uploads
    0

    Default Re: Does KmotionCNC simulator support trajectory planner?

    Hi Tom,

    This is awesome! The last video you show is smoothing the code much more like what i was thinking, the middle sections of code look much closer to original. Even the smallest amount, 0.02 was a huge difference and would probably be fine. So in the video was this only the #3 IIR type Low pass filter or were 1 and 2 used as well? Im not sure exactly what you mean by #1 run length averaging, can you explain this more?

    Also I see the units of Tau are in inches and not seconds? So does this mean the same amount of smoothing would be done at all feedrates? It would be very nice to have it smooth based on time somehow if its at all possible. All the industrial machines smooth way more at high speeds for sure. Its common to slow down for finishing critical features knowing the machine rounds corners and lags behind more at high speeds. Could different Tau lengths be used based on programmed feedrate somehow? Maybe specify a maximum value and have it proportional to programmed feedrate? Or would the same Tau value need to be used throughout?

    I had no idea about the transform feature being already there. When I try it I dont get all these options, I guess this is what you mean about posting the program. Yes by all means post it and ill play around with it. Thanks

    Mark



  12. #12
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2958
    Downloads
    0
    Uploads
    0

    Default Re: Does KmotionCNC simulator support trajectory planner?

    Hi Mark,

    This is awesome! The last video you show is smoothing the code much more like what i was thinking, the middle sections of code look much closer to original. Even the smallest amount, 0.02 was a huge difference and would probably be fine.
    Well I would think 0.02 inches would be significant errors.

    So in the video was this only the #3 IIR type Low pass filter or were 1 and 2 used as well?
    Yes only the IIR Filter was applied (besides subsampling and recombination)

    Im not sure exactly what you mean by #1 run length averaging, can you explain this more?
    This is where each point is the simple average of itself and N points before and N points after. A rectangular convolution filter. This is fast to calculate as the next point can be computed with just two operations even if many points are involved. A possible advantage is that it is symmetrical and points some distance away will have no influence at all.

    Also I see the units of Tau are in inches and not seconds? So does this mean the same amount of smoothing would be done at all feedrates? It would be very nice to have it smooth based on time somehow if its at all possible. All the industrial machines smooth way more at high speeds for sure. Its common to slow down for finishing critical features knowing the machine rounds corners and lags behind more at high speeds. Could different Tau lengths be used based on programmed feedrate somehow? Maybe specify a maximum value and have it proportional to programmed feedrate? Or would the same Tau value need to be used throughout?
    Yes I was thinking to control the amount of error would be most desirable and intuitive for the Operator. I was also thinking a constant feedrate for the entire path, so assuming ideal feedrates with no trajectory planning, distance and time are proportional. But I now see your point. I find this all very ironic on how we work so hard to assure the machine follows the exact path specified in a fully optimized manner with exactly controlled errors, but now you are sort of saying errors can be uncontrolled like machines with poor trajectory planning work.

    I had no idea about the transform feature being already there. When I try it I dont get all these options, I guess this is what you mean about posting the program. Yes by all means post it and ill play around with it.
    Yes. The two release binaries to copy to KMotion434\\KMotion434\Release to get the new Transform Screen are located here:
    Index of /Software/Patch/AddNewSmoothTransform_V434

    Also the changed source files if you are interested and the piece of your test pattern I've been using in the videos.



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

Does KmotionCNC simulator support trajectory planner?

Does KmotionCNC simulator support trajectory planner?