Using proximity sensors for automatic Homing

More
14 Mar 2013 19:19 #31400 by susam
Hi,

I am quite new to LinuxCNC. I couldn't find any other topic that answers the following:

Every time I launch a new config for a CNC mill, I have to home the axes again and again. A way around this will be kind of an automatic homing. I intend to integrate two proximity sensors at the home positions of X and Y axis.

Using these proximity sensors, can I achieve automatic homing? Can these proximity sensors act as both homing sensors and limit switches? If yes, please advice me on how to go about and achieve this.

Thanks

Regards

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

More
14 Mar 2013 20:03 #31404 by cncbasher
Yes they can be used for both homing and limits , although it is usual to use switches for limits and proximity for homing
as the homing point is usualy inside of the limit .

however linuxcnc has provision to use limit switches also as homing

linuxcnc.org/docs/html/config/ini_homing.html

to use the switch for both limit and home , use net both-home-x etc for the appropriate switch

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

More
15 Mar 2013 15:04 - 15 Mar 2013 15:08 #31444 by Rick G
Sorry, duplicate post!
Last edit: 15 Mar 2013 15:08 by Rick G.

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

More
16 Mar 2013 16:22 #31491 by susam
Thank You.
After declaring the pins in custom _postgui.hal, don't we have to code it anywhere else to achieve automatic homing?
Further, if there is another post discussing the same, can you please post the link?

Regards

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

More
16 Mar 2013 19:14 #31498 by alan_3301
I dont think there it is fully automatic, you still have to click home all axes.
Also, I dont think you need to put anything in custom_postgui.hal for homing.

assuming your machine is called "main"
homing parameters are in main.ini
and the pins are connected in main.hal

here is an example from my main.hal (only one axis for simplicity)
as said earlier, replace home-x with both-home-x if you are using home and limit switch on same pin
also the "not" on the end inverts the signal
net home-x <= parport.0.pin-15-in-not
net home-x => axis.0.home-sw-in

and from my main.ini
[AXIS_0]
HOME = 0.0
MIN_LIMIT = -0.01
MAX_LIMIT = 50.0
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = -2.800000
HOME_LATCH_VEL = -0.392699
HOME_SEQUENCE = 0

Basically on my X axis, I will usually be somewhere in the middle when I click home.
The negative search_vel makes it move in the X- direction until it finds the switch.
The negative latch_vel means it moves forward off the switch, then slowly moves back until it finds it again.
I put all my limit switches at 0, so that if I click home, when already in homed position, it doesnt wreck my machine.

I don't use limit switches, just homing and then axis sets the soft limits, which always work, except for a expermental setup I was using.
stepconf was a big help getting this set up for me, have you tried it?
Also, experimenting is the best way to learn how each change you make affects how the machine acts.
The following user(s) said Thank You: susam

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

More
17 Mar 2013 09:02 #31509 by andypugh

as said earlier, replace home-x with both-home-x if you are using home and limit switch on same pin


both-home-x is a signal name in your config. It has no special meaning to LinuxCNC.

Stepgen creates the signal name if you tell it that homes and limits are shared switches. However, if you haven't told stepgen that, then it won't exist unless you create it in the HAL file. Choosing it in Stepconf will have the desired effect. Editing the HAL file will just change the name of the signal, without changing its function.

The first term after a "net" command in HAL is a signal name. It can be anything at all, and none of them mean anything to LinuxCNC.
An easy bug to write is to miss-spell a signal name, which creates a new signal, unlinked to the one you meant to type.

If you want a shared home/limit switch then hal needs something like
net freely-chosen-signal-name parport.0.pin-15-in
…
net freely-chosen-signal-name axis.0.axis.N.neg-lim-sw-in
net freely-chosen-signal-name axis.0.axis.N.pos-lim-sw-in
net freely-chosen-signal-name axis.0.home-sw-in

if you prefer, you can put the pins on the same line, or lines split as you choose. You can also add => and <= symbols to indicate data flow to yourself, but they are ignored by LinuxCNC.
net freely-chosen-signal-name parport.0.pin-15-in  => axis.0.axis.N.neg-lim-sw-in axis.0.axis.N.pos-lim-sw-in axis.0.home-sw-in
Is valid too.

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

More
17 Mar 2013 17:58 #31510 by BigJohnT

The first term after a "net" command in HAL is a signal name. It can be anything at all, and none of them mean anything to LinuxCNC.


IIRC if you use a dot in the signal name the Show Hal Configuration sorts them kinda funny...

John

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

More
18 Mar 2013 20:09 #31542 by susam
Thanks Guys!

It worked great. I have another query about homing. Suppose we connect home X, Y, Z to pins 10,11,15. Now each one is a different pin. With this configuration is it possible to create just 1 pyvcp button (say 'HOME AXES') that triggers each pin at the same time. Thus, one home button does it all. Can this be achieved w/o having to connect all sensors to the same pin?

Regards

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

More
18 Mar 2013 20:31 #31546 by andypugh

It worked great. I have another query about homing. Suppose we connect home X, Y, Z to pins 10,11,15. Now each one is a different pin. With this configuration is it possible to create just 1 pyvcp button (say 'HOME AXES') that triggers each pin at the same time. Thus, one home button does it all. Can this be achieved w/o having to connect all sensors to the same pin?


Yes, In fact it is possible to do this with shared pins _or_ with a pin per axis.

All you need is to add a HOME_SEQUENCE entry to the INI file for each axis, and you will find that the GUI button changes to say "home all"
www.linuxcnc.org/docs/html/config/ini_ho....html#_home_sequence

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

Time to create page: 0.165 seconds
Powered by Kunena Forum