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: TIDM-02010 Dual motor speed loop problem

Part Number: TMS320F280025C
Other Parts Discussed in Thread: TIDM-02010

I have successfully driven the motor to rotate using the tidm_02010_dmpfc_002x example code.

My needs are very simple. I don’t need PFC or compressor. I just need to use TIDM-02010 hardware to drive dual motors. It can be understood that it drives two fans. The reason for using TIDM-02010 is because it supports high voltage. And with the dual motor routine, I can quickly verify the project.
But regarding the tidm_02010_dmpfc_002x example, I have the following questions. Please ask motor control experts to answer my questions one by one. Thank you:
1. In the initialization code, I saw the HAL_setupPWMsPhaseShift function, which sets the phase displacement of motor 1 and motor 2 (PFC is automatically ignored in this question). Why do I need to set the phase displacement? Is it just to avoid interruption? I tried not setting the phase shift, but the acquisition of the adc voltage will be about 5v higher than the average? why is that?

2. As mentioned above, I only need to drive 2 motors for speed loop control, but the processing of motor 1 and motor 2 seems to be different in the code, because my motor ultimately rotates through the motor 2 channel. Motor 1 is working abnormally. Do I need to modify the logic of motor 2 to motor 1?

  • Why do I need to set the phase displacement? Is it just to avoid interruption?

    Yes, avoid the interrupt and ADC used by dual motor.

    I tried not setting the phase shift, but the acquisition of the adc voltage will be about 5v higher than the average? why is that?

    Not fully understand your question. The phase shift doesn't impact the ADC voltage.

    2. As mentioned above, I only need to drive 2 motors for speed loop control, but the processing of motor 1 and motor 2 seems to be different in the code, because my motor ultimately rotates through the motor 2 channel. Motor 1 is working abnormally. Do I need to modify the logic of motor 2 to motor 1?

    That depends on your application. You can user either one for dual motor or just as the example.

  • Hello, I noticed that the status processing of motorState seems to be different from that of the general laboratory. Is there a document explaining how the status of MOTOR_Status_e is switched and run in the program?

    In the tidm_02010_dmpfc_002x example, if the status handling of MOTOR_OL_START is a bit difficult to understand:

        else if(motorVars[MTR_2].motorState == MOTOR_OL_START)
        {
            angleFOCM2_rad = angleESTM2_rad;
    
            if(fabsf(estInputDataM2.speed_ref_Hz) >= fabsf(motorVars[MTR_2].speedForce_Hz))
            {
                motorVars[MTR_2].motorState = MOTOR_CL_RUNNING;
            }
        }

    As above, speed_ref_Hz is the expected speed closed-loop speed, speedForce_Hz is a speed defined by the macro. According to the process, motorState will first go through the MOTOR_ALIGNMENT state, and then switch to MOTOR_OL_START. During the processing of MOTOR_OL_START, it will be judged that speed_ref_Hz >= speedForce_Hz, and the transition from MOTOR_ALIGNMENT to When MOTOR_OL_START, the current on the id axis is not 0, so why wait for speed_ref_Hz >= speedForce_Hz? This will cause the motor to vibrate significantly after starting, and will it switch to closed-loop speed operation after a while?

  • It's only for running the motor with eSMO. The process will be passed if the motor is running with FAST. You can refer to the TID user's guide, and the source code should be easy to understand the operation process as well. It's just the control flow, not related to the estimator algorithm. You can design the control flow according to your application.