LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using usb 6501 to track the position of 6 different stepper motors

I'm attempting to use 6 optical encoders to track the position of 6 different stepper motors. I understand that I can use port 2.7 as a counter, but won't that only be able to count one input? how would I wire the NI board to have 6 different counters? Or should I be going about this in a different way?

 

Thanks.

0 Kudos
Message 1 of 12
(3,570 Views)
With the 6501, you are basically hosed, as it only has one counter. You are going to need multiple counters. Are you married to the USB platform?

How fast are these motors moving? How many pulses per revolution on the encoders?

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 2 of 12
(3,550 Views)

But is there a way to use the other ports instead of just the counting port? Can you explain a little why the 2.7 port is different from the others in terms of getting the digital signal? The motors are moving about 1.5mm/s and there are 4000 pulses per revolution on the optical encoder. The motors also make bilateral movements so I need to detect 2 signals from each encoder.

0 Kudos
Message 3 of 12
(3,519 Views)
The problem is that unless you have a counter on each encoder output you are depending upon being able to sample the DIs fast enough to catch all the transitions.

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 4 of 12
(3,511 Views)

And what are maximum pulses per second you can get? 

Counters are dedicated hardware elements to count pulses (or generate them), very high resolution (~10 ns), very reliable - they do not skip pulses of sufficient amplitude.

If you are using software timed digital lines, your resolution is determined by software that can pause for a ms before getting data.

 

I would say 1 pulse per 5 ms down to 0.5 ms is doable, but requires care and work. Dedicated loop, track changes. The faster, the less reliable - you can start skipping pulses.

If you have smaller rate of encoder pulses, it is much easier and you do not require counter.

0 Kudos
Message 5 of 12
(3,491 Views)

One more thing - how wide are the pulses? Is it 50% duty cycle, or are they 1 us pulses? If pulse is shorter than 0.5 ms, do not even think about software timing - you will definitely skip pulses. Digital board with hardware timing will help untill certain pulse width - it is easier to get multichannel board than 8 channel counter board.

Another options - FPGA, 3-d party motion controller that gives you position over some interface - com, usb, etc.

0 Kudos
Message 6 of 12
(3,486 Views)

We are looking at about 1 pulse per 10 ms; any hints to start coding for that small of a resolution? it's 50% duty cycle.

0 Kudos
Message 7 of 12
(3,476 Views)

Help-> Find examples, Hardware I/O -> DAQmx -> Digital measurements -> Read Dig Chan.vi

Set delay to 1 ms and compare with previous iteration to detect edge on each channel (XOR for example). Edge type and value on the second channel will determine direction - increase or decrease counter. 

0 Kudos
Message 8 of 12
(3,431 Views)

I cannot run these as you need hardware timing for them. How do I create a software timed program that will detect the direction changes in the encoder? currently this program only gets about a forth of the counts as it should and im not sure how to go about detecting the A/B channel peaks in order to get positive and negative directions.

0 Kudos
Message 9 of 12
(3,333 Views)

examples\DAQmx\Digital\Read Values.llb\Read Dig Chan.vi is software timed.

Remove second read, your single read should iterate as fast as possible.

0 Kudos
Message 10 of 12
(3,320 Views)