G2

More
11 Jan 2025 19:32 #318701 by claytoncramer
G2 was created by claytoncramer
What I am trying to do: in a 1" x 1" square workpiece, cut a .68" ID hole starting at (.16",.16").  The mill is .125" nminal diameter.  It is actually .122".

The gCode I tried, producing a hole that is too small:

g1 x.16 y.16 f25
g1 z0 f25
g2 i.-34

Please Log in or Create an account to join the conversation.

More
12 Jan 2025 08:25 #318739 by Aciera
Replied by Aciera on topic G2
What have you set as your tool diameter and how much is 'too small'?

Please Log in or Create an account to join the conversation.

More
13 Jan 2025 22:49 #318895 by claytoncramer
Replied by claytoncramer on topic G2
I may have solved it. There are dozens of G2/G3 examples on YouTube and only one seems to provide useful instruction.

Please Log in or Create an account to join the conversation.

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
13 Jan 2025 23:07 #318898 by tommylight
Replied by tommylight on topic G2
What video on youtube?
It might be helpful to others ...

Please Log in or Create an account to join the conversation.

More
14 Jan 2025 02:14 #318918 by claytoncramer
Replied by claytoncramer on topic G2
was the only useful one for me. This is the bash scrip that I wrote to produce a hole centered in a box specified by four points. There are two files that this script uses.

#!/bin/bash

# Cut an interior circle starting at xStartBB yStartBB xEndBB yEndBB zStart zStep zEnd feedRate holeDiameter endMillDiameter

# BB is short for BoundingBox

if [ "$#" -eq 0 ];

then echo "$0 xBB yBB xEndBB yEndBB zStart stepZ endZ feedRate holeDiameter endMillDiameter"

else

xStartBB=$1

yStartBB=$2

xEndBB=$3

yEndBB=$4

startZ=$5

stepZ=$6

endZ=$7

feedRate=$8

holeDiameter=$9

endMillDiameter=${10}

millRadius=`echo "$endMillDiameter/2"|bc -l`

# Calculate starting cut points

echo $xEndBB $xStartBB $holeDiameter

center=`echo "(($xEndBB-$xStartBB)/2)"|bc -l`

offset=`echo "((($xEndBB-$xStartBB)-($holeDiameter))/2)"|bc -l`

startXCut=`echo "$xStartBB+$offset+$millRadius"|bc -l`

startYCut=`echo "($yEndBB-$yStartBB)/2"|bc -l`

endYCut=$startYCut

endXCut=`echo "$yEndBB - $offset - $millRadius"|bc -l`

# calculate radius for i

i=`echo "($center-$startXCut)"|bc -l`

cat prolog.nc >rotate.nc

echo "g1 z1.0 f$feedRate" >>rotate.nc

echo "g1 x$startXCut y$startYCut f$feedRate" >>rotate.nc

echo "g1 z$startZ y$startYCut f$feedRate" >>rotate.nc

newstartZ=`echo "$startZ+$stepZ"|bc -l`

for curZ in `seq $newstartZ $stepZ $endZ`

do

echo "g1 z$curZ f$feedRate" >>rotate.nc

echo "g2 x$endXCut y$endYCut i$i j0 f$feedRate" >>rotate.nc

echo "x$startXCut y$startYCut j0 i-$i" >>rotate.nc

done

echo "g1 z1.0 f$feedRate" >>rotate.nc

cat epilog.nc >>rotate.nc

fi


The two external files are prolog.nc

%

g17 g20 g54


and epilog.nc

m2

%

The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.118 seconds
Powered by Kunena Forum