03-21-2013 10:18 AM
Hello:
Im trying to develop a control system for an inverter with with my CRIO 9022, the speed of my system is 10 kHz(the switching frequency for the inverter is 10 kHz).
Im trying to develop the controller using the microprocesor, but I was reading that the highest speed achievable for a loop in the microprocessor is around 1 Khz, is this true?
If is it, how can I develop a control with a loop of 10 Khz? this speed is only achievable using the FPGA?
Thanks a lot!
Regards
03-21-2013 10:29 AM
If you really need 10KHz, then the FPGA is the way to go.
03-21-2013 10:49 AM
Thanks!
Someone knows wich could be maximun speed for a loop in the microprocessor?
03-21-2013 10:59 AM
Hi Alvaro,
the CPU can usually run faster than 1kHz. BUT: the scan engine will have problems when you want to read/write I/O faster than 1kHz. You also will see a jitter, even "real time" has it's limits!
And yes, on the FPGA you can stretch those limits far more. Here you could go to the limits of the hardware (cRIO modules also support certain sample rates...).
03-22-2013 03:46 AM
I think that Im not using the Scan engine mode, Im using the cRIO in FPGA mode because I use the FPGA for adquire the data and after I export this data to the processor with a Read/Write block for perform the calculations for the control(PID control), but in the control loop inside the microprocessor I cant achieve a speed for the loop higher than 0.4 Khz, I dont know if this is the limit for the procesor or its a problem in my programation.
Do you suggest maybe move all the programation to the FPGA?
[I attach a image of the control loop in the microprocessor (I take the data from the FPGA and after I perform the calculations), in this loop Im not able to achieve a speed higher than 0.4 khz]
Thanks a lot!
03-22-2013 03:53 AM - edited 03-22-2013 03:56 AM
Hi Alvaro,
atleast you should remove those "multiply by one"! (It will not speed up your loop, but it's not needed for calculation...)
- You don't show what kind of calculation is done inside those 2 subVIs. Maybe you can do them on the FPGA? When this loop only runs at 400Hz you definitely have some long calculations inside those subVIs...
- You calculate some DBL values that get transferred to the FPGA. Usually the FPGA doesn't support DBLs (well), I would prefer to scale those values back to UINT16 (or FXP), depending on how you use those values on the FPGA. You might even rethink your calculations and do them completely using FXP datatypes only?
03-22-2013 04:12 AM
Sorry for dont attach the subVI, but the calculation that I perform inside are not diffcult, the first one is only aritmetic calculations and the second one is a PID (I attach them).
Maybe I can try to move them to the FPGA, but would be very tedious because I need huge times for compile and if I want to make any change will be very more difficult.
Do you think that the processor can not carry out these loop a higher speed than 400 Hz?
Thanks
03-22-2013 05:18 AM - edited 03-22-2013 05:19 AM
Hi Alvaro,
I hate to say it, but you still don't show the full picture as all of your math is hidden in those ExpressVIs. When it's just simple math: use simple math functions instead!
For your PID:
It seems you use the Simulation toolkit. I think this will be rather slow when compared with the PID functions from PID toolkit... (Not quite sure about that, but the PID might be from RT palette. Don't have access to that on my current computer.)
03-22-2013 05:42 AM
Thanks GerdW
-I show you the calculations that I have inside the block (are realy easy), I used these calculations bolcks only for simplify the programation, these blocks can really make my program so slow?
-Also I show you where comes from my PID block, it comes from the RT palette as I show in the image. Do you suggest use another kind of PID implementation?
Regards
Alvaro
03-22-2013 06:05 AM - edited 03-22-2013 06:07 AM
Hi Alvaro,
you might replace your ExpressVI with that pieces of code:
or even this:
When all the calculations are the same: create a subVI from the snippet...
The PID is made for RT targets, but I never used it so far. Instead I use the PID from PID toolkit and I never had any problems with loop iteration times...