Ymit24 / too-hot-to-prandtl-control-system

GNU General Public License v2.0
0 stars 0 forks source link

❄️🎛️ Too Hot To Prandtl Control Software

About this repo

This repo contains all the software I wrote for my undergraduate senior design project "Too Hot To Prandtl".

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. License
  6. Contact

About the Project

My senior design project, "Too hot to prandtl", is a thermal management solution designed for heterogeniously packaged chips. It is a fluid based cooler which leverages phase change to increase heat transfer. Myself, along with four Mechnical Engineering students designed, simulated, fabricated, and tested this system. As the teams sole Electrical Engineer, I wrote all the software and designed, ordered, assembled, and brought-up the custom embedded system's printed circuit board (PCB). The hardware for this project is hosted in a seperate repository found here.

Project Structure

(Here I use a workspace containing multiple crates which is Rust's terminology for a solution with multiple projects, if you're coming from a .NET background, for example.)

This project is split between two applications across four crates.

Crate Description
control_system The application which runs on the host system. This application runs the control algorithm.
common A library crate which contins common definitions such as Temperture, Packet, etc...
embedded_firmware The embedded firmware application wihch runs on the microcontroller.
embedded_firmware_core A library containing business-logic level code from the firmware which can be tested in isolation.
external_dependencies Contains a local copy of the arduino_mkrzero board support crate due to versioning issues.

Control System

The control system crate contains application code for the authoritative control server. This software runs on a desktop computer (Windows, macOS, Linux) and communicates with the embedded system via USB. In our prototype, we connected via the internal motherboard's USB2 header.

Built With

Getting Started

This software is designed specifically for use with the custom hardware, both electrical and mechanical. It is ill advised to try and set this up on your own due to risk of property damage. This section is here for future research reference and for documentation.

Prerequisites

This software doesn't have any major requirements to run on your computer, you just need a recent version of rust.

The embedded firmware was designed to run on a Cortex M0+ atsamd21g18a microcontroller. The schematic's for the hardware, including pin assignments, can be found here on the hardware repo.

Installation

Clone down this repository somewhere convenient. For the host machine, just run it!

cd too-hot-to-prandtl-control-system
cargo run

Note: for a real production use case, run the control system application as a daemon launched by the OS on startup for maximal reliability.

For the embedded firmware, you'll need to get the software onto the microcontroller. Personally, I used a tigard. Connect up the tigard's pins from the cortex header to the PCB with the Vcc, Gnd, SWIO, SWCLK (reset pin not needed!). Make sure to set the tigard to SWD mode and VTG mode. Note: This assumes working with the hardware I designed here and the tigard.

As per tigard's instructions, you can compile OpenOCD and use it to program the hardware. I recommend flashing the Arduino Zero's bootloader here to make flashing easier.

Once the bootloader is installed and working, I double tap the reset button on the board and flash the firmware over USB using the build_and_upload.pl perl script. This script automates compiling the project, copying the binary, and flashing using the bossac tool which is the same one used by the arduino IDE. Depending on your port allocation, you might need to modify the script to flash to whichever port your device connected to.

Usage

This system is designed to run autonomously on its own so once you start it there is nothing left to do!

Roadmap

There are many features which I wish I had time to implement that I ran out of time and project scope to implement. Future development for this project will be concluded May 10th, 2024. Below are a list of ideas that I wanted to implement.

License

This project uses the GNU General Purpose License (GPL). Basically, do whatever you want but you must open source any derivative work!

Contact

My name is Christian Smith and you can contact me through my linked in here. As this was a senior design project which has now concluded, further work and support of this project will not continue.