Intelligent fixtures as follow spots part 2

I tried my Lego prototype today with a moving head. The results weren’t as good as I was hoping. After a bit of tweaking and jiggery pokery, managed to get the moving head to move in sync with me moving the tracking system. By ‘in sync’ I mean the same directions and speeds, but not scale yet (although it was close), and managed to use both of the handle encoders to change the dimmer of the fixture (individually and not both at the same time – that would be silly!).

Rite now there is one problem – it’s Lego. The problem is accuracy of movement to encoders and there is an error here. As you move the Lego, you have some play in the parts before the pots sense the movement, and this means it is not accurate. So until a more accurate device in the real world (out of laser cut wood, with 20bit or more AD’s) can be made, this project is on the back burner. (Plus I need to focus on my studies.)

 

For those interested in where I got to, have a look at the pictures in this post, and the code below – it is similar to the code for the simple DMX desk here.

 #include <DmxSimple.h>

// this is the code for a track pod idea and it takes 4 analogue ins to
// a number of analgue outs.

// this code channels is for a mac 250 mode 2
// 1 strobe
// 2 dim
// 3 colour
// 4 gobo
// 5 gobo rotate
// 6 focus
// 7 prism
// 8 pan
// 9 pan fine
// 10 tilt
// 11 tilt fine

// two in’s are for pan and tilt – so the 10bit will need to be translated
// to 16 bit and split up and sent on channels 8+9/10+11,
// one will be used for dim and one will be used for focus. both will need
// 10->8bit reduction.

void setup() {
DmxSimple.usePin(3);
DmxSimple.maxChannel(512);
}

void loop() {
// read the value from the sensors:
int value1 = analogRead(A1);
int value2 = analogRead(A2);
int value3 = analogRead(A3);
int value4 = analogRead(A4);

//need to change from 10bit to 8bit
value3 = value3 / 4;
value4 = value4 / 4;

//spliting the 8bit output from the 10bits.
int valuep = value1 / 4;
int valuet = value2 / 4;

//spliting the 2bit output from the 10bits.
int valuepf = (value1 – (valuep * 4)) * 64;
int valuetf = (value2 – (valuet * 4)) * 64;

//output
DmxSimple.write(2, value3);
DmxSimple.write(6, value4);

DmxSimple.write(8, valuep);
DmxSimple.write(9, valuepf);
DmxSimple.write(10, valuet);
DmxSimple.write(11, valuetf);
}