TIDUBE5A January 2022 – October 2022
The current through the motor is sampled by the microcontroller as part of the motor control algorithm during every one (Compressor) or three (Fan) PWM cycle. To measure bidirectional currents of the motor phase, that is, positive and negative currents, the circuits below require a reference voltage of 1.65-V. This offset reference voltage is created by a voltage follower as shown in Figure 2-31. This 1.65-V reference voltage is used to both fan and compressor motors phases current and PFC AC voltage feedback sensing circuit. In this revision hardware, compressor (Motor 1), Fan (Motor 2) and PFC have the offset reference separately, but these three sampling circuit can share the same offset reference in a design to save the cost.
Figure 2-32 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 3-phase PMSM of compressor and fan. The transfer function of this circuit is given by Equation 89.
Where Rshunt=0.01(OHM) and Voffset=1.65(V)
The calculated resistance values lead to the sensing circuit shown in Figure 2-35, the Gi is given by Equation 90.
The maximum peak to peak current measurable by the microcontroller is given by Equation 91.
which is the peak to peak value of ±18.59A. The following code snippet shows how this is defined for compressor motor in user_mtr1.h file:
//! \brief Defines the maximum current at the AD converter
#define USER_M1_ADC_FULL_SCALE_CURRENT_A (37.18f)
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;
Implementing the same calculation steps for Fan motor, and set the scale values in user_mtr2.h file.