CubeSatDetumblingSimulator

CubeSat Detumbling Simulator

MIT license

When a satellite such as a CubeSat (a small 10 cm x 10 cm x 10 cm spacecraft) is released from its deployer, it tumbles about all axes and must be detumbled before mission operations can take place. Detumbling is the process of slowing the body angular rates of a satellite down until its attitude (angular orientation) is stabilized in orbit. After a satellite is detumbled, the on-board attitude determination and control system (ADCS) can use deterministic methods to acquire initial attitude measurements with respect to the inertial reference frame (the Earth-centered inertial (ECI) frame), and recursive methods to perform tasks like nadir-pointing and attitude maintenance. Written in MATLAB, this CubeSat Detumbling Simulator (originally developed for UCI CubeSat) allows the user to simulate the detumbling phase of a LEO CubeSat (with at least a 3-axis magnetorquer set, a magnetometer, and a gyroscope) using a B-dot controller and low pass filters (for sensor noise attenuation) in a closed-loop feedback process.

Requirements

Hardware

Software

Usage

Download and unzip the files. Open Main.m in MATLAB. In the “Main Parameters” section, initialize the program by assigning values to each of the parameters, making sure to stay within the allowable range for each parameter. Run Main.m.

If the simCalcltnMdfier parameter is set to ‘Real-Time’, a GUI window will pop up and will update in real-time as the simulation progresses. While the real-time simulation is running, calculation can be paused/continued by toggling the pause/play button under the simulation progress bar.

cubesat_detumbling_simulator_gui

If the simCalcltnMdfier parameter is set to ‘Pre-Calculate’, the program will run the simulation without real-time updates to the GUI. After the pre-calculations finish, the GUI window will appear showing the final output. Pre-calculation is significantly faster and potentially a bit more accurate as sampling periods are pre-determined and MATLAB’s clock and etime functions are not needed for timing.

cubesat_detumbling_simulator_pre_calculation

Once the simulation finishes, a summary of run details will be outputted in the MATLAB Command Window. The code may be edited as desired for customized simulation outputs.

Tips

  1. The default orientation of the CubeSat looks something like the image below. The red/green reference frame is the CubeSat’s body frame and the white reference frame is the ECI frame. The initYawAngl_spcrft (about body Z), initPtchAngl_spcrft (about body Y), and initRollAngl_spcrft (about body X) parameters (in that order) define the intrinsic body frame rotation sequence that represents how the CubeSat will initially be oriented relative to the ECI frame when ejected from the deployer. Note that an intrinsic rotation defined by yaw-pitch-roll about body frame axes is the same as an extrinsic rotation defined by roll-pitch-yaw about inertial frame axes.

cubesat_detumbling_simulator_default_orientation

  1. The viewAzmth and viewElvtn parameters are passed into MATLAB’s view command in the code to set the “camera line of sight” for the orbit plot and the spacecraft plot. In other words, these parameters change the angle at which the user sees the ECI frame in these two plots.

Limitations

References

[1] Curtis, Howard D, Orbital Mechanics for Engineering Students, 3rd ed. Embry-Riddle Aeronautical University, Daytona Beach, Florida: Butterworth-Heinemann Elsevier Ltd., 2014.

[2] Montalvo, Carlos. “ADCS for LEO Satellites.” YouTube. https://www.youtube.com/playlist?list=PL_D7_GvGz-v3mDQ9iR-cfjXsQf4DeR1_H.

[3] Sanderson, Grant [3Blue1Brown] and Ben Eater. “Visualizing Quaternions: An explorable video series.” eater.net. https://eater.net/quaternions/.

[4] Armesto, Leopoldo. “Quaternions: Robotic Systems.” YouTube. https://www.youtube.com/watch?v=0FbDyWXemLw&t=309s.