Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 38

Thread: Using Arduino to read DMX for Maestro Servo Control

  1. #11
    Join Date
    Apr 2017
    Posts
    30
    Post Thanks / Like

    Default Re: Using Arduino to read DMX for Maestro Servo Control

    Hmmm, this sounds good to me, but I'm not quite clear on how to set everything up. For the three channel idea, what kind of controller would I create in Vixen? Also, which effects would I use, and how would I tell each channel to adjust a unique part of a single message instead of an individual device? On another note, would I still need extra equipment for the DMX if all the Arduino was doing is translating it into a different protocol? Thanks again for giving me so much of your time! I really appreciate your help!

    Sent from my Moto G (4) using Tapatalk

  2. #12
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,176
    Post Thanks / Like

    Default Re: Using Arduino to read DMX for Maestro Servo Control

    Capture.PNG

    Hi, I'm not a big Vixen user so someone else will be better equipped to help you with the best way to do this.
    For each servo you need 3 channels.
    Start – this never changes and is 255 for all servos.
    Servo No. – this is the number of the servo ( servo 0 = 0, servo 12 =12) and never changes.
    Set position – this is the value you change to set the position of the servo .
    When you patch the channels to the serial output they must be in that order.
    So what you send over the serial output is this:

    Code:
    255, 0, <servo position>, 255, 1, <servo position>, 255, 2, <servo position>, 255, 3, <servo position>, 255, 4, <servo position>, 255, 5, <servo position>,
    255, 6, <servo position>, 255, 7, <servo position>, 255, 8, <servo position>, 255, 9, <servo position>, 255, 10, <servo position>, 255, 11, <servo position>,
    255, 12, <servo position>, 255, 13, <servo position>, 255, 14, <servo position>, 255, 15, <servo position>, 255, 16, <servo position>, 255, 17, <servo position>,
    Hence the two extra channels that never change. It may well be that they are better not next to each other and just patched to get the same outcome.

    DMX has two parts, the protocol basically a form of serial communication and secondly the way it is transmitted using + and – voltages. You would need something to convert to DMX at your PC and then something to convert from DMX at the Arduino. Again it’s not something I use a lot, so someone else may be better to recommend equipment. If you want to go down that route I’m happy to help with the Arduino side.
    Last edited by Barnabybear; 04-19-2017 at 11:49 AM.

  3. #13
    Join Date
    Apr 2017
    Posts
    30
    Post Thanks / Like

    Default Re: Using Arduino to read DMX for Maestro Servo Control

    Great! Thank you for this information. It helps me understand what path I need to take. I think I'll give your suggestion a try in Vixen, although I may create a new post with what you have said. Also, I'm going to create a thread on the DMX forum to pursue the hardware situation further. Thanks again for all your help, and I'll keep you posted!

    Sent from my Moto G (4) using Tapatalk

  4. #14
    Join Date
    Apr 2017
    Posts
    30
    Post Thanks / Like

    Default Re: Using Arduino to read DMX for Maestro Servo Control

    Just to update, I tried sending the code you provided over the serial output as a header, but Vixen crashed. I can't help but think that I am doing something wrong; so if you get the chance, could you please tell me how I send out this information? Thank you for your patience!
    BTW the picture helped a lot!

  5. #15
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,176
    Post Thanks / Like

    Default Re: Using Arduino to read DMX for Maestro Servo Control

    Hi, you don't need any header - just set up the channels and run the sequence with the servo board connected directly to the PC.

  6. #16
    Join Date
    Apr 2017
    Posts
    30
    Post Thanks / Like

    Default Re: Using Arduino to read DMX for Maestro Servo Control

    Ah, okay. That makes sense. I just tried pasting the code into the Maestro Control Center Software script, but I get the error message, "Error applying parameters. script:1:1: Did not understand '255'".

  7. #17
    Join Date
    Apr 2017
    Posts
    30
    Post Thanks / Like

    Default Re: Using Arduino to read DMX for Maestro Servo Control

    Just to follow up, I have attached some screenshots of what I am seeing. I don't think I quite understand how to set this up properly, and would greatly appreciate any further help you have to offer. Thank you so much!
    2017-04-21 19_43_01-Display Setup.jpg2017-04-21 19_44_38-Timed Sequence Editor - [Untitled _].jpg2017-04-21 19_45_31-.jpg2017-04-21 19_46_10-.jpg

  8. #18
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,176
    Post Thanks / Like

    Default Re: Using Arduino to read DMX for Maestro Servo Control

    Hi, not a problem. I have a few jobs to get sorted this morning before the weather takes a down turn. I'll be messing in the workshop for most of the rest of the weekend, it might be easier to have half an hour in chat later. What time zone are you?

  9. #19
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,176
    Post Thanks / Like

    Default Re: Using Arduino to read DMX for Maestro Servo Control

    Hi, I didn’t explain things very well so here is a better attempt.

    The object:
    To get Vixen to communicate with a Pololu stepper controller.

    The resources:
    Vixen 3. Will output data bytes (a number between 0 and 255) in various protocols, what we’ll refer to as generic serial is one of the options. Regardless of the type it outputs 1 byte of data for each channel setup. For our porpoises at this time there is no way to change this.

    The Pololu stepper board. This receives 3 or 4 bytes of data (dependant on the protocol) which it uses to set the position of the servo. This board also communicates in generic serial.

    The problem:
    Or though both use the same communication method they us a different number of bytes to express the same information. Whilst it is possible to connect them directly and they will understand the communication they will not know how to implement it correctly. We were able to get round this by using an Arduino as a translator. When I looked at what the Arduino was doing it became apparent it was not needed. So what did it do:
    Lets say for example Vixen outputted 150 as a ‘Vixen data value’ intended to go to servo 0. The way we know it was for servo 0 as it was the first byte of data sent, had it been for servo 1 it would have been the second byte etc. The Arduino knowing that the Pololu need 3 bytes to understand data added the 2 extra bytes before passing on the data. The first was 255 and the second was the number of the servo, followed by the data from Vixen.

    Vixen sent = 150.
    Arduino received = 150.
    Arduino sent = 255, 0, 150.
    Pololu received = 255, 0, 150.
    Servo 0 moved to position 150.

    So if we wanted to control 3 servos with the values:
    Channel 1 (Servo 0) = 150.
    Channel 2 (Servo 1) = 160.
    Channel 3 (Servo 2) = 170.

    Vixen sends = 150, 160, 170.
    Arduino receives = 150, 160, 170.
    Arduino sends = 255, 0, 150, 255, 1, 160, 255, 2, 170.
    Pololu receives = 255, 0, 150, 255, 1, 160, 255, 2, 170.
    Servos 1, 2 & 3 move to positions 150, 160 & 170.

    As you can see the data remains unchanged it is just that 255 and the servo number are added before the data. So this is where I got to thinking rather than messing about with the Arduino why don’t we get Vixen to send out two extra bytes. If we set up 3 channels in Vixen for each servo it will send out 3 bytes one for each channel. So to redo the first example:
    Channel 1 = 255.
    Channel 2 = 0.
    Channel 3 = 150.

    Vixen sends = 255, 0, 150.
    No need for the Arduino.
    Pololu receives = 255, 0, 150.
    Servo 0 moves to position 150.

    It’s a bit of a cheat but Vixen doesn’t care where the data goes or what it is used for. It just sends out what it has instructed too. By the same token The Pololu board just looks at the data it receives and if the format is correct it implements it.

    Setting up Vixen:
    As you have started doing, create 3 channels for each Servo.
    The first channel for all the servos needs to be set to a fixed value of 255 across the full duration of the sequence.
    The second channel for each servo needs to be set to a fixed value of ‘the servo number’ across the full duration of the sequence.
    This will take care of the two extra bytes that the Arduino added.
    The third channels is the one you use to set the servo position.

    The bit of stuff I posted in the code tags is not needed, it was a poor attempt to display how the data was structured and just confused things. Also I would remove the ‘!~’ Vixen serial header. It shouldn’t make any difference but safer to remove just in case.

    Setting up Vixen should be pretty basic the fun bit might be setting the serial on the Pololu board. Give it a go and if you have a problem let me know and I’ll read through the data sheet again. Hopefully I’ve explained things a little more clearly this time.
    Last edited by Barnabybear; 04-22-2017 at 08:55 AM.

  10. #20
    Join Date
    Apr 2017
    Posts
    30
    Post Thanks / Like

    Default Re: Using Arduino to read DMX for Maestro Servo Control

    Hello and thank you BarnabyBear! I live in California (Pacific time) and just read your explanation of what you want me to do. This really means a lot more sense, and I am so thankful that you have taken the time to get to the bottom of this. Unfortunately, I will be at work for most of the day, but will check back as much as I can. Also, I'm going to follow your suggestion and set this up as soon as possible. Thank you again!!

    Sent from my Moto G (4) using Tapatalk

Page 2 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •