Skip to content

eamars/OpenTrickler-RP2040-Controller

Repository files navigation

OpenTrickler RP2040 Controller

This repo is for the firmware that utilises the Raspberry Pi RP2040/RP2350 microcontroller to operate the OpenTrickler.

Join our discord server for help and development information.

Features

Supported Scales

Supported Scale Read Force Zero (Tare) Notes
A&D fx-i series (Std Format) ✔️ ✔️ Baud: 19200, Format: 8d,1s,np
Steinberg SBS ✔️ Baud: 9600, Format: 8d,1s,np
G&G JJ / JJB series ✔️ ✔️(Unreliable) Baud: 9600, Format: 8d,1s,np
U.S.Solid JFDBS ✔️ Baud: 9600, Format: 8d,1s,np
JM Science series ✔️ Baud: 9600, Format: 8d,1s,np
Creedmoor Sports series ✔️ Baud: 9600, Format: 8d,1s,np
Radwag R series ✔️ ✔️ Baud: 9600, Format: 8d,1s,np
Sartorius series ✔️ ❌ (Not supported yet, but doable) Baud: 9600, Format: 7d,1s,np
Generic Scale Driver ✔️ Depends

Supported Hardware

  • Mini 12864 Display Module (with rotary encoder, 3x Neopixel LED)

  • Dedicated Neopixel LED (up to 16 chains)

  • 2x Miniture Servo Motors (TowerPro SG/MG90S, or similar)

  • 2x TMC2209 (STEP/DIR with 1-line UART)

  • On-board EEPROM (up to 256 kbits)

Remote Connectivity

  • WiFi (2.4 Ghz only, AP or Station mode)

  • Web Interface

  • RESTFul Interface

  • mDNS Lookup

Operating Modes

  • Charge Mode

  • Cleanup Mode

Get Started

Use with mini 12864 display

  1. From the main menu, select "Start".

    12864_main_menu

  2. Provide the target charge weight in grain then press Next to continue.

    12864_select_charge_weight

  3. Remember to put pan on the scale.

    12864_waring_put_pan_on_scale

  4. Wait for scale to stable at 0. Or press the rotary button to force Re-zero.

    12864_wait_for_zero

  5. Wait for charge to reach the set point

    12864_wait for charge

  6. Once the charge set point is reached, remove the pan. The program shall restart from step 4.

    12864_wait_for_cup_removal

Pre-build firmware

Auto Build

You can download the pre-built firmware based on the latest release from above link. Similar to flashing other RP2040 firmware, you need to put the Pico W into the bootloader mode by pressing BOOTSEL button and plug in the micro-USB cable. Then you can copy the .uf2 file from the package to the pico. Shortly after the Pico W will be programmed automatically.

Build OpenTrickler firmware from source on Windows

Reference: https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf

Prerequistes

Git and VSCode are required to build the firmware. To install build dependencies, you will need to use: VSCode Raspberry Pi Pico extension and create an pico-example project (any project will trigger the download of pico-sdk, a collection of tools required to build the firmware locally). When creating the example project, select a Pico SDK version of v2.1.1 in the version dropdown.

Then you can verify the installation of pico-sdk by inspecting the path from C:\Users\<user name>\.pico-sdk. pico_sdk_path

Downloading Source Code

From PowerShell, execute below command to fetch the source code:

git clone https://github.com/eamars/OpenTrickler-RP2040-Controller

Next change to the cloned directory

cd OpenTrickler-RP2040-Controller

Next use git to initalise the required submodules

git submodule init

Now using git clone all submodules. It may take up to 5 minutes to clone all required submodules.

git submodule update --init --recursive

Configure CMake

Open the PowerShell, run the below script to load required environment variables:

.\configure_env.ps1

To build firmware for Pico W, from the same PowerShell session, run below command:

cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DPICO_BOARD=pico_w

To build firmware for Pico 2W, from the same PowerShell session, run below command:

cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DPICO_BOARD=pico2_w

Build Firmware

From the same workspace root directory, run the below command to build the firmware from source code into the build directory:

cmake --build build --config Debug

On success, you can find the app.uf2 from <workspace_root>/build/ directory.

Use VSCode

You need to call VScode from script to pre-configure environment variables. You can simply call

.\run_vscode.ps1

The VSCode cmake plugin is pre-configured to build for Pico 2W by default. You can change the build config to Pico W by modifying <workspace_root>.vscode/settings.json.

About

OpenTrickler controller application on RP2040 platform

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors