LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Highest speed for a loop in the microprocessor of my CRIO?

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

 

 

 

 

0 Kudos
Message 1 of 13
(3,819 Views)

If you really need 10KHz, then the FPGA is the way to go.

0 Kudos
Message 2 of 13
(3,812 Views)

Thanks!

 

Someone knows wich could be maximun speed for a loop in the microprocessor?

 

 

0 Kudos
Message 3 of 13
(3,803 Views)

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...).

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 13
(3,799 Views)

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!

0 Kudos
Message 5 of 13
(3,771 Views)

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?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 13
(3,764 Views)

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

Download All
0 Kudos
Message 7 of 13
(3,759 Views)

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.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 13
(3,743 Views)

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

Download All
0 Kudos
Message 9 of 13
(3,736 Views)

Hi Alvaro,

 

you might replace your ExpressVI with that pieces of code:

check.png or even this: check.png

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...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 13
(3,724 Views)