5.9. Temperature measurement

Boards with a power stage temperature sensor (“bridge temperature”) are supported in MCAF with basic signal conditioning. This temperature sensor should be placed on or near the power transistors of the three-phase bridge.

The bridge temperature signal is available for general use (for example, validation of dynamic current limit parameters) and is also used to detect an overtemperature fault condition, which causes the state machine to enter the MCSM_FAULT state and disable the drive.

5.9.1. Filtering

To reduce the impact of noisy measurements, a low-pass filter is used to process the raw temperature measurements \(T_{\rm raw}\), as shown in Figure 5.118, into a temperature estimate \(\hat{T}\).

../_images/3652-temperature-filtering.svg

Figure 5.118 Block diagram of temperature filtering

This low-pass filter includes a slew-rate limit. As long as the output slew rate stays below a specified maximum rate of temperature change, the transfer function of the low-pass filter is \(\frac{1}{\tau s + 1}\), where \(\tau = 1/\alpha\) is the effective time constant of the filter, determined by gain \(\alpha\).

The slew rate limiter is present to reduce the impact of burst noise on the temperature measurements. An example of this is shown in Figure 5.119.

../_images/3652-temperature-filtering-simulation.png

Figure 5.119 Simulation of burst noise in temperature filtering

While the presence of noise spikes on the raw temperature reading is a red flag that should be investigated to identify circuit design or EMI management issues, the temperature filtering in MCAF is intended to take advantage of oversampling the output of temperature sensors.

5.9.2. Implementation notes

Temperature sensing was added in MCAF R7.

5.9.2.1. Implementation source code

Filtering of the temperature sensors is done in MCAF_ADCReadNonCritical(), located in the adc_compensation module.

5.9.2.2. Scaling

Temperature signals in MCAF are scaled at 0.01°C per count, for a range of −327.68°C to +327.67°C.

MCAF R7 supports only linear temperature sensors at this time.

5.9.2.3. Filtering parameters and state variables

MCAF filters the temperature sense signals in each current loop sampling period \(T_s\), typically 50 μs. The state variable for the estimated temperature \(\hat{T}\) is a 32-bit integer with the high 16 bits used as its output — in other words, 0.01°C per 65536 counts for the state variable itself. This permits filter time constants as long as \(\tau = 65536 T_s\). (3.27 s for \(T_s =\) 50 μs)

Slew rates between 1 and 32767 counts per sampling period — 0.003°C/s to 100°C/s for \(T_s =\) 50 μs — are supported.

5.9.2.4. Board support

Both the dsPIC33CK Low Voltage Motor Control (LVMC) Development Board and MCS MCLV‑48V‑300W Development Board boards include an MCP9700 temperature sensor (10mV/°C, 0.5V offset) mounted among the power transistors.