A MATLAB study of multilayer PCB magnetorquers for a PocketCube attitude determination and control system (ADCS). The scripts estimate coil properties, magnetic moment, torque and the time needed to rotate a small spacecraft under simplified assumptions.
A PocketCube with a 5 cm side has little room for attitude control hardware. This project explores placing square spiral coils within the outer solar panel PCBs, making use of the board area already available.
The coil model calculates the area of each turn using an odd-and-even sequence for the square spiral. This allows the magnetic moment to account for the changing area towards the centre of the coil.
Clone or download the repository, open its root folder in MATLAB and run:
mainADCSEdit the parameter block in mainADCS.m to compare coil geometry, PCB layers, supply voltage, temperature, spacecraft mass and magnetic field conditions.
The included example uses a 5 cm, 250 g spacecraft, seven coil layers and a 1.5 V supply. It compares the calculated rotation time against a 180-second target for a 180-degree turn.
flowchart TD
A["mainADCS.m: spacecraft and coil parameters"] --> B["obtainMagneticMoment.m: coil properties"]
B --> C["torque.m: torque and rotation time"]
C --> D["distance.m: distance travelled"]
B --> E["Command Window summary"]
C --> E
D --> E
| File | Role |
|---|---|
| obtainMagneticMoment.m | Estimates turns, conductor length, resistance, current, inductance and magnetic moment. |
| torque.m | Calculates moment of inertia, magnetic torque and rotation time. |
| distance.m | Converts rotation time into orbital travel distance and a corresponding distance at Earth's radius. |
The summary reports these values and whether the estimated rotation time meets the configured target.
The calculation uses a uniform cube moment of inertia, a fixed magnetic field and field angle, constant torque and rotation from rest. Coil resistance varies with temperature using a linear approximation.
The scope is an initial actuator feasibility estimate. Attitude sensing, feedback control, changing orbital magnetic fields and a braking manoeuvre are outside the model.
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported. Shared for educational and showcase purposes.