What is DMX?
DMX is a digital control protocol used by the entertainment industry to control lighting. DMX can be used to control dimmer channels, intelligent lighting and lots of other things besides, such as smoke machines, strobes, and so on.
Why was DMX invented?
In the beginning there were just dimmers. In the early days these were large wirewound resistors (in the even earlier days, pots of salty water). These were a little cumbersome and large scale scene changes and blackouts required a herculean effort (often involving a broom handle over all the knobs). To keep the wiring economical, the dimmers were usually located at the side of the stage.
In the 1960’s, electronic dimmers became available. Suddenly there was the possibility to have the lighting control console at the rear of the audience where the operator could see what was happening. Each dimmer was controlled by a low voltage control signal (usually +10V or -10V meaning “full on” and 0V meaning “off”), which meant that even a six channel dimmer required a minimum of 7 cables between the control desk and the dimmer, often 8 (control cables 1-6, ground and power). A large dimmer installation in a theatre would require many cores to operate all the channels, worse still any touring production would have to carry a costly multicore around. This type of system is now referred to as analogue control.
A few manufacturers produced systems that could send multiple analogue control voltages down a single cable, such as Strand’s D54 and the AMX512 system, but these suffered from their own problems with interference and cable length.
When digital electronics became affordable, various digital control systems began to be invented. In 1986 USITT (U.S. Institute of Theatre Technology) developed a protocol principally for dimmer control, with a view to generating a standard protocol. As more manufacturers began to adopt it the standard was formalised as DMX512(1990). Those with their own protocols also began to switch over to DMX, though sometimes producing equipment with both standards.
So how does it work?
Rather than sending a continuous control value down several bits of cable, one for each channel, like an analogue control system, the DMX transmitter chops up the information, sending the value of each control channel down one piece of cable one after another as serial digital data. So it will send a value for channel 1 at 50%, then channel 2 at 75%, then channel 3 at 7% and so on, when it has reached the highest channel to be transmitted it starts again at channel 1. This is called multiplexing, which is where DMX gets its name (Digital MultipleXing).
What is actually transmitted?
DMX is a digital serial protocol using a transmission speed of 250kBaud (250,000 bits per second).
Before any information is sent the transmitter sends a timed pulse of “zero” level, which is called the break time. This tells all of the equipment listening that information is about to be transmitted. It has to be longer than 92 microseconds.
Next, a single byte (8 bit code) is sent called the “start code”. This tells the receivers what sort of data is being sent. Normally it is zero meaning “channel level information”. At 250kBaud this takes 40 microseconds.
Finally, all of the channel information is sent one channel at a time, up to a maximum of 512 channels, (which is why DMX is often referred to as DMX 512). Each ‘channel’ is an 8 bit byte (10 bits including a start and stop bit). A controller may not necessarily send out all 512 channels.
Then the whole process starts all over again. If transmitting the full 512 channels, the maximum refresh rate is 44Hz.
How does the equipment know how to respond?
So that each piece of equipment knows which of the 512 channels to respond to, it is given an ‘address’. This is basically a channel number. So if we wanted to control a piece of equipment using channel 13 of the desk then we would set the address of the piece of equipment to 13.
All the equipment then has to do is look for the break time, look at the startcode, and then count through the channel information until is receives channel 13, which might be say a value of 127, which would be decoded as 50%.
Does each piece of equipment receive just one channel?
No, a piece of equipment can receive as many channels as it likes. A 6 channel dimmer pack, for instance, would require 6 channels of information. So if we set the address at 13 as in the previous example, the dimmer would see the six channels from 13 onwards, i.e. 13-18. This would result in the following situation.
Control Channel 13 = Dimmer Channel 1 |
Control Channel 14 = Dimmer Channel 2 |
Control Channel 15 = Dimmer Channel 3 |
Control Channel 16 = Dimmer Channel 4 |
Control Channel 17 = Dimmer Channel 5 |
Control Channel 18 = Dimmer Channel 6 |
The next dimmer’s address could be set to start at channel 19 (this is why the Address is sometimes referred to as the Start Address).
Some intelligent lighting can require many control channels to control different aspects such as colour, position, focus etc. Pixel-based fixtures often require a red, green and blue channel for each pixel. This can mean that the maximum of 512 control channels is rapidly exceeded. In the case of larger lighting desks, four, sixteen or even more DMX outputs are available each giving 512 channels. Each output chain is referred to as a DMX Universe.
Because of the large number of DMX channels often needed, various ethernet-based control systems have been developed. The most common of these are sACN and ArtNet. These can send multiple universes of DMX over a single network cable. Most lighting consoles can directly output sACN and ArtNet. At the other end, there would normally be a decoder (usually called a “Node”) which splits the ethernet protocol back into “normal” DMX. However some fixtures can directly receive the ArtNet or sACN.
How do you transmit it?
- It uses the electrical standard RS485. This is a three wire differential voltage system – a logical “1” has line A at 5V and line B at 0V, and a logical “0” has line A at 0V and line B at 5V. A third ground reference wire is needed. (Actually only 0.2V difference is required between A and B). This system is extremely robust and can survive various fault situations.
- The DMX line should be terminated with a 120 ohm resistor across the A and B lines at the last fixture (in real life this is often not fitted and everything still works fine).
- Transmit a break time, which is a logical “0” lasting for 88 microseconds. On a microcontroller you can usually do this by temporarily setting the baud rate to 96KBaud, then transmit a “0” byte.
- Then transmit a startcode of “0” (returning the baud rate to 250KBaud).
- Then transmit up to 512 8-bit channel level bytes.
How do you receive it?
- Wait for a break time. A quick and dirty way to do this is to set the UART to receive 9 bits at 250Kbaud, then check if the 9th bit is zero (and the other 8 bits are also zero). If so, it is probably a breaktime. (To be sure you aren’t receiving rubbish, some other checks are advisable)
- Receive the next byte – this is the start code and should be zero. If not, the data should be ignored until the next break time comes along.
- Count each received channel level byte until you get to the start address you are looking for. (eg for channel 8, count 7 bytes then start receiving with the 8th)
- Receive and store the next channel bytes until you have got as many as you are interested in.
- Wait for another breaktime.
What problems need to be avoided?
DMX will often continue to work with one of the A or B legs disconnected, if the 120 ohm termination is not fitted. If you get a situation where the system works without a terminator but not with a terminator, chances are there’s a break in one of the lines somewhere.
DMX devices are fairly resistant to “bad” things being connected. However, some DMX connectors are similar to audio – you can guess what happens next. Also if there is a mains fault to earth (the fault may not necessarily be in any of the DMX equipment), the fault current can flow down the DMX cabling damaging the fixtures.