This repository contains the source code for the firmware utilized in the Cubli project of a PhD Thesis.
It was developed with ARM Mbed OS open-source operating system targeting the STM32 NUCLEO-L432KC development board:
- 80MHz ARM®32-bit Cortex®M4
- 256 KB Flash
- 64 KB SRAM
For Cubli attitude estimation it utilizes the SparkFun 9Dof Sensor Stick inertial measurement unit (IMU) composed by the ST LSM9DS1 motion-sensing system-in-a-chip:
- 3D gyroscope (±245/±500/±2000 dps)
- 3D accelerometer (±2g/±4g/±8/±16 g)
- I2C serial bus (100 kHz and 400 kHz)
For reaction wheel estimation and control it utilizes the Maxon EC 45 flat motor together with the Maxon ESCON Module 50/5 controller:
- 24V/50W brushless motor with hall sensors
- 50V/5A/250W 4-quadrant PWM controller
All the remaining mechanical and electrical parts (aluminuim structure, PCBs, etc.) were tailor-made in Autodesk Fusion 360 and Autodesk Eagle and can be found in this other repository.
The source code is organized as follows:
./ | Root
main.cpp | Main source code (call one of the programs)
+ programs | Programs files
| + examples | Example programs
| + drivers | Driver example programs
| + modules | Modules example programs
+ src | Source files
| cubli.h | Include all header files
| + drivers | Drivers files
| hall.h/.cpp | Hall sensor class [header / source code]
| lsm9ds1.h/.cpp | IMU sensor class [header / source code]
| motor.h/.cpp | Motor controller class [header / source code]
| + modules | Modules files
| estimator_speed.h/.cpp | Speed estimator [header / source code]
| estimator_attitude.h/.cpp | Attitude estimator [header / source code]
| controller_attitute_wheel.h/.cpp | Attitude and wheel controller [header / source code]
| + utils | Utility files
| parameters.h | Parameters (physical constants, controller gains, etc.)
| pin_names.h | Pin names
+ mbed-os | ARM Mbed OS source files (automatically imported)
You can import this project directly to Mbed Studio or Mbed Online Compiler.
- Install and open Mbed Studio
- Click on
File
>Import Program...
- Paste
https://github.com/fbobrow/cubli-firmware/
underURL
and then clickAdd Program
- Open Mbed Online Compiler
- Click on
Import
>Click here
to import from URL - Paste
https://github.com/fbobrow/cubli-firmware/
underSource URL:
and then clickImport
You should choose the NUCLEO-L432KC
platform as Target
while builging the project or adapt it to your Mbed compatible board.