DzikuVx / DiyMotionController

Mozilla Public License 2.0
71 stars 8 forks source link

DiyMotionController

Presetation video

DIY Motion Controller is a gesture control controller that works with any drone or RC airplane. It acts as an OpenTX trainer slave connected to the OpenTX radio like a Radiomaster TX16S or any other with SBUS trainer input.

Drone or airplane should be capable of Position Hold and Altitude Hold. INAV or Ardupilot recommended.

DIY Motion Controller

More info

More info about the project can be found here:

Short manual for OpenTX, Radiomaster TX16S and INAV

OpenTX setup with SBUS Trainer input

  1. Configure OpenTX to use Serial Port 1 as a SBUS Trainer (System -> Hardware)
  2. Enable Trainer input for your model (Model -> Model Setup -> Trainer Mode Master/Serial)
  3. Configure one of the radio switches to enable Trainer Sticks (Model -> Special Functions)
  4. Connect DIY Motion Controller to Serial Port 1. Radio RX pin to ESP32 SERIAL1_TX pin (14 default)
  5. To enable gesture control, switch configured in point 3 has to be enabled!

PPM Trainer input

In case of radios that does not have user accessible serial port, PPM mode can be used.

To enable PPM output on pin 14, uncomment #define TRAINER_MODE_PPM and comment out #define TRAINER_MODE_SBUS

//#define TRAINER_MODE_SBUS
#define TRAINER_MODE_PPM

INAV Setup

INAV craft should be capable of performing Position Hold and Altitude Hold. Craft should be stationary when Motion Controller is enabled.

Motion Controller Setup

Power Up

  1. After powering up, controller should be stationary for gyro to calibrate. Calibration is done when OLED says Gyro: OK
  2. Joystick should be calibrated by moving the stick to top/down/left/right positions after each power up

Operations

  1. Gesture Control is activated after a long press (1s) of a trigger button. OLED will display HOT
  2. Enable OpenTX trainer mode with a switch
  3. Tilting DIY Motion Controller left and right will roll the craft left and right
  4. Tilting DIY Motion Controller forward and back will move the craft forward and back
  5. Throttle control is assigned to the thumb joystick UP/DOWN
  6. Yaw control is assigned to the thumb joystick LEFT/RIGHT
  7. Gesture YAW control is enabled only when THUMB trigger is pressed

Parts

STL for the controller available here. Print with PLA/PET-G/ABS. Design has integrated supports, print without adding supports in slicing software.

Wiring

ESP32 PIN Accessory PIN
0 MPU6050 SDA
23 MPU6050 SCL
4 Thumb trigger
15 Index finger trigger
13 Thumb joystick X Axis
33 Thumb joystick Y Axis
32 Thumb hoystick press button

Both Thumb and Index Finger Triggers should be wired to GND (ESP32 Pullups are enabled on those inputs)

Dependencies

To complile and flash ESP32, you will need the latest Arduino and Arduino ESP32 core

Following Arduino libraries are required:

DIY Motion Controller DIY Motion Controller