- Posts: 77
- Thank you received: 0
SSI ABS Encoder
I have 1 ssi abs encoder 12 bit.
i connected it to mesa board and got data.
my encoder is single turn, binary code, with 4096 res/rev.
Exam: my data is 0-3072 then it restores correctly
but if my data is 3073-4096 then whenit recovers negative numbers from -1024 ->-1
It's abs encoder
can you help me check it, pls?
thank you very much
Please Log in to join the conversation.
Does the encoder actually do more than one revolution in use? If not then you could try setting the "m" (multi-turn) flag in the config string.
The code that handles absolute encoders is actually re-used smart-serial code:
github.com/LinuxCNC/linuxcnc/blob/master...mot2/sserial.c#L1980
I am a bit surprised that the wrap happens at 3072, though. I would expect it at 2048.
Please Log in to join the conversation.
andypugh wrote: It sounds like the encoder wrap handling is going wrong.
Does the encoder actually do more than one revolution in use? If not then you could try setting the "m" (multi-turn) flag in the config string.
The code that handles absolute encoders is actually re-used smart-serial code:
github.com/LinuxCNC/linuxcnc/blob/master...mot2/sserial.c#L1980
I am a bit surprised that the wrap happens at 3072, though. I would expect it at 2048.
Yes, it happens at 3072, about 1/4 one revolution.
my encoder is sigle-turn. I tried setting the 'm' code but it doesn't help.
Please Log in to join the conversation.
andypugh wrote: It sounds like the encoder wrap handling is going wrong.
Does the encoder actually do more than one revolution in use? If not then you could try setting the "m" (multi-turn) flag in the config string.
The code that handles absolute encoders is actually re-used smart-serial code:
github.com/LinuxCNC/linuxcnc/blob/master...mot2/sserial.c#L1980
I am a bit surprised that the wrap happens at 3072, though. I would expect it at 2048.
is My setting correct?
Please Log in to join the conversation.
Setting it to a much larger number might be an interesting experiment, though.
Is there any way to see the raw data from the encoder? if no-wrap is active then the driver doesn't do very much with the data that comes back. Is it possible that what you see is the actual numbers from the encoder?
I think you can use "enable_raw" in the loadrt hostmot2 line of the hal and peek at the actual register values on the FPGA.
linuxcnc.org/docs/2.8/html/man/man9/hostmot2.9.html#Raw%20Mode
I have attached the hostmot2 register map so that you know where to look.
Please Log in to join the conversation.
Please Log in to join the conversation.
andypugh wrote: counts-per-rev should probably be 4096. But that isn't the problem.
Setting it to a much larger number might be an interesting experiment, though.
Is there any way to see the raw data from the encoder? if no-wrap is active then the driver doesn't do very much with the data that comes back. Is it possible that what you see is the actual numbers from the encoder?
I think you can use "enable_raw" in the loadrt hostmot2 line of the hal and peek at the actual register values on the FPGA.
linuxcnc.org/docs/2.8/html/man/man9/hostmot2.9.html#Raw%20Mode
I have attached the hostmot2 register map so that you know where to look.
i have used an oscilloscope to see data. it returns a correct value from 0->4095
Please Log in to join the conversation.
inverted clock maybe?
Andys raw read suggestion is good
For debugging, its important to see what the FPGA reads
Please Log in to join the conversation.
andypugh wrote: Specifically this bit..
Code:SSI Data Register0, right justifed. Writes to this location will start a read cycle for the specific SSI interface addressed 0x6900 SSI data register0 channel 0 0x6904 SSI data register0 channel 1 0x6908 SSI data register0 channel 2 0x690C SSI data register0 channel 3 ... 0x6A00 SSI data register1 channel 0 0x6A04 SSI data register1 channel 1 0x6A08 SSI data register1 channel 2 0x6A0C SSI data register1 channel 3
Is it correct?
The values return from 0x0000000->0x0000ffff for 0->4096
thank you for your helping
Please Log in to join the conversation.
