Strange homing behavior

More
4 years 9 months ago #231046 by johnbl
Replied by johnbl on topic Strange homing behavior
Yes it is homing, I can observe the various homing velocities on the machine.
On the video you can see near -250 the homing switch being triggered. Y is reset to 0 and it starts looking for index in the opposite direction. But after index is found at 3-4 it resets Y to -250 and travels to 0 at HOME_FINAL_VEL speed.

The soft limit error is triggered at the very end of the homing, when the axis is back at its initial power-on position.
The whole thing is very weird...

Please Log in to join the conversation.

More
4 years 9 months ago #231065 by Todd Zuercher
What hardware do you have? Are you using some kind of smart servos and have the home switches connected to them and trying to use the homing routines built into the drives?

Please Log in to join the conversation.

More
4 years 9 months ago #231070 by johnbl
Replied by johnbl on topic Strange homing behavior
I'm using Yaskawa servos driven by step/dir from a Mesa 7i94/7i85 combo. No special homing routines from the servos are used, the homing and limit switches are only connected to LinuxCNC.
Also the encoder position feedback from the drives is wired but currently not used in LinuxCNC, only the index pulse is.

Here's the relevant HAL config for the axis:
Code:
net y-home hm2_7i94.0.7i84.0.1.input-00 => joint.1.home-sw-in net y-limit-min hm2_7i94.0.7i84.0.1.input-01-not => joint.1.neg-lim-sw-in net y-limit-max hm2_7i94.0.7i84.0.1.input-02-not => joint.1.pos-lim-sw-in net y-enable joint.1.amp-enable-out => hm2_7i94.0.stepgen.01.enable pid.1.enable # position command and feedback net y-pos-cmd joint.1.motor-pos-cmd => pid.1.command net y-pos-fb hm2_7i94.0.stepgen.01.position-fb => joint.1.motor-pos-fb pid.1.feedback net y-command pid.1.output hm2_7i94.0.stepgen.01.velocity-cmd setp hm2_7i94.0.stepgen.01.control-type 1 setp hm2_7i94.0.stepgen.01.step_type 0 setp hm2_7i94.0.stepgen.01.dirsetup [JOINT_1]DIRSETUP setp hm2_7i94.0.stepgen.01.dirhold [JOINT_1]DIRHOLD setp hm2_7i94.0.stepgen.01.steplen [JOINT_1]STEPLEN setp hm2_7i94.0.stepgen.01.stepspace [JOINT_1]STEPSPACE setp hm2_7i94.0.stepgen.01.position-scale [JOINT_1]SCALE setp hm2_7i94.0.stepgen.01.maxvel [JOINT_1]STEPGEN_MAX_VEL setp hm2_7i94.0.stepgen.01.maxaccel [JOINT_1]STEPGEN_MAX_ACC setp pid.1.error-previous-target true setp pid.1.Pgain [STEPGEN_PID]P setp pid.1.Igain [STEPGEN_PID]I setp pid.1.Dgain [STEPGEN_PID]D setp pid.1.bias [STEPGEN_PID]BIAS setp pid.1.FF0 [STEPGEN_PID]FF0 setp pid.1.FF1 [STEPGEN_PID]FF1 setp pid.1.FF2 [STEPGEN_PID]FF2 setp pid.1.deadband [STEPGEN_PID]DEADBAND setp pid.1.maxoutput [STEPGEN_PID]MAX_OUTPUT setp pid.1.maxerror [STEPGEN_PID]MAX_ERROR # Y Encoder setp hm2_7i94.0.encoder.01.counter-mode 0 setp hm2_7i94.0.encoder.01.filter 1 setp hm2_7i94.0.encoder.01.scale 1000 net y-index-enable hm2_7i94.0.encoder.01.index-enable <=> joint.1.index-enable

Please Log in to join the conversation.

More
4 years 9 months ago #231085 by PCW
Replied by PCW on topic Strange homing behavior
I think this behavior is probably expected since you are not using encoder feedback.

LinuxCNC expects the feedback position to be cleared on index
(encoder position is cleared on index but stepgen position is not)

Possible fixes are

1. Use the encoders for feedback (possibly just looping back the step/dir signals to the encoder inputs)
2. Use firmware with stepgen index support

Please Log in to join the conversation.

More
4 years 9 months ago #231088 by rodw
Replied by rodw on topic Strange homing behavior
Actually further to PCW's advice, it may help. In master branch (V2.9), there is a new homing parameter
HOME_INDEX_NO_ENCODER_RESET
which is meant to be used where the encoder does not reset.
I just stumbled on this the other day 

Please Log in to join the conversation.

More
4 years 9 months ago #231133 by johnbl
Replied by johnbl on topic Strange homing behavior
Thanks, it finally starts to make sense.
So with index homing LinuxCNC expects joint.X.motor-pos-fb to be reset to 0 on the index pulse. This is unfortunately not documented anywhere.

HOME_INDEX_NO_ENCODER_RESET is interesting... Yes it should solve my issue, but it also throws away the repeatability of the index. I'll look into this stepgen with index support feature.

Before going further I'm trying to scale the encoder position feedback correctly. The servo drive is configured to output 10'000 encoder pulses per revolution. I have a 10mm pitch ballscrew so this means 1000 pulses per mm, so encoder scale is set to 1000. It's a quadrature encoder.

However the encoder position is consistently off by a factor of 4. When DRO position = 1, encoder position = 4. Are Mesa encoders configured to count 4x per PPR?

EDIT: it seems so:

scale - (Float, RW) Converts from count units to position units. A quadrature encoder will normally have 4 counts per pulse so a 100 PPR encoder would be 400 counts per revolution.

Please Log in to join the conversation.

More
4 years 9 months ago #231213 by Todd Zuercher
The reason is because linuxcnc counts edges instead of just pulses.

Please Log in to join the conversation.

More
4 years 9 months ago #231302 by johnbl
Replied by johnbl on topic Strange homing behavior
So I managed to reflash the 7i94 firmware configured with stepgen index.
This leads to 2 more questions:
1. Should the joint index-enable pin be also connected to the pid index-enable?
2. I see there is support in hostmot2 firmware for a shared index pin between stepgen and muxed encoder. Is there something alike for a non-muxed encoder?

Please Log in to join the conversation.

More
4 years 9 months ago #231322 by PCW
Replied by PCW on topic Strange homing behavior
1 Yes (and index enable should come from the appropriate stepgen index enable)
2. Yes: (from IDROMConts) constant SharedSDQCIdxPin : std_logic_vector(7 downto 0) := x"06";

Please Log in to join the conversation.

More
4 years 9 months ago #231330 by johnbl
Replied by johnbl on topic Strange homing behavior
Thanks.
However I can't find this SharedSDQCIdxPin reference anywhere.
I tried firmware from www.mesanet.com/software/parallel/hostmot2.zip
and freeby.mesanet.com/software/parallel/hostmot2.zip

Please Log in to join the conversation.

Time to create page: 0.069 seconds
Powered by Kunena Forum