Open Source · MIT License

Neural control
for everything

Train autonomous agents in simulation. Export to C. Deploy on any microcontroller. No frameworks required.

BUILT FOR REAL-WORLD DEPLOYMENT

ARM Cortex
ESP32
STM32
Arduino

One framework.
Any robot.

Define your platform in YAML. TernaryPhysics handles the physics, training, and export.

Multirotor

Quad, hexa, octo — full 6-DOF physics with thrust modeling

IMU GPS

Fixed-Wing

UAVs and airplanes with lift/drag aerodynamics

Aero Pitot

Ground Rover

Differential drive with friction and terrain modeling

Encoders Lidar

Robot Arm

Multi-joint manipulators with forward kinematics

Joint EEF

Four steps to
autonomous control

1

Define

Describe your robot in a simple YAML config. Motors, sensors, physics — all declarative.

2

Train

PPO training with pure NumPy. No PyTorch needed. Define rewards, run episodes.

3

Export

Generate C header files. Float32, int8, or ternary weights — your choice.

4

Deploy

Flash to any MCU. ARM, ESP32, STM32 — if it has C, it runs TernaryPhysics.

From Python
to production

Write in Python, export to C. No runtime dependencies. No framework overhead. Just neural inference.

Pure NumPy training

No PyTorch, TensorFlow, or JAX required

C header export

Single .h file, no libraries to link

Online learning ready

Keep adapting after deployment

from ternaryphysics import SimExporter, PPOTrainer
from ternaryphysics.trainer import export_to_c_header

# Load your robot
env = SimExporter.from_yaml("drone.yaml")

# Create PPO trainer
trainer = PPOTrainer(
    state_size=12,
    action_size=4,
    hidden_size=64
)

# Train hover behavior
trainer.train(env, episodes=1000)

# Export to C header
export_to_c_header(
    trainer.policy, 
    "drone_policy.h"
)

Built for
real robots

Everything you need to ship autonomous systems

Online Learning

Keep learning after deployment. Incremental updates from real-world experience.

Safety Guards

Action bounds, rate limiting, and recovery behaviors. Protect your hardware.

Zero Dependencies

Pure NumPy for training. Pure C for inference. No runtime required.

Tiny Footprint

Sub-KB weights. Quantized to int8 or ternary. Fits in L1 cache.

Readable Code

Clean Python implementation. Easy to understand, modify, and extend.

Extensible

Add custom physics models, reward functions, and action spaces.

100%
NumPy
0
Dependencies
<1KB
Model Size
Platforms

Start building
autonomous systems

Open source. No vendor lock-in. Deploy anywhere.