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.

tms570ls3137 drv8301 clarke and adc interrupt

Other Parts Discussed in Thread: TMS570LS3137, MOTORWARE

I have DRV8301-LS31-KIT. I have TMS570LS3137 controller. I want to control my motor using Field Oriented Control. Also, I want to feedback from my quadrature encoder. In other words I want to control my motor with its sensor not sensorless control. To do this,  I am using, 

Motorware_1_00_03_03\sw\solutions\foc_encoder_speed\boards\drv8301kit_revD\hercules\tms570ls3137\projects 

In addition, I am using Code Composer Studio v5  so that I can import projetcs and control my motor with microcontroller. 

Q1) 

I have suprised about clarke transformation algorithm (clarkeHandle) in the code because it is different from theoretical equation which is below.

Ialfa=Ia
Ibeta=(Ia+2*Ib)/sqrt(3)

However in the program;

pOutVec->value[0] = pInVec->value[0] * alpha_sf;
pOutVec->value[1] = (pInVec->value[0] + (pInVec->value[1] * 2) ) * beta_sf;

alpha_sf=1.00 and beta_sf=1.00

I think that this beta_sf should be 1/sqrt(3) not 1.00. I couldn't understand why beta_sf value is 1.00?

Q2)    My motor currents are measured from low side sense resistor. To read correct motor current from sense resistor low 
side A and B leg switches should on. In other words I should read sense voltage by ADC when low side switches conduct. Whic 
part of the code is doing this interrupt?

 

Q3)  My motor rated current is 7.1 Amper. However in the code speed saturation is 0.71 A (speed control output is current reference). Where this 1/10 scale come from?

  • Hello denizdeniz,

    I am forwarding your questions to one of my associates with more experience with motor control so see if he can address your questions and provide guidance.
  • Hello denizdeniz,

    Please find the application note in the doc folder:

    C:\ti\Hercules\MotorWare\v1.0.3.03\sw\solutions\foc_encoder_speed\boards\drv8301kit_revD\hercules\tms570ls3137\projects\ccs5\project01\docs
  • Hi QJ Wang . Thanks for your quick answer however this document does not  include solution for my problems. I will be very appreciated if you help me more.

     

    Thanks and regards
    denizdeniz

  • Is there someone to help me?

  • Hello,

    Q1) You are correct. alpha_sf =1, and beta_sf=1/sqrt(3)

           The scale factors need to be set by call the function:

           CLARKE_setScaleFactors(CLARKE_Handle clarkeHandle,const _iq alpha_sf,const _iq beta_sf)

    Q2) The current is measured from low side sense resistor, and the ADC sampling is triggered by the PWM signals. The  trigger is designed in NHET RAM if NHET is used to generate PWM signals.

    The ADC ISRs are:

    adc1Group0Interrupt(void);

    adc1Group1Interrupt(void);

    adcGetData(adcREG1, adcGROUP1, obj->AdcResults1)

    DRV_get_adcData(DRV_Handle handle)

    --> are used to read ADC results  (in drv.h)

    Q3) PID_setGains(drv->pidSpdHandle, drv->velocityKp, (drv->velocityKi * T), (drv->velocityKd / T));

    PID_setMinMax(drv->pidSpdHandle, -0.71, 0.71);

        The min and max values are set to be -0.71 and 0.71. This values are mapped to your minimum and maximum current output values. They should be calibrated based on the specific application.