Introduction
This system is designed to accurately track the position and orientation of a high power rocket (levels L2 and L3) during its flight from launch to apogee. I'm not exactly sure what measurement range I'll need to capture the acceleration and angular velocity of the vast majority of L2 and L3 rockets without saturating but I think 100 g and 500 dps is a useful baseline. It may be useful to add a barometer to capture altitude and igniter input/output connectors to use motor launch controllers as a trigger for recording and then use an onboard driver to ignite the rocket motor.
Analysis
It's important to understand exactly what's required from the system before designing it so I'm going to calculate required accelerations and recording time.
- AIM-9X Sidewinder accelerates at 60 g1
- Sprint accelerated to 100 g
- Minimum diameter Blackhawk 38 (1.8 lb. / 0.82 kg) with Aerotech J435WS (max thrust 712.9 N) accelerates at ~88 g (assuming no drag)2
1 Found via Internet search, not verified
2 \( a = \dfrac{F_T - mg}{m} \), where a is acceleration, \(F_T\) is thrust, \(m\) is mass and \(g = 9.81 \, \text{m/s}^2\)
Microcontroller
I'm using the RP2350 with the following pinout.
| Pin | Type | GPIO | Description | Alternate Functions |
|---|---|---|---|---|
| A0 | Analog | GPIO41 | ADC1 | SPI1 CS, UART1 RX, I2C0 SCL, PWM8 B |
| A1 | Analog | GPIO42 | ADC2 | SPI1 SCK, I2C1 SDA, PWM9 A |
| A2 | Analog | GPIO43 | ADC3 | SPI1 MOSI, I2C1 SCL, PWM9 B |
| A3 | Analog | GPIO44 | ADC4 | SPI1 MISO, UART0 TX, I2C0 SDA, PWM10 A |
| A4 | Analog | GPIO45 | ADC5 | SPI1 CS, UART0 RX, I2C0 SCL, PWM10 B |
| A5 | Analog | GPIO46 | ADC6 | SPI1 SCK, I2C1 SDA, PWM11 A |
| SCL | Digital | GPIO21 | I2C0 Clock | SPI0 CS, UART1 RX, PWM2 B |
| SDA | Digital | GPIO20 | I2C0 Data | SPI0 MISO, UART1 TX, PWM2 A |
| D23 | Digital | GPIO23 | Digital I/O | SPI0 MOSI, I2C1 SCL, PWM3 A |
| D22 | Digital | GPIO22 | Digital I/O | SPI0 SCK, I2C1 SDA, PWM3 A |
| D11 | Digital | GPIO11 | Digital I/O | SPI1 MOSI, I2C1 SCL, PWM5 B |
| D10 | Digital | GPIO10 | Digital I/O | SPI1 SCK, I2C1 SDA, PWM5 A |
| D9 | Digital | GPIO9 | Digital I/O | SPI1 CS, UART1 RX, I2C0 SCL, PWM4 B |
| D8 | Digital | GPIO9 | Digital I/O | SPI1 MISO, UART1 TX, I2C0 SDA, PWM4 A |
| D7 | Digital | GPIO7 | Digital I/O | SPI0 MOSI, I2C1 SCL, PWM3 B |
| D6 | Digital | GPIO6 | Digital I/O | SPI0 SCK, I2C1 SDA, PWM3 A |
| D5 | Digital | GPIO5 | Digital I/O | SPI0 CS, UART1 RX, I2C0 SCL, PWM2 B |
| D4 | Digital | GPIO4 | Digital I/O | SPI0 MISO, UART1 TX, I2C0 SDA, PWM2 A |
| D3 | Digital | GPIO3 | Digital I/O | SPI0 MOSI, I2C1 SCL, PWM1 B |
| D2 | Digital | GPIO2 | Digital I/O | SPI0 SCK, I2C1 SDA, PWM1 A |
| TX | Digital | GPIO0 | UART0 TX | SPI0 MISO, I2C0 SDA, PWM0 A |
| RX | Digital | GPIO1 | UART0 RX | SPI0 CS, I2C0 SCL, PWM0 B |
| MISO | Digital | GPIO28 | SPI1 MISO | UART0 TX, I2C0 SDA, PWM6 A |
| SCK | Digital | GPIO30 | SPI1 SCK | I2C1 SDA, PWM7 A |
| MOSI | Digital | GPIO31 | SPI1 MOSI | I2C1 SCL, PWM7 B |
| SD_CARD_DETECT | MicroSD | GPIO40 | Card Detect | SPI1 MISO, UART1 TX, I2C0 SDA, PWM8 A |
| SD_CS | MicroSD | GPIO39 | Chip Select | SPI0 MOSI, I2C1 SCL, PWM11 B |
| SDIO_DATA2 | MicroSD | GPIO38 | SDIO Data 2 | SPI0 SCK, I2C1 SDA, PWM11 A |
| SDIO_DATA1 | MicroSD | GPIO37 | SDIO Data 1 | SPI0 CS, UART1 RX, I2C0 SCL, PWM10 B |
| SD_MISO | MicroSD | GPIO36 | SPI0 MISO | UART1 TX, I2C0 SDA, PWM10 A |
| SD_MOSI | MicroSD | GPIO35 | SPI0 MOSI | I2C1 SCL, PWM9 B |
| SD_SCK | MicroSD | GPIO34 | SPI0 SCK | I2C1 SDA, PWM9 A |
Sensors
LSM9DS1
| Component | I2C Address | ODR (Hz) | Measurement Range | FIFO Buffer |
|---|---|---|---|---|
| Accelerometer | 0x6B | 10, 50, 119, 238, 476, 952 | ±2 / ±4 / ±8 / ±16 g | 32 levels |
| Gyroscope | 0x6B | 14.9, 59.5, 119, 238, 476, 952 | ±245 / ±500 / ±2000 dps | 32 levels |
| Magnetometer | 0x1E | 0.625, 1.25, 2.5, 5, 10, 20, 40, 80 | ±4 / ±8 / ±12 / ±16 gauss | — |
| Temperature | 0x6B | — | — | — |
ADXL375
| Component | I2C Address | ODR (Hz) | Measurement Range | FIFO Buffer |
|---|---|---|---|---|
| Accelerometer | 0x53 | 0.1, 0.2, 0.39, 0.78, 1.56, 3.13, 6.25, 12.5, 25, 50, 100, 200, 400, 800, 1600, 3200 |
±200 g (fixed) | 32 levels |
Firmware
I'm using arduino-pico and a RP2350 microcontroller. Originally I wanted to use MicroPython or CircuitPython but MicroPython and CircuitPython don't have true multicore support. CircuitPython doesn't have multicore support at all and MicroPython hangs up when writing to microSD card while attempting to drain FIFO buffers. There are a few goals for the firmware which define success.
- Read LSM9DS1 accelerometer, gyroscope and magnetometer data at maximum ODRs
- Read ADXL375 accelerometer data at maximum ODR
- Log the data to a microSD card in parallel
- Don't miss any samples
- Accurately and precisely timestamp each sample