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.

CCS/TMS320F28054F: Instaspin FOC Lab 1c: motor not spinning

Part Number: TMS320F28054F

Tool/software: Code Composer Studio

I successfully ran lab 1b and got my motor spinning at about 100 rpm. Now I'm trying to run lab 1c, and when I edit the variables “gMotorVars.SpeedRef_krpm”, “gMotorVars.IdSet_A” and “gMotorVars.IqSet_A”, nothing happens. When I change Iq_SetA I see IqRef_pu update, but there is no effect on the output to the motor.

I am using a custom board, so I had to make some changes in the ADC config. I've checked my ADC readings for current and voltage, these seem to accurate and setup correctly (ADC0 as I_A (buffer), ADC1-3 as I_A/B/C, ADC4-7 as V_A/B/C/bus).

I see the signal switching and PWM is working correctly, but the current does not change as I set these variables. What could I be missing? Thanks

  • Lab01b doesn't use the current sensing signals to spin the motor, but you need to verify the current sensing signals by running the lab01b. Lab01c needs the current sensing signals to spin the motor with the current close loop, so don't run the lab01c before you make sure the current sensing signals are good.

    1. Set correct parameters based on the hardware board in user.h.

    #define USER_IQ_FULL_SCALE_VOLTAGE_V           (24.0)

    #define USER_VOLTAGE_FILTER_POLE_Hz               (335.648)

    #define USER_ADC_FULL_SCALE_VOLTAGE_V       (66.32)

    #define USER_IQ_FULL_SCALE_CURRENT_A           (41.25)

    #define USER_ADC_FULL_SCALE_CURRENT_A       (82.5)

     

    2. Change the sign of the current coefficient in HAL_readAdcData() in hal.h, you may refer to chapter 5.2 (Hardware Prerequisites) of InstaSPIN-FOC and InstaSPIN-MOTION User's Guide (Rev. H) (http://www.ti.com/lit/ug/spruhj1h/spruhj1h.pdf) to have a detailed description of this.

     

    static inline void HAL_readAdcData(HAL_Handle handle,HAL_AdcData_t *pAdcData)

    {

       _iq current_sf = HAL_getCurrentScaleFactor(handle);

    }