LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using DAQ USB 6001 with Labview to read DC encoder

Hello,

 

so I'm using an DC motor with an encoder to control the angular position of needle attached to the motor. In order to read from the encoder to keep track of the angular position, I need to constantly monitor ports on the DAQ attached to the encoder. On Arduino I could use an interrupt with attach_interrupt() to constantly monitor the ports attached to the encoder and call a corresponding function. I don't believe the DAQ USB 6001 has that interrupt option. Is there any way to perhaps modify the DAQ assistant in Labview to constantly monitor the ports attached to the encoder like a interrupt in Arduino?

 

Any suggestion is appreciated.

0 Kudos
Message 1 of 7
(293 Views)

Hi slacker,

 


@Sliferslacker wrote:

Any suggestion is appreciated.


The USB6001 comes with a counter. Use the counter to count the encoder pulses…

Best regards,
GerdW


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

Hello,  I just wanted to also confirm that I can use the PFI 0 and PFI 1 ports to perform PWM to control the DC motor speed?

0 Kudos
Message 3 of 7
(252 Views)

Hi Slacker,

 


@Sliferslacker wrote:

I just wanted to also confirm that I can use the PFI 0 and PFI 1 ports to perform PWM to control the DC motor speed?


Read the specs of your DAQ device!

AFAIK the USB6001 only supports a counter, but no PWM output…

Best regards,
GerdW


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

Hello, sorry if this is a stupid question because I'm new to tabview.

 

Since DAQ 6001 doesn't have PWM. Would a possible solution to control DC motor speed be to use a signal simulator express to create a square wave. I can control the frequency of that square wave hence produce effects similar to PWM. Then feed that square wave into a DAQ assistant to generate the corresponding square wave that would hopefully have similar effects to PWM and control the motor speed. Would that be possible? Once again I'm new to Labview so I'm not sure what is and isn't possible. 

 

Thanks and regards.

0 Kudos
Message 5 of 7
(223 Views)

Hello, 

 

So I'm trying to use Labview and DAQ USB 6001 to control a DC motor with a built in encoder. I was told the DAQ 6001 doesn't have PWM to control the motor speed. I was wondering if a valid solution be to use a simulate signal from the input express in labview to simulate a square wave and I can control the frequency hence mimic PWM. Then input this simulated wave into a DAQ assistant to generate the signals to the port that controls speed of the DC motor. Would that be a possible solution?

 

Also in terms of reading the rotary encoder, I need to attach the encoder signal pins to the PFI 0 and PFI 1 pins on the DAQ 6001 and use the counter in Labview to count rising edge correct? 

 

I'm open to any suggestions and information, Thanks

0 Kudos
Message 6 of 7
(225 Views)

Hi Slacker,

 

please keep your discussion in one place instead of creating multiple threads on the very same problem!

 


@Sliferslacker wrote:

I was wondering if a valid solution be to use a simulate signal from the input express in labview to simulate a square wave and I can control the frequency hence mimic PWM. Then input this simulated wave into a DAQ assistant to generate the signals to the port that controls speed of the DC motor. Would that be a possible solution?


Well, as I wrote before: read the specs of your DAQ device!!!

 

The DIO pins are rather limited for your cheap DAQ device and don't support timed IO. You can use an AO channel instead with upto 5kS/s…

 

I also recommend to stay away from ExpressVIs and use plain functions instead. Learning DAQmx is quite simple by following this article!

All the basic DAQmx features are explained in the example VIs found in the example finder…

 

 


@Sliferslacker wrote:

Also in terms of reading the rotary encoder, I need to attach the encoder signal pins to the PFI 0 and PFI 1 pins on the DAQ 6001 and use the counter in Labview to count rising edge correct? 


Did I suggest to read the specs of your DAQ device before?

 

The specs clearly mentions you can use PFI0 OR PFI1 for the single counter of your NI6001…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(199 Views)