Inside Automation Systems
By Amir Majidimehr
As we explained in the article on the
need for automation in your
home, an automation controller is a device which receives input due
to some event occurring (e.g. hitting the pause on your remote)
and creating a set of response to it (e.g. pausing the DVD player
and turning the lights on).
In its simplest form then, an automation controller is nothing but a
specialized computer. After all, what is a computer than a device
which receives input (e.g. what you type on your computer) to something output
(e.g. going to some web page and displaying its content).
In the case of a general purpose computer, you run an operating system
such as Windows or MacOS. On top of that, you run a set of applications such as the
web browser and email. Our automation "controller" also comes with a pre-loaded
operating system (usually a customized version of Linux). So in this regard, it is very similar to
a personal computer. Where it deviates is that it
does not run an application you buy or download. But rather, companies like us
write a custom “control” program for it which gets embedded in it to
teach it how to manage the functions of your home from showing a
user interface on a touch screen, to turning your lights and
audio/video system on and off.
Let's now dive in and examine the hardware that
lives inside these opaque boxes. The best way to do that is to look
at an example such as the AMX NI-3100.
Not much to look at, right? Now you know why we install it in a rack
in a closet rather than showcasing it in your entertainment center!
Well, it turns out the "business end" is the back:
Still makes no sense to you? Well, it will once we take out the
jargon out of the specification mentioned by AMX for this
controller:
(7) Configurable RS-232 / RS-422 / RS-485 Serial Ports
A “serial port” is a type of electrical connection that is used to
communicate with other devices. The connection is called “serial”
because a single wire is used to either transmit or receive data.
Computer data tends to be in “8 bit” chunks (which we call a "byte") so to use a serial port,
that data is “serialized” or sent out one bit at a time and hence
the terminology used here.
“RS-232/RS-422/RS-485” designations are the various standards that
specify how the bits look on the wire electrically. In other
words, how you represent a "1" or "0." That in turn
determines how far the signals can travel (in feet over certain
quality cable). The details are beyond the scope of this article and
frankly rather boring. If you are curious to learn about them
anyway, you can refer to the articles in Wikipedia:
RS-232:
http://en.wikipedia.org/wiki/RS-232
RS-422:
http://en.wikipedia.org/wiki/RS-422
RS-485:
http://en.wikipedia.org/wiki/RS-485
Of the three, RS-232 is the most common but it also has the shortest
reach. The implementation in this AMX controller is quite nice in that the
same physical port can be configured to behave as any of the above
formats. Such is not the case for many devices this controller
manages. As such, the port needs to be set up correctly in the control
software to match the device being controlled. For example, LG
LCD TVs have an RS-232 port for control (see picture below) so unless the AMX
controller is instructed to use the same electrical signals, proper communication cannot
be established.
By the way, in the past your PC also had RS-232 ports but they have
long been
replaced with the much faster USB ports. That might make you think
that serial ports are yesterday’s news and not very useful but
that would be wrong. A PC needs to move a lot of data as it for
example communicates with a printer or flash memory over that USB
port. In our
situation, we only need to send a handful of bits to make something
happen such as turning on a TV or changing the light level in a
room. So even though RS-232 is much slower than USB, it is still
plenty fast for the types of things we use with it. That said,
there are poorly designed control systems where the designer did not
understand the speed limitations of this connection and as a result,
you have a system where you push a button, and you visibly see
things happen one at a time instead of all at once.
Cable length restrictions is also another reason we use slower links
like RS-232. The automation controller may sit a
hundred feet away from where your TV might be installed. USB has a maximum range of
16 feet (5 meters) so it would not work in this situation without some
kind of extra hardware to boost its range. RS-232 on the other hand
can easily reach 200 feet and if you use it at slower speeds, as far as 3000 feet! Now you see why there is such a
strong preference in the automation world for this flavor
of communication over USB connection in your PC.
That said, there are occasions where a faster interface might be
handy. For example, driving a touch panel user interface requires
that the controller output a lot of data such as pictures of buttons
and music cover art. In that scenario, the speed of the serial port
would become a serious bottleneck. For these applications, we can
use the much faster Ethernet network interface explained below.
8 Relays
A relay is an electrical switch which can be turned on or off under software
control. By connecting the output of the relay to some other device,
we can instruct it to do something when relay contacts open or
close. And example may be opening a gate when you hit a
button on your touch screen. The relay output would be
connected to the motor controller in the gate, telling it to open or
close.
As the example above shows, relays are useful when we just want to
send a "binary" message to some other device: either do something or
not. Serial ports are more sophisticated in that we can send
longer messages such as telling a TV to change is volume to 25%.
Alas, it costs more money to implement a serial port on a device so
we are stuck with a simple relay control in them.
8 IR / Serial ports
IR stands for Infrared and is the type of communication mechanism
used in most remote controls and their corresponding receiver such
as a TV or Blu-ray player.
If you look at the front of typical
remote control, you see little round domes (sometimes hidden behind
dark red glass). These are Infrared
“LEDs” which while invisible, create a beam of “light” which is modulated
(varied) to send a message to a receiving device. Think of IR as
a wireless one-way serial port (i.e. output only). In the
aforementioned LG TV example, we could have instructed it to turn on
using an IR port instead of serial same way as if you had used the
remote control for it. So if there is a button to change
channels, the control system can emulate the same function but now,
under the control of the custom software we write for it. This
allows us for example to give you a touch screen and have you hit
buttons on that to change functions of your TV.
In general IR communication tends to be less reliable than serial. The communication is one way
by nature, making it much more difficult to
know what the device is doing before telling it to do something. For example, if we don’t know if the TV is on, sending it the
“on” command again might just turn it off as the power switch is
sometimes a "toggle" meaning the same button turns things on if off,
and on if off. While there are
work-around for such limitations, it is much better to avoid
the problem if possible by utilizing a device that has serial ports.
So all else being equal, you want to buy a TV or Blu-ray player
which has a serial port rather than resorting to controlling it with
IR.
8 Digital I/O ports
“I/O” stands for Input or Output. In this context, it means a wire
connection from/to the controller. Being a single wire, an I/O port can
only transmit or receive a “binary” message of 1 or 0. Hence the use of the term
“Digital” by AMX.
Unlike serial ports where a single wire transmits entire messages,
these ports communicate simply whether something is on or off. In
output mode, this is similar to using relays as above. However,
electrically they look different and so they are not always
compatible with other devices that expect relay (“dry”) contacts.
The input mode is useful for example to receive data from simple
devices. Let’s say you have a door sensor in a closet and you like
the light in there to come on when someone opens that door and turn
off the light when it is closed. To do this we would install a
simple mechanical
switch in the door mechanism and then “watch” for it changing in the
controller (software) by connecting it to one of these input lines
on the controller. Once we see the input going from zero to one -- meaning the
door is open -- we send a command to the lighting subsystem to turn on
the closet light. When the door is closed, the value on the input
port changes back to zero and we use that to turn off the light. The
beauty of this is that it costs very little to implement. The input device is just a simple switch as
opposed to a small computer with a serial port.
(2) Communication Networks: AxLink and Ethernet (TCP/IP)
Ethernet communication is the same as what you have in your
PC. It is a high-speed serial port which is used to communicate with
other devices. The Ethernet
port usually runs at a speed of 100 Mbit/sec which is about 500 to
1000 times faster than a serial port enabling it to move large
amounts of data in less time.
Ethernet connections can be used to "talk" to other devices as long
as they sport the same connection. One example would be
connecting the AMX controller to your
lighting system using this single cable. The the two devices
can then communicate back and forth and at high speed. While serial ports can
and very often is used in this situation, Ethernet provides better
performance in certain situation where a lot of lighting data
needs to be communicated.
Yet another use is for remote diagnostic, and updating of the
control software in the system. By connecting the AMX
controller to your home network, our system designers can connect to
your system remotely and update its software. This is saves
travel time and expense. The same thing can be done using the
serial port but that would require a phone line but as you can slow
down the work substantially and require proximity and availability
of the phone line.
Processor Speed 404 MIPS
This is the speed of the microprocessor that runs the control software.
No, MIPS is not another name for Gigahertz that you might be
familiar with from your PC spec sheet. Old time computer geeks might remember this
term being an acronym for Millions of Instructions Per Second. In
reality, it doesn’t really mean that. To understand the true meaning
requires a bit of history.
A now defunct minicomputer company called Digital Equipment
Corporation (DEC) used to be the leading
provider of mid-tier computers to businesses. In 1977, DEC introduced a new machine called the VAX 780. That
machine was thought to be able to run at speed of one million instructions per
second (this was later shown to be incorrect but the history was
left written as it was).
Fast forward a few years later and a
benchmark called Dhrystone was written to measure performance of
computer systems. The benchmark outputs a number which is the number
of “Dhrystones” the computer is able to compute in the predetermined
time.
To arrive at a MIPS rating for a different computer, the same
benchmark is run and then its Dhrystone rating divided by the value produced by VAX 780.
Since the later is assumed to be “one MIPS,” then whatever that
ratio is will give you the overall MIPS rating of the computer in
question.
Putting what we just learned to practice, the microprocessor used in
this AMX controller is 404 times faster than VAX 780. Typical
VAX computer of the time costs hundreds of thousands of dollars and
was the size of multiple refrigerators. So achieving such
performance in such a tiny package (similar to a DVD player) shows
how far we have come!
But then again maybe not. Let’s translate the MIPS rating into
something we might be more familiar with: a personal computer. As of
this writing (2010) the
Intel Core i5 powering many PCs is rated at over 5500 MIPS. That is one heck of a speed
difference!
Fear not. Control software requires very little CPU horsepower to do
its job. We get an event, run through some logic and decide to take
some action. This is a fraction of code that for example your web
browser uses to display this web page. So proportionally, we need
far fewer MIPS in our application than your PC.
64 MB RAM
OK, another let down from the PC world. We have 64 Megabytes of
memory instead of 4+ Gigabytes (thousand megabyte) of memory in a
modern PC. Fortunately, our control programs are very efficient and small
so this is plenty of space to get the job done even in complex
scenarios.
256 MB Compact Flash (upgradeable to 1 G)
Normal computer memory loses its content when you turn it off (whether it is
in your PC or this controller). Flash memory as in the type
you use in your camera or USB thumb drives, retains its data even
when turned off. That is quite useful as you can store permanent
data as if you had a little hard disk.
This controller has an expandable flash memory of
256 megabytes which is plenty to hold control software and any data
it needs to store in case of power failure.
1 MB Non-Volatile Memory
This just another name for flash memory. It holds the software that
is loaded into the device from the factory and in some cases, the
control software written by your system integrator.
Summary
So there you have it. You now know more about the heart of the
automation system than most people including some who install them!
Back to Articles