Page 11 of 15 FirstFirst ... 910111213 ... LastLast
Results 101 to 110 of 150

Thread: Vixen Generic Serial Output controls the Arduino!

  1. #101

    Default Re: Vixen Generic Serial Output controls the Arduino!

    deleted
    Last edited by Teraphim; 06-09-2012 at 06:51 PM. Reason: posted to wrong topic (:

  2. #102

    Default Re: Vixen Generic Serial Output controls the Arduino!

    I just opened up shop for this year's Halloween display and I now have 30 separate channels with Vixen and Arduino. I'll use a 12 volt power source and some ULN2003's like last year to power about 200 small LED spotlights, singing pumpkins, candles, lanterns, and glowing eyes. All the channels are fully dimmable with the SoftPWM library for the Arduino.

  3. #103

    Default Re: Vixen Generic Serial Output controls the Arduino!

    Hi Gang,

    I'm a relative newbie to this stuff (this will be my first automated lights year), but am learning a lot fast.

    Here's my setup so far (see prototype image below):

    1) I have an Arduino 2560 Mega board, and am using pins 2 through 13 as PWM pins.

    2) These are wired to two SainSmart 8-SSR boards respectively.

    XMAS01.jpg


    I have run a test loop from Arduino to make sure the wiring is good (it is), and have a variation on Matthew's original file. The original indexing on the control loops didn't work for me and I had to add one to the serial.available loop (I have a "Beat Track" in there that needs to be skipped, that's probably why). Here is my code:

    /*
    The purpose of this code is to allow the Arduino to use the generic serial
    output of vixen lights to control 12 channels of 110VAC lighting.

    This is an adaptation from code originally written by Matthew Strange.

    Created: 5 November 2012

    */

    #define CHANNELS 12

    // Output
    int Chan1 = 13; // PWM Pin 13.
    int Chan2 = 12; // PWM Pin 12.
    int Chan3 = 11; // PWM Pin 11.
    int Chan4 = 10; // PWM Pin 10.
    int Chan5 = 9; // PWM Pin 9.
    int Chan6 = 8; // PWM Pin 8.
    int Chan7 = 7; // PWM Pin 7.
    int Chan8 = 6; // PWM Pin 6.
    int Chan9 = 5; // PWM Pin 5.
    int Chan10 = 4; // PWM Pin 4.
    int Chan11 = 3; // PWM Pin 3.
    int Chan12 = 2; // PWM Pin 2.

    int i = 0; // Loop counter
    int incomingByte[16]; // array to store the values from the serial port

    //setup the pins/ inputs & outputs
    void setup()
    {
    Serial.begin(57600); // set up Serial at 57600 bps

    pinMode(Chan1, OUTPUT); // sets the pins as output
    pinMode(Chan2, OUTPUT);
    pinMode(Chan3, OUTPUT);
    pinMode(Chan4, OUTPUT);
    pinMode(Chan5, OUTPUT);
    pinMode(Chan6, OUTPUT);
    pinMode(Chan7, OUTPUT);
    pinMode(Chan8, OUTPUT);
    pinMode(Chan9, OUTPUT);
    pinMode(Chan10, OUTPUT);
    pinMode(Chan11, OUTPUT);
    pinMode(Chan12, OUTPUT);

    analogWrite(Chan1, 0);
    analogWrite(Chan2, 0);
    analogWrite(Chan3, 0);
    analogWrite(Chan4, 0);
    analogWrite(Chan5, 0);
    analogWrite(Chan6, 0);
    analogWrite(Chan7, 0);
    analogWrite(Chan8, 0);
    analogWrite(Chan9, 0);
    analogWrite(Chan10, 0);
    analogWrite(Chan11, 0);
    analogWrite(Chan12, 0);

    //test();

    }

    // Quick test loop to cycle through the pins and make sure all
    // are properly connected and working.
    void test()
    {
    delay(1000);

    analogWrite(Chan1, 255);

    delay(1000);

    analogWrite(Chan2, 255);
    analogWrite(Chan1, 0);

    delay(1000);

    analogWrite(Chan3, 255);
    analogWrite(Chan2, 0);

    delay(1000);

    analogWrite(Chan4, 255);
    analogWrite(Chan3, 0);

    delay(1000);

    analogWrite(Chan5, 255);
    analogWrite(Chan4, 0);

    delay(1000);

    analogWrite(Chan6, 255);
    analogWrite(Chan5, 0);

    delay(1000);

    analogWrite(Chan7, 255);
    analogWrite(Chan6, 0);

    delay(1000);

    analogWrite(Chan8, 255);
    analogWrite(Chan7, 0);

    delay(1000);

    analogWrite(Chan9, 255);
    analogWrite(Chan8, 0);

    delay(1000);

    analogWrite(Chan10, 255);
    analogWrite(Chan9, 0);

    delay(1000);

    analogWrite(Chan11, 255);
    analogWrite(Chan10, 0);

    delay(1000);

    analogWrite(Chan12, 255);
    analogWrite(Chan11, 0);

    delay(1000);

    analogWrite(Chan12, 0);
    }

    void loop()
    { // Channels are coming in to the Arduino
    if (Serial.available() >= 13) {
    // read the oldest byte in the serial buffer:
    for (int i=0; i<13; i++) {
    // read each byte
    incomingByte[i] = Serial.read();
    }

    analogWrite(Chan1, incomingByte[0]); // Write current values to LED pins
    analogWrite(Chan2, incomingByte[1]); // Write current values to LED pins
    analogWrite(Chan3, incomingByte[2]); // Write current values to LED pins
    analogWrite(Chan4, incomingByte[3]); // Write current values to LED pins
    analogWrite(Chan5, incomingByte[4]); // Write current values to LED pins
    analogWrite(Chan6, incomingByte[5]); // Write current values to LED pins
    analogWrite(Chan7, incomingByte[6]); // Write current values to LED pins
    analogWrite(Chan8, incomingByte[7]); // Write current values to LED pins
    analogWrite(Chan9, incomingByte[8]); // Write current values to LED pins
    analogWrite(Chan10, incomingByte[9]); // Write current values to LED pins
    analogWrite(Chan11, incomingByte[10]); // Write current values to LED pins
    analogWrite(Chan12, incomingByte[11]); // Write current values to LED pins
    }
    }


    And here's the config in Vixen. I have the following profile setup in Vixen. I have switched the order of the items in the list (moved "SHRUBS" from near the bottom to the top, added "STROBES"). Here's the profile:

    XMAS02.jpg


    ...and my beginning sequence looks like this (just a simple track light-up to test and make sure the output is working):

    XMAS03.jpg


    Ok, that said, the results are such that:

    1) All channels light fine when I run my test loop (that you can find in the code above).
    2) When I run the test loop through Vixen, it is acting like the "indexing" of the channels is off. When it starts on channel 1 (SHRUBS), the 10th channel on the SSR board lights (pin 4 on the Arduino). Then it misses, and then cycles through the rest of the channels like it should, but 3 pins "shifted" to the right.
    3) It is not "totally out of whack" like it would be when there's a total byte misalignment (like trying to pull 10 bytes at a time from a 13-channel serial stream).


    A couple of questions:

    1) When I changed the order of the channels in the Vixen Profile, does it change the sequence in the Serial output as well?
    2) Is there an outbound serial analyzer add-in for Vixen or something similar I could actually examine the hex/binary stream with?
    3) Anyone with other suggestions, please chime in.

    Thanks in advance for any help.

    -S

  4. #104
    Join Date
    Jul 2011
    Location
    Noblesville, IN
    Posts
    156

    Default Re: Vixen Generic Serial Output controls the Arduino!

    Vixen is sending that 13th channel with all the others, so your arduino is getting out of sync. Try diabling that channel.
    Andersonville Cemetery

    2011 Halloween -- 18 Channels - 6 channels Mr. Christmas, 12 channels Arduino, all On/Off unfortunately...
    2012 Halloween -- nuthin. Everything went to hell in a handbasket :-P
    2013 Halloween -- *crosses fingers*

  5. #105

    Default Re: Vixen Generic Serial Output controls the Arduino!

    Hi, apologies if this is hijacking but I was wondering if Vixen and this setup would work with an arduino UNO r3 > 2x tlc5490 > 32mosfets for 32 channels full PWM control? I'd love to be able to use lighting sequencers for my lil DIY controller.

  6. #106
    Join Date
    Sep 2010
    Location
    Folsom, Ca
    Posts
    43

    Default Re: Vixen Generic Serial Output controls the Arduino!

    Quote Originally Posted by archades View Post
    Hi, apologies if this is hijacking but I was wondering if Vixen and this setup would work with an arduino UNO r3 > 2x tlc5490 > 32mosfets for 32 channels full PWM control? I'd love to be able to use lighting sequencers for my lil DIY controller.
    I have not had much luck using my Duemilanove (also 16MHz) with AC PWM. I get to about 4 channels and then the processor can't keep up. If you're doing DC it wouldn't be a problem. Not saying it can't be done. Maybe if the code could use DMA. If that is supported. I switched to the leaflabs maple which is an arduino clone and much faster, it handles AC PWM easy and I had it running around 50 channels. I'm waiting to get the Arduino Due which is fast enough also.

  7. #107

    Default Re: Vixen Generic Serial Output controls the Arduino!

    Ah ok, I have some ws2803's coming which I've heard takes the load off the arduino, do you think that would work better?

  8. #108
    Join Date
    Sep 2010
    Location
    Folsom, Ca
    Posts
    43

    Default Re: Vixen Generic Serial Output controls the Arduino!

    Quote Originally Posted by archades View Post
    Ah ok, I have some ws2803's coming which I've heard takes the load off the Arduino, do you think that would work better?
    Really it is the PWM code portion that is slowing it down. The more AC channels you add the more calculations the Arduino must perform and the slower the refresh becomes.

  9. #109

    Default Re: Vixen Generic Serial Output controls the Arduino!

    Ah, this is for 12v DC not 240v ac lights. I'm guessing DC requires far less processing power? Would it be enough for that many channels switch DC 12v?
    Last edited by archades; 12-07-2012 at 07:53 PM.

  10. #110

    Default Re: Vixen Generic Serial Output controls the Arduino!

    I had 32 channels running with ULN 2003's and my Arduino Mega with a 12V power supply and had no problems. I could forsee having many more channels.

Page 11 of 15 FirstFirst ... 910111213 ... 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
  •