LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA multiple PID application

Hello to all:

I'm thinking about an application which should run multiple PID's on a FPGA 7833R. It should be possible to select one of the following options for the running mode of each PID:
1) PID with 2 analog inputs (Process variable, and Setpoint) and 2) PID with 1 analog input (Error signal).

By the time , the number of "plants"  to control is three (piezzo actuators for laser frequency stabilization and optical cavity locking), but I would want the application to have modular design , because the number of "plants" is possibly growing in the future.

In summary, I would like the FPGA VI to do:

            1) Read all AI's
            2) Read control from Host VI with information of which is the running mode for each PID
            3)Assign 1 or 2 AI's to each PID , depending on the running mode.
            4) Write all the AO's (control signal) and pass data to the Host VI through a FIFO, in order to plot a) Process Variable, Setpoint and PID out (for mode (1)) or b) Error Signal               and PID output (for mode (2) ).

I just want advice for which functions to use in order to design the method which has to allow the FPGA VI to recognise when has to feed a particular PID with 1 or 2 input values.

Thanks for your attention!


0 Kudos
Message 1 of 4
(4,321 Views)

Hi zermelo,

You just have to build a kind of selector (case selector could be button on front panel) where you choose either one or two inputs for the PID control. But you have to keep in mind, the PID VIs needs the setpoint and also the process variable as input. So for the case of two inputs you can wire them through, but for the case with only one input, so the error or differntial signal you have to build your setpoint and process variable to route them to the PID VI (e.g. by adding a constant: 1+error=process variable, setpoint=1).

BR, Christian

0 Kudos
Message 2 of 4
(4,220 Views)

Hi zermelo:

The PID algorithm requires that you provide the process variable as well as the setpoint. It is true that an error signal is calculated from the process variable and setpoint, which will be used subsequently in the algorithm. However, the algorithm still uses the process variable signal. In order to have a PID VI that takes the error signal as an input without providing the setpoint and the process variable, you need to modify the PID code yourself. The following link should give you a brief introduction to PID controllers

http://zone.ni.com/devzone/cda/tut/p/id/3782

Also, I would recommend that you look at the book by Karl Astrom on control system design (try google for that). This should give you more in-depth ideas about the different PID algorithms.

Please let me know if you have more questions.

Cheers...

Message 3 of 4
(4,058 Views)

Or you could simpy set the setpoint input on the PID to be your error signal and the process variable to be zero.

 

0 Kudos
Message 4 of 4
(2,218 Views)