LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Segment signal generation

Solved!
Go to solution

Hi!

 

How is it possible to generate such a signal (picture attached)?

https://pp.vk.me/c622024/v622024951/33e6f/I3zJNTMGiU0.jpg

 

A link to the answer (if there is one in this forum) would be awesome.

 

Thanks 

0 Kudos
Message 1 of 13
(3,637 Views)

Hi Negvet,

 

There might be a better way to do it, but here is a solution 😉

 

signal.jpg

CLAMaxime -- Kudos are a great way to say thank you
0 Kudos
Message 2 of 13
(3,621 Views)
Solution
Accepted by topic author Negvet

That may work for a graph where it will automatically draw lines between the points.  But if this is signal generation, it won't look like that.

 

Look at the Ramp Pattern function.  Use that to build the sloping parts of the signal, and Initialize array to build the zero parts and the flat parts.  Then use Build Array with concatenate inputs in order to combine those arrays into one.

Message 3 of 13
(3,613 Views)

Thanks for the correction RavensFan 🙂

 

Just a question : how would you force the slopes to be between c and d or e and f ? Would I need to determine a "dt" for each slope ?

CLAMaxime -- Kudos are a great way to say thank you
0 Kudos
Message 4 of 13
(3,604 Views)
Solution
Accepted by topic author Negvet

To quote RavensFan -- "Look at the Ramp Pattern function".  If you are running "modern LabVIEW", go to the Block Diagram, type Ctrl-Space to bring up Quick Drop, and type "Ramp Pattern".  Choose it, type <Enter>, and examine that VI.  You should be able to figure out the answer to how to generate the slope.

 

Bob Schor

Message 5 of 13
(3,576 Views)

Many thanks. I did it using Ramp pattern VI and for loop.

The result is attached.

 

Now I need to sent this result to control and simulation loop.

This signal have to be desired position of my actuator insted of Knob (now I set the desired position using knob). check the attached vi.

 

But as I found out it is impossible to put 'for loop' inside of 'control and simulation loop'.

'control and simulation loop' also do not want to read updated signal from the outside, if I place my signal generation (using Ramp pattern VI and for loop) outside of 'control and simulation loop'.

 

Coul you please suggest somth?

 

THANKS

 

Download All
0 Kudos
Message 6 of 13
(3,515 Views)
Solution
Accepted by topic author Negvet
When working with analog out remember that dt and slope are two very different things. The time between samples is very easy to set, but at the analog output there is no such thing as slope. The output is at one level until you tell it to go to a different level at which point there is an abrupt step in the output to the new level.

True, you can subdivide a large change unto a series of smaller ones, but you haven't changed the fundamental problem -- you just made the steps smaller.

The only way to give a real slope to the output is with a hardware low-pass filter that removes the high frequency components contained in the step.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 13
(3,499 Views)

Ramp Pattern produces all of the points of your Ramp waveform.  Instead of taking all of those points and bring them, one at a time at 10/sec, into a Waveform Chart, replace that For loop with a Waveform Graph -- note that you get the entire waveform, all at once.  In your plotting example, you "chose" a delta-t of 100 milliseconds.

 

Your output loop seems to have an Express VI that outputs one sample.  If you wrap that in a For Loop (as you did your Chart) and clock it with a 100 msec delay, you should get it to reproduce what you see in the Chart.

 

Bob Schor

0 Kudos
Message 8 of 13
(3,478 Views)

Mike,

 

Thanks for the answer

 

I also thought there is some fundamental problem..

But there is really no solution on sortware?

I am very new in Labview, so maybe I did't explain properly what I need.

 

On the figure you can see that I use sine signal for my purposes. 

But I hope that there is a software way that I can use signal from the array (I need it!), like on the below part of the figure, instead of the sine signal. Let it be executed in 10 seconds for example..

But may be here is a mistake 

 

Thank you!

0 Kudos
Message 9 of 13
(3,459 Views)
Solution
Accepted by topic author Negvet
Put your control code inside a for loop to get a single point at a time from the ramp.
0 Kudos
Message 10 of 13
(3,452 Views)