BGC Board I2C Trouble

Hey @Thor, welcome to SimpleFOC…

I don’t really know what to say… it sounds like you have figured things out, and are having a similar experience to me…
I played with the BGC boards for a bit initially, as I was looking for a small 2-motor driver… it seems like a really nice package.

But in my experiments I made two discoveries which eventually led me to move on to other boards:

  1. while it is possible to get FOC working on 2 motors on the Atmel chips, it is so near the limits of the board that there would be no more overhead for any kind of extra sensor code, comms, etc… this is both in terms of memory usage and performance. The performance of the board with 2x closed loop on I2C sensors is such that it can only just run gimbal motors.
  2. I2C in general is a bit slow for FOC - you won’t get much more than 1kHz loop iteration speed if the loop has to wait on I2C comms… while 1kHz is ok for gimbal motors, that also limits the performance.

If you want to stick with the BGC boards, it will be an optimization game - eliminating code you don’t need, getting rid of strings etc to conserve memory, and seeing what you can do to shave the execution time down. There is a minimal branch of the SimpleFOC code on GitHub which might be a better starting point.

If you want to switch to another board, STM makes a demo board for a 3-axis gimbal controller (around $80), or there are the Storm32 gimbal boards (around $25 - but they come with their own set of difficulties!)… or there are various drivers which can be used with different boards like the newer Arduino Nano33s, STM32 or ESP32 boards.