SSI ABS Encoder

More
06 May 2021 17:12 #208134 by andypugh
Replied by andypugh on topic SSI ABS Encoder

annhandt09 wrote: i tried this. The encoder data returned : 0->2047 - 2047 -2046 ...->-1 for 0->4096 datas
Is it correct?


I think it assumes that the data is signed, which is a problem in this case.

I have just realised that the answer is to simply not configure it as an encoder at all...

Use %12U and it should be fine.

Please Log in or Create an account to join the conversation.

More
07 May 2021 01:19 - 07 May 2021 01:42 #208174 by annhandt09
Replied by annhandt09 on topic SSI ABS Encoder

andypugh wrote:

annhandt09 wrote: i tried this. The encoder data returned : 0->2047 - 2047 -2046 ...->-1 for 0->4096 datas
Is it correct?


I think it assumes that the data is signed, which is a problem in this case.

I have just realised that the answer is to simply not configure it as an encoder at all...

Use %12U and it should be fine.


Hi, i used %12U , then the returning data is 0->1
I can't config "setp hm2_7i80.0.ssi.00.zencoder.scalemax 0.5" para. It's error

thank you for your helping
Last edit: 07 May 2021 01:42 by annhandt09.

Please Log in or Create an account to join the conversation.

More
07 May 2021 07:25 #208182 by andypugh
Replied by andypugh on topic SSI ABS Encoder

annhandt09 wrote: Hi, i used %12U , then the returning data is 0->1


That's a start, at least.


I can't config "setp hm2_7i80.0.ssi.00.zencoder.scalemax 0.5" para. It's error


What error? Does the parameter exist?

Please Log in or Create an account to join the conversation.

More
07 May 2021 08:44 #208189 by annhandt09
Replied by annhandt09 on topic SSI ABS Encoder

andypugh wrote:

annhandt09 wrote: Hi, i used %12U , then the returning data is 0->1


That's a start, at least.


I can't config "setp hm2_7i80.0.ssi.00.zencoder.scalemax 0.5" para. It's error


What error? Does the parameter exist?


It's "./mesahal/mesamWork.hal:103: parameter or pin 'hm2_7i80.0.ssi.00.zencoder.scalemax' not found"

Please Log in or Create an account to join the conversation.

More
07 May 2021 09:02 - 07 May 2021 09:05 #208192 by andypugh
Replied by andypugh on topic SSI ABS Encoder
I think that the underlying problem here is that the SSI driver re-uses the smart-serial driver code, so makes assumptions that the input data is like the smart-serial data. In smart-serial the encoders are always signed-int, for example, and that is why %12e is not working with your unsigned encoder.

However, looking at the source
github.com/LinuxCNC/linuxcnc/blob/master...mot2/sserial.c#L1212
It looks like there should be a "scalemax" pin for your zencoder if is is defined as unsigned with %12U

Can you get a pin listing for hm2_7i80.0.ssi* ?
(halcmd show pin hm2_7i80.0.ssi* )
Last edit: 07 May 2021 09:05 by andypugh.

Please Log in or Create an account to join the conversation.

More
07 May 2021 14:33 - 07 May 2021 14:34 #208221 by annhandt09
Replied by annhandt09 on topic SSI ABS Encoder

andypugh wrote: I think that the underlying problem here is that the SSI driver re-uses the smart-serial driver code, so makes assumptions that the input data is like the smart-serial data. In smart-serial the encoders are always signed-int, for example, and that is why %12e is not working with your unsigned encoder.

However, looking at the source
github.com/LinuxCNC/linuxcnc/blob/master...mot2/sserial.c#L1212
It looks like there should be a "scalemax" pin for your zencoder if is is defined as unsigned with %12U

Can you get a pin listing for hm2_7i80.0.ssi* ?
(halcmd show pin hm2_7i80.0.ssi* )


i got there pins.
It don't have a scalemax pin
halcmd show pin hm2_7i80.0.ssi.00
Component Pins:
Owner   Type  Dir         Value  Name
    29  bit   OUT         FALSE  hm2_7i80.0.ssi.00.data-invalid
    29  bit   OUT         FALSE  hm2_7i80.0.ssi.00.steps
    29  bit   OUT          TRUE  hm2_7i80.0.ssi.00.steps-not
    29  float OUT    0.01782662  hm2_7i80.0.ssi.00.zencoder ==> z-pos-fbss
Last edit: 07 May 2021 14:34 by annhandt09.

Please Log in or Create an account to join the conversation.

More
07 May 2021 16:24 #208229 by andypugh
Replied by andypugh on topic SSI ABS Encoder
I don't know why there is no scalemax pin, I do think that there should be.

Which firmware are you using? I might need to load that to test.

As a workaround, you could use a HAL "scale" component to change the 0->1 value that you are currently getting to be the range that you require.

Please Log in or Create an account to join the conversation.

More
07 May 2021 20:01 #208252 by PCW
Replied by PCW on topic SSI ABS Encoder
Scale is not a pin but a parameter so try:

halcmd show param hm2_7i80.0.ssi*

Please Log in or Create an account to join the conversation.

More
08 May 2021 00:35 - 08 May 2021 00:36 #208270 by annhandt09
Replied by annhandt09 on topic SSI ABS Encoder

PCW wrote: Scale is not a pin but a parameter so try:

halcmd show param hm2_7i80.0.ssi*

hi, it don't have any para.
linuxcnc:~ $  halcmd show param hm2_7i80.0.ssi*
Parameters:
Owner   Type  Dir         Value  Name


Last edit: 08 May 2021 00:36 by annhandt09.

Please Log in or Create an account to join the conversation.

More
08 May 2021 00:39 - 08 May 2021 00:41 #208271 by annhandt09
Replied by annhandt09 on topic SSI ABS Encoder

andypugh wrote: I don't know why there is no scalemax pin, I do think that there should be.

Which firmware are you using? I might need to load that to test.

As a workaround, you could use a HAL "scale" component to change the 0->1 value that you are currently getting to be the range that you require.


I'm using the s_kins brand. I built it from the source with V2.9.0 pre0.

it at github.com/mWorkVN/linuxcnc

thank you for your helping
Last edit: 08 May 2021 00:41 by annhandt09.

Please Log in or Create an account to join the conversation.

Time to create page: 0.111 seconds
Powered by Kunena Forum