Hello,
We are trying to implement gyro stabilization using the sFOC shield. The setup is as follows :
- sFOC shield version : 2.0.4
- Driver board : Nucleo-F446RE
- sFOC version : 2.3.2
- Controller mode : Torque mode in FOC current mode
- Current sensing : Low side current sensing
As seen below, the master reads gyro measurements and commands Iq setpoints to the driver using the I2C interface. We are using the Wire library for the I2C interface, which calls the command.run() after the bytes are read. The commanding of Iq setpoints on the I2C happens at 1 kHz, which triggers an I2C interrupt and then executes the handler.
We are toggling a GPIO on the Nucleo to verify that the interrupt hits. When we use inline current sensing, the I2C interrupt hits every 1ms as expected, but with the low side current sensing, the I2C interrupt hits initially a few times after which the I2C line becomes busy and hangs.
Since, loopFOC() takes around ~130us with inline current sensing, while it takes around 25us with low side current sensing, we tried to enforce a delay of 75us after loopFOC() executes, but that did not help.
Would appreciate any suggestions on this.
Thanks for the great work and all the support.