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 > Gecko Drives


Gecko Drives Discuss all Gecko drives here and get direct support!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 01-02-2009, 06:40 PM
 
Join Date: Jul 2006
Location: USA
Age: 38
Posts: 841
Fixittt is on a distinguished road
G540 and proximity switches

I have a question, I have a set of prox switches (Koyo APS4-12s-e-d) the require 10 to 30 volts power. I have them hooked to a 12v walwart. My question is on wireing. The switches are 3 wire. When the switches are powered and I trigger one of the switches I get 12vs on the 3rd wire. Im not the sharpest tool in the shed, but I happen to know that if I put 12v`s to the g540 pin chances are Im going to let the magic smoke out.........
I have a wirering diagram that I dont fully understand..... can one you you electronics guys simplify this for me please?
Attached Thumbnails
Click image for larger version

Name:	NPN sensor  with C10.JPG‎
Views:	286
Size:	18.6 KB
ID:	72738  
Reply With Quote

  #2   Ban this user!
Old 01-02-2009, 07:24 PM
 
Join Date: Dec 2008
Location: Australia
Posts: 30
David Campbell is on a distinguished road

Fixittt,

What voltage are you running G540 on?

The part should work with a G540 except for the issue of voltage issolation.

I have just had a quick look at the full datasheet:
http://web2.automationdirect.com/sta...oxrectaps4.pdf

The wiring should be:
Brown => +ve supply
Black => Input terminal of G540 (wired directly)
Blue => -ve supply

The gotcha is the -ve supply feeding the proximity sensor must also be connected to the -ve supply of the G540. The APS4-12S-E-D has a maximum voltage rating of 30V DC (most simple voltage regulators also have a maximum input voltage of 30V except possibly the 7824 which is typically 40V).

David Campbell
Reply With Quote

  #3   Ban this user!
Old 01-02-2009, 07:32 PM
 
Join Date: Jul 2006
Location: USA
Age: 38
Posts: 841
Fixittt is on a distinguished road

and I thought I couldnt get any more confused!!!!! LOLOL

Here is what I have...
I have a keling 36V PSU feeding the G540.
I have a 12V wall wart feeding the prox switches......
Reply With Quote

  #4   Ban this user!
Old 01-02-2009, 09:05 PM
 
Join Date: Dec 2008
Location: Australia
Posts: 30
David Campbell is on a distinguished road

Originally Posted by Fixittt View Post
and I thought I couldnt get any more confused!!!!! LOLOL

Here is what I have...
I have a keling 36V PSU feeding the G540.
I have a 12V wall wart feeding the prox switches......
OK - I'll try and go slow and walk you through the steps...
There is a small diagram showing the suggested wiring below in the attached images.

Step #1 - Grab a multimeter and make sure there is no conductivity between the 110V and the 12V side of the "wall wart". There shouldn't be any conductivity but this is a quick 30 second check just to make sure. If there is any conductivity between the low and high voltage side of the "wall wart", stop and do not proceed any further.

Step #2 -
a) Connect the -ve wire from the "wall wart" to the -ve terminal of the 36V PSU, leave the +ve wire from the "wall wart" disconnected for the moment.
b) Turn both power supplies on and measure the voltage between the +ve terminal of the 36V PSU and the +ve terminal of the "wall wart". Red lead to the 36V PSU +ve terminal, black lead to the +ve terminal of the "wall wart". The voltage should be 24V (36V - 12V = 24V), if there is no voltage turn off and check your wiring.

If nothing has gone pop yet then you have cleared the power supply problems.

Step #3 - Connect the proximity switches as follows:
Brown => +ve "wall wart"
Black => Input terminal of G540 (wired directly)
Blue => -ve (common to both supplies)

The diagram you originally posted had additional resistors, these are not required for a G540.

The proximity switch you have bought acts like a traditional switch between the black and the blue wires.

If you look at the documentation you recieved with your G540 drive, the recommended input is a switch between the input and the G540 -ve supply wire.

If you want to get rid of the "wall wart" you can make a small 24V regulator using three parts (7824, a small capacitor and a heatsink) which takes power from the 36V PSU and supplies the proximity switches. Just about any idiot with a screw driver and a bit of terminal strip could put together.

David Campbell

PS: An old style plug pack were pretty much guaranteed to have voltage issolation however with switchmode plug packs appearing you need to double check. Sorry if I am being a little paranoid about safety...
Attached Thumbnails
Click image for larger version

Name:	wiring.jpg‎
Views:	253
Size:	23.1 KB
ID:	72744  
Reply With Quote

  #5   Ban this user!
Old 01-02-2009, 09:10 PM
 
Join Date: Jun 2005
Location: USA
Posts: 196
Richards is on a distinguished road

I would add an opto-isolator to convert the 12V to 5V. When the proximity switch senses its target, the opto's transistor turns on and the output line goes LOW. There are two drawings, one for NPN sensors and one for PNP sensors.
Attached Thumbnails
Click image for larger version

Name:	prox_sensor.jpg‎
Views:	285
Size:	33.3 KB
ID:	72745  
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 01-02-2009, 09:30 PM
 
Join Date: Dec 2008
Location: Australia
Posts: 30
David Campbell is on a distinguished road

Originally Posted by Richards View Post
I would add an opto-isolator to convert the 12V to 5V. When the proximity switch senses its target, the opto's transistor turns on and the output line goes LOW. There are two drawings, one for NPN sensors and one for PNP sensors.
Richards,

Nice idea but with the G540 Rev3 there is no 5V supply readily available (the G540 Rev1 required an additional 5V supply for the logic side).

I am not a fan of ganging different power supplies together as there are potential issues when only one of the power supplies is running. In this particular case as the output is only a pull down transistor there should be no issues.

To get around the "two power supply problem" you can build a small voltage regulator that provides a lower voltage from the 36V supply. The simple 3 pin linear voltage regulators (eg: 78xx series) have a maximum inlet voltage of 30V to 35V (manufacturer dependent) except for the 24 volt version (7824) which has a 40V maximum inlet voltage.

Fixittt: The 7824, capacitor and small heatsink should be easily purchased for less than $5.

The other option is to keep the proximity switch and "wall wart" power supply completely issolated and use the proximity switch to drive a small 12V relay. Normally relays have over 1000V issolation between the coil and contacts.

Come to think of it, the relay option probably is the best solution:
- simple to wire
- minimal extra components
- no voltage issolation issues

David Campbell
Reply With Quote

  #7   Ban this user!
Old 01-02-2009, 11:31 PM
 
Join Date: Jun 2005
Location: USA
Posts: 196
Richards is on a distinguished road

David,

I agree that the G540 has no 5VDC "tap". I get around that in my designs by sometimes using multi-stage voltage regulators to get the 24V or 12V for the proximity sensors and to get 5V for the TTL logic. Other times I use additional power supply (or supplies) with its (their) ground(s) tied to the stepper power supply ground.

In this particular case, I'm wondering whether the G540 already has a pull-up resistor attached to each input so that the opto-isolator's transistor's collector (pin 5) could be attached directly to a G540 input and the emitter of the opto-isolator ((pin 4) could be attached to the G540's ground. Since I don't have a G540, I can't test that idea, but it might fall within the parameters of the TTL spec on page 2 of the data sheets.

(Perhaps Mariss could comment on that possibility.)

Page 1 of the data sheet for the G540 contains this notation:

7) INPUTS: The G540 has four general purpose inputs called INPUT 1, INPUT 2, INPUT 3 and INPUT 4 on the MAIN TERMINAL BLOCK. They are at Pos 1, Pos 2, Pos 3 and Pos 4 respectively on the terminal block. These inputs may be used as limit switches or for any other purpose. SPST switches can be used with these inputs; one end of the switch goes to the input, the other end of the switch goes to ground (Pos 12).

Page 2 of the data sheet contains this notation:

Four SPST to GND inputs (TTL)

As a side note, some might consider attaching the black wire of a three wire proximity sensor directly to a G540 input line and then connecting the sensor's blue wire to the G540's ground. I'm not comfortable with that idea, because I don't have a schematic of the proximity sensor's circuit. Since a PNP sensor has to SOURCE the current, it seems that it would be using 24V or 12V which would not work as an interface to a TTL circuit. An NPN sensor might actually have a built in opto-isolator, but, again, I don't have a schematic of the proximity sensor.

Edited:
Page t.5 of Balluff's 08/09 "Object Detection" Catalog shows that their sensors use the higher voltage (10V - 30V) as the source/sink voltage of the output, so it would not be possible to connect the black wire of a three-wire sensor directly to a TTL input line.

Last edited by Richards; 01-02-2009 at 11:58 PM.
Reply With Quote

  #8   Ban this user!
Old 01-03-2009, 02:05 AM
jalessi's Avatar  
Join Date: Feb 2007
Location: U.S.A.
Posts: 3,155
jalessi is on a distinguished road
Smile

The opto-isolator and two LM317T chips would do the trick.

One 317T for the Koyo APS4-12s-e-d "10-30 volts" and one 317T for the opto-isolator "5 volts".

http://www.national.com/mpf/LM/LM317.html

http://tinyurl.com/8wrnac

No problem powering the LM317T off the Keling power supply either.

Less than ten bucks for all the parts.

Jeff...
Reply With Quote

  #9   Ban this user!
Old 01-03-2009, 05:47 AM
 
Join Date: Dec 2008
Location: Australia
Posts: 30
David Campbell is on a distinguished road

Fixitt,

I will shortly post a wiring diagram for a relay solution.

Jeff,

Based on Fixittt's original plea for help he is looking for a simple wiring solution. I overlooked the LM317 and other variable voltage regulators as they need extra resistors and you start getting into the realm of building a small PCB.

For a very simple, fool-proof system I believe the good old electro-mechanical relay is the best option.

Richards,

With an NPN output transistor for the proximity sensor, the maximum voltage that proximity sensor can supply on the outlet connection is 0.6V if the -ve of the proximity sensor is at the same voltage as the -ve of the G540 supply.

The output circuit for the proximity sensor can be found at the bottom left corner of the first page of the following PDF:
http://web2.automationdirect.com/sta...oxrectaps4.pdf

I did some quick checks with a multimeter on my G540:
1) The resistance between an input to any other input is more than 2000k
2) The resistance between an input to Vsupply is more than 2000k
3) The resistance between an input to Ground is more than 2000k
4) An open input measures 11.1V with respect to ground (24V supply)
5) An ammeter between an input to ground reads 7.1 mA

I double checked the 2000k ohm range on my multimeter and the range is functioning correctly as the first three results are "unusual" for a logic input (except for an unprotected CMOS input and I'd doubt that is the case).

Test #4 & #5 indicates there is a 1.5k resistor to an internal 12V rail. It looks like each pull-up resistor has a diode inline, this explains the 11.1V and the "infinite resistance" between inputs.

My guess is that the four inputs are opto-issolator inputs. Makes sense, a little current avoids a whole pile of spurious induced voltage noise.

Edit: Just double checked a datasheet for a 4N25/6/7/8, the forward voltage at 25'C and 0.1 mA is 0.9V, I think we have a smoking gun...

David Campbell

Last edited by David Campbell; 01-03-2009 at 05:56 AM. Reason: Updated based on optocoupler datasheet info...
Reply With Quote

  #10   Ban this user!
Old 01-03-2009, 06:48 AM
 
Join Date: Jun 2005
Location: USA
Posts: 196
Richards is on a distinguished road

Proximity sensors are not picky about voltages as long as the voltage is within the 10 to 30 volt range of the sensor. Having 25 volts or 21 volts works fine. I try to keep the voltage at 12V or higher and at 24V or lower just to make sure that the sensor works properly.

The problem with converting high voltages from the stepper power supply to low voltages for 5V TTL or 12V sensors is heat - lots and lots of heat. When a voltage is dropped across a load (resistor or a regulator), the dropped voltage is converted to heat. That's one reason that transformers often have multiple outputs. Each required voltage level has its own output from the transformer.

One way to handle the heat problem is to use components that can handle more heat (and voltage) than a TO-220 type regulator. A normal TO-3 size NPN transistor (with hefty heat sink), a zener diode and a current limiting resistor can do the job.

A transistor has beta or gain. That simply means that a low current can control a high current. Small transistors typically have lots of gain and large transistors usually have less gain. Two transistors can be combined so that the gain of one transistor is multiplied by the gain of the second transistor (darlington configuration).

Here's a simple circuit that shows how a zener diode could be used to control the voltage allowed through a transistor. Assuming that the transistor has a gain of 30, the resistor is chosen to allow about 1/30th of the desired current to pass through the base of the transistor; therefore, if 0.5A is required at 24 volts from the transistor, then 0.50/30 = 0.016A needs to pass through the resistor. The resistor needs to be about 24 / 0.016A = 1440 ohms. The wattage of the resistor would be 24 X 0.016 = 0.38W, so a 1W, 1.2K resistor could be used along with a 25V, 5W zener diode. (Pick higher wattage resistors and zeners to keep the heat level down.) Remember that a transistor requires about 0.6V for its base/collector junction, so pick a zener diode that is 0.6V (or about 1 volt) higher in value than the voltage that you need.

[Edited: Thanks Dave. You posted while I was writing. Your experiment verifies what I had assumed.]
Attached Thumbnails
Click image for larger version

Name:	ps_transistor_zener_2.jpg‎
Views:	137
Size:	5.3 KB
ID:	72778  
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 01-03-2009, 10:06 AM
 
Join Date: Jun 2005
Location: USA
Posts: 196
Richards is on a distinguished road

A fact of life for the do-it-yourselfer is that if you want to build your own CNC controller, you're going to have to understand some basic electronics. A good source for basic information is the internet. When you read a term that you don't understand, Google that term and read until you do understand it. Interfacing devices to a CNC controller are part of the life of those of us who build our own equipment.

Some basic steps might help.

Go to your nearest Radio Shack type store and buy a 9-volt battery and a connector for the 9-volt battery. Buy one of their white prototyping boards and a length of solid telephone connecting cable so that you'll have some solid wire for the prototyping board. Get a $5 wire stripper and a $5 pair of nippers so that you can cut and strip the telephone wire. If they have some of their paper-back books that explain simple electronics, buy a few of those, too. Get a package of NPN and PNP transistors, some resistors (1K, 10K), some LEDs and experiment until you can get the transistor to turn the LED on and off.

Once you can do that, you'll have learned about 75% of what you'll need to know to connect an external device to a CNC controller.

After you've got the transistors and LEDs working, get a 7805 voltage regulator to give you 5VDC from the 9-volt battery. Buy some TTL chips (7400, 7404, etc.). Learn how to make the TTL chip turn the LED on and off.

At this point, you're almost there.

Get a few opto-isolators (4N25 are common) and learn how to turn the inputs on and off to make the outputs turn on and off.

Every interface that I build is based on those simple components. Sometimes I use an 89C2051 micro-controller, but that's just a programmable 20-pin chip that can replace a whole board full of standard TTL chips.

When you're ready to build a permenant circuit board, download the free software from ExpressPCB (or other similar software). That software contains both a schmatic package as well as a board layout package. It includes a library that contains hundreds of common devices. It has a simple tutorial to get you started and it allows you to directly upload your PC board to their fabrication facility. With ExpressPCB, you can build 2-layer and 4-layer boards of almost any reasonable size. They offer a service to make three 2.5X3.8 inch boards for you for about $70, including shipping, that will enable you to build many of the simple interfaces that you'll need without breaking the bank.

If you think that a board that small wouldn't be of much value, think again. Last week I designed a board that holds five 20-pin micro-controllers, a watch-dog timer, an oscillator, two 14-pin "glue" chips and enough Phoenix connectors to allow me to monitor five stepper motors. That board allows me to modify the pulse width going to the steppers, modify the direction that the steppers turn, slave other steppers off one incoming signal, and, best of all, toggle a step signal back and forth on each axis to keep all axes active while a file is being run so that no single axis becomes inactive long enough for the Gecko to go into standby mode. That keeps the active axes from pushing around the inactive axes. Total time to draw the schematics and layout the PC Board was less than six-hours. A much simpler board that interfaced five proximity sensors, complete with five opto-isolators and a single 7408 AND gate chip took less than fifteen minutes from start of schmatic drawing to uploading the PC Board for fabrication.

All it takes is a little time, a little desire, and about $100 worth of practice parts.
Reply With Quote

  #12   Ban this user!
Old 01-03-2009, 10:21 AM
 
Join Date: Dec 2004
Location: usa
Posts: 1,665
TOTALLYRC is on a distinguished road

Of course, fixxit could just cut a small board on his mill as he has a high speed spindle and all he would need would be a few cutters if he doesn't have them already.

Mike.
__________________
Warning: DIY CNC may cause extreme hair loss due to you pulling your hair out.
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
PROXIMITY SWITCHES CHANDRU General Electronics Discussion 1 12-12-2007 07:33 AM
PNP v/s NPN Proximity Switches whiteriver General Electronics Discussion 3 05-17-2007 11:10 AM
proximity switches woodguy7777 Commercial CNC Wood Routers 4 04-29-2006 04:17 PM
Proximity switches bgriggs DIY-CNC Router Table Machines 5 09-01-2003 12:13 AM
proximity switches rcrabb DIY-CNC Router Table Machines 6 07-20-2003 11:27 PM




All times are GMT -5. The time now is 05:53 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