FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

How transform the FPQUAD 520 position in the correct radiant and the count of tour axis

I have an encoder of 2500 ppr and i keep the position in deg with the division by the 32 bit position exit but thi as a problem of decimal error.The example is attached.This method is generate an error in the long time for the decimal number and the position in the reset is not right.Thanks Nic
Bytelabs.it
0 Kudos
Message 1 of 3
(3,392 Views)
Nicola,

First a couple of questions;
1) Does the encoder have an index channel?
2) Is the OVERFLOW refnum Channels 0-3 or 4-7? Same question for the POSITION refnum?
3) Why do you divide by 720?

The FP-QUAD-510 uses two software channels per physical channel to represent 32 bit positions. Channels 0-3 represent the least significant 2 bytes and Channels 4-7 represent the most significant two bytes. Thus in your code, if the POSITION channels are channels 4-7, you are correctly concatenating the data, but if they are Channels 0-3, you are concatenating the data backwards.

When the data is concatenated, it is a signed integer with a negative position indicating reverse displacement and a positive position representing positive displacement. To convert the position to an angle, you should take current position (counts) and divide it by 2500 (counts per revolution) and then multiply it by 360 (degrees per revolution) to get the displacement in degrees.

From there, you have several ways to go about handling count overflow above 2500 counts/below -2500 counts. If your encoder has an Index channel, the most accurate way to handle it is to set the FP-QUAD-510 to Reset On Index. Thus, the count position will reset automatically when the Index is active and A and B are inactive. Alternatively, you can use the approach that you are currently using where you reset the count when the count exceeds 360 degrees. However, this method has the drawback that it induces an error each time a reset is performed since it resets above 360 degrees, not exactly at 360 degrees each time. A better method would be to simply use the Quotient & Remainder node from the Numeric palette. Take the position, divide it by 360 and look at the remainder. If you have rotated 719 degrees (almost 360 twice), you will see 359 degrees. If you still want to send a software reset to the channel, you should send the reset when the position (signed 32 bit int, not the position in degrees) is equal to +2500 or -2500 counts.

Regards,
Aaron
LabVIEW Champion, CLA, CPI
Message 2 of 3
(3,392 Views)
Very Thank's for reply;

You have find my problem and i going to reply

1) Yes the encoder have a index channel but it is in phase with Channel A and it's not
read correct in Field point (low when A and B are low level)
2) Yes i have incorrect joint the Overflow position channel,but in the concatenate i have respected
the right LSB MSB.

3) Yes is strange 720 but with this i have the respect of position per tour (-360 at 360 is 720)is a alternative ("bad") solution.

After your answer i try the reset on index but unsuccesful because just in positive rotation
reset at index.In the negative rotation don't reset for the not right level situation.

I try with a monostable for augment the time ON in the reset impulse.

Now i try with hand
le reset (Your solution) and i see very better solution.

Regards,
Nicola
Bytelabs.it
0 Kudos
Message 3 of 3
(3,392 Views)