TIDUFE5 July 2025
The current through the motor is sampled by the microcontroller as part of the motor control algorithm during every PWM cycle. To measure bidirectional currents of the motor phase, that is, positive and negative currents, the circuits create a reference voltage of 1.65V. This offset reference voltage is created by a voltage follower with TLV9062. Figure 3-20 shows how the motor current is represented as a voltage signal, with filtering, amplification, and offset to the center of the ADC input range. This circuit is used for each phase of the three-phase motor. The transfer function of this circuit is given by Equation 47.
where
The calculated resistance values lead to the sensing circuit shown in Figure 3-21, Gi is given by Equation 48.
The maximum peak-to-peak current measurable by the microcontroller is given by Equation 49.
The resulting 16.5A is the peak-to-peak value of ±8.25A. The following code snippet shows how this is defined for the compressor motor in the user_mtr1.h file:
//! \brief Defines the maximum current at the AD converter
#define USER_M1_ADC_FULL_SCALE_CURRENT_A (16.5f)Correct polarity of the current feedback is also important so that the microcontroller has an accurate current measurement. In this hardware board configuration, the negative pin of the shunt resistor, which is connected to ground, is also connected to the non-inverting pin of the operational amplifier. The highlighted sign is required to be configured to have correct polarity for the current feedback in software as shown in the following code snippet in motor1_drive.c:
// define the sign of current feedback based on hardware board
adcData[MTR_1].current_sf = -userParams[MTR_1].current_sf;
Figure 3-20 Motor Current Sensing Circuit With Three-ShuntImplement the same calculation steps for a fan motor, and set the scale values in the user_mtr2.h file.