Electronic home switches made easy!


Page 1 of 101 12341151 ... LastLast
Results 1 to 12 of 1206

Thread: Electronic home switches made easy!

  1. #1
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2392
    Downloads
    0
    Uploads
    0

    Default Electronic home switches made easy!

    Hi, my Honeywell hall switches arrived and I figured it might be good to start an open-source thread on using electronic hall switches for home sensors (or limit sensors).

    Please contribute to the thread! Especially if you have any experience with electronic (contactless) sensors on your CNC machine, I've searched this forum a couple of times and there seems to be a lack of information on them.

    Hall Effect Switches.

    I chose the Honeywell SS441 sensor as it seems common enough and has some decent features. There is also a SS541 sensor, that seems to be the same device but in a surface mount package that requires a special PCB.

    The SS441 is probably easier to use for most people as it has legs that are more easily soldered.



    There are a few sensors in the range. The SS441 is "unipolar" meaning it just needs the presense of a magnetic field to operate. The "bipolar" sensors can detect if a magnetic field is North or South, which is not needed for limit switches.

    The SS441 is suited for lower strength magnets, and is temperature compensated. It's temperature compensation matches that of lower strength (older style) magnets.

    My initial testing showed that the new super magnets give a greater sensing distance from magnet to sensor, but this seems to reduce sensitivity as we need to detect a close precise distance. So unless testing proves otherwise it seems that older style low-power magnets are the best for this application.

    Similar Threads:


  2. #2
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2392
    Downloads
    0
    Uploads
    0

    Default

    Where to buy them;

    I bought them from Farnell, they were $3 each in the catalogue but when I phoned to order they were only 78 cents each.

    311-1477 Honeywell SS441A SENSOR, HALL EFFECT


    Datasheets;


    SS441 Datasheet;
    Honeywell SS441 Hall Switch.pdf

    SS541 (surface mount version) Datasheet;
    Honeywell SS541 Hall Switch.pdf


    How to test the sensor.

    The SS441 and SS541 have 3 legs;
    + (+5v power)
    - (0v ground)
    O (Output)

    The datasheet says 4v to 30v is ok for power, but I used +5v regulated as that is available on my CNC machine (and most machines) and using regulated voltage for the power eliminates one variable that might affect the sensing characteristics.

    The easiest way to understand these sensors is to see the output like a switch to ground, whenever the magnet is present.



    This is a very simple test rig that only needs a resistor and a LED. When the magnet is present the Output leg switches to ground and the LED lights up. The test rig took about 30 seconds to make, and was powered from +5v and ground via the Red and Black wires.


    Test rig results

    This worked well. I used a 1.5k (1500 ohm) resistor and a high brightness LED but the resistor value is not critical nor is the type of LED.

    The sensing surface of the SS441 is the front (or back) face. When a magnetic South field is present near the front face it switches on (Output connects to ground). Likewise it switches on the same if a North field is near the back face of the device.

    The front face has the writing and sloped sides. The back face is flat.

    I tested a few magnet types and settled on 2 small bar magnets that operated the sensor from about 5mm (3/16"). Hysteresis was about 3mm (1.8") or less.

    Hysteresis means that once the sensor turns on, the magnet must be withdrawn a certain distance for it to switch off again.

    Using a lower strength magnet means the magnet must be closer to activate the sensor, and the hysteresis is much smaller, and the repeatability of the "on" trigger point is better as this is over a smaller physical distance.

    Last edited by RomanLini; 03-21-2010 at 08:32 AM.


  3. #3
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2392
    Downloads
    0
    Uploads
    0

    Default

    Mounting the sensors

    If you have the smaller, surface-mount SS541 sensors they will need small PCB made, or some tricky soldering.

    But I deliberately bought the SS441 to allow easy soldering. They can be soldered onto standard 0.1" stripboard ("veroboard" brand or similar) but in a pinch you could just solder the 3 wires to the 3 legs and secure the lot with a blob of epoxy.



    I cut 2 small pieces from 0.1" stripboard, leaving just 3 strips (to solder to 3 legs). The little PCB are about 10mm x 20mm (3/8" x 3/4").

    When bending the legs make sure you bend them out AND down, so only the points at the end of the legs touch the PCB strips. This makes it easier to solder and has less chance of shorting between legs.



  4. #4
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2392
    Downloads
    0
    Uploads
    0

    Default

    First tests on the CNC machine

    I glued the little sensor PCBs onto small pieces of plastic using non-acetic (non corrosive) silicone as the glue. This will allow testing but also allows for removal and repositioning if needed.



    For the X axis I glued the magnet onto the moving part and the sensor PCB onto the gantry.

    The end of the magnet just covers the face of the SS441 sensor when at the home position. There is about 2mm gap between. It triggers the sensor when approaching, about 10mm (3/8") before it reaches the home position, about 5mm between the end of the magnet and the edge of the SS441.

    This will allow a safety margin of up to 10mm when moving home just in case it has skipped some steps in either way.



    On the Y axis I glued the magnet onto the moving table, and the sensor PCB to the machine's base plate. The distances are similar to the X axis setup, it triggers the sensor when approaching, about 10mm before reaching home.

    I'll let the silicone glue set a bit overnight and tomorrow I'll write some software to test the repeatability of both sensors with the machine moving home at different speeds.



  5. #5
    Gold Member
    Join Date
    Jun 2003
    Posts
    2103
    Downloads
    0
    Uploads
    0

    Default

    Roman I will be watching this thread. I only wish I had something to give to it, but alas.....electronics is not my strong point.

    Mike

    No greater love can a man have than this, that he give his life for a friend.


  6. #6
    Registered Drools's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    1290
    Downloads
    0
    Uploads
    0

    Default

    Very nice write up.
    For a inexpensive 5VDC power supply, I used an old cell phone AC Adaptor with my optical home switches.



  7. #7
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2392
    Downloads
    0
    Uploads
    0

    Default

    Thanks for the interest guys!

    Quote Originally Posted by turmite View Post
    Roman I will be watching this thread. I only wish I had something to give to it, but alas.....electronics is not my strong point.
    ...
    Actually that makes your viewpoint very valuable to the thread! As an electronics guy I know roughly what info to provide to help electrical people use these sensors but I don't know how scary this looks to a person from a non-electrical background. I've been trying to explain it simply and would appreciate feedback on whether I am making sense and making the sensors seem easy to use, or if it seems too hard or I am explaining it badly etc.



  8. #8
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2392
    Downloads
    0
    Uploads
    0

    Default

    Actual sensor testing on the machine!

    Software test procedure;
    1. move the axis well past the sensor (eliminates backlash)
    2. move back close to the detect point
    3. slowly move back in 0.01mm steps, until detect
    (repeat for other axis)

    Results;

    Speed 4mm/sec;
    X Y
    994 873 (9.94mm, 8.73mm)
    993 874
    993 873
    994 873
    993 874
    994 874
    993 874
    993 874
    993 873
    993 873

    Speed 2mm/sec;
    993 873
    993 873
    993 873
    993 873
    993 873
    993 873
    993 873
    992 873
    992 873
    992 872
    993 873

    Speed 1mm/sec;
    992 873
    992 873
    992 873
    993 873
    992 873
    992 873
    992 873
    992 873
    992 873
    992 873

    Speed (back to) 4mm/sec;
    992 873
    992 873
    993 873
    992 873
    992 873
    992 873
    992 874
    991 873
    992 873
    991 873

    About the results;

    The results are interesting! Firstly my machine repeatability seems to be worse than the sensor. The first set of tests with cold machine you can see +/- 0.01mm noise, probably my leadscrews being cold and looser in my plastic leadnuts.

    I varied the speed of the tests, from 4mm/sec down to 1mm/sec. There seemed to be a little more error at 4mm/sec than the two slower speeds, so I will set it to 2mm/sec for future use.

    I know my screws tighten up a bit and accuracy increases after a few minutes use, this is visible as the tests progress. There also seems to be some sign of my leadscrew getting longer as it warms up, over the full set of tests which took about 10 minutes you can see about 0.02mm of increase in leadscrew length.

    Conclusion;

    1. My machine is probably repeatable to about 0.02mm (0.0008") when cold
    2. My machine is probably repeatable to about 0.01mm (0.0004") when warm
    3. The sensor is most likely more repeatable than my machine!

    I really don't think I can get any more accurate results than these. Moving my machine in 0.01mm steps makes its own error, because a stepper motor slowly moved one step "jerks" from step to step, and obviously my machine has friction and slop, so the actual distance "jerked" each 0.01mm step may be slightly different.

    You might notice that my Y axis is a bit more repeatable than X, this is probably because it has much less mass to move, less bearing stick, and a shorter leadscrew with less expansion. (edit) I just realised with my Y axis the home sensor is at the stepper motor end, so it is not affected by leadscrew thermal expansion (or is not measuring leadscrew thermal expansion).

    The results do look pretty good! I'm happy with the sensors and their present locations, which detect about 10mm before home. So they got glued down with a lot more silicone and will get some more testing over coming weeks.

    Last edited by RomanLini; 03-22-2010 at 05:32 AM.


  9. #9
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2392
    Downloads
    0
    Uploads
    0

    Default

    Stepper motor error.

    There are 2 homing errors possible with stepper motors;

    1. Mechanical (jumped steps)
    This is the easy one. If a stepper motor is overloaded physically by some problem it will "jump steps". The armature of the stepper motor jumps to another position in the motors magnetic field. This commonly happens when your cutting tool tries to cut too deep or your machine tries to move too fast etc.

    A typical 200 step motor has 4 full steps, times 50. So there are exactly 50 positions on the magnetic field and when it jumps steps it must jump to one of them. So the minimum error is exacty 1/50th of a rotation, or 7.2 degrees. So it is easy to detect if the motor has jumped steps, and easy to correct.

    I forced my X axis motor to jump once, and recorded the results;

    (before jump)
    992 873
    992 873
    993 873
    992 873
    992 873

    (after jump)
    1008 873
    1008 873
    1007 873
    1007 873
    1007 873

    The X axis is showing an error of about 0.16mm in each step, which is because my X axis leadscrew moves 0.16mm for every 7.2 degrees of motor rotation. Obviously it has jumped exactly one magnetic "pole" and the software can easily compensate by moving the machine 0.16mm.


    2. Software/electrical (step pulse error)
    This one is a little harder. If your software has glitched or your electricals have experienced a spike or surge, then the stepper motor driver may have received additional "step" pulses or lost "step" pulses.

    The amount of error could be anything, in the resolution of your driver (ie in microsteps).

    This error is hard to detect, as it may be smaller than the repeatability of your machine. If you get a fault like this the best solution would be to turn the drivers off, and when the drivers start up again they will be on the "home" step. Then you can do the test above and align the steppers to the correct 7.2 degree magnetic "pole" giving zero step error.


    Homing procedures?

    Obviously it is going to be up to your CNC software to decide how to handle initial homing (at turn on) and detect/correct homing errors.

    The good news is for initial homing that it only needs to detect within +/- 3.6 degrees of motor rotation to find the correct magnetic pole, and then the system can be aligned to zero microstep error.

    If your software re-homes everytime it goes back to the sensor, this can be good as it will compensate for errors or thermal expansion etc, but can be bad as it will always be changing.

    I would be interested in hearing other people's homing/correction methods, or those used in standard CNC software. It might be good to start a discussion of the homing technique and possible changes to the sensor setup that might improve homing accuracy!

    For my system I am currently aligning to the correct stepper magnetic pole and then using the native accuracy of the machine so technically there is zero microsteps error after homing, and any real error is caused by the mechanicals of the machine.

    That's all I have for now, please comment and if you want me to do any specific sensor tests just speak up.



  10. #10
    Registered
    Join Date
    Jan 2009
    Location
    australia
    Posts
    71
    Downloads
    0
    Uploads
    0

    Default

    Thanks for this thread Roman,
    I am looking forward to understanding a little bit more about electronics










    All Australian Politicians should serve two terms
    One in Parliament
    And one in jail



  11. #11
    Member
    Join Date
    Jan 2005
    Location
    USA
    Posts
    9505
    Downloads
    0
    Uploads
    0

    Default

    Hi RomanLini

    This has been use before, but like you say not much imformation on them any were, that is because they have very limited use on metal cutting machine, they would be ok on wood working machines,were you only have wood dust to deal with

    The magnets get covered with metal chip, so you know what happens next, & there's no way to stop this from happening

    There are lots of machines that use proximity sensors ,but they don't use magnets as there trigger

    You have done a great write up on this, that should help anybody that wants to try it

    Mactec54


  12. #12
    Registered DIYaholic's Avatar
    Join Date
    Oct 2009
    Location
    USA
    Posts
    272
    Downloads
    0
    Uploads
    0

    Default

    RomanLini,
    I too will be watching this thread!
    You have done a great job explaining/describing these sensors (even I understand your explanations). You made/make it seem as though even I could make these quite easily.
    If I had an apple, I would give it to you for being such a good teacher (perhaps a cold one will do)!

    Randy,

    I may not be good....
    But I am S L O W!!


Page 1 of 101 12341151 ... LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Electronic home switches made easy!

Electronic home switches made easy!