## Additive Manufacturing

Additive manufacturing is the process of building from a computer controlled 3-dimensional printer. The material can be polymer (plastic), ceramic, metallic powder, liquid, or any material that is joined together through deposition, solidification, or fusion. It speeds the development of prototypes by precisely converting a computer aided design (CAD) drawing into a physical device. Additive manufacturing can be either a prototype or scaled up to full product production, but typically for applications that require customization or with low production volumes.

Background: A 3D print data set of additive manufacturing test conditions is available for Polylactic Acid (PLA) and Acrylonitrile Butadiene Styrene (ABS). PLA can print at lower temperatures of 180°C compared to 250°C for ABS. PLA is more brittle than ABS and is not typically suitable for high strength applications. The data was collected by researchers in the Mechanical Engineering department at Selçuk Üniversitesi on a Ultimaker S5 3D printer. The study focused on how the parameters in a specific 3D printer affects the print quality, accuracy and final part strength. This work is based on the settings and PLA or ABS filaments. Material and strength tests were carried out on a Sincotec GMBH tester capable of pulling 20 kN. |

Nine parameters were adjusted for the Ultimaker S5 3D printer.

- Layer Height (mm)
- Wall Thickness (mm)
- Infill Density (%)
- Infill Pattern (Honeycomb or Grid)
- Nozzle Temperature (ºC)
- Bed Temperature (ºC)
- Print Speed (mm/s)
- Material (PLA or ABS)
- Fan Speed (%)

After the part was manufactured, three parameters were measured for each product.

- Roughness (µm)
- Tension Strength (MPa)
- Elongation (%)

The labeled data is a combination of PLA and ABS material, print patterns, and conditions with 66 samples from a first repository and 50 samples from a second repository. The combined set is 70 samples with the duplicates removed and one outlier added. The label associated with each filament is *pla* or *abs*. The print pattern is *grid* or *honeycomb*. One-hot encoding translates character labels into a binary representation (0 or 1) for classification.

import pandas as pd

url = 'http://apmonitor.com/pds/uploads/Main/manufacturing.txt'

data = pd.read_csv(url)

# 'material' (1 is abs, 0 is pla) with numpy.where

data['material'] = np.where(data['material']=='abs',1,0)

# 'infill pattern' (1 is 'grid', 0 is 'honeycomb') with list comprehension

data.infill_pattern = [1 if ip=="grid" else 0 for ip in data.infill_pattern]

#### Part 1: Data Visualization and Cleansing

Generate summary statistics with a profiling report to statistically characterize the data. Use box plots to identify the one outlier in the data. Remove the row that contains the outlier from the data set. Generate a pair plot and correlation matrix. What factors are highly correlated to *Material (PLA or ABS)* and *Tension Strength (MPa)*?

#### Part 2: Classification of Materials

Train and test a classifier to distinguish between PLA and ABS filament material. Test at least 8 classifiers of your choice. Recommend a best classifier among the 8 that are tested. Randomly select values that split the data into a train (80%) and test (20%) set by using the sklearn *train_test_split* with *shuffle=True*.

Report the confusion matrix on the test set for each classifier. Discuss the performance of each. A confusion matrix shows true positive, false positive, true negative, and false negative groups from the test set. Generate a confusion matrix for each classifier.

Test 8 classification methods. Possible classification methods are:

- Adaptive Boosting (AdaBoost)
- Logistic Regression
- Naïve Bayes
- Stochastic Gradient Descent
- K-Nearest Neighbors
- Decision Tree
- Random Forest
- Support Vector Classifier
- Deep Learning Neural Network
- XGBoost Classifier

#### Part 3: Regression

Develop a regression model to predict *Tension Strength (MPa)* using the 9 machine settings.

- Layer Height (mm)
- Wall Thickness (mm)
- Infill Density (%)
- Infill Pattern (Honeycomb or Grid)
- Nozzle Temperature (ºC)
- Bed Temperature (ºC)
- Print Speed (mm/s)
- Material (PLA or ABS)
- Fan Speed (%)

Report the correlation coefficient (*R ^{2}*) for the train and test sets. Randomly select values that split the data into a train (80%) and test (20%) set. Use Linear Regression, Neural Network (Deep Learning), and another regression method of your choice. Discuss the performance of each.

**Regression:** Use 3 regression methods. Possible regression methods are:

- Linear Regression
- Neural Network (Deep Learning)
- K-Nearest Neighbors
- Support Vector Regressor
- XGBoost Regressor

There is concern that PLA has less strength than ABS for additive manufacturing. Compare the PLA and ABS predicted strength for all of the test points. One way to compare the strength is to change the *PLA* material to *ABS* and recalculate the predicted *Tension Strength (MPa)*.

#### Summary Report

Submit source code and an executive summary memo (max 2 pages) of the results from Parts 1-3.

- What is the outlier data row?
- What are the correlated variables with Material and Strength?
- What is the ability of the classifier to predict PLA or ABS print material?
- What is the relative strength of PLA versus ABS?

#### References

- Wang, C., Tan, X.P., Tor, S.B. and Lim, C.S., Machine learning in additive manufacturing: State-of-the-art and perspectives. Additive Manufacturing, 2020, p.101538.
- What is additive manufacturing?, GE Additive, YouTube, Posted Online July 2020.
- Minshall, T., How 3D printing is enabling the 4th Industrial Revolution, YouTube, Hosted by TEDxOxBridge, Posted Online June 2016.
- Alvarado, T., Introducing the Future of Manufacturing, YouTube, Hosted by TEDxCoeurdalene, Posted Online May 2019.
- Nomula, V.K., 3D Printer Material Dataset, Kaggle, Data Archive.
- Okudan, A., 3D Printer Dataset for Mechanical Engineers, Dataset for find relations between the input parameters of 3D printers, Kaggle, Data Archive.