SSI ABS Encoder

More
5 years 5 months ago #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 to join the conversation.

More
5 years 5 months ago #208174 by nhanpham
Replied by nhanpham 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

Please Log in to join the conversation.

More
5 years 5 months ago #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 to join the conversation.

More
5 years 5 months ago #208189 by nhanpham
Replied by nhanpham 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 to join the conversation.

More
5 years 5 months ago #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* )

Please Log in to join the conversation.

More
5 years 5 months ago #208221 by nhanpham
Replied by nhanpham 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
Code:
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

Please Log in to join the conversation.

More
5 years 5 months ago #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 to join the conversation.

More
5 years 5 months ago #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 to join the conversation.

More
5 years 5 months ago #208270 by nhanpham
Replied by nhanpham 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.
Code:
linuxcnc:~ $ halcmd show param hm2_7i80.0.ssi* Parameters: Owner Type Dir Value Name

Please Log in to join the conversation.

More
5 years 5 months ago #208271 by nhanpham
Replied by nhanpham 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

Please Log in to join the conversation.

Time to create page: 0.075 seconds
Powered by Kunena Forum