Skip to content

h-brenne/thrust_vector_control

Repository files navigation

Related Repositories and Resources For Thrust Vectoring

Rotor and Rotorcraft CAD Design and Production Files: Fusion A360

Harmonic modulation motor driver firmware: h-brenne/moteus-vector-uav

Thrust Vectoring Rotor and Rotorcraft Simulation: h-brenne/coaxial_thrust_vector_uav_model

PX4 Autopilot Thrust Vectoring Rotor Control Allocation: h-brenne/PX4-thrust-vector-control

Thrust Vector Control

This repository contains a program for controlling the Moteus open-source motor driver to enable thrust vector control for aerial vehicles with just a single actuator. The program is designed to run on a Raspberry Pi with the Moteus Pi3Hat CAN adapter and custom moteus firmware h-brenne/moteus-vector-uav.

The repo consists of a cpp project, and python scripts to analyze data.

There are two main operation modes, calibration and the thrust vector controller. In calibration, a sequence of motor commands are sent. Using data from a 6-axis force/torque sensor, the relationship between motor commands and thrust vector can be made. The thrust vector controller takes thrust vector setpoints, and sends motor commands based on the relationships found from calibration. These thrust vector setpoints will typcially come from a flight controller.

Table of Contents

Building the cpp Project

Dependencies

Please refer to CMakeLists.txt.

With a raspbian-lite image, the following packages required manual install.

sudo apt-get install pip cmake pigpio
sudo pip3 install moteus-pi3hat

Building

To build the code, follow these steps:

  1. Clone the repository:
git clone https://github.com/h-brenne/thrust_vector_control.git
  1. Navigate to the repository directory:
cd thrust_vector_control
  1. Create a build directory and navigate to it:
mkdir build && cd build
  1. Run CMake to generate the build files:
cmake ..
  1. Build the program:
make

Usage

Calibration

⚠️ Warning: Assure that appropriate safety routines are followed! This includes among others

  • Having the rotor under test in a protected enclosure
  • Wearing PPE(glasses, ear protection)
  • Assuring the rotor is securely fastened and is not damaged

Configure

Configure the motor command sequence to be generated in src/main_calibration.cpp.

Running

After configuring and building the project, you can run the calibration by executing the generated binary file. Please ensure that your Moteus motor driver, Raspberry Pi, and test stand setup are properly connected and configured before running the calibration. The Moteus controller should be connected to the "JC1" CAN port on the Pi3Hat.

sudo ./build/main_calibration

Analyzing

To analyze the calibration, prepare recorded motor telemetry and force/torque measurements. If the force measurements are not synced, this must be performed manually. Use scripts/plot_single_datase.py to visualize force/torque measurements against motor telemetry with the generated sequences highlighted. Note the timeshift between this data. The force/torque csv file should be updated with a header element Force Time Offset = 0.0. Update this with the manual timeshift. Running scripts/plot_single_datase.py again should now show synchronized data.

Example results

Thrust Vector Control

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages