LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM algorithm involving both RT & FPGA

Hi all,

I'm new to programming in LabVIEW (at least seriously), so I'm hoping that someone can help me.  I'm a grad student working on a research project to do with control of a linear motor.  I'm using a 7831R PCI board in a machine running LabVIEW RT Engine.  I'm trying to construct a PWM algorithm to drive a 3-phase inverter that goes something like this:

I generate a triangle wave in an FPGA VI (frequency is arbitrary, but I've got it working at 10kHz).  The reference signals will be pure sinusoids (for now) with a frequency of around 10Hz (give or take) which come from the VI running on the RT machine.  What I need to be able to do is sample these sinusoids (RT VI) at the instant that the triangle wave (FPGA VI) peaks.  Then I can send the value of the sinusoid at that time to the FPGA.  This single value will be my reference signal until the triangle wave peaks again.  I've been able to successfully generate an interrupt that is generated in the FPGA VI & acknowledged in the RT VI, so that I know when I need to "sample" these reference waveforms.  However, it seems that when I place any other computations in the RT VI, it misses some (actually most) of the interrupt signals.  Also, how should I "sample" those sinusoids--it's important for any transition to occur when the triangle wave peaks to avoid multiple switching signals.

I would appreciate ANY suggestions!!! 

Thanks,
Jessie   

0 Kudos
Message 1 of 4
(3,892 Views)
Hi, Jessie.

Just can't get the reason you use FPGA for your PWM needs.
At first sight, I'd suggest to you to use DAQmx-card instead of 7831R.
Suppose it simplify things greatly :).

Still, why RIO-card?
0 Kudos
Message 2 of 4
(3,875 Views)
Hi again, Jessie.

Needed some time to think it little bit over.

That's what I think.
If you are not interested in bying DAQ-card for your task :), will you at least share your "place any other computations in the RT VI".vi (both RT and FPGA) and "before-place any other computations in the RT VI".vi (both RT and FPGA).

Suppose there can be a kind of a mistake.
(You can even find it by yourself ;)).
0 Kudos
Message 3 of 4
(3,869 Views)
Jesse,

I hope you're doing well.  One question I had was is there any particular reason you are using the RT VI to sample rather than the FPGA?  I realize you already have the 7831R so you can only do DIO on the FPGA, but I thought I would ask anyway since we do have RIO boards that do both analog and digital.  With the architecture you have though, how is the RT VI sampling the sine waves?  Is this through a DAQ board and the DAQmx API?  Also, it may help to send your data between the FPGA and the RT target via a DMA channel (if you are using LabVIEW FPGA 8 and NI-RIO 2.0), as this will require less intervention from the CPU to process events.  Fill us in on more details, and we'll be glad to continue helping.  Have a great day!

Thaison V
Appilcations Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,855 Views)