在该公式中,第一项\(td_{offmax}-td_{onmin}\)为最大关断延迟时间和最小开通延迟时间之差。这一项主要描述
MOS
管器件结合所用的门极电阻的特性。由于上升和下降时间通常比延迟时间短很多,这里就不考虑它们。另一项\(tpdd_{max} -
tpdd_{min}\)为由驱动器决定的传输延迟时间之差(延迟时间不匹配)。该参数通常可在驱动器制造商提供的驱动器数据表中查找到。对于基于光耦合器的驱动器,该参数值通常很大。
/** * @brief Configure the ADC for the current sampling related to sector 1. * It means set the sampling point via TIMx_Ch4 value and polarity * ADC sequence length and channels. * And call the WriteTIMRegisters method. * @retval none */ uint16_tR3_2_SetADCSampPointSectX(void) { uint16_t sampling_point; uint16_t DeltaDuty;
/** * @brief It computes and return latest converted motor phase currents motor * @param pHdl: handler of the current instance of the PWM component * @retval Ia and Ib current in Curr_Components format */ voidR3_2_PhaseCurrentsUpdate(void) { int16_t i_a,i_b; int32_t aux; uint32_t adc_data_reg1, adc_data_reg2;
switch (sector) { case SECTOR_4: case SECTOR_5: /* Current on Phase C is not accessible */ /* Ia = phase_a_offset - ADC converted value) */ aux = (int32_t)(kMCLowLevelInstance.phase_a_offset) - (int32_t)(adc_data_reg1);
/* Saturation of Ia */ if (aux < -INT16_MAX) { i_a = -INT16_MAX; } elseif (aux > INT16_MAX) { i_a = INT16_MAX; } else { i_a = (int16_t)aux; }
case SECTOR_6: case SECTOR_1: /* Current on Phase A is not accessible */ /* Ib = phase_b_offset - ADC converted value) */ aux = (int32_t)(kMCLowLevelInstance.phase_b_offset) - (int32_t)(adc_data_reg1);
/* Ia = -Ic -Ib */ aux = (int32_t)(adc_data_reg2) - (int32_t)(kMCLowLevelInstance.phase_c_offset); /* -Ic */ aux -= (int32_t)i_b; /* Ia */
/* Saturation of Ia */ if (aux > INT16_MAX) { i_a = INT16_MAX; } elseif (aux < -INT16_MAX) { i_a = -INT16_MAX; } else { i_a = (int16_t)aux; } break;
case SECTOR_2: case SECTOR_3: /* Current on Phase B is not accessible */ /* Ia = phase_a_offset - ADC converted value) */ aux = (int32_t)(kMCLowLevelInstance.phase_a_offset) - (int32_t)(adc_data_reg1);
/* Saturation of Ia */ if (aux < -INT16_MAX) { i_a = -INT16_MAX; } elseif (aux > INT16_MAX) { i_a = INT16_MAX; } else { i_a = (int16_t)aux; }
/* Ib = -Ic -Ia */ aux = (int32_t)(adc_data_reg2) - (int32_t)(kMCLowLevelInstance.phase_c_offset); /* -Ic */ aux -= (int32_t)i_a; /* Ib */