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-Q1: Example code consultation

Part Number: TMS320F280025C-Q1
Other Parts Discussed in Thread: C2000WARE

Hi Team,

There's an issue from the customer need your help:

I am running the C2000Ware_MotorControl_SDK_5_00_00_00\solutions\universal_motorcontrol_lab experimental routine, and I chose HALL sensory FOC. In the hall.h header file, why does the angle increment thetaDelta_rad change by 2Π/36 when the Hall state changes once, three-phase Shouldn't the angle increment be Π/6 every time the Hall state changes?

The first picture below is in the hall.h file, the second picture is in the hall.c file, and the third picture is in motor1_drive.c

Thanks & Regards,

Ben

  • Hello Ben, I am looking into your question and will get back to you soon. Thanks, Ashwini.

  • Hello Ben,

    Apologies for the delay in response. Please note that your pictures did not attach correctly.

    As for thetaDelta_rad, that variable is actually not a state-change increment. Instead, thetaDelta_rad is a hardware offset compensation.

    The angle of the motor is determined by the 'thetaBuff' lookup table, treating the HALL sensor state as the index value. The 7 values present in this table are motor-dependent. See the HALL_setAngleBuf() function and the hallAngleBuf table in the motor1_drive.c file. If you want to verify that these values are correct, use the MOTOR1_HALL_CAL predefine for HALL calibration.

    Regards,
    Jason Osborn

  • Hi Jason,

    So can the angle obtained in this way be used for FOC control? It feels like there is no interpolation to subdivide the 60° Hall angle.

    Thanks & Regards,

    Ben

  • Hello Ben,

    By default, there is no interpolation in the HALL sensor routine- if you watch the motor angle via the DAC, you'll see it cycle through the course angle values. This naturally results in significantly more noise and error in other values like speed and current, but the motor will typically still run.

    If you'd like to implement interpolation yourself, the HALL_run() function called during the ISR also calculates an approximate speed of the motor based on the time between state transitions. Interpolation should be relatively simple from there.

    Regards,
    Jason Osborn