How do I zero an axis when homed?

More
03 Oct 2020 20:20 #184724 by jhandel
To note, I am not above fixing this bug if I can get a dev environment stood up, but I also don't want to run on a custom build and all the risks that come with that, so if homing can be pulled out into a macro I am cool with building that instead I suppose...

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

More
03 Oct 2020 21:04 #184729 by PCW
So you are not really using the encoder at all in the hal file
so homing to index is not expected to work in that situation.

The way homing to index is expected to work is that after coarse homing
to the home switch, a search for index is started and index_enable
is asserted. When a physical index is detected in hardware, LinuxCNC expects
2 things to happen: 1 it expects the encoder position to set to zero, and 2. it expects
that the index_enable signal will be cleared (signalling to LinuxCNC that the index has be detected)

Since you are using the step generators feedback position rather than the encoders
feedback, the stepgens position is not cleared on index so you get an odd offset

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

More
03 Oct 2020 21:15 - 03 Oct 2020 21:15 #184730 by jhandel
So even though I am doing :

net x-index-enable joint.0.index-enable <=> hm2_7i76e.0.encoder.02.index-enable.

Its ignoring it and the index pulse itself because of :
net x-pos-fb <= hm2_7i76e.0.stepgen.00.position-fb
net x-pos-fb => joint.0.motor-pos-fb

It is using the encoder index puise as a trigger but then its not just saying "this is zero" it is pulling some un-expected value from the stepgen?

is there any way to customize this behavior outside of source code because I think the issue with that encoder is that Z and A pulses work great but B is flaky and so position-fb is not accurate.. I would think that when the right tiggers flipped Linux CNC would just set G53 to zero and call it a day and not try to be "fancy" and read anything off of anything..
Last edit: 03 Oct 2020 21:15 by jhandel.

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

More
03 Oct 2020 21:36 - 03 Oct 2020 21:37 #184732 by PCW
The way index works is that the encoder counter hardware is expected to
capture the count or reset the count at index. This means the the encoder position
reference is accurate to one encoder count regardless of the encoder count rate
(which could be many counts per servo period). This requires that LinuxCNC make
use of this special encoder hardware.

You might be able to use index_enable and some hal logic to simulate
a more accurate home switch, but in any case you cannot use HOME_USE_INDEX
with stepgen position feedback unless the stepgen position is cleared on index.

Another possibility is fixing your encoder hardware and getting the feedback
position from the encoder rather than the stepgens
Last edit: 03 Oct 2020 21:37 by PCW.

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

More
03 Oct 2020 21:49 #184735 by jhandel
Just started testing with the encoder set as, I think, the follow errors I was having were related to moving fast (so I can at least test the issue there.. I wonder if I can AND the limit switch and the index... that would work if I move the switch to extremely close to where the index flips so that the switch is "on" when the index fires..

I did see (using HAL config) what you mean how the count resets to zero

Now to get the PID worked out enough to test with the encoder to see if I can fake a zero well enough to maybe move the home switch.

(now where was that PID tuning doc, time to hunt through my notes and the forums lol)

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

More
05 Oct 2020 00:56 #184897 by jhandel
So when the Servo is fully closed loop it does zero with the Index...

If I am reading my ferror correctly its under .02 mm 99.9% of the time and usually under .005mm... So I'll go with that..

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

Time to create page: 0.138 seconds
Powered by Kunena Forum