Stumped about my Hall effect limit switches - Page 1
Forum section: electronics / projects

author: billbyrd1945
author_rank: Regular Contributor
timestamp: April 30, 2020, 06:15:21 pm
content: In an attempt to dump mechanical limit switches, I installed 3 Hall effect sensors as shown below. When a magnet is passed over the individual sensors, its relay indicator lights up and the normally closed relay breaks the circuit to kill the appropriate axis. This works, but...Each limit switch works so that it stops the travel of that particular axis and requires a reset to continue with its travel.If you fail to move that axis after resetting it, the other two axes will run passed their stops even though their individual relays are triggered.This might make it easier to envision what happens:Scenario 1:Y hits a limit and stops. I reset it and move it again to make sure it was reset. Then I test X. It hits a stop, I reset it, test to make sure it travels. Ditto for Z.Scenario 2:Y hits a limit and stops. I reset it but I DON'T jog it to test for a reset. Then I test X. It passes its magnet, lights up its relay, but continues to travel without setting off an alarm, eventually crashes.The breakout board and just about everything else is eBay components marketed as "Longs", Chinese stuff. I've tried for a couple of days to figure it out but I'm stumped. Any ideas? I appreciate any help. Diagram attached.

author: thm_w
author_rank: Super Contributor
timestamp: April 30, 2020, 09:56:52 pm
content: So there is 5V and Ground going to each limit switch, and an individual line coming back from each. Seems good.With a multimeter test switch output signals when multiple are active, you may be able to do this on the PC as well depending on how the board is hooked up. Some hall sensors may not work at 5V, so we want to eliminate the possibility of supply being too low.So whats left is the logic running on the PC or control board, to determine what happens when a limit is hit. Typically these are wired in series, and XYZ are all one limit switch. Is it possible the controller logic is seeing you "override" all limit switches? Therefor ignoring future input?You should never be hitting a limit switch and continuing with it active, you'd generally tap it and move off for homing only.edit: I don't think that relay board is necessary, usual probe will have NPN open collector output, so can go straight to the logic input (which would be pulled up on the board). That said it should not be causing any serious issues.

author: SilverSolder
author_rank: Super Contributor
timestamp: April 30, 2020, 09:58:51 pm
content: Where is the "reset" performed... on that board, or somewhere else?Does the board have any logic / CPU on it?Maybe a picture of it would be good?

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 01, 2020, 01:06:48 pm
content: Throw away the Longs board and use something like GRBL ?GRBL has been ported to a lot of different uC's. The original "arduino" boards are maxed out on CPU capacity (both speed, peripherals and FLASH).I've been using a port to the Blue Pill for some time, and it has plenty of room for some extensions.It also uses hardware USB (CDC, none of that RS232 translator chip rubbish)

author: billbyrd1945
author_rank: Regular Contributor
timestamp: May 01, 2020, 02:40:33 pm
content: I'm listening to each of you and using my pea sized brain to interpret what you ask and suggest. Last night I removed the relay pack and wired it up as shown in the attached pic. It was a total fail. When the Hall effect sensors are triggered (or when they're not) the axes jog as if the sensors weren't even there.

author: mikerj
author_rank: Super Contributor
timestamp: May 01, 2020, 03:21:38 pm
content: Which specific sensors are you using, do you have part number? Sounds like they aren't able to pull the inputs the the "Longs" board low enough for it to recognise a "zero" state.

author: billbyrd1945
author_rank: Regular Contributor
timestamp: May 01, 2020, 06:55:52 pm
content: I would love to learn that you are right. Interesting!WINGONEER 5Pcs Hall Effect KY-003 Magnetic Sensor Module DC 5V for PIC AVR Smart Carshttps://www.amazon.com/WINGONEER-Effect-KY-003-Magnetic-Arduino/dp/B06XHG9CYN/ref=sr_1_1?ie=UTF8&qid=1536156550&sr=8-1&keywords=Hall+Effect+Magnetic+Sensor+Module+DC+5V+For+Arduino&dpID=51S6QaMzwuL&preST=_SX342_QL70_&dpSrc=srch

author: thm_w
author_rank: Super Contributor
timestamp: May 01, 2020, 09:41:27 pm
content: Quote from: billbyrd1945 on May 01, 2020, 02:40:33 pmI had assumed these were typical "3D printer inductive probe" type sensors, but these are slightly different:https://github.com/R2D2-2017/R2D2-2017/wiki/Keyes-44E402-Magnetic-Hall-Switch-SensorHowever, they still behave the same: 5V supply voltage ok, and open collector output, capable of 25mA. This should be more than enough for that board (optocoupler input would typically run at 10-20mA).According to their documentation, the input pins are pulled up then go through an optocoupler diode (see attached image, or image on their website).Can you note the voltage on the input pin when hall is not active? 3.5V sounds about right for not active (5V -> optocoupler LED).Then what is the voltage when it is active? Near 0V is correct.If you have access to a "monitor" program where you can simply monitor the pin status (in Mach3 CNC this is the Diagnostics page), this will help you avoid any software logic issues. Simply trigger the hall sensor, check the input pin on the screen, does it go from de-active to active?I assume JN1 and JN2 jumpers are fitted as noted below.https://www.longs-motor.com/breakout-board.htmlhttps://openbuilds.com/attachments/breakout-board-manual-pdf.10855/

author: billbyrd1945
author_rank: Regular Contributor
timestamp: May 02, 2020, 01:16:48 am
content: Lest anyone thinks I'm not doing everything I can to help myself-- see attached pic where individual relays were used to replace the 8-pack. I thought it was worth a try. No luck of course. I hadn't yet read the post from thm_w. I'll try his suggestions next.

author: billbyrd1945
author_rank: Regular Contributor
timestamp: May 03, 2020, 03:14:44 pm
content: Per advice from various respondents, I removed the relays altogether and wired it as they recommended. Pics with values attached. As the magnets passed the sensors, the lights in the sensors came on and the voltage changed from 3.75v to 0.08v but no alarms were triggered, like the sensors weren't even there. As far as I could tell, there was nothing happening on the diagnostics screen with or without the sensor activated. The saga continues.

author: billbyrd1945
author_rank: Regular Contributor
timestamp: May 03, 2020, 04:34:52 pm
content: Instead of 12v I went ahead and used the 36v from my main power supply. Made the sensor lights much brighter of course. But still no trigger action. So far, the closest I've come to success was the 8 relay block. But it does have that one problem mentioned in my original post. And, of course, the primitive mechanical micro switches that I used for several years worked. But they were so crappy looking. I really would like to get this to work. No moving parts, nice clean look.

author: thm_w
author_rank: Super Contributor
timestamp: May 04, 2020, 08:59:15 pm
content: Really good diagramsSo you are measuring the voltage on the Y connector of the breakout board, with the hall connected to that input, and when it switches it drops to 0.08V. And no signal status change is seen in Mach3 diagnostics screen?Now if you instead take Y input and short it to ground with a wire or switch, the input does change in Mach3? Or still doesn't work.If it still does not change, then we need to diagnose other parts of the system:- opto output- parallel port input to PC- etcSince these were working before, it makes it hard to think they stopped working.Although, I have had to change the parallel port address a few times in mach settings. If no input pins at all are triggering this could be the case.

author: billbyrd1945
author_rank: Regular Contributor
timestamp: May 05, 2020, 12:56:46 am
content: I got so angry today, I just laid down my tools and walked away. I'm 74y/o yet, I feel like a four year old trying to figure out how to put a couple of D batteries in a flashlight. So I'm going to replace all the sensors with mechanical micro switches just to make sure I even know how to set up home and limit switches on the most primitive level. Then I'll come at it again one axis at a time with sensors. I do appreciate all the advice.

author: mikerj
author_rank: Super Contributor
timestamp: May 05, 2020, 07:06:05 am
content: Quote from: billbyrd1945 on May 03, 2020, 03:14:44 pmIn this scenario when you measured 3.75volts, was the output of the hall sensor (i.e. green wire) also connected to one of the limit switch inputs rather than just the volt meter? The Halls sensors have open collector outputs, so they need something to pull them up when not active.If they sensor are pulling the X/Y/Z limit inputs down to zero volts and you still aren't seeing anything then it sounds like the problem lies elsewhere. If you connect the limit inputs to ground with a piece of wire do you see the alarm?

author: billbyrd1945
author_rank: Regular Contributor
timestamp: May 05, 2020, 05:00:58 pm
content: "...was the output of the hall sensor (i.e. green wire) also connected to one of the limit switch inputs..."Yes. I back-probed the connector with the sensors connected to the breakout board.I put together a playlist consisting of 5 very short videos to show what's going on. Maybe this will help:

author: thm_w
author_rank: Super Contributor
timestamp: May 05, 2020, 08:44:20 pm
content: From the video Y axis endstop seems to be working properly. Seems like progress. Nice cnc router setup.All three trigger as you have all three in settings set to the same input pin (11?).The software does not know Y-- or Y++ has triggered, it just knows pin 11 has gone low so whatever is linked to pin 11 is now marked as triggered (Y--, Y++, Yhome).In a more complex machine, you might have an individual switch for Y--. Y++, and Yhome, each going to a separate input. But for a hobby machine its simpler to have less, you just want to know if you've hit any limit at all.