Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Program doesnt fit on FPGA

Hi,

my problem is that the FPGA has not enough resources for my motor control program.
Know i want to generate the current signal for the PWM-Generator on the CRio-Level.
This includes the PID-Module. The system isn´t stable any more. It´s oszillating around the values, and i can´t stop it with the gains.
before it run without problems (Program on the FPGA-Level)

Where comes the oszillation from? Slow data exchange Rio-FPGA?
Which components need the most resources?

If its needed, i can post the Programm.

Tanks
  Andi

0 Kudos
Message 1 of 4
(3,486 Views)

Hi Andi,

What cRIO back plane and controller are you using?  Your issue may be that you aren't getting the data from the controller to the FPGA fast enough, as you suggested.  If you are using a 901x series controller then you can use DMA's to transfer from the controller to the FPGA which will be very fast.  The 900x controllers only support DMA transfers from the FPGA to the controller.  Also, you can take a look at this Knowledgebase for some tips on optimizing your FPGA code and reduct resource usage.  It might be possible to get your resource usage low enough that you could keep your motor control program on the FPGA.  Thanks.

Stephen S.
National Instruments
1 Test is worth 1000 expert opinions
0 Kudos
Message 2 of 4
(3,465 Views)
Hi Stephen,

thanks for the reply.
I found a solution to run it on the FPGA. I replaced the Fixed Point PID  with a normal PID module (i couldn´t find out where the difference is). Their size of space are different.  Also i did some finetuning on the other loops.
So, know the system is working.
Which solution is more elegant?

Cheers
   Andi

0 Kudos
Message 3 of 4
(3,447 Views)

Andi,

Well...the most elegant solution is the one that fits on your FPGA, but otherwise, it is always good to take out the fat in loops and functions that are just doing basic things.  This is why reducing coercions and using the saturation VI's for math functions can be a big help.  If you are not waisting space on your FPGA with poorly executed code then you will have room to do the things that simply require more space.  I'm not sure what you mean by a Fixed Point PID vs a norman PID module.  The PID module has a number of different VI's...did you simply change the VI's you were using? 

 

Stephen S.
National Instruments
1 Test is worth 1000 expert opinions
0 Kudos
Message 4 of 4
(3,417 Views)