Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to erase Encoder-Backsteps?

Hello
I have a problem with my USB-6210 Multi-I/O. I want to get the linear position of an encoder. Unfortunately, my encoder don't counts linearly. There are unwished backsteps. Does anybody know, how to get a better measurement. I tried several parameters to get a better mesurement, but there was no success.
Look at the pictures. There you can see the backsteps and the VI.
 
Thanks for helpful advises
 
 
Download All
0 Kudos
Message 1 of 9
(3,536 Views)
Hi Schleumi,

What I see is that you did not take the right inputs for your counter.

Can you try with the right one?
Have a look on the picture attached.

Regards.

Matthieu

NI / Switzerland
0 Kudos
Message 2 of 9
(3,514 Views)

Hello Matthieu

Thanks for the answer. I allready changed the inputs. So the Input was not really the problem, because I tried that before. But I turned the axis to slow. Therefore I lost steps. Now I have a better measurement. But there's a further question:

I synchronized my analog and encoder input by a Pulse-Generation-Frequency. Do you know, if that's a good solution? Or would it be better to take another source. For example the timebase with 20MHz? But there I have the problem, that I have to deal with a lot of measurement data. I'm not absolutly sure, if the Frequency-Generator delivers the best result. My resolution don't have to be really high, so perhaps the Frequency-Generator isn't too bad. If you have some experiences with that, it would be glad if you can give me an advice.

 

Thanks

Schleuni

0 Kudos
Message 3 of 9
(3,509 Views)
Hi schleumi,

Depending on what you want to do with the counter state and how many times you want to read it, the solution with the counter is pretty great.
The most advantage is that you can configure the read-update frequency that you want.

Take care that this solution is a buffered counter measurement and that you receive the data in your programm only when the configured buffer is full...
PS: The rate that you configure for the counter is derived from the onboard clock (10 or 20 MHz on your card).

Matthieu

NI Switzerland
0 Kudos
Message 4 of 9
(3,505 Views)
Sorry Schleumi,

but right now I thought another solution which not use a counter.

You must only create an analog input task with a 1000Hz rate and configure your buffered counter acquisition to have for source the AI Sample clock of your card.

It would be a better solution because this way you will spend the counter use.

Let me know if I can help you more.

Regards.

Matthieu
NI Switzerland.

PS this different solution are explained in our DAQ course.
0 Kudos
Message 5 of 9
(3,503 Views)

Thanks for this clue

Do I understand right? You mean, that I have to abandon my Frequency-Generator. Instead of that I have only to use the AI-Task, where the source of the SampleClock is the Dev1/ai/sampleclock ? And what's about the encoder? Do I have to use there the same source for the SampleClock, so that I have both measurements (encoder and AI) at exactly the same time?

Regards

Schleuni

0 Kudos
Message 6 of 9
(3,504 Views)
Schleuni,

Of yourse you need the counter input for your encoder...

What you need is an analog input (that you already had) and you will create an internal ai_sample_clock at the frequency that you configure (in your case 1000Hz).
Configure your encoder input like you made but with the source of the clock to the Dev1/aiSamplClock.

This way, like you said, you will fill the analog input buffer at the same time as the counter input buffer...

It's the best solution because in your program you use a counter output that you don't really need because the aiSampleClock is also derives from the OnBoardClock...

Let me know if I can help you...
Regards.

Matthieu

PS: You can post the part of the code that you changed and I can check if all is OK.
0 Kudos
Message 7 of 9
(3,498 Views)
Of course I do need the counter to get the encoder-measurement.
I deletet my frequency-generator. So I only have one counter now. The source of the AI is the onboard clock. The source of the encoder-sampleclock is like you said ai/sampleclock. If I understand right both measurements use the same clock now.
So did I the right code changes?
 
Thanks for your help
 
0 Kudos
Message 8 of 9
(3,493 Views)
Hi Schleuni,

RIGHT...you use now the same sample clock for your data acquisition and your counter acquisition...it's exactly the same as you made with the counter output on your first picture...

Regards...

Matthieu

0 Kudos
Message 9 of 9
(3,488 Views)