SLAU948 October 2024 MSPM0G3507
FOC application converts the sampled currents through ADC into PU system based on the maximum current that can be sensed through the ADC. This depends on the CSA offset introduced from the amplifier. Typically for bipolar current sense measurement, full scale value of ADC 3.3V / 2 = 1.65V is given as offset. For applications where the current sensing is always unipolar, offset values are set less than 0.5V to use the maximum full scale ADC output for +ve current measurement and small margin is left for -ve current measurement.
FOC application requires this scaling to be specified for appropriate functionality. As the ADC 12-bit value is converted to PU value, if the offset is set as 0 : Then the scaling factor to be set as _IQ(1).
If the CSA offset in HW is set as 1.65V (3.3V / 2) for bipolar current sense measurement the scaling factor to be set as _IQ(2).
For any arbitrary offset values, the scaling values to be specified as
_IQ(3.3v/(3.3v - CSA_OFFSET in volts)). This value to be added as macro definition in the projectroot/modules/hal/gateDriverInterface/source/<driverSpecific>_focHalInterface.c.
For example : Refer to example project DRV8329 - where #define DRV8329_CURRENT_SF_IQ is specified as _IQ(1.42857142) for a CSA offset of 0.4125V.