LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate ramp voltage and keep it constant (cRIO and NI9263 - scan mode)

Hi there,

I hope you will be able to help me out with a relatively simple task, i.e ramp voltage generation. 

I should control a slope in ms (10-150 ms) of the ramp signal as well. The initial value is always zero. The maximum varies, I need to control it from the front panel. And I should be able to achieve the same maximum value with different slopes in ms. So I reckon calculation of the ramping slope won’t be helpful. Well the voltage reaches its maximum value, it should be constant. And after that I resetting this signal back to zero (manually from the front panel). So I don’t need a saw tooth generator, but a simple ramp generator.

I know about the ramp_pattern.vi but by using the “ramp by samples” mode I could not achieved the desired results.  Either in terms of the maximum ramping value, or the slope in ms.

 I’ve done some research over the forum as well, but could not a suitable solution for me.

https://forums.ni.com/t5/LabVIEW/staircase-ramp/m-p/3157979

The example from this thread is quite similar to what I am trying to achieve, but at the same time, I don’t need this stairs pattern. But could not work through how to simplify the presented code.

https://forums.ni.com/t5/LabVIEW/creating-ramp-and-constant-in-combination/m-p/206980

Similar situation, but in this case I could achieve the slope and the maximum ramp signal voltage at the same time.

Hardware:

cRIO 9068 and an NI 9263 AO (AO0 node in the attached code – STL freq meas.vi – STL freq meas.vi).

This AO control code is part of my acquisition code (controlling the voltage and measuring other parameters at the same time). It works in the scan mode with a sample rate of 5 ms.

A lot of other threads focus mainly on DAQ boards or still unsolved…so, if somebody has a clue to do this simple task, will highly appreciate any suggestions. Have a good one.

 

Download All
0 Kudos
Message 1 of 10
(5,301 Views)

Have you seen this example the NI provides?

 

 

Configurable voltage ramp generator with DAQmx:
https://forums.ni.com/t5/Example-Programs/Configurable-voltage-ramp-generator-with-DAQmx/ta-p/351512...

0 Kudos
Message 2 of 10
(5,240 Views)

Hi,

Thank you, I definitely overlooked DAQ examples. However the issue is that this approach does not give a constant value, after it reaches its maximum.

 

Capture.JPG

Any suggestions, what can be done in order to get the desired results? Thank you!

0 Kudos
Message 3 of 10
(5,215 Views)

Could you possibly write a 10V signal immediately after the ramp ends? I'm not sure if this will still create a dip or not. I'm not sure if this method is actually writing a 0, or if it just no longer writes any values. If it doesn't write any values, righting a 10V immediately after could cause it to stay at 10V. Worth a shot

0 Kudos
Message 4 of 10
(5,201 Views)

Hi, 

Yep I was thinking about it as well. Not sure that I implemented the best solution, but still. I am picking up the last value of the ramp signal (10V for instance) and comparing it with the "final value" of the ramp setting from the front panel.

It triggers the switch after it and I am getting "Ramp-constant" (was using it as a buffer to check the value, before pass it further). 'Ramp trigger" sends the signal to the main switch. And after that with the main switch I can choose between full control of the voltage level (AO0), step signal (up to 10V) and ramp signal. In general looks like the system works. But what I've noticed after a test, is that the slope is not 20 ms (as I was introducing into the ramp system).

In the picture it can be seen that the slope is 1 ms, it is the same delay as when I am sending a step signal.  After that I've changed the Final value to the switch with 0 and 10 V constants, to start up the ramp generation. Still the same outcome. Do you have anything in mind what I am doing wrong? Thank you for any tips...

Download All
0 Kudos
Message 5 of 10
(5,189 Views)

Hi ESturov,

 

why do you append the "initial value" to the end of your ramp?

 

(And why is this wire hidden behind some text?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(5,178 Views)

Hi GerdW,

 

Could you specify please? Because as far as I can see, I am assigning the final value of 10V to the end of the ramp signal.

And what text and wire? If you are talking about the wire from the "Initial voltage" goes around the text "Ramp by samples" to the build array and the indicator "Initial voltage 2". Hopefully you are asking about that wire. Thank you.

 

Best Regards

ESturov

 

 

0 Kudos
Message 7 of 10
(5,164 Views)

Hi ESturov,

 

I'm talking about the marked items in your image:

check.png

- You append the "Initial Voltage" as last element to your ramp array.

- The wire is (mearly) hidden by the selector text of that polymorphic function - at least in this scaled down image…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 10
(5,151 Views)

GerdW,

 

You are absolutely right, I see this mistake. Fixed, but I still an issue with the ramp generation. The ramp plot is perfectly fine, but when the signal goes to AO0, it does not pick it up. I am getting only maximum value (10V in my case), without a ramp pattern. So it looks like a step response generation. 

How can I get the desired ramp signal? Thank you in advance.

 

Best Regards

ESturov

Download All
0 Kudos
Message 9 of 10
(5,131 Views)

Hi ESturov,

 

so yu create a waveform consisting of a lot of samples (aka an array of samples).

Then you write this waveform to your AO ScanEngine IO node, which is expecting a scalar value.

You also ignore this red coercion dot and completely miss its meaning - but still you wonder about the output signal of your hardware… 😞

 

You need to output those samples one after the other (aka in a loop!), using the correct timing!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(5,122 Views)