Issue with resolver least bit resolution and speed

Hi all,

I'm using the AD2S1210 to read a motors speed but I'm confused with the LSB conversion and the max speed...

The datasheet states that the maximum speed the IC can measure at 16-bit resolution is +/-125 rps. At the maximum speeds, the corresponding values within the register are:
125 = 0x7FFF
-125 = 0x8000
where the LSB resolution is 0.004

however, I can't seem to get the correct values with the code I've written:

int16_t valueInReg = 0x8000;
float LSB = 0.004;

float speed = LSB*valueInReg;

with this, I get a speed of -131.072 for 0x8000 and 131.068 for 0x7FFF...
Is there something I'm missing?

The 0.004 seems not to meet the high resolution expectations. Change it to 125/0x7FFF and try again.

Thanks! I've corrected that, Although I think I still might be missing something for the 10-bit conversion, here's the code I have so far:

float rotationOutputDataToSpeed_10Bit(int32_t binRep){
    
    //Checks whether or not the number is negative
    int negFac = ((binRep >> 15) != 0 ? -1 : 1);
    
    //Correct -1 for twos compliment
    if (negFac == -1) binRep -= 1;
    
    return negFac*(0xFFFF&binRep)*0.00381481368; //was 0.004

}

Now, I get 2500 for binRep = (0x1FF << 6) (great!), but I get -5000 for binRep = (0x3FF << 6)...

Never mind I solved it, there were quite a few issues within the datasheet!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.