On 13 January 2014 16:21, Marius Alksnys <[email protected]> wrote:
> src/hal/drivers/mesa-hostmot2/resolver.c:
>
> I changed:
> if (*res->hal.pin.index_enable && (res->index_cnts %
> res->hal.param.index_div == 1)){
>
> to
>
> if (*res->hal.pin.index_enable && (res->index_cnts %
> res->hal.param.index_div == 0)){
>
>
> now it works to both directions! :)
I spent quite a long time testing this behaviour before pushing:
http://git.linuxcnc.org/gitweb?p=linuxcnc.git;a=blobdiff;f=src/hal/drivers/mesa-hostmot2/resolver.c;h=3fca0a16f6eeeea30ad90098e81f5e225a0b7b96;hp=f678c625f5bd0ff45310d2f7ad14190aea45e704;hb=492421b6c01eaafa08d16fa126d4ec591fe2b104;hpb=91efbf5fe8da8e1d5c023c45a94a3303cf29c27f
However, I can see that that code won't work properly for index-div ==
1 (because there is no X such that X % 1 == 1). So clearly I didn't
spend quite long enough looking at the index-div == 1 case.
However your code will be wrong for index-div > 1, so more work is needed.
I am trying to remember what hardware setup I used, I don't recall
dismantling my machine but it might have been before I finally fitted
the X-axis motor.
The patch above was because the original code tended to "index"
multi-turn resolvers in different places in each direction. The offset
of 1 is required to fix that. However breaking single-turn resolvers
in the process was bad.
The correct code might be:
if (*res->hal.pin.index_enable && (res->index_cnts %
res->hal.param.index_div == (res->hal.param.index_div == 1 ? 0 : 1))){
--
atp
If you can't fix it, you don't own it.
http://www.ifixit.com/Manifesto
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers