In hal, it is necessary to connect several index-related pins together to make everything work right: axis.#.index-enable motenc.0.enc-##-index-enable pid.#.index-enable
It's also very important to have your hal threads in the right order read hardware motion pid write hardware When this is done, motion sees both the step change in axis position and the falling index-enable. It changes its commanded position to match. When these new values for command and feedback are seen by pid, the P, I and D terms function properly since they are all calculated in terms of the difference of command and feedback. By contrast, FF0, FF1 and FF2 are calculated in terms of command only, and would have a 1-cycle glitch when command takes its big step. But when pid sees the falling edge of index-enable, it holds the computed FF* values for that one cycle, fixing the glitch. If you don't have all these things right, then you will get a 1-cycle (1ms typ) glitch in the PID output, which can often be heard as a BANG when an axis is first homed after power-on. I am not sure whether these things are correct or not in the motenc sample files, so you will want to delve into the hal and make sure. I rather suspect that at least the connection to pid.#.index-enable is missing in the hal file, because this is a comparatively new featuer (only 4 years old, probably:) I double checked, and I'm right that pid index-enable isn't hooked up in the motenc sample configuration. Here are the (untested by me!) changes you'd need to make to motenc_motion.hal with the old lines show with "-" and the modified lines shown with "+": diff --git a/configs/motenc/motenc_motion.hal b/configs/motenc/motenc_motion.hal index 8e5be93..19eeeab 100644 --- a/configs/motenc/motenc_motion.hal +++ b/configs/motenc/motenc_motion.hal @@ -70,6 +70,6 @@ setp pid.1.maxoutput [AXIS_1]MAX_OUTPUT setp pid.2.maxoutput [AXIS_2]MAX_OUTPUT # Connect index pulses to motion controller. -net Xindex motenc.0.enc-00-index-enable <=> axis.0.index-enable -net Yindex motenc.0.enc-01-index-enable <=> axis.1.index-enable -net Zindex motenc.0.enc-02-index-enable <=> axis.2.index-enable +net Xindex motenc.0.enc-00-index-enable <=> axis.0.index-enable pid.0.index-enable +net Yindex motenc.0.enc-01-index-enable <=> axis.1.index-enable pid.1.index-enable +net Zindex motenc.0.enc-02-index-enable <=> axis.2.index-enable pid.2.index-enable Jeff ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users