LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Limit Mask Test Limit Trapezoid Profile

Solved!
Go to solution

So to one of our proportional valves, we are going to use the gain scheduling set point profile to create a trapezoidal input current to the valve. This trapezoidal input represents one cycle for the rocker arm we are controlling (it is periodic and this profile is repeated for many cycles). I'm creating a fail-safe system and am wanting to create a limit profile that is essentially an offsetted trapezoid of +/- 1 mA. The largest and smallest trapezoids would be the constraints and the middle one would be the input to the system. I want it where if the input current exceeds this inner or outer trapezoid, the system goes into the safe state. I've tried using the Mask and Limit VI and defined my upper and lower limits by making 4 different points for each limit but when I give it my input signal and observe the tested signal, all I see is the input to the system with a horizontal line at y=0 which is the green colored limit. I can get the constant upper and lower limits to work but I'd really like a closer more defined constraint since we are controlling a very big structure. What am I doing wrong? I've attached a picture of the input to the system.

 

-Thanks

0 Kudos
Message 1 of 5
(2,810 Views)

Hello,

 

Would you be able to post your code so that we may better understand what you are trying to do?

Regards,
Isaac S.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(2,774 Views)

Thanks for the reply! I've attached the VI I'm currently working with. The code is for only one cycle. We need it to repeat the trapezoidal profile repeatly but my other team members are currently trying to figure out how to do that as well as the rest of the control system (I'm only in charge of the fail safe system). But for my part I'm trying to take their output they're sending out to the proportional valve and put a constraint on it and if it goes outside these constraints, the system goes into a safe state. I've attached a hand drawn picture of what I'm trying to do. The purple and green lines would be the lower and upper boundaries of the output current sent to the valve.

0 Kudos
Message 3 of 5
(2,759 Views)
Solution
Accepted by topic author andrewjoe777

Hello,

 

I believe the issue is that you do not have enough datapoints defining your upper and lower limits.  You only placed coordinates for the vertices of each trapezoid.  The Mask and Limit Testing VI will not automatically generate datapoints between these points it needs a full set of datapoints defining the whole graph.

 

Your input data has much more datapoints than the actual boundary you've defined, that's why it appears as a line at y = 0.  It plots four points on a chart that probably that has much more data points on the input.  You should generate trapezoidal signals and wire those signals into the upper and lower limit inputs of the express VI.  That way you do not have to fill out all the datapoints manually.

 

Below I've attached an example LabVIEW project that shows how to do this.  I used this example to create a subVI to generate a trapezoidal signal.  It uses ramp functions to piece together an array of datapoints that looks like a trapezoid.  

 

I think you should use the "Generate Trapezoid" subVI I included in my project.  Generate the upper and lower trapezoids outside the while loop with the same amount of datapoints as you expect from your input data.  This should save processing so you don't have to generate the waveform each loop iteration.  It will look something like this:

 

ExampleFix.JPG

Regards,
Isaac S.
Applications Engineer
National Instruments
Message 4 of 5
(2,733 Views)

Ah, this is perfect!! Exactly what I needed! Thank you so much, Isaac!Smiley Very Happy

0 Kudos
Message 5 of 5
(2,702 Views)