<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Cody Churchwell</title>
    <description>The latest articles on DEV Community by Cody Churchwell (@consigcody94).</description>
    <link>https://dev.to/consigcody94</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3639381%2Ff6028a50-ca3c-4aef-92c4-2b210df4456a.jpeg</url>
      <title>DEV Community: Cody Churchwell</title>
      <link>https://dev.to/consigcody94</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/consigcody94"/>
    <language>en</language>
    <item>
      <title>How I Built a Digital Twin for NASA's $3M Lunar Waste Recycling Challenge</title>
      <dc:creator>Cody Churchwell</dc:creator>
      <pubDate>Mon, 01 Dec 2025 14:54:13 +0000</pubDate>
      <link>https://dev.to/consigcody94/how-i-built-a-digital-twin-for-nasas-3m-lunar-waste-recycling-challenge-3ab0</link>
      <guid>https://dev.to/consigcody94/how-i-built-a-digital-twin-for-nasas-3m-lunar-waste-recycling-challenge-3ab0</guid>
      <description>&lt;p&gt;Eight kilograms.&lt;/p&gt;

&lt;p&gt;That's how much trash a single astronaut generates per day on a space mission. Food packaging, worn-out clothing, hygiene products, equipment foam. On the ISS, most of it gets stuffed into a cargo vehicle and burned up in the atmosphere.&lt;/p&gt;

&lt;p&gt;On the Moon? There's no convenient disposal method 384,000 kilometers from Earth.&lt;/p&gt;

&lt;p&gt;NASA's LunaRecycle Challenge is a $3 million competition to solve this problem. I've been working on it solo for months, and today I'm open-sourcing my entire solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem Is Harder Than It Sounds
&lt;/h2&gt;

&lt;p&gt;At first glance, recycling seems straightforward. Heat things up, melt them down, reshape them. That works for most materials.&lt;/p&gt;

&lt;p&gt;Then I discovered PVDF.&lt;/p&gt;

&lt;p&gt;Zotek F30 is a polyvinylidene fluoride foam used extensively in spacecraft for insulation and cushioning. It's lightweight, durable, and perfect for space applications.&lt;/p&gt;

&lt;p&gt;It's also a nightmare to recycle.&lt;/p&gt;

&lt;p&gt;Heat PVDF above 300°C and it undergoes thermal decomposition, releasing hydrogen fluoride gas. HF is immediately dangerous to life—it penetrates skin on contact and can cause systemic fluoride poisoning. In an enclosed lunar habitat, even small amounts could be catastrophic.&lt;/p&gt;

&lt;p&gt;Most thermal recycling approaches simply can't handle PVDF safely.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: Don't Heat It
&lt;/h2&gt;

&lt;p&gt;After weeks of research into polymer chemistry, the answer became obvious: if heating is the problem, don't heat it.&lt;/p&gt;

&lt;p&gt;ARTEMIS-R (Advanced Recycling Technology for Extraterrestrial Material Integration System) uses a hybrid approach:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For safe materials (food packaging, clothing, paper):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Thermal pyrolysis at 350-450°C&lt;/li&gt;
&lt;li&gt;Produces syngas (fuel), biochar, and recovered water&lt;/li&gt;
&lt;li&gt;Melt extrusion for thermoplastics → 3D printer filament&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;For PVDF foam:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cold mechanical shredding (never exceeds 50°C)&lt;/li&gt;
&lt;li&gt;Particle size reduction to 5mm&lt;/li&gt;
&lt;li&gt;Mixed with biochar and lunar regolith simulant&lt;/li&gt;
&lt;li&gt;Low-temperature pressing (150°C) into composite tiles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The composite tiles serve as radiation shielding—PVDF actually has decent radiation attenuation properties, so we're turning a waste problem into a protective asset.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building the Digital Twin
&lt;/h2&gt;

&lt;p&gt;Before building physical prototypes (budget: ~$32K), I needed to validate the design. That meant building a complete physics simulation.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Architecture
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────────────────────────────────────────┐
│            ARTEMIS-R Digital Twin            │
├──────────────────────────────────────────────┤
│                                              │
│  ┌─────────────┐     ┌─────────────────────┐ │
│  │ Waste Input │────▶│  IHA-100 Classifier │ │
│  └─────────────┘     │  (AI + NIR Spectro) │ │
│                      └──────────┬──────────┘ │
│                    ┌────────────┼────────────┐
│                    ▼            ▼            ▼
│              ┌─────────┐  ┌─────────┐  ┌─────────┐
│              │ TPR-200 │  │ MEX-300 │  │ MSH-400 │
│              │ Thermal │  │ Extruder│  │ Shredder│
│              └────┬────┘  └────┬────┘  └────┬────┘
│                   └────────────┼────────────┘
│                                ▼
│                      ┌─────────────────┐
│                      │ CPR-500 Press   │
│                      └────────┬────────┘
│                               ▼
│                      ┌─────────────────┐
│                      │ Products Output │
│                      └─────────────────┘
└──────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Physics Modeling
&lt;/h3&gt;

&lt;p&gt;The simulation needed to capture real thermodynamics. For pyrolysis, I implemented Arrhenius kinetics:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calculate_reaction_rate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;temperature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    Arrhenius equation: k = A * exp(-Ea / RT)

    Parameters:
        temperature: Reactor temperature in Kelvin

    Returns:
        Reaction rate constant
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;8.314&lt;/span&gt;  &lt;span class="c1"&gt;# Universal gas constant (J/mol·K)
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pre_exponential&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;activation_energy&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;R&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;temperature&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Heat transfer through reactor walls uses conduction equations. Energy balance tracks every joule in and out. Mass balance ensures we're not creating or destroying matter (physics tends to complain about that).&lt;/p&gt;

&lt;h3&gt;
  
  
  The Classification System
&lt;/h3&gt;

&lt;p&gt;Waste arrives mixed. The system needs to identify what it's looking at before routing to the correct processor.&lt;/p&gt;

&lt;p&gt;I simulated an NIR spectroscopy + computer vision pipeline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;WasteClassifier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;classify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sample&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;WasteSample&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ClassificationResult&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# NIR spectral analysis
&lt;/span&gt;        &lt;span class="n"&gt;spectral_match&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match_spectrum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sample&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nir_signature&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="c1"&gt;# Visual classification (contamination detection)
&lt;/span&gt;        &lt;span class="n"&gt;visual_result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cnn_classify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sample&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="c1"&gt;# Confidence-weighted fusion
&lt;/span&gt;        &lt;span class="n"&gt;combined&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fuse_results&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;spectral_match&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;visual_result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="c1"&gt;# Route to appropriate processor
&lt;/span&gt;        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;determine_route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;combined&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Current simulation accuracy: 99.2% correct classification.&lt;/p&gt;

&lt;h3&gt;
  
  
  Real-Time Dashboard
&lt;/h3&gt;

&lt;p&gt;All this data needed visualization. I built a web dashboard using Dash/Plotly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; lunarecycle.dashboard.app &lt;span class="nt"&gt;--web&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It shows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Current processing state of each module&lt;/li&gt;
&lt;li&gt;Energy balance (spoiler: we're net positive!)&lt;/li&gt;
&lt;li&gt;Mass flow through the system&lt;/li&gt;
&lt;li&gt;Safety interlock status&lt;/li&gt;
&lt;li&gt;7-day production history&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Numbers
&lt;/h2&gt;

&lt;p&gt;After running thousands of simulation cycles:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Achieved&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Mass Recovery&lt;/td&gt;
&lt;td&gt;&amp;gt;80%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;90%+&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Net Energy&lt;/td&gt;
&lt;td&gt;Positive&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+44 kWh/week&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Crew Time&lt;/td&gt;
&lt;td&gt;&amp;lt;1 hr/week&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;&amp;lt;30 min/week&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PVDF Safety&lt;/td&gt;
&lt;td&gt;Zero HF&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Zero HF&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Throughput&lt;/td&gt;
&lt;td&gt;8 kg/day&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;8 kg/day&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The energy surplus comes from syngas. Pyrolysis of organic waste produces a hydrogen/carbon monoxide mix that can be burned for power. We generate more energy than the processing consumes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Domain expertise isn't always required to start.&lt;/strong&gt;&lt;br&gt;
I had zero aerospace background. I learned polymer chemistry from papers, thermodynamics from textbooks, and NASA requirements from the challenge documentation. The knowledge is out there.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Simulation before fabrication saves money.&lt;/strong&gt;&lt;br&gt;
Finding the PVDF decomposition problem in simulation cost me time. Finding it after building a $32K prototype would have cost much more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The hard problems are often at the edges.&lt;/strong&gt;&lt;br&gt;
The core recycling tech is well-understood. The challenge was handling edge cases—PVDF foam, contaminated mixed waste, failure modes. That's where the competition is won.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Open source accelerates everything.&lt;/strong&gt;&lt;br&gt;
By sharing this publicly, I've already gotten feedback that improved the design. Even if I don't win, maybe this helps someone who does.&lt;/p&gt;
&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;

&lt;p&gt;The entire project is MIT licensed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/consigcody94/lunarecycle-challenge.git
&lt;span class="nb"&gt;cd &lt;/span&gt;lunarecycle-challenge
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;
python &lt;span class="nt"&gt;-m&lt;/span&gt; lunarecycle.dashboard.app &lt;span class="nt"&gt;--web&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The repo includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complete simulation code (Python)&lt;/li&gt;
&lt;li&gt;109 automated tests&lt;/li&gt;
&lt;li&gt;Technical documentation&lt;/li&gt;
&lt;li&gt;CAD specifications for prototype&lt;/li&gt;
&lt;li&gt;Full bill of materials&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Submission deadline is January 22, 2026. I'm still iterating.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Physical prototype construction (early 2025)&lt;/li&gt;
&lt;li&gt;Regolith simulant testing for composite tiles&lt;/li&gt;
&lt;li&gt;Optimizing the classification model with real waste samples&lt;/li&gt;
&lt;li&gt;Documentation for NASA submission&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're working on space sustainability, ISRU, or polymer recycling—I'd love to connect. The problems are too big for any one person.&lt;/p&gt;

&lt;p&gt;Let's go recycle some astronaut trash.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;GitHub: &lt;a href="https://github.com/consigcody94/lunarecycle-challenge" rel="noopener noreferrer"&gt;consigcody94/lunarecycle-challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Questions? Find me in the comments or open an issue on the repo.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>opensource</category>
      <category>science</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
