Welcome, %1$s. Please login or register. - Did you miss your activation email?

Login with username, password and session length
 

Author Topic: TOS E Warp Engine Lighting Effect - Custom Solution  (Read 1907 times)

Offline RossW

  • Commander
  • ***
  • Posts: 249
TOS E Warp Engine Lighting Effect - Custom Solution
« on: September 16, 2017, 02:59:30 pm »
Almost 5 years in the making, here's my TOS E warp engine lighting solution available to all who are willing to put it together themselves. I'm providing the Arduino code (thanks Gadgetron_3000 for your post on LEDFader library - that was the crucial missing part and convinced me to switch from PIC Microcontrollers to Arduino), PCB boards (which you'll use to order yourself from places like OSH Park in the U.S.), schematics, parts list, and photos of the completed set up.

This is free for individual modellers to use, but not for sale by anyone other than me. So, it's OK to put a set together for a friend if they're not comfortable with soldering SMD components, but please do not sell them.

While I would have preferred to use 1 board to light both nacelles, that would mean running 9 wires up the nacelle pylons (7 for this board and another 2 for the motor). Not impossible, but my pylons are already glued together so the Arduino logic board will fit in the nacelle (my rear caps are removable and held in place my small magnets). With the Arduino logic boards in the nacelle, you need to run 4 wires - the 5V/GND for the Arduino logic board, and +ve/-ve wires for the motor.

The Arduino logic board needs a regulated 5V power supply, so if you're using 9V for the port lights you'll need a 5V regulator board. I got mine from Pololu.com. It handles both the blinking LEDs (my board has 15 blinkies - 5 larger ones and 10 SMDs) and the 5 pulsing amber LEDs. I found that rectangular LEDs look the best but you could substitute 3mm or 5mm round ones if desired. The fade up/down time and intensity is randomly set in each iteration through the loop. The max intensity values in the Random() function were chosen after much experimentation so that the blinkies don't overwhelm the ambers, but also don't disappear. Same goes for each resistor value chosen for the LEDs - not too bright but not too dim. This is also affected by how you finish the two domes - for mine, I sprayed a very light coat of Tamiya Clear Orange in the inside of the outer dome (after gently frosting the insides), and a heavier coat on the spinning inner dome. The blades are Bare Metal Foil (Chrome) - black is too dark for this scale, IMHO.

You can use different coloured blinking LEDs between the port an starboard nacelles, either just by rearranging the ones I used or using different colour combinations. Just be careful with he series resistors and test with your completed clear domes.

The board in the photos has a 3-pin JST connector to provide power, and a small slider switch to control what makes the amber LEDs pulse - I have a separate board for controlling the motors and that also includes a separate chip to control the amber LEDs - but the schematics and parts list reflect a 2-pin JST connector to simplify things for everyone else, so go by the schematics and parts list.

Here's a YouTube vide of the whole shebang in action: https://youtu.be/BucR-Cdlbos

Arduino sketch:
Code: [Select]
/*

Copyright (c) 2017 Ross A. Waddell

Sketch is for personal use only.


Change:

  Board -> Ardunio Pro or Pro Mini
  Processor -> ATmega328 (5V, 16Mhz)
  Port -> (whichever one has "usb" in it; board needs to be connected)
  Programmer -> AVRISP mkII


http://scifimodelaction.com/sfmaforum/index.php?topic=6850.msg88253#msg88253

  5 LED Random Intensity and Time Fader:

    - Fades five LEDs to random intensities (between 0 to 255) at random
      durations (between 0 to 1.5 seconds).

    - The LEDFader.h library will be needed.  The download and instructions can be found
      here: https://github.com/jgillick/arduino-LEDFader.

    - Based on original Arduino sketch by Jeremy Gillick
      (http://mozmonkey.com/2013/10/arduino-fade-leds-without-blocking/).

*/

#include <LEDFader.h>              // Don't forget to include the LEDFader libraries folder
#include <Curve.h>

// Config for blinking coloured LEDs
// =================================
#define LED_NUM 5                  // Number of LEDs

// 5 pin blinking LED setup
LEDFader leds[LED_NUM] = {
  LEDFader(3),                     // PWM pin
  LEDFader(5),                     // PWM pin
  LEDFader(6),                     // PWM pin
  LEDFader(9),                     // PWM pin
  LEDFader(10),                    // PWM pin
};

unsigned long OffTimerLEDs[LED_NUM];


// Config for pulsing amber LEDs
// =============================
#define AMBER_LED_PIN 11           // Amber LEDs output pin (5 in pentagon shape)
#define FADE_UP_TIME 2500          // Time to power up (power first turned on)
#define PULSE_TIME 600             // Fade down/up pulse time
#define MAX_BRIGHTNESS 200//190         // Max brightness of amber LEDs (can go up to 255)   -> 190 works well
#define MIN_BRIGHTNESS 185//175         // Min brightness of amber LEDs to fade down to (pulse)   -> 175 works well
#define DIR_UP 1
#define DIR_DOWN -1

LEDFader amber_led;
int direction = DIR_UP;


void setup() {
  randomSeed(analogRead(0));

  amber_led = LEDFader(AMBER_LED_PIN);
  amber_led.set_curve(&Curve::exponential);
  amber_led.fade(MAX_BRIGHTNESS, FADE_UP_TIME);
}
 
void loop() {

  // Pulsing amber LEDs
  // ==================

  amber_led.update();

  // LED no longer fading, switch direction
  if (amber_led.is_fading() == false) {

    if (direction == DIR_UP) {
      // Last faded up, so now fade down
      amber_led.fade(MIN_BRIGHTNESS, PULSE_TIME);
      direction = DIR_DOWN;
    }
    else {
      // Last faded down, so now fade up
      amber_led.fade(MAX_BRIGHTNESS, PULSE_TIME);
      direction = DIR_UP;
    }
  }


  // Blinking coloured LEDs
  // ======================
 
  unsigned long currentMillis = millis();


  // Update all LEDs and start new fades if any are done
  for (byte i = 0; i < LED_NUM; i++) {
    LEDFader *led = &leds[i];
    led->update();
 
    if (led->is_fading() == false) {
      // This LED is not fading, start a new fade

      // LED has stopped fading down (hopefully, we are capturing this just as it has ended)
      // Set timer for how long LED should stay off (if not set already)
      if (led->get_value() == 0 && OffTimerLEDs[i] == 0) {
        int offTime = random(100, 350);

        OffTimerLEDs[i] = millis() + offTime;
      } 
 
      int duration = random(95, 700);             // Randomly set fade duration between 95 to 700 ms (0.7 s)
      // int duration = random(75, 700); -> alternate timings; use what best suits you
      // int duration = random(100, 750);
      // int duration = random(0, 750);
      // int duration = random(1000, 3000);
 
      if (led->get_value() == 0 && currentMillis > OffTimerLEDs[i]) {
        // Was fading down, so now fade up (but only if the elapsed time for the off value has been exceeded)
        OffTimerLEDs[i] = 0;
       
        byte intensity = random(7, 15);           // Randomly set brightness intensity between 7 and 15
                                                  // PWM: 0 (off) to 255 (maximum)
        // byte intensity = random(5, 15); -> alternate intensities; use what best suits you
        // byte intensity = random(15, 50);
        // byte intensity = random(0,75);
        // byte intensity = random(100, 255);

        led->fade(intensity, duration);
      }
      else {       
        // Was fading up, so now fade down
        led->fade(0, duration);
      }
    }
  }
}


Note - you need to grab the LEDFader library from GitHub as mentioned in Gadgetry_3000's post (link to that topic is in the code above).

Fritzing schematic:
TOS E Warp Engines (Arduino Pro Mini) by Ross the Boss, on Flickr

Arduino logic board:
Arduino_Logic_Board_Front by Ross the Boss, on Flickr

Nacelle disc:
Nacelle_Disc_Front by Ross the Boss, on Flickr

All the files you need are in my Google Drive folder:
https://drive.google.com/open?id=0B-ikhAQea-PaU1dtTGxSa2pDQU0

Happy modelling!
« Last Edit: September 17, 2017, 07:02:23 pm by RossW »

Offline Tritanium

  • Ensign
  • *
  • Posts: 19
  • There are always possibilities.
Re: TOS E Warp Engine Lighting Effect - Custom Solution
« Reply #1 on: September 16, 2017, 04:07:53 pm »
I just went to the YouTube video and watched this in action.  My jaw is on the floor, Ross.  Let me be the first to say this is GENIUS.  Nice work!

Offline RossW

  • Commander
  • ***
  • Posts: 249
Re: TOS E Warp Engine Lighting Effect - Custom Solution
« Reply #2 on: September 16, 2017, 04:46:48 pm »
I just went to the YouTube video and watched this in action.  My jaw is on the floor, Ross.  Let me be the first to say this is GENIUS.  Nice work!

Thanks very much, Tritanium!

Offline Gadgetron_3000

  • Admiral
  • *****
  • Posts: 1160
Re: TOS E Warp Engine Lighting Effect - Custom Solution
« Reply #3 on: September 17, 2017, 10:48:10 am »
Insanely cool and awesome!   8)

I don't believe there is a PCB solution better than yours.  Cool use of the Darlington transistor array.

You have set the bar so far up high!

Thanks for sharing your work.

:)
"They've done studies, you know.  60% of the time, it works every time."

-----

Google+: https://plus.google.com/109660073537038906328

Offline RossW

  • Commander
  • ***
  • Posts: 249
Re: TOS E Warp Engine Lighting Effect - Custom Solution
« Reply #4 on: September 17, 2017, 12:46:13 pm »
Insanely cool and awesome!   8)

I don't believe there is a PCB solution better than yours.  Cool use of the Darlington transistor array.

You have set the bar so far up high!

Thanks for sharing your work.

:)

Thanks very much, Gadgetron_3000. That means a lot to me coming from you. And I owe it all to you thanks to your post from earlier this year.
« Last Edit: September 17, 2017, 06:59:26 pm by RossW »

Offline khitomer

  • Commander
  • ***
  • Posts: 200
  • Dum Spiro, Spero
Re: TOS E Warp Engine Lighting Effect - Custom Solution
« Reply #5 on: September 17, 2017, 06:20:15 pm »
What can I say but WOW !!!!!!
Still going boldly!

Offline RossW

  • Commander
  • ***
  • Posts: 249
Re: TOS E Warp Engine Lighting Effect - Custom Solution
« Reply #6 on: September 17, 2017, 07:02:45 pm »
What can I say but WOW !!!!!!

Thanks khitomer!

Offline whb64

  • Captain
  • ****
  • Posts: 376
Re: TOS E Warp Engine Lighting Effect - Custom Solution
« Reply #7 on: September 17, 2017, 09:33:52 pm »
I think you just set the new standard for this build.  I know I'll be picking your brains when I finally get around to building mine.

Offline RossW

  • Commander
  • ***
  • Posts: 249
Re: TOS E Warp Engine Lighting Effect - Custom Solution
« Reply #8 on: September 17, 2017, 09:58:37 pm »
I think you just set the new standard for this build.  I know I'll be picking your brains when I finally get around to building mine.

 ;)

Offline rmpitzer

  • Ensign
  • *
  • Posts: 22
Re: TOS E Warp Engine Lighting Effect - Custom Solution
« Reply #9 on: September 18, 2017, 09:07:28 am »
This is SO awesome!  I can't thank you enough for sharing all this information with us.  I'm going to order my boards today!

Thanks again,

-Rich

Offline RossW

  • Commander
  • ***
  • Posts: 249
Re: TOS E Warp Engine Lighting Effect - Custom Solution
« Reply #10 on: September 18, 2017, 09:50:24 am »
This is SO awesome!  I can't thank you enough for sharing all this information with us.  I'm going to order my boards today!

Thanks again,

-Rich

You're welcome! And please update this thread once you get it all working - I'd love to see it.

Offline rmpitzer

  • Ensign
  • *
  • Posts: 22
Re: TOS E Warp Engine Lighting Effect - Custom Solution
« Reply #11 on: September 26, 2017, 07:51:51 am »
Will do!

I was looking at the photos and videos in your Flikr link, looks like you drilled out those terrible inner dome shafts.  Do you have any more info on how you mounted those domes, and what motors you used?  I'd love to use stepper motors and mount them in the back of the bussard cap, like it looks like you did.

(EDIT): I found your posts about which motors you used (should have done a search before posting!   ::)  I'd still be interested in knowing how you mounted the inner domes, if I overlooked that info.

Thanks!
« Last Edit: September 26, 2017, 08:31:42 am by rmpitzer »

Offline RossW

  • Commander
  • ***
  • Posts: 249
Re: TOS E Warp Engine Lighting Effect - Custom Solution
« Reply #12 on: September 26, 2017, 11:08:03 am »
Will do!

I was looking at the photos and videos in your Flikr link, looks like you drilled out those terrible inner dome shafts.  Do you have any more info on how you mounted those domes, and what motors you used?  I'd love to use stepper motors and mount them in the back of the bussard cap, like it looks like you did.

(EDIT): I found your posts about which motors you used (should have done a search before posting!   ::)  I'd still be interested in knowing how you mounted the inner domes, if I overlooked that info.

Thanks!

I removed the inner dome shafts entirely, then used a jig to drill a hole dead centre for a 4/40 screw. This attaches to a DU-BRO 4/40 threaded coupler that I tapped a 4/40 thread in the top to accept the screw. The threaded coupler screws into a bearing I got from Electronic Goldmine, and then that attaches to the Faulhaber motor via a small piece of tubing.

Btw, I'm not using kit part #42 at all.

https://www.flickr.com/gp/rwaddell/7P1g78

https://www.flickr.com/gp/rwaddell/24iSV1

https://www.flickr.com/gp/rwaddell/6d4ab5

https://www.flickr.com/gp/rwaddell/7oM8rN




Offline rmpitzer

  • Ensign
  • *
  • Posts: 22
Re: TOS E Warp Engine Lighting Effect - Custom Solution
« Reply #13 on: September 26, 2017, 12:16:09 pm »
Very nice!  Is the motor physically mounted to the nacelle, or does the foam act as it's 'mount'?


Offline RossW

  • Commander
  • ***
  • Posts: 249
Re: TOS E Warp Engine Lighting Effect - Custom Solution
« Reply #14 on: September 26, 2017, 12:44:18 pm »
Very nice!  Is the motor physically mounted to the nacelle, or does the foam act as it's 'mount'?

I found a small foam roller at Michael's that's just the right diameter to fit snugly inside the nacelle, so it acts as the motor mount (and helps reduce noise). If any part of the motor touches a plastic part of the kit, that's where you'll get a lot of noise (the reason the PL lighting kit motor is so loud, IMHO).

 




Enterprise © Bloc