Microcontroller#
Overview#
We currently use ESP32-microcontrollers for this project. These provide the necessary hardware (timers and two cores) and enough speed for most use-cases. We tested with ESP32-WROOM32 and ESP32 Firebeetle modules.
Firmware installation#
For installing the firmware on the ESP32 it is advised to use Visual Studio Code and the PlatformIO extension. This makes changing and uploading the firmware easier. The PlatformIO can be installed through the extension tab in VS code. In addition, the USB-driver for the ESP (CH210x) is needed.
Uploading of the firmware is done by switching in VS code to the firmware folder of the repository, then opening the PlatformIO tab and hitting upload. There are a few (more or less optional) settings to be made in the firmware. The options can be found in config.h
in the src
folder.
|
Tells the controller to write debug messages to serial. Default false. |
|
Define the baud-rate, i.e. the communication speed between controller and interfacing software. Default 921600. |
|
Default rate for the command rate (number of commands per second). Can be changed via serial. Default 10 |
|
Default steps per mm of the table. Can be changed via Serial. Default 10 |
|
Default movement speed of the table for positioning and centering. Default 50 |
|
Whether or not buttons are attached to the table. See hardware interface. |
|
Whether or not limit switches are attached to the table. See hardware interface. |
|
Whether or not to use inbuilt EEPROM to save position data. CURRENTLY SOMEWHAT UNTESTED! Only supported on some ESP32 models. |
|
Define digital PIN for the indicated functions (list can be found below). |
PIN function list (click to expand)
PIN_EN
: enablePIN_INVERT_EN
: inverted enablePIN_DIR
: directionPIN_INVERT_DIR
inverted directionPIN_STEP
: step (or pulse on some drivers)PIN_BTN_START
: Start buttonPIN_BTN_STOP
: Stop buttonPIN_BTN_PAUSE
: Pause buttonPIN_BTN_UP
: Button to move table in “up” directionPIN_BTN_DOWN
: Button to move table in “down” directionPIN_BTN_CENTER
: centering buttonPIN_BTN_LIMIT_MIN
: pin for “lower” limit switchPIN_BTN_LIMIT_MAX
: pin for “upper” limit switch
Note
Actual “up” and “down” directions, as well as the connection of the limit switches depends on the connection of the motor to the table and the exact motor wiring. The firmware is agnostic to the actual connection of the limit switches, but beware of directions for the buttons.