the tool coordinate system of a 6 DOF robot

More
10 years 4 months ago #75964 by andypugh
65536 is a number that any programmer will immediately recognise. It is 2^16.
In a 16-bit system you can have 65536 different values (0 to 65535).
The number 65536 is 100000000 in binary.
65535 is 11111111 in 16-bit unsigned. 0-65535 encoding.
0 is 00000000
Perhaps most suspiciously, -1 is 11111111 in 16-bit signed. (-32768 to + 32767 encoding)
The system somewhere probably uses signed representation in a 16-bit accumulator and extends that to 32 or 64 bits to keep track of multiple turns.

We need to work out where this miss-count is taking place. Whether it is in LinuxCNC (where it can be fixed) or in the hardware, where it is more difficult.

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

More
10 years 4 months ago #76039 by chuchengbing
Thanks very much, andypugh
I ask this question to my teacher, yes, just as you say, he found that the -65536 was zero too and there is something wrong with the type data of actual positon. And we have a test with another driver. we find that it has the same question in 0 position, then we changed the application program, and it is ok now!! The work now I should do is to find where the question is in Linuxcnc, from the data of halscope, I put my focus on lcec, because it is lcec to get the wrong data first.
Thanks again for all the help. I will tell you my results!!!

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

More
10 years 4 months ago #76313 by chuchengbing
Hello andypugh:
Sorry for disturbing you again,yes,you are right, I use the function EC_READ_S32 to read the value of 0x6064. I find that, when the value is 1 in decimal and the value from 6064 is just 0x1 in hex, the value is 0 in decimal and the value from 6064 is 0x0 in hex, when it changed to -1, the value from 6064 is FFFF while is not FFFFFFFF which FFFF in 32bit is 65535 and FFFFFFFF in 32bit is just -1, when the value is changing to -2 , the value from 6064 is just be correct and is FFFFFFFE;
I don't know this reason. I find that I have some problems to read the source code!!
Sorry for disturbing you again and again , I am really new to this.

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

More
10 years 4 months ago #76316 by andypugh
That is very strange. It sounds like a problem at the driver end,
though perhaps it is a problem in the serial protocol.
Is the output for -1 actually 0000FFFF or is it actually a shortened sequence?

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

More
10 years 4 months ago - 10 years 4 months ago #76318 by chuchengbing
Thanks.
I will give you my hal file and I send a private mail to you and it is great that you will check it.
BTW, FFFF in 16 bit is -1..
Last edit: 10 years 4 months ago by chuchengbing.

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

Time to create page: 0.367 seconds
Powered by Kunena Forum