This repository provides an implementation of the paper:
COMPAct: Computational Optimization and Automated Modular design of Planetary ActuatorsAman Singh, Deepak Kapa, Suryank Joshi, and Shishir Kolathaya
IEEE International Conference on Robotics and Automation, 2026
Video-Overview
- Step 1: Setup & Requirements
- Step 2: Installation
- Step 3: CAD Automation Setup
- Step 4: Run Optimization
- Step 5: View Results
- Step 6: Generate Automated CAD designs
- Step 7: 3D-print and Assemble
- Python 3.x
- SolidWorks 2024 (or higher) – Required for CAD automation features.
- Windows: Git Bash is highly recommended.
- Linux/macOS: Default terminal.
Clone the repository and install the dependencies:
# Clone the repository
git clone https://github.com/singhaman1750/COMPAct.git# Enter the directory
cd COMPAct# Install required packages
pip install numpy matplotlib pandas requestsDue to file size limits, CAD files are zipped. You must extract them before running the framework.
NOTE: If you only need the optimized gear parameters (teeth count, module, etc.), you can skip this step. Extraction is only required if you intend to use the automated 3D modeling.
- Navigate to the
CADsdirectory. - Inside each gearbox folder (e.g.,
CADs/SSPG/), unzip the archive (e.g.,sspg_actuator.zip) into the same directory.
Your directory structure should look like this after extraction:
COMPAct-Actuator_design_framework/
└── CADs/
├── SSPG/sspg_actuator/sspg_actuator/...
├── CPG/cpg_actuator/cpg_actuator/...
├── DSPG/dspg_actuator/dspg_actuator/...
└── WPG/wpg_actuator/wpg_actuator/...
If you prefer not to use SolidWorks, the CAD models are also available on Onshape. No extraction or local files needed.
To get your own editable copy:
- Open the link above — you will see the model in view-only mode
- Click the Onshape logo / menu icon in the top-left corner
- Select "Make a copy"
- Give it a name and save it to your own Onshape workspace
✅ Your copy is fully independent — any changes you make will not affect the original shared document. You can now edit the Variable Studio, modify geometry, and run the automation script against your own copy.
Run the Python script from the root directory to generate optimal gear parameters.
Syntax:
python actOpt.py <motor> <gearbox> <ratio><motor>: U8, U10, U12, MN8014, VT8020, MAD_M6C12<gearbox>: sspg, cpg, dspg, wpg<ratio>: Must be a value > 2.
Example: To optimize a T-motor U8 with a Single-Stage Planetary Gearbox and a ratio of 6.5:
python actOpt.py U8 sspg 6.5The script will output the optimal geometric parameters directly in the terminal:
Running optimization:
Motor : U8
Gearbox : sspg
Gear Ratio : 6.5
Time taken: 0.0196 sec
Optimization Completed.
-------------------------------
Optimal Parameters:
Number of teeth: Sun(Ns): 23 , Planet(Np): 52 , Ring(Nr): 127 , Module(m): 0.6 , NumPlanet(n_p): 3
---
Gear Ratio(GR): 6.52 : 1
-------------------------------
Detailed parameter files are automatically generated in the following locations:
- SSPG:
CADs/SSPG/sspg_equations.txt - CPG:
CADs/CPG/cpg_equations.txt - DSPG:
CADs/DSPG/dspg_equations.txt - WPG:
CADs/WPG/wpg_equations.txt
There are two ways to apply the optimization results to a CAD model — using SolidWorks (local) or Onshape (cloud-based). Both use the same equations file generated in Step 2.
NOTE: If you skipped the CAD extraction in Step 2, you cannot use this option.
- Open SolidWorks.
- Open the assembly file (
.SLDASM) for your specific gearbox type:- SSPG:
CADs/SSPG/sspg_actuator/sspg_actuator/sspg_actuator.SLDASM - (Paths for CPG, DSPG, and WPG follow the same folder pattern)
- SSPG:
- Click the Rebuild (Traffic Light) icon.
- The 3D model will automatically update to reflect the calculated parameters.
This extension lets you push optimization results directly to a parametric Onshape CAD model via the Onshape REST API — no SolidWorks or local CAD files required.
If you haven't already done so in the extraction step above, open the shared Onshape document and make your own copy:
- Click the Onshape logo / menu icon in the top-left corner
- Select "Make a copy"
- Give it a name and save it to your own Onshape workspace
✅ Your copy is fully independent — any changes the script makes will not affect the original shared document.
The script authenticates with the Onshape REST API using personal API keys.
- Go to dev-portal.onshape.com and sign in
- Navigate to API Keys → Create New API Key
- Copy the Access Key and Secret Key
- Create a file named
.envinside theOnshape_extension/folder with the following content:
ONSHAPE_ACCESS_KEY=your_access_key
ONSHAPE_SECRET_KEY=your_secret_key🔒 Never commit your
.envfile. Make sure.envis listed in your.gitignore.
The script needs to know which Onshape document and Variable Studio to update. This is done via the URL in your browser.
- Open your copied Onshape document
- Click on the Variable Studio tab at the bottom of the screen (it appears alongside part studios and assemblies)
- Once you are on the Variable Studio page, copy the full URL from your browser's address bar — it will look something like:
https://cad.onshape.com/documents/abc123.../w/def456.../e/ghi789... - Open
Onshape_extension/set_values.pyand paste the URL into theurlfield:doc = Document.from_url( url="https://cad.onshape.com/documents/<your-url-here>" )
💡 This URL encodes your document ID, workspace ID, and element ID — it is unique to your copy. Using the original shared link will fail as you do not have write access to it.
From the root of the repository:
cd Onshape_extension
python3 set_values.pyThe script will print the variable values before and after the update so you can confirm the changes were applied correctly:
=== BEFORE ===
{ ... current variable values ... }
=== SETTING VARIABLE ===
[POST] /api/variables/d/.../w/.../e/.../variables → 200
=== AFTER ===
{ ... updated variable values ... }
⚠️ A200status does not always mean the update succeeded — Onshape returns 200 even for malformed payloads. Always check theAFTERoutput to confirm your variables were updated as expected.
- 3D Printing: Export the updated plastic parts to
.STLformat. - Bearings: Check the updated CAD model to identify which standard bearings are required for your specific configuration.
This framework provides the following features:
-
Optimize planetary gearbox parameters for a given motor across the following gearbox types:
- Single Stage Planetary Gearbox (SSPG),
- Compound Planetary Gearbox (CPG),
- Wolfrom Planetary Gearbox (3K)(WPG), and
- Double Stage Planetary Gearbox (DSPG).
-
Perform multi-objective optimization to minimize actuator mass and axial width while maximizing efficiency.
-
Automatically generate parametric actuator CAD from optimization results, enabling direct 3D printing without manual redesign.
| Motor Code | Description |
|---|---|
| U8 | T-motor U8 |
| U10 | T-motor U10+ |
| U12 | T-motor U12 |
| MN8014 | T-motor MN8014 |
| VT8020 | Vector Techniques 8020 |
| MAD_M6C12 | MAD Components M6C12 |
| Type | Description |
|---|---|
| sspg | Single-Stage Planetary Gearbox |
| cpg | Compound Planetary Gearbox |
| wpg | Wolfrom Planetary Gearbox (3K) |
| dspg | Double-Stage Planetary Gearbox |
If you use this framework in your research, please cite:
@misc{singh2025compact,
title={COMPAct: Computational Optimization and Automated Modular design of Planetary Actuators},
author={Aman Singh and Deepak Kapa and Suryank Joshi and Shishir Kolathaya},
year={2025},
eprint={2510.07197},
archivePrefix={arXiv},
primaryClass={cs.RO},
url={https://arxiv.org/abs/2510.07197},
}