Basket Weave

This still untested

################################################################# ### Code Purpose ### #################################################################

Purpose


Basket Weave Pattern

This program is to create a basket weave pattern as shown in the picture to the right

 

################################################################# ### Axes & Movement Notes ### #################################################################

Axes & Movement Notes

Axis Usage Gcode Notes System Setup Notes

*** Sp0 ***************************************************

Sp0 This axis is not used.

This axis cannot be used for the spindle rotation as LinuxCNC does not support synchronized movement of spindles with another axis. Typically, the C axis would be used; however this machine has no dedicated C axis; thusly, the B axis is used here to stand in for Sp0. The spindle’s stepper motor must thusly be plugged into the B axis jack.

 

*** Sp1 ***************************************************

Sp1 This axis is not used    

*** X ***************************************************

X

This axis is used to

  • Plunge the cutter into the piece for cutting, and
  • Withdraw the cutter away from the cylinder when repositioning it.

Be sure to check that the following are good values for your machine:

  • #30 X axis plunge/withdraw feed rate. The plunge rate will especially need to be configured for the material.
  • #40 Distance to plunge/retract

Ensure the backlash setting for this axis is set appropriately. *** Z ***************************************************

Z This axis is used for movement along the lathe bed.

Be sure to check that the following are good values for your machine:

  • #31 feed rate for cutting
  • #33 feed rate for repositioning
  • #40 Z axis starting position; usually this is 0

Ensure the backlash setting for this axis is set appropriately. *** B ***************************************************

B This axis is used for driving the spindle rotation.

Be sure to check that the following are good values for your machine:

  • #31 feed rate for cutting
  • #32 feed rate for repositioning

Ensure the backlash setting for this axis is set appropriately.

Ensure the scale setting for this axis is set appropriately. Typically, the scale is set to match the value for Sp0. *** U ***************************************************

U This axis is not used.    

*** V ***************************************************

V This axis is not used.    

*** W ***************************************************

W This axis is not used.    

################################################################# ### Gcode ### #################################################################

Gcode

Right-click on the file icon shown to the left, and then select Save Link As... to save it to the folder,
/home/reuben/linuxcnc/configs/RoseEngineButler/gcode
The file's extension should be ngc.

Gcode File Contents

Everything between and is not formatted as PMwiki text. The entered text is displayed as is.

%
(=======================================================================)
(  BASKET WEAVE PATTERN                                                 )
( Designed to run on the Rose Engine Butler system which runs on        )
( LinuxCNC. The gcode format is rs274ngc and uses O-word loops.         )
(=======================================================================)
(  Version 1.0, 11 August 2026                                          )
(=======================================================================)
(  *** OPERATOR NOTE ***                                                )
(  This machine has no dedicated C axis. The B axis letter is used here )
(  to stand in for Spindle0 -- the physical spindle motor must be       )
(  plugged into the B-axis driver jack before running this program.     )
(                                                                       )
(  ASSUMPTIONS -- CHECK THESE BEFORE RUNNING:                           )
(   1. X- moves the cutter INTO the work as a plunge. If your           )
(      cross-slide's polarity is opposite, swap the signs on the X      )
(      moves marked [X SIGN].                                           )
(   2. Check that the following are good values for your machine:       ) 
(      X Axis                                                           )
(         #30 X axis plunge/withdraw feed rate                          )
(         #40 Distance to plunge/retract                                )
(                                                                       )
(      B & Z Axes - synchronized movement                               )
(         #31 feed rate for cutting                                     )
(         #32 feed rate for B repositioning                             )
(         #33 feed rate for Z repositioning                             )
(         #40 Z axis starting position - usually 0                      )
(   3. Check that the scale for the B axis is appropriately set.        ) 
(   4. Check that backlash for the X axis is set appropriately.         ) 
(=======================================================================)

(-- USER PARAMETERS ----------------------------------------------------)
#1 = 1.2500     (Diameter of piece in inches.  If machine setup is      )
                (using G21, then this is in mm.                         )
#2 = 24         (Number of Waves - number of boxes around perimeter     )
#3 = 4          (Number of CutsPerWave, typ. 3 or 4                     )
#4 = 0.0300     (DepthOfCut, in UOM per plunge                          )
#5 = 8          (RowsOfPatterns - should be an even number              )

(-- FEEDS / SAFE POSITION ----------------------------------------------)
#30 = 20.00     (Feed, X plunge/withdraw, in/min or mm/min              )
#31 = 00.50     (Feed, synchronized B+Z cutting move, in/min or mm/min  )
#32 = 600.00    (Feed, B reposition move, in/min or mm/min              )
#33 = 02.00     (Feed, Z reposition move, in/min or mm/min              )
#40 = 0.5000    (Safe/retract X position, absolute, inch or mm          )
#41 = 0.0000    (Start Z position, absolute, inch or mm                 )

(-- CALCULATED VALUES --------------------------------------------------)
#7 = [360 / #2]                      (C1  SpindleAmplitude, deg         )
#8 = [#1 * 3.14159265 / [#2 * 2]]    (C2  ZAmplitude, inch or mm        )

(-- STATE / LOOP VARIABLES ---------------------------------------------)
#13 = -1        (Spindle0Direction                                      )
                (   -1=negative = starting value                        )
                (    1=positive                                         )
#14 = -1        (AxisZDirection                                         )
                (   -1=negative = starting value                        )
                (    1=positive                                         )
#9  = [#5 / 2]  (Loop1 repeat count                                     )
                (     = RowsOfPatterns / 2                              )

(-- MACHINE / MODE SETUP -----------------------------------------------)
G20             (Imperial mode / G21 is metric mode                     )
G90             (absolute mode for setup moves                          )
G0 X#40 Z#41    (move to safe/start position - based on #40/#41 above   )
G91             (incremental mode for all pattern moves below           )

(-- Loop1: repeat RowsOfPatterns/2 times -------------------------------)
#10 = 1
O100 WHILE [#10 LE #9]

  (-- Loop2: repeat CutsPerWave times ----------------------------------)
  #11 = 1
  O200 WHILE [#11 LE #3]

    #15 = [#7 / 2]    (Spindle0Distance = SpindleAmplitude/2            )
    #16 = #8          (ZAxisDistance    = ZAmplitude                    )
    #17 = [#15 / #3]  (per-step reposition rotate                       )
                      (     = Spindle0Distance/CutsPerWave              )

    (-- Loop3: repeat Waves times --------------------------------------)
    #12 = 1
    O300 WHILE [#12 LE #2]

      G1 X[-#4] F#30                          (plunger cutter           )
      G1 B[#15 * #13] Z[#16 * #14] F#31       (synchronized B/Z move    )
      G1 X[#4] F#30                           (withdraw cutter          )
      G1 B[#17 * #13] F#32                    (reposition B for next cut)
      G1 Z[#8 * #14] F#33                     (reposition Z for next cut)

      #12 = [#12 + 1]
    O300 ENDWHILE

    #13 = [-#13]            (flip B/Sp0 direction                       )

    #11 = [#11 + 1]
  O200 ENDWHILE

  #13 = [-#13]              (flip B/Sp0 direction                       )
  #14 = [-#14]              (flip Z direction                           )

  #10 = [#10 + 1]
O100 ENDWHILE

(-- PROGRAM END --------------------------------------------------------)
G90
G0 X#40 Z#41
M9
M2
%
 

################################################################# ### DO NOT REMOVE THE FOLLOWING ### #################################################################

########## Standard Footer for all pages ##########

About the Rose Engine Butler System
Terms of Use

eMail comments to
ColvinTools @ Gmail [period] com -> mailto:ColvinTools [snail] Gmail [period] com