Modifying TI C2000 ePWM block output

10 vues (au cours des 30 derniers jours)
Mike Buba
Mike Buba le 17 Sep 2022
Réponse apportée : Samar le 25 Avr 2025
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 commentaire
Omar Shouman
Omar Shouman le 25 Oct 2022
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

Connectez-vous pour commenter.

Réponses (1)

Samar
Samar le 25 Avr 2025
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