I want to create a device that will accept data from a theatrical DMX512 signal, and use it to position a motor. I would prefer to use a DC Motor with a Quadrature encoder, rather than a stepper.
I have a background with some electronics training, and have done a bit of programming in Windows, but am new to the Arduino platform. Currently, I have an Arduino UNO.
The application is to make a Tinkerbell puppet for a stage production of Peter Pan. I am thinking of putting some flashing LEDs into a ball, and hang it on cords from two motorized spools located on the upper corners of the stage opening. Then, by taking in, or letting out the cords, I can move the ball of LEDs around the stage to depict Tinkerbell flying around.
My concerns;
There seem to be a number of ways that DMX interfaces are managed on the Arduino. Some of the DMX interfaces seem to need to use interrupts, and I know that Quadrature encoders use interrupts. Also, I know the data rate for DMX is fairly high. My concern is that the processor will be so busy with the DMX, that it doesn't have time to manage the motor, which will need a PWM output pin.
I know that DMX512 will send a series of bytes, and in the original theater light dimmer concept, each of these values represents a brightness for one of the 512 dimmers. It sends out each of these values in sequence and a full set is called a frame. A controller that sends all 512 channels, will typically send full frame at around 44hz/frame. The receiver has to wait until its particular channel was sent to read the value. That also means that if a receiver is looking for a low channel, it could "bail out" and stop looking at all the other values until a new frame is sent. So, if I really need to shave off some of that processing time, by restricting my device to a lower channel value, I could cut the processing time needed to deal with an interrupt and use it for processing the quadrature encoder.
Obviously, some processor time will be needed to analyze and come up with the proper parameters to drive the DC motor.
In terms of the motor speed, I was actually thinking of making my own encoder on the motor, so that I could keep the pulse count down. If I make it only 1 pulse/rev, I can keep the pulses down to around 500hz. If that is too fast, I can put the encoder on the output shaft of the gear box, and that would be around 150hz.
Another processor saving time I can use is to ignore some of the DMX frames. I don't need to change the position at 44hz. So, I might do something like examining only one frame out of five.
Can I make use of an Arduino Uno, and accept both a DMX512 input and a quadrature encoder input, and use that to drive a DC motor?
Thanks for the advice,
-Joe