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: F280025C + DRV8329A EVM | Universal Motor Control | Hall Sensor Feedback | Current Waveform Not Sine & Motor Not Rotating Properly

Part Number: TMS320F280025C


Tool/software:

I am using the F280025C with the DRV8329A EVM inverter board and working with the Universal Motor Control Lab (DMC Level 4) for Hall sensor feedback.

I need to configure a new motor that is not pre-configured in the Universal Motor Control project. How should I correctly add the motor parameters and adapt the control algorithm for Hall sensor-based FOC?

Additionally, I am facing the following issues:

  1. The current waveform is not sinusoidal; instead, it resembles a six-step control waveform. According to the user guide, the current should be sinusoidal in FOC mode. How can I resolve this issue?
  2. The motor does not rotate properly with the electrical angles calculated using HAL_CAL. What could be the cause of this, and how can I fix it?

Any guidance on correctly configuring Hall sensor-based FOC and debugging these issues would be greatly appreciated.

Thanks!

  • Hello,

    Apologies for the brief delay in response, I was unexpectedly out of office.

    First, adapting the control algorithm. Note that the HALL algorithm is already available in the UMCL using the predefined symbol "MOTOR1_HALL", so no adapting should be required.

    To add a new motor, refer to the examples in "user_mtr1.h". These example motors begin ~line 1100 in the current version, I believe. Once you have done so, make sure to also add your motor to the user_common.h file as well. Let me know if you have any questions.

    For your issues:

    1. If you are using HALL, the project does NOT have a built-in method to smooth out the estimated angle. Figure 3-52 of the UMCL shows an example of this:
      1. If you wish to have this be smoother, you will need to add a custom slew implementation for the angle at this time.
    2. Ensure that the active estimator is FAST during the HALL calibration. If you have already done this, please let me know.

    Regards,
    Jason Osborn

  • Hello Jason,

    Thanks for the guidance. I have implemented both HALL_FAST and HALL_CAL, and the motor is now rotating, reaching the maximum speed as expected. However, after storing the values obtained from theta_cal_buff into theta_angle_buff and disabling HALL_CAL, the motor does not rotate.

    I have made changes as referenced in the forum post:

    e2e.ti.com/.../tms320f280025c-need-sinusoidal-current-with-hall-sensor-feedback-on-universal-motor-control-project-getting-step-type-current-with-audible-noise-as-of-now-on-my-ebike-hub-motor

    Despite these changes, the phase current waveform still resembles six-step control rather than sinusoidal current. Could this be due to an issue with the interpolation or filtering of the angle values from theta_angle_buff? Or is there a need for additional tuning to smooth out the estimated angle?

    Any insights would be greatly appreciated.

    Best regards,

  • Sakshi,

    The issue is what I referred to in my previous response in this thread. By default, there is NO interpolation on the angle, as you can see in the image I posted of DAC output. To smooth out the current, you'll need to add in an interpolation after the HALL_run() function.

  • Hi,

    I was able to achieve a sinusoidal phase current waveform by incrementing obj->thetaHall_rad in the HALL_run() function. This interpolation smooths out the rotor angle updates between Hall transitions, resulting in a smoother current waveform.

    Currently, I have implemented the following:

    • If the Hall index changes, update thetaHall_rad based on thetaBuff[].
    • If the Hall index remains the same, increment thetaHall_rad using obj->phaseincreament.
    • Question:

      I need guidance on how to dynamically adjust phaseincreament based on speed to maintain accurate interpolation at different operating points.

    • Here is my HALL_run(); function: 
    • static inline void HALL_run(HALL_Handle handle, float32_t speedRef)
      {
      HALL_Obj *obj = (HALL_Obj *)handle;

      obj->hallIndex = HALL_getInputState(handle);
      obj->timeCountPWM++;

      if(obj->hallIndex != obj->hallIndexPrev)
      {

      if(speedRef > 0.0f)
      {
      obj->thetaHall_rad = obj->thetaBuff[obj->hallIndex] + obj->thetaDelta_rad;
      obj->hallDirection = 0;
      }
      else
      {
      obj->thetaHall_rad = obj->thetaBuff[obj->hallIndex] - obj->thetaDelta_rad;
      obj->hallDirection = 1;
      }

      obj->hallIndexPrev = obj->hallIndex;

      float32_t speedCAP_Hz = 0.0f;
      if(obj->timeStampCAP != 0)
      {
      speedCAP_Hz = obj->capScaler / ((float32_t)obj->timeStampCAP);
      }
      else
      {
      speedCAP_Hz = 0.0f;
      }

      float32_t speedPWM_Hz = obj->pwmScaler /
      ((float32_t)(obj->timeCountPWM + obj->timeCount[1] + obj->timeCount[0]));

      if(obj->hallDirection == 0)
      {
      obj->speedCAP_Hz = speedCAP_Hz;
      obj->speedPWM_Hz = speedPWM_Hz;
      }
      else
      {
      obj->speedCAP_Hz = -speedCAP_Hz;
      obj->speedPWM_Hz = -speedPWM_Hz;
      }

      if(speedPWM_Hz > obj->speedSwitch_Hz)
      {
      obj->speedHall_Hz = obj->speedCAP_Hz;
      }
      else
      {
      obj->speedHall_Hz = obj->speedPWM_Hz;
      }

      obj->timeCount[1] = obj->timeCount[0];
      obj->timeCount[0] = obj->timeCountPWM;
      obj->timeCountPWM = 0;
      }
      else{
      obj->thetaHall_rad += obj->phaseincreament;
      }

      if(obj->timeCountPWM > obj->timeCountMax)
      {
      obj->speedCAP_Hz = 0.0f;
      obj->speedPWM_Hz = 0.0f;
      obj->speedHall_Hz = 0.0f;
      obj->timeCountPWM = 0;
      }

      if(obj->thetaHall_rad >= MATH_PI)
      {
      obj->thetaHall_rad = obj->thetaHall_rad - MATH_TWO_PI;
      }
      else if(obj->thetaHall_rad <= -MATH_PI)
      {
      obj->thetaHall_rad = obj->thetaHall_rad + MATH_TWO_PI;
      }

      return;
      }

    • Looking for Guidance On:

      1. How to calculate phaseincreament dynamically based on motor speed?
      2. What formula or factors should be considered for accurate interpolation?
      3. Are there any recommended tuning methods to optimize phaseincreament at different speeds?

      Would appreciate any insights on the best approach to fine-tune this for different motor operating points.

      Thanks in advance!

  • My personal recommendation would be:

    1. Determine the ISR period, given by 1/(ISR Freq), a parameter defined in user_mtr1.h
    2. Based on the current motor speed and the ISR period, you can determine the approximate delta (or phase increment) of the motor in one ISR period

    Assuming that the interpolation occurs at roughly the same time cycle-to-cycle, then this should be sufficient. This is advice given based on my understanding of the situation, please ensure adequate testing of your implementation.

    Regards,
    Jason Osborn