Absolute Encoder Questions / SSI via 5i25
17 Aug 2013 00:09 #37756
by PCW
Replied by PCW on topic Absolute Encoder Questions / SSI via 5i25
Its a direct connection
TX --> CLOCK
DATA --> RX
Not sure about the polarity, I have it written down (at least for my Siemens SSI encoder) worst case you would have to swap the +- pins
TX --> CLOCK
DATA --> RX
Not sure about the polarity, I have it written down (at least for my Siemens SSI encoder) worst case you would have to swap the +- pins
The following user(s) said Thank You: PKM
Please Log in or Create an account to join the conversation.
17 Aug 2013 00:17 #37757
by PKM
Replied by PKM on topic Absolute Encoder Questions / SSI via 5i25
Then I'll check it next week!
The encoder has 10-30V power. Should I worry about it, or all RS-422 devices have compatible levels?
Suppose the encoder is connected, it appears at HAL Configuration? Do I need to update the firmware?
The encoder has 10-30V power. Should I worry about it, or all RS-422 devices have compatible levels?
Suppose the encoder is connected, it appears at HAL Configuration? Do I need to update the firmware?
Please Log in or Create an account to join the conversation.
17 Aug 2013 00:30 #37758
by PCW
Replied by PCW on topic Absolute Encoder Questions / SSI via 5i25
The clock input/data output are normally just 5V RS-422 but you should check the data sheet. The encoder I have is the same :10-30V power RS-422 input and output levels. Mine happens to be 12 bits of counts per turn and 12 bits of turn counts, both in gray scale
Unfortunately theres no driver support so the best you can do is use
hm2s raw-read/raw-write facility to check that the interface functions
Unfortunately theres no driver support so the best you can do is use
hm2s raw-read/raw-write facility to check that the interface functions
Please Log in or Create an account to join the conversation.
17 Aug 2013 01:58 #37762
by PKM
Replied by PKM on topic Absolute Encoder Questions / SSI via 5i25
OK, I'll see what happens when it's connected.
Will these SSI commands work with raw mode enabled?
Any examples of such a driver for serial device? Not sure I can do it but I'd like to look.
Will these SSI commands work with raw mode enabled?
Any examples of such a driver for serial device? Not sure I can do it but I'd like to look.
Please Log in or Create an account to join the conversation.
17 Aug 2013 02:14 #37764
by PCW
Replied by PCW on topic Absolute Encoder Questions / SSI via 5i25
No smart serial commands will work (SSI stands for Synchonous Serial Interface) It is a very simple way to communicate with absolute encoders.
The hardware works like this: on command the host sends out a burst of clock pulses and the encoder responds with a serial data stream of position data
(often in gray code)
raw-read/raw-write hm2 interface is very low level, you can just read/write physical registers.
This is enough to verify SSI interface operation (in conjunction with the register information for the SSI interface) but not a lot more
Earlier it this thread I detailed what I thought was required of a flexible SSI interface (bit field extraction, gray code conversion) etc
The hardware works like this: on command the host sends out a burst of clock pulses and the encoder responds with a serial data stream of position data
(often in gray code)
raw-read/raw-write hm2 interface is very low level, you can just read/write physical registers.
This is enough to verify SSI interface operation (in conjunction with the register information for the SSI interface) but not a lot more
Earlier it this thread I detailed what I thought was required of a flexible SSI interface (bit field extraction, gray code conversion) etc
Please Log in or Create an account to join the conversation.
17 Aug 2013 02:17 #37766
by PKM
The type of transmission protocol is "right aligned" with a length of 25 bit. The transmission starts with MSB (most significant bit) and ends with LSB (less significant bit). Unused bits are set to 0 (zero). The output code of the sensor is GRAY.
Besides clock and data pins, it has inputs for zeroing and reversing. Though I could live without those.
That is the driver has to provide clock signal, read 25 bit reply and convert it from Gray code.
Replied by PKM on topic Absolute Encoder Questions / SSI via 5i25
I have a linear encoder, but almost the same specs:The clock input/data output are normally just 5V RS-422 but you should check the data sheet. The encoder I have is the same :10-30V power RS-422 input and output levels. Mine happens to be 12 bits of counts per turn and 12 bits of turn counts, both in gray scale
The type of transmission protocol is "right aligned" with a length of 25 bit. The transmission starts with MSB (most significant bit) and ends with LSB (less significant bit). Unused bits are set to 0 (zero). The output code of the sensor is GRAY.
Besides clock and data pins, it has inputs for zeroing and reversing. Though I could live without those.
That is the driver has to provide clock signal, read 25 bit reply and convert it from Gray code.
Please Log in or Create an account to join the conversation.
17 Aug 2013 05:13 #37769
by PKM
Do I need the firmware that you made earlier in this thread?
Replied by PKM on topic Absolute Encoder Questions / SSI via 5i25
Can you give me the commands that you use to communicate with your encoder? I'll have it on 7i76 (or 7i77 if nesessary) port.raw-read/raw-write hm2 interface is very low level, you can just read/write physical registers.
This is enough to verify SSI interface operation (in conjunction with the register information for the SSI interface) but not a lot more
Do I need the firmware that you made earlier in this thread?
Please Log in or Create an account to join the conversation.
17 Aug 2013 05:25 #37770
by andypugh
You need to enable raw mode: www.linuxcnc.org/docs/html/man/man9/hostmot2.9.html#Raw%20Mode
And then you can access the registers directly: git.linuxcnc.org/gitweb?p=hostmot2-firmw...a660c71a48191b4d1a64
It's not especially user-friendly
Replied by andypugh on topic Absolute Encoder Questions / SSI via 5i25
Can you give me the commands that you use to communicate with your encoder? I'll have it on 7i76 (or 7i77 if nesessary) port.
You need to enable raw mode: www.linuxcnc.org/docs/html/man/man9/hostmot2.9.html#Raw%20Mode
And then you can access the registers directly: git.linuxcnc.org/gitweb?p=hostmot2-firmw...a660c71a48191b4d1a64
It's not especially user-friendly
Please Log in or Create an account to join the conversation.
17 Aug 2013 13:16 - 17 Aug 2013 17:29 #37773
by PKM
Replied by PKM on topic Absolute Encoder Questions / SSI via 5i25
Really it isn't... but I start figuring it out. What I was most scared of is low-level SSI communication (sending a clock sequence and reading the reply), but I see that hm2 does that with Simple SSI interface.
Say I connected the encoder to 7i76. Now it's on SSI data register 0?
The following is my guess:
I need to set the number of encoder bits (25) and probably set program start mask to SSIBitCountRegister 0, that is
setp hm2_5i25.0.raw.write_address 0x6900
setp hm2_5i25.0.raw.write_data 89 (25 to 0...5 bits and 1 to bit 6 for Program Start Mask)
setp hm2_5i25.0.raw.write_strobe 1
SSI Bit Rate register should be set. CLockLow is 50MHz for 5i25.
The encoder has a frequency of data transmission from 100 kHz to 1 MHz, it must be the Shift frequency.
Then for 500kHz I need to set SSI Bit Rate register to 65536*500000/50000000 = 655
setp hm2_5i25.0.raw.write_address 0x6A00
setp hm2_5i25.0.raw.write_data 655
setp hm2_5i25.0.raw.write_strobe 1
Then I have 2 ways to start the reading cycle: either write (anything?) to SSI Global Start register (as the Program Start Mask is set to 1) or write (anything?) to SSI data register 0
Say I choose the second way (which is not logical as I just set the program start mask bit):
setp hm2_5i25.0.raw.write_address 0x6800
setp hm2_5i25.0.raw.write_data 1
setp hm2_5i25.0.raw.write_strobe 1
To see the returned value:
setp hm2_5i25.0.raw.read_address 0x6800
show pin hm2_5i25.0.raw.read_data
Please check if that's correct
Say I connected the encoder to 7i76. Now it's on SSI data register 0?
The following is my guess:
I need to set the number of encoder bits (25) and probably set program start mask to SSIBitCountRegister 0, that is
setp hm2_5i25.0.raw.write_address 0x6900
setp hm2_5i25.0.raw.write_data 89 (25 to 0...5 bits and 1 to bit 6 for Program Start Mask)
setp hm2_5i25.0.raw.write_strobe 1
SSI Bit Rate register should be set. CLockLow is 50MHz for 5i25.
The encoder has a frequency of data transmission from 100 kHz to 1 MHz, it must be the Shift frequency.
Then for 500kHz I need to set SSI Bit Rate register to 65536*500000/50000000 = 655
setp hm2_5i25.0.raw.write_address 0x6A00
setp hm2_5i25.0.raw.write_data 655
setp hm2_5i25.0.raw.write_strobe 1
Then I have 2 ways to start the reading cycle: either write (anything?) to SSI Global Start register (as the Program Start Mask is set to 1) or write (anything?) to SSI data register 0
Say I choose the second way (which is not logical as I just set the program start mask bit):
setp hm2_5i25.0.raw.write_address 0x6800
setp hm2_5i25.0.raw.write_data 1
setp hm2_5i25.0.raw.write_strobe 1
To see the returned value:
setp hm2_5i25.0.raw.read_address 0x6800
show pin hm2_5i25.0.raw.read_data
Please check if that's correct
Last edit: 17 Aug 2013 17:29 by PKM.
Please Log in or Create an account to join the conversation.
17 Aug 2013 19:34 #37780
by andypugh
Replied by andypugh on topic Absolute Encoder Questions / SSI via 5i25
Looks about right, does it work?
Please Log in or Create an account to join the conversation.
Time to create page: 0.093 seconds