Hi All,
I am working on getting an industrial robot running and one of my challenges is converting the serial encoder data into a different serial format my servo drives can understand. This is a big project but I'd like to ask a simplified question about reading this data.
Problem Statement: I'd like to read the output of this Tamagawa TS5643N151 serial encoder into a microprocessor (I'll start with an Arduino Mega, but likely move to something more powerful for the final implementation), decode the packets, and output the data on another serial port.
Attached is the encoder specification, an image of the captured serial data, an image of the decoded serial data, and a picture of the robot for fun.
I've decoded the data by hand on some worksheets quite easily, but I haven't programmed a micro in a good number of years, and I've never worked with manchester encoded serial. The serial data is presented in two packets, and the payloads need to be combined. The payload consists of:
Questions:
I am working on getting an industrial robot running and one of my challenges is converting the serial encoder data into a different serial format my servo drives can understand. This is a big project but I'd like to ask a simplified question about reading this data.
Problem Statement: I'd like to read the output of this Tamagawa TS5643N151 serial encoder into a microprocessor (I'll start with an Arduino Mega, but likely move to something more powerful for the final implementation), decode the packets, and output the data on another serial port.
Attached is the encoder specification, an image of the captured serial data, an image of the decoded serial data, and a picture of the robot for fun.
I've decoded the data by hand on some worksheets quite easily, but I haven't programmed a micro in a good number of years, and I've never worked with manchester encoded serial. The serial data is presented in two packets, and the payloads need to be combined. The payload consists of:
- Single Turn Data (First 11 bits of packet 1, LSB) - The absolute angle of the encoder shaft
- Multi Turn Data (Last 4 bits of packet 1 and first 9 bits of packet 2, LSB) - The integer count of revolutions since counter reset
- Status Flags (Last 6 bits of packet 2)
- CRC - Some sort of polynomial 3 bit CRC. I do not know how this is calculated. There is one for each packet.
Questions:
- Can an Arduino read serial packets with Manchester encoding? I think yes since there are some libraries, although they seem to expect a predetermined packet format that looks different from what I have.
- What is the baudrate I should use for the serial port? I got confused with baud and bit rate, especially with manchester encoding.
- How is a 3 bit CRC calculated? Can I figure out which polynomial is used from my example below?
- Is there any good sample code for what I'm trying to do?
Attachments
-
429.8 KB Views: 4