hall effect home switches

More
18 Oct 2018 21:26 #119020 by Dr. John
My concept of a “home” switch is one that is closed when at, or close to, the home position; and on either side of the home position and at a small distance away from it, the switch is open. The homing sequence on the AXIS simulator seems to reinforce this concept in that it seems to try to find the limits on either side of the home switch and then center over it.

While trying to conceive of an appropriate cam mechanism to effect this, I realized that the easiest and most reliable mechanism for achieving this would be a hall-effect switch and a magnet. This is what I have implemented on my LMS3960 mini-mill X and Y axes.

Now that I’m past the stage of configuring the hardware inputs, I’ve found that the implementation of the logic doesn’t appear to support this configuration. In particular, after reading Chris Morley’s write-up about homing and limit switches (forum.linuxcnc.org/32-documents/12146-an...oming-hope-its-clear), it appears that LinuxCNC, or at least the “firmware” for the Mesa 5i25 board that I’m using, doesn’t think the same way. In particular, it appears that the homing switch is expected to be like a limit switch, except not at the limit, but rather far enough away from center/home so that the axis can be moved in a single direction to find it rather than using a gradually increasing amplitude back and forth motion to find the home switch more or less in the center of the range of motion.

Can somebody please confirm that this is true? Or, if it isn’t, either provide documentation that will enable me to use the home switches that I’ve implemented, or direct me to it?

Unfortunately, the combination of scattershot organization of the information that is available for LinuxCNC and the lack of clarity in the user interfaces of the software make it almost impossible to catch these issues prior to getting there, and make dependence on folks like you extremely important.

Thanks for your help!

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

More
18 Oct 2018 21:49 #119022 by PCW
Replied by PCW on topic hall effect home switches
Have you looked at:

linuxcnc.org/docs/html/config/ini-homing.html ?

AFAIK LinuxCNC always homes in one direction, this direction is selected by ini constants

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

More
18 Oct 2018 22:01 #119024 by curtisa
Replied by curtisa on topic hall effect home switches
Your choice of limit switch shouldn't matter (switch closed = tripped, or switch open = tripped) as the signal can be inverted within LinuxCNC to gain the required logic polarity to indicate that the axis is at limit or home positions.

There are, however good reasons to use limit switches which are closed when not tripped, the primary one being that LinuxCNC will fail safe if the supply to them is accidentally disconnected.

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

More
20 Oct 2018 00:52 #119097 by rodw
Replied by rodw on topic hall effect home switches
I think you should forget about your concept of homing and take the time to read the homing configuration documentation PCW has linked to. Note that if you are using V 2.8 (master), then homing is a bit different so make sure you read the correct documentation. I found this to be an excellent article and is easy to find from the documentation menu.

There is nothing mentioned about back and forth motion and as PCW says, it is one way. Also the homing switch is not designed to be a pulse and must stay active until the axis decelerates to a stop as part of the homing process. In my case, I allow about 100mm for this to happen.

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

More
20 Oct 2018 02:00 #119100 by Dr. John
Replied by Dr. John on topic hall effect home switches
Alas, another logical idea about how things ought to work in the absence of good documentation has bit the dust. Meanwhile, I think that the Chris Morley documentation is the best that has been referred to. It's the clearest that I've found. Too bad it's so far to find.

So, now I'll have to figure out how to make an intrinsically less reliable method of providing a home switch. Or, perhaps just make it a limit switch. It seems like it doesn't matter which.

The thing about LinuxCNC is that, when it works, it works really well. But getting it to work is maddeningly difficult. Oh well.

Thanks to all for your help.

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

More
20 Oct 2018 08:26 #119108 by tommylight

The thing about LinuxCNC is that, when it works, it works really well. But getting it to work is maddeningly difficult. Oh well.


It took me about 10 minutes from when the ubuntu ( emc2 at that time) started to having a working cnc when i first did it a looooooong time ago, albeit i had one of the motors moving in the wrong direction so ended up with the "EMC2" written upside down, and i did not even know that i could reverse the rotation in the config or ini file or hal file, so i powered down and reversed one side of the wiring to the stepper motor. This was without reading anything ever about Linuxcnc ( emc2 ). I refuse to refer to something that easy as "difficult". By the end of that evening i had read a lot about hal and how it functions and got enlightened by the scope of possibilities it has.
Oh and it does work, very well. Extremely well. It works much better than a lot of industrial software solutions i had experience with.
Back on topic.
You can use your implementation of limit switches as is, it will work properly. What i do not understand is where you got the idea that the limit switches should be passed back and forth and stop at the switch ? That does not work, and it does not exist in any machine i have used or worked on. Stopping at the switch will inhibit all motion, so it has to find it, move back and stop as soon as it passes the switch. Linuxcnc has also the option of moving fast to find the switch, backing off and moving again slowly to find it again and back off. That provides for more precise homing and it is very useful for large machines.

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

More
20 Oct 2018 19:56 #119134 by curtisa
Replied by curtisa on topic hall effect home switches

What i do not understand is where you got the idea that the limit switches should be passed back and forth and stop at the switch ?


I think the example the OP is using is where the home position is not at the limit switch position, eg in the centre of an axis' travel rather than at one extremity. In that instance, I guess the question is how does LinuxCNC know which way to move the axis to find the home switch? On a cold startup the mill could be on either side of the home switch, but there is no feedback to indicate if the axis should move positive or negative to get find it again. If LinuxCNC's first homing move is to go in a positive direction and it gets it 'wrong', all it will do is hit the limit switch instead of finding the home switch.

I've only ever used combined limt+home positions at X/Y/Z = 0, so the homing sequence is uncomplicated - home is always [send X axis left until the limit switch is hit] + [send Y axis down until limit switch is hit] + [send z axis up until limit switch is hit].

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

More
20 Oct 2018 20:43 #119139 by tommylight
If that is the case, Linuxcnc does that very easy, you just set the HOME_OFFSET in the ini file to whatever you need it to be. Home switches have to be on one side of the travel, that is not negotiable, Home position can be at any given location inside that travel distance.
Example :
Home switch on the negative side ( usually ), at the start of homing sequence Linuxcnc moves the machine towards the negative end so it does not matter where it is, hits the limit switch and then moves towards the positive side till it gets to the point set in the ini file, it stops and sets the DRO to 0.
Say machine has 2 meters of travel, or 2000 mm, set the home_offset to 1000 and it will move to negative till it hits the limit switch and then move to the 1000mm point, stop and reset the DRO to 0 ( zero ). That will have the home at the exact centre of the machine.

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

More
20 Oct 2018 21:01 #119143 by rodw
Replied by rodw on topic hall effect home switches
You can place your home switch wherever you like, It just needs to remain activated all the way to one limit switch.

Say you placed the limit switch at the centre of travel and the machine was designed so that the limit switch remained activated from that point to the left side limit switch. When the homing sequence is commenced if the home switch is activated (eg axis is to left of centre), LinuxCNC will see that the home switch is triggered and will move to the right until such time the home switch turns off and then homes to the point of switch activation.

Here is an example of how to set up separate home and limit switches using proximity switches taken from my machine



The home switch is triggered on the right edge of the plate.
The limit switch is triggered by the raised section on the left.
The length of the plate is sufficient to allow the axis to coast to a stop and could be half the length of the axis if thats what you want.



And here are the proximity switches.
The centre sensor is the home sensor and the limit switch sensors are the outside ones.
This is the final home position after a home offset has been used to move as close to the limit as possible to maximise axis travel.
So if the axis was homed from this position, Linuxcnc moves the home sensor off the plate before the homing sequence is commenced.

If you use a shared home/limit switch, you must add a home offset to move the axis away from the tripped position (eg, in my case, the sensor in the second photo needs to be moved to the right until its no longer above the plate that activates it). If you do not do this, you get a limit switch error the moment the homing sequence is completed.

So for this machine, the axis travel would be reduced by 40mm - 50mm if a shared home/limit switch was used due to the distance required to coast to a stop. This coasting distance can be reduced by slowing down the homing velocity, but on a 1200mm long axis, homing would take a loooong time if at the opposite end.
Attachments:

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

More
20 Oct 2018 21:42 #119145 by Dr. John
Replied by Dr. John on topic hall effect home switches
Thanks guys for your help. It's clear to me now.

The thing that you might want to keep in mind is that some of us are approaching their CNC project without previous CNC experience, but with experience from other areas. So, when we ask a noobie question like this one, it might be with complete naivete relative to you guys. Hence the question in this forum.

In my case, I'm an electrical engineer with 40+ years of experience. I've designed and implemented a number of electromechanical systems, but never used nor implemented a CNC mill. It's not at all unusual, in my experience, to have a switch that closes at a position +/- a tolerance to represent a "home" position. In that case, one shuttles about either side of the switch closure (i.e., when it opens) to determine home position. So, it was a reasonable question to ask. The homing operation of the Axis simulator made me think that this was possible. Apparently, it is dealing with the hysteresis of the simulated switch.

I did find Chris Morley’s write-up and it was clear enough. Unfortunately, it is the only one that exists with sufficient information, and it took me a long time to find. But, I wanted to verify it before I had to do a re-think about how I'm going to implement the home and/or limit switches since my first attempt (which really was my second) didn't work out.

As to my comment about how difficult it is to get LinuxCNC up and running, alas that's my experience. I know that it is the experience of others too who ask questions on this forum. That comment wasn't meant in disrespect. It is a matter of fact, for me, and at least for some of us who don't use CNC machines and therefore who might have a completely different (say uninformed) view of the world.

The problem is in the documentation. For those of us who are just starting out, it's hard to find what you need, and the information is often presented in a way that is from an insider's view rather than an outsider's view. It's a natural problem. Developers often don't understand the needs of users, especially those who come from a different background.

I've thought of trying to help by generating some noobie friendly documentation (which I'm doing for myself so, if necessary, I can accomplish the same thing again without the same pain). I've yet to complete a document for my small configuration, so contemplating trying to complete one that might be applicable to all of the different configurations that LinuxCNC is capable of supporting is a bit overwhelming at the moment. But, maybe when I'm further along, and if there is interest from you guys...

Thanks again for your help.

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

Time to create page: 0.134 seconds
Powered by Kunena Forum