From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use a PID in a CRIO-9102 FPGA

Hello
 
My name is Francisco, and I'm a student of mechanical engineering in Portugal (FEUP).
 I'm working on a project that involves the use of a CRIO-9102 to control a servo hydraulic cylinder. For this purpose I have to implement a PID controller in my FPGA code. Since is not possible to use floating point math how can I do this operation?
Can you pont me to an example that can help me.
 
Thanks in advanced for any help.
 
Best regards
 
Francisco Freitas
0 Kudos
Message 1 of 3
(5,697 Views)

Can you tell us a bit more about your requirements for floating point maths?

I write control software for jet engines in custom build microcontrollers with no floating point support. Very often we find something we THINK we might have to use floating point for and discover that we dont!

The most frequently used solution is to establish your maximum and minimum values and instead of scaling your calculations to +/- 1, they are scaled from -32768 to 32767 instead.

Failing that, another option is to use the FPGA as an I/O device and do any floating point work in a Windows host.

 

0 Kudos
Message 2 of 3
(5,648 Views)
Hi Francisco,

If your using LabVIEW FPGA 8.2, you might also take a look at the Using Discrete PID example that is shipped with the NI RIO driver.  Depending on the PID rate you need, another option is to pass the I/O to the Host and perform the PID calculations there.

You might also check out the "Benchmarking Single-Point Performance" to get a feel for the PID rates you could expect.

Regards,

Steve
0 Kudos
Message 3 of 3
(5,635 Views)