Sharing Limit Switches and Homing on a Single Input
- jay.perez1
- Offline
- Senior Member
Less
More
- Posts: 47
- Thank you received: 3
13 Apr 2020 04:44 #163844
by jay.perez1
Replied by jay.perez1 on topic Sharing Limit Switches and Homing on a Single Input
Hi Clive,
I've copied the .INI below.
It was created with the StepConf utility but manually edited since then.
Thanks for offering to look at it.
Jay
# Generated by stepconf 1.1 at Sat Apr 11 19:42:04 2020
# If you make changes to this file, they will be
# overwritten when you run stepconf again
[EMC]
MACHINE = 6040
DEBUG = 0
[DISPLAY]
DISPLAY = axis
EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
ARCDIVISION = 64
GRIDS = 10mm 20mm 50mm 100mm 1in 2in 5in 10in
MAX_FEED_OVERRIDE = 1.5
MIN_SPINDLE_OVERRIDE = 0.5
MAX_SPINDLE_OVERRIDE = 1.2
DEFAULT_LINEAR_VELOCITY = 0.10
MIN_LINEAR_VELOCITY = 0
MAX_LINEAR_VELOCITY = 1.00
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/dad/linuxcnc/nc_files
INCREMENTS = .1in .05in .01in .005in .001in .0005in .0001in
PYVCP = custompanel.xml
[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python
[TASK]
TASK = milltask
CYCLE_TIME = 0.010
[RS274NGC]
PARAMETER_FILE = linuxcnc.var
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
BASE_PERIOD = 100000
SERVO_PERIOD = 1000000
[HAL]
HALUI = halui
HALFILE = 6040.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal
[HALUI]
# add halui MDI commands here (max 64)
[TRAJ]
AXES = 3
COORDINATES = X Y Z
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 0.10
MAX_VELOCITY = 1.00
[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl
[AXIS_0]
TYPE = LINEAR
HOME = .1
MAX_VELOCITY = 1.0
MAX_ACCELERATION = 30.0
STEPGEN_MAXACCEL = 37.5
SCALE = 2033.4
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = 0.0
MAX_LIMIT = 12.0
HOME_OFFSET = 0.050000
HOME_SEARCH_VEL = -0.300000
HOME_LATCH_VEL = -0.010000
HOME_FINAL_VEL = .5
HOME_SEQUENCE = 1
[AXIS_1]
TYPE = LINEAR
HOME = .1
MAX_VELOCITY = 1.0
MAX_ACCELERATION = 30.0
STEPGEN_MAXACCEL = 37.5
SCALE = 2033.4
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = 0.0
MAX_LIMIT = 20.0
HOME_OFFSET = 0.050000
HOME_SEARCH_VEL = -0.300000
HOME_LATCH_VEL = -0.010000
HOME_FINAL_VEL = .5
HOME_SEQUENCE = 2
[AXIS_2]
TYPE = LINEAR
HOME = -.1
MAX_VELOCITY = 1.0
MAX_ACCELERATION = 30.0
STEPGEN_MAXACCEL = 37.5
SCALE = 2540.0
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = -4.000000
MAX_LIMIT = -0.000000
HOME_OFFSET = -0.050000
HOME_SEARCH_VEL = 0.300000
HOME_LATCH_VEL = 0.010000
HOME_FINAL_VEL = .5
HOME_SEQUENCE = 0
I've copied the .INI below.
It was created with the StepConf utility but manually edited since then.
Thanks for offering to look at it.
Jay
# Generated by stepconf 1.1 at Sat Apr 11 19:42:04 2020
# If you make changes to this file, they will be
# overwritten when you run stepconf again
[EMC]
MACHINE = 6040
DEBUG = 0
[DISPLAY]
DISPLAY = axis
EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
ARCDIVISION = 64
GRIDS = 10mm 20mm 50mm 100mm 1in 2in 5in 10in
MAX_FEED_OVERRIDE = 1.5
MIN_SPINDLE_OVERRIDE = 0.5
MAX_SPINDLE_OVERRIDE = 1.2
DEFAULT_LINEAR_VELOCITY = 0.10
MIN_LINEAR_VELOCITY = 0
MAX_LINEAR_VELOCITY = 1.00
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/dad/linuxcnc/nc_files
INCREMENTS = .1in .05in .01in .005in .001in .0005in .0001in
PYVCP = custompanel.xml
[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python
[TASK]
TASK = milltask
CYCLE_TIME = 0.010
[RS274NGC]
PARAMETER_FILE = linuxcnc.var
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
BASE_PERIOD = 100000
SERVO_PERIOD = 1000000
[HAL]
HALUI = halui
HALFILE = 6040.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal
[HALUI]
# add halui MDI commands here (max 64)
[TRAJ]
AXES = 3
COORDINATES = X Y Z
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 0.10
MAX_VELOCITY = 1.00
[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl
[AXIS_0]
TYPE = LINEAR
HOME = .1
MAX_VELOCITY = 1.0
MAX_ACCELERATION = 30.0
STEPGEN_MAXACCEL = 37.5
SCALE = 2033.4
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = 0.0
MAX_LIMIT = 12.0
HOME_OFFSET = 0.050000
HOME_SEARCH_VEL = -0.300000
HOME_LATCH_VEL = -0.010000
HOME_FINAL_VEL = .5
HOME_SEQUENCE = 1
[AXIS_1]
TYPE = LINEAR
HOME = .1
MAX_VELOCITY = 1.0
MAX_ACCELERATION = 30.0
STEPGEN_MAXACCEL = 37.5
SCALE = 2033.4
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = 0.0
MAX_LIMIT = 20.0
HOME_OFFSET = 0.050000
HOME_SEARCH_VEL = -0.300000
HOME_LATCH_VEL = -0.010000
HOME_FINAL_VEL = .5
HOME_SEQUENCE = 2
[AXIS_2]
TYPE = LINEAR
HOME = -.1
MAX_VELOCITY = 1.0
MAX_ACCELERATION = 30.0
STEPGEN_MAXACCEL = 37.5
SCALE = 2540.0
FERROR = 0.05
MIN_FERROR = 0.01
MIN_LIMIT = -4.000000
MAX_LIMIT = -0.000000
HOME_OFFSET = -0.050000
HOME_SEARCH_VEL = 0.300000
HOME_LATCH_VEL = 0.010000
HOME_FINAL_VEL = .5
HOME_SEQUENCE = 0
Please Log in or Create an account to join the conversation.
13 Apr 2020 08:03 - 13 Apr 2020 08:13 #163850
by Clive S
Replied by Clive S on topic Sharing Limit Switches and Homing on a Single Input
Ok .Have you seen this:- linuxcnc.org/docs/devel/html/config/ini-homing.html
Before you start editing save a copy of the ini file under a different name. Also if you use stepconf again you will loose any changes.
What is the actual problem ?
Before you start editing save a copy of the ini file under a different name. Also if you use stepconf again you will loose any changes.
What is the actual problem ?
Last edit: 13 Apr 2020 08:13 by Clive S.
Please Log in or Create an account to join the conversation.
13 Apr 2020 08:55 - 13 Apr 2020 08:57 #163855
by bbsr_5a
Replied by bbsr_5a on topic Sharing Limit Switches and Homing on a Single Input
all you need to know is
All axis need to move away from the switch
HOME = is the position the Machine ends up/drives thru after trigger the switch
HOME_OFFSET is the actually G53 Position of the Switch on Axis
so this cand be the same at any axis
HOME = 165.0
HOME_OFFSET = 176.000000
dont forget to gt s slight overtravel to the limits
MIN_LIMIT = -1.0
MAX_LIMIT = 177.0
All axis need to move away from the switch
HOME = is the position the Machine ends up/drives thru after trigger the switch
HOME_OFFSET is the actually G53 Position of the Switch on Axis
so this cand be the same at any axis
HOME = 165.0
HOME_OFFSET = 176.000000
dont forget to gt s slight overtravel to the limits
MIN_LIMIT = -1.0
MAX_LIMIT = 177.0
[AXIS_0]
TYPE = LINEAR
HOME = 165.0]
MAX_VELOCITY = 20.0
MAX_ACCELERATION = 200.0
STEPGEN_MAXACCEL = 400.0
SCALE = 100.0
FERROR = 1
MIN_FERROR = .25
BACKLASH = 0.02
[color=gray]MIN_LIMIT = -1.0
MAX_LIMIT = 177.0[/color]
HOME_OFFSET = 176.000000
HOME_SEARCH_VEL = 3.000000
HOME_LATCH_VEL = 2.000000
HOME_FINAL_VEL = 5
HOME_SEQUENCE = 1
[AXIS_1]
TYPE = LINEAR
HOME = 165.0
MAX_VELOCITY = 20.0
MAX_ACCELERATION = 200.0
STEPGEN_MAXACCEL = 400.0
SCALE = 100.0
FERROR = 1
MIN_FERROR = .25
BACKLASH = 0.01
MIN_LIMIT = -1.0
MAX_LIMIT = 172.0
HOME_OFFSET = 176.000000
HOME_SEARCH_VEL = 3.000000
HOME_LATCH_VEL = 2.000000
HOME_FINAL_VEL = 5
HOME_SEQUENCE = 2
[AXIS_2]
TYPE = LINEAR
HOME = -5.0
MAX_VELOCITY = 20.0
MAX_ACCELERATION = 200.0
STEPGEN_MAXACCEL = 400.0
SCALE = 100.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = -69.0
MAX_LIMIT = 0.5
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 3.000000
HOME_LATCH_VEL = 2.000000
HOME_FINAL_VEL = 4
HOME_SEQUENCE = 0
Last edit: 13 Apr 2020 08:57 by bbsr_5a. Reason: messed up
Please Log in or Create an account to join the conversation.
- jay.perez1
- Offline
- Senior Member
Less
More
- Posts: 47
- Thank you received: 3
14 Apr 2020 06:43 #163924
by jay.perez1
Replied by jay.perez1 on topic Sharing Limit Switches and Homing on a Single Input
Hi All,
I had a pretty long reply typed up until our new kitten stepped on the keyboard ...
Instead I've attached both a PDF and a zipped PowerPoint file of a section of the Homing manual that I marked up extensively to help me better understand everything, and, to present a number of questions I have for the group. Either there's some missing or possibly incorrect information in this section or I just don't get it.
Would you kindly look it over and see if there's any hope for me ?
Thanks.
Jay
I had a pretty long reply typed up until our new kitten stepped on the keyboard ...
Instead I've attached both a PDF and a zipped PowerPoint file of a section of the Homing manual that I marked up extensively to help me better understand everything, and, to present a number of questions I have for the group. Either there's some missing or possibly incorrect information in this section or I just don't get it.
Would you kindly look it over and see if there's any hope for me ?
Thanks.
Jay
Please Log in or Create an account to join the conversation.
- jay.perez1
- Offline
- Senior Member
Less
More
- Posts: 47
- Thank you received: 3
14 Apr 2020 07:25 #163927
by jay.perez1
Replied by jay.perez1 on topic Sharing Limit Switches and Homing on a Single Input
Thanks Clive,
The original issue I was seeking help with is how to use a single input pin on my breakout board for all the Home/Limit switches, and specifically, I was hoping for info on how to do it using the just StepConf utility. I never did get a clear answer on whether it was possible to do all of it with the StepConf tool so I eventually dove into the .INI file and got things to work, mostly.
So now the problem has become understanding some of the variables and settings I used.
Although I have gotten the single input pin and shared homing/limit switches and soft limits to work I can tell you that I definitely do not understand how to correctly input the numbers which I really want to be able to do.
I've gotten and studied the link you sent and ones that others have shared and they have helped some but haven't really jelled in my head and I still don't understand how some of the parameters work. For example; I studied HOME_OFFSET and thought I understood what it means but just received a new response from bbsr_5a that I think describes it differently than what I came up with. Definitely don't mind reading and studying as I like to understand things but to spend hours and still not understand is exhausting and frustrating.
I just updated my posting with a copy of a section of the manual that I marked up and would appreciate your thoughts and comments if you have time.
Jay
The original issue I was seeking help with is how to use a single input pin on my breakout board for all the Home/Limit switches, and specifically, I was hoping for info on how to do it using the just StepConf utility. I never did get a clear answer on whether it was possible to do all of it with the StepConf tool so I eventually dove into the .INI file and got things to work, mostly.
So now the problem has become understanding some of the variables and settings I used.
Although I have gotten the single input pin and shared homing/limit switches and soft limits to work I can tell you that I definitely do not understand how to correctly input the numbers which I really want to be able to do.
I've gotten and studied the link you sent and ones that others have shared and they have helped some but haven't really jelled in my head and I still don't understand how some of the parameters work. For example; I studied HOME_OFFSET and thought I understood what it means but just received a new response from bbsr_5a that I think describes it differently than what I came up with. Definitely don't mind reading and studying as I like to understand things but to spend hours and still not understand is exhausting and frustrating.
I just updated my posting with a copy of a section of the manual that I marked up and would appreciate your thoughts and comments if you have time.
Jay
Please Log in or Create an account to join the conversation.
- jay.perez1
- Offline
- Senior Member
Less
More
- Posts: 47
- Thank you received: 3
14 Apr 2020 07:43 #163928
by jay.perez1
Replied by jay.perez1 on topic Sharing Limit Switches and Homing on a Single Input
Hi bbsr_5a,
I appreciate you taking the time to read my post and respond. Your explanations were helpful but I'm having a little trouble visualizing how your machine and homing switches are laid out based on the large negative numbers in your .INI file.
Our machines all have the shared Homing/Limit switches in the front-left corner of the machine. When Homing, the Z axis moves up in the positive direction and then the X & Y axes move onto the switches in the negative direction. They all back off of the switches by about .100" and this location becomes our G53 machine reference position. The machine remains at this position (I guess this would be the HOME location in LCNC) and the homing sequence is complete. (Currently this is done using Mach3 and Mach4 which I'm evaluating LinuxCNC to replace.)
I updated my post with a marked up image showing some of my points of confusion and would appreciate your feedback if you get a chance to look at it.
Jay
I appreciate you taking the time to read my post and respond. Your explanations were helpful but I'm having a little trouble visualizing how your machine and homing switches are laid out based on the large negative numbers in your .INI file.
Our machines all have the shared Homing/Limit switches in the front-left corner of the machine. When Homing, the Z axis moves up in the positive direction and then the X & Y axes move onto the switches in the negative direction. They all back off of the switches by about .100" and this location becomes our G53 machine reference position. The machine remains at this position (I guess this would be the HOME location in LCNC) and the homing sequence is complete. (Currently this is done using Mach3 and Mach4 which I'm evaluating LinuxCNC to replace.)
I updated my post with a marked up image showing some of my points of confusion and would appreciate your feedback if you get a chance to look at it.
Jay
Please Log in or Create an account to join the conversation.
14 Apr 2020 09:23 #163930
by rodw
Replied by rodw on topic Sharing Limit Switches and Homing on a Single Input
There are a couple of issues here that work together to confuse you. Please bear in mind I have never set up a machine with a single pin for home and limits. Where possible I set them up with separate max, min and home switches on each joint. Sometimes, I have used a shared home/limit switch where space is limited. (Eg. Z axis)
But be warned, if you read on, you will have to leave Stepconf behind. I actually wrote my hal and ini files by hand back when I set my foist machine up ad I knew lot less than you becasue I had never even used a CNC machine!
And also, read this linuxcnc.org/docs/2.8/html/config/ini-config.html
Starting at the beginning (my version anyway) Lets talk about limit switches. They should never be hit and need to be outside of the soft limits (which in turn need to be set before you hit hard limits (eg endstops) so they are inside hard limits. I hope you are still following.
So limit switches should never ever be hit. If they are then we throw out the boat anchor and stop motion ASAP because something is very very wrong. In my case Linuxcnc will tell me exactly which limit switch has been triggered but in your case, it won't be able to do that But it does not really matter. If the limit is triggered motion is stopped. Thats all we need.
From this point, I am going to be talking about homing in V 2.8 and 2.9 as it changed with the release of 2.8. I personally would recommend you use V 2.8 as a minimum becasue 2.7 is so old, its not worth persevering with. I have only ever used master branch back when that was V 2.8.
So lets add homing to the mix. If you home with a single input pin, when you hit the home switch, all the other limit switches will be triggered when you hit the home switch and the anchors get thrown out.
So the solution to this is to set HOME_IGNORE_LIMITS = YES for each joint. I think you will also need HOME_IS_SHARED = 1.
That way when homing, limit switches that are triggered will be ignored. So then your machine will home happily but when homing is completed, your triggered home switch suddenly becomes a limit switch so the boat anchors get thrown out immediately (becasue the limit switch is left in a triggered state).
So the solution then is to add a HOME_OFFSET to move the Axis off the limit switch after its homed. Then everything is happy again!
Now I am out of time as its tea time here an our beautiful wood fired pizza is only 5 minutes from being cooked. I have another idea which I would experiment with in your situation and that is to add some lines to my hal file that used and2 to and your pin with the joint.n.homing (where n = 0,1,2 in your situation) and use that output to create a home switch pin for each axis. (eg. a home switch for joint 0 will only be triggered when joint 0 is homing.
If I get time, I will describe how to do that but someone might come along and tell you my idea is not necessary.
But be warned, if you read on, you will have to leave Stepconf behind. I actually wrote my hal and ini files by hand back when I set my foist machine up ad I knew lot less than you becasue I had never even used a CNC machine!
And also, read this linuxcnc.org/docs/2.8/html/config/ini-config.html
Starting at the beginning (my version anyway) Lets talk about limit switches. They should never be hit and need to be outside of the soft limits (which in turn need to be set before you hit hard limits (eg endstops) so they are inside hard limits. I hope you are still following.
So limit switches should never ever be hit. If they are then we throw out the boat anchor and stop motion ASAP because something is very very wrong. In my case Linuxcnc will tell me exactly which limit switch has been triggered but in your case, it won't be able to do that But it does not really matter. If the limit is triggered motion is stopped. Thats all we need.
From this point, I am going to be talking about homing in V 2.8 and 2.9 as it changed with the release of 2.8. I personally would recommend you use V 2.8 as a minimum becasue 2.7 is so old, its not worth persevering with. I have only ever used master branch back when that was V 2.8.
So lets add homing to the mix. If you home with a single input pin, when you hit the home switch, all the other limit switches will be triggered when you hit the home switch and the anchors get thrown out.
So the solution to this is to set HOME_IGNORE_LIMITS = YES for each joint. I think you will also need HOME_IS_SHARED = 1.
That way when homing, limit switches that are triggered will be ignored. So then your machine will home happily but when homing is completed, your triggered home switch suddenly becomes a limit switch so the boat anchors get thrown out immediately (becasue the limit switch is left in a triggered state).
So the solution then is to add a HOME_OFFSET to move the Axis off the limit switch after its homed. Then everything is happy again!
Now I am out of time as its tea time here an our beautiful wood fired pizza is only 5 minutes from being cooked. I have another idea which I would experiment with in your situation and that is to add some lines to my hal file that used and2 to and your pin with the joint.n.homing (where n = 0,1,2 in your situation) and use that output to create a home switch pin for each axis. (eg. a home switch for joint 0 will only be triggered when joint 0 is homing.
If I get time, I will describe how to do that but someone might come along and tell you my idea is not necessary.
The following user(s) said Thank You: jay.perez1
Please Log in or Create an account to join the conversation.
14 Apr 2020 11:45 #163936
by bbsr_5a
Replied by bbsr_5a on topic Sharing Limit Switches and Homing on a Single Input
ok my machine gots also the left front and z up
but the switches are on the other side XY so it homes not where the part is placed
so on yours it is as simple as
X
HOME = 5.0
HOME_OFFSET = 0.0
MIN_LIMIT = -1.0
MAX_LIMIT = your max
HOME_SEARCH_VEL = -5.0
HOME_LATCH_VEL = -2.0
HOME_FINAL_VEL = 5
HOME_SEQUENCE = 1
Y
HOME = 5.0
HOME_OFFSET = 0.0
MIN_LIMIT = -1.0
MAX_LIMIT = your max
HOME_SEARCH_VEL = -5.0
HOME_LATCH_VEL = -2.0
HOME_FINAL_VEL = 5
HOME_SEQUENCE = 2
Z
HOME = -5.0
HOME_OFFSET = 0.0
MIN_LIMIT = your Zmin
MAX_LIMIT = 1
HOME_SEARCH_VEL = 5.0
HOME_LATCH_VEL = 2.0
HOME_FINAL_VEL = 5
HOME_SEQUENCE = 0
but the switches are on the other side XY so it homes not where the part is placed
so on yours it is as simple as
X
HOME = 5.0
HOME_OFFSET = 0.0
MIN_LIMIT = -1.0
MAX_LIMIT = your max
HOME_SEARCH_VEL = -5.0
HOME_LATCH_VEL = -2.0
HOME_FINAL_VEL = 5
HOME_SEQUENCE = 1
Y
HOME = 5.0
HOME_OFFSET = 0.0
MIN_LIMIT = -1.0
MAX_LIMIT = your max
HOME_SEARCH_VEL = -5.0
HOME_LATCH_VEL = -2.0
HOME_FINAL_VEL = 5
HOME_SEQUENCE = 2
Z
HOME = -5.0
HOME_OFFSET = 0.0
MIN_LIMIT = your Zmin
MAX_LIMIT = 1
HOME_SEARCH_VEL = 5.0
HOME_LATCH_VEL = 2.0
HOME_FINAL_VEL = 5
HOME_SEQUENCE = 0
The following user(s) said Thank You: jay.perez1
Please Log in or Create an account to join the conversation.
14 Apr 2020 13:09 #163946
by rodw
Replied by rodw on topic Sharing Limit Switches and Homing on a Single Input
So what I think you are saying is your x & Y switches are at the maximum end. If thats the case home-offset might need to be negative to bring the home position back to 0.
BUt maybe its not really a problem if you use G54 offsets. I found they are part of setting up your machine.
BUt maybe its not really a problem if you use G54 offsets. I found they are part of setting up your machine.
Please Log in or Create an account to join the conversation.
14 Apr 2020 13:20 #163948
by rodw
Replied by rodw on topic Sharing Limit Switches and Homing on a Single Input
Actually, all you need to do is touch off each axis in the GUI and enter the maximum travel. Thats actually what I do with my Z axis. touch off at the top (which becomes 0.0 and the lower limit of travel becomes -86mm after homing ) So I touched off at 86mm 12 months ago and have never touched my Z axis since.
Please Log in or Create an account to join the conversation.
Time to create page: 0.088 seconds