Constrained spacecraft attitude control using Semidefinite Programming (SDP) with quaternion dynamics. The controller tracks a desired orientation while respecting geometric keep-in/keep-out cones and actuator limits. Simulations are in MATLAB/Simulink; optimization is solved via MOSEK through YALMIP or CVX.
- Method: SDP (MOSEK via YALMIP or CVX)
- States: Unit quaternions (q), body rates (\omega)
- Constraints: Keep-in/keep-out cones, bounds on (|\omega|) and torque (u), terminal state
- Env: MATLAB & Simulink
- Rigid-body (Euler) rotational dynamics + quaternion kinematics
- Exact cone constraints via SDP
- Plots for boresight on sphere, constraint margins, attitude/rate histories
- Baseline PD vs. SDP-guided tracking comparison
- MATLAB R2021b+ and Simulink
- Modeling: YALMIP or CVX
- Solver: MOSEK (installed, licensed, on MATLAB path)
- Using CVX? Set
cvx_solver mosek.
- Using CVX? Set
- Open the repo in MATLAB and set the current folder to the repo root.
- Add paths: Home โ Set Path โ Add with Subfoldersโฆ โ select repo root โ Save.
- Configure a scenario: edit
Code/initialize_satellite_simulation.m(desired quaternion, torque/rate limits, cone angles). - Solve (SDP): run
initialize_satellite_simulation(callssolveSDPControl.m). Results are written toResults/<run_name>. - Plot: run
plot_SDPsim_results.m(orplot_SDP_sim_results.mlx) to save figures inResults/<run_name>. - (Optional) Simulink tracking: open
CubeSat_SDP_PD_Attitude.slx, select SDP reference (or baseline PD), and Run.- What Simulink does: a quaternion-PD feedback regulator compares measured attitude to the SDP reference, calculates the error caused by the model uncertainities, and tries to minimise it, by appling control torque.
MIT License
Made with โ and ๐ by Shavy Kashyap