Hi,
I have encountered an issue that I would like your help with. I would like to know if it is possible to use separate PWM blocks with two different switching frequencies in TI auto-code generation. I tried this with the F280039C control card, but I wasn’t able to get it to work.
Following is the Project Schematic and the error I am getting.
For the PWM block, I am using 10 kHz, and the PWM1 block 20 kHz. I have set the Tasking mode to Single-Tasking and Step size to 5e-5 (1/20000). Do I need to assign tasks as the multi-level? Can you please give me some guidance for this?
Please find the project file also.
resolver.plecs (40.6 KB)
Hello,
The problem is you have your ADC attached to a control task trigger. This makes it so that the PWM triggering the ADC also triggers the control task. Because this PWM is running at 10e3, the base task is forced to run at 1/10e3 = 1e-4. Removing the control task trigger fixes the problem!
Hope this helps, let us know if you need any further help. I’ve attached a fixed version of the model to this.
resolver.plecs (37.9 KB)
Hi Sulliva
Thank you for the information. I have resolved the previous issue. However, when I run the system in External Mode, I’m noticing noise in the position signal, and my SPWM also gets distorted. Interestingly, when I run both at 10 kHz, the system works well, with clean signals and proper SPWM behavior. Do you have any idea what might be causing this issue at two different frequencies?
Also, I’m trying to acquire a resolver signal and measure speed. For that, I’ve used the following block set in my implementation. However, I’m not getting the correct speed output. I suspect the issue might be related to the initial condition of the integrator block. (Instance that I have used C-script to create a derivative and do the same thing, but with a fixed step, I was unable to do that.)
I’ve attached the PLECS file with this message. Could you please take a look and share your thoughts on the above two issues?
Resolver_V02.plecs (58.0 KB)
Derivative_1.plecs (17.7 KB)