Variable duty cycle PWM from ADC input using TI C2000 Embedded coder for F28069M Launchpad

23 次查看(过去 30 天)
I am trying to generate a variable duty cycle PWM controlled by a potentiometer. I am using the "Embedded Coder Support Package for Texas Instruments C2000 Processors" hardware support package in Simulink. The ADC is reading zero even though there is a signal at the analog input port. The images below show the system that I have.
I have also tried the "c280xx_adcpwmasynctest_ert" example file command which results in an unstable output.
How should I resolve this issue? Thanks

回答(1 个)

Sayan
Sayan 2023-9-8
编辑:Sayan 2023-10-9
My understanding of the issue you are facing is that the PWM pulses are not generated from your F28069M Launchpad "ePWM" pins when the input comparator value is varied by varying the voltage using a potentiometer. The possible issues in the model and their fixes are mentioned below.
The most probable issues:
  • Ensure the logic to generate PWM in counting mode "Up-Down" is correct. This can be fixed from the "Counter Compare" tab of the ePWM block.
  • Check if the potentiometer output voltage is provided to the correct ADC pin in the F28069M Launchpad as defined by the ADC block in the model. This can be changed from the "Input Channels" tab in the ADC block.
  • Ensure the potentiometer output voltage is within the sensible limit of the launchpad.
Some recommendations about the model are provided below.
  • Try to use "Clock cycles" instead of "Seconds" in the ePWM block for both "Timer period units" and "CMPA units" as this will increase the precision of computation.
  • Use the value of duty ratio instead providng it as percentage value maximum output of ADC
Further details on the ePWM block and ADC block can be found in the following MATLAB documentation:
Hope this helps in resolving the issue.

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by