Problem with home/limit configuration
26 Mar 2015 16:22 - 26 Mar 2015 16:23 #57203
by Vinci
Problem with home/limit configuration was created by Vinci
Hello there
I'm new to linux CNC and currently trying to get the home/limit configuration of my switches right. My setup consists of 2x inductive switches per axis one of which I'd like to use for homing (preferably the lower ones for the X and Y axis and the higher one for the Z axis). At first I was under the impression that the configuration worked right out of the wizard, but every time I try to home an axis I get a limit error as well.
So I started reading the documentation on home/limit switches and went on with editing the parameters HOME, HOME_OFFSET and the sign of HOME_LATCH_VEL. An old forum entry suggested, that HOME and HOME_OFFSET can't be the same value if the same switch is used for homing and limiting, but it didn't really matter what I changed... the error still comes up.
Out of desperation I even added a debounce function to the inputs, just in case... of course that didn't help either.
For the sake of simplicity here is the .ini and .hal code of my Z-axis configuration:
ini
hal
Any ideas?
- one desperate user...
I'm new to linux CNC and currently trying to get the home/limit configuration of my switches right. My setup consists of 2x inductive switches per axis one of which I'd like to use for homing (preferably the lower ones for the X and Y axis and the higher one for the Z axis). At first I was under the impression that the configuration worked right out of the wizard, but every time I try to home an axis I get a limit error as well.
So I started reading the documentation on home/limit switches and went on with editing the parameters HOME, HOME_OFFSET and the sign of HOME_LATCH_VEL. An old forum entry suggested, that HOME and HOME_OFFSET can't be the same value if the same switch is used for homing and limiting, but it didn't really matter what I changed... the error still comes up.
Out of desperation I even added a debounce function to the inputs, just in case... of course that didn't help either.
For the sake of simplicity here is the .ini and .hal code of my Z-axis configuration:
ini
[AXIS_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 7.0
MAX_ACCELERATION = 250.0
STEPGEN_MAXACCEL = 312.5
SCALE = 960.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = -100.0
MAX_LIMIT = 5.000
HOME_OFFSET = 3.000000
HOME_SEARCH_VEL = 1.500000
HOME_LATCH_VEL = -0.520833
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 0
hal
# add debounce component
loadrt debounce cfg=3
# set delay (number of iterations of base thread)
setp debounce.0.delay 2000
# add debounce to base-thread
addf debounce.0 base-thread
# put debounce between parport input pins and min/max home signals
net min-z <= parport.1.pin-06-in
net debounce-max-home-z debounce.0.2.in <= parport.1.pin-07-in
# assign net to axis
net min-z => axis.2.neg-lim-sw-in
net debounce-max-home-z => axis.2.home-sw-in
net debounce-max-home-z => axis.2.pos-lim-sw-in
Any ideas?
- one desperate user...
Last edit: 26 Mar 2015 16:23 by Vinci.
Please Log in or Create an account to join the conversation.
26 Mar 2015 20:07 - 26 Mar 2015 20:12 #57207
by PCW
Replied by PCW on topic Problem with home/limit configuration
Wrong limit switch polarity?
If you are using Axis, check with ( menu items )
Machine
Show Hal Configuration
Watch
Pins
axis
2
home-sw-in
(yellow means true= at limit, dark red means false)
If you are using Axis, check with ( menu items )
Machine
Show Hal Configuration
Watch
Pins
axis
2
home-sw-in
(yellow means true= at limit, dark red means false)
Last edit: 26 Mar 2015 20:12 by PCW.
Please Log in or Create an account to join the conversation.
26 Mar 2015 20:26 #57209
by Vinci
Replied by Vinci on topic Problem with home/limit configuration
Sadly I can't check that till tomorrow evening, but wouldn't a wrong polarity trigger the home/limit switch all the time?
With the current configuration I can move around freely, the switches only trigger when they actually should.
With the current configuration I can move around freely, the switches only trigger when they actually should.
Please Log in or Create an account to join the conversation.
26 Mar 2015 20:39 #57211
by andypugh
And who chose that colour encoding? I find it confusing even now.
Replied by andypugh on topic Problem with home/limit configuration
(yellow means true= at limit, dark red means false)
And who chose that colour encoding? I find it confusing even now.
Please Log in or Create an account to join the conversation.
26 Mar 2015 20:51 #57213
by andypugh
Your system definitely can work. It is possible to have all limits and all homes share a single input pin, or you can wire the switches for three separate inputs per axis if you really want to. Or any combination between those extremes.
It seems to me like the system is not moving the axis back off of the switch after the latch move, but that seems rather strange. You could try setting HOME to -20 just to check that you are getting the final rapid to home after the latch move.
Not related to the problem you have, but you would normally have the axis max-limit _inside_ the limit switch. Your config has the switch / hard limit at +3 and the soft-limit at +5.
I imagine you have already found this page, but here is the link for reference:
www.linuxcnc.org/docs/html/config/ini_homing.html
Replied by andypugh on topic Problem with home/limit configuration
I'm new to linux CNC and currently trying to get the home/limit configuration of my switches right. My setup consists of 2x inductive switches per axis one of which I'd like to use for homing (preferably the lower ones for the X and Y axis and the higher one for the Z axis). At first I was under the impression that the configuration worked right out of the wizard, but every time I try to home an axis I get a limit error as well.
Your system definitely can work. It is possible to have all limits and all homes share a single input pin, or you can wire the switches for three separate inputs per axis if you really want to. Or any combination between those extremes.
It seems to me like the system is not moving the axis back off of the switch after the latch move, but that seems rather strange. You could try setting HOME to -20 just to check that you are getting the final rapid to home after the latch move.
Not related to the problem you have, but you would normally have the axis max-limit _inside_ the limit switch. Your config has the switch / hard limit at +3 and the soft-limit at +5.
I imagine you have already found this page, but here is the link for reference:
www.linuxcnc.org/docs/html/config/ini_homing.html
Please Log in or Create an account to join the conversation.
26 Mar 2015 21:21 #57215
by Vinci
Replied by Vinci on topic Problem with home/limit configuration
Alright, I'll try that tomorrow.
On another though can it be that bouncing still causes me trouble?
I guess the inductive switches not just bounce like mechanical contacts do but rather fluctuate around their tripping point. It seems to me that those cheap china things don't have any kind of hysteresis in their switching characteristics.
Occasionally the LED which indicates the switch state toggles although the switch already got triggered.
Since I can see those state toggles they must be far beyond the reach of classical debounce timings... probably even in the 0.5 to a couple of seconds-ish? This still might cause trouble when homing since backing away from the triggered switch takes a lot of time with all the decelerating and accelerating in the other direction.
So I'd probably need some kind of delay instead of a debounce when the machine tries to back off from the switch?
On another though can it be that bouncing still causes me trouble?
I guess the inductive switches not just bounce like mechanical contacts do but rather fluctuate around their tripping point. It seems to me that those cheap china things don't have any kind of hysteresis in their switching characteristics.
Occasionally the LED which indicates the switch state toggles although the switch already got triggered.
Since I can see those state toggles they must be far beyond the reach of classical debounce timings... probably even in the 0.5 to a couple of seconds-ish? This still might cause trouble when homing since backing away from the triggered switch takes a lot of time with all the decelerating and accelerating in the other direction.
So I'd probably need some kind of delay instead of a debounce when the machine tries to back off from the switch?
Please Log in or Create an account to join the conversation.
Time to create page: 0.198 seconds