Engineer the attitude loop.
Reaction wheels exchange angular momentum with the spacecraft. Magnetic torquers interact with Earth's field to remove accumulated momentum without propellant.
Command a 45° slew and observe error decay. Target: error below 1° and rate below 0.1°/s.
Science, assumptions & controls
Body inertia 32 kg·m²; rotor inertia 0.035 kg·m²; motor torque limit 0.18 N·m; wheel limit 6,000 rpm. The fixed-step semi-implicit Euler integrator uses 0.05 s steps. The magnetic field is a simplified signed sinusoidal projection with a 93-minute period. Magnetic torque is mB; the controller compensates external torques until the wheel saturates. The rotor display is slowed for legibility; the telemetry reports physical speed. The Earth and spacecraft are illustrative, not to scale. Solar wings and antenna are visual hardware, not electrical subsystems.
Use the controller checkbox to free-drift; turn magnetic unloading off to see momentum accumulate. Adjust gains to compare response. Increase time speed to investigate saturation over orbital timescales.
Download scientific notes