# Calculating Remnant Lengths

*Material Optimization - Part One*

April 26, 2020
We require a formula or method to calculate the amount of material remaining following the completion of a given cut sequence.

We also need a method or formula to determine how many cut lengths we can produce from a given stock length. We'll save this discussion for Part Two.

First, define the variables used to describe the cutting process. We'll then work through an example and determine the edge cases for further consideration.

- StockLength: (Input)
- StockLength is the length of material from which our lengths are cut.

- Kerf: (Input)
- Material removed by the actual cutting operation and is typically the width of the saw blade.

- Crop:
- The Crop does not include the Kerf and is the length of cropped material remaining after the cutting operation.

- CropKerf:
- It is possible to specify a CropCut that is greater than zero and less than the Kerf.

- CropCut: (Input)
- CropCut is the sum of Crop and CropKerf and is the parameter we will supply to our formula. A cropped cut ensures the end of the stock length is "square" across the width of the profile.

- Grip: (Input)
- The Grip is the minimum length of material that must be present to either push or grip the material while executing the cutting sequence.

- OffalKerf:
- If (Grip > 0), OffalKerf is equal to Kerf, as Kerf Cut is required to separate the remaining stock from the last cut length in the sequence. Otherwise, we set OffalKerf to zero and calculate the actual OffalKerf AFTER calculating the remaining Offal.

- GripCut:
- If Grip is greater than zero, GripCut is the sum of Grip and GripKerf; otherwise, GripCut is zero.

- CutLength(s): (Input)

- CutLength is the actual cut length of material from a given stock length and may yield multiple cut lengths.

- Offal:
- Offal typically describes process waste; however, in our instance, we define Offal as the length of material remaining between the GRIP and the last cut sequence.

- Remnant:
- A remnant is the length of material remaining after completing a given cut sequence and is the sum of GRIP and OFFAL.

Now that we have defined our variables, we can proceed with examples to demonstrate their use. We will use the parameters below for the calculations to follow:

- Stock Length = 4876.8 mm (192 inches, 16 feet)
- Kerf = 3.2 mm (0.125 inches)
- GRIP = 150.0 mm (6 inches)
- CropCut = 6.0 mm

Using the above parameters, we can calculate some of the remaining variables independent of the cut lengths and respective quantities:

- For simplicity, we will specify the CropCut parameter then calculate the Crop and CropKerf, as it is possible to specify a CropCut value that is less than Kerf.
- Crop
- Crop = Maximum(CropCut-Kerf, 0)
- Crop = Maximum(6.0-3.2, 0)
- Crop = 2.8

- CropKerf
- CropKerf = Minimum(CropCut, Kerf)
- CropKerf = Minimum(6.0, 3.2)
- CropKerf = 3.2

- Offal
- Offal is the only unknown length and is the calculation of concern.

- OffalKerf
- When Grip is greater than zero, OffalKerf is equal to Kerf. When Grip is equal to zero, OffalKerf equals zero.
- If(Grip > 0) then,
- OffalKerf = Kerf
- OffalKerf = 3.2
- Else
- OffalKerf = 0

- When Grip is greater than zero, OffalKerf is equal to Kerf. When Grip is equal to zero, OffalKerf equals zero.
- GripCut
- GripCut = zero or (Grip+Kerf) if Grip is greater than zero
- If (Grip > 0) then,
- GripCut = (Grip+OffalKerf),
- GripCut = 150.0 + 3.2
- Gripcut = 153.2
- Else
- GripCut = 0

- Crop

### Calculate "CutLengths"

Given that a Kerf cut separates each cut length, we can calculate the stock that CutLengths requires as follows:

- CutLengths = Sum(CutLengths)+(LengthCount-1)*Kerf) where LengthCount is the number or quantity of Cut Lengths.

### Edge Cases:

We need to test or check some parameters BEFORE we perform some of the calculations shown here.

- If the cut length is ZERO, then no stock is consumed. A quantity "n" of ZERO length cuts does not yield (n-1) Kerfs.
- If the CutLength is greater than or equal to the stock length, Crop and Grip parameters do not apply.
- If the number of cut lengths (LengthCount) is zero, then no stock is consumed. A given length with zero requirements does not yield (0-1) Kerfs.
- OffalKerf requires a unique calculation when Grip is equal to ZERO.
- Offal = one of two possible values. A Grip requires a full Kerf cut, whereas, a partial Kerf or no Kerf may exist without a Grip:
- With Grip: OffalKerf is equal to Kerf.
- If(Grip > 0) then,
- OffalKerf = Kerf
- Else
- OffalKerf = 0

- Without Grip: We defer the OffalKerf calculation AFTER we calculate the Offal.
- If(Grip = 0) then
- OffalKerf = Minimum(Kerf, Offal)
- Else
- OffalKerf = 0

- With Grip: OffalKerf is equal to Kerf.

- Offal = one of two possible values. A Grip requires a full Kerf cut, whereas, a partial Kerf or no Kerf may exist without a Grip:

## Calculate the Remnant Length

The Offal is the only unknown length in our cut sequence, and we can now calculate the length of the remnant as follows:

- Remnant = Grip + Offal - OffalKerf