How to export a 3d path as GCode


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

Thread: How to export a 3d path as GCode

  1. #1
    Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    150
    Downloads
    0
    Uploads
    0

    Default How to export a 3d path as GCode

    I have made a 3D path on a 3D object in CAD. The path is the winding pattern for filament winding similar to

    Now this is additive kind of manufacturing like a 3d printer but unlike machining.
    I have no clue how to convert this path to 3D motions for seperate axis by generating a g code.

    What tools do I use to generate the g code. Are there any 3D path to gcode converters?

    TIA

    Similar Threads:


  2. #2
    Member awerby's Avatar
    Join Date
    Apr 2004
    Posts
    5731
    Downloads
    0
    Uploads
    0

    Default Re: How to export a 3d path as GCode

    I'm not sure that thinking of this as a "3D path" is helpful. As I understand it, the mandrel that the filament winds onto rotates at a constant rate, so all you need to do is move the head that dispenses the filament back and forth horizontally, twisting it a little at each end.. You would do that by writing a simple Gcode program that specifies the speed of movement and the limits of travel.for that axis (call it "X"). The twisting move at the ends of travel would be done by Y, set up as a rotary axis denominated in degrees. So the code would look like this:

    G01 X20 (assuming the mandrel is 20 inches long) F30 (move the head at 30 ipm)
    Y45 (assuming it needs to rotate 45 degrees)
    X0
    Y0
    X20
    Y45
    X0
    Y0
    etc.unitl the reel is full, which might trigger a sensor that stops motion

    [FONT=Verdana]Andrew Werby[/FONT]
    [URL="http://www.computersculpture.com/"]Website[/URL]


  3. #3
    Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    150
    Downloads
    0
    Uploads
    0

    Default Re: How to export a 3d path as GCode

    Thanks for you explanation and the G-Code for cylindrical mandrels this would suffice. However if you go 3 to 4 minutes into the video it will show you winding a cylinder with dome ends. This needs more complex motions like the spindle will slow down while the delivery head rotates and untwists the filaments on its way back.
    Although I can manually write g code for simple windings as you illustrated . I'm loooking at a longterm pipeline where I just extract the 3d points from CAD and then convert it to G Code.
    Alternatively are there any existing solutions like SolidCAM / Mastercam that can generated G Code directly from path information.



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

    Default Re: How to export a 3d path as GCode

    I think this is more complex than just winding a filament on a form. Each pass moves over the width of the filament, I guess this might equate to stepover in a normal machining environment. And it looks like there are a number of other moves that seem to be unique to the application. I'm still thinking that this is going to require some special software to generate the proper motion, but maybe I'm over complicating the it. I could see entering the parameters for the desired wind, then the software would generate the needed motion commands to make it happen. This could be output as G code, or as machine readable code.

    A couple of fun facts: The G code that we read and write can not be read directly by a motion controller, it is internally translated into something the processor can digest. If you tell a motion controller to move an axis 10 mm, its response would be ''Huh?'' It has no idea what 10mm is. But if you told it to move an axis 10000 encoder pulses (in a properly formatted command string) it would happily do so.

    Jim Dawson
    Sandy, Oregon, USA


  5. #5
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: How to export a 3d path as GCode

    hello zzzzzzzero even if those filaments are on a 3d shape, in machining tems that is not a real 3d toolpath, because it is kind of repetitive, etc

    for example both a teapot and a cube are 3d objects, but the teapot is more complex; if you break each object into triangles, than the cube will have all triangles into only 6 planes, while the teapot will have the triangles in more planes

    also, the cube may reflect the light all over one side, while the teapot will reflect it only in a certain spot, or among a 3d curve

    a 3d toolpath is a long row of 3d segments : each segment has dx dy & dz projection; if you create a chart with dx or dy or dz and that chart looks predective ( or repetitive ), or suitable for regression / interpolation, than that toolpath is not a 3d toolpath from a machinist perspective

    a sphere may be a real 3d_toolpath, or not, depending on the way you program it a sphere is at the limit between complex and normal 3d shape, or, if you wish, it is at the limit between geometrical 3Ds and organic 3Ds



    about 3d path to g-code :
    ... try fingering that cam
    ... output as dwg and google search for dwg to g-code converter ?


    for that video that you shared, you don't need to master 3d toolpaths ( you are very close to threading on a cnc lathe ), but this does not mean that you should not master 3d toolpaths ... kindly

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  6. #6
    Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    150
    Downloads
    0
    Uploads
    0

    Default Re: How to export a 3d path as GCode

    Quote Originally Posted by deadlykitten View Post

    about 3d path to g-code :
    ... try fingering that cam
    ... output as dwg and google search for dwg to g-code converter ?


    for that video that you shared, you don't need to master 3d toolpaths ( you are very close to threading on a cnc lathe ), but this does not mean that you should not master 3d toolpaths ... kindly
    So I need to do that in a cam software? Any preferences?
    BTW this is a sample gcode generated by the Xwinder software. This is for a cylinder for dome shaped ends.


    [BEGIN 4-AXIS WINDING WITH HEMI ENDS --------------------------------------------------- ]
    D0 ST=Winding Schedule
    M0 [Wait for Button Press to Begin Winding Schedule]
    M601 [MARK THE MANDREL REFERFENCE ANGLE]

    [START LAYER #1 ----------------------------------------------]
    [Layer 1: Group 1/3 : Pass 1/10]
    D0 LA=1_of_2 PA=1_of_30 RPM=6.98 CS=2.00 WA=20.08 WM=4AX TI=0 LD=2 FW=0.2 HL= [Display Layer Properties]
    G1 F2.00 Z25.75 S6.98 C319.71 A397.95 [MOVE LEFT END]
    G2 K40.00 F0.22 Z27.75 E0.63 Y1.00 R0.59 B53.13 U0.75 V2.00 H25.75 W1.00 S3.00 C115.00 A512.95 [CW ELLIPSE AT LEFT END]
    G5 K2.00 F0.57 Z25.75 E0.21 Y1.75 R7.03 B-69.92 U0.75 V2.00 H25.75 W1.00 S2.00 C45.00 A557.95 [DH G5 WITHDRAWL LEFT END]
    G1 F2.00 Z6.75 S6.98 C397.95 A955.89 [MOVE RIGHT END]
    G3 K40.00 F0.22 Z4.75 E0.63 Y1.00 R0.59 B-53.13 U0.75 V2.00 H6.75 W1.00 S3.00 C115.00 A1070.89 [CCW ELLIPSE AT RIGHT END]
    G6 K2.00 F0.57 Z6.75 E0.21 Y1.75 R7.03 B69.92 U0.75 V2.00 H6.75 W1.00 S2.00 C45.00 A1115.89 [DH G6 WITHDRAWL RIGHT END]

    [Layer 1: Group 1/3 : Pass 2/10]
    D0 LA=1_of_2 PA=2_of_30 RPM=6.98 CS=2.00 WA=20.08 WM=4AX TI=0 LD=2 FW=0.2 HL= [Display Layer Properties]
    G1 F2.00 Z25.75 S6.98 C397.95 A1513.84 [MOVE LEFT END]
    G2 K40.00 F0.22 Z27.75 E0.63 Y1.00 R0.59 B53.13 U0.75 V2.00 H25.75 W1.00 S3.00 C115.00 A1628.84 [CW ELLIPSE AT LEFT END]
    G5 K2.00 F0.57 Z25.75 E0.21 Y1.75 R7.03 B-69.92 U0.75 V2.00 H25.75 W1.00 S2.00 C45.00 A1673.84 [DH G5 WITHDRAWL LEFT END]
    G1 F2.00 Z6.75 S6.98 C397.95 A2071.79 [MOVE RIGHT END]
    G3 K40.00 F0.22 Z4.75 E0.63 Y1.00 R0.59 B-53.13 U0.75 V2.00 H6.75 W1.00 S3.00 C115.00 A2186.79 [CCW ELLIPSE AT RIGHT END]
    G6 K2.00 F0.57 Z6.75 E0.21 Y1.75 R7.03 B69.92 U0.75 V2.00 H6.75 W1.00 S2.00 C45.00 A2231.79 [DH G6 WITHDRAWL RIGHT END]

    [Layer 1: Group 1/3 : Pass 3/10]
    D0 LA=1_of_2 PA=3_of_30 RPM=6.98 CS=2.00 WA=20.08 WM=4AX TI=0 LD=2 FW=0.2 HL= [Display Layer Properties]
    G1 F2.00 Z25.75 S6.98 C397.95 A2629.74 [MOVE LEFT END]
    G2 K40.00 F0.22 Z27.75 E0.63 Y1.00 R0.59 B53.13 U0.75 V2.00 H25.75 W1.00 S3.00 C115.00 A2744.74 [CW ELLIPSE AT LEFT END]
    G5 K2.00 F0.57 Z25.75 E0.21 Y1.75 R7.03 B-69.92 U0.75 V2.00 H25.75 W1.00 S2.00 C45.00 A2789.74 [DH G5 WITHDRAWL LEFT END]
    G1 F2.00 Z6.75 S6.98 C397.95 A3187.68 [MOVE RIGHT END]
    G3 K40.00 F0.22 Z4.75 E0.63 Y1.00 R0.59 B-53.13 U0.75 V2.00 H6.75 W1.00 S3.00 C115.00 A3302.68 [CCW ELLIPSE AT RIGHT END]
    G6 K2.00 F0.57 Z6.75 E0.21 Y1.75 R7.03 B69.92 U0.75 V2.00 H6.75 W1.00 S2.00 C45.00 A3347.68 [DH G6 WITHDRAWL RIGHT END]

    [Layer 1: Group 1/3 : Pass 4/10]



  7. #7
    Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    150
    Downloads
    0
    Uploads
    0

    Default Re: How to export a 3d path as GCode

    Quote Originally Posted by Jim Dawson View Post
    I could see entering the parameters for the desired wind, then the software would generate the needed motion commands to make it happen. This could be output as G code, or as machine readable code.

    A couple of fun facts: The G code that we read and write can not be read directly by a motion controller, it is internally translated into something the processor can digest. If you tell a motion controller to move an axis 10 mm, its response would be ''Huh?'' It has no idea what 10mm is. But if you told it to move an axis 10000 encoder pulses (in a properly formatted command string) it would happily do so.
    Are you reference to some software that would be generated the winding pattern. How could the pattern be output to G code ?
    What is the difference between G code and Machine Readable Code do present CNC softwares also accept alternative inputs instead of GCode. I would be interested to know what those formats are?



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

    Default Re: How to export a 3d path as GCode

    Quote Originally Posted by ZeroBacklash View Post
    Are you reference to some software that would be generated the winding pattern. How could the pattern be output to G code ?
    What is the difference between G code and Machine Readable Code do present CNC softwares also accept alternative inputs instead of GCode. I would be interested to know what those formats are?

    Yes. I can't see how any normal CAM software could generate the winding path from a CAD model. And after looking at the generated G code above, looks like a very special post processor. I had to look up a G5 move (Cubic spline), and I can't even find a G6 (inverse of a G5?). But it does look like LinuxCNC might handle the G code example above.

    I'm not aware of any CNC machines that operate with anything other than a G code input. Really what I was trying to say is that it is possible to generate motion using a lower level language directly. Sometimes useful for special applications. The exact language would be dependant on the motion controller used.

    Jim Dawson
    Sandy, Oregon, USA


  9. #9
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default Re: How to export a 3d path as GCode

    The G5 and G6 might also be some proprietary codes?

    I agree that you won't find any CAM to do this. Hand coding is probably going to be the best route.

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

    JointCAM - CNC Dovetails & Box Joints
    [URL]http://www.g-forcecnc.com/jointcam.html[/URL]

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


  10. #10
    Member
    Join Date
    May 2005
    Location
    canada
    Posts
    1662
    Downloads
    0
    Uploads
    0

    Default Re: How to export a 3d path as GCode

    Alternatively are there any existing solutions like SolidCAM / Mastercam that can generated G Code directly from path information.
    I have zero experience with filament winders but did a bit of searching (it's a long weekend here).
    https://www.material.be/cadwind/download/index.html
    Probably industrial read:expensive. The link above takes you to a list of videos, the 4th from the top explains post processor options.

    The software for x-winder has a download page but without the hardware may not be much use.

    Anyone who says "It only goes together one way" has no imagination.


  11. #11
    Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    150
    Downloads
    0
    Uploads
    0

    Default Re: How to export a 3d path as GCode

    Quote Originally Posted by ger21 View Post
    The G5 and G6 might also be some proprietary codes?

    I agree that you won't find any CAM to do this. Hand coding is probably going to be the best route.
    Question is how to I hand code something that doesn't exist in the standard.
    Wikipedia G-Code page only lists G05 as High Precision Contour Control and G06.1 as Nurbs.
    Linux CNC only has a G5.
    Do you suggest that G5 / G6 should be handled with standard codes?



  12. #12
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default Re: How to export a 3d path as GCode

    I'm saying that I don't even know for sure what those G5/G6 codes are doing.

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

    JointCAM - CNC Dovetails & Box Joints
    [URL]http://www.g-forcecnc.com/jointcam.html[/URL]

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


  13. #13
    Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    150
    Downloads
    0
    Uploads
    0

    Default Re: How to export a 3d path as GCode

    Quote Originally Posted by Jim Dawson View Post
    Yes. I can't see how any normal CAM software could generate the winding path from a CAD model. And after looking at the generated G code above, looks like a very special post processor. I had to look up a G5 move (Cubic spline), and I can't even find a G6 (inverse of a G5?). But it does look like LinuxCNC might handle the G code example above.
    Actually I just pasted that software for reference, yes I need to do something similar. Would there be alternatives to G5/G6 or workarounds? Basically I need a combination of axis movements for the path I generate. If I could use conventional G code for that it would be nice.
    Are there any gcodes for curve / spline?
    I even looked up the documentation for UCCNC and even they don't seem to handle G5/G6.



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

    Default Re: How to export a 3d path as GCode

    It is possible to generate any motion profile in multiple axes using only G1 moves. You can convert arcs into line segments, the only real downside is that the G code file sizes get huge. But not a real problem for modern computers. I've run files with a half million lines of code.

    Jim Dawson
    Sandy, Oregon, USA


  15. #15
    Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    150
    Downloads
    0
    Uploads
    0

    Default Re: How to export a 3d path as GCode

    Quote Originally Posted by Jim Dawson View Post
    It is possible to generate any motion profile in multiple axes using only G1 moves. You can convert arcs into line segments, the only real downside is that the G code file sizes get huge. But not a real problem for modern computers. I've run files with a half million lines of code.
    Wow! Now that's some hope, I see light at the end of the tunnel.



  16. #16
    Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    150
    Downloads
    0
    Uploads
    0

    Default Re: How to export a 3d path as GCode

    Quote Originally Posted by deadlykitten View Post

    about 3d path to g-code :
    ... try fingering that cam
    ... output as dwg and google search for dwg to g-code converter ?

    for that video that you shared, you don't need to master 3d toolpaths ( you are very close to threading on a cnc lathe ), but this does not mean that you should not master 3d toolpaths ... kindly
    I have been thinking about this all week and so if I somehow generate a 3D path and export it as DXF or DWG. Will the converter map the axis correctly to the C axis. I wonder if there are any 4 axis or 6 axis dxf / dwg to gcode converters?



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

    Default Re: How to export a 3d path as GCode

    Quote Originally Posted by ZeroBacklash View Post
    I have been thinking about this all week and so if I somehow generate a 3D path and export it as DXF or DWG. Will the converter map the axis correctly to the C axis. I wonder if there are any 4 axis or 6 axis dxf / dwg to gcode converters?

    I would expect that a 4 axis CAM program would map the axis correctly. Fusion 360 is supposed to have a 4th axis option, but I have never used it. When you get to 5 or 6 axis, the cost goes up exponentially.

    However, my opinion is that you are going to need some purpose built software to really get what you want. Really all that's required would be to enter the parameters of the wind, such as: length, layers, rotational speed, stepover/pass, and a number of other parameters then press ''Generate Code'' No reason to have G code as an intermediate step, outputting the native controller code would make more sense.

    Jim Dawson
    Sandy, Oregon, USA


  18. #18
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: How to export a 3d path as GCode

    Quote Originally Posted by ZeroBacklash View Post
    I have been thinking about this all week and so if I somehow generate a 3D path and export it as DXF or DWG. Will the converter map the axis correctly to the C axis. I wonder if there are any 4 axis or 6 axis dxf / dwg to gcode converters?
    hi / that video that you shared is far from needing 4 or 6 axis, it is a process pretty close to threading, which is quite simple

    please :
    ... i would advise you to master the threading codes : pitch / revolution & angular phase shift
    ... also pls look at image 01 : there is a part that requires a pretty similar process, like the one that you need the code is not hard, and is not 3D
    ... same, in image 02, there is needed a similar process

    look mr Zero , think about a wheel of a car the wheel is 3D, but actually, it only rotates, thus only 1 movement ...

    also, at the begining of your video, it says winding in 3 axis & 4 axis : please, somehow, you should make a difference between a process that needs to synchronize many axis, or only needs to position many axis / i am sorry, i can not explain this better right now



    there are guys&girls out there that can take a dwg, extract coordinates, and create a custom code that will suit whatever cnc; another way to do it, is to edit a CAM source ...


    do you need contacts ? please google " cad vcl " and " simple cnc ", etc ... and i believe that there are guys on this forum that can do it ; kindly

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  19. #19
    Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    150
    Downloads
    0
    Uploads
    0

    Default Re: How to export a 3d path as GCode

    Quote Originally Posted by deadlykitten View Post
    hi / that video that you shared is far from needing 4 or 6 axis, it is a process pretty close to threading, which is quite simple
    If we go a bit further into the video linked at the 3 or 4min point it shows winding of a cylinder with hemispherical ends.
    The axis shown are
    1. Rotating C axis (spindle)
    2. Linear Z axis running parallel to spindle in a reciprocating manner.
    3. Linear X axis moving towards and away from the spindle (perpendicular to the spindle)
    4. Rotating A axis this is required to unfold the filaments at the end of each stroke.

    I have not done any gcode so far, however I guess threading involves the above points 1, 2, 3 only there is no A axis involved in threading right? This is where I guess this operation differs from threading. But possibly you are trying to point me to similarities in threading and this operation.

    Quote Originally Posted by deadlykitten View Post
    there are guys&girls out there that can take a dwg, extract coordinates, and create a custom code that will suit whatever cnc; another way to do it, is to edit a CAM source ...
    Are you referring to softwares here or people? Also I did not get the part of "edit the CAM source", would this mean edit a gcode file that has been generated by CAM software.



  20. #20
    Member
    Join Date
    May 2005
    Location
    canada
    Posts
    1662
    Downloads
    0
    Uploads
    0

    Default Re: How to export a 3d path as GCode

    x-winder is using a custom interpretor, for example G5/G6 rotate the feed head and axis acceleration seems to be part of the code is well.
    Cadwind has a post for Mach3 so if you can find an example of that output it may give some ideas.

    Anyone who says "It only goes together one way" has no imagination.


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

How to export a 3d path as GCode

How to export a 3d path as GCode