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.

C2000WARE-MOTORCONTROL-SDK: TMS320F280025 and DRV8343 motor control project

Part Number: C2000WARE-MOTORCONTROL-SDK
Other Parts Discussed in Thread: TMS320F280025

Dear Team,

           We are using universal motor control project using TMS320F280025 microcontroller and DRV8343 module.

In that we want to know the change of the direction rotation of the motor.

1. How to change the rotation direction of the pump in the Code?

2. How to control the current value as a constant while increasing the torque of the pump?

Advance Thanks and Regards,

B.Punitha

  • Punitha,

    1. To change the direction the motor will move, change speedRef_Hz to a negative value before enabling the motor.
      1. To change the direction the motor is moving while the motor is already enabled, the same answer applies. However, the Universal Motor Control Lab does not have built-in functionality to handle crossing the zero speed threshold- this would need to be added by you.
    2. There is a current control loop in the Universal Motor Control Lab. The Id and Iq reference values ( motorVars_M1.IdqRef_A[1:0] ) are the input to this control loop.
      1. In Build Level 4, IdqRef_A is automatically calculated by the speed control loop to achieve the desired motor speed. In Build Level 3, the Idq reference is a constant.

    Please let me know if I misunderstood any questions.

    Regards,
    Jason Osborn

  • Hi Jason,

          We successfully changed the direction of the rotation of the pump.

    For current control only not yet achieved.

    We disabled the Comparator module and set fault portion in the project. While enable the CMPSS module the pump was not run...

    How to resolve this issue?

    Whether comparator module is related with current control part of the pump?

    Kindly share the comparator related documents 

    Regards, 

    B.Punitha

  • Hello,

    The CMPSS comparator module protects against overcurrent fault conditions. When the current exceeds a set limit (defined by USER_MOTOR1_OVER_CURRENT_A in user_mtr1.h, which should be set to an appropriate value for your hardware), the CMPSS detects an overcurrent condition and trips.

    Adjust USER_MOTOR1_OVER_CURRENT_A to an appropriate value for your hardware to fix spurious trips.

    Regards,
    Jason Osborn

  • Hi Jason,

     Thanks for your reply.

    We successfully change the direction of the rotation of the pump. 

    How to enable the constant POWER or Current Control loop in the above project?

    Because our requirement is while increase the Torque value , the current value should not increased.

    Kindly suggest to achieve the above task.

    Thanks and regards,

    B.Punitha

  • Hello,

    The constant current control loop is Build Level 3, as described in the Universal Motor Control User's Guide. To control the current, adjust the value of the Idq_set_A vector in real-time in CCS debug.

    Note: I would recommend altering the lab when increasing the load on the motor in build level 3. Because the lab is designed to primarily run off of speed control, it has no built-in method to account for the fact that speed will decrease as load increases at constant current.

    My tentative recommendation based on the theory, assuming you're using the FAST estimator:

    • Remove this code from motor1_drive.c:
    • Change "flagEnableSpeedCtrl" to false in this code from motor1_drive.c:

    I believe that this should set the system to solely run off of current control, but I have not had the chance to test this personally. I highly recommend testing this.

    Regards,
    Jason Osborn

  • Dear Jason,

    If i enable the Comparator module and changed the OVER CURRENT value 25.0f , then the motor will not spinning.

    I am using in bulid Level 4 control.

    I want to know how to calculate the running speed of the pump using FAST ESTIMATOR?..

    As of my knowledge i observed the following details.

    1. Speed_Hz, Speed_Est_Hz are the Same value. 

    2. speedAbs_Hz and speedFilter_Hz are the same value. This indicates running speed of the pump.

    3. speed_int_Hz = Speed_Ref_Hz, While increase the torque the pump speed will reach to  Ref_Hz

    4. Idq_in_A.value[1] is the current of the pump.

    5.If I set the Speed_Ref_Hz, value form 0 to 150 Hz then the pump will run in the same frequency.

    6. If i set the Speed_Ref_Hz above 160 to 190 Hz, then the pump start working in 150Hz. While increase the torgue the pump max speed frequency is set value of  Speed_Ref_Hz.

    7. Which current value i have to consider for Pump Current ? (Idq_in_A.value[1] Is this?)

    Please ensure the above points are correct or not.

    Regards, 

    B.Punitha

  • B. Punitha,

    1. In a system which only has FAST enabled (no eSMO, no HALL, etc.), speed_Hz is always identical to speed_est_Hz.
      1. Speed_Hz and Speed_est_Hz are both the FAST estimated speed of the motor. This indicates the running speed of the motor.
    2. speedAbs_Hz is the absolute value of speedFilter_Hz. speedFilter_Hz is the output of a simple digital filter applied to speed_Hz.
    3. speed_int_Hz/speed_ref_Hz is the output of the slew/ramp generator for the speed reference. This is the target speed of the motor. This ramps to the value of speedRef_Hz.
    4. The vector Idq_in_A.value[1:0] represents the d and q axis current values. In an ideal world, only one of these has a value.

    Ideal d/q-axis current is related to general motor control theory. Refer to the following document, section 2.4.2 Three-Phase PMSM Drive for further details.

    This content will also be added to the Universal Motor Control Lab User's Guide in an upcoming update.

    Once this content has been reviewed, let me know if there are any additional specific questions.

    Regards,
    Jason Osborn

  • Hi Jason,

               Pump speed and Current variables was OK,

    I used in Build Level 4, FAST algorithm method.

    While i enable the comparator module in Code, then the module overcurrent fault was occur.

    I increased the OVER CURRENT value upto 75.0 A then also same error occured.

    In DRV8343 driver settings we configured the MAX current Value in registers.

    WE used the following current channel in our code.

    1. U phase - ADCA - A15/C7

    2. V phase - ADCC - A11/C0

    3.W phase - ADCA - A5/C2

    for above current channel WE CONFIGURER THE COMPARATOR MODULE AS BELOW

    #define MTR1_CMPSS_U_BASE               CMPSS1_BASE

    #define MTR1_CMPSS_U_BASE               CMPSS1_BASE

    #define MTR1_CMPSS_W_BASE              CMPSS3_BASE

    #define MTR1_IU_CMPHP_SEL                 ASYSCTL_CMPHPMUX_SELECT_1              / / CMPSS1-A15
    #define MTR1_IU_CMPLP_SEL                  ASYSCTL_CMPLPMUX_SELECT_1              / / CMPSS1-A15

    #define MTR1_IV_CMPHP_SEL                 ASYSCTL_CMPHPMUX_SELECT_1               // CMPSS1-A11
    #define MTR1_IV_CMPLP_SEL                  ASYSCTL_CMPLPMUX_SELECT_1               // CMPSS1-A11

    #define MTR1_IW_CMPHP_SEL                  ASYSCTL_CMPHPMUX_SELECT_3             // CMPSS1-A5
    #define MTR1_IW_CMPLP_SEL                   ASYSCTL_CMPLPMUX_SELECT_3              // CMPSS1-A5

    #define MTR1_IU_CMPHP_MUX                                  3 // CMPSS1-A15
    #define MTR1_IU_CMPLP_MUX                                   3 // CMPSS1-A15

    #define MTR1_IV_CMPHP_MUX                                  1 // CMPSS1-A11
    #define MTR1_IV_CMPLP_MUX                                   1 // CMPSS1-A11

    #define MTR1_IW_CMPHP_MUX                                   1 // CMPSS1-A5
    #define MTR1_IW_CMPLP_MUX                                    1 // CMPSS1-A5

    // XBAR-EPWM
    #define MTR1_IU_XBAR_EPWM_MUX                                   XBAR_EPWM_MUX00_CMPSS1_CTRIPH                 // CMPSS1-HP
    #define MTR1_IV_XBAR_EPWM_MUX                                   XBAR_EPWM_MUX01_CMPSS1_CTRIPL                   // CMPSS1-LP
    #define MTR1_IW_XBAR_EPWM_MUX                                 XBAR_EPWM_MUX04_CMPSS3_CTRIPH_OR_L       // CMPSS3-HP&LP 

    #define MTR1_IU_XBAR_MUX                            XBAR_MUX00 // CMPSS1-HP
    #define MTR1_IV_XBAR_MUX                            XBAR_MUX01 // CMPSS1-LP
    #define MTR1_IW_XBAR_MUX                           XBAR_MUX04 // CMPSS3-HP&LP

    Kindly check whether the configuration is correct or not..

    Thanks

    B.Punitha

  • Hello B. Punitha,

    Apologies for the delay, I was out sick and have just returned. I'm going to make 2 posts. In the first post, I'm going to confirm that all of your settings you provided look correct. In the second post, I'm going to request some values from the CCS Debug Expressions window, which is going to be your primary tool for determining the cause of this.

    First post. To determine if you're using the right Analog Subsystem and CMPSS muxing, refer to section 14.5 Analog Pins and Internal Connections of the device TRM.

    • A15
      • HP- CMPSS1, HPMXSEL = 3
      • LP- CMPSS1, LPMXSEL = 3
    • C0
      • HP- CMPSS1, HPMXSEL = 1
      • LP- CMPSS1, LPMXSEL = 1
    • A5
      • HP- CMPSS3, HPMXSEL = 1
      • LP- CMPSS3, LPMXSEL = 1

    Based on this, your values for the CMPSS all look correct.

    For the ePWM XBAR, refer to Table 9-3. EPWM X-BAR Mux Configuration Table.

    • mux0 - CMPSS1 TRIPH
    • mux1- CMPSS1 TRIPL
    • mux4- CMPSS3 TRIPH_OR_L

    Based on this, your values for the XBAR all look correct as well.

    Regards,
    Jason Osborn

  • Hello B. Punitha,

    Apologies for the delay, I was out sick and have just returned. I'm going to make 2 posts. In the first post, I'm going to confirm that all of your settings you provided look correct. In the second post, I'm going to request some values from the CCS Debug Expressions window, which is going to be your primary tool for determining the cause of this.

    Second post.

    The Universal Motor Control Lab User's Guide refers to a few different variables when discussing the CMPSS and the overCurrent fault.

    • What are the value of the following expressions during or immediately after an overCurrent fault?
      • motorSetVars_M1.dacCMPValH
      • motorSetVars_M1.dacCMPValL
      • motorSetVars_M1.overCurrent_A

    Regards,
    Jason Osborn

  • Hi Jason,

             Thanks for your reply.

    After enabling the comparator module the following values are computed in the coding

    I set the over current value to be 25.0A

    And also while enable the comparator module, i found the PWM module trip fault occured.

    How to rectify the above faults

    Thanks and regards,

    B.Punitha

  • What are the contents of the following registers after the trip?

    • Each CMPSS COMPSTS register
    • Each PWM's TZFLG register

    Regards,
    Jason Osborn