Arduino based logic for OpenPPG Throttle Controller
For now the SP140 code lives in its own branch. We hope to get it integrated back into the main/master branch by having the compliler be device aware (eg. only load certain libraries/code if building for x4 or sp140).
It may not be stable and is not recommended for flying
For batch 4-6 controllers please see the batch-4 branch.
For batch 3 (non-telemetry) controllers please see the batch-3 branch.
For batch 2 (Arduino nano based) controllers please see the batch-2 branch.
OpenPPG supports flashing the firmware using the ArduinoIDE or PlatformIO (beta)
Suitable for Mac, Windows, and Linux
- Follow the instructions here for using with VSCode (recommended) https://platformio.org/install/ide?install=vscode
- Extract the downloaded code from the repo here (or git clone it)
- Open the folder using the PlatformIO "open project" option inside of VSCode
- Click the "PlatformIO Build" button inside of VSCode or enter
platformio run --target upload
in the command line. PlatformIO will automatically download libraries the first time it runs
Tested on macOS Catalina (10.15)
- Download the latest version for Mac OS or Windows https://www.arduino.cc/en/Main/Software
- Windows - Run the Arduino installer. Mac - Expand the zip and Copy the Arduino application. into the Applications folder
The Batch 3+ OpenPPG controller is powered by Atmel’s SAMD21G18A MCU, featuring a 32-bit ARM Cortex® M0+ core. In order to communicate with it follow the instructions here to set up your computer https://learn.adafruit.com/adafruit-feather-m0-basic-proto/setup and set up the Arduio IDE https://learn.adafruit.com/adafruit-feather-m0-basic-proto/using-with-arduino-ide
- Download the latest controller code zip from here
- Extract and open "eppg-controller.ino" in the Arduino IDE
- Open Library Manager (Sketch -> Include Library -> Manage Libraries)
- Install the following libraries by searching and installing the latest versions:
AceButton
Adafruit GFX Library
Adafruit_DRV2605
ArduinoJson
Adafruit_SSD1306
Adafruit SleepyDog
Adafruit_TinyUSB
ArduinoThread
extEEPROM
ResponsiveAnalogRead
Time
(search "Timekeeping")
- First make sure the code compiles by hitting the check button in the top right name "Verify"
- Connect the controller to your computer by using the micro USB port on the bottom of the controller
- Under the Tools menu select "Adafruit Feather M0" for the board and "TinyUSB" for the stack
- Select the proper port (Tools -> Port). It should show up as something like
COM5 (Arduino/Genuino Zero (Native USB port))
orFeather M0
or/dev/cu.usbmodem14201
- Click the right arrow in the top right named "Upload"
- Wait for the code to flash and the Arduino IDE to say "Done" at the bottom. Success!
The latest batches of OpenPPG X4 and SP140 controllers use the UF2 bootloader (compatible with Arduino). It makes firmware updates as simple as drag and drop. Learn more here https://github.com/openppg/uf2-samdx1
The uf2 bootloader can update firmware with a .uf2 binary file built from a complied .bin firmware file. The .bin file is automatically built when "verifying" the firmware in either Ardion IDE or PIO. Using the uf2-samdx repo above python tool the command to build a compatible .uf2 file should look something like:
$ python3 utils/uf2conv.py eppg-controller/.pio/build/OpenPPG\ CM0/firmware.bin -c -o sp140-update.uf2
The open source web based config tool for updating certain settings over USB (without needing to flash firmware) can be found at config.openppg.com.