Attitude Determination and Control Software for StudSat-2
Article Created on May 09, 2023
StudSat-2 [1] is a nano-satellite project developed under the initiative of Centre of Excellence for Space Research [2]. I worked as an intern and undergraduate research student with Attitude Determination and Control Systems (ADCS) team for nearly a year. During my time with the team, I worked on writing ADCS firmware for STM32F4-Discovery board [11]. I used FreeRTOS kernel to implement the firmware.
Attitude Determination Algorithm
The attitude determination algorithm used is a magnetometer-only attitude determination algorithm [3]. The algorithm comprises of three main computational blocks:
- Pre-Filter
- Intertial-Frame Vector Calculation
- Attitude Filter
Image 1: Block Diagram for Attitude Determination Algorithm — Notations: Bb - magnetic field vector in body frame, Bi - magnetic field vector in intertial frame, ω - angular velocity
The algorithm uses Kalman Filter and involves a lot of matrix multiplication. STM32F407 microcontroller based on ARM Cortex-M4 [4] has a floating point unit to accelerate computations involving floating point numbers. I used CMSIS DSP library [5] to optimize the matrix multiplications.
Firmware
As a part of the project, I interfaced Magnetometer [8] using USART interface, Gyroscope[9] using I2C interface, GPS using USART interface and Reaction Wheels [10] using PWM interface to the STM32F4-Discovery Board.
The firmware is implemented using FreeRTOS [6] as the kernel. The firmware consists of tasks outlined in the table below:
Task Name | Description |
---|---|
Bootup | Periodically informs C&DH microcontroller board that it is awake until C&DH acknowledges |
IPC | Acknowledges the message coming from C&DH board and takes necessary action according to the message received |
Gyro | Checks the angular velocity of the satellite either on request from C&DH or periodically |
Detumble | Detumbles the satellite |
AttDet | Determines the attitude of the satellite |
AttControl | Controls the attitude of the satellite |
I used Keil IDE for the development using Windows 7 host system. For visualizing the FreeRTOS objects, I used Precipio Tracealyzer [7]. Image 2: Snapshot from Tracealyzer
References
- [1] Wikipedia Page: StudSat-2
- [2] Website: Centre of Excellence for Space Research, Bangalore, India
- [3] Master Thesis: Magnetometer-only attitude determination with application to the M-SAT mission, Jason D. Searcy
- [4] ARM Cortex-M4 Processor Technical Reference Manual
- [5] CMSIS DSP Software Library
- [6] Website: FreeRTOS
- [7] Website: Precipio Tracealyzer
- [8] Datasheet: Smart Digital Magnetometer HMR2300
- [9] Datasheet: Integrated Triple-Axis Digital-Output Gyroscope
- [10] IEEE Paper: Design and development of 3-axis reaction wheel for STUDSAT-2
- [11] Website: STM32F4-Discovery Board