Firefly Mini - Compact, Cost Effective and High Performance Rocketry Flight Logger

by strathseds in Circuits > Electronics

67 Views, 0 Favorites, 0 Comments

Firefly Mini - Compact, Cost Effective and High Performance Rocketry Flight Logger

IMG_0321.JPG
strathseds.png
jlc.png
IMG_1230.JPG
IMG_1252.JPG

StrathSEDS is sponsored by JLCPCB and Altium

From $2 for 1-8 layer PCBS, visit jlcpcb.com/HAR to order now.

This year, StrathSEDS' entry to National Rocketry Championship (NRC) has brought the development of the rocket - Still Testing, the society's second entry to NRC. Still Testing has a miniscule inner diameter of 38mm, and our existing flight computers are much too wide to fit. Something new had to be developed, and so came the development of our newest and smallest flight computer - Firefly Mini. This is by far the most compact and complex board we have ever designed in the society.

The initial plans for Firefly Mini included significantly reduced capability, essentially boiling down to a GPS, MCU and payload electronics for as cheap as we could make it. We then found a JLCPCB deal for $2 6 layer PCB assembly. This included free via in pad, as well as other benefits. The draw back was that it had a maximum area of 50*50mm, to fit into the rocket this further restricted us to 50*30mm. Our new goal was to pack as many features as possible into such a tiny footprint, while staying within budget. To add to the challenge, we only had the money for a single revision. Whatever we designed would have to fly no matter what.

Supplies

The full bill of materials is attached here. All components apart from the GPS, Radio and SMA connector were sourced from JLCPCB, and basic where possible.

Design

There were a few requirements imposed for cost, such as using JLCPCB's standard assembly that restricted use to a single side. Others were for the competition like the need for a GPS and the payload expansion connector.


1. Fit within 50x50mm area set by the JLC discount

2. Fit comfortably within a 38mm inner diameter tube

3. Include a radio, GPS, IMU, Pressure sensor.

4. Support expansion boards for payloads.

5. Be as low cost as practicable with these features

6. Include mounting screw holes

7. All machine soldered components should be on the same side to reduce fees


A major trade-off here was in the choice of IC packages. BGA or LQFN are much more compact than LQFP, but any routing issues are much harder to fix. To mitigate this, a lot of development time was spent checking and double checking the design for each component.

Component Selection

exp_connector_comp.PNG
flash_comp.PNG
gps_comp.PNG
imu_comp.PNG
mcu_comp.PNG
pressure_comp.PNG
pwr_connector_comp.PNG
radio_comp.PNG

MCU

  • -STM3F412RGT6
  • 100MHz, 32bit Single Core Arm M4
  • 1Mbit Flash

Plenty fast for our needs, we've had good experience with the F412 line and good Rust support on the STM32.

GPS

  • Quectel L80-M39

Getting to near the end of its life. Good prior experience with it, liked the integrated patch antenna and was quite easy to source.

Radio

  • NiceRF LoRa-CC68 868MHz radio module

We have used these extensively to great effect. Excellent range even over built up areas and very reliable. We are also using edge mount SMA connectors for the antenna. These take up much less space than traditional through hole connectors.

IMU

  • Invensense ICM20948

A very price competitive 9 DoF IMU. Extremely compact as well, only draw back is that it works at 1.8V so required a level switcher and another power rail.

Pressure Sensor

  • Bosch BMP388

Cheap on JLCPCB. ±66cm relative altitude precision. Good enough for our purposes.

Storage

  • Winbond W25Q128JVSIQ

128Mb NOR storage. Very cheap on JLCPCB, but a slightly bulky package.

Power Connector

  • Wago 2060-452/998-404

Very compact screwless wire connector. Slightly fragile push tab.

Schematic Design

wireless.png
connectors.png
mcu.png
overview.png
power.png
sensors.png
storage.png

All circuits were created with reference to the component datasheets. Due to complexity, the design was split into subsheets.

Downloads

PCB Design

bottom_gnd_mask.png
bottom_mask.png
inner_sig_mask.png
power_mask.png
top_gnd_mask.png
top_mask.png
mini_progression.gif

Fitting this many components into such a small space required some very careful layout decisions. The use of 6 layers made routing significantly easier, and allowed separate power, ground and signal planes. This was particularly useful to ensure the correct operation of the GPS and radio.

Such a small area also brings signal integrity issues. Common mode noise could be a real issue, a large amount of decoupling capacitors were used, as well as stitching vias to combat this. Most datalines on the board are relatively low speed, with the MCU topping out at 100MHz so noise and trace lengths weren't particularly pressing issues. The highest speed traces were routed first, and kept to the same layer of the PCB.

The most sensitive components, the GPS and Radio were both placed on the rear of the PCB. As all other signals were routed on the top and inner layers, cross talk could be kept to a minimum and they could receive basically their own ground plane. The antenna was routed using controlled impedance tools in Altium Designer and the provided figures from JLCPCB. Shielding vias were used to further isolate against noise. The PCB uses the JLCPCB JLC06161H-3313 6 Layer controlled impedance stackup as it is offered at no extra cost.

Manufacturing

Costs.PNG

After the board was routed, it was time to order. The files were generated using an Altium Outjob, and uploaded to the JLCPCB.com website. The Cost breakdown is below. With the 6 layer discount, this gave a total of $127.64 (+shipping) for 5 PCBs to be manufactured and 2 to be assembled, for a price of $63.82 / assembled board. A significant cost here is the extended components fee. This added for components that are not on the pick and place machines, adding an extra $3 / extended component type. Added on to that are our hand soldered components, the radio is £3.64 from Aliexpress, the GPS was £12.70 from RS Components and the SMA connector was £3.19. This gives a total board cost of £70.35. While high, this is mainly due to only assembling two PCBs. If we ordered 5 this would come down to £43.20 total.

Rust Software Development

The firmware for Firefly Mini (and its predecessors) is entirely written in Rust, a new systems programming language with a focus on safety. Rust provides expressive, high-level language features whilst compiling to an optimized binary. We take advantage of these features with a performant, real-time, cooperative asynchronous scheduler (not an RTOS!) which we use to manage the vast suite of sensors with minimal overhead.

Rust's safety checks verify the memory-safety and soundness of the firmware at compile-time, allowing us to guarantee reliable, data-race free execution. The Rust's rich type system also prevents a large class of logic-errors, for example, typestate pins mean that pins must be necessarily set to the correct alternate function in order to be used for a specific purpose, and hardware failures must be handled.

However, the Rust embedded ecosystem is yet immature and we have encountered the edges of what's supported several times. This has led us to upstream a new QuadSPI driver to the HAL, author many, many fixes, and publish crates for previously unsupported peripherals

Testing and Integration

NRC AV 1.png
NRC AV 2.png
nrc_rokkit.png
nrc_rokkit_openguide.png

Mini is still in its testing stages, but we have managed to confirm the basic functionality of the major components including: GPS, radio, IMU, pressure sensor, LEDs, buzzer, flash storage and MCU. Coming soon will be long range radio tests, sensor fusion and payload board integration.

Firefly Mini is integrated into Still Testing's Avionics (AV) Bay as shown. A standard threaded bar design is used to support a 3D printed AV Sled. Along with Firefly Mini and power systems, an Altrus Metrum EasyMini is used in tandem for validation of Firefly Mini data after recovery. As Firefly Mini requires an antenna to transmit data during flight, the AV Sled required an interesting twist to facilitate both the antenna and EasyMini in the same area, reducing the overall AV Bay length.

The radio performance will require thorough testing, as there will be interference from other metal components nearby the antenna, such as the threaded rods or other PCBs. Our initial range test was very promising, transmitting packets 10km line of sight between two minis with omni-directional antennas at 22dBm.

Future Plans and Launches

Firefly Mini will launch aboard our rocket Just Testing at the National Rocketry Competition in June 2024. It will also be a backup tracker in the payload of our bigger launch in July on Strathosphere III at the Mach-24 competition.

After the summer we're looking to cram even more features into this form factor as we look towards creating a functional and reliable flight computer with pyro, and even more advanced sensors.

Launches will be live-streamed and plenty of pictures will be posted to our socials. You can find us at strathseds.org or @StrathSEDS on Instagram and Facebook. We open source all of our designs on our GitHub: StrathSEDS-on-GitHub. We also livestream our launches on Twitch, at StrathSEDS.