Skip to content

[WIP] Hardware Upgrades #15

@gbalke

Description

@gbalke

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.

  1. Bootloader at 0x80000000
  2. Board ID (1 byte so tiny flash sector preferred)
  3. Motor calibration: arbitrarily sized protobuf that is currently under 1kB
  4. 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)
    • RAM: 196kB (though the ld file only uses the first 112kB)
    • FLASH: 1MB -> RM0090 Rev 19
      image
    • CLOCK: 168MHz
    • Package: 64LQFP (10x10mm)
  • 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).

Supply to 12V Buck Regulator

  • LM46000PWPR ($4.49 & current)
    • Vin_max: 60V
    • Vout: 12V
    • Iout: 500mA
  • RT6204GSP ($2.02)
    • Same as current specs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions