Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Resolver output validation

Status
Not open for further replies.

electronicsman

Full Member level 5
Joined
May 4, 2012
Messages
291
Helped
11
Reputation
22
Reaction score
12
Trophy points
1,298
Activity points
3,737
I need to validate the resolver output. The communication with the master controller is through spi. But i am sure how to validate that data. The spi data consists of position and velocity. Since the motor runs at a high speed i can control the speed but still how to make sure i am receiving correct data. Any ideas. Please help. The resolver is AD2S1210.
 

Hi,

If you just want to check MISO activity, then connect a pullup to it and check if you receive any other value than 0xFF.

Klaus
 

No i want to match the actual rotor position with the value i am receiving over spi. Similarly velocity should with the actual motor velocity.
 

i am bit confused the with data output format. The angular velocity data is a 12-bit twos complement word, representing the velocity of the resolver shaft rotating in either a clockwise or counterclockwise direction. The angular velocity data format is twos complement, with the MSB representing the rotation direction. I have done the following calculations are they correct? please help

Assume:
1 - Clockwise
0 - Anticlockwise

Actual Value
0b 1010 1011 0101 - 0xCB5
2's Complement
Invert Bits
0b 0101 0100 1010
Add 1

0b 0101 0100 1011 -> 0x54B Velocity Clockwise Direction

It will be rotating 1355 rps clockwise direction. Whether the calculations are same for anti clockwise direction? Should i completely neglect 12th bit? Please suggest. I have attached the data sheet. A sample linux driver is given in the following link **broken link removed**
I did not understand the function
Code:
 sign_extend32(vel, 11)
 

Attachments

  • resolver_datasheet.pdf
    335.8 KB · Views: 67

Check your calculation. Correct result is -0x34B. (0b 1100 1011 0101 - 0xCB5)

I don't understand what you want to achieve. It's just regular signed arithmetic, handled by any C compiler without special action.
 
I am really sorry i don't understand what i am doing. OK as per your instruction can i write the code as follows
Code:
int main(void)
{
signed int l_read_miso_data_int16;
l_read_miso_data_int16 =  transmit_mosi_read_miso();
if(l_read_miso_data_int16 < 0)
{
  ditection = CLOCKWISE;
  /*mask the last 4 lsb bits */
 /* the result is the velocity */
}
else
{
  direction = ANTI CLOCKWISE;
 /* mask the last 4 lsb bits*/
/* the result is velocity */
}

return 0;
}

int transmit_mosi_read_miso(void)
{
/*
send spi data and read back the data
*/
return miso_data;
}
Can you please correct if any mistake?
 

If you read the velocity data word as 16 bit int, the sign bit gives the direction. In so far the code is correct.
 

Thank you very much. I am sorry i forgot to ask there is a parity bit 0 what exactly is this? I am extracting 12 bits of velocity and seeing if there are odd number of 1's else i am considering it as invalid data. But please tell me what shall i do with parity bit?
 

Sorry to ask basic question, i read the wiki and found the answer. Thank you.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top