13 October 2013

Understanding the DMX Protocol and the RS-485 Relationship

I often get questions asking about DMX and how it works so I thought it might be useful  to recycle my presentation about DMX from the 2012 Academy that talks about the basics of the DMX protocol.

What can DMX do?
• DMX is simple – it is designed to control
devices, usually lights
• This may also mean just turning on and off a device
• Work with desperate devices and software applications

Where did “DMX” Come From?
• DMX was designed as a public standard to allow hardware and software vendors to all be able to
design inter-operation devices
• Designed in the early 90’s
• Developed by USITT – United States Institute for Theatre Technology
• Designed to be very reliable (but not guaranteed – no error checking)

What is DMX?
• DMX is a protocol
• DMX is a public standard
   - E1.11 (ANSI)
   - Just a set of rules
• DMX runs “over” other protocols or wiring systems

What DMX isn’t
• DMX isn’t a wiring standard
• DMX isn’t a physical “thing”
• DMX isn’t complicated
• DMX isn’t the perfect protocol

RS485 and DMX
• It is important to understand that RS485 ISN’T DMX and vice-versa
• RS485 is the most common method of DMX transmission

Here is a table that shows how DMX (E1.11) compares to other layered systems:

RS485
• RS485 is the “road” on which DMX runs
• Very robust – designed for industrial environments back in the 1970’s
• Differential signaling system (positive and negative voltages)

Here is an example of how a differential signalling system works:

RS485
• Able to handle speeds up to 35 Mbit/s depending on cabling
• Cable lengths up to several thousand feet
• Two wires + ground (optional)
• Allows for a variety of wiring topologies 
• RS485 is the basis for DMX (E1.11) , LOR, Pixelnet and Renard protocols 

RS485 Termination – Yes or no?
• PRO: Termination “dampens” the reflections of the signal in the cable
• CON: Termination “sucks up” power on the line, lowering the voltage and thus the distance
• The RS485 (DMX) specs call for termination (100-120 ohms) with standard DMX cable
LOR Controllers don’t use termination 
• No one best answer – sometimes it is  necessary…sometimes not 
• A scope is the best tool for looking at the quality of the signal
• For video showing the effects of termination: 


Splitting RS485
• Some controllers passively split the connection (LOR/LE Express) and some actively split and then repeat the signal (LE Express)
• Splitting DMX can be as simple as using 3-way splitters
• Keep “stubs” as short as possible

Connectors and Cable (E1.11)
• The E1.11 DMX standard says to use 5 PIN “XLR” plugs (there is also a section about CAT5)
• Many lighting industry devices use 3 PIN “microphone” cable with XLR plugs instead as it is more common
• The holiday lighting world uses CAT5 cable and connections almost exclusively – as they are cheap

RS485 Wiring
• Chart showing wiring interconnections:  http://www.holidaycoro.com/kb_results.asp?ID=46
• Ground wire often not connected in holiday lighting controllers

Controller Count per line
• Technical limit to the number of devices on a single DMX line is 32 but many more are 
possible depending on the line load per controller (actually the RS-485 chip).  I've personally used 90, 3 channel DMX controllers on a single RS-485 line.
• Controller counts can be increased with the use of repeaters (not common)
DMX over Ethernet (E1.31)
• No RS485 - DMX is instead sent over standard Ethernet/Wireless using TCP/IP
• Allows many universes over a single network connection
• Used when distances are far or channel counts are high
• EtherCongateway (J1SYS) / SanDevices controllers or other high-channel count pixel controllers

DMX Channels and universes
• There are 512 channels (9 bits) in a DMX universe
• One transmitter (RS-485) per universe
• One transmitter (E1.31) for many universes
• Universes are effectively unlimited
• Universes are not “connected” to another universe

DMX Protocol Internals
• DMX runs at 250Khz or 4 micro seconds widths/”slices” of time – 1 Microsecond (µs) = .001 milliseconds (ms) / 1000 ms = 1 second
• MTBP – Mark Time Between Packets (idle)
• Break – Starts with 88 µs low/ 22 pulses (get ready…I’m about to send data)
• MAB – Mark After Break ~12 µs high / 2 pulses
• Channel Data - 44 µs / 11 pulses for each channel (shown in red below)
  – Start bit– 1 bit low
  – Data bits – 8 bits (0-255 that define the level of light intensity)
  – End bits – 2 bits high
• First channel zero, has the start code of binary 00000000 (zero) 
• MTBF - Mark Time Between Frames 0-1 seconds high (the next channel is coming up)
• All 512 channels are sent one after another until the next MTBP and the process restarts

DMX Packet Timing
• Timing References
  – 1 Microsecond (µs) = .001 milliseconds (ms)
  – 1 Second = 1000ms
• [(88)+(12)+(44)+(channels*44)+(channels*MTBF)+(MTBP)] µs
• 88+12+44+22528+0+50 = 22,722 µs
• 1,000,000µs (1 second) / 22,722µs = 44.01 Hz or 44(times per 
second)
• This means that as long as your sequences contain timing no smaller than 22ms or .022 seconds, the timing of the display will be as expected

Output Adapters / Dongles
• DMX must be generated by a device
• Devices can be “Smart” or “Dumb”
  – Smart – Command is sent to device from the sequencing software (say…Channel 1 at 128 bits) once and the devices keeps repeating it 44 times/sec. This way the PC doesn't need to keep repeating it. 
  – Dumb – Commands from the sequencing software have to be re-sent over and over 44 times/sec. This puts a larger load on the PC
• Adapters/Dongles
– Smart – HolidayCoro ActiDongle, Enttec Pro, DIYLA Dongle
– Dumb – Enttec Open, generic RS-485 Adapters

Levels of Fading
• Each channel in a universe carries 8 bits of data, allowing up to 256 (FF hex) levels of fading per channel.
• 0 = Off
• 128 = Half on
• 255 = Full on
• Fading “quality” can be affected by lighting curves, linear lighting output

See the following videos for example of what this looks like:


DMX Effect Generation
• DMX Devices don’t generate any local effects, unlike the LOR protocol which generates it’s effects in the controller hardware
• Effects are generated in software
• This means that effects can be changed easily as they are created in the sequencing software

LOR Users – How get DMX
• LOR S2 Users – Upgrade to LOR S3 Advanced
• Native in LOR S3 using Enttec Open/Pro (supported by LOR) / Lynx Dongle / HolidayCoro ActiDongle
• Native in LOR S3 using Lynx Dongle
• iDMX-1000 – converts LOR protocol to DMX  (not recommended)
• Play sequences in xLights – better output support and less moving parts

Misc
• LOR Controllers can listen to LOR and DMX allowing you to run all your controllers as DMX (DIY and LOR)
• There is “to spec” and there is “it works” – this is Christmas lights after all

Resources
• DMX Standards:
– Recommended Practice for DMX512 from USITT – book, purchase only
– BSR E1.11 Standard from USITT, book, purchase only
• RS-485

No comments:

Post a Comment

We welcome all feedback