Skip to content
Snippets Groups Projects
Name Last commit Last update
..
embedded
js
README.md

DEX Controller

I've decided to roll a standalone controller for DEX. I've made a little ad-hoc breadboard circuit to connect one stepper driver, one load cell amp, to an Adafruit Feather M4 - an arduino variant.

So, this should just be a short project - I mostly have the codes I need to run the thing in cuttlefish implementations, here will just be wrapping those up in a standalone system. I can also experiment with 'no handcuffs' programming models, not having to manage this all through various homebrew dataflow environments.

So, first task is getting the embedded code up to competency. Compexity will live in JS, so the embedded just needs to do two things:

  • step <int32 steps>
    • accelstepper's this count, replies when complete
    • microsteps are baked in: calculate transmission ratio as well?
  • read <uint32 averaging samples>
    • does read, replies with int32 (or whatever width is HX711) back, simple

Then, steps / mm land, zeroing, etc, will live in JS. As will load cell calibration, and plotting, etc. I can bottle each of those low level commands in JS promises, making 'running' the machine big async codes. This should be easy-ish, let's see.

Have this all together, now just need to re-calibrate the load cell and debug some loadcell-not-ready errors that the embedded code occasionally throws.

controller

Install

npm install express npm install ws npm install serialport npm install esm