Homing with Absolute Encoders (Again)

More
2 years 2 months ago #306717 by Sandro
Hello everyone

I am having issues setting up my homing sequence for absolute encoders on my Ethercat servo dirves. I have read trough a few topics here on the forum but did not find the solution to my problem.

Background: I have Lichuan Ethercat servo drives with 23bit absolute encoders. From testing I have found out, that the encoder tracks 512 turns (-256 to +256) which combined with my 5 mm pitch ballscrews gives me a effective range of -1280 to +1280 mm. I need a distance of 0 to 1000 mm on my machine. On startup of LCNC, my encoder reports the correct absolute position of my axis. I have setup the homing sequence as follows:
Code:
HOME_ABSOULTE_ENCODER = 2 HOME                    = 0 HOME_OFFSET                = 0 HOME_SEQUENCE            = 0 HOME_SEARCH_VEL            = 0 HOME_LATCH_VEL            = 0 HOME_IGNORE_LIMITS        = YES #HOME_USE_INDEX          = NO

To the issue: Let's say on startup I am at some random position e.g. 833 mm. LCNC now requires me to press the home button before I am able to switch to teleop mode or issue MDI commands. What happens now, is that the position of the axis is set to 0 and my two soft limits of 0 mm and 1000 mm are applied. This however is in my opinion not correct since the soft limits are now actually at 833 mm and 1833mm. This would lead to a crash if I were to move the axis. I need the homing sequence to keep the 833 mm absolute position value and apply the soft limits at the effective 0 mm and 1000 mm. Basically I need it to just set the "homed" flag and be done with it.

Hope I was able to describe issue somewhat clearly. Any ideas?

Thank you and greetings

Please Log in to join the conversation.

More
2 years 2 months ago #306722 by Aciera
Maybe immediate homing works for you, see section 6.14:
linuxcnc.org/docs/html/config/ini-homing.html#_immediate_homing

[edit]
Actually I think the above will still zero your position so not what you are looking for. Your solution is likely a custom homing procedure.

linuxcnc.org/docs/devel/html/man/man9/homecomp.9.html

[edit]
All nonsense see below.

Please Log in to join the conversation.

More
2 years 2 months ago #306740 by Sandro
Thank you Aciera!

I just changed the settings to these random values:
Code:
HOME_OFFSET = 0 HOME = 0 HOME_SEARCH_VEL = 30 HOME_LATCH_VEL = -5 HOME_FINAL_VEL = 10 HOME_USE_INDEX = YES HOME_SEQUENCE = 0 HOME_IGNORE_LIMITS = YES HOME_ABSOLUTE_ENCODER = 2

Now it works as intended and my absolute position persists through the homing process (not set to zero anymore). But no idea why...

[edit]

Alright I have found it. It was a simple spelling mistake in the HOME_ABSOLUTE_ENCODER = 2 line. This led to the setting not beeing applied. Nothing to do with the other lines. In fact I can delete anything about homing besides the absolute encoder setting = 2. Feel really stupid now :D

Please Log in to join the conversation.

More
2 years 2 months ago #306744 by Aciera
Oh my, totally missed that one. Thanks for reporting back.
Actually, I think this may be all you need:
Code:
HOME_ABSOLUTE_ENCODER = 2 HOME_SEQUENCE        = 0

Please Log in to join the conversation.

More
2 years 2 months ago #306750 by Sandro
Yes correct these are the only lines I have kept. I have set HOME_SEQUENCE = -1 for now so I am forced to home at startup in order to get the soft limits active. This way I will not move the axes by accident without limits in place. Later I plan to automate it so I don't need to press the button anymore.

Please Log in to join the conversation.

More
2 years 2 months ago #306809 by pippin88
For anyone copying and pasting - typo in absolute
Should be
Code:
HOME_ABSOLUTE_ENCODER = 2 HOME_SEQUENCE = 0

Please Log in to join the conversation.

More
1 year 10 months ago #316954 by TMonteiro
Hello Sandro,
would like to talk to you about your configuration of the Lichuan Servos with absolute encoder with linuxcnc.
I need feedback coz i am about to pull the trigger on some kits like that.

Thank you in advance,
Tiago Monteiro from Portugal

Please Log in to join the conversation.

Time to create page: 0.118 seconds
Powered by Kunena Forum