Tuesday, April 25, 2017
Home » Flowstone Workshop » Flowstone Workshop 13

Flowstone Workshop 13

Flowstone-HeaderDMX Robotic Disco Light Protocol

FLOWSTONE WORKSHOP 13-1
DMX Robotic Disco Light Protocol

Welcome to the FlowStone Workshop number 13, where we give a beginners guide to computer programming using the FlowStone graphical programming language inside FlowBotics Studio. In this issue we are going to look at the DMX512 disco and stage lighting protocol used to control lights, smoke machines, robotic lights, motors and lasers. DMX is widely available; just about every disco light has a DMX port on the back but unfortunately it appears that DMX is often misunderstood and over complicated when in reality it’s quite simple when using FlowStone.

EXAMPLES OF DMX HARDWARE 

Transmitter & Receiver:

A DMX system comprises of a single transmitter and up to 512 receivers, traditionally the transmitter would be a lighting control desk something like this:

And the receivers would be the lights or other hardware devices. For our application we want to program the DMX data from the PC using FlowStone so we don’t need a DMX controller but a USB DMX interface instead.

Here are a few examples of USB DMX Controllers:

FLOWSTONE WORKSHOP 13-2
Eurolite TMH-6 DMX LED moving head.
FLOWSTONE WORKSHOP 13-5
Gismo—Dual Rotating LED Stage Lighting
FLOWSTONE WORKSHOP 13-4
Crystal Ball LED Stage Lighting.

Transmitter & Receiver: 

A DMX system comprises of a single transmitter and up to 512 receivers, traditionally the transmitter would be a lighting control desk something like this:

FLOWSTONE WORKSHOP 13-3
Traditional DMX Controller.

And the receivers would be the lights or other hardware devices. For our application we want to program the DMX data from the PC using FlowStone so we don’t need a DMX controller but a USB DMX interface instead.

Here are a few examples of USB DMX Controllers:

FLOWSTONE WORKSHOP 13-6
EntTec – Open DMX, Bitbang – DMX512A USB DMX, Robot Electronics – USB-RS485.

These low cost USB interfaces all use the same FTDI FT232R USB chip that converts the USB data into the DMX data. Connection to the hardware is usually via a 3-pin XLR type connector (XLR Mic Lead) or sometimes a 5-pin XLR is used.

THE TECHIE BIT 

Here’s the lowdown for those that are interested. DMX is the protocol and it is sent via RS485 which is the electrical specification (not the protocol as often thought). DMX is a serial protocol that runs at 250Kb/s and uses 1 start bit, 8 data bits (0-255 or 0x00-0xFF), and 2 stop bits. Up to 512 bytes of information are sent after each other and the start of the sequence is initiated by a ‘Break’ (typ. 88us) and then a ‘Mark After Break’ (MAB ~12us) then the 512 packets of DMX data. So here are the basics of the protocol: DMX Data = BREAK, MAB, Data0 , Data1, Data2 …Data 511, BREAK, MAB, Data0 , Data1 etc.

FLOWSTONE WORKSHOP 13-8
DMX signal on the scope.

Since DMX uses the RS485 balanced electrical system it is relatively immune to electrical noise and can go for a reasonable distance (100yds or more), if longer distances are required repeaters and splitters can be used also a terminator is required for long runs. The final part of the puzzle is that the DMX standard stipulates that the data is sent repeatedly 44 times a second. DMX is a fire and forget protocol with no error checking.

INSIDE FLOWSTONE 

FlowStone now has a DMX controller module built in so you can just use it to send data to your DMX devices via USB. The data is made up of a Hexadecimal string of up to 512 bytes, Byte 0 is reserved and usually set to zero. So a typical string would look like this: 00550000 etc. in this case byte 1 is set to 0x55.

Here is a FlowStone example with three sliders to control the first three DMX channels:

FLOWSTONE WORKSHOP 13-9
3ch DMX controller in FlowStone.

If you want to control more than one DMX device then you will need to set the DMX base address on the hardware device. This is simply the offset where your device will sit in the 512 channels. For example if Disco Light 1 uses 4 DMX channels, set Disco light 2 to start as address 5. This is typically set using a DIP switch on the device or a software menu.

FLOWSTONE WORKSHOP 13-11

FLOWSTONE WORKSHOP 13-10
DIP switch set to base address 1 (First device).Up : Device Menu set to address 5 (Second Device).

In our FlowStone example we simply send the DMX data string to the USB interface 25 times a second and the DMX module will do the rest for you. Now we are ready to add some functionally to our DMX control system in FlowStone, clearly we could make our own DMX control centre software similar to the traditional DMX hardware controller but we have so much more available since we now have software control.

Here’s an example of a MIDI controlled DMX system: 

FLOWSTONE WORKSHOP 13-12
Midi to DMX controller in FlowStone.
FLOWSTONE WORKSHOP 13-13
Midi Keyboard used to control stage lights.

In this case the DMX channels for my disco light are : 0 = reserved, 1 = Red, 2 = Green, 3 = Blue, 4 = Pattern Select, 5 = Pattern Speed. So decoding the notes from a velocity sensitive midi keyboard you can use the note number to select the light pattern and how hard you press the key to determine the pattern speed. The note number, e.g., 83 is scaled so that it falls in the range 0-255. We do the same for the Note On velocity – this also needs scaling so it’s between 0 and 255.

This would make a neat system for the fifth member of a band to actually play the stage lights from a midi piano keyboard on stage, while the crowd thinks it’s really a musician! (5 piece bands usually get paid more!)

CONCLUSION 

The possibilities are endless once you have access to control DMX via FlowStone and a PC. You could connect some Phidgets boards with sensors and control robotic stage lights by body movement using accelerometers or hook up a webcam using motion detection to control the lighting effects. We have also seen people use DMX to control home automation systems including even a swimming pool cover

Links 
BitBang, bitbang.co.uk
DSPRobotics, 
dsprobotcs.com
EntTec, enttec.com
FlowBotics Studio, flowbotics.com
Robot Electronic, robot-electronics.co.uk
RobotShop, RobotShop.com

Leave a Reply

Your email address will not be published. Required fields are marked *