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.

MCU-PLUS-SDK-AM243X: how to switch the PWM mode from complementary mode to other mode dynamicly during motor moving

Part Number: MCU-PLUS-SDK-AM243X

Tool/software:

Hi Ti,

we are using AM243x for motor control. I'm here to ask if the AM243x supports PWM mode switching dynamicly? Here is the aim we want to achieve:

Normal operation:

- PWM is complementary with deadband
- When a brake request is received, we switch to the braking mode.
In the braking mode:
- Set the upper - bridge PWM output to be constantly OFF.
- The lower - bridge continues with PWM, and the duty cycle is controlled (soft braking).
- When the stop condition is met, we return to the normal control mode or keep all three LOW bridges are constantly on.

we tried seveal ways, but cannot brake the complementary characristic of PWM effectively.

Here is an example provided by Dong Kangjia, Ti support China. But we are now sure if this way is safe or the best way: 



switch(state) {
case STATE_RUNNING:
EPWM_enableDeadBand(...);
// 上下桥互补输出
break;

case STATE_ENTER_BRAKE:
// 第一步:强制关闭上桥
EPWM_setActionQualifierAction(..., A, LOW);
// 等待 2 周期
wait_n_cycles(2);
// 第二步:禁用 Dead - Band
EPWM_disableDeadBand(...);
// 第三步:配置下桥 PWM
EPWM_setAQAction(..., B, PWM);
state = STATE_BRAKING;
break;

case STATE_BRAKING:
update_pwm_duty(brakeDuty);
break;
}

  • Hi ,

    can you please confirm if below is what you are trying to do?

    Normal mode -> both High Bridge and Low Bridge will generate PWM signals

    Braking mode -> High Bridge PWM out is fixed to low and Low Bridge PWM out is configured to generate varying duty cycles and then Low Bridge PWM out is stopped high then both will be moved to Normal state

    Normal <-> Braking mode

    Do you have any PRU core free, we suggest configuring compare values and switching from PRU based on commands from R5F using PRUICSS DMEM?

    How many High side and low side PWM signals do you  require?

    Thanks & regards,
    Manoj.

  • Hi Manoj,

    In this application, one three phase half-bridge circuit is controlled by AM processor, 3 high side and 3 low side. We many extend the sw and hw to support dual axis, which means 6 high side and 6 low side.

    Let' add more details:

    Normal mode -> both High Bridge and Low Bridge will generate PWM signals

    Braking mode -> High Bridge PWM out is fixed to low and Low Bridge PWM out is configured to generate varying duty cycles.

    Stop mode -> High Bridge PWM out is fixed to low. Low Bridge PWM out are all constant high or low depend on application.

    Stop mode can only switch to Normal state

    we are using PRU. Don't you suggest keep using EPWM function? I am a little worried about the PRU plan. because it need commutination between R5F and PRU. And PWM update frequency is high, could be 40kHz or 100kHz.

    Thanks

    Logan


  • Hi ,

    we are using PRU. Don't you suggest keep using EPWM function? I am a little worried about the PRU plan. because it need commutination between R5F and PRU. And PWM update frequency is high, could be 40kHz or 100kHz.

    Ok, I got it.

    There is EPWM peripheral available at SOC level and PRUICSS PWM available inside ICSS, I see you are using EPWM so you can configure or control EPWM from R5F itself.

    we tried seveal ways, but cannot brake the complementary characristic of PWM effectively.

    Are you referring to any SDK example? if not can you tell me how you are doing this, are you configuring FREE_SOFT field to achieve this to fix EPWM to high or low?

     


    Thanks & regards,
    Manoj.


  • Hi ,

    we are using PRU. Don't you suggest keep using EPWM function? I am a little worried about the PRU plan. because it need commutination between R5F and PRU. And PWM update frequency is high, could be 40kHz or 100kHz.

    Ok, I got it.

    There is EPWM peripheral available at SOC level and PRUICSS PWM available inside ICSS, I see you are using EPWM so you can configure or control EPWM from R5F itself.

    we tried seveal ways, but cannot brake the complementary characristic of PWM effectively.

    Are you referring to any SDK example? if not can you tell me how you are doing this, are you configuring FREE_SOFT field to achieve this to fix EPWM to high or low?


     

    If you want to use PRU, we recommend using PRUICSS PWM. we have an example which matches with your use case and this will integrated in 11.0 motor control SDK.


    Thanks & regards,
    Manoj.


  • Hi Manoj,

    we solved our issue finally. we may explore the solution that runing current loop and generating PWM in PRU in future if it provides fast execution.

    Thanks

    Logan

  • Hi Logan,

    Thank you, we are closing this thread.

    please create new thread, if you need any help in future.

    Thanks & regards,
    Manoj.