Skip to main content

A program for controlling a miniaturized additive friction stir deposition (AFSD) machine.

Project description

mini_afsd is a program for controlling a miniaturized additive friction stir deposition (AFSD) machine.

Introduction

This repository contains code for controlling a miniaturized AFSD machine and is used by the Yu group at Virginia Tech.

Communication with the machine is achieved using FluidNC, and future modifications to the firmware or code inputs can be helped by looking through FluidNC’s documentation.

Installation

Dependencies

Driver Dependencies

The LJM driver from LabJack must be installed to interface with the LabJack for measuring the thermocouple outputs, which can be downloaded from https://labjack.com/support/software/installers/ljm.

The driver needed for computers to properly connect to the serial port’s USB interface is available from https://oemdrivers.com/usb-cp2104-usb-to-uart-driver. (Change this in the future if the connector changes)

Python Dependencies

mini_afsd requires Python version 3.10 or later and the following Python libraries:

All of the required Python libraries should be automatically installed when installing mini_afsd using any of the installation methods below.

Installing Python

Python can be installed multiple ways:

Stable Release

mini_afsd can be installed from pypi using pip, by running the following command in the terminal:

pip install -U mini_afsd

Development Version

The sources for mini_afsd can be downloaded from the GitHub repo. To install the current version of mini_afsd from GitHub, run:

pip install https://github.com/RyTheGuy355/MiniAFSDCode/zipball/main

Optional Dependencies

While not needed, an Arduino IDE (available from https://www.arduino.cc/en/software) can be used when connected to the serial port of the mill to get more detailed feedback on the messages sent to and from the port.

Quick Start

For default usage, mini_afsd can be ran from the a terminal (the command line if Python was install universally, from an Anaconda terminal if Python was installed with Anaconda, or from the WinPython Command Prompt if Python was installed using WinPython) using:

python -m mini_afsd

To list out the various options when using mini_afsd from the terminal, simply do:

python -m mini_afsd -h

Alternatively, mini_afsd can be used from a Python file by doing the following:

from mini_afsd import Controller

Controller().run()

Configuring LabJack

For determining proper addresses to connections on the LabJack, use the Kipling software included with LJM to find the pin addresses within the “Register Matrix” section.

Sending Commands to FluidNC

Commands sent from the GUI to FluidNC for control of the mill can be split into 2 categories:

  1. G-Code (and subsequent M-Codes, etc.): These are prefixed by “G”, “M”, etc., and follow their standard usage. See http://wiki.fluidnc.com/en/features/supported_gcodes for the G-Codes supported by FluiNC.

  2. Codes to FluiNC or Grbl. These can include things liking homing (“$H”), status query (“?”), or soft reset (“0x18” == “CTRL+X”). When adding new commands under this category, it is recommended to add a comment as to what these commands are doing since it is not immediately clear and makes maintenance difficult. A full listing of commands can be found at http://wiki.fluidnc.com/en/features/commands_and_settings.

Log Files

While the program is running, it is set up to automatically log messages sent and received from the mill for later reference/debugging. In addition, if data collection was turned on and the data was not subsequently saved, the data is automatically saved in order to prevent losing data.

The folder where these logs and data files are saved can be found by running the following within a Python file:

from mini_afsd.controller import get_save_location

print(get_save_location())

On Windows, this folder location likely corresponds to the local AppData folder, ie. %localappdata%/mini_afsd.

License

mini_afsd is all rights reserved. For more information, refer to the license.

Author

  • Ryan Gottwald

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mini_afsd-1.3.0.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mini_afsd-1.3.0-py3-none-any.whl (28.9 kB view details)

Uploaded Python 3

File details

Details for the file mini_afsd-1.3.0.tar.gz.

File metadata

  • Download URL: mini_afsd-1.3.0.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for mini_afsd-1.3.0.tar.gz
Algorithm Hash digest
SHA256 7464deec30b5da75c40f1c6c0de85e3475c18607fe218e701df36a85ae491fed
MD5 a315892570ace16cfa8dbda26cdb93b7
BLAKE2b-256 c720755ee904eda6112cbd83149be1e4922949cb21acca8b5dd5c44382372a75

See more details on using hashes here.

File details

Details for the file mini_afsd-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: mini_afsd-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 28.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for mini_afsd-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56a44a273de07d6e538c492a261969b4fe4706a800f1b230914f65c3c2b0aa81
MD5 8ea223f096bc689b84a3b6905d1e1214
BLAKE2b-256 85a734d088a527ff24997e564674b4cfb3a98fe432c0f5a170a3a3ce8037c957

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page