-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Given the age of the parts, I definitely believe the performance of the motor controller can be improved at a lower cost. I'm going to do a quick breakdown of current components and specs and update this issue with alternatives.
Based on current firmware size and bootloader size, I think it's possible to get away with a much smaller FLASH section.
text data bss dec hex filename
17589 1532 5288 24409 5f59 bazel-build/bin/bootloader/bootloader.elf
(recorder size == 2000)
text data bss dec hex filename
52413 1620 75180 129213 1f8bd bazel-build/bin/firmware/firmware.elf
(recorder size == 0)
text data bss dec hex filename
52397 1620 11180 65197 fead bazel-build/bin/firmware/firmware.elf
Note that bss is just static initialized RAM and does not count towards flash space.
Currently flash is broken into 4 sections so we need sectors to support the sizes necessary.
- Bootloader at 0x80000000
- Board ID (1 byte so tiny flash sector preferred)
- Motor calibration: arbitrarily sized protobuf that is currently under 1kB
- Firmware takes up the rest of flash
Microcontroller
It appears that pretty much all STM32s are at stock volume zero ._. Truly a sad day in the world of microcontrollers.
- STM32F405RGT6 ($15.84 & current)
- STM32G431CBT6 ($8.01)
- RAM: 32kB
- FLASH: 128kB (64 sectors @ 2kB flash sector size)
- Bootloader (~18kB): 9 sectors
- ID: 1 sector
- Calibration: 1 sector
- Firmware: 27 sectors
- Free: 26 sectors (52kB)
- CLOCK: 170MHz
- Package: 48LQFP (7x7mm)
- Benefits:
- Much cheaper & smaller
- Drawbacks:
- Much less flash/RAM to fiddle with
Accelerometer
Not strictly necessary. Was intended to be used for arm initialization. Part of me thinks this is reasonable to suggest as a DNP.
- IIS328DQTR ($5.85 & current)
- ODR: 25-500Hz
- Precision: 16-bit
- Range: +/-2g,4g,8g
- LIS2HH12TR ($1.87)
- ODR: 10-400Hz
- Precision: 16-bit
- Range: +/-2g,4g,8g
- Seems like a great alternative... Need to deep dirve the spec sheet as the price gap must mean something haha.
Motor Controller
Heart of the motor controller... I think switching this to a pure gate driver + discrete FETs would only increase the footprint (but would bump peak current immensely).
The arm runs on 48V and each motor can pull up to 2-3A. I haven't seen a lot of options for integrated solutions operating in these ranges so the current chip seems reasonable.
- DRV8312DDWR ($7.28 & current)
- Integrated FETs
- Vmax: 70V
- Imax: 3.5A/channel
- Ipeak: 6.5A
Encoder
Currently using a 14-bit encoder. Might be worth finding a low-cost 12-bit alternative for lower precision applications (even better if it's pin compatible).
- AS5047U-HTSM ($12.10 & current)
- 14-bit absolute encoder
- MA732GQ-Z ($6.70)
- 14-bit absolute encoder
Supply to 12V Buck Regulator
- LM46000PWPR ($4.49 & current)
- Vin_max: 60V
- Vout: 12V
- Iout: 500mA
- RT6204GSP ($2.02)
- Same as current specs
