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: 

Moving all the program to FPGA

Solved!
Go to solution

Hi, 

I've got a question to You 🙂 . I'm trying to implement Fuzzy II regulator on myRIO. I know that FPGA is much faster than any RTOS, especially that uP in myRIO. I want to ask you if it is possible to move all my program to FPGA, to improve execution of the program, and if so, have you got any advise for me , where should I look for the way to solve it?

 

 

0 Kudos
Message 1 of 5
(2,760 Views)

how fast do you really need to go? that's what you should ask yourself. If 100 Hz loop rate is adequate there then why go to all that effort. You will have to do a lot of work otherwise

0 Kudos
Message 2 of 5
(2,746 Views)

As Mark says it really depends on the system you are regulating as to whether this is worth it. If it is a temperature control or mechanical system quite often you won't get any gain going to the FPGA since the dynamics of the system don't require a faster loop rate.

However something like electrical control or high speed switching might see a benefit.

Fundamentally I don't see any obvious stumbling block to a fuzzy logic controller on the FPGA. Floating point maths is the big problem on FPGAs but this should be limited on a fuzzy logic controller. If you have sine or cos calculations these are often good indicators that it may struggle on FPGA (but is still possible - just much harder).

 

If you want a method to transition slowly and test step by step you could start moving fuzzification and de-fuzzification to the FPGA feeding your existing control logic so you can be sure that works before moving everything to the FPGA .

 

All of that being said, for the types of system fuzzy logic is normally used for I would not expect any major gain by moving to FPGA.

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
0 Kudos
Message 3 of 5
(2,725 Views)
Solution
Accepted by topic author wojtek432

If you really want to do it and understand well how fuzzy logic works (I don't) my approach would be to implement a fuzzy logic program using the fuzzy logic VI as inspiration but not trying to convert them. Strip it down to very core of the logic needed for your system. THE FL logic library is very general purpose which is great but it will take a lot of work to adapt it and will take up more FPGA resources than you need. You can use single precision floating point on FPGA also, though that uses more resources. There is certainly a way to implement using fixed point numbers. If you use the linear types of membership functions then you won't need to mess around with sines and cosines.

0 Kudos
Message 4 of 5
(2,709 Views)

Thank You for your answers 🙂

With this regulator and PID(not together-I'm just comparing them) regulator I want to controll a pneumatic actuator. The computational complexity of the fuzzy controller of type-2 does not allow effective use of this algorithm in devices with lower performance. SbRIO system, from what I know, have RTOS clock frequency 400MHz. I have made tests on the same regulator cycle times (3.5 ms), and I'm sure that system sbRIO is able to perform the PID and Fuzzy II algorithm in less time, which would improve its results.
I would add that I do not use express PID and Fuzzy II, but I build them from scratch.

0 Kudos
Message 5 of 5
(2,692 Views)