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 numpy as np
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:

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 (R2) 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:

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


Generative AI Learning

Use these prompts to test your understanding after completing the case study. Direct the AI — with 70 samples, every judgment call is yours.

"Quiz me with 5 questions, one at a time, on the 3D-printing case study: which of the nine print parameters are categorical and how they must be encoded before modeling, why 70 samples makes both the classifiers and the regressors fragile and what cross-validation adds over a single 80/20 split, why a confusion matrix is reported per classifier instead of accuracy alone, what a parity plot shows for the tension-strength regressors, and why an effect found in this dataset (say, infill pattern) might not transfer to a different printer or filament brand. Grade my answers and list my misconceptions."
"I have only 70 samples. Argue BOTH sides of this decision, specifically for this printing dataset: (a) generate synthetic samples (SMOTE-style interpolation or asking a generative model for plausible print outcomes) to enlarge training data, vs (b) refuse synthetic data and rely on cross-validation and simpler models. Name the concrete risks of each — interpolated print settings that no physical printer produced, synthetic points that smooth over the real PLA/ABS boundary, small-sample variance — then make ME decide and defend the decision. Critique my defense."

Tip: This case study is the template for the midterm exam's applied section — practice writing the memo as if a manufacturing engineer who has never seen scikit-learn will read it and choose print settings based on your conclusions.

What to Turn In

Submit your source code and an executive memo (PDF, maximum 2 pages) that curates your results into a demonstration of what you learned. You may use Generative AI to help write the memo, but you must guide it to the correct visualizations, justifications, and assumptions. Answer these questions:

  1. Data preparation: the profiling/box-plot evidence you used, what you cleansed or encoded, and the final feature table.
  2. Classification: the 8+ classifier comparison with test confusion matrices, and which classifier you would trust to identify material type — justified by more than accuracy.
  3. Regression: three models for tension strength with parity plots, and your PLA vs ABS strength conclusion WITH an honest statement of uncertainty given n=70.
  4. From the synthetic-data debate: your decision, your strongest argument for it, and the strongest argument against it.
  5. From the quiz prompt: one question you missed and the corrected answer.

Course on GitHub

Exams

Data Engineering

Agentic Engineering

Classification

Supervised Learning

Unsupervised Learning

Regression

Time-Series

Computer Vision

Applications

3D Print 📈📊
Automotive Data 📈📊
Auto Efficiency 📈📊👁️
Battery Life⏱️📈
Bit Classification 👁️📊
Facial Recognition 👁️📊
Glass Type⏱️📈
Hand Tracking 👁️
OT Cybersecurity ⏱️📊
Batteries 📊
Polymers 📈
Road Detection 👁️📊
Safety 👁️
Soils 👁️📊
Sonar 📊
Texture 👁️📊
Wind Power ⏱️📈
📈=Regression
📊=Classification
⏱️=Time Series
👁️=Computer Vision
🎧=Audio

TCLab Project

Related Courses

Admin