How to use the absolute value encoder reasonably base on ethercat?

More
29 Nov 2022 08:03 #257948 by Drizzt
I've got a server motor with 17bit absolute value encoder which has battery installed and the servo controller has ethercat interface.
The situation is when I power off the machine and change the joint position manully. How can I move the joint to original position.
The machine platform is RPI4 ,ethercat comp is ''github.com/dbraun1981/hal-cia402.git'' use csp-mode. Besides, I can read out the encoder absolute value in pdo addr "0x213C" and "0x213D", encoder user value "0x6064"(will be 0 after power off) .

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

More
29 Nov 2022 08:21 #257950 by db1981
please give detailed information about pdos
"0x213C" and "0x213D"

is this 64bit position value ?

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

More
29 Nov 2022 17:58 #258001 by Drizzt
yes, it is 64bit value. 0x213C is low 32bit signed value and 0x213D is the high 32bit.
And I think I've found the key to the problen. The "drv_target_position 0x607A" shall follow “drv_actual_position” before cspmod enabled. If I use the abs value instead of "drv_actual_position 0x6064". Even I have decrease the abs value to real offset. It is still too long, and it is dangerous operation.So the right operation is change the ini.x.home_offset before homing.But I don't know how to do yet. Any suggestion will be grateful.

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

More
29 Nov 2022 22:53 #258040 by db1981
can you tell the type of servo drive? manual?

are you shure? or are them two 16bit pdos ?

i have not seen an 64 bit pos register in my life yet...
or is one pdo only for the multiturns?
If you will get an 64bit feedback register, you should also get an 64bit setpoint register.

With 17bit encoder , 32bit pos register should be fine -> that are 12bit of multiturns....

We can use an encoder_class that handels 64 bit values for overflow protection. But the linuxcnc motionpart can only handle 32 bits.

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

More
30 Nov 2022 10:33 #258108 by Aciera
Not sure if this is of any interest regarding 64bit values in LinuxCNC:
github.com/LinuxCNC/linuxcnc/pull/2034

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

More
30 Nov 2022 15:02 - 30 Nov 2022 15:30 #258128 by Drizzt
The servo driver made in China and the company named HCFA.I think 32bit reg is enough for normal CNC machine.Actually there is 4 pdo addr 0x213A for multiturns, 0x213B for single turn position, 0x213C and 0x213D as I said above.The relationship of these pdo is [Num_turns(0x213A)*(0x20000) + pos(0x213B) = pos_L(0x213C) + pos_H(0x213D)<<32]. Let's forget this. Now I just want to know is there have any method change the ini.x.home_offset automaticaly after linuxcnc start?And how?
Attachments:
Last edit: 30 Nov 2022 15:30 by Drizzt.

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

More
30 Nov 2022 15:32 #258132 by Drizzt

Not sure if this is of any interest regarding 64bit values in LinuxCNC:
github.com/LinuxCNC/linuxcnc/pull/2034

I think this is not what I want.But thankyou anyway.

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

More
01 Dec 2022 10:59 #258200 by db1981
how is you C knowledge ?

I can give advice how to build a small component for encoder readout at startup in front of the cia402 comp.

unfortunaly i am currently on tour and will have no options the next weeks, to code and test this by myself.
The following user(s) said Thank You: Drizzt

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

More
01 Dec 2022 11:16 #258201 by Drizzt
I can wirte another state machine, but I think it is not necessary to do this for now. When I solve this problem I will post it. Thank you for all.

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

More
14 Dec 2022 10:07 #259439 by Drizzt
since I use the abs 17bit encoder. I write a simple comp for this. And the hal file is as bellow. Besides, The machine I use is hexapod.
Attachments:
The following user(s) said Thank You: tommylight

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

Time to create page: 0.084 seconds
Powered by Kunena Forum