A tool for calculating the optimal trace width to maximize magnetic moment for PCB magnetorquer coils with various copper weights. This tool helps design optimal PCB-based magnetorquer coils by considering various constraints like trace width, spacing, current density, and power limitations.
This repository contains two different versions of the magnetorquer optimization tool:
magnetorquer_optimization.py
- Command line version with basic functionalitymagnetorquer_optimize_with_graphics.py
- GUI version with interactive graphs
- Python 3.7+
- Required Python packages:
numpy scipy matplotlib
-
Clone this repository:
git clone https://github.com/yourusername/magtorque-optimization.git cd magtorque-optimization
-
Install required packages:
pip install numpy scipy matplotlib
Run the basic optimization script: (I recommend using the graphical onen as this one is outdated)
python magnetorquer_optimization.py
You'll be prompted to enter:
- Voltage supplied (V)
- Max power (W)
- Inner length (mm)
- Inner width (mm)
- Outer length (mm)
- Outer width (mm)
- Copper weight (oz) (USE 2.0 OZ)
- Number of layers (USE 6.0)
Run the graphical interface version:
python magnetorquer_optimize_with_graphics.py
This provides an interactive interface where you can:
- Adjust parameters in real-time
- View optimization graphs
- See immediate results of parameter changes
-
magnetorquer_optimization.py
(Command Line Version)- Most reliable version
- Provides basic functionality
- Gives consistent results
-
magnetorquer_optimize_with_graphics.py
(GUI Version)- Working visualization
- Includes real-time parameter updates
- Some unit conversion inconsistencies but functional
- All scripts assume uniform copper thickness
- Edge effects are not considered
- Thermal considerations are not included
- Magnetic field uniformity is not calculated
- Voltage:
- Power:
- Trace Width:
- Trace Spacing:
- Copper Weight:
- Number of Layers: Samwise - 6
Feel free to open issues or submit pull requests. Areas that need improvement:
- Thermal analysis
- Edge effect calculations
- Better handling of non-square geometries
- Manufacturing constraint validation
MIT License - See LICENSE file for details