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! > Electronics > General Electronics Discussion


General Electronics Discussion Discuss basic electronics, power supplies and anything else electronic related here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 07-08-2010, 11:20 PM
 
Join Date: Nov 2009
Location: USA
Posts: 1,515
Fastest1 is on a distinguished road
Can optical switches be run in series?

I would like to run 3 slotted optical switches for limits on my mill. I am currently testing a Optek OPB620 and it seems to work well in testing. I do like its size, simplicity and hopefully its durability in a benchtop enviroment. I am out of pins and would like to just use 1 as I have done with mechanical limit switches. Is this possible? It would seem you could just wire the 3 emitters in parallel and then do series on the collectors. Would this work?
Reply With Quote

  #2   Ban this user!
Old 07-08-2010, 11:25 PM
amishx64's Avatar  
Join Date: Jul 2008
Location: USA
Posts: 324
amishx64 is on a distinguished road

Originally Posted by Fastest1 View Post
I would like to run 3 slotted optical switches for limits on my mill. I am currently testing a Optek OPB620 and it seems to work well in testing. I do like its size, simplicity and hopefully its durability in a benchtop enviroment. I am out of pins and would like to just use 1 as I have done with mechanical limit switches. Is this possible? It would seem you could just wire the 3 emitters in parallel and then do series on the collectors. Would this work?
I can't think of any reason it wouldn't work. Just make sure you don't put any sort of load on the lines and that you wire them all in the some orientation. They shouldn't blow out, but you should always give them a test to make sure they work the way you want.

If you'd like, I have two at home I can try in series and tell you what happens.

- amishx64
Reply With Quote

  #3   Ban this user!
Old 07-09-2010, 12:25 AM
 
Join Date: Nov 2009
Location: USA
Posts: 1,515
Fastest1 is on a distinguished road

I wont be able to do it til tomorrow and then it will be blind trial and error.
Reply With Quote

  #4  
Old 07-09-2010, 09:17 AM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,539
Al_The_Man is on a distinguished road
Buy me a Beer?

Not sure what you mean by series on the collectors, but in general an open collector transistor, can be used in parallel, emitters and collectors, and have a common load from all three collectors to +dc.
This is called OR'ing, it works in the TTL world so it should work with these devices according to the app. sheet.
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #5   Ban this user!
Old 06-06-2011, 04:53 PM
BTS's Avatar
BTS BTS is offline
 
Join Date: Dec 2010
Location: USA
Posts: 28
BTS is on a distinguished road

I am looking for the same information. I am using Mach3 with a CNC4PC C1 BOB.
I only need to use 2 switches for home and limit.

The only thing I have found is this video....

YouTube - ‪Optical Slotted Switches in series‬‏
The person that posted the video said to look on this forum, but I have not been able to find anything.

Anyone have a schematic?
__________________
Allen
Louisville KY
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 06-06-2011, 05:38 PM
 
Join Date: May 2007
Location: UK
Posts: 701
wildwestpat is on a distinguished road

You need to tell us what you are driving with the switches.

Is it a break out board (BOB) -OR - a drive amplifier - OR - the pins on the LPT port of your computer - or something else? Each type of input has its own drive requirements which the arrangement of your switches must meet with an adequate safe margin between 'ON' and 'OFF' both in terms of current and voltage.

What are you driving? Tell us and I might be able to help. You also need to state what the desired logic is.

To answer your posted question the answer is no. This is because each switch has two connections an emitter and the collector of the NPN photon operated transistor. Yes you could connect the switch outputs in series. i.e. emitter of the first is the common negative terminal and the collector goes to the emitter of the second switch and so on with the final collector going via a suitable resistor to the positive supply. But as each switch has a voltage drop of around 0.8 volt pulling the shutter on two switches in series would give 1.6volts for one of the states and this is may not look like either a logic one or zero to the circuit being driven

This might work but you need to tell us what the drive conditions are for the following circuit input. The logic function performed is that any one switch that has its beam interrupted will operate by cutting off the current in the series resistor.

Tell us more if you want further help. Regards - Pat

PS the normal way of operating these switches, if there is such a thing as normal, is to common the emitters and the collectors. You then have a choice of putting the common ( a single ) resistor in either the collector to positive lead or in the emitter lead to the negative supply. The action is that the voltage across the resistor is highest when one or more switches has no shutter in place. However the voltages may well be wrong for direct drive into logic. Extra components may be required to adjust this.

Placing the switches in parallel might be a better option but more information on the circuit to be driven and how the limit switch shutter operates please.


If you are using this to indicate that the table has reached its end of travel by a shutter coming between the switch arms then putting the resistor in the emitter lead of the first switch generates a logic '1' and a suitable pull up or pull down resistor would also be required.

Last edited by wildwestpat; 06-06-2011 at 06:12 PM. Reason: PS added
Reply With Quote

  #7   Ban this user!
Old 06-06-2011, 05:52 PM
 
Join Date: May 2007
Location: UK
Posts: 701
wildwestpat is on a distinguished road

BTS - Treat the switches as open collector NPN and the operation is described in the CNC4PC manual for your BOB. The manual indicates the value of the common resistor required and how to set the pull down resistors for that BOB. Respond if you need further help. The switches are operated when the shutter is absent.

Regards _ Pat
Reply With Quote

  #8  
Old 06-06-2011, 06:44 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,539
Al_The_Man is on a distinguished road
Buy me a Beer?

One feature of Optical switches is the transistor emitter & collector is usually uncommitted, IOW they are not necessarily referenced to any particular supply.
Here is an example of using optical switches in series, or in logic it would be a NOR function.
Al.
Attached Files
File Type: dxf slotiso.dxf‎ (70.0 KB, 21 views)
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #9   Ban this user!
Old 06-07-2011, 02:49 PM
BTS's Avatar
BTS BTS is offline
 
Join Date: Dec 2010
Location: USA
Posts: 28
BTS is on a distinguished road

I am using Mach3 with a CNC4PC C1 Break Out BoardCNC4PC.
I want to set up home and limit using the optical slot switches existing on the machine that is being re-fit with new electronics. There are 2 per axis. on at each end of travel.
My main concern is how to wire them.

Another question is, if these are wired together as on circuit, how will Mach3 see them? Say the stage hits a limit on the X-axis, will this just kill the operation and stop the machine requiring a manual move back toward center?
How does Mach3 know which travel limit (left or right) has been hit?

If Mach3 needs to see each switch, would it be better to go with a board with more input channels?CNC4PC

Sorry about all the questions! If I need to post these as new threads, I will.
__________________
Allen
Louisville KY
Reply With Quote

  #10  
Old 06-07-2011, 02:59 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,539
Al_The_Man is on a distinguished road
Buy me a Beer?

If using the same switch for home and over travel, when homing an axis, Mach expects that that is the only axis moving, if homing the X the the first switch tripped should be X home switch regardless and so on.
Once homed, in the case of over travel, it does not matter which axis over traveled, all Mach knows it that an over travel has occurred and stops the process.
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 06-07-2011, 04:34 PM
 
Join Date: May 2007
Location: UK
Posts: 701
wildwestpat is on a distinguished road

Hi Allen - With the CNC4PC C1 Break Out Board (BOB) can I assume that you have them wired as in the manual for open collector electronic switches?

If so then the switch has to be obstructed by the shutter when the axis is OK and reaching the limit removes the shutter. By shutter I an talking about the vane or flag used to operate the switch. This means a long vane almost the total length of the axis and the switch is uncovered only when it is required to indicate it has either reached the end of travel or is at the home position. Long vane with a break at the home position.

Mach3 operates by driving each axis in turn to the axis limit. The limit can be set up in software or as a limit switch or as both. If you use software limits then these have to be set prior to use. Assuming you have configured Mach3 for hardware limit switches and a home switch using a single LPT input pin and told Mach3 the correct pin and polarity then Mach carries out the following actions. First axis is driven to the limit and the limit switch operates in your case the shutter at the opposite end of the table uncovers the switch. Mach3 detects the switch has been activated i.e. light shines from diode source to photo NPN transistor and the drive is instructed to stop. Mach3 then jogs (drives back off the switch) until the switch reverses state and notes the position. The axis is then driven to the opposite end of the axis when the limit switch at the opposite end of the table is uncovered by the vane and the axis halts jogs back off the limit switch and notes where the switch has been set. The same action is used for the home switch when the axis limits have been obtained. Mach3 repeats this action for all axis in turn (drink tea whilst waiting!). Mach 3 then has knowledge of when to expect the axis limits to be reached and where the home switches are. Sounds very complicated and there is a very good write up on the Mach 3 download page written as a stage by stage setting up procedure. The Mach 3 manual also covers the setting up of stepper motors in terms of acceleration and maximum speed etc.

If the action of the vane and the switch is not as I have described please ask. It is easy to invert the switching logic but this requires extra components. Unfortunately you can not use Mach3 to invert the signals if they have been combined onto a single input pin. The logic has to be right before combining.

There is a common problem with the simple optical shutter operated switches in that there are two distinct families of device often sharing a common part number using a suffix to differentiate between them. For example the H22** slotted optical switches. The first * can be an A or L the A indicates an analogue switch where the vane position can be detected as a change in the current conducted by the NPN transistor. These operate over 3 mm which is not what is required for a good limit switch. The L indicates logic functionality and the beam of light is focused much more tightly so that the switch range is sub the 0.1mm from 'ON' to 'OFF' . I suspect many have used the wrong switch as there is a load of conflicting advice on the web.

Whilst I am on about the correct switches I seriously suggest not putting the diodes in series but using separate resistors for each switch diode. Since the diode has a forward voltage drop of 1.7 volts the value of resistor is easy to calculate as supply minus the 1.7 volts divided by the desired current (in milliamperes) to give the value in K Ohms. A typical switch should have 10 to 20 milliamps. The resistors are cheap and the wiring which needs to be screened is as neat or neater using separate resistors. It is also easy to inhibit the home switch when required if all leads from the switches start in the control box.

Hope this helps - if not ask again - Regards - Pat
Reply With Quote

  #12   Ban this user!
Old 06-07-2011, 04:47 PM
 
Join Date: May 2007
Location: UK
Posts: 701
wildwestpat is on a distinguished road

Hi Allen

Sorry missed the second part of the question about extra inputs. Here is my take:-

Yes you could add another parallel port to the computer running Windows for your Mach 3 software. Windows will handle up to four parallel ports. Two is usually sufficient where high speed inputs are required along with motion control of the axis. As far as I can rember Mach 3 can only handle two. For switch controls other than the axis limits it is practical to use a key board emulator. Most machines can be controlled fully from two parallel ports and a few keyboard emulated instructions or using a standard key board with the short cut keys. You will soon see what you need when every thing is connected and you start to make things on it. I have found that one parallel port is OK until you want to add manual control handset. Even this is not a good reason to use a second port as there is a good plug in for the 'shuttle mouse' which provides a few buttons and a nice jog wheel at a fraction of the price as it is a standard USB main stream computer device. Look on the Mach 3 web site for details under down loads.

Regards - Pat
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IH Optical Limit Switches HimyKabibble Industrial Hobbies (Support forum) 18 12-06-2008 11:09 PM
Optical Limit Switches HimyKabibble Bridgeport and Hardinge Mills 7 11-20-2008 09:50 AM
Build Thread- Optical limiting switches oxford Benchtop Machines 29 07-25-2008 05:37 PM
optical interrupter switches arbus General Electronics Discussion 17 02-07-2008 07:10 AM
optical limit switches woffler Benchtop Machines 7 12-17-2007 05:01 PM




All times are GMT -5. The time now is 06:47 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 354 355 356 357 358 359 360 361