absolute multiturn encoders (solved)

More
28 Dec 2020 13:28 #193362 by Aciera
Replied by Aciera on topic absolute multiturn encoders
The only difference I could find between to two modes is that mode 2 does a move to the home position. Have you set any HOME_OFFSET values in the INI?

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

More
28 Dec 2020 13:32 - 28 Dec 2020 18:59 #193363 by bkt
All problem seems to related some HOMING parameter and a bad encoder scale settings. Here the right HOMING INI config:
HOME_ABSOLUTE_ENCODER	= 2
HOME					= 0
HOME_OFFSET				= 0
HOME_SEQUENCE			= 0
HOME_SEARCH_VEL			= 0
HOME_LATCH_VEL			= 0
HOME_IGNORE_LIMITS		= yes

And here the first wrong one:

HOME_ABSOLUTE_ENCODER = 2
HOME = 0.0
HOME_DELAY = 0
HOME_VEL = 0
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_USE_INDEX = NO
#HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 0


So with the right one, HOME_ABSOLUTE_ENCODER = 2 work like a charm. The only remaining problem is the obligation to use the home all button as soon as the GUI is started. But automating this doesn't seem like a problem. It is enought to create an RTAI component that verifies the real position of the axes. If inside the soft-limits and in the possible safety area, a bool output connected to halui.joint.n.home can be activated .... in this way it will not be necessary to press any button. Obviously you need a pin for unhome. I have not found the dimitri patch .... but making a component where to insert the minimum and maximum values of each joint read from the .hal file and which makes the control regarding where the encoders find us out there does not seem to me bad idea ..... and probably dimitri did more or less like this, probably in a more elegant way.

regards
bkt
Last edit: 28 Dec 2020 18:59 by bkt.
The following user(s) said Thank You: Aciera

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

More
28 Dec 2020 14:02 #193367 by dm17ry
my forks on the github:
github.com/yur7aev/linuxcnc/tree/nyx2.8
github.com/yur7aev/linuxcnc/tree/nyx_master
those have some other stuff mostly for my sscnet/mds/mechatrolink interface cards support.

i did absolute encoder support in my own way because i wanted to keep the ability to home with limit switches/index/whatever. when you set USE_ABSOLUTE_ENCODER you lose it and have to adjust HOME_OFFSET manually. my patch basically does 2 things:
1. adds a set-homed pin to each joint which just sets the "homed" flag without doing anything else. really simple and straightforward thing apart from the need to add it thru a dozen of source files.
2. add an ABSOLUTE_ENCODER ini var in [JOINT_n] section. when set, upon exit it will save the "motor_offset" value instead of the current joint position to the .pos file.

with some mitsubishi drives i have no control upon the position reported by absolute encoders. it's just some random number which persists across power-ons. then the linuxcnc executes the homing, it sets the motor_offset = home_offset - motor_pos_fb when the joint is at the home switch position. so all i need to do is to save that "motor_offset". upon startup it is already getting read from the .pos file - nothing to change here.
The following user(s) said Thank You: bkt, Aciera

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

More
16 Nov 2023 07:05 #285583 by bkt
know someone if dm17ty stuff is include in actual master branch or not? not see on manual .... so think not ...but is for chek and not rebuilt the wheel.

regards

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

More
16 Nov 2023 09:01 #285589 by Aciera
No, it has not been merged. I have tried to motivate him to get it included but there wasn't much interest. It's rather unfortunate in my view as it forces everyone who buys his hardware to patch linuxcnc because his drivers are also not included anymore.

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

More
16 Nov 2023 20:06 #285648 by dm17ry
i try to keep up with stable releases, but yeah, a few guys who want master are in trouble...
it's not that i didn't have much interest. i just wasn't sure it's the optimal solution to push upstream. and now with an ability to make a custom homing module i can probably add my hal pins in there without touching the base code. i'll see what can i do with it in upcoming weeks. if i like it, i can prepare a pull request. though i have no idea how it works :)
The following user(s) said Thank You: bkt, Aciera

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

Time to create page: 0.151 seconds
Powered by Kunena Forum