LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stepping or Ramping up a signal

I have a sine wave coming from a 'signal simulate' this will eventually go to an amplifier which will control a shaker. I need to the amplitude of the signal to be gradually or stepped increased when the rig is turned on and gradually decreases when the rig is stopped. How is this achieved ?

 

Thanks, James

0 Kudos
Message 1 of 9
(1,882 Views)

Hi James,

 


@Jamesbdowty wrote:

I have a sine wave coming from a 'signal simulate' this will eventually go to an amplifier which will control a shaker. I need to the amplitude of the signal to be gradually or stepped increased when the rig is turned on and gradually decreases when the rig is stopped. How is this achieved ?


When your "rig is turned on" then you ramp up the amplitude of the sine wave.

And when the "rig is stopped" then you need to ramp down the amplitude.

 

What is the problem?

What have you tried?

Where did you fail?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(1,881 Views)

Hi GerdW,

 

The amplitude will be established before, it a requirement that this is all automated,

 

Thanks, James

0 Kudos
Message 3 of 9
(1,844 Views)

Hi James,

 


@Jamesbdowty wrote:

The amplitude will be established before, it a requirement that this is all automated,


I never meant you need to change the amplitude manually…

 

What have you tried?

Where are you stuck?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(1,841 Views)

I dont really know where to start to be honest,

 

Any tips would be useful

0 Kudos
Message 5 of 9
(1,828 Views)

Hi James,

 

there is a Ramp function in the SignalProcessing palette: you can use it to create your ramps for the amplitude…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(1,822 Views)

A few breadcrumbs, I won't be able to walk you through all the details start to finish:

 

1. I assume you'll generate this signal with a Continuous Sampling AO task.   Look at the shipping example for "non-regeneration" which keeps writing new data to a task in a loop.  You'll be doing something similar.

 

2. To make life easier, I'd write the same # of samples every time *and* I'd make that size hold an integer # of sine wave cycles.  Then you can probably just calculate the data once and keep writing another copy of it to the task over and over.

 

3. In addition to this re-usable chunk of data, I'd make 3 other special chunks of the same size.  One will ramp you up to full amplitude, one will ramp you back down to 0, one will be a constant bunch of 0's because you won't be able to perfectly time your software stoppage with the exact end of the hardware ramp-down.

   You'll write the ramp-up chunk first, keep re-writing the normal chunk in a loop, then write the ramp-down, and finally write the chunk of 0's enough times to be sure you gave the shaker a soft landing.

   The snippet below shows how to take a normal sine wave chunk and make the other special chunks.

 

 

-Kevin P

 

ramped sine.png

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 7 of 9
(1,815 Views)

@Kevin_Price wrote:

you won't be able to perfectly time your software stoppage with the exact end of the hardware ramp-down.

   You'll write the ramp-up chunk first, keep re-writing the normal chunk in a loop, then write the ramp-down, and finally write the chunk of 0's enough times to be sure you gave the shaker a soft landing.

 

You can also just write your "ramp down" value once, then wait until you get a buffer underflow error, then stop your task. IIRC there are two possible errors that will be generated in this case but I don't have the specific error numbers in front of me.

0 Kudos
Message 8 of 9
(1,789 Views)

@BertMcMahan wrote:

You can also just write your "ramp down" value once, then wait until you get a buffer underflow error, then stop your task.

That's a good idea and will be a simpler way to be sure you end at 0.  You'll probably need to explicitly disallow regeneration (prior to starting the task) with a DAQmx Write property node as seen in the shipping example.

 

Many many years ago non-regenerating output tasks used to be pretty tricky to deal with, but DAQmx has gotten much better and handles things rather well these days.  You can see in the example that all you've got to do is call DAQmx Write in a loop and the driver manages all the details about timing and buffer locations.

 

 

-Kevin P

 

 

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 9 of 9
(1,783 Views)