CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > WoodWorking Machines > DIY-CNC Router Table Machines > Open Source CNC Machine Designs


Open Source CNC Machine Designs Discuss Open Source CNC Machine Designs here.


This forum is sponsored by:

Reply
LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-21-2010, 07:20 AM
Gold Member
 
Join Date: Oct 2005
Location: Australia
Posts: 2,098
RomanLini is on a distinguished road
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.
Tweet this Post!Share on Facebook
Reply With Quote

  #2  
Old 03-21-2010, 07:45 AM
Gold Member
 
Join Date: Oct 2005
Location: Australia
Posts: 2,098
RomanLini is on a distinguished road

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.
Tweet this Post!Share on Facebook
Reply With Quote

  #3  
Old 03-21-2010, 07:58 AM
Gold Member
 
Join Date: Oct 2005
Location: Australia
Posts: 2,098
RomanLini is on a distinguished road

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.
Tweet this Post!Share on Facebook
Reply With Quote

  #4  
Old 03-21-2010, 08:14 AM
Gold Member
 
Join Date: Oct 2005
Location: Australia
Posts: 2,098
RomanLini is on a distinguished road

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.
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 03-21-2010, 07:45 PM
 
Join Date: Jun 2003
Posts: 1,984
turmite is on a distinguished road

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.
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 03-21-2010, 07:59 PM
Drools's Avatar  
Join Date: Feb 2009
Location: Canada
Posts: 878
Drools is on a distinguished road

Very nice write up.
For a inexpensive 5VDC power supply, I used an old cell phone AC Adaptor with my optical home switches.
Tweet this Post!Share on Facebook
Reply With Quote

  #7  
Old 03-22-2010, 04:55 AM
Gold Member
 
Join Date: Oct 2005
Location: Australia
Posts: 2,098
RomanLini is on a distinguished road

Thanks for the interest guys!

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.
Tweet this Post!Share on Facebook
Reply With Quote

  #8  
Old 03-22-2010, 04:58 AM
Gold Member
 
Join Date: Oct 2005
Location: Australia
Posts: 2,098
RomanLini is on a distinguished road

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.
Tweet this Post!Share on Facebook
Reply With Quote

  #9  
Old 03-22-2010, 05:14 AM
Gold Member
 
Join Date: Oct 2005
Location: Australia
Posts: 2,098
RomanLini is on a distinguished road

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.
Tweet this Post!Share on Facebook
Reply With Quote

  #10   Ban this user!
Old 03-22-2010, 06:01 AM
 
Join Date: Jan 2009
Location: australia
Posts: 45
denz is on a distinguished road

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
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 03-22-2010, 09:33 AM
 
Join Date: Jan 2005
Location: USA
Posts: 2,166
mactec54 is on a distinguished road
Buy me a Beer?

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
Tweet this Post!Share on Facebook
Reply With Quote

  #12   Ban this user!
Old 03-22-2010, 05:50 PM
DIYaholic's Avatar  
Join Date: Oct 2009
Location: USA
Posts: 272
DIYaholic is on a distinguished road

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!!
Tweet this Post!Share on Facebook
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 2 (0 members and 2 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stepper Phase Current Made Easy Rube Stepper Motors and Drives 1 08-30-2007 02:02 PM
The relationship of limit switches to home switches. MikeAber General Electronics Discussion 4 11-04-2004 02:28 PM
Limit switches and home switches viktorcnc TurboCNC 2 08-03-2004 07:11 AM
Home switches and limit switches. ynneb General Electronics Discussion 5 04-08-2004 06:32 PM
Home made CNC mill (and some products made by it) gcamlibel DIY-CNC Router Table Machines 23 04-05-2004 06:54 PM




All times are GMT -5. The time now is 01:44 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353