Skip to main content

Bhuvanesh Aerospace Controls

bhuvanesh is a small, dependency-free Python library for learning and prototyping drone flight-control loops. It provides a bounded PID controller, an X-frame quadrotor attitude mixer, and a deterministic roll-response simulator with CSV telemetry. Every demo identifies the project as Bhuvanesh Aerospace Controls.

This project is for simulation and bench testing. Do not connect it to a flying aircraft without adding sensor validation, arming and disarming logic, watchdogs, failsafes, calibrated units, and hardware-in-the-loop testing.

Install on Ubuntu

# Run these commands from the folder containing pyproject.toml.
cd /path/to/bhuvanesh-aerospace-controls
sudo apt update
sudo apt install -y python3 python3-venv python3-pip
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e '.[dev]'
python -m pytest

If Ubuntu reports that ensurepip is unavailable, install the venv package matching your Python minor version, then retry the venv command:

sudo apt install -y "python$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')-venv"
python3 -m venv .venv

Quick start

from bhuvanesh import Attitude, QuadrotorPID

controller = QuadrotorPID()
result = controller.update(
    target=Attitude(roll=5.0),
    measured=Attitude(roll=2.0),
    throttle=0.50,
    dt=0.01,
)
print(result.motors.as_tuple())

Run the included smoke demo:

python -m bhuvanesh.cli --roll 5 --throttle 0.5
# or, after installation:
bhuvanesh-demo --roll 5 --throttle 0.5

The PID output is bounded, integral windup is limited, and derivative action is based on measured motion to avoid a setpoint kick. Motor commands are normalized from 0 to 1.

Learn with the simulator

Run a 10-second roll step and print response metrics:

python -m bhuvanesh.simulation --target-roll 10 --seconds 10

Change the gains and add a constant wind disturbance:

python -m bhuvanesh.simulation --target-roll 10 --kp 0.12 --ki 0.02 --kd 0.04 --wind 3

Save telemetry for plotting in a spreadsheet or notebook:

python -m bhuvanesh.simulation --csv telemetry.csv

The simulator models rotational motion with three simple terms:

acceleration = (control × max_acceleration) + wind - (damping × roll_rate)
roll_rate    = roll_rate + acceleration × dt
roll         = roll + roll_rate × dt

At each timestep the PID sees the current roll, computes a correction, and the quadrotor mixer turns that correction into four normalized motor commands. This is an educational model, not a flight-certified physics engine.

Windows and macOS

The package is pure Python and uses the same commands on Windows and macOS.

Windows PowerShell:

py -m venv .venv
.venv\Scripts\Activate.ps1
py -m pip install bhuvanesh-aerospace-controls
py -m bhuvanesh --roll 5 --throttle 0.5

macOS Terminal:

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install bhuvanesh-aerospace-controls
python3 -m bhuvanesh --roll 5 --throttle 0.5

Metadata

Release files for bhuvanesh-aerospace-controls 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bhuvanesh-aerospace-controls 0.3.0
File Size Uploaded
bhuvanesh_aerospace_controls-0.3.0.tar.gz 10.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bhuvanesh-aerospace-controls 0.3.0
File Interpreter ABI Platform
bhuvanesh_aerospace_controls-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.8 kB

Release files / bhuvanesh_aerospace_controls-0.3.0.tar.gz

Download URL bhuvanesh_aerospace_controls-0.3.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7f1d88a1693498cdfd788172b08d2c2920c6d60b129d5f46743953e541631ea9
BLAKE2b-256 checksum
How to use checksums
0caf043ff53f7cec15884af838a7f2a5a09a99bda925290650eec92e3d4ac673
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / bhuvanesh_aerospace_controls-0.3.0-py3-none-any.whl

Download URL bhuvanesh_aerospace_controls-0.3.0-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f21f590f9596ab9baeabb9bcd0abe846d97b7787cd18ad113fd49cabce8b406
BLAKE2b-256 checksum
How to use checksums
01b3196b065bfb683384d7165c3f523f3f110e53b28d3c21ad4f6dc797615632
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

0.6.0

2 release files

0.5.0

2 release files

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page