08-11-2017 09:18 AM
I'm trying to create a closed loop for my system, but I'm having some trouble figuring out how to implement it. Currently, I'm just doing something simple where I command a current (gets transformed to voltage by a linear relationship), and sends this to the power suppply. The power supply then responds with a current. For example, if I give it an input of 1A, I will read 0.97A from the power supply. I have also added a range to check whether the output is within 1% of the input. If not, then I update the input with the error term to send it more current (i.e 1A actually sends 1.05 to get closer to the 1A output as expected).
I'm having some issues figuring out how to do this properly, as I want the user to be able to manually change the input current and my control system to respond accordingly. Currently, I believe my control system and input current are interfering with each other causing unstable results as they are "competing". Please let me know what you suggest I change. Thank you
Solved! Go to Solution.
08-11-2017 09:34 AM
If I told you to go east and someone else told you to go west, which one are you going to listen to? You obviously can't listen to both of us. Either your power supply automatically outputs a programmed value from the control loop or it outputs a value from the user. You could have a boolean select that tells the control where to get its input value. of you could do a compare and if the user value is different than the control value, use the user value.
It's really difficult to tell what you are doing because the block diagram is so large and the image is small.
08-11-2017 09:38 AM
Yeah, that makes sense. I just didn't know how to solve the east vs west issue without having to change a lot of my diagram and I'm also new to LabVIEW so i'm still trying to grasp all the functionality.
In terms of the picture, would uploading my vi file help?
08-11-2017 09:43 AM - edited 08-11-2017 09:43 AM
Yes the VI would be helpful. Even more helpful (for those of us that have older versions of Labview, 2012 to be exact) is to create a VI Snippet....from the Edit menu. The Labview code is embedded in the PNG file and can be dropped onto a block diagram. It's a very useful tool for sharing code on forums.
08-11-2017 09:48 AM
Awesome, thanks! I didn't know the sniplet tool existed.
I have attached a sniplet and my VI file.
There's probably a way easier way to do what I'm trying to accomplish...
08-11-2017 10:34 AM - edited 08-11-2017 10:54 AM
I would create a subVI that acts as a PID function (if you don't have access to the PID addon). Basically this subVI would have a process variable input (which is the DAQ value that is read from your device) and a setpoint input value. Inside this subVI is where you will scale the values and calculate a new setpoint based on the current value. Something similar to the image below....what goes in the PID VI is up to you. You'll want to put the code that clamps your program value to +/-1% in this subVI.
08-11-2017 10:55 AM
Thank you very much for your help, I appreciate it.