Skip to content

timschmidt/alumina

Repository files navigation

Alumina - a firmware and user interface for CNC and more

No license is granted to redistribute this work under any circumstance.

Todo:

  • read boot button as input and display status
  • parse self.url and use host portion to address microcontroller instead of hard coded uri
  • calculate gcd in ui and firmware planners
  • generate steps in stepper driver interrupt handler on micro
  • implement queue between planner and stepper driver interrupt handler
  • implement rate limiting in UI for geometry send
  • implement SD support in firmware
  • FAT / exFAT support for SD cards in firmware
  • browse SD over HTTP in firmware
  • UI for browsing SD in GUI
  • read and display ADC values from micro
  • read and display timer from micro
  • read http headers, especially accept-encoding and content-length and others.
  • integrate arcfinder
  • get 2D image viewer based on a bitmapped memory region working in GUI
  • get 3d viewer module based on kiss3d / miniquad working for CAD
  • implement ramp_maker in firmware from https://github.com/braun-embedded/ramp-maker/blob/main/examples/basic.rs
  • implement wifi AP mode, and configuration screens for connecting to other wifi
  • simplify and cargo-ize build system
  • rustwasm/wasm-bindgen#2000 WebXR bindings for WASM
  • implement ETag / if-none-match for wasm based on build ( https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#etagif-none-match )
  • enable https in firmware / UI with pinned cert, maybe still load UI via HTTP
  • implement relay board support
  • implement single axis board support
  • implement 4 axis board support
  • implement 4 axis c-6 board support
  • implement endstop support
  • store cryptographic key using wasm-cookies crate
  • implement mppt algorithm in firmware
  • implement topleveling algorithm in firmware
  • include charge curves for common chemistries
  • run flamegraphs on UI and firmware, and add to automated tests
  • implement tree control for CAD window
  • implement add / remove buttons for CAD tree control
  • integrate https://surrealdb.com/
  • integrate cavalier contours
  • develop datastructure to represent idealized microcontroller
  • send and receive Rusty Object Notation inside HTTP messages

Goals:

  • Easy setup
  • Networked and secure
  • Modular
  • High quality motion synchronization for steppers and three phase servo motors
  • Broad support for MCUs of different models and from different vendors
  • Zero memory errors (Buffer Overflow is the most common CVE for SCADA systems according to Industrial Control Systems Vulnerabilities Statistics)
  • Plasma, Laser, Router, Mill, Operator, Building support
  • Versioned interfaces with feature discovery

Status:

Initial implementation for GUI and MCU

Application:

  • High security and mission critical infrastructure automation
  • Internet connected automation

License(s):

MIT / BSD / Apache

Underlying concepts:

Development on Fedora 36 requires the following:

Dependencies

sudo dnf groupinstall "C Development Tools and Libraries" "Development Tools"
sudo dnf install patch uglifyjs zstd libudev-devel glib-devel gdk-pixbuf2-devel atk-devel cairo-devel pango-devel gtk3-devel
sudo ln -s /usr/lib/gcc/x86_64-redhat-linux/12/include/stdarg.h /usr/include/stdarg.h
sudo ln -s /usr/lib/gcc/x86_64-redhat-linux/12/include/stddef.h /usr/include/stdbdef.h
sudo ln -s /usr/lib/gcc/x86_64-redhat-linux/12/include/stdbool.h /usr/include/stdbool.h
cargo install cargo-flash
cargo install probe-run
cargo install flip-link
cargo install cargo-embed
rustup target install thumbv6m-none-eabi
rustup target install arm-unknown-linux-gnueabihf
rustup target install x86_64-pc-windows-gnu
rustup target install x86_64-apple-darwin
rustup default nightly

Building

Linux

scripts/build_demo_web.sh --release

Windows

cargo build --target x86_64-pc-windows-gnu --release

MacOS

follow osxcross setup here

Modules

Algorithms

Boolean difference, intersection, union

The genmesh crate provides primitives and CSG operations Boolean difference Boolean intersection Boolean union

Constructive Solid Geometry

CSG Tree

Components

Circuits

  • Full H bridge with high and low side driver control
  • current sensing
  • voltage sensing
  • isolation for GPIO, ADC, I2C, SPI, RS232/422/485, etc
  • buck / boost
  • PoE power supply (up to 48v, 100W - would be nice to push to non-standard 400W)
  • relay / SSR driver
  • ethernet to SPI adapter using w5500

Boards (PoE + positive locking terminal connector)

  • low, mid, high power three phase motor controller / inverter / vfd for open and closed loop w/ GPIO
  • low, mid power stepper controller for open and closed loop w/ GPIO
  • toolhead controller w/ serial / modbus, thc, capacitive sensing, accellerometer
  • torch / laser / vfd controller
  • dc-dc mppt power conditioner for solar panels up to 400W (MPPT PoE sender?)
  • 110/220v remote controlled receptical
  • multi-chemistry battery management system
  • remote sensors / actuators: NIR, temp / humidity, RFID, accellerometer, PIN pad, deadbolt, solenoid, liquid and gas flow, current, voltage,
  • camera, mic, audio output
  • PoE network motion controller

Axes

  • Actuator(s)
  • Sensor(s)
  • Coordinate space (cartesian, spherical, polar, hyperbolic, etc)
  • Relationship between actuator and movement in coordinate space in EMUs
  • Basic CAD representation built-in

Machines

  • Axes in coordinate space relationships to each other
  • control loops
  • communication
  • synchronization
  • consumables

Locations

  • Machines
  • Operators
  • Security, safety, and authorization
  • Coordination

Initial setup should be via Wifi / Bluetooth / QR Code lasered onto device

Host:

File inputs: 2D geometry in files formatted as:

File inputs: 3D geometry in files formatted as:

We may have to fix up the data:

For 3D toolpathing operations, this means we will need an idea of the shape of the working material:

Our toolpath must include lead-ins and lead-outs:

We may need to do trigonometric functions on fixed point numbers quickly:

We may need to turn shapes into triangles for the GPU:

We will translate the toolpath into commands for the MCU:

We need buffered (queued), and unbuffered (instantaneous) commands:

  • Buffered:
    • Most moves
  • Unbuffered:
    • Estop (both directions)
    • Jog (from pendant, to motors)
    • Torch Height Control

We will calculate the timer offsets from system time for each of our multiple microcontrollers so that we can accurately timestamp each command for execution:

And transport them to the MCU via an encrypted serial or network protocol:

MCU:

Firmwares:

Hardware support:

Embedded software implementations:

OTA Updates:

Bitbanging VGA:

Our MCU will need an events system (interrupt based, polling, etc):

  • Monitor temperature sensors, encoders, estops, and various other inputs
  • Register a configurable action to execute on event
  • Register a configurable time to trigger the event (optionally repeating)
  • Commands to configure all this
  • https://github.com/drogue-iot/ector

Our MCU will have to generate timed pulses for step/dir, PWM, I/O, etc:

We will sometimes have to speak other protocols to peripherals, necessitating commands and MCU facilities for doing so:

Web API:

Browser extensions:

Database:

  • https://surrealdb.com/
  • Machines
    • Machine ID
    • Machine type
    • Machine owner
    • Date of manufacture
    • Machine on hours
    • EMUs moved, each axis
  • Services
    • Time of service
    • Type of service
    • Tool serviced
  • People
    • First name
    • Last name
    • Shipping address
    • Billing address
  • Toolpaths

Resources:

General:

Testing:

P2P:

About

Rust firmware / UI for machine control

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published