Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: E1.31 Servo Controller

  1. #1
    Join Date
    Oct 2009
    Location
    Vancouver BC
    Posts
    54
    Post Thanks / Like

    Default E1.31 Servo Controller

    Has anyone seen any projects or code related to driving rc servos via E1.31?
    I know of DMX based ones but hoping something exists in E1.31 (either wired or wireless)

    Thanks,

  2. #2
    Join Date
    Dec 2011
    Posts
    6,978
    Post Thanks / Like

    Default Re: E1.31 Servo Controller

    Hi packetbob

    I have toyed with the esp8266 and various motors in the past 9 months or so and believe I posted code .

  3. #3
    Join Date
    Dec 2012
    Location
    Framingham, MA
    Posts
    525
    Post Thanks / Like

    Default Re: E1.31 Servo Controller

    Any Raspberry pi or Beaglebone can be used along with the cheap PCA9685 based PWM boards, like: https://smile.amazon.com/gp/product/B07Z8R2YB9

    FPP 3.6 has an output driver for that built in. Can drive a ton of servos off of one Pi/BBB, and drive lights and such at the same time.
    Dan Kulp

  4. #4
    Join Date
    Dec 2011
    Posts
    6,978
    Post Thanks / Like

    Default Re: E1.31 Servo Controller

    is FPP an e131 receiver ? Built-in always sounds good .

    What is entailed in learning this ?
    Does this require learning the new xlights ?
    Curious at what is all needed .

  5. #5
    Join Date
    Dec 2012
    Location
    Framingham, MA
    Posts
    525
    Post Thanks / Like

    Default Re: E1.31 Servo Controller

    FPP running in bridge mode can act as a e1.31 (and/or ArtNet and/or DDP) receiver. Basically, configure a universe or so on the "Channel Inputs" page in FPP and put FPP in bridge mode and it will listen for e1.31 data.

    For the PCA9685 stuff, you would need to wire the little board to the I2C bus (pins 3 and 5) on the Pi (and ground which is pin 6 and 3.3v which is pin 1). Then, on FPP's channel output page, go to the "Others" and click "add" and select the PCA9685 option. If you have multiple boards, you can add more there. For each output on the board, configure the start channel and min/max and such.

    You don't "need" to learn xLights to play with this. It's just channel data. You can use anything to send a set of e1.31 channels to FPP and it will map that to the PWM needed for the servos.
    Dan Kulp

  6. #6
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,519
    Post Thanks / Like

    Default Re: E1.31 Servo Controller

    Quote Originally Posted by dkulp View Post
    FPP running in bridge mode can act as a e1.31 (and/or ArtNet and/or DDP) receiver. Basically, configure a universe or so on the "Channel Inputs" page in FPP and put FPP in bridge mode and it will listen for e1.31 data.

    For the PCA9685 stuff, you would need to wire the little board to the I2C bus (pins 3 and 5) on the Pi (and ground which is pin 6 and 3.3v which is pin 1). Then, on FPP's channel output page, go to the "Others" and click "add" and select the PCA9685 option. If you have multiple boards, you can add more there. For each output on the board, configure the start channel and min/max and such.

    You don't "need" to learn xLights to play with this. It's just channel data. You can use anything to send a set of e1.31 channels to FPP and it will map that to the PWM needed for the servos.
    Hi Dan, a cool development that I’ve missed. You have to love the PCA9685, are there options other than servos for this board? I’m thinking dumb pixels/strips if FET’s are also used. This is not a request just wondering if it’s something you coded that again I’ve missed.

  7. #7
    Join Date
    Dec 2012
    Location
    Framingham, MA
    Posts
    525
    Post Thanks / Like

    Default Re: E1.31 Servo Controller

    Technically it's just a 12bit PWM chip. Thus, you should be able to use it to drive dumb RGB's or similar. The defaults on the outputs for FPP are setup for servos, but the settings are all there to treat it as a plain PWM driver.
    Dan Kulp

  8. #8
    Join Date
    Oct 2009
    Location
    Vancouver BC
    Posts
    54
    Post Thanks / Like

    Default Re: E1.31 Servo Controller

    Hi Dan,
    Thanks for the info..
    I have a PCA9685 module and a Rasp Pi kicking around somewhere...
    Time to load up FPP...

  9. #9
    Join Date
    Dec 2011
    Posts
    6,978
    Post Thanks / Like

    Default Re: E1.31 Servo Controller

    Quote Originally Posted by dkulp View Post
    FPP running in bridge mode can act as a e1.31 (and/or ArtNet and/or DDP) receiver. Basically, configure a universe or so on the "Channel Inputs" page in FPP and put FPP in bridge mode and it will listen for e1.31 data.

    For the PCA9685 stuff, you would need to wire the little board to the I2C bus (pins 3 and 5) on the Pi (and ground which is pin 6 and 3.3v which is pin 1). Then, on FPP's channel output page, go to the "Others" and click "add" and select the PCA9685 option. If you have multiple boards, you can add more there. For each output on the board, configure the start channel and min/max and such.

    You don't "need" to learn xLights to play with this. It's just channel data. You can use anything to send a set of e1.31 channels to FPP and it will map that to the PWM needed for the servos.
    Thank you for this explanation . I'll have to read more on it .

  10. #10
    Join Date
    Sep 2016
    Posts
    22
    Post Thanks / Like

    Default Re: E1.31 Servo Controller

    I played around with some scripting last year to get a Wemos D1 to output I think 6 servo outputs. I used it to control my 3D talking skull worked perfect. I am not a programmer and I never cleaned up the code from when I was collaborating and learning with Darren, but here it is.

    Code:
    // Wemos D1 Mini E1.31 - 6 channel Servo Controller - Tomms first test
    
    #include <ESP8266WiFi.h>
    #include <E131.h> // Copyright (c) 2015 Shelby Merrick http://www.forkineye.com
    #include <Servo.h> 
    
    Servo ch_1_red_Nodd;
    Servo ch_1_green_Tilt;
    Servo ch_1_blue_Turn;
    Servo ch_2_red_Jaw;
    Servo ch_2_green_eyehor;
    Servo ch_2_blue_eyever;
    
    // ***** USER SETUP STUFF *****
    const char ssid[] = "ENTER SSID HERE";  // replace with your SSID.
    const char passphrase[] = "PASSWORD HERE"; // replace with your PASSWORD.
    const int universe = 8; // this sets the universe number you are using.
    
    // this sets the Universe channel number used by the output.
    const int ch_1_red = 0; // the channel number to link to output 1 red.
    const int ch_1_green = 1; // the channel number to link to output 1 green.
    const int ch_1_blue = 2; // the channel number to link to output 1 blue.
    const int ch_2_red = 3; // the channel number to link to output 2 red.
    const int ch_2_green = 4; // the channel number to link to output 2 green.
    const int ch_2_blue = 5; // the channel number to link to output 2 blue.
    
    // this sets the pin numbers to use as outputs.  **FROM OLD RGB CODE**  DO WE USE OR DELETE??
    //const int output_1_red = 4; // the pin to use as output 1 red (D2).
    //const int output_1_green = 5; // the pin to use as output 1 green (D1).
    //const int output_1_blue = 12; // the pin to use as output 1 blue (D6).
    //const int output_2_red = 13; // the pin to use as output 1 red (D7).
    //const int output_2_green = 14; // the pin to use as output 1 green (D5).
    //const int output_2_blue = 15; // the pin to use as output 1 blue (D8).
    
    
    E131 e131;
    
    void setup() {
      Serial.begin(115200);
      ch_1_red_Nodd.attach(4); // D2
      ch_1_green_Tilt.attach(5); // D1
      ch_1_blue_Turn.attach(12); // D6
      ch_2_red_Jaw.attach(13); // D7
      ch_2_green_eyehor.attach(14); // D5
      ch_2_blue_eyever.attach(15); // D8
    
      // set the pins chosen above as outputs. **OLD CODE**
      //pinMode(output_1_red, OUTPUT);
     // pinMode(output_1_green, OUTPUT);
     // pinMode(output_1_blue, OUTPUT);
     // pinMode(output_2_red, OUTPUT);
      //pinMode(output_2_green, OUTPUT);
     // pinMode(output_2_blue, OUTPUT);
    
      // set the servos to Mid point 
      ch_1_red_Nodd.write(90);
      ch_1_green_Tilt.write(90);
      ch_1_blue_Turn.write(90);
      ch_2_red_Jaw.write(90);
      ch_2_green_eyehor.write(90);
      ch_2_blue_eyever.write(90);
    
      /* Choose one to begin listening for E1.31 data */
     //e131.begin(ssid, passphrase);               /* via Unicast on the default port */
       e131.beginMulticast(ssid, passphrase, universe); /* via Multicast for Universe 1 */
    }
    
    void loop() {
      /* Parse a packet */
      uint16_t num_channels = e131.parsePacket();
    
      /* Process channel data if we have it */
      if (num_channels) {
      Serial.println("we have data");
    
        Serial.println(e131.data[ch_1_red -1]);
        Serial.println(e131.data[ch_1_green -1]);
        Serial.println(e131.data[ch_1_blue -1]);
        Serial.println(e131.data[ch_2_red -1]);    
        Serial.println(e131.data[ch_2_green -1]);
        Serial.println(e131.data[ch_2_blue -1]);
      
      // set the outputs to the data value. **OLD CODE FOR DUMB RGB**  
      //analogWrite(output_1_red, (e131.data[channel_1_red -1] *4));
      //analogWrite(output_1_green, (e131.data[channel_1_green -1] *4));
      //analogWrite(output_1_blue, (e131.data[channel_1_blue -1] *4));
     // analogWrite(output_2_red, (e131.data[channel_2_red -1] *4));
      //analogWrite(output_2_green, (e131.data[channel_2_green -1] *4));
     // analogWrite(output_2_blue, (e131.data[channel_2_blue -1] *4));
    
    
      // Set output to servo **NEW CODE** will this work???
      
    
      if ((e131.data[ch_1_red] >= 0) or (e131.data[ch_1_red] <= 180)) {
      if (e131.data[ch_1_red] == 0 ) {
       ch_1_red_Nodd.write(90);
       }
       else {
         ch_1_red_Nodd.write(e131.data[ch_1_red]);
     // Serial.println("Nodd");
      }
      };
      if ((e131.data[ch_1_green] >= 0) or (e131.data[ch_1_green] <= 180)) {
      if (e131.data[ch_1_green] == 0 ) {
       ch_1_green_Tilt.write(90);
       }
       else {
         ch_1_green_Tilt.write(e131.data[ch_1_green]);
     // Serial.println("Tilt");
      }
      };
      if ((e131.data[ch_1_blue] >= 0) or (e131.data[ch_1_blue] <= 180)) {
      if (e131.data[ch_1_blue] == 0 ) {
       ch_1_blue_Turn.write(90);
       }
       else {
         ch_1_blue_Turn.write(e131.data[ch_1_blue]);
     // Serial.println("Turn");
      }
      };
      if ((e131.data[ch_2_red] >= 0) or (e131.data[ch_2_red] <= 180)) {
      if (e131.data[ch_2_red] == 0 ) {
       ch_2_red_Jaw.write(90);
       }
       else {
         ch_2_red_Jaw.write(e131.data[ch_2_red]);
     // Serial.println("Jaw");
      }
      };
      if ((e131.data[ch_2_green] >= 0) or (e131.data[ch_2_green] <= 180)) {
      if (e131.data[ch_2_green] == 0 ) {
       ch_2_green_eyehor.write(90);
       }
       else {
         ch_2_green_eyehor.write(e131.data[ch_2_green]);
     // Serial.println("Eyehor");
      }
      };
    if ((e131.data[ch_2_blue] >= 0) or (e131.data[ch_2_blue] <= 180)) {
      if (e131.data[ch_2_blue] == 0 ) {
       ch_2_blue_eyever.write(90);
       }
       else {
         ch_2_blue_eyever.write(e131.data[ch_2_blue]);
     // Serial.println("Eyever");
      }
      };
    
     // *****  Repeat for each channel if this is correct******
    
    
    
      }
    }

Page 1 of 2 12 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
  •