From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3 Possible Set points

Good day to every one! I'm new here, and to programming in NI LabView. I am trying to come up with a program for a wind turbine yaw system. I have 2 angle sensors from HiTechnic from which I obtain Accumulated angle data and Shaft RPM data. What I have done so far is to get an instantaneous reading , 30 second average, and 10 second average of the RPM reading. These each of these readings are then compared to a max and minimum value. If the value is in range, setpoint returns the value of the accumulated angle, if out of range (x<min; x>min) setpoint is accumulated angle + 90 degrees. Now I have three possible set points that can be used. Problem is, I can only use one with my PID. I would like to ask if you guys have any idea as to what can be done so that only one among the three will be used as setpoint. Conditions: assume range is 50 RPM = minimum, 100 RPM = Maximum if 50 RPM 70 RPM; setpoint + 90 if instantaneous RPM > 100 RPM; setpoint + 90

0 Kudos
Message 1 of 8
(2,744 Views)

sounds like much, but possible...show us what you have done so far?

0 Kudos
Message 2 of 8
(2,738 Views)

Here is what I have done so far, sorry for the messy block diagram, I'll clean it up after i make it work.

0 Kudos
Message 3 of 8
(2,711 Views)

It is difficult to trouble shoot an image, especially one a messy as yours.  If you have a recent version of LV, the Diagram Cleanup button will get you a much nicer diagram in one second.  It is far from perfect but better than nothing.

 

How do you decide which setpoint to use? You need to implement that decision logic in your code. Just as you use the Selector primitives to choose whether to use the 90 degree added value, you can use Selectors to choose which setpoint is connected to the PID. Since you have more than two chioces a case structure might be better.

 

Lynn

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

Good day!

Sorry for the messy diagram. I'll upload the cleaned up VI this time.
I wish to take all the cases into account since that what a real yaw system would do.
Lets say a wind turbine plant is running, when the 60 second average wind speed is inside the range where it can harness useful energy, the turbine is yawed windward, otherwise, if the 30 second average wind speed is greater than the upper limit, it will be yawed 90 degrees away. Lastly, if there occurs an extreme gust, i.e., the instantaneous wind speed is higher than the set limit, it is again yawed away 90 degrees.

I have attached the VI this time. 
Thank you and Godbless!


0 Kudos
Message 5 of 8
(2,680 Views)

Why the double shift registers that are taking the same data to the next loop iteration?

Why the sequence structure?

 

I cleaned up your code further to eliminate those problems.

 

All you need to do is use simple boolean logic.  You have 2 output values.  You want the output to be one thing if All of 3 conditions are true.  Or you want it to be something else.

 

So just use boolean logic with the compound arithemetic node where you AND all 3 conditions together to give the normal output, otherwise it gives the +90 degree output.

 

See attached modified VI.

 

 

Although it didn't seem to be necessary here, remember you can chain together Select functions.  You can send the output of one select function to the input of a following select function.  In this image, the condition A determines whether a 1 or 2 gets sent on.  But condition B can override that if True and send out a 3.  It's really not any different from an If Then ElseIF Then Else statement in a text based language. 

In this case
If B then
   output 3
ElseIf A then
   output 1
Else
   output 2
EndIf

 

Download All
Message 6 of 8
(2,675 Views)

I used 2 shift registers for the PID, sorry for the primitive method. 🙂
The sequenced structure is because there are other things the program does before the main yawing process.

0 Kudos
Message 7 of 8
(2,660 Views)

there appeared a bunch of problems with the VI, and I can't run it. but the solution makes sense.
now i'm hitting myself on the head saying "why didn't i think of that?" haha.



0 Kudos
Message 8 of 8
(2,657 Views)