Power Electronics Development Center

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding PWMs to myRIO FPGA Personality / Homemade PWM Speed / PWM Express VI

Hello,

I'm using a myRIO to control an active rectifier for PFC.  So far the number of independent PWMs on the myRIO has been sufficient.  However, I'm now adding more power electronics to my setup and require more independent PWMs than the myRIO natively supports through the PWM Express VI.

As such, the first thing I did was simply write my own basic PWM VI that outputs to a DIO as seen below:

PWM with DIO Back Panel.png

PWM with DIO Front Panel.png

It works, but the problem is the frequency is much lower than expected when I observe the DIO on the scope.  I've written the VI to wait 4 system ticks between each up-count on the carrier sawtooth, and to reset the sawtooth when it reach 10.  With a 25 ns system tick this should yield a PWM frequency of 1 MHz, or a period of 1 us.  However, when the DIO is observed on the scope the period is only 1.5 ms, which is less than 1 kHz:

Scope Capture 2.jpg

So I tried modifying the default myRIO FPGA personality to add more of the same PWMs that are already instantiated on the FPGA to other DIOs on Connector C:

Here's the top half of the Connector C loop with PWM DIO Muxes added to DIOs 0 and 2:

FPGA Back Panel 1.png

And here's the bottom half of the Connector C loop with PWM DIO Muxes added to DIOs 4 and 6:

FPGA Back Panel 2.png

And the resulting front panel:

FPGA Front Panel.png

After instantiating this modified personality to the FPGA my home-made PWM using DIOs still runs with the slow 1.5 ms period, so I tried using the PWM Express VI that I would use for PWMs included in the default personality, but I find that the PWM Express VI doesn't recognize the new PWMs I've added.  It only lets me select DIO 3 or 7 on Connector C even though I've added the same PWM capability for Connector C pins 0, 2, 4, and 6 as well:

Express PWM DIO Selection.png

So I grabbed the PWM Express VI code and pasted it into my own loop:

PWM Express VI Back Panel.png

But I can't figure out how to add my new PWMs for Connector C DIOs 0, 2, 4, and 6 to this channel selection.  I tried right-click > advanced > customize, and then working with the Channel Selection on the front panel, but still could only select from defaults, and couldn't add my new PWMs.

So how would I go about making the PWM Express VI module recognize my new Connector C PWMs?

Or is there a way to make my own PWM run at the speed I expect it to?

Thanks!

0 Kudos
Message 1 of 1
(3,777 Views)