Homing two encoders on one axis

More
31 Dec 2018 02:15 - 01 Jan 2019 01:34 #123183 by Nitram
Hello all.

In a previous post Andy mentioned the concept of having a constant offset between rotary encoder vs linear encoder and feeding this into the PID for the axis.

Posts 1 & 2 below:
forum.linuxcnc.org/38-general-linuxcnc-q...s-vs-rotary-encoders

I have been trialing two PID loops, one from rotary fb (velocity control to stepgen), the other from the linear fb using only an I gain and then sum2 with the output of the other PID. (This is taken from the wiki on two encoders for one axis, thanks Chris for your input here!).

I would also like to compare the offset suggestion of Andy's.
1. I will hardwire the index pulse of the rotary into the index pulse of the linear so they both have the same datum point.
2. Homing is then done on index from this (rotary driven) pulse for both encoders.
3. Thus at the homed position they should both be at zero (plus any overrun from axis decel to zero from homing velocity but encoder.N.position should both read the same).
4. Then have a sum2 to do: (linear fb minus rotary fb) plus rotary fb. (this should make the summed position fb equal to linear position at any given time).
5. Net this feedback into the axis.N.motor-pos-fb for the axis.

The thought process behind this is that in this way:
a. if low resolution linear was used for position feedback, the velocity signal derived from it (for a velocity driven axis) is poor.
b. the velocity driven axis has "a view of" the high resolution of the rotary encoder for velocity.
c. if low resolution linear was used for position feedback with no backlash it would take time for the I gain to move the axis to the correct position if it is a relatively large backlash figure
d. if low resolution linear was used for position feedback but backlash WAS used, then while the backlash is being applied, the linear encoder position would be frozen during this offset, which is fine for a rotary taking up slack on the ballscrew, but does not work for a direct reading linear.
e. By summing the two outputs in the fashion above and inputting them in via axis.N.motor-pos-fb, the summed fb will now always equal the linear fb, but backlash can be used on the rotary encoder to bring the rotary and linear values as close together as possible, minimizing the I gain correction needed, while not changing the actual absolute position or LCNC position readout as the sum2 keeps that position the same even through a backlash move.

So, the two questions:
1. A little convoluted but does the above make sense?
2. How can I have two encoders zero on index? EDIT: done by hardwiring index pulse from rotary to linear, then added linear to "enable-index" pin.

Thanks!
Best wishes to Chris, Andy and to all for 2019!
Last edit: 01 Jan 2019 01:34 by Nitram.

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

More
31 Dec 2018 14:27 #123208 by andypugh
Note that the offset idea was because the machine in that post was a stepper machine in position control. Summing two PIDs is likely to be a better solution if there is already a position PID.
The following user(s) said Thank You: Nitram

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

Time to create page: 0.104 seconds
Powered by Kunena Forum