Commit ecdaf2f2 authored by Jake Read's avatar Jake Read
Browse files

add firmware guide, motor settings default for cooler z

parent 75218b55
......@@ -16,6 +16,37 @@ Circuits that run the machine can be found [in this folder](/clank-circuits), al
Each of the circuits you received should have Adafruit's Feather M4 bootloader onboard, meaning that you can build and flash firmware (if needed) using [platformio](https://platformio.org/) or (?) the Arduino IDE.
#### Install Platformio and VSCode
[Platformio](https://platformio.org/) is an extension that can work in [VSCode](https://code.visualstudio.com/) or in [Atom](https://atom.io/) though the latter is not as well supported. To build firmware, install VSCode and then use it's internal extensions-installer to install Platformio. The softwares are well documented and are cross platform, you should be able to figure out how to do this by following the links above.
#### Open and Build Firmware
From platformio, do `file > open folder ...` and open i.e. `<this repo>/firmware/osape-smoothieroll-drop-stepper/` - Platformio should recognize it's project metadata files in this folder. Give it a few moments to get itself sorted (VSCode and Atom are built on web technologies - they are sometimes loading / reloading big messy javascript dependencies / etc).
You should be able to do `platformio: build` from VSCode's little internal command line - in windows I can open that command line with `ctrl + shift + p` - I think VSCode calls it a 'command pallette' or something.
Build also works with `ctrl + alt + b`
In `src/main.cpp` for the stepper motor firmware, you'll find this little snippet:
```cpp
#define BUS_DROP 1 // Z: 1, YL: 2, X: 3, YR: 4
#define AXIS_PICK 2 // Z: 2, Y: 1, X: 0
#define AXIS_INVERT false // Z: false, YL: true, YR: false, X: false
#define SPU 3200.0F // always positive! Z: 3200, XY: 400
#define C_SCALE 0.1F // 0-1, floating: initial holding current to motor, 0-2.5A
#define TICKS_PER_PACKET 20.0F // always 20.0F
```
These are motor-specific settings. The selection above is for an updated Z motor with less current scaling than what was originally flashed in the kits (the C_SCALE value). You'll need to swap these around when you flash different motors.
#### Uploading Firmware
Once you can build, this should be easy! Inside each board we gave you is the [UF2 Bootloader](https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/uf2-bootloader-details) via Adafruit. This means that you can just plug the board of interest in via USB (don't plug two boards on the same network in to usb power at once!), and hit `platformio: upload` with your preferred build settings (those #defines above). This is also `ctrl + alt + u` in VSCode in windows.
You should see the build complete, and then an upload process involving looking for a port ... resetting it ... waiting for a new port ... and flashing. This can be slow (ish!) so be patient.
### Operation
The machine eats [gcode](https://www.reprap.org/wiki/G-code), an aweful and outdated format that we love to hate. If you want to build a different interface, the controller's internal entry point for motion commands will accept a position & rate data object.
......
......@@ -23,7 +23,7 @@ union chunk_float64 {
#define AXIS_PICK 2 // Z: 2, Y: 1, X: 0
#define AXIS_INVERT false // Z: false, YL: true, YR: false, X: false
#define SPU 3200.0F // always positive! Z: 3200, XY: 400
#define C_SCALE 0.2F // 0-1, floating: initial holding current to motor, 0-2.5A
#define C_SCALE 0.1F // 0-1, floating: initial holding current to motor, 0-2.5A
#define TICKS_PER_PACKET 20.0F // always 20.0F
void setup() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment