Hello. I am currently facing an issue and would greatly appreciate your urgent advice.
I am working on a 1Shunt FOC implementation with a 100 kHz carrier frequency using the EVSPIN32G4 evaluation board.
My goal is to amplify the shunt voltage using the internal OPAMP1 of the STM32G431 in Standalone mode with external resistors, and then read this amplified voltage using ADC1 in Injected mode. However, it is not working as expected.
Current Situation:
- When the motor is not energized, I measured the physical output voltage of OPAMP1 and confirmed it is correct at approximately 1.65V.
- However, when OPAMP1 is routed internally to ADC1, the 12-bit (right-aligned) ADC value fluctuates around 4090 (approximately 3.3V).
Objective:
I need to correctly configure the system so that the ADC reading is around 2048 (the midpoint) when the current is 0A.
Could anyone please provide advice on how to resolve this? Thank you in advance.