Problems homing at higher speed

More
01 Feb 2016 00:39 #69351 by 10K
I've been setting up LinuxCNC on my lathe. I got the homing function working, but only at lower speeds. The lathe carriage will move at 120ipm without locking up the steppers. But if I set the initial homing speed to more than 36ipm, it overshoots the limit switch, and either gets confused or bangs in to a hard limit and stalls the stepper. It's almost as if it does not see the switch at all.

If I'm not setting home, I can run the lathe carriage at 120ipm, and it'll stop like it's supposed to when it hits the same switch.

The home/limit switch is an industrial quality proximity switch. (SunX EX-10). I'm using the same switch on my A-spindle encoder, and it works fine at 25,000 pulses/min (417 Hz). I get nice square waves on the HAL scope.

I'm using a Mesa 7i92 board on a dedicated ethernet to talk to the computer with SERVO_PERIOD = 1000000

Here's the relevant section from my .ini file:
[AXIS_0]
TYPE = LINEAR
HOME_SEARCH_VEL = 0.6
HOME_LATCH_VEL = 0.1
#HOME_FINAL_VEL = 1.0
HOME_IGNORE_LIMITS = YES
HOME_USE_INDEX = NO
HOME_OFFSET = 7.8
HOME = 6.0
HOME_IS_SHARED = 1
HOME_SEQUENCE = 0
VOLATILE_HOME = 1
FERROR = 1
MIN_FERROR = 0.01
MAX_VELOCITY = 1.25
MAX_ACCELERATION = 4.0
STEPGEN_MAXVEL = 1.5625
STEPGEN_MAXACCEL = 5.0
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
DIRSETUP   = 50000
DIRHOLD    = 20000
STEPLEN    = 1000
STEPSPACE  = 3000
STEP_SCALE = 12800.0
MIN_LIMIT = -0.001
MAX_LIMIT = 7.8

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

More
01 Feb 2016 01:13 - 01 Feb 2016 01:15 #69352 by PCW
Replied by PCW on topic Problems homing at higher speed
Are you sure the axis can stop before it runs into the hard stop at higher than 36IPM?
Your acceleration is pretty slow so will take .156" to stop at full speed ( 75 IPM in the INI file )

BTW your P term should be 1000 for 1KHz thread rate
(and you min_ferror and ferror should be much smaller )
Last edit: 01 Feb 2016 01:15 by PCW.
The following user(s) said Thank You: 10K

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

More
01 Feb 2016 02:23 #69354 by 10K
Replied by 10K on topic Problems homing at higher speed
You were on to something there! There's (by eyeball) about 1/4" between the limit switch and the hard stop. It was hitting the hard stop while coasting down, which threw off the steps and generated an error. I bumped up the acceleration a bit. My cross slide is very heavy, and even with big steppers, it takes time to accelerate / decelerate it.

Here's what I landed on:
[AXIS_0]
TYPE = LINEAR
HOME_SEARCH_VEL = 1.10
HOME_LATCH_VEL = 0.1
#HOME_FINAL_VEL = 1.0
HOME_IGNORE_LIMITS = YES
HOME_USE_INDEX = NO
HOME_OFFSET = 7.8
HOME = 6.0
HOME_IS_SHARED = 1
HOME_SEQUENCE = 0
VOLATILE_HOME = 1
FERROR = 0.001
MIN_FERROR = 0.0002
MAX_VELOCITY = 1.25
MAX_ACCELERATION = 10.0
STEPGEN_MAXVEL = 1.5625
STEPGEN_MAXACCEL = 12.5
P = 1000.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
DIRSETUP   = 50000
DIRHOLD    = 20000
STEPLEN    = 1000
STEPSPACE  = 3000
STEP_SCALE = 12800.0
MIN_LIMIT = -0.001
MAX_LIMIT = 7.8

The Z axis is the same, except I had to set MAX_ACCELERATION = 4.0 because of the additional mass.

I reset P to 1000, and changed min_ferror and ferror. I'm not sure what the values should be - do these look OK? And any other recommended changes? My resolution is 1/STEP_SCALE = 0.000078"/step

And while I'm asking, I have Pacific Scientific MA6410 stepper drivers, and I don't know the setup parameters. I played with them a bit to get the ones I used. Does anyone have any data on these? I have a manual, but it only gives what might be two of them.

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

More
01 Feb 2016 03:01 #69356 by PCW
Replied by PCW on topic Problems homing at higher speed
I do know as a general rule that there's no reason to use shorter step lengths than needed
so for the most timing margin these should be as long as possible. Since you have a maximum step rate
of 1.25 IPS * 12800 Steps Per Inch = 16 KHz, its not going to hurt to set your step length and step space
to say 5 or 10 usec

One thing I see that is wrong is the MAX_OUTPUT = 1.25 statement
This bounds the PID velocity output to your max velocity but leaves no headroom for errors
this really should equal the STEPGEN_MAXVEL = 1.5625 or just be set to 0
( MAX_OUTPUT = 0 turns off the PID output limit )

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

More
04 Feb 2016 18:28 - 04 Feb 2016 18:29 #69599 by 10K
Replied by 10K on topic Problems homing at higher speed
I've done a lot more work on this. I spent this morning experimenting to figure out the speed and then the velocity that the steppers stalled, then setting the maximum rates at 75% of that. When I got finished, I could successfully home the two axes of my lathe, and I was getting excellent repeatability.

A little later, I homed the machine again, and the Z axis gave a joint following error. I dialed down the speed and acceleration, but kept getting the error. It occurred at different places in the homing routine.

The X axis homing has been working fine, even though it has a similar setup and runs at a higher speed. (because it weights less).

Is there some parameter.that I need to reset? I've tried increasing the FERROR variables, and dialed down the velocities and accelerations some, but that does not necessarily help.

Here's my base .ini file. AXIS_0 is my X axis, and it works. AXIS_1 is z, where I get the follow error:
[AXIS_0]
TYPE = LINEAR
HOME_SEARCH_VEL = 0.9
HOME_LATCH_VEL = 0.1
#HOME_FINAL_VEL = 1.0
HOME_IGNORE_LIMITS = YES
HOME_USE_INDEX = NO
HOME_OFFSET = 7.8
HOME = 6.0
HOME_IS_SHARED = 1
HOME_SEQUENCE = 0
VOLATILE_HOME = 1
FERROR = 0.001
MIN_FERROR = 0.0002
MAX_VELOCITY = 1.8
MAX_ACCELERATION = 12.75
STEPGEN_MAXVEL = 2.4
STEPGEN_MAXACCEL = 17
P = 1000.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 0
DIRSETUP   = 50000
DIRHOLD    = 50000
STEPLEN    = 2000
STEPSPACE  = 2000
STEP_SCALE = 12800.0
MIN_LIMIT = -0.001
MAX_LIMIT = 7.8
#BACKLASH = 0.0135

[AXIS_2]
TYPE = LINEAR
HOME_SEARCH_VEL = 0.9
HOME_LATCH_VEL = 0.1
#HOME_FINAL_VEL = 1.0
HOME_IGNORE_LIMITS = YES
HOME_USE_INDEX = NO
HOME_OFFSET = 19.5
HOME = 12
HOME_IS_SHARED = 1
HOME_SEQUENCE = 1
VOLATILE_HOME = 1
FERROR = 0.001
MIN_FERROR = 0.0002
MAX_VELOCITY = 1.25
MAX_ACCELERATION = 4.5
STEPGEN_MAXVEL = 1.65
STEPGEN_MAXACCEL = 6.0
P = 1000.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 0
DIRSETUP   = 50000
DIRHOLD    = 50000
STEPLEN    = 2000
STEPSPACE  = 2000
STEP_SCALE = 12800.0
MIN_LIMIT = 0.001
MAX_LIMIT = 19.5
BACKLASH = 0.015
Last edit: 04 Feb 2016 18:29 by 10K. Reason: typo

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

More
04 Feb 2016 18:36 #69600 by PCW
Replied by PCW on topic Problems homing at higher speed
What is your servo thread rate?

I may help to plot Z-Axis ferror to see whats going on

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

More
04 Feb 2016 19:14 - 04 Feb 2016 19:14 #69603 by 10K
Replied by 10K on topic Problems homing at higher speed
Here's the section from the .ini:
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
SERVO_PERIOD = 1000000

I tried to look at FERROR on the scope. I found something very interesting. axis.0.ferror is a very small number that jumps around when I move the X axis. axis.1.ferror is always zero when I move the Z axis I'm guessing that's the problem, but I don't know how to fix it.
Last edit: 04 Feb 2016 19:14 by 10K. Reason: typo

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

More
04 Feb 2016 19:22 #69604 by Todd Zuercher
Shouldn't the Z axis be axis.2.ferror?

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

More
04 Feb 2016 19:46 #69606 by 10K
Replied by 10K on topic Problems homing at higher speed
Oops. Here's the screenshot. I ran the Z axis left-right-left-boom. Got error. The remainder of the scope had values, but they don't even register at this vertical scale.

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

More
04 Feb 2016 19:47 - 04 Feb 2016 19:53 #69607 by PCW
Replied by PCW on topic Problems homing at higher speed
Can you post your complete hal and ini files?
Last edit: 04 Feb 2016 19:53 by PCW.

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

Time to create page: 0.095 seconds
Powered by Kunena Forum