SPRUHJ1I January 2013 – October 2021 TMS320F2802-Q1 , TMS320F28026-Q1 , TMS320F28026F , TMS320F28027-Q1 , TMS320F28027F , TMS320F28027F-Q1 , TMS320F28052-Q1 , TMS320F28052F , TMS320F28052F-Q1 , TMS320F28052M , TMS320F28052M-Q1 , TMS320F28054-Q1 , TMS320F28054F , TMS320F28054F-Q1 , TMS320F28054M , TMS320F28054M-Q1 , TMS320F2806-Q1 , TMS320F28062-Q1 , TMS320F28062F , TMS320F28062F-Q1 , TMS320F28068F , TMS320F28068M , TMS320F28069-Q1 , TMS320F28069F , TMS320F28069F-Q1 , TMS320F28069M , TMS320F28069M-Q1
In order to measure bidirectional currents, that is, positive and negative currents, the circuits below require a reference voltage of 1.65 V. This voltage is generally not available in 3.3-V systems, but can be created very easily by a voltage follower. Figure 6-2 is a circuit example that generates a 1.65-V reference from a 3.3-V input, which is available in 3.3-V systems. For subsequent circuits connecting to 1.65 V, this circuit is assumed to be used.
Figure 6-3 shows a typical differential amplifier configuration for the current measurement.
The transfer function of this circuit is given by Equation 3.
In order to illustrate some values on this circuit, let's consider a motor with a maximum phase current defined to be 10 A. The maximum current to be measured by the microcontroller in this example is ±10 A with this circuit producing a maximum voltage of 1.65V (±1.65V) to support the 3.3 V ADC input range.
For the worst case of 10A, consider a 0.01-Ohm shunt resistor.
Now if we let the input resistance be 1.0 kOhm, we can calculate the feedback resistance based on the input resistance and the required ratio.
The calculated resistance values lead to the circuit shown in Figure 6-4, providing a voltage range of 0-3.3 V to represent a measured phase current of ±10 A.
As shown in this example, the maximum peak to peak current measurable by the microcontroller is 20 A, which is the peak to peak value of ±10 A. The following code snippet shows how this is defined in user.h:
//! \brief Defines the maximum current at the AD converter
#define USER_ADC_FULL_SCALE_CURRENT_A (20.0)
The slew rate of the OPAMP plays an important role in the current measurement quality. For more details, see Section 18.