Hi all,
Over the past few months I have been developing with different FOC boards and different microcontrollers, the ones I have right now are ESP 32 WROOM 32s and Arduino R4 minima with SimpleFOCShield v3.2, SimpleFOC mini v1.0 and MKS dualfoc V3.2 (but this last one I never managed to get working because my ESP has different pin layout).
Now I have seen very inconsistent results when deploying code. If I connect my R4 minima with a single encoder it works, if I then connect my second encoder it will break FOC, if I then remove the second encoder and push code with the single encoder, FOC is still broken. While this is the exact same code that worked 2 minutes earlier.
If I then disconnect both USB and power and reconnect, FOC will work again.
Is this supposed to happen, and what is the correct way to deal with this? I thought I was going insane but I think stuff is breaking when the Arduino is rebooting while power is still connected to minifoc?
Any help is appreciated, I’m just trying to create a serial bridge that takes torque (/voltage) as input but having lots of FOC related issues unfortunately.
EDIT: if it matters; I am using “PreciseMagneticSensorAS5048A motor_sensor = PreciseMagneticSensorAS5048A(10);” from “#include “encoders/as5048a/PreciseMagneticSensorAS5048A.h”“