Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

balancing three variables to one setpoint

I have a system with three input variables A1, A2, A3 (Min: 0, Max: 10) and output variables  B1, B2, B3 (approx output range: Min:0, Max:180) 

I can control A1, A2, A3 and read B1, B2, B3 using GPIB and a data acquisition card.

In LabView I would like to create automatic balancing of  B1,B2,B3 at certain setpoints (ie. setpoint 30 means that I want B1, B3 and B3 to be equal to 30) 

The system works pretty straightforward: increasing(decreasing) A1 increases(decreases) B1 but also increases (decreases) B2 and B3 by smaller value. 

I tried using PID for this but with no success. Maybe I am doing something wrong but it makes input variables jump from Min to Max and so on forever no matter what Kp,Ki,Kd values I put. 

If any more information is needed just ask. I can share my block diagram, screenshot etc.

Any help will be appreciated. Please be gentle as I am a beginner. 

 Thanks

0 Kudos
Message 1 of 8
(4,194 Views)

Hello RafalM,

 

There are a few things to consider with this kind of application.

Can you please let me know what version of LabVIEW you are using? Also, are you using the provided PID VIs? Or did you use your own algorithm?

 

In order to have a reasonable control loop applied to a system you would need at least 100 cycles a second I would say, or if you need fast feedback control, then probably 300 cycles per second minimum. What sort of speeds of communications are you achieving at the moment with your GPIB? What form factor is the GPIB? If you are using a GPIB-USB device, then this would be quite insufficient for a control application. If your response doesn't have to be that fast, then GPIB would be ok.

 

I would think that you are seeing this radical behaviour because of timing issues. Your loop needs to execute fast enough for the PID to output values that ramp up smoothly. You could try executing the PID loop in parallel to the acquisition instead of in the same loop, if you are not already doing so.

 

Have a look at the examples that come under your Help menu (Find Examples) within LabVIEW as well, they are extremely useful. Type "PID" in the search tab and you should get a couple of good examples.

 

Let me know what you think and I will try to help further as best I can.

 

Kind Regards,

Michael S.
Applications Engineer
NI UK & Ireland 

0 Kudos
Message 2 of 8
(4,168 Views)

Hello Sahpek,

Many thanks for your reply. 

 

I am using LabView 8.5 and using the provided PID VIs.

I am using a PCI GPIB card. I do not know the communication speed. I guess I can check the 'cycles per second' speed by counting time in the main loop, is that right?

But I think that time may not be that important here. The controlled proces response is slower than 10 cycles per second. The sampling frequency of the device that provides B1, B2 and B3 is in the range of 100s of ms. 

 

Since my last post I have been trying to fix the problem. I rebuild the PID control and gave the three values separate PID gains. In the end I managed to overcome the jumping output value by adjusting Kp, Ki and Kd values. ( 0.0004, 0.0010, 0.0010 respectively) 

The output signal from PID became slower and more stable. The process now is controlled better. The output values get balanced for most cases. But not as well as when manually balancing them using UP and DOWN buttons on the controlled system. 

 

There is another problem here: the output of PID VIs is an analog value. I feed it straight to the DAQ and from DAQ to the controlled system which has three INPUTs (0...10V).

The system consists of three DC motors that control variable transformers and these influence the output variables of the controlled system - B1, B2 and B3. 

Now the problem is that these motors have some inertial behaviour by which I mean that if the signal fed to them increases slowly they do not respond until the signal has increased a great deal. But if the signal fed to the DC motors is descrete - motors respond quicker.

 

Let me give an example: Lets say that B1 value is almost in balance, just a bit under the setpoint. PID starts increasing the signal very slowly, maybe in the rate of 0.005V per second. Before the motor responds to the increase, the signal has already risen 20 times (0.1V altogether). But if I manually feed a change in the signal of 0.03 - the motor responds immediately. 

 

This makes it impossible for B1, B2, B3 to be balanced even as acurately as manual balancing by pressing buttons up/down for controling the motors. 

 

I do not know much about DC motors but I think that, if I want to push the motor by "x", if instead of slow change I could apply a step back "-10x"  and subsequent step forward of  "+11x" then the system could perform better.

 

Do you have some Ideas on how to solve this problem? 

 

0 Kudos
Message 3 of 8
(4,156 Views)

At first I would try to measure the stepresponses at various setpoints.. and try to find out how linear the system is. (According to Murphy .....    ) 

(good chance three heater , three sensors..... worse is stuff like airflow systems ... )

As a last resort I would suggest to try a neural network, however more information about the physical system would help..

Looptime might be critical, maybe not (If you control the house temperature 5 minutes looptime is fine, but will fail in your coffeemaker 😉

How critical is a overshot?

Can you measure the output voltage of your transformer? (You don't really need it, however it might ease things) 

 

Message Edited by Henrik Volkers on 05-12-2009 09:24 AM
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 4 of 8
(4,129 Views)

Bad idea to control the dc motors of a variable transformer with an anaolog PID output. The motor will heat up. Better to calculate a new position and drive it in steps ...if possible....

Sounds like (slow) heaters...   

Give us more information, your requirements to the setpoint, timings ..... 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 5 of 8
(4,127 Views)

Ok, I will measure stepresponses - but I think that the controller sais that 0- 10V is 0-100% which indicates linearity.

Physical system is 3 variable transformers controlled by DC motors. There is a big 3 phase transformer powered from 3phase socket in the wall, it powers three variable transformers each of them from one of the phases. These variable transformers, each controlled by a DC motor, are used to magnetise a three phase transformer core under test. I know there are a lot of transformers here, but it is simple when you think about it: One transformer supplies "power" for the three variable transformers, those three variable transformers supply three phases of the transformer under test. 

 

Overshot is VERY important. Problem is that when magnetising the test core to high flux densities quite high current is needed from the variable transformers - ~5A... The measurement equipment allows for maximum 10A. But if overshot is too high the current will rise quite a bit more than it is desired. 

 

Looptime - do you mean "if I want the algorithm to go faster??" - no, I am ok with balancing within 2-3 minutes

I can measure output voltages of the variable transformers if you mean this. 

In the normal course of action I measure the secondary voltages on the transformer under test - and these three voltages are the values that are to be balanced.

 

Setpoint: With manual control of the variable transformers I can achieve as low as  0.05 % for high range of output values ( output ranges from 10 to 190 - achievable tolerance is 0.1 - ergo I go as precise as 0.05%) But with PID (ok, I know now that it is not good for this purpose) I could not make it as precise - this is the remaining problem. 

 

I hope I answered all questions to your satisfaction. Thanks for help and I am waiting for more.

Message Edited by RafalM on 05-13-2009 10:48 AM
0 Kudos
Message 6 of 8
(4,102 Views)

RafalM wrote:

Ok, I will measure stepresponses - but I think that the controller sais that 0- 10V is 0-100% which indicates linearity.

 

Oh, Oh,  I ment the linearity of your system under test!  Since it's a transformer core it should be possible to create a modell

 

Physical system is 3 variable transformers controlled by DC motors. There is a big 3 phase transformer powered from 3phase socket in the wall, it powers three variable transformers each of them from one of the phases. These variable transformers, each controlled by a DC motor, are used to magnetise a three phase transformer core under test. I know there are a lot of transformers here, but it is simple when you think about it: One transformer supplies "power" for the three variable transformers, those three variable transformers supply three phases of the transformer under test. 

 

Overshot is VERY important. Problem is that when magnetising the test core to high flux densities quite high current is needed from the variable transformers - ~5A... The measurement equipment allows for maximum 10A. But if overshot is too high the current will rise quite a bit more than it is desired. 

 

Looptime - do you mean "if I want the algorithm to go faster??" - no, I am ok with balancing within 2-3 minutes

I can measure output voltages of the variable transformers if you mean this. 

In the normal course of action I measure the secondary voltages on the transformer under test - and these three voltages are the values that are to be balanced.

 

Setpoint: With manual control of the variable transformers I can achieve as low as  0.05 % for high range of output values ( output ranges from 10 to 190 - achievable tolerance is 0.1 - ergo I go as precise as 0.05%) But with PID (ok, I know now that it is not good for this purpose) I could not make it as precise - this is the remaining problem. 

 

I hope I answered all questions to your satisfaction. Thanks for help and I am waiting for more.

Message Edited by RafalM on 05-13-2009 10:48 AM

May I ask for your technical background?  Ever heard lectures on control theorie or technique?

Just to know where to start. 

 

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 7 of 8
(4,088 Views)

Henrik Volkers wrote:

Ok, I will measure stepresponses - but I think that the controller sais that 0- 10V is 0-100% which indicates linearity.

 

Oh, Oh,  I ment the linearity of your system under test!  Since it's a transformer core it should be possible to create a modell

I am not sure what you mean.

Let me try to explain this: induced secondary voltages  of the transformer are dependant of flux density in the core, number of windings, frequency and cross sectional area of the core. The formula is: Uinduced = 4 * Bpk * N * F * A    Even though this is a straight forward linear dependancy, power loss calculated based on three watmeter method is not linear. (calculated using primary winding currents, secondary winding voltages and phase shift angle between them)   see  here for an example curve 

 

 Is this what you asked for ??

 

[...]

May I ask for your technical background?  Ever heard lectures on control theorie or technique?

Just to know where to start. 

Control theory rings a bell. I had some lectures in this area during my studies. But I do not think I am too well prepared to do this on my own.
0 Kudos
Message 8 of 8
(4,085 Views)