10-18-2009 06:59 PM
Can anyone provide a simple sample program that uses the PID.vi?
I cannot figure out all of the connections and all I get is a locked up cpu.
Thanks.
10-19-2009 12:40 PM
Sorry I can't provide a sample program, but maybe I can help you figure out your connections. What are you trying to control? How do you have the PID wired now?
The inputs to the PID VI should be a setpoint, a process variable, and tuning parameters. You should put it inside a loop in which you measure something (the process variable), feed that measurement to the PID VI, and then take the output of the PID and write it to an output on your hardware. There should also be a a wait to regulate your loop timing so that it doesn't simply run as fast as possible (otherwise it will consume all your CPU time which is probably what is happening). The PID attempts to make the process variable match the setpoint. So, for example, say you're trying to control speed by measuring wheel revolutions. The setpoint is the target speed. The process variable is the measured wheel revolutions. The output is the signal sent to the motor. Once you have that much working, you can look for help on how to tune your PID for better performance.