Simple(?) limit switch problem!!

More
20 Feb 2021 14:34 - 20 Feb 2021 14:36 #199529 by Muzzer
On my embryonic lathe setup I have a shared Home and X +ve limit switch on one end of my cross slide and a separate limit switch on the -ve end of my cross slide.

I can get it to home OK - but only if I disable the X +ve limit line in my HAL. Otherwise I get a "joint 0 on limit switch error".

I have this:

# external input signals

# --- MAX-HOME-X ---
net max-home-x <= hm2_5i25.0.7i76.0.0.input-00-not

# --- MIN-X ---
net min-x <= hm2_5i25.0.7i76.0.0.input-01-not

# --- MAX-HOME-Z ---
net max-home-z <= hm2_5i25.0.7i76.0.0.input-02-not

# --- MIN-Z ---
net min-z <= hm2_5i25.0.7i76.0.0.input-03-not

..........

# ---setup home / limit switch signals---

net max-home-x => joint.0.home-sw-in
net min-x => joint.0.neg-lim-sw-in
# net max-home-x => joint.0.pos-lim-sw-in


I have HOME_IGNORE_LIMITS = YES set in the .INI file

This seems remarkably simple but equally I'm struggling to figure out how to solve it. Can somebody point out where I am going wrong and help save my sanity please?!! Many thanks.

File Attachment:

File Name: Bantam_v1.hal
File Size:9 KB

File Attachment:

File Name: probe_basi...2-20.ini
File Size:6 KB
Attachments:
Last edit: 20 Feb 2021 14:36 by Muzzer. Reason: Added INI file

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

More
20 Feb 2021 14:57 - 20 Feb 2021 14:58 #199531 by chris@cnc
maybe you have a double turn. how do you connect the limit switch? normally open or close
Last edit: 20 Feb 2021 14:58 by chris@cnc.

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

More
20 Feb 2021 15:10 #199536 by Muzzer
They are both normally closed, opening when they hit the limit.

I'm not sure what you mean by double turn.

Everything seems to operate as expected, apart from the error. It seems that once the homing operation is complete, the limit switch check is re-enabled and found to be in an unapproved state. I seem to have shown that by disabling the limit signal to prevent the error but what's confusing me is that this is how PNCConf sets up the shared home/limit configuration.

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

More
20 Feb 2021 16:19 - 20 Feb 2021 16:24 #199538 by Aciera
I know, this may seem unrelated to your homing throwing the limit_switch violation but just to be sure that the basic setup of the axis is correct.

I notice this:
# MIN_LIMIT = -0.01
# MAX_LIMIT = 200.0
MIN_LIMIT = -20
MAX_LIMIT = 100.0
MAX_VELOCITY = 100.0
MAX_ACCELERATION = 6000.0

Have you tuned the motors properly? Is the distance traveled identical to the distance commanded?
Are you sure your axis is running correctly when you jog? i.e. DRO counts up when jogging in the positive direction and down when jogging in the negative direction.
Since you tell it to look for the home switch in the positive direction your max_Limit would be something like 0.1 or even less and min_Limit would reflect your axis travel length as a negative number (say -200).
The other thing is that MAX_Acceleration of 6000 seems rather excessive.

[edit]
Another thing:
These timings seem rather short.
DIRSETUP   =                    5000
DIRHOLD    =                    500
STEPLEN    =                    1000
STEPSPACE  =                    5000

The ones for the other axis are much more what I would expect to see:
DIRSETUP   =                    10000
DIRHOLD    =                    10000
STEPLEN    =                    5000
STEPSPACE  =                    5000
Last edit: 20 Feb 2021 16:24 by Aciera.

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

More
20 Feb 2021 16:42 - 20 Feb 2021 17:21 #199540 by Muzzer
Thanks - appreciate the suggestions. I'll give those a try when I get back out there later!

EDIT - that seems to have done the trick. Presumably the limits were being exceeded during the homing move and when the limits check was reinstated, it flagged up an out of bounds error. I was thinking it was the status of the limit signals themselves but the error message was not clear to me.

As you may be able to tell, I'm new to CNC lathe concepts, so the positions of home, +/- limits etc are a bit of a learning experience for me.

Although I have the motors spinning, they are on the bench at the moment. I need to feel that the limit switches are set up sensibly before unleashing the servos and possibly damaging something. It's a bit cart and horse (with a novice rider) but I'm surely approaching that moment now.

Many thanks :)
Last edit: 20 Feb 2021 17:21 by Muzzer.

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

More
21 Feb 2021 13:22 #199606 by Mike_Eitel
Where is your home position after home-movement is finished? It must not be at the limit. Set it a bit away.
Mike
The following user(s) said Thank You: Muzzer

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

More
21 Feb 2021 21:51 #199654 by Muzzer
Thanks - I have an offset for the home position after homing. I've also got it set up for real on the lathe now and it works fine. It took me a while to work out what was happening but it's looking good so far.

Setting up the switches on the machines has always been one of the more time consuming yet critical tasks. However, I now have my servos installed and running on the lathe, so there is a functioning machine in sight now!

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

More
22 Feb 2021 12:16 #199697 by Mike_Eitel
Happy that you got it sorted. ;-)
Mike

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

Time to create page: 0.104 seconds
Powered by Kunena Forum