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.

LAUNCHXL-F280049C: Instaspin Too High Current Problem in Motor Identification Step

Part Number: LAUNCHXL-F280049C
Other Parts Discussed in Thread: DRV8305

I'm doing Motor Control SDK intaspin FOC labs on by one. My controller is F280049C Launchpad and my driver is Boostxl-drv8305. I did first three lab work without problem. Third lab is is03_hardware_test and it runs open loop motor speed control and I have completed this lab without any problem. However, in fourth and fifth labs namely is_04 and is_05_motor_id, system producing too high current and driver is giving nFault signal. Therefore, I can't accomplish these labs and I can't identify the motor.

I have also used F28069M launchpad and drv8305 with same motor in the past with Instaspin and I did not get any problems. Also I adapted all the code for the drv8305 for F280049C, so ADC and PWM values seems correct.

I guess on is_05 lab, high current occurs in EST_STATE_ROVERL step. Maybe there is a problem for current controller. When I changed PWM frequency this behavior is changing. 20-25kHz pwm freq causing high current but when I increase this value to 45kHz, motor current being very low and motor is not spinning. Also estimator state is staying EST_STATE_ROVERL.

I have examined instaspin user guide but "6.9.2.5 Troubleshooting Current Controller Stability during RoverL Identification" section is empty

My motor parameters:

#elif (USER_MOTOR == My_A2212T13)
#define USER_MOTOR_TYPE                    MOTOR_TYPE_PM
#define USER_MOTOR_NUM_POLE_PAIRS          (6)
#define USER_MOTOR_Rr_Ohm                  (NULL)
#define USER_MOTOR_Rs_Ohm                  (0.102725)
#define USER_MOTOR_Ls_d_H                  (0.00001216)
#define USER_MOTOR_Ls_q_H                  (0.00001216)
#define USER_MOTOR_RATED_FLUX_VpHz         (NULL) 
#define USER_MOTOR_MAGNETIZING_CURRENT_A   (NULL)
#define USER_MOTOR_RES_EST_CURRENT_A       (1.0)
#define USER_MOTOR_IND_EST_CURRENT_A       (-1.0)
#define USER_MOTOR_MAX_CURRENT_A           (3.0)
#define USER_MOTOR_FLUX_EXC_FREQ_Hz        (20.0)

#define USER_MOTOR_RATED_SPEED_KRPM       (3.0)

#define USER_MOTOR_FREQ_MIN_HZ            (5.0)           // Hz
#define USER_MOTOR_FREQ_MAX_HZ            (300.0)         // Hz

#define USER_MOTOR_FREQ_LOW_HZ            (10.0)          // Hz
#define USER_MOTOR_FREQ_HIGH_HZ           (150.0)         // Hz

#define USER_MOTOR_VOLT_MIN_V             (0.1)
#define USER_MOTOR_VOLT_MAX_V             (12.5)

#define USER_MOTOR_NUM_ENC_SLOTS          (NULL)

  • Hi,

    Is it possible you have cross wired the current monitor ADC input channels? Taken from experience if that occurs it will cause excessive current overshoot and tripping various PWM zone monitors.

    BTW: Lab5 ~_d_H/_q_H, _Rs_Ohm values are to be NULL then we enter finding Only after successful motor ID run. State R/L will also allow very high phase current to trip fault if ADC current monitor inputs are crossed in software, easy to fix (hal.c/h) check TRM too. Supposedly Lab4 should reveal such condition but I would not count on it.

  • Thank you very much. Finally it worked thanks to you. As far as I understand, unfortunately there is a mistake in example code. Because adc sequence is not correct. This is original adc setup code (in my code, I changed only PGAs with normal ADC inputs):

        // ISENA - PGA5->A14->RA0
        ADC_setupSOC(obj->adcHandle[0], ADC_SOC_NUMBER0, ADC_TRIGGER_EPWM6_SOCA,
                     ADC_CH_ADCIN14, HAL_ADC_SAMPLE_WINDOW);
    
        // ISENB - PGA3->C7->RC0
        ADC_setupSOC(obj->adcHandle[2], ADC_SOC_NUMBER0, ADC_TRIGGER_EPWM6_SOCA,
                     ADC_CH_ADCIN7, HAL_ADC_SAMPLE_WINDOW);
    
        // ISENC - PGA1->B7->RB0
        ADC_setupSOC(obj->adcHandle[1], ADC_SOC_NUMBER0, ADC_TRIGGER_EPWM6_SOCA,
                     ADC_CH_ADCIN7, HAL_ADC_SAMPLE_WINDOW);

    Code comments A, B, C sequence must be opposite so this mistake effected to adc read operation code:

      // convert phase A current        ->RA0/A14
        value = (float32_t)ADC_readResult(obj->adcResult[0], ADC_SOC_NUMBER0);
        pADCData->I_A.value[0] = value * current_sf;
    
        // convert phase B current        ->RC0/C7
        value = (float32_t)ADC_readResult(obj->adcResult[2], ADC_SOC_NUMBER0);
        pADCData->I_A.value[1] = value * current_sf;
    
        // convert phase C current        ->RB0/B7
        value = (float32_t)ADC_readResult(obj->adcResult[1], ADC_SOC_NUMBER0);
        pADCData->I_A.value[2] = value * current_sf;

    adcResult[0] and adcResult[1] should be swapped.

  • Recall pulling hair from roots after PGA's were switched over to analog MUX inputs for external current sensors. I added note comments to the end of each one as to switch back at some time for drv8320rs booster pack. That ADC input issue effects the R/L current in a very bad way.

  •  // configure the interrupt sources
        // configure the sample window to 15 system clock cycle wide by assigning 14
        // to the ACQPS of ADCSOCxCTL Register.
        // RB2/B1
        ADC_setInterruptSource(obj->adcHandle[1], ADC_INT_NUMBER1, ADC_SOC_NUMBER2);
    
        // configure the SOCs for hvkit_rev1p1
        // ISENA - PGA5->A14->RA0
        ADC_setupSOC(obj->adcHandle[2], ADC_SOC_NUMBER0, ADC_TRIGGER_EPWM6_SOCA,
                     ADC_CH_ADCIN0, HAL_ADC_SAMPLE_WINDOW);
    
        // ISENB - PGA3->C7->RC0
        ADC_setupSOC(obj->adcHandle[0], ADC_SOC_NUMBER0, ADC_TRIGGER_EPWM6_SOCA,
                     ADC_CH_ADCIN5, HAL_ADC_SAMPLE_WINDOW);
    
        // ISENC - PGA1->B7->RB0
        ADC_setupSOC(obj->adcHandle[1], ADC_SOC_NUMBER0, ADC_TRIGGER_EPWM6_SOCA,
                     ADC_CH_ADCIN4, HAL_ADC_SAMPLE_WINDOW);
    
        // VSENA - A5->RA1
        ADC_setupSOC(obj->adcHandle[2], ADC_SOC_NUMBER1, ADC_TRIGGER_EPWM6_SOCA,
                     ADC_CH_ADCIN2, HAL_ADC_SAMPLE_WINDOW);
    
        // VSENB - B0->RB1
        ADC_setupSOC(obj->adcHandle[0], ADC_SOC_NUMBER1, ADC_TRIGGER_EPWM6_SOCA,
                     ADC_CH_ADCIN8, HAL_ADC_SAMPLE_WINDOW);
    
        // VSENC - C2->RC1
        ADC_setupSOC(obj->adcHandle[1], ADC_SOC_NUMBER1, ADC_TRIGGER_EPWM6_SOCA,
                    ADC_CH_ADCIN0, HAL_ADC_SAMPLE_WINDOW);
    
        // VSENVM - B1->RB2. hvkit board has capacitor on Vbus feedback, so
        // the sampling doesn't need to be very long to get an accurate value
        ADC_setupSOC(obj->adcHandle[1], ADC_SOC_NUMBER2, ADC_TRIGGER_EPWM6_SOCA,
                     ADC_CH_ADCIN2, HAL_ADC_SAMPLE_WINDOW);
        float32_t current_sf = -HAL_getCurrentScaleFactor(handle);
        float32_t voltage_sf = HAL_getVoltageScaleFactor(handle);
    
    #if (BOOST_to_LPD == BOOSTX_to_J1_J2)
      // convert phase A current        ->RA0/A14
        value = (float32_t)ADC_readResult(obj->adcResult[1], ADC_SOC_NUMBER0);
        pADCData->I_A.value[0] = value * current_sf;
    
        // convert phase B current        ->RC0/C7
        value = (float32_t)ADC_readResult(obj->adcResult[0], ADC_SOC_NUMBER0);
        pADCData->I_A.value[1] = value * current_sf;
    
        // convert phase C current        ->RB0/B7
        value = (float32_t)ADC_readResult(obj->adcResult[2], ADC_SOC_NUMBER0);
        pADCData->I_A.value[2] = value * current_sf;
    
        // convert phase A voltage        ->RA1/A5
        value = (float32_t)ADC_readResult(obj->adcResult[1], ADC_SOC_NUMBER1);
        pADCData->V_V.value[0] = value * voltage_sf;
    
        // convert phase B voltage        ->RB1/B0
        value = (float32_t)ADC_readResult(obj->adcResult[0], ADC_SOC_NUMBER1);
        pADCData->V_V.value[1] = value * voltage_sf;
    
        // convert phase C voltage        ->RC1/C2
        value = (float32_t)ADC_readResult(obj->adcResult[2], ADC_SOC_NUMBER1);
        pADCData->V_V.value[2] = value * voltage_sf;
    
        // convert dcBus voltage          ->RB2/B1
        value = (float32_t)ADC_readResult(obj->adcResult[1], ADC_SOC_NUMBER2);
        pADCData->dcBus_V = value * voltage_sf;
    #endif

    Hi, you're solution worked for me too. So I managed Lab04. But in Lab05 I have issues. I think the problem might be with the wrong ADC Input's for the Voltage Sensors. I'm playing around a little bit, but nothing seems to work. Sometimes the Rs calculation ist wrong and shows the smallest possible value and sometimes it is right. But when the programm goes in CONSTSPEED Mode the speedRef_Hz Expression jump to zero and nothing is happen anymore. I have one ADC setting for the Voltage Sensor, where the speedRef_Hz jump to 600 and the motor starts spinning really fast, but then stops.  For hopefully better understanding I insert my code.

    Sorry for the long text, maybe you can help me? I don't know what the problem can be.

  • Hi Jonas,

    There was a symbol name missing effecting correct state machine time counts, compiler did not error. So the R/L calculation was running oddly longer than required (fine tune times user.c). Sometimes state machine jumped over steps when watching CCS debug status. Ti may have fixed the missing symbol in later RDK versions.

    It may have been _INLINE was missing from predefined symbols, issue was posted in forum.