1
$\begingroup$

I thought I am not bad at Google, but simply I am unable to find a G-code for doing circular motion for nozzle cleaning. It is possible to write a simple circular motion in G-code?

$\endgroup$
1
  • $\begingroup$ Marlin's g-code reference is so good that I don't Google for this kind off information anymore; I go rightly to it. $\endgroup$
    – mguima
    Dec 25, 2021 at 21:43

2 Answers 2

2
$\begingroup$

To draw a circle, you need to approximate the circle as a sufficient number of line segments. This requires computing or using a table of sine and cosine values for each angle step. Then you just emit a sequence of G1 commands.

Some printer firmware also supports arc drawing commands you could use instead in principle, but support is not widespread, and the quality of the results varies enough that I would not recommend trying to do it this way.

$\endgroup$
1
$\begingroup$

While many 3D printers support using G2 and G3 for circles and arcs, most people are not used to them because the STL files consist entirely of flat triangles (straight lines).

If you want a simple 2D circle, see the following for help:

https://marlinfw.org/docs/gcode/G002-G003.html

https://makezine.com/2016/10/24/get-to-know-your-cnc-how-to-read-g-code/

https://reprap.org/wiki/G-code#G2_.26_G3:_Controlled_Arc_Move

Note: it can take a while to get used to the I and J parameters.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged .