TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS320F2800137: TMS320F2800137+独立的偏置电路控制BLDC偏移计算异常

Part Number:TMS320F2800137Other Parts Discussed in Thread:C2000WARE, , LAUNCHXL-F2800137

开发一款电调,MCU:TMS320F2800137,SDK:C:\ti\c2000\C2000Ware_MotorControl_SDK_4_02_01_00\solutions\universal_motorcontrol_lab\f280013x,问题如下:

1、根据开发文档,#define DMC_BUILDLEVEL  DMC_LEVEL_1,offset_v_sf偏移值应该在0.5上下,而我的自己的样板的值始终在0.14上下;

2、对比TI的官方LAUNCHXL-F2800137开发板+8353RX-EVM,offset_v_sf偏移值应该在0.5上下;

3、仔细分析代码,偏移计算在motor1_driver.c中runMotor1OffsetsCalculation()中做了如下30000次计算:
// clear the ADC interrupt flag
ADC_clearInterruptStatus(MTR1_ADC_INT_BASE, MTR1_ADC_INT_NUM);

while(ADC_getInterruptStatus(MTR1_ADC_INT_BASE, MTR1_ADC_INT_NUM) == false);

HAL_readMtr1ADCData(&obj->adcData);

if(offsetCnt >= 2000) // Ignore the first 2000 times
{
obj->OffsetCount = offsetCnt – 1999; //lzx add for counter offset calculation;
obj->offsetdebugData[0] = obj->adcData.offset_V_sf.value[0];
obj->offsetdebugData[1] = obj->adcData.offset_V_sf.value[1];
obj->offsetdebugData[2] = obj->adcData.offset_V_sf.value[2];
// Offsets in phase current sensing
#if defined(MOTOR1_ISBLDC)
obj->adcData.offset_Idc_ad = offsetK1 * obj->adcData.offset_Idc_ad +
(obj->adcData.Idc1_A.value[0] + obj->adcData.Idc1_A.value[1]) * 0.5f * offsetK2;
#elif defined(MOTOR1_DCLINKSS)
obj->adcData.offset_Idc_ad = offsetK1 * obj->adcData.offset_Idc_ad +
0.25f * offsetK2 *(obj->adcData.Idc1_A.value[0] +
obj->adcData.Idc1_A.value[1] +
obj->adcData.Idc2_A.value[0] +
obj->adcData.Idc2_A.value[1]);
#else // !(MOTOR1_ISBLDC || MOTOR1_DCLINKSS)
obj->adcData.offset_I_ad.value[0] =
offsetK1 * obj->adcData.offset_I_ad.value[0] +
obj->adcData.I_A.value[0] * offsetK2;

obj->adcData.offset_I_ad.value[1] =
offsetK1 * obj->adcData.offset_I_ad.value[1] +
obj->adcData.I_A.value[1] * offsetK2;

obj->adcData.offset_I_ad.value[2] =
offsetK1 * obj->adcData.offset_I_ad.value[2] +
obj->adcData.I_A.value[2] * offsetK2;
#endif // !(MOTOR1_ISBLDC || MOTOR1_DCLINKSS)

#if defined(MOTOR1_FAST) || defined(MOTOR1_ISBLDC)
//obj->adcData.VdcBus_V = 0.0324213766f;
invVdcbus = 1.0f / obj->adcData.VdcBus_V;
//if(offsetCnt < 2100)
//printf("obj->adcData.offset_V_sf.value[0]:%f,obj->adcData.V_V.value[0]:%f\n",obj->adcData.offset_V_sf.value[0],obj->adcData.V_V.value[0]);
// Offsets in phase voltage sensing
obj->adcData.offset_V_sf.value[0] =
offsetK1 * obj->adcData.offset_V_sf.value[0] +
(invVdcbus * obj->adcData.V_V.value[0]) * offsetK2;

obj->adcData.offset_V_sf.value[1] =
offsetK1 * obj->adcData.offset_V_sf.value[1] +
(invVdcbus * obj->adcData.V_V.value[1]) * offsetK2;

obj->adcData.offset_V_sf.value[2] =
offsetK1 * obj->adcData.offset_V_sf.value[2] +
(invVdcbus * obj->adcData.V_V.value[2]) * offsetK2;
#endif // MOTOR1_FAST || MOTOR1_ISBLDC
}
else if(offsetCnt <= 1000)
{
// enable the PWM
HAL_enablePWM(obj->halMtrHandle);
}

实际参与计算的参数有offsetK1 ,offsetK2,adcData.V_V.value,invVdcbus ,为什么我的板子就算出来的参数越来越小,30000次计算后再0.14上下?

请贵司帮忙分析我的板子电压偏移计算为什么越来越小,而TI的官方LAUNCHXL-F2800137开发板+8353RX-EVM计算值始终保持在0.5上下?

偏移值计算主要和哪些参数有关?

Ben Qin:

你好,如果软件是一样的话,那么应该是硬件上的问腿。

,

liang zuxing:

我们经过进一步排查,我们的Vref是外接3.3V电压的,将其断开改为芯片内部的基准电压与 demo板一致(VERFHI和VERFLO接2.2uF电容)同时将Vm、Vu、Vv和Vw分压系数改为与demo一致,Vm电压检测正常,但是Vu/Vv/Vw检测值与使用万用表实际测试不一致,接近于万用表测试值的二分之一!!!!(demo板Vu/Vv/Vw检测值与使用万用表实际测试基本一致),按道理外部电压检测只是做了分压并没有复杂的电路。(实际测试时,新板卡和demo板卡在MCU输入引脚处的电压都是0.3V左右,其分压系数一样,但是新板卡软件工具读出来的电压始终是万用表测试值的二分之一!)

我们与demo板的区别:

1、我们使用了TMS320F2800137PT  48pin的器件,demo使用TMS320F2800137PM 64pin的器件

2、因两个型号的器件管脚分布不一致,故我们的Vu/Vv/Vw分压后送给MCU的引脚与demo板的引脚不一致,但MCU输入引脚处的电压都是0.3V

请帮助分析一下呢,debug工具显示的U/V/W检测值为什么与万用表实测值不一致?有没有更好的思路?请指教,谢谢

,

Ben Qin:

你好,您查看过user guide了吗?

https://www.ti.com/lit/ug/spruj26/spruj26.pdf?ts=1705399002484

同时,查看下下面这篇帖子看是否有帮助:

e2e.ti.com/…/3933543

,

liang zuxing:

我们仔细看了一下,感觉问题还是没有解决。我们的新板卡时没有搭配8353使用的,我们的MCU 137直接外挂了SOIC-8封装的驱动芯片。在运行过程中offset_v_sf不是理想的0.5,而是0.22左右,但是demo(64pin PM)是0.5左右。电压检测这一块应该与是否使用8353无关,因为都是分压后直接进MCU的。

条件:#define DMC_BUILDLEVEL  DMC_LEVEL_1,直流供电电压:BAT=24V,MCU输出高低侧脉冲50%占空比,使用万用表测试Vu/Vv/Vw=12V,debug显示motorVar_M1.offsetdebugData (x)[0]/[1]/[2]值在12V附近,符合预期,而offset_v_sf=0.22左右,不是我们所期望的0.5!!!

如果我们强制将V_V.value[0]/[1]/[2]设置为固定值12.0f时,则offset_v_sf=0.5左右,这是为什么?另外前面也说了,我们使用的MCU是48pin的PT,而demo是64pin的pm,引脚功能两者不完全一致。请教一下在demo板软件基础上如何修改使其motorVar_M1.offsetdebugData (x)[0]/[1]/[2]符合预期值,同时offset_v_sf在理想值0.5左右。谢谢

另外 Vm/Vu/Vv/Vw的分压电路如下:

,

Ben Qin:

我咨询下相关的资深工程师后回复您。

,

Ben Qin:

您是否为 8353RX-EVM 板添加了正确的直流电源支持?将 8353RX-EVM 连接到 LaunchPad,如下所示或实验室用户指南中所示,例如 LaunchPad 上使能引脚、SPI 引脚的开关?

您可以查看下面的链接。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1270449/launchxl-f2800137-spi-between-launchxl-f2800137-and-drv8353rs-evm/4834260#4834260

,

liang zuxing:

感谢Ben Qin回复。根据TI guide提供的测试方法,LEVEL设置成1时电压采集对了,offset_v_sf接近0.5,V_V.value也在0附近。现在存在的问题是输出50%占空比PWM波电流采集值没有趋近0,请问该调整哪些参数呢?

,

liang zuxing:

我们的方案不使用用8353,使用外部的电流放大器采集的电流

,

liang zuxing:

经过反复测试,问题大概率是在电流引脚配置这里,麻烦Ben Qin抽出宝贵时间指点一下,万分感激。项目卡在这里很多天了。我们新板子电路设计如下:U项电流采集连接MCU的A12/C1V项电流采集连接MCU的A7/C3W项电流采集连接MCU的A8/C11

U项电压采集连接MCU的A15/C7V项电压采集连接MCU的A2/C9W项电压采集连接MCU的A3/C5总线电压采集连接MCU的A11/C0相关代码配置如下:// Three-shunt// ADC & CMPSS#define MTR1_ADC_TRIGGER_SOC ADC_TRIGGER_EPWM1_SOCA // EPWM1_SOCA#define MTR1_ADC_I_SAMPLEWINDOW 14#define MTR1_ADC_V_SAMPLEWINDOW 20#define MTR1_IU_ADC_BASE ADCC_BASE // ADCA-A12*/C1#define MTR1_IV_ADC_BASE ADCC_BASE // ADCC-A7/C3*#define MTR1_IW_ADC_BASE ADCC_BASE // ADCC-A8/C11*#define MTR1_IU_ADCRES_BASE ADCCRESULT_BASE // ADCA-A12*/C1#define MTR1_IV_ADCRES_BASE ADCCRESULT_BASE // ADCC-A7/C3*#define MTR1_IW_ADCRES_BASE ADCCRESULT_BASE // ADCC-A8/C11*#define MTR1_IU_ADC_CH_NUM ADC_CH_ADCIN1 // ADCA-A12*/C1#define MTR1_IV_ADC_CH_NUM ADC_CH_ADCIN3 // ADCA-A7/C3*#define MTR1_IW_ADC_CH_NUM ADC_CH_ADCIN11 // ADCC-A8/C11*#define MTR1_IU_ADC_SOC_NUM ADC_SOC_NUMBER1 // ADCA-A12*/C1-SOC1-PPB1#define MTR1_IV_ADC_SOC_NUM ADC_SOC_NUMBER1 // ADCC-A7/C3* -SOC1-PPB1#define MTR1_IW_ADC_SOC_NUM ADC_SOC_NUMBER2 // ADCC-A8/C11* -SOC2-PPB2#define MTR1_IU_ADC_PPB_NUM ADC_PPB_NUMBER1 // ADCA-A12*/C1-SOC1-PPB1#define MTR1_IV_ADC_PPB_NUM ADC_PPB_NUMBER1 // ADCC-A7/C3* -SOC1-PPB1#define MTR1_IW_ADC_PPB_NUM ADC_PPB_NUMBER2 // ADCC-A8/C11*- SOC2-PPB2// CMPSS – three shunt#define MTR1_CMPSS_U_BASE CMPSSLITE2_BASE//CMPSS1_BASE#define MTR1_CMPSS_V_BASE CMPSSLITE4_BASE//CMPSSLITE3_BASE#define MTR1_CMPSS_W_BASE CMPSSLITE2_BASE//CMPSS1_BASE#define MTR1_IU_CMPHP_SEL ASYSCTL_CMPHPMUX_SELECT_2 // CMPSSLITE2-A12*/C1 CMP2_HP1#define MTR1_IU_CMPLP_SEL ASYSCTL_CMPLPMUX_SELECT_2 // CMPSSLITE2-A12*/C1, N/A#define MTR1_IV_CMPHP_SEL ASYSCTL_CMPHPMUX_SELECT_4 // CMPSSLITE4-A7/C3* CMP4_HP1#define MTR1_IV_CMPLP_SEL ASYSCTL_CMPLPMUX_SELECT_4 // CMPSSLITE4-A7/C3* CMP4_LP1#define MTR1_IW_CMPHP_SEL ASYSCTL_CMPHPMUX_SELECT_2 // MPSSLITE2-A8/C11*, N/A#define MTR1_IW_CMPLP_SEL ASYSCTL_CMPLPMUX_SELECT_2 // MPSSLITE2-A8/C11* CMP2_LP4#define MTR1_IU_CMPHP_MUX 1 // CMPSSLITE2-A12*/C1#define MTR1_IU_CMPLP_MUX 1 // CMPSSLITE2-A12*/C1#define MTR1_IV_CMPHP_MUX 1 // CMPSSLITE4-A7/C3*#define MTR1_IV_CMPLP_MUX 1 // CMPSSLITE4-A7/C3*#define MTR1_IW_CMPHP_MUX 4 // CMPSSLITE2-A8/C11*#define MTR1_IW_CMPLP_MUX 4 // CMPSSLITE2-A8/C11*// XBAR-EPWM#define MTR1_IU_XBAR_EPWM_MUX XBAR_EPWM_MUX02_CMPSS2_CTRIPH//XBAR_EPWM_MUX00_CMPSS1_CTRIPH // CMPSSLITE2-HP1#define MTR1_IV_XBAR_EPWM_MUX XBAR_EPWM_MUX06_CMPSS4_CTRIPH_OR_L//XBAR_EPWM_MUX04_CMPSS3_CTRIPH_OR_L // CMPSS4-HP1&LP1#define MTR1_IW_XBAR_EPWM_MUX XBAR_EPWM_MUX03_CMPSS2_CTRIPL//XBAR_EPWM_MUX01_CMPSS1_CTRIPL //CMPSSLITE2-LP4#define MTR1_IU_XBAR_MUX XBAR_MUX00 // CMPSS2-HP1#define MTR1_IV_XBAR_MUX XBAR_MUX04 // CMPSS4-HP1&LP1#define MTR1_IW_XBAR_MUX XBAR_MUX01 // CMPSS2-LP4#endif // !MOTOR1_DCLINKSS, Three-shunt// ADC – Voltage, Phase and dc-bus#define MTR1_VU_ADC_BASE ADCA_BASE // ADCA-A15*/C7#define MTR1_VV_ADC_BASE ADCC_BASE // ADCC-A2/C9*#define MTR1_VW_ADC_BASE ADCA_BASE // ADAC-A3*/C5//ADCA-A2/C9*#define MTR1_VDC_ADC_BASE ADCC_BASE // ADCC-A11/C0*//#define MTR1_POT_ADC_BASE ADCA_BASE // ADCA-A12*/C1#define MTR1_VU_ADCRES_BASE ADCARESULT_BASE // ADCA-A15*/C7#define MTR1_VV_ADCRES_BASE ADCCRESULT_BASE // ADCC-A2/C9*#define MTR1_VW_ADCRES_BASE ADCARESULT_BASE // ADCA-A3*/C5#define MTR1_VDC_ADCRES_BASE ADCCRESULT_BASE // ADCC-A11/C0*//#define MTR1_POT_ADCRES_BASE ADCARESULT_BASE // ADCA-A12*/C1#define MTR1_VU_ADC_CH_NUM ADC_CH_ADCIN15 // ADCA-A15*/C7#define MTR1_VV_ADC_CH_NUM ADC_CH_ADCIN9 // ADCA-A2/C9*#define MTR1_VW_ADC_CH_NUM ADC_CH_ADCIN3 // ADCC-A3*/C5#define MTR1_VDC_ADC_CH_NUM ADC_CH_ADCIN0 // ADCCA11/C0*//#define MTR1_POT_ADC_CH_NUM ADC_CH_ADCIN12 // ADCA-A12*/C1#define MTR1_VU_ADC_SOC_NUM ADC_SOC_NUMBER4 // ADCA-A15*/C7 -SOC4#define MTR1_VV_ADC_SOC_NUM ADC_SOC_NUMBER5 // ADCA-A2/C9* -SOC5#define MTR1_VW_ADC_SOC_NUM ADC_SOC_NUMBER5 // ADCC-A3*/C5 -SOC5#define MTR1_VDC_ADC_SOC_NUM ADC_SOC_NUMBER6 // ADCCA11/C0* -SOC6

,

Ben Qin:

我已向相关工程师跟进,一旦得到回复会立即回复您。

,

liang zuxing:

感谢Ben Qin回复,主要是SOC NUMBER,PPB NUMBER,比较器配置看的不太明白,完全不明白的是XBAR配置方法

#define MTR1_IU_XBAR_MUX   XBAR_MUX00 // CMPSS2-HP1#define MTR1_IV_XBAR_MUX   XBAR_MUX04 // CMPSS4-HP1&LP1#define MTR1_IW_XBAR_MUX  XBAR_MUX01 // CMPSS2-LP4

,

Ben Qin:

参考下工程师的回复:

Make sure that the PWM and ADC are configured correctly according to the hardware board you used. Check the PWM output and the voltage on the ADC input channel, and then check the related ADC result.

Please take a look at the Universal Project and Lab User’s Guide: https://www.ti.com/lit/spruj26, and follow the guide to change the hardware configuration for your own board.

,

liang zuxing:

我们就是根据上面链接的文档一步一步调试的,现在确认PWM正常,4路电压ADC采集正常,只有电流采集异常,红框里的值不符合文档的值,请帮忙看看电流采集三路配置问题出在哪里。感谢Ben Qin支持。

,

Ben Qin:

已向工程师跟进

,

Ben Qin:

运行build level 1 时,检查 ADC 输入通道上的电压是否为 ~1.65V。如果不是,请检查硬件板上的电流感应电路。如果是,请检查 ADC 配置代码。

,

liang zuxing:

电流检测ADC输入偏置电压在1.65V左右,当前硬件通道使用ADC-A6/ADC-C3/ADC-C11,offset_I_ad的几个值比较一致,但是执行程序后,过几秒钟就会出现startupfailed告警,请问内部配置主要问题在哪一部分?怎么修改?谢谢

,

Ben Qin:

参考下工程师的回复:

Please check your own hardware first as mentioned above. And take a look at chapter 3. Building Custom Board in the lab user's guide below. And then follow the guide to run build level 1 to 4 if there are no current and voltage sensing fault.

Universal Project and Lab User’s Guide: https://www.ti.com/lit/spruj26

,

liang zuxing:

以上问题都是在未连接电机的情况下出现的。

,

Ben Qin:

已跟进

,

Ben Qin:

参考下工程师的回复:Looks the offsets are correct. What are your questions now? Which build level are you working on?

You may disable all of the faults protection first except the over-current protection. Or change the fault protection parameters to avoid the faults if needed

,

liang zuxing:

当前level 1状态各种偏移值符合开发文档给的参考值,level 2时通过修改USER_M1_ADC_FULL_SCALE_CURRENT_A值电机可以转起来,但是转动异常,电机转动时示波器电流达到3A以上且剧烈抖动,对比将 8353RX-EVM +F2800137 LaunchPad,转动平稳且电流在1A一下。请问该从哪些方面查找原因?

,

liang zuxing:

电机转速设置60HZ,实际转速只有几个HZ,并且剧烈抖动

,

Ben Qin:

已跟进

,

Ben Qin:

liang zuxing 说:当前level 1状态各种偏移值符合开发文档给的参考值

你这里的各种偏移值是什么意思?它们有什么区别?

liang zuxing 说:请问该从哪些方面查找原因?

你自己的板子吗?您是否按照指南设置了硬件参数?

,

liang zuxing:

偏移值就是指按照开发文档的LEVEL设置成1时没有异常,电流偏移和电压偏移都满足开发文档。板子是我们自己做的,现在的问题是按照开发文档LEVEL设置成2验证开环控制,电机可以转动,但是转速参考值用默认的60HZ,实际转速只有几个HZ,而且剧烈抖动。请Ben Qin指点该从哪些地方入手或者说该调试哪些参数。

,

Ben Qin:

参考下工程师的回复:

As mentioned above. Set the right current and voltage scale values according to the hardware you have. And set the right v/f parameters as below in user_mtr1.h per the motor you used.

// the maximum/base rotation frequency of the motor (Hz)#define USER_MOTOR1_FREQ_MAX_Hz (600.0f) // Hz

// V/f Profile Parameters for open-loop in build level 2// the low frequency f_low of V/f profile, in Hz,// set to 10% of rated motor frequency#define USER_MOTOR1_FREQ_LOW_Hz (5.0f) // Hz

// the high frequency f_high of V/f profile, in Hz,// set to 100% of rated motor frequency#define USER_MOTOR1_FREQ_HIGH_Hz (400.0f) // Hz

// the minimum voltage V_min of V/f profile,// the value is suggested to set to 15% of rated motor voltage, in Volt.#define USER_MOTOR1_VOLT_MIN_V (1.0f) // Volt

// the maximum voltage, V_max of V/f profile,// the value is suggested to set to 100% of rated motor voltage, in Volt#define USER_MOTOR1_VOLT_MAX_V (24.0f) // Volt

You may try to search the question on E2E, looks there are a few threads have the similar issue as you have.

赞(0)
未经允许不得转载:TI中文支持网 » TMS320F2800137: TMS320F2800137+独立的偏置电路控制BLDC偏移计算异常
分享到: 更多 (0)

© 2024 TI中文支持网   网站地图 鲁ICP备2022002796号-1