Accurate satellite orientation is a prerequisite for a successful mission, therefore the Attitude Determination and Control System (ADCS) is one of the most important satellite systems. In this repo, the ADCS system software is presented, which enables the collection and processing of the orientation sensors data, attitude determination, actuator control and finally, control of the desired orientation.
Click on an image for a YouTube video.
IMPORTANT: Recommended OS for the development is the Ubuntu 21.10. If you don't have a machine with the Ubuntu 21.10, the easiest workaround is to install Ubuntu on a Virtual Machine (Link for a tutorial).
Make sure you install all required dependencies listed below with written versions (or higher). After you have all the requirements installed, then you can go to the building stage, and finally to the debugging stage.
To install all the dependencies on the Ubuntu 21.10, user can just follow the steps below. Steps below will install all the required tools and VSCode code editor with all the required extensions.
cd cubesat-adcs
make install_deps
(requires sudo privileges)git submodule update --init --recursive
make setup_cmake
(needed only once)make build
or simply make
code .
Run and Debug
and run Cortex Debug
debug configuration
make debug_gdb
target remote localhost:5000
make flash
and wait for completionmake clang_format
make cppcheck
STM32 Nucleo board for STM32L412 is configured by default to use internal clock. We had problems with the UART baudrate. When configured to 115200 bits/s we would have about 108000 bits/s. In order to configure Nucleo board to use external crystal (from the STM Link) we have unsoldered SB5 and SB7 solder bridges and soldered SB17 solder bridge. Doing that we have introduced a bug where initial pins PB7 and PB6 for UART did not work, they were in high state when transmitting. To fix the bug we have changed pinout to PA10 and PA9 for the UART1.
To use parser functionalities:
callbacks.hpp
and callbacks.cpp
files and also add function pointers to the m_callbacks
variable in parser.hpp
file.echo(some text)\n
. Be aware that every parser command, in order to be received, must end with the EOL ('\n') character.