This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280025C: TMS320f280025 - ADC reading ISSUE

Part Number: TMS320F280025C

Dear Team

               We used TMS320F280025C - 48 PIN IC

While connected JTAG to our PCB, The code will be successfully downloaded. 

While debug the code the ADC value not gettting properly. 

We used the following settings in ADC

            1. Internal Ref 3.3V

            2. ADC clock 50MHz

We used motor control SDK project. We used driver ic as DRV8343.

The ADC values of current and voltage is not coming correctly. But the same code worked correctly in the LAUNCHPAD 280025C.

Thank you

Punitha . B

  • Please take a look at the Universal Project and Lab User’s Guide: https://www.ti.com/lit/spruj26. Follow the chapter 5.1 to change the device configuration codes in hal.c and hal.h files.

    If you haven't had a chance to look at the workshop material, I think this will help demystify some of the terminology and architecture, and learn about C2000 MCU to get started developing as well.

     

    C2000 Five Minute Overview

    C2000 Academy

  • Above issue was solved. We missed the ground connection to VrefLO pin. Now ADC value read correctly in the interrupt routine.  

    In the universal motor control project in voltage and current offset calibration calculation function,

    for(offsetCnt = 0; offsetCnt < 32000; offsetCnt++)
    {
                // 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
              {
                          // Offsets in phase current sensing
                        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;


                        #if defined(MOTOR1_FAST) || defined(MOTOR1_ISBLDC)
                                           invVdcbus = 1.0f / obj->adcData.VdcBus_V;

                                         // 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
                {
                            // enable the PWM
                            HAL_enablePWM(obj->halMtrHandle);                                     
                 }
    } // for()

    After this function the Current Offset values coming as 2035,2045,2009

    But Voltage Offset values is coming  1.033, 1.026, 1.036   instead of the values 0.5006,0.5002,0.498 .

    The corresponding ADC pin voltages remaining same as 0.5V.

    The voltage offset error will be occured.

    Dont know how to proceed further

    Kindly help to resolve the issue.

    Thanks 

    Punitha.B

  • Which build level? Please check if the sensing value of the dc bus voltage is correct, and the ADC result values of the dc bus voltage and phase voltages during the offset calibration.

  • Bulid level : DMC level 2

    Yes. The sensing value of the dc bus voltage is correct. The ADC result values of the dc bus voltage and phase voltages are same as 0.5V during the offset calibration

  • For DMC level 3 also Same problem occurred. But during offset calibration ADC values of DC bus voltage and Phase voltages are 0.5V.

  • But during offset calibration ADC values of DC bus voltage and Phase voltages are 0.5V.

    Please check if you add the right power supply to dc bus and the DRV device and configure the ADC correctly for voltage sensing.

  • But in the EVM board for the above code was executed correctly. Motor also runs properly.

    I think NO issue in power supply also. The voltages in the dc bus pin and adc pins were 0.5V always in our developed PCB. 

    But the code didn't work. 

  • I think NO issue in power supply also. The voltages in the dc bus pin and adc pins were 0.5V always in our developed PCB. 

    What do you mean this? Is the value changed if you adjust the dc bus voltage? Is the value of motorVars_M1.adcData.VdcBus_V close to the dc bus voltage?

  • Yes. While i changed to DC voltage then the corresponding motorVars_M1.adcData.VdcBus_V  value also changed. We used the following ADC channels for voltage and current measurement.

    We used Tms320F280025C 48 Pin IC

    1. DC voltage  =   A6/C6    Pin NO  4          CHANNEL   C6

    2. Vsen A     = A0/C15        Pin NO  11         CHANNEL   A0

    3. Vsen B   =  A3/C5          PIN NO  5           CHANNEL   A3

    4. Vsen C   =  A2/C9         PIN NO 6      CHANNEL   C9

    5. ISEN A   = A15 /C7        PIN NO 7    CHANNEL   A15

    6. ISEN B = A11/C0           PIN NO 8   CHANNEL   C0

    7. ISEN C = A5/C2            PIN NO 9   CHANNEL   C2

    We changed the corresponding CMPSS configuration also.

    After the runoffset1 calibration function only the error will be occured.

    While i set to breakpoint in ADC read function, the values in the result register came according to the input voltage at the corresponding PINs.

    If i reduced the for-loop count value to 2050 instead of 32000 then the voltage offset error not occurred. 

  • It's not related to the setting count value.You can change the codes as below and run the lab in build level 1 to check if anything is wrong.

    if(offsetCnt >= 2000) // Ignore the first 2000 times
    {

    offsetCnt = 2000;

    The sening dc bus voltage or phase voltage could be not correct since the PWM or ADC doesn't work at this time in your project.