SignalExpress

cancel
Showing results for 
Search instead for 
Did you mean: 

Quadratur Encoding with NI USB-6210 and LabView SignalExpress

Hello,

I would like to capture the position of a Motor. The encoder connected to the motor gives 500 pulses/rev on channel A and B. I have connected chA and chB PFI0 and PFI1 and GND to DGN.

The first thing I would like to know which Aquisition Mode I should use. I would like to capture the position over time, so I think I need "Continous Samples" but in order to do so I would need an external clock (according so LabView SE). So I tried "1 Sample", this gives me an angle and works so far, except that the calculated angles are not correct. I am suspecting that the samle period is too long. The smalles allowed period is 100ms, if I set it to a smaller value SE gives an error and asks to chose a longer time.

At the moment I am turning the shaft just with my hand, assuming 200rev/min would be a pulse every 0.0006s. Thats a lot shorter than the sampling period. Weird is that I get the same values if I turn the motor back and forth to the same two positions, what shouldn't be the case if I would miss pulses. 

So how can I increase the full speed of 80Mhz of the USB-6210 and what do I have to change in order to get the right angle? 

The Datasheet of the encoder is attached if this helps.

 

Thank you,

Tim

0 Kudos
Message 1 of 10
(8,766 Views)

Hey Tim,

 

It sounds like you have everything connected properly, so the incorrect angle measurement must be a result of incorrectly configuring the task in Signal Express. You'll need to verify the type of encoder (X1, X2, X4) that you've got and input that into the task.  Additionally, if there is a z input, you'll need to specify that as well.

 

As far as how you'd like to record the values, you need to figure out what makes sense for your application.  If you want to record every angle that the motor turns to (including all the transition angles), use the single measurement and record each of those values.  If you want to only measure the angle at certain times, you'll need to find a way to output a digital pulse whenever you'd like to measure and connect that to your external trigger line.  This way, you'll get a value every time the trigger goes high, instead of every value that is output.  

 

Please post back if you need more info.  Since this is in SE, it shouldn't be too bad to set up from the task and logging perspective.  Have a great day!

Sincerely,

Chris G in AE
0 Kudos
Message 2 of 10
(8,739 Views)

Hello,

 

I am trying to get a similar setup to work. I have a USB6251 and am attempting to configure and run a torque sensor and an encoder via Signal Express alone.

 

The torque sensor is configured as an analog voltage input, and runs as Continuous samples at 2kHz. This works wonderfully.

The encoder is 1024 cnts/rev and is connected to Counter0 and works fine when looking in the data view or when testing via MAX.

 

The issue I have is that I would like to log the encoder angle at the same frequency as the torque sensor. Running the encoder in "1 sample (on demand)" gives an update rate of 100ms. I cannot set the update rate to anything faster - it says the sample period is too short.

 

From your repose the solution looks to be to trigger the encoder acquisition via an external trigger. I was reading the the manual that the AI sample clock can be routed to an output pin. I would like to use the sample clock that is starting the torque sensor acquisition to trigger the encoder acquisition, but I could not find details of how to do that in Signal Express.

 

So do I route the AI sample clock to the trigger of Counter0 using signal express?

 

Thanks,

 

Jon

 

 

 

0 Kudos
Message 3 of 10
(7,846 Views)

I think I'm having maybe the similar problem with you.

 

I'm using USB-6343 ctr0 and ctr1 to measure the feedback from 2 elgo Lmix Linear encoder with 0.1mm resolution.

But the TTL signals voltage level from the linear encoder was not closed to 0 or 5V enough (0.5V at low level and 4.5 at high level), so I noticed that the positon value goes correct only in one certain direction but goes wired in another direction.

The solution is a Motrona signal converter GV204 or GV210(http://www.motrona.com/encoder_splitter.html), or a simply comparitors and push-pull transistor on breadboard can also solve it.  

 

The other problems of "Sample Period too short" also bothered me for a long time, and I also notice that the position curve have a slight jitter (but very obvious on Speed curve) at the exact moment of triggering.

 

I guess that when the "1 sample on demand" Acquisition Mode is selected, the Timing Base is NOT a Hardware Colck but a Software Timer which is quite not accurate, and it seems that the triggering may affect the software timing at the moment.

 

Luck thing is in my situation, the minimal sample period can be set to 10ms.

 

Now 2 person have the similar questions, so please anyone could offer a detail description?

 

Thanks......

 

 

YS

 

0 Kudos
Message 4 of 10
(7,198 Views)

I did some research and this is related to an issue that was fixed in NI DAQmx after version 9.1. Do you have a driver version later than that? If not, you can tell me what LabVIEW / SignalExpress versions you have and I can tell you what is the latest driver you can use (you can find the software version information in MAX).

 

If you do have a later NI-DAQmxversion than 9.1, you can try posting this issue on a new thread so it will probably be given better following. Please notice that it is originally from 2009, so it was closed already.

Camilo V.
National Instruments
0 Kudos
Message 6 of 10
(7,173 Views)

Cavarval

 

Hello, Cavarval-

 

Thanks for your reply.

 

I've searched on google for the err "sample peroid too short" with the result of NI Knowledgebase: http://digital.ni.com/public.nsf/allkb/9430D7F074BE8577862577300063CE97

 

But my NI-DAQmx version is 9.3.5.

 

And by the way, any other model of USB X series support hardware internal clock for Counter?

Or I have to buy a PCI/PXI interface DAQ? 

 

Because for the USB-6343, if N samples or Continous Sampling mode was selected to measure position by quadratur encoder, you have to assign the ctr# a external clock (internal clock can not be selected for counter), so you must use another PFI# /ctr# to generate a clock as external clock.. and route it back to another PFI# / ctr# (I'm not very sure my understanding is correct)..sounds difficult...

 

 

 

0 Kudos
Message 7 of 10
(7,162 Views)

Several things. I noticed that the NI Knowledge base you listed shows the error for 5s and in your case, it is 5ms (0.005s), so it is not actually the same problem. I got the same error at 5ms and I was able to avoid it at 10ms while running only the signal express task on the computer and at 25ms while running several other programs.

 

"On Demand" sampling means exactly what you stated; the acquisition is software timed and the computer will acquire as fast as possible. Software timed acquisition is limited not only by the software you use to acquire (in this case, SignalExpress), but by the whole computer hardware and operative system; if you are running a large amount of processes, it will likely require a higher value (this is confirmed by the results of my test). My suggestion would be to increment that value to a point where the OS is "comfortable" with so you can avoid the error.

 

Next, you can use an internal clock source for an X series USB device. In your device's case, you should be able to use any counter internal output in LabVIEW. In SignalExpress I believe that functionality is not possible, so you can try what you suggested yourself: creating a counter output task, input it to another counter PFI and use it as an External Sample Clock. Your device has 4 counters, so it should be possible to reserve 2 for that purpose.

 

I hope this answers your questions. If you still have any, I will tray to help you further. However, if that is the case, I still suggest posting in a new forum thread due to this post's original date (2009); usually, new threads are easier to follow.

Camilo V.
National Instruments
0 Kudos
Message 8 of 10
(7,132 Views)

Dear.

 

I need to use a flow meter (manufacturer Omega, model FPR-303).

This flow meter has three cables: red, white and black.

 

According of the Omega, the red is the sensor power supply (5-24 V DC and 2 mA current), white is the signal and black is a ground. 
The sensor`s output is current sinking pulse (6-24 Vdc), the sensor input on PLC can accept a current sinking device and the PLC frequency response > flow meter output frequency.

 

My plan was use the NI USB-6210 to edge count and determination the flow according with factor-k that i obtained by manufacturer.

 

I read the USB-6210`s manual and connected the red in +5V, white in FPI 0 for crt0 and black in DGND, all of the wires in Digital I/O side.

 

I have tried to use the NI USB-6210 on my Labview SignalExpress.

In Labview SignalExpress i did: Connected the NI USB > Add step > Adquire Signal > DAQmx Adquire > Counter Input > Edge Count. I choose the falling active edge and Sample On Demand.

 

I have tested the NI USB-6210 and flow meter, but i do not have success.

How i connected the cables, does NI USB-6210 take a sinking or sourcing pulse signal?

 

Is NI USB-6210 applicable in this case?
If it is not, please, tell me the appropriate equipament.

 

Regards.
Tallita Nunes

0 Kudos
Message 9 of 10
(6,466 Views)
Hi Tallita,
 
As a first step, I would check the way you are wiring your flow meter to the USB-6210. If you check the manual (http://www.ni.com/pdf/manuals/371931f.pdf), page 99 and 129 of the PDF may provide you with more information on how to use the counters on the 6210. 
 
If you have any more questions, I would suggest creating a new forum post since this is an old thread and new threads will have more traffic.
0 Kudos
Message 10 of 10
(6,441 Views)