03-15-2010 01:46 PM
Question:
I have three incremental encoders connected to my M-Series DAQ board (PCI-6229) that has TWO Counter input channels. I am measuring the position of each encoder. How do I measure the position of the third encoder if I have used-up both counter inputs? Is there a manual way to accomplish this using my older version of Labview (version 7 express)? Any help is appreciated.
-Clarkam1
03-15-2010 02:00 PM
clarkam1 wrote:Question:
I have three incremental encoders connected to my M-Series DAQ board (PCI-6229) that has TWO Counter input channels. I am measuring the position of each encoder. How do I measure the position of the third encoder if I have used-up both counter inputs? Is there a manual way to accomplish this using my older version of Labview (version 7 express)? Any help is appreciated.
-Clarkam1
I wrote code to monitor DI lines using analog years ago... and it is not trivial and depending on your signals and the hardware limitaions, may not even be possible. So my first reply to this question is, why not just get another deveice with more counters?
Ben
03-15-2010 02:51 PM
03-15-2010 03:14 PM - edited 03-15-2010 03:15 PM
03-15-2010 03:23 PM
All three encoders are running and need to be computed simultaneously. Here's a thought: since the max output frequency for each encoder is 200kHz (which is 100 times slower than the 80MHz counters) could the counter handle all three encoder inputs at the same time? The output of the counter would then need to be divided into groups.
03-16-2010 08:11 AM
clarkam1 wrote:
Ben,I'm on an extremely small budget and can only use the items available to me at present time. That being said, is there no way to use one counter for multiple encoders? Or could an external device be used to count which the DAQ board would read? I appreciate your timely responses. I'm trying to explore all other options.
So do you work for free?
If you are determined to get all three counters going with that device, you have a big challenge ahead of you. I'll try to explain. At teh input of your counters you have signal conditioning that feeds the counter itself. To do the same thing using analog input channels (since all of the counters are already used) you will have to develop code that simulates the signal conditioning, converts the analog to digital (this may sound easy but if you need to implement over-sampling its not) and then do the work of the counter, again in software.
If my customer was forcing this on me I would first review the behavour of the hardware and use it to establish the requirements of my code. So if you do not have an EE background, you will first have to learn the hardware so you can write software that does the same thing.
So if you work for free then you may want to chase down the examples that NI ships for their FPGA targets that implement serial protocols and the like. You may be able to harvest some code and examples from there. If you don't work for free, then you really have to decide if you want to re-invent in software what you can purchase.
Ben
07-20-2012 07:16 AM
hey,
i really work for free as a project student and they are not ready to give me extra hardware so please if you have got any vi or method which get the position of encoder without counter input it will be really helpfull .
Thank you
07-20-2012 09:54 AM
Wire up the 3rd encoder to a couple lines of digital port 0. Set up a buffered DI task. Then the fun starts.
You'll (probably) have to constantly service the DI task and send it through some processing to perform a software quadrature
decode. You *must* get every digital transition for the quad decode to be valid. You can either do a change-detection based
task or else do oversampling. If change-detection based, you'll have to solve the puzzle of time-correlating your buffered DI
task to your (presumably) buffered encoder tasks.
If you use a constant sampling clock, you'll need to oversample and share the clock among all 3 tasks to keep time correlation.
That clock must come from either an analog task or some external source. Oversampling means you'll have a very high data
rate to manage and you'll need to learn how to program quite efficiently.
If you're fairly new to this, you can expect to be tied up for weeks. It's definitely a case of "penny wise, pound foolish" to ask
you to do this job without the full set of needed tools. Like asking you to dig a canal with a spoon.
-Kevin P