CNCMill: Difference between revisions

From Traxel Wiki
Jump to navigation Jump to search
No edit summary
 
(171 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:Hacking]]
[[Category:Hacking]]
= Links =
* Radial and Axial Depth of Cut
** [https://www.cnccookbook.com/2-tools-calculating-cut-depth-cut-widthstepover-milling/ Cut Depth and Stepover]
** https://www.harveyperformance.com/in-the-loupe/depth-of-cut/
*** Perimeter Milling
**** RDOC
***** Finishing: 3% - 5% of tool diameter
***** Roughing: 10% to 50% of tool diameter
**** ADOC
***** Shallower for roughing, deeper for finishing.
*** Slotting
**** ADOC
***** Roughing: 10% to 50% of tool diameter
***** Finishing (bottom): 3% - 5% of tool diameter
* Feeds & Speeds
** https://www.the-carbide-end-mill-store.com/Feeds-and-Speeds.html
** [[Feeds_and_Speeds]]


= G-Code =
= G-Code =


This may be specific to Acorn CNC at HSL.
This may be specific to Acorn CNC at HSL.
* https://en.wikipedia.org/wiki/G-code


== Comments ==
== Comments ==
Line 71: Line 92:
== Arc Cuts ==
== Arc Cuts ==


G2 is a clockwise cut from the current position to the destination at { X, Y, Z } about the center { I, J, K }.
G2 is a clockwise cut from the current position { X1, Y1, Z1 } to the destination at { X2, Y2, Z2 } about the center { X1 + I, Y1 + J, Z1 + K }.
 
G3 is counterclockwise.


If the active plane is XY, all three Z's must be the same and do not need to be specified. The same applies for ZX and Y, and for YZ and X.
If the active plane is XY, all three Z's must be the same and do not need to be specified. The same applies for ZX and Y, and for YZ and X.
'''Note:''' I, J, and K are always incremental measurements from X1, Y1, Z1


<pre>
<pre>
Line 79: Line 104:
G90 (set absolute coordinates)
G90 (set absolute coordinates)
G1 X-1 Y0 Z0 (cut line to {-1, 0, 0 } at feed rate)
G1 X-1 Y0 Z0 (cut line to {-1, 0, 0 } at feed rate)
G2 X1 Y0 I0 J0 (cut arc to { 1, 0, 0 } about center at { 0, 0, 0 } )
G2 X1 Y0 I1 J0 (cut arc to { 1, 0, 0 } about center at { -1 + 1, 0 + 0, 0 } )
</pre>
</pre>


== Drill Array Pecking ==
== Drill Array Pecking ==


= Example =
TBD
 
= Bearing Cup =
* [[BearingCupVersionOne]]
* [[BearingCupVersionTwo]]
* [[BearingCupVersionThree]]


== Bearing Cup ==
= Gear Cutting =


=== Find Center of Part ===
== G-Code ==


* 25.4mm from long edge
[[GearCuttingVersionOne]]
* 13mm from short edge


=== Face Material ===
== Notes ==


=== Drill Center ===
* On a 30mm radius gear, error from 1 degree involute curve approximation is on the order of thousandths of a millimeter.
* 20 degrees is the typical pressure angle.
* http://www.otvinta.com/gear.html
** http://www.otvinta.com/tutorial01.html
** Also: cnc-mill/involute_gear/calculator/Otvinta.com -- Involute Gear Calculator


Zero Tool Z Manually w/ 5/16 drill, zero Z to drill shoulder.
== Not Profile-Shifted ==


<pre>
* Bottom of Root to Pitch Radius = module
G21 (set units to millimeters)
* Pitch Radius to Tip Radius = module
G90 (set measurements to absolute, relative to machine zero)
* module = distance along pitch radian from pitch circle at 0 radians to base circle at standard pressure angle radians
G0 Z20 (traverse to 20mm above part)
** See: https://www.tec-science.com/mechanical-power-transmission/involute-gear/undercut/
G0 X0 Y0 (traverse to origin XY)
** "Calculation of the minimum number of teeth"
F100 (set feed rate to 100mm per minute)
* 14 teeth minumum (17 hypothetical, 14 practical, some stretch to 12)
G1 Z-6 (peck to 6mm deep)
G0 Z6 (retract to 6mm above)
G0 Z0 (traverse to 0mm above)
G1 Z-12 (peck to 12mm deep)
G0 Z20 (traverse to 20mm above)
</pre>


Zero Tool Z Manually w/ 5/8 drill, zero Z to drill shoulder.
== Profile Shifted ==


<pre>
* z=10, x=.4 pretty safe
G21 (set units to millimeters)
* z=8, x=.4 probably works in practice
G90 (set measurements to absolute, relative to machine zero)
* https://khkgears.net/new/gear_knowledge/abcs_of_gears-b/gear_profile_shift.html
G0 Z20 (traverse to 20mm above part)
* http://www-mdp.eng.cam.ac.uk/web/library/enginfo/textbooks_dvd_only/DAN/gears/generation/generation.html
G0 X0 Y0 (traverse to origin XY)
F100 (set feed rate to 100mm per minute)
G1 Z-4 (peck to 4mm deep)
G0 Z6 (retract to 6mm above)
G0 Z0 (traverse to 0mm above)
G1 Z-9 (peck to 9mm deep)
G0 Z20 (traverse to 20mm above)
</pre>


=== Drill Screw Holes ===
== Mesh Check ==


==== Drill Threaded Hole ====
Looks promising:


==== Drill Slip Hole ====
[[File:Mesh check.png|thumb]]


Use .166" or 4.25mm bit.
= Geometry =


=== Arc Cut Center ===
== Circle from 3 Points ==


Zero Tool Z w/  
https://stackoverflow.com/questions/4103405/what-is-the-algorithm-for-finding-the-center-of-a-circle-from-three-points#4103418


==== Bearing Retainer ====
<pre>
  public static Circle circleFromPoints(final Point p1, final Point p2, final Point p3)
  {
    final double offset = Math.pow(p2.x,2) + Math.pow(p2.y,2);
    final double bc =   ( Math.pow(p1.x,2) + Math.pow(p1.y,2) - offset )/2.0;
    final double cd =   (offset - Math.pow(p3.x, 2) - Math.pow(p3.y, 2))/2.0;
    final double det = (p1.x - p2.x) * (p2.y - p3.y) - (p2.x - p3.x)* (p1.y - p2.y);
   
    if (Math.abs(det) < TOL) { throw new IllegalArgumentException("Yeah, lazy."); }


==== Bearing Cup ====
    final double idet = 1/det;
   
    final double centerx = (bc * (p2.y - p3.y) - cd * (p1.y - p2.y)) * idet;
    final double centery = (cd * (p1.x - p2.x) - bc * (p2.x - p3.x)) * idet;
    final double radius =  
      Math.sqrt( Math.pow(p2.x - centerx,2) + Math.pow(p2.y-centery,2));
   
    return new Circle(new Point(centerx,centery),radius);
  }
</pre>

Latest revision as of 06:11, 4 August 2022


Links

G-Code

This may be specific to Acorn CNC at HSL.

Comments

Comments are in parentheses.

G0X0Y0 (rapid traverse to origin - the traverse will be executed, but this parenthetical comment is ignored)

Active Units

G20 (set active units to inches)
G21 (set active units to millimeters)

Absolute v. Incremental

G90 (absolute measurements, relative to machine zero)
G91 (incremental measurements, relative to previous ending position)

Feeds

F sets the feed rate in the active units.

G20 (inches)
F15 (15 inches per minute)
G1 X0 Y0 (traverse to origin at 15 IPM) (spaces are optional)
G21 (millimeters)
F375 (375 mm per minute)
G1X0Y0 (traverse to origin at 375mmPM)

Straight Line Traversal

G0 is fast traversal. Careful not to run the tool into the part. Each axis is run at full speed until reaching its destination (ie: the tool follows multiple line segments, not an interpolated straight line).

G21 (set millimeters)
G90 (set absolute coordinates)
G0X3 (fast traverse the X axis to origin + 3 millimeters)
G0X1Y-2.6Z3 (fast traverse to { 1, -2.6, 3 } millimeters)
G0X0Y0Z0 (fast traverse to origin)
G0 X1 Y-2.6 Z3 (fast traverse to { 1, -2.6, 3} mm with spaces for readability)

Straight Line Cuts

G1 is an interpolated straight line from current position to the new position, moving at feed rate.

G21 (set millimeters)
G90 (set absolute coordinates)
F350 (set feed speed to 350mm per minute)
G0X0Y0Z0 (move to origin)
G1X10Y20Z-5 (move in a straight line from {0,0,0} to {10,20,-5} at 350mm per minute)

Plane Selection

G17, G18, G19 select XY, ZX, or YZ as the active plane.

Arc Cuts

G2 is a clockwise cut from the current position { X1, Y1, Z1 } to the destination at { X2, Y2, Z2 } about the center { X1 + I, Y1 + J, Z1 + K }.

G3 is counterclockwise.

If the active plane is XY, all three Z's must be the same and do not need to be specified. The same applies for ZX and Y, and for YZ and X.

Note: I, J, and K are always incremental measurements from X1, Y1, Z1

G17 (set plane to XY)
G90 (set absolute coordinates)
G1 X-1 Y0 Z0 (cut line to {-1, 0, 0 } at feed rate)
G2 X1 Y0 I1 J0 (cut arc to { 1, 0, 0 } about center at { -1 + 1, 0 + 0, 0 } )

Drill Array Pecking

TBD

Bearing Cup

Gear Cutting

G-Code

GearCuttingVersionOne

Notes

Not Profile-Shifted

Profile Shifted

Mesh Check

Looks promising:

Mesh check.png

Geometry

Circle from 3 Points

https://stackoverflow.com/questions/4103405/what-is-the-algorithm-for-finding-the-center-of-a-circle-from-three-points#4103418

  public static Circle circleFromPoints(final Point p1, final Point p2, final Point p3)
  {
    final double offset = Math.pow(p2.x,2) + Math.pow(p2.y,2);
    final double bc =   ( Math.pow(p1.x,2) + Math.pow(p1.y,2) - offset )/2.0;
    final double cd =   (offset - Math.pow(p3.x, 2) - Math.pow(p3.y, 2))/2.0;
    final double det =  (p1.x - p2.x) * (p2.y - p3.y) - (p2.x - p3.x)* (p1.y - p2.y); 
    
    if (Math.abs(det) < TOL) { throw new IllegalArgumentException("Yeah, lazy."); }

    final double idet = 1/det;
     
    final double centerx =  (bc * (p2.y - p3.y) - cd * (p1.y - p2.y)) * idet;
    final double centery =  (cd * (p1.x - p2.x) - bc * (p2.x - p3.x)) * idet;
    final double radius = 
       Math.sqrt( Math.pow(p2.x - centerx,2) + Math.pow(p2.y-centery,2));
    
    return new Circle(new Point(centerx,centery),radius);
  }