Traffic lights
"Only three lamps – easy!"
I always thought a traffic light was three bulbs. In reality a
modern traffic light is a complex piece of software engineering.
The individual lights have software to control the sequencing of
its light signals, the story doesn’t end there. Separate signals
at a junction need to operate in a co-ordinated fashion, this bit
is obvious. There is no point in your light going green at the same
time as the crossing traffic’s light goes green.
The clever bit is when nearby junctions operate in harmony. This
is achieved by the traffic signals communicating. This communication
can be at a local level or at a city level.
The job we were asked to do was to allow the traffic lights
to be reprogrammed without engineers having to visit every
signal. On the basis that all the signals were chatting away to
a central control centre, then why couldn’t the central control
centre reprogram the signals when the telephone line wasn’t busy.
Well it could.
The real problem was that the traffic lights chatted to the central
computer every second or so. Also we couldn’t switch everything
off for half an hour whilst the data was transmitted.
So the solution was to transmit small packets of information to
each traffic signal during the small period each second when it
wasn’t talking to the control centre with traffic information. This
operation being enacted for dozens of signals at the same time
.
This involved calculating the unused time each second, calculating
the actually achieved transmission speed over the telephone line
and then working out how many bytes of program could be transmitted
in any second. The bad news is that traffic signals are connected
with very cheap, very slow telephone lines (200 baud), a modern
modem runs at 56000 baud, nearly 300 times faster.
It was done using a PC. The PC did not run DOS or Windows as this
was too slow. A special purpose (very fast) operating system
was written that allowed the flexibility we needed. In
addition some special hardware was developed that allowed the PC
to talk to many telephone lines in quick succession.
This was completed successfully and operated well within the agreed
specification.
|