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:

  1. Pre-Filter
  2. Intertial-Frame Vector Calculation
  3. Attitude Filter

Attitude Determination Algorithm Block Diagram 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]. Tracealyzer Snapshot Image 2: Snapshot from Tracealyzer

References