DiyMotionController
DiyMotionController copied to clipboard
DiyMotionController
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.
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
- Configure OpenTX to use Serial Port 1 as a SBUS Trainer (System -> Hardware)
- Enable Trainer input for your model (Model -> Model Setup -> Trainer Mode Master/Serial)
- Configure one of the radio switches to enable
Trainer Sticks
(Model -> Special Functions) - Connect DIY Motion Controller to Serial Port 1. Radio RX pin to ESP32
SERIAL1_TX
pin (14 default) - 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
- After powering up, controller should be stationary for gyro to calibrate. Calibration is done when OLED says
Gyro: OK
- Joystick should be calibrated by moving the stick to top/down/left/right positions after each power up
Operations
- Gesture Control is activated after a long press (1s) of a trigger button. OLED will display
HOT
- Enable OpenTX trainer mode with a switch
- Tilting DIY Motion Controller left and right will roll the craft left and right
- Tilting DIY Motion Controller forward and back will move the craft forward and back
- Throttle control is assigned to the thumb joystick UP/DOWN
- Yaw control is assigned to the thumb joystick LEFT/RIGHT
- Gesture YAW control is enabled only when THUMB trigger is pressed
Parts
- ESP32 LORA32 V2 - future wireless version will require 2 boards. Other ESP32 with OLED will do, but you will have to adjust pin mapping
- MPU6050 gyro board
- 10mm push button
- 7mm push button
- Analog joystick - current 3D printed model supports this kind of joystick. Future version might require different joystick
- AWG30 wires
- Optional 18650 holder - for future wireless version
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: