LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pid feedback voltage

Hi

 

I'm using ohm's law to control a system. I have the resistor (100ohm) and i need to choose the current ( for example : 100mA or 50mA, the user will select the value of current ). LabView would recognize the voltage to feedback the system...

 

I don't know how to put this control, i'm using pid control but the set point is manual, i'm putting the value of set point.

 

How can i leave the automatic feedback  ?

 

Sorry for my bad english.

0 Kudos
Message 1 of 4
(2,342 Views)

Sorry, I don't understand your question. Do you need PID control for this project? What are the setpoint, the process variable, and the output?

 

You put the DAQ Output outside the loop, so you will set the output only once after the loop stops. That's probably not what you want. Move the DAQ output into the while loop.

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

Set Point: Current = 50 mA

Process Variable = Current

Manipulated Variable = Voltage

Resistor Shunt = 100 ohm

 

I need 50 mA in my circuit....the resistance of potentiometer varies alone....

 

 Voltage Input = PID DAC                        Current = Set Point                   Resistence Shunt = 100Ω             and                     a potentiometer ..

 

when I change the resistance of the potentiometer, the current change too....  Ohm's Law ...  U= Rshunt .I       U/R= i     If i need 50 mA    so,      U/100Ω= 50 mA    

Labview will try to put a voltage to get the current from set point....for example:   I want 30 mA .... labview will send 3V to output ...  3V/100Ω = 30mA .... but the resistence of potenciomenter changed and the voltage droped....

So the labview will send more voltage to the input to supply the circuit and get the 30mA again.

 

I tried 1million times, but failed.

 

PID will control the input voltage to get the set point current.

0 Kudos
Message 3 of 4
(2,311 Views)

There are several possible issues here.

 

The first problem, as I already mentioned, is that the DAQ Output is outside the while loop, so the voltage never changes while the loop is running.

 

What hardware are you using to generate the analog output? Is there some sort of amplifier? Many of the NI analog outputs cannot generate more than 5mA, so you'll never hit 50mA even if there's no resistance through the potentiometer.

 

In your screenshot, the current value is wired to the dt input of the PID Autotuning function. Why would you wire amps to an input that should be in seconds? You can leave dt unwired.

 

If the process variable is current, then the setpoint should be the same units (amps), but the control that is wired to the setpoint is labeled Voltage Output.

 

I recommend that you start with the simple PID VI (not the Autotuning version) and tune it by hand to see how it works, once you get all the inputs wired correctly.

 

There might be more issues but those are the ones I see quickly. If there's no timing structure in your while loop, there should be one (the Wait(ms) function is a good choice). Also, eventually you should replace the Express VIs with the DAQmx VIs, and get away from the dynamic data type.

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