Would like to learn about index enable hoohah

More
29 Jul 2011 09:52 #11982 by 1:1
Hello all,

Hal signal flow is making much more sense to me nowadays :cheer:

But I still have some learning to do in that I'm a bit lost by the index carry on - I've tried reading the relevant manual pages but I think I'm up against a wall of personal ignorance to the topic...

Ok so:
setp    hm2_5i22.0.encoder.01.index-invert 0
setp    hm2_5i22.0.encoder.01.index-mask 0
setp    hm2_5i22.0.encoder.01.index-mask-invert 0

net      x-index-enable    axis.0.index-enable  <=>  hm2_5i22.0.encoder.01.index-enable
net      x-index-enable  <=>  pid.0.index-enable

hostmot manual says:
(bit in/out) index-enable: When this pin is set to True, the count (and therefore also position) are reset to zero on the next Index (Phase-Z) pulse. At the same time, index-enable is reset to zero to indicate that the pulse has occurred.

Hal PID page says:
pid.N.index-enable bit in
On the falling edge of index-enable, pid does not update the internal command derivative estimate. On systems which use the encoder index pulse, this pin should be connected to the index-enable signal. When this is not done, and FF1 is nonzero, a step change in the input command causes a single-cycle spike in the PID output.

Axis / Motion page says:
axis.N.index-enable IO BIT - Should be attached to the index-enable pin of the joint’s encoder to enable homing to index pulse

See! I did read the manual :P

I know at least 3 of the 5 motors I'm using have index from their encoders - I think i know what they can do, but not so much of the use of them practically, as in great we know when the motor has gone around once, but if we have encoder pulses then we know that already ? hmmmm, thinking cap on - ok so for homing maybe ? like you get a trigger from a physical home switch then drive until you hit the index signal ?? (better accuracy?) - but I don't quite get what is going on with the Hal here

We have a wire called ' x-index-enable' it connects the three hal whatsits above (correct?) - but which if any will actually go 'high' ?

- hm2_5i22.0.encoder.01.index-enable ? every rotation ??
- axis.N.index-enable ?

I'm a bit flummoxed of where to go looking for info next - can anyone enlighten me ?

cheers all,
Nick

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

More
29 Jul 2011 12:44 #11987 by andypugh
The encoder index is, as you have noticed, of limited use.

It can let you home very, very accurately, to within the variablility of the index sensor trigger point.

It is useful for finding the absolute position of the motor shaft when running brushless motors.

However, the real use in the EMC2 context is multipass lathe threading. The index is used to ensure that the motion starts at the same point in the rotation every time, so that the cuts line up.

I think it is used in rigid tapping with a mill, too. But as I doubt anyone does multi-pass rigid tapping I am not sure why.

It would also be very important for some styles of mill toolchanger.

Index is used to make the encoder counts absolute to shaft position. The quadrature counters start counting from zero as soon as they are enabled, regardless of the shaft position.

Basically, a function (running in the servo thread) sets index-enable for a specific encoder instance. The encoder counter (running in hardware or the fast base-thread) watches for the index pulse, zeros the counts and resets the index-enable pin.
Some time later, at which point the encoder counts are probably no longer zero, the slow servo-thread function is called again, notices that the latch has cleared, and now knows that the current encoder counts value is referenced to the index so that 0 counts, 1024 counts -2048 counts etc (dependent on actual encoder counts-per-rev) all correspond to the eame shaft angle (and, more importantly, the same shaft angle as last time the machine ran).

The index-enable pin on the PID is a nice touch, but not core to the index-enable function.

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

More
29 Jul 2011 23:13 #11999 by 1:1
multi-pass tapping ... hmmm, deep blind holes - swarf breaking/clearing ? or use a spiral flute ? anyways ...

ok, I can see why and how knowing the real shaft position with respect to the encoder '0' is helpful. Lathe threading for example, the index effectively becomes the thread and spring loaded thread follower on manual feed lathe in threading mode (?). But with an encoder once you've homed once aren't you set, counts will maintain positioning right ? or is it helpful for the fact you might not do all your work in one session, so you want absolute shaft positioning for every session after an evening switch on/switch off and re-home ?

When you say a function sets index-enable for a specific encoder - you mean it sets "axis.N.index-enable" ? Any example functions ?

What I'm hearing is that I could remove this part if I were just doing vanilla machining (i.e. didn't have a servo spindle and weren't coding anything that would call those functions) ? Or in the case of a 3 axis, just have it on the Z axis ?

Also just to confirm - does this line do the same thing in hal as the above code:

net x-index-enable hm2_5i22.0.encoder.01.index-enable <=> axis.0.index-enable pid.0.index-enable ?

thanks as always Andy

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

More
30 Jul 2011 02:33 #12004 by PCW
Yes the code does the same thing
The index stuff is important if you want accurate homing
limit switch positions wander about

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

Moderators: cmorley
Time to create page: 0.248 seconds
Powered by Kunena Forum