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.
Hi Yanming Luo
I am having some trouble trying to get the dual axis project running with different PWM modules in one of my custom boards.
With the BOOSTXL-3PhGaNInv inverter PWM1,2,3 are used for the first motor and PWM 4,5,6 are used for the second motor.
The pin configuration in my custom board is exactly same as the BOOSTXL-3PhGaNInv hardware, with one change(Motor 1 Phase A pwm is connected to PWM11 and Motor 2 Phase A pwm is connected to PWM12)
I would like to use PWM11,2,3 for the first Motor and PWM12,5,6 for the second Motor.
In dual_axis_servo_drive_user.h, I tried changing the following:
//#define M1_ADC_TRIGGER_SOC ADC_TRIGGER_EPWM1_SOCA // NC: Set up based board #define M1_ADC_TRIGGER_SOC ADC_TRIGGER_EPWM11_SOCA //#define M1_U_PWM_BASE EPWM1_BASE // NC: Set up based board #define M1_U_PWM_BASE EPWM11_BASE #define M1_V_PWM_BASE EPWM2_BASE // NC: Set up based board #define M1_W_PWM_BASE EPWM3_BASE // NC: Set up based board //#define M1_INT_PWM INT_EPWM1 // NC: Set up based board #define M1_INT_PWM INT_EPWM11 //#define M2_ADC_TRIGGER_SOC ADC_TRIGGER_EPWM4_SOCA // NC: Set up based board #define M2_ADC_TRIGGER_SOC ADC_TRIGGER_EPWM12_SOCA //#define M2_U_PWM_BASE EPWM4_BASE // NC: Set up based board #define M2_U_PWM_BASE EPWM12_BASE #define M2_V_PWM_BASE EPWM5_BASE // NC: Set up based board #define M2_W_PWM_BASE EPWM6_BASE // NC: Set up based board //#define M2_INT_PWM INT_EPWM4 // NC: Set up based board #define M2_INT_PWM INT_EPWM12
But when running Build level 1, to check the PWM pulses, the PWM ISR counter(motorVars[0].isrTicker) does not increment, which means that the PWM 11 interrupt is not generated.
Is there any other configuration settings that needs to be modified?
Thanks,
AK
Did you set up the related GPIOs to EPWM in HAL_setupGPIOs() and enable the peripherals clock for EPWM11 and EPWM12?
Can you check if the control registers are configured correctly for EPWM11 and EPWM12?
If you want to run the lab with CLA, you need to change the following code according to the PWM you used in HAL_setupCLA().
// Enable EPWM1 INT trigger for CLA TASK1
CLA_setTriggerSource(CLA_TASK_1, CLA_TRIGGER_EPWM1INT);
// Enable EPWM4 INT trigger for CLA TASK5
CLA_setTriggerSource(CLA_TASK_5, CLA_TRIGGER_EPWM4INT);
Hi Yanming,
Yes I have setup the GPIOs in HAL_setupGPIOs()
I had not changed the CLA trigger. Once I had changed it to CLA_TRIGGER_EPWM11INT and CLA_TRIGGER_EPWM12INT, i could see the PWM ISR counter incrementing correctly.
Hi Yanming Luo
I was just reading this forum post about PWM synchronization
So since we are now not using sequent PWM modules anymore (PWM11,2,3 for Motor 1 and PWM 12,4,5 for Motor 2), do we have to modify the the sync related settings? I see in HAL_setupMotorPWMs() that PWM1 SyncOut is used to synchronize PWM4 SyncIN
Also should the phase shift values remain the same (0,2,4) ?
So since we are now not using sequent PWM modules anymore (PWM11,2,3 for Motor 1 and PWM 12,4,5 for Motor 2), do we have to modify the the sync related settings? I see in HAL_setupMotorPWMs() that PWM1 SyncOut is used to synchronize PWM4 SyncIN
Yes. It's neccesary.
Also should the phase shift values remain the same (0,2,4) ?
You may need to change the value according to the PWM module.