LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx functions - update frequency

Hello community!

I am trying to make a servo controller vi in LabVIEW for a sg90 servo motor.

Currently, my vi allows me to set the servos position anywhere from 0-180 degrees. However its position is only updated about once every 2 seconds.

 

I can see that the daqmx write function is where the delay occurs but I cant think of a way to make it go faster.

 

I am wondering if this is a limitation of the software or if there is a way I can make the servos position update more "instantaneously".

 

In my current code, I have a sinewave generator which has the servo move across its full range by connecting its output to the duty cycle of the PWM signal.

My end goal would be to have a knob or dial which can move the servo smoothly through its range.

 

Any help or tips is/are greatly appreciated.

 

0 Kudos
Message 1 of 13
(226 Views)

Cannot open your VI.  Many of us (including me) are using earlier versions of LabVIEW.  Please "Save for Previous Version" and specify LabVIEW 2019 or 2021.

 

Bob Schor

0 Kudos
Message 2 of 13
(195 Views)

Apologies again...

0 Kudos
Message 3 of 13
(186 Views)

ZYOng_0-1713398107999.png

When Fs and #s are equal, that is one second worth of data points. DAQ device will output all the existing data from the FIFO before processing new data, hence the delay.

Why don't you use this example instead? PWM Servo Control with DAQ

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 4 of 13
(180 Views)

What hardware are you using? what are available at your disposal to use?

 

 

 

santo_13_0-1713398483631.png

 

Why are you wiring a waveform to a numeric input?

santo_13_1-1713398578336.png

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 5 of 13
(176 Views)

Currently I am working with an CDAQ 9174 and a NI 9263 which is purely an analog output card.

I think I have a few other types of units I could get my hands on, but I haven't considered any yet.

 

I have the sine wave as the input so that my servo will sweep over its range without requiring input. Previously, I had this input wired to a dial which achieved the same kind of control.

 

What I would like to achieve is having my output signal update at a high rate so my servo will move as I adjust its duty cycle input. What is occurring right now is that the servo position updates once every 2ish seconds.

0 Kudos
Message 6 of 13
(152 Views)

Try this implementation (VI attached in v16.0)

santo_13_0-1713414930349.png

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 7 of 13
(145 Views)

Santo_13, Thank you for providing that Vi.

 

Unfortunately, it is experiencing the same issue of updating position about once every 2 seconds.

 

I think that in order to solve my problem, I will have to download the "LabVIEW Real-time module" in order to get the response time I desire.

 

Thank you for your help anyways.

 

 

0 Kudos
Message 8 of 13
(113 Views)

Or perhaps! 

 

The timed loop structure is what I need? 

 

What I need is for the loop to write data at a higher rate of speed, so this timed loop I see may be what I need

0 Kudos
Message 9 of 13
(111 Views)

Hello,

 

I am trying to make a servo motor sweep smoothly across its range by sending a pulse signal which varies in duty cycle. 

 

My code currently runs my waveform and collects data points for 2 seconds before sending data to the "DAQmx write" function. When I highlight the execution, it looks like only the latter second of data is written into the buffer, which then plays for 2 seconds.

 

Is there a way I can maybe collect all of the data points over that time and *then* send it to the DAQ task so that the output has a pulse pattern where the duty cycle changes with time?

 

Any help or advice is appreciated!

thanks.

 

 

0 Kudos
Message 10 of 13
(139 Views)