我会用英语回答这个问题。I understand from your issue that when the value of Gain block is changed in the example to obtain 10kHz PWM with 20% duty ratio the desired output is not found in the output pin of the F28335 board. The possible reasons of the issue and their fixes are mentioned below:.
- Check if the "CMPA units" in the ePWM block is "Clock cycles" or "Percentages". If it is in "Percentages" ensure 0.2 is the input to the "WA" port of the ePWM block to obtain 20% duty cycle. If it is in "Clock cycles" ensure that 20% of the "Timer period" value of the ePWM block is provided.
- Ensure that 2 volt which is sent to the ADC pin computes for 20% of 4095. You can do that by finding the board specification for ADC pin sensible voltage limit.
- Verify if the ADC is sensing the analog voltage. You can do that by ensuring the "Conversion channel" of the ADC block matches to the pin where the input voltage is provided.
Further details on the ADC block can be found in the following MATLAB documentation:
希望这有助于解决问题。