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.

TMS320F280049C: Can't get motor running with INSTAspin FOC identification on my own circuit board.

Part Number: TMS320F280049C
Other Parts Discussed in Thread: DRV8303, DRV8301

#define USER_MOTOR_TYPE_VER                 MOTOR_Type_Pm
#define USER_MOTOR_NUM_POLE_PAIRS_VER       (3)
#define USER_MOTOR_Rr_Ohm_VER                   (NULL)
#define USER_MOTOR_Rs_Ohm_VER                   (0.135367796)
#define USER_MOTOR_Ls_d_H_VER                 (0.000455653295)
#define USER_MOTOR_Ls_q_H_VER                 (0.000455653295)
#define USER_MOTOR_RATED_FLUX_VpHz_VER           (0.210337803)
#define USER_MOTOR_RES_EST_CURRENT_A_VER      (3.2)
#define USER_MOTOR_IND_EST_CURRENT_A_VER      (-2.0)
#define USER_MOTOR_MAX_CURRENT_A_VER          (16.0)
#define USER_MOTOR_FLUX_EST_FREQ_Hz_VER     (20)
#define USER_MOTOR_MAGNETIZING_CURRENT_A_VER  (NULL)
#define USER_MOTOR_FLUX_EXC_FREQ_Hz_VER       (5.0)
#define USER_MOTOR_FREQ_MAX_HZ_VER            (300.0)
#define USER_MOTOR_NUM_ENC_SLOTS_VER        (2500.0)

  // Update Control Register 1
  drvRegName = DRV8303_RegName_Control_1;
  drvDataNew = (DRV8303_PeakCurrent_0p25_A   | \
                DRV8303_Reset_Normal         | \
                DRV8303_PwmMode_Three_Inputs   | \
                DRV8303_OcMode_CurrentLimit  | \
                DRV8303_VdsLevel_0p730_V);
//                DRV8303_VdsLevel_0p403_V);
  DRV8303_writeSpi(handle,drvRegName,drvDataNew);

  // Update Control Register 2
  drvRegName = DRV8303_RegName_Control_2;
  drvDataNew = (DRV8303_OcTwMode_Both        | \
                DRV8303_ShuntAmpGain_10VpV   | \
                DRV8303_DcCalMode_Ch1_Load   | \
                DRV8303_DcCalMode_Ch2_Load   | \
                DRV8303_OcOffTimeMode_Normal);
  DRV8303_writeSpi(handle,drvRegName,drvDataNew);

Now, the motor can run with signal chain test which is based on is04_signal_chain_test. And we are using drv8303 to drive the motors.These parameters are given by the drv8301-evm with is05_motor_id.

  • And I want to know how to set these parameters.

        user_params[AXLE_TABLE_VERTICAL].BWc_rps                    = 2350;
        user_params[AXLE_TABLE_VERTICAL].BWdelta                    = (float_t) 10.0;
        user_params[AXLE_TABLE_VERTICAL].Kctrl_Wb_p_kgm2            = 4500.00049;

  • For your custom board firmware, did you add a HAL driver for the DRV8303? Or are you using the DRV8301 driver? For lab04, were you able to verify the feedback signals looked as intended using the datalogger or otherwise?

    Sean

  • I have added a HAL driver for the DRV8303 but I think it is as the same as the 8301 driver. I thought I had verified the feedback signals since I could drive the motor but failed to identify it.
    one of the differences between our board and drv8301-evm is that we connect SN output from 8301 to the noninverting pin
    of the operational amplifier. But I already used the scale factor with minus.
    current_sf = -HAL_getCurrentScaleFactor(handle);
  • If the motor ID lab doesn't run well, it typically means there is an issue with the feedback circuitry. You say you were able to run the motor, but it doesn't seem you obtained the corresponding graphs to confirm, correct?

    Sean
  • I have obtained the corresponding graphs according to the lab document.

    I think gMotorVars.Rs_Ohm = 0.876959562 is too high when I run the identification. It's just 0.13 when I run the identification with the EV board.

    And I also want to know how to set these three parameters.

        user_params[AXLE_TABLE_VERTICAL].BWc_rps = MATH_TWO_PI * (float_t) 40.0;
        user_params[AXLE_TABLE_VERTICAL].BWdelta = (float_t) 10.0;
        user_params[AXLE_TABLE_VERTICAL].Kctrl_Wb_p_kgm2 = (float_t) 3.0
                * user_params[AXLE_TABLE_VERTICAL].motor_numPolePairs * (float_t) (0.001)
                / (float_t) (2.0 * 0.000001);

  • When the motor is running, gMotorVars.Speed_Hz is wrong. And I also check the gEstOutputData, all data is wrong. I think that cause the identification failure. I'm confused about why the motor can run but the gEstOutputData is wrong. what can I do to solve it?
  • 1. You may check the USER_ADC_FULL_SCALE_VOLTAGE_V, USER_ADC_FULL_SCALE_VOLTAGE_V, and USER_VOLTAGE_FILTER_POLE_Hz if these three values are calculated correctly based on the h/w board.
    2. Set USER_MOTOR_RES_EST_CURRENT_A and USER_MOTOR_IND_EST_CURRENT_A to the right value according to the specification of the motor, 10%~20% rated current of the motor is recommended.
    3. You might use the default of BWc_rps and BWdelta, you just only to set a right Kctrl_Wb_p_kgm2 if you know the inertia and flux of the motor. If not, you may set these values as below. And these three values are for speed close loop that doesn't impact the motor identification.
    pUserParams->BWc_rps = MATH_TWO_PI * (float32_t)40.0;
    pUserParams->BWdelta = (float32_t)10.0;

    // 3.0 * pUserParams->motor_numPolePairs * 0.1 / (2.0 * 0.00001);
    pUserParams->Kctrl_Wb_p_kgm2 = (float32_t)3.0 *
    pUserParams->motor_numPolePairs *
    (float32_t)(0.001) /
    (float32_t)(2.0 * 0.000001);
  • 1.we set these three values correctly.
    2.we set the current correctly.
    3.we use the default of BWc_rps and BWdelta.

    The motor makes big noise during the identification and it cannot run. gMotorVars.RoverL_rps = 31415.9277, gMotorVars.Rs_Ohm = 599.619385. I think these results are abnormal.
  • 1. You have to use lab03 and lab04 to check the signal chain of your board if you think the scale current and voltage, and filter pole frequency are set correctly based on your own board. Please be noted, the voltage can't be verified automatic, you need to check if the sensing voltage viewed in graph toll is the same
    2. Make sure the sign is correct for reading current in HAL_readADCDataWithOffsets(), and the gain is configured properly as you want for DRV device. If not, the USER_ADC_FULL_SCALE_CURRENT_A will not match the setting value in user.h.
    3. Please use a current probe to check if the current is the value you set USER_MOTOR_RES_EST_CURRENT_A during the Rs identification, that will help you to check if the gain and USER_ADC_FULL_SCALE_CURRENT_A are right.
    4. Please make sure the PWM is configured properly since you set the PWM mode of DRV8303 to three inputs. All MCSDK use 6 inputs by default.
  • As we have replied to you, you should check if the below items are right again, and help to provide more tested information (like motor current waveform) that may help us resolve this if you can identify and run your motor on TI EVM board.
    1. Check current/voltage feedback circuit using lab03 and lab04.
    2. Check the maximum voltage/current in user.h
    3. Set correct identification current and frequency based on motor specification.