Homing / limits - the manual is misleading, possibly wrong
(I'm using Master on Debian Stretch)
My setup:
Lathe
Z axis: 245mm travel, limit switch at full positive travel
X axis: 95mm travel, limit switch at full positive travel
(That is limit switches at position furthest away from chuck).
Using limit switch as homing switch
To make things easy to understand, I want machine 0,0 to be at full positive travel, and all travel towards the chuck to be negative (similar to how a Z axis on a mill is usually 0 at the top, with all moves down being negative).
I was trying to follow the manual: linuxcnc.org/docs/html/config/ini-homing.html
3.6. HOME_OFFSET
Contains the location of the home switch or index pulse, in joint coordinates. It can also be treated as the distance between the point where the switch or index pulse is latched and the zero point of the joint. After detecting the index pulse, LinuxCNC sets the joint coordinate of the current point to HOME_OFFSET. The default value is zero.
Note - The home switch location, as indicated by the HOME_OFFSET variable, must be strictly within the soft limits. That is, MIN_LIMIT < HOME_OFFSET < MAX_LIMIT.
This does not work
Following this resulted in the limit switch being within the soft limits, and the machine would happily jog into the limit switch.
What works is (Z axis):
MIN_LIMIT = -245
MAX_LIMIT = 0
HOME = -0.01
HOME_OFFSET = 1
HOME_SEARCH_VEL = 10
HOME_LATCH_VEL = -0.25
HOME_FINAL_VEL = 0.000000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1
Note that HOME_OFFSET is greater than my MAX_LIMIT.
The above works as predicted - the machine homes, and sets the home switch (limit switch) position to 1 in machine coordinates. The soft limits are set to -245 to 0mm. The machine will not jog into the limit switch.
In case others would like an explanation of what happens:
When homing is commanded:
1. Moves towards the home (limit) switch at 10units/sec (HOME_SEARCH_VEL) until switch triggers
2. Moves away from home switch at 0.25units/sec (HOME_LATCH_VEL, note the minus to command a negative move) until the switch releases.
3. This position is set to HOME_OFFSET. That is, when the switch releases, that position on the axis is now called 1mm (in my case), defining where the axis travel / scale is in relation to the home switch.
4. The machine moves to HOME - which is just within the soft travel limits.
The manual needs clarification and more information about the relationship between MIN_LIMIT, MAX_LIMIT, HOME, HOME_OFFSET
The diagrams are good, but should included a reference to MAX_LIMIT to clarify things.
I suspect the note is really meant to be about HOME, not HOME_OFFSET. If you try to have a HOME position that is not between MIN_LIMIT and MAX_LIMIT, you get errors.
On another note, I think there is a bug (potentially in gmoccapy), which was not letting me use the override limits to jog off a limit switch.
The machine is on a limit switch (giving "joint 1 on limit switch error")
The override limits check box is available. When I try to check the override box, the error "No limit switch is active, ignore limits will not be set". Therefore I can't enable the machine to jog it off the limit switch!
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
linuxcnc.org/docs/devel/html/config/ini-homing.html
I though this was really high quality documentation when I set my machine up.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I don't use gmocappy.
/EDIT Sorry, re-read your post.
Please Log in or Create an account to join the conversation.
I think the Note for Home_offset is not correct and should be for home
Note - The home switch location, as indicated by the HOME_OFFSET variable, must be strictly within the soft limits. That is, MIN_LIMIT < HOME_OFFSET < MAX_LIMIT.
if your home offset is within the travel soft limit then you can always trip your limit switches. if you home is not within your travel soft limits the machine will always throw an error during homing they to exceed the soft limit.
the documentation in general is good, but that not can cause problems. what is the process to get documentation updated ?
Thank you
Calvin
Please Log in or Create an account to join the conversation.
It doesn't say the home switch must be within soft limits (they must be within hard limits).3.6. HOME_OFFSET
Contains the location of the home switch or index pulse, in joint coordinates. It can also be treated as the distance between the point where the switch or index pulse is latched and the zero point of the joint. After detecting the index pulse, LinuxCNC sets the joint coordinate of the current point to HOME_OFFSET. The default value is zero.
Note - The home switch location, as indicated by the HOME_OFFSET variable, must be strictly within the soft limits. That is, MIN_LIMIT < HOME_OFFSET < MAX_LIMIT.
Home offset is the distance from the home switch to the machine origin.
_Machine origin_ must be inside the soft limits.
I tried your home settings in a simulation:
[AXIS_X]
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
MIN_LIMIT = -245.0
MAX_LIMIT = 0.0
[JOINT_0]
TYPE = LINEAR
HOME = -0.01
MIN_LIMIT = -245.0
MAX_LIMIT = 0.0
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
STEPGEN_MAXACCEL = 937.5
SCALE = 80.0
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 1.000000
HOME_SEARCH_VEL = 3.500000
HOME_LATCH_VEL = 3.500000
and it failed until I set the home offset and home search velocity negative.
I feel reasonably confident that the simulation is right.
I wonder if your axis directions are correct on your machine?
directions are based relative to tool movement not table.
Chris
Please Log in or Create an account to join the conversation.
1. Hard limits by definition have to sit outside of soft limits. They should never be hit. Stuff breaks.
2. Limit switches need to be inside the hard limits far enough to allow the axis to coast to a stop before crashing into the hard limits. I found things stop pretty quickly
3. Soft limits need to be inside your limit switches so the switches are never triggered.
4. Home switches need to be inside limit switches (and soft limits) and must allow enough room to coast to a stop as the deceleration is very gentle during homing for maximum accuracy.
You can ignore limits (typical case is shared home/limit switches) but after homing, you must use a home offset to move the axis off the limit switch or it will trigger the limit as soon as it comes out of homing.
So from my experience, shared home/limit eats into machine travel. My home switches are about 45 mm inside the limit switches to allow the table to coast under homing, then I use a home offset to move it as close to the limit switch as I can to maximise travel.
Also you must be careful to read the right instructions. The OP said he was using master. The home offset is covered under para 3.7
linuxcnc.org/docs/devel/html/config/ini-...ng.html#_home_offset
But Chris quoted another version where the para was 3.6 so take care.
In my view if you have enough inputs (and enough room for the switches) having separate max limits, min limits and home switches is the way to go, particularly with gantry machines
Please Log in or Create an account to join the conversation.
Chris.
Please Log in or Create an account to join the conversation.
searching the doc soft limits seems to be there once (in the lines we are talking about) and hard limits is not explicitly stated at all. Think if we cleared up some terms and added enough a paragraph to add some definition this would help a ton.
Basically
Hard limits are the physical min and max of the machine
Soft limits create the area of restricted travel for and Axis / Joint ?
Home location is where the machine will move to after the homing sequence is complete
Home Offset is location of the homeswitch in the co ordinate system of the joint/axis
adding something about how to handle shared home/limit switches would be great. I'm actually happy to write this, if we are willing to update the documentation.
even having 1-2 examples would be every useful
Thank You
C
Please Log in or Create an account to join the conversation.