From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA code for PWM with cRIO 9035

Solved!
Go to solution

Hello everyone,

 

I am trying to generate PWM signal for future control applications. For this, I am using the cRIO 9035 and the NI 9474 module and display the signal on a Tektronix TDS 2002C oscilloscope.

 

I want to generate high-frequency PWM, therefore, I use the LabVIEW FPGA interface. And I create a very simple and basic FPGA VI (PWM0) and call it in the host VI (PWM_FPGA) as shown in this Fig.1 and Fig.2.

Fig.1: Project Explorer and FPGA VI of the PWM.

Project and code.png

 

Fig.2: Host VI.Host VI.png

I can generate the squared signal with both High and Low pulses. But when I increase the frequency I lose the low pulse as shown in the figures below:

 

F = 5Hz

 

F0001TEK.JPG

 

 

 

F = 50Hz

F0002TEK.JPG

 

 

F = 250Hz

F0003TEK.JPG

 

F = 1kHz

F0000TEK.JPG

 

 

F = 2kHz

F0004TEK.JPG

 

 

F = 3kHz

 

F0005TEK.JPG

 

 

F = 4kHz

F0006TEK.JPG

 

 

F = 5kHz

F0007TEK.JPG

 

 

Can anyone explain to me why do I have a problem with the Low pulse. Did I miss something? or do I have to add some sort of configuration?

Any help would be highly appreciated.

 

0 Kudos
Message 1 of 3
(2,590 Views)
Solution
Accepted by topic author FaresMZOUGHI

Do you have a pull down resistor? If not, try one. Maybe ~10KOhm.

Message 2 of 3
(2,579 Views)

It worked thank you very much. I connected the PWM signal to a power converter SEMIKRON which has an internal resistor 10kOhm.

 

Thank you for your quick response.

0 Kudos
Message 3 of 3
(2,555 Views)