Modifying TI C2000 ePWM block output

조회 수: 17 (최근 30일)
Mike Buba
Mike Buba 2022년 9월 17일
답변: Samar 2025년 4월 25일
Is it is possible to modify an ePWM output to do additional calculations before sending a PWM signal to GPIOs.
For example, I would one of the switches to switch using the following logic:
or
For the first three signals am sending a reference to a PWM block, but my fourth PWM signal is calculated as a combination of the first three PWM signals, i.e. forth signals does not have a reference.
  댓글 수: 1
Omar Shouman
Omar Shouman 2022년 10월 25일
Hello Mike,
I want to do the same thing. I was wondering if you were able to do it or find an alternative. That would be very helpful.
Thank you for your time.
Kind Regards,
Omar

댓글을 달려면 로그인하십시오.

답변 (1개)

Samar
Samar 2025년 4월 25일
As per my understanding, you are trying to implement a custom logic for ePWM4. You are trying to derive the output of the fourth ePWM as a logical combination of the other three ePWMs.
This is possible, the following steps should be followed to implement this logic:
  • Use “ePWM” blocks to generate the first three PWM signals with the usual workflow.
  • To know the logical state of a digital pin, use the “Digital Input” block. Connect one block to each of the GPIO pins. Make sure the sample time is same for corresponding ePWM and Digital input block.
  • For the above function you can also use “From Workspace”.
  • To apply logical operation, use the “Logical Operator” block. Select the desired logical operation and feed the three ePWM signals to it.
  • The output from this logical operator block is the desired ePWM4. Since this is not from a reference signal, there is no requirement of using another ePWM block. Instead, we can directly connect this output to drive a “Digital Output” block.
There are some points to be noted:
  • Make sure that the PWM frequency of the three base signals is sufficient for the logic to make sense at GPIO level.
  • The sample rate of the logical operation block should be high enough to capture all the transitions.
Refer the screenshot given below to understand the step-by-step procedure mentioned above. Here I have tried to create 4th ePWM by taking XOR operation of the existing three ePWMs.
I hope this helps!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by