The attached PID FPGA VI has been modified to save previous iteration data in block RAM for up to 8 axes allowing a single PID VI for multiple control loops. For LabVIEW FPGA targets, this method reduces gate usage allowing more axes, or control loops on a given target. Figure 1 below shows how this single PID VI can be used in a “For Loop” to control all the “control loops” or axes defined by the number of elements in each array.
Figure 1. PID VI which saves previous iteration data in FPGA block RAM
The PID VI takes ~60 ticks to run (670+kHz) for each axis (i.e. for 8 axes, this control loop could run up to 670Hz/8 = ~84kHz . . . adding more code, such as input and outputs IO nodes, in series to the control loop will decrease the maximum rate).
This VI is password protected. The unlocked single axis version is available with NI SoftMotion. Contact National Instruments if you already have purchased a license of NI SoftMotion and need this VI unlocked. NI SoftMotion provides other motion centric LabVIEW IP allowing you to create a flexible motion control system.