01-10-2017 04:02 PM
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?
Solved! Go to Solution.
01-10-2017 05:21 PM
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
01-11-2017 03:47 AM
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.
01-11-2017 03:07 PM
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.
01-12-2017 04:53 PM
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.