CAD CAM EDM DRO - Yahoo Group Archive

Current loop

on 1999-10-15 11:23:21 UTC
Hi folks,

I am going to try to cover several topics, - first:

Andrew:
-------

Well, I will give you a short explanation on the TTY stuff:

The RS232 is a standard for communication. A serial stream of ones
and zeroes. These are defined by voltage swings, and they use pin 2
and pin 3 of the DB25 connector. ( I will not go into more details,
you can get all this info elsewhere, and you probably know a lot of
it already. )

In standard instrumentation, you often use a 4-20mA current loop.
That is a swing of 16mA, and can be like a 0 - 100% scale of some
kind of sensor, actuator, or what ever. The 20mA max. current, is
a safe value in many hazardous environments. The zero value of 4mA,
is very convenient. You will always know that the devices is
connected. Any open line, will not return the 4mA.

Because of this widely used standard, they used it to transfer a
serial data stream in the same fashion. But often they just dropped
the offset of 4mA. ( you talk to the device, and if you don't get an
answer back, then you know that the wire is not connected anyway)

What you use is a constant current source. That is, if you send a
20mA signal, then the voltage will just rise to overcome any
resistance in the circuit. This could be resistance in long wires (
any length, hundreds of miles if you like ).
It is also noise immune, because most external fields that would
induce a current, will be taken care of by the loop control. It will
always keep the correct current levels, according to the value it is
suppose to represent.

In the case of TTY transmission, they made some compromises, and
didn't use much fancy circuits at all. This was so good after all,
for most applications.

Let us take a LED . We would like to attach this to a 5V supply,
just as a power on indicator. The voltage drop across the LED, (
because of PN junction, etc. ) is like 1,5 Volt. If you don't limit
the current to the levels it is designed for, you will burn it off.
So, 5V - 1,5 V = 3,5 V and on "old" LED's, the recommended current
was 20mA. So, in order to drop the voltage and current to the
recommended values: Ohm law: R=U*I, that is: 3,5V/20mA= 175
Ohm. You can do the same calculation, for any other voltages, if
you would like to attach a LED. ( the voltage and current across
the LED, varies some on different colors and makes. )

( Most of you know all this, but I included it for those who do not
)

If you set up a the communication adapter as I told you, then the
opto isolator is noting but a LED in one end, and a photo sensor
on the other side of the light path. The receiving circuit will
sense the light from this internal LED, and output the signal.

Let us wire two computers together, and let them communicate over
this current loop. I call them computer A and B.

The A computer will send data to B.
--------------------------
Internal on the adapter card, there is a resistor between the 5V
rail and pin 9 on the DB25 connector.

You wire this pin, to pin. 18 on B computer. Then another wire
from B's pin 25, and back to A's pin 11.

Internal on A, is a TTL circuit that can drive this pin 11 to
ground, via an internal resistor of 100 Ohm.
Internal on B, is a LED diode in the opto isolator.

So here is from A - 5v - 50 Ohm -(pin 9) -> your cable -> B's (pin
18) LED anode to cathode (pin 25) -> your other cable -> A's (pin
11) - through a 100 Ohm resistor - > TTL port pin.

When A's internal TTL port goes low ( ground ) a current of approx.
20 mA will go through the LED on computer B. The opto sensor on B
will read this. This LED will then transmit the data of zeroes and
ones.

An identical path can be connected on computer B, - that is two
more wires, and you have a the two devices talk to each other.

Most people don't know about this other way to use the COM1 or COM2
port, because you often have to change the mode on the adapter card
inside the computer.

-----------------------------

This 0-20mA loop, has been widely used to send G-code strings from
a tape, to a NC machine. To check if this is the case, look for any
wires connected to the above pin numbers. If you have DOS, then you
know that to set up COM1, you supply the number of bits, parity,
stop bits, together with the baud rate. So to use a computer to
send data to the machine, this has to be set up correctly. Then you
could do something like C:\ type your _G_ code _file > COM1 ,
but it could be a bit more complicated. Let us say that Computer A
is to work as your tape, then it may send G_code string, and wait
for an acknowledge code back, before it will send the next string.

Some of the others on this list, have made such programs - so in
the case you would try this, - ask for some help. But try to
identify if it is a current loop, or normal RS232. ( You could also
try to see what kind of chips the wire on your machine will go to. -
It could be a RS422 type of interface too )

The things that someone said about a parallel port, is wrong ( IMO).
There might be one, but that is to supply a print out device. ( you
can tell them apart from a male/ female DB25 - and the way it is
wired )

The little trick a said with the diode, is often used on a 4-20mA
loop. But if you followed what I said, you could use a LED on the
wire and see the communication traffic. That is, if the driving
voltage will allow it, your resistance on the wire is not to much,
maybe change the value on some resistors. But I don't think a
normal diode should do much harm. But sure, you had to cut the
wire to put it in there :-) But I thought that you would be making
the wire between a PC and your machine.

I hope this helps, - and if you have any more questions, I would
have to see some of the drawings. But I think the other guys on the
list is much better in this than I am.

Best wishes

//ARNE

Discussion Thread

Arne Chr. Jorgensen 1999-10-15 11:23:21 UTC Current loop