Recommended Posts

Dear all,

 

I am interested in using the following encoder (http://www.hengstler.de/gfx/file/shop/encoder/RI32/Datasheet_RI32_en.pdfaz) with a quadrature timer mode.

 

I have already set up another encoder with quadrature, following a similar method (http://www.azeotech.com/board/index.php?/topic/4600-quadrature-encoder-to-calculate-angular-velocity/) , but it does not seem to work. I would like to know whether it makes sense to use a quadrature timer for this device or if I should change to another type of timer.

 

 

Summary of the spec sheet:

 

2 wires to power it

2 wires for the signals

Pulse shape: Square wave (it does not say anything else about it)

 

Many thanks for your help

 

Best regards

Link to comment
Share on other sites

The DAQFactory - LabJack Application guide for the U3/U6/UE9 describes how to setup the timers as quad, and there should be samples as well.  It is installed with DAQFactory.  I'll let LabJack comment on any other hardware related issues.

Link to comment
Share on other sites

Do you have Supply Voltage option A or E?  Do you have Output option K or D?

 

I suggest you start with the test panel in LJControlPanel.  Once you get the encoder counting properly in there, then move on to DAQFactory.

 

 

I would like to know whether it makes sense to use a quadrature timer for this device or if I should change to another type of timer.

 

The reason for quadrature encoding is that the sequence in which you get edges from phases A & B tells you whether each edge represents a step forward or backward.  If you need to keep track of absolute position, and have no other way to know if the encoder is moving forward or backward, the stick with quadrature.  If, however, you don't care about direction, the encoder is always moving the same direction, or you know direction (perhaps because you are controlling it), then you can just use a simple counter (hardware counter or firmware counter) to count edges from one phase.

Link to comment
Share on other sites

The main issue for me I think is to know if this square wave signal can be used for quadrature.

 

In the past I set up an encoder with two shifted square wave signals, and quadrature worked well. Here it does not say if that signal is shifted.

 

(Supply voltage is E and Output option is K)

 

Thanks for your reply.

Link to comment
Share on other sites

Power supply option E means that you need to provide a 10-30V supply for the encoder.  You also want to tie the common of that to LabJack GND so the signals have a common reference.

 

Output option K is push-pull.  I don't see it clearly stated, but most likely it pushes at the supply voltage, so if your supply is 12 or 24 volts, your signal will be 12/0 or 24/0.  Those voltages are too high to connect directly to the U6, so you need to add series resistors:

 

http://labjack.com/support/u6/users-guide/2.8.1.1

 

... or you could use an LJTick-Divider-UNI10V to drop the 12 or 24 down to 3.0-3.5.

 

 

The main issue for me I think is to know if this square wave signal can be used for quadrature.  In the past I set up an encoder with two shifted square wave signals, and quadrature worked well. Here it does not say if that signal is shifted.

 

 

Strangely, when I search their datasheet for "quadrature" I do not get a single hit, but since this is an "Incremental Encoder" with A and B outputs, it must certainly be providing quadrature outputs.

Link to comment
Share on other sites

This is good, I think we are getting very close.

 

I had already a power supply with 20V with another wire for the ground to have a common reference as you said. I had also an small electrical circuit that gives an output of 5V.

 

What I am getting from the DAQfactory counter are just 0 and 1, but I followed exactly the same method that I used for another encoder and for this case I get values that increase continuosly (as I understand it should be).  

 

In case it could help, the method that I used is very similar to this one: http://www.azeotech.com/board/index.php?/topic/5733-quadrature-encoder/

That is why I think the signal could be the problem, although maybe it is something that I am missing.

 

 

On the other hand, if you think I could track perfectly the position of the encoder with just 0 and 1, I would be glad using a new method.

 

 

Many thanks for your help, I appreciate it a lot.

 

Best regards

Link to comment
Share on other sites

Okey, it is sorted out. Although the specs sheet says between 10 and 30V, as the power supply was not in very good conditions, it needs to be above 30 V.

 

As it was reading data as if they were pulses, I thought the problem was linked to that.

 

Sorry for the nuisances and many thanks for your help.

 

PS: I would have another question if you were able to answer, although I think this one is much easier.

 

As I was worried about this encoder, I had set up a new one (much worse) and now I would like to compare them.

I am using this script and it does not work for the four timers.

 

AddRequest(15, LJ_ioPUT_CONFIG, LJ_chNUMBER_TIMERS_ENABLED, 4, 0, 0) 
AddRequest(15, LJ_ioPUT_TIMER_MODE, 0, LJ_tmQUAD, 0, 0) 
AddRequest(15, LJ_ioPUT_TIMER_MODE, 1, LJ_tmQUAD, 0, 0)
AddRequest(15, LJ_ioPUT_TIMER_MODE, 2, LJ_tmQUAD, 0, 0) 
AddRequest(15, LJ_ioPUT_TIMER_MODE, 3, LJ_tmQUAD, 0, 0)
 
Using channels 0 and 2 in the DAQFactory.

 

Am I missing anything?

 

 

Again, thank you so much for your support

 

Best regards

 

Luis

Link to comment
Share on other sites

Your config lines generally look fine.  I don't see a problem.

 

Can you read both encoders using the test panel in LJControlPanel?

 

A couple things you could try if it works in the test panel but you still have trouble in DF:

 

1.  Post your entire script so we can see everything such as the Go and error handling.

 

2.  Do the timer configuration using "config defaults" in LJCP (then power-cycle the U6), rather than doing it in real-time in DF.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.