how to report maybe a bug in homing in 2.7.4 ?

More
25 Apr 2016 21:12 #73873 by Alicee
So sorry I am new and I don't know how to report what may be a bug. I am working on this for many days. Advice by Big JT and cncbasher has not found any what I may be doing wrong. I test many many versions of parameters in INI file but none works.

I am running standard (iso) of 2.7.0 then last week updated to 2.7.4 using Synaptic.
My cnc machine is gantry XYZ plus A. (router)
2 step motors for X, 1 each step motor for Y, Z, A
Mesa 6i25 + 7i76 from kit
6 limit switch at ends of X,Y,Z (no limit switch on A)
3 home switch. One each for X,Y,Z (no home for A)
estop, enables, etc.

Machine was running pport before and homing worked and that was 2.5.0, but now rewired for mesa. So like new and new configured. I use Axis GUI comes with 2.7.x and no changes.

What I expect is like I thought was read in:
linuxcnc.org/docs/2.7/html/config/ini-homing.html

For example:
My X axis has about 2ft travel. In INI file I set like this:
MIN_LIMIT = 0.0
MAX_LIMIT = 22.0
HOME = 6.0
HOME_OFFSET = 8.0
HOME_SEARCH_VEL = -0.30
HOME_LATCH_VEL = -0.04
HOME_FINAL_VEL = 0.50
HOME_USE_INDEX = NO
HOME_SEQUENCE = 3


I think my X axis looks like this:

LimSw - - SoftNeg - - - - - - - - - - - - - - - HMHM - - - - - - - - - - - - - b - - - - - - - - - - - - - - - - - - - - SoftPos - - LimSw

I think MIN_LIMIT = 0.0 and MAX_LIMIT = 22.0 sets my soft limits.
I jog to position "b" by eye. I know it is right of HM switch.
Home switch is acted by a cam on gantry and it is true about 1.3" of travel (hence "HMHM" but I use precise of right edge)
Home switch is about 8 or 9 inches from left limit switch.
I use menu [Machine][Homing][Home X Axis] from when machine sitting at "b"

I expect:
gantry moves left (neg direction) at HOME_SEARCH_VEL = -0.30
it finds HM switch, it sets coarse value about HOME_OFFSET = 8.0, and coast overshoot to stop.
it goes right (pos direction) until is gets off of HM switch, then coast to stop.
It goes left (neg direction) at HOME_LATCH_VEL = -0.04 until HM switch go true again.
It set DRO to HOME_OFFSET = 8.0.

It goes left (neg direction) and deccel to stop at HOME = 6.0 position.
Dotted red box should be 6.0" left of tool tip shown in AxisGUI.


I try many many values for HOME and HOME_OFFSET in many combos. I also tried some different MIN_LIMIT too.
Steps in green above ALWAYS WORKS according to linuxcnc.org/docs/2.7/html/config/ini-homing.html weather I start at "b" or changnig signs of HOME_SEARCH_VEL and HOME_LATCH_VEL and it always follow diagrams 1 & 2 accordingly. (no index on mine).

RESULTS:
machine NEVER goes to HOME position (red steps above) !
machine ALWAYS goes to soft limit in direction of last moving (@ last green step above) !

I looked at source code here:
github.com/LinuxCNC/linuxcnc/blob/2.7/src/emc/motion/homing.c
and especially about line number 587 and 695

I can see that
offset = joint->home_offset - joint->pos_fb;
/* this moves the internal position but does not affect the
motor position */
joint->pos_cmd += offset;
joint->pos_fb += offset;
joint->free_pos_cmd += offset;
joint->motor_offset -= offset;
/* next state */
joint->home_state = HOME_FINAL_MOVE_START;

works on my system (last green step above, DRO=HOME_OFFSET=8.0)

but while function looks the correct procedure here
joint->free_pos_cmd = joint->home;
/* do the move at max speed */
/* if home_vel is set (>0) then we use that, otherwise we rapid there */
if (joint->home_final_vel > 0) {
joint->free_vel_lim = fabs(joint->home_final_vel);
/* clamp on max vel for this joint */
if (joint->free_vel_lim > joint->vel_limit)
joint->free_vel_lim = joint->vel_limit;
} else {
joint->free_vel_lim = joint->vel_limit;
}
/* start the move */
joint->free_tp_enable = 1;
joint->home_state = HOME_FINAL_MOVE_WAIT;
break;


this just start the moving. Then next fn it wait for be at HOME position like
if (!joint->free_tp_active) {
/* yes, stop motion */
joint->free_tp_enable = 0;
/* we're finally done */
joint->home_state = HOME_LOCK;
immediate_state = 1;
break;
}


but on my cnc it never gets to any HOME position. Instead it hits the next clause as:
if (joint->on_pos_limit || joint->on_neg_limit) {
/* on limit, check to see if we should trip */
if (!(joint->home_flags & HOME_IGNORE_LIMITS)) {
/* not ignoring limits, time to quit */
reportError(_("hit limit in home state %d"),
joint->home_state);
joint->home_state = HOME_ABORT;
immediate_state = 1;
break;
}
}
break;

this what shows me why it always goes to soft limit at last direction traveling.

I must ask then:
1) does value in INI of [Axis_0] ever put correct into "home" variable (cause it always looks ignored)
2.) is it confused by names like in iniaxis.cc ?
HOME <float> home position (where to go after home)
HOME_FINAL_VEL <float> speed to move from HOME_OFFSET to HOME location (at the end of homing)
HOME_OFFSET <float> home switch/index pulse location
HOME_SEARCH_VEL <float> homing speed, search phase
HOME_LATCH_VEL <float> homing speed, latch phase

like is it not come through as 0.0 some how? Is it been watched?
or it got reset or cleared to zero somewhere?
3.) or is value of HOME calculated by diff from HOME_OFFSET - MIN_LIMIT ?

I can see that this may be missed if HM switch shared with neg limit switch cause then HM and negLim switch is same and so then clause in code at line 744 is the same end results which look correct.

In case of HM switch in middle (not shared) the HOME position is never happens !

Is this wrong? Am I bug or is code bug? What can I do?

regards,
Alice

p.s. I also tried 14ms debounce on HM switch pins in hal file - made no difference.

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

More
26 Apr 2016 15:36 #73916 by andypugh
Firstly, my machine does hoe to the commanded position, so it can work.
But my machine homes to an end rather than the middle. Which might matter.

Do you get any difference in behaviour with HOME set to 0, 8, -6, or 9?

To answer your question, you can report bugs here:
github.com/LinuxCNC/linuxcnc/issues
The following user(s) said Thank You: Alicee

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

More
26 Apr 2016 15:44 #73917 by Todd Zuercher
Did deleting the extraneous HOME = 0.0 entries in your ini file fix your problem?
The following user(s) said Thank You: Alicee

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

More
26 Apr 2016 17:12 #73921 by Alicee
Mr. Todd, YES ! Thank you very much.

That I learnt that only topmost entry name in INI is used and the below are ignore. i KNEW it was disrespect when I put HOME = nnn but I did not see HOME at top until Mr Todd show me it. That HOME at the top was put there by pncconf program like this:
#********************
# Axis X
#********************
[AXIS_0]
TYPE = LINEAR
HOME = 0.0
FERROR = 0.5
MIN_FERROR = 0.05
MAX_VELOCITY = 1.66666666667
MAX_ACCELERATION = 10.0
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
STEPGEN_MAXVEL = 2.08
STEPGEN_MAXACCEL = 12.50
P = 50.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 2.08333333333
# these are in nanoseconds
DIRSETUP = 5000
DIRHOLD = 5000
STEPLEN = 5000
STEPSPACE = 5000
STEP_SCALE = 32512
MIN_LIMIT = 0.0
MAX_LIMIT = 20.0
HOME_OFFSET = 8.000000
HOME_SEARCH_VEL = -0.050000
HOME_LATCH_VEL = 0.016667
HOME_FINAL_VEL = 0.316667
HOME_USE_INDEX = NO
HOME_SEQUENCE = 1

#********************


And I was only wrong looking at the down area with all other "HOME_nnnnn = NN" and didn't notice what pncconf put up at top of section.

However: here is my ini of same section now what is working as I expected:
#********************
# Axis X
#********************
[AXIS_0]
TYPE = LINEAR
FERROR = 0.5
MIN_FERROR = 0.05
#next is in machine units per second
MAX_VELOCITY = 1.2
MAX_ACCELERATION = 3
# The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
# If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
STEPGEN_MAXVEL = 1.4
STEPGEN_MAXACCEL = 3.75
P = 50.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 1.25
# these are in nanoseconds
DIRSETUP = 5000
DIRHOLD = 5000
STEPLEN = 5000
STEPSPACE = 5000
STEP_SCALE = 10160
#next are soft limits values
MIN_LIMIT = 0.0
MAX_LIMIT = 22.0
#home is where it goes after homed to home switch position
HOME = 6.0
#offset is at this value --- at home pos this is put into DRO
HOME_OFFSET = 8.0
#vel is how fast it first approach the switch, hunting, - is neg direction + is pos
HOME_SEARCH_VEL = -0.50
#lacth vel is on 2nd approach to sw position
HOME_LATCH_VEL = 0.05
#final vel is how fast it moves AFTER it is homed and going to offset, 0=maxvel
HOME_FINAL_VEL = 0.50
HOME_USE_INDEX = NO
#sequence is order of homing. 0 is first. Simultaneous if same number. -1 = don't do
HOME_SEQUENCE = 1
#********************


And I write myself comment note about each parameter.

So thanks to you guys every thing is 100% ok now. All is working just the docs say it should work. No bugs.

best regards,
Alice

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

More
26 Apr 2016 17:27 #73925 by Todd Zuercher
Glad to hear that you have it working.

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

Time to create page: 0.150 seconds
Powered by Kunena Forum