ELEV-8 V3 running lights build and install review
Orientation is a real problem when piloting a quadcopter. Adding running lights to the ELEV-8 offers a way to maintain orientation with bright LEDs.
http://learn.parallax.com/tutorials/robot/elev-8/running-lights-your-elev-8-v3
Building and installing these lights involves ordering parts from 3 sources, surface mount soldering, modifying the flight controller firmware, testing the lights and installing the lights.
There is a complete bill-of-material (BOM) with the tutorial - here is a summary:
Parallax — Washers, Hardware pack, Header, cables $ 52.32
Digi-Key — LEDs, Regulators, caps, solder paste $ 54.59
OSH Park — PC boards (6 copies) $ 20.70
Total - $ 127.61
This was my first experience with surface mount soldering. You put a tiny amount of solder paste (this is not just 'paste' is paste with a mix of powdered Tin, Bismuth, and Silver that melts and solders at a relatively low temperature) on the electrical connections of the parts, place them on the printed circuit board - then heat the board to the temperature that melts the solder. The tutorial suggests putting the paste on the board - I had better luck putting it on the parts (your mileage may vary, this is not easy).
You can use an electric fry pan with temperature control or a toaster oven with convection heating. I chose the toaster oven - picked one up at Penny’s for $40 (after rebate of course). I added a grilling thermometer with a range above 500 degrees F.
The solder paste has a published heat profile - as luck would have it my little consumer toaster oven matched that profile almost exactly.
I botched the first board - too much solder paste on the pads. You could tell by the tiny balls of solder and the messy results. Maybe it would have worked - but I couldn’t be sure, so I scrapped it.
Next attempt I applied as little of the paste as I could (point of a needle) to each terminal - and that worked.
After the surface mount parts you have to solder 2 LEDs (they are surface mount too) - to an edge of each board. This was a little tougher since you had to get the solder to bridge a fairly large gap. But I got the hang of it (I thought).
Next you solder on the terminals. The instructions recommend bending the pins out once they are on the board (with a saddle washer as reference). I didn’t want to stress the connections once the soldering was done so I chose to give a slight bend to them before soldering them to the PC board. That seemed to work.
Next you modify the FC firmware - that takes care but it worked first try.
The next step is to test the running lights - I’m glad I took this advice.
I connected the lights as described (make sure you number the boards and label the cables) - and only half of them worked.
The Digi-Key website has a link to the data sheet for the LEDs.
https://cdn-shop.adafruit.com/product-files/1138/SK6812+LED+datasheet+.pdf
The LED chips use a serial connection - so if any one of them is faulty - the ones following it will fail.
I looked at the one that seemed to failing - and could see that my soldering had probably ruined it - I replaced it and everything worked.
Don’t pass up testing the lights BEFORE you install them.
If you’re going to run the cables thru the booms - on an existing ELEV-8 - expect problems. It took me a lot of time and effort - I didn’t find an easy way to do this - but I’m guessing I should have read the instructions closer instead of winging it. I was reluctant to remove each boom completely - but I probably should have.
Each boom gets two cables - on one boom you can insert the cable into the hole by the motor, then feed it down the boom - relatively easy. But the other end of that cable has to be pushed up thru the second boom and fished thru the motor hole - make sure you have some very good tweezers.
Overall I’m happy with the results - the lights work and look pretty neat.
Hope this review helps someone thinking about installing these lights.
Comments
Jim
Still trying to find the fault!
Hopefully you ordered the correct part, (sounds like it since they work).
I used the frying pan method. Cost maybe 5 bucks. I ruined my first board by using too high a temperature. I broke out my IR thermometer to watch the temp, and the other six boards went well.
Could you share your code that worked, (post the SIDE Project as an attachment), so others can see the changes. The instructions are a little confusing as far as line numbers.
I considered the fry pan, an IR thermometer sounds like a good solution for making sure the temperature is correct. I had a grill probe which was more conducive to an oven.
I really like the diffusers - I may try them.
The regulator I used is here (looks like the latest version of a 7805): http://www.digikey.com/products/en?keywords=296-12290-1-ND
To troubleshoot I'd start by hooking up just Boom 1 - FC-Boom1-PwrD-FC --- and see if that boom works alone - then add 2...
I thought the soldering process was very touchy - especially the hand soldered LEDS - that's the one that failed for me. I didn't get the gap filled quickly enough - and when I lingered the LED was ruined. If any of the circuit mount parts have tiny balls of solder, that would indicate too much solder - which might mean a short you can't see. I didn't figure out how to tell if the surface mount soldering had any failure points (at least not with visual inspection).
It's important to make sure you are at the EXACT point in the code that needs to be changed. It's easy to confuse one part of code with another.
FWIW - I was nervous enough about doing this mod that I used version control.
(I didn't have any problem with this code - it worked the first time. But I may have had an advantage since I code for a living.)
A list of files will appear on the left side of the window.
Click on elev8-main.h to open that file.
Scroll down until you you find the line
#define LED_COUNT 2
Edit the line to say
#define LED_COUNT 21
Next, click on the elev8-main.cpp file in the Project Manager Window.
In the elev8-main.cpp file, scroll down until you find the line (around line 135)
static long LEDModeColor;
After that line, add the following code:
static short RunningLightModeStep; //LED Running light mode setting and counter variables
static char RunningLightMode;
Next, scoll down until you find (around line 620)
UpdateFlightLEDColor();
//Test for flight mode change
if( FlightEnabled == 0 )
{
Inside of that if statement (immediately after the code listed above), add the following code. Pay close attention to the highlighted line. If you add or take away running light modes, you will need to come back and modify this line. If you have 4 modes, this line will say "RunningLightMode > 3" since the first mode is 0:
if( (Radio.Rudd < -750) && (-350 < Radio.Thro) && (Radio.Thro < 350) ) //is the left stick pushed straight to the left?
{
if( (Radio.Aile > 750) && (-350 < Radio.Elev) && (Radio.Elev < 350) ) //is the right stick pushed straight to the right?
{
RunningLightModeStep++; // add to the counter
if (RunningLightModeStep >= 325) // have the sticks been held there for 1.5 seconds?
{
RunningLightModeStep = 0; // reset the counter
RunningLightMode++; // increment to the next running light mode
if (RunningLightMode > 1) RunningLightMode = 0; // This must be set for the number of different modes
for( int i=0; i <= RunningLightMode; i++ ) // x short beep(s) to indicate the mode
{
BeepHz(4500, 100);
waitcnt( CNT + 5000000 );
}
loopTimer = CNT; // because the beeper overruns the main loop timer, it must be reset
}
}
}
Next, scroll all of the way to the bottom of the elev8-main.cpp code.
Inside the last function in the elev8-main.cpp code, delete or comment out this line of code:
for( int i=0; i<led_count; i++ )
Replace it with the following code:
int idx = (LEDColorTable[FlightMode & 3] & LEDBrightMask) >> LEDBrightShift; // get the color representing the current flight mode
if(RunningLightMode == 0) //Dim Running Lights
{
LEDValue[0] = Color;
LEDValue[1] = LEDValue[6] = LEDValue[11] = LEDValue[16] = idx;
LEDValue[2] = LEDValue[3] = LEDValue[4] = LEDValue[5] = LED_Green & LED_Quarter;
LEDValue[7] = LEDValue[8] = LEDValue[9] = LEDValue[10] = LED_Green & LED_Quarter;
LEDValue[12] = LEDValue[13] = LEDValue[14] = LEDValue[15] = LED_Red & LED_Quarter;
LEDValue[17] = LEDValue[18] = LEDValue[19] = LEDValue[20] = LED_Red & LED_Quarter;
}
if(RunningLightMode == 1) //Standard Running Lights
{
LEDValue[0] = Color;
LEDValue[1] = LEDValue[6] = LEDValue[11] = LEDValue[16] = idx;
LEDValue[2] = LEDValue[3] = LEDValue[4] = LEDValue[5] = LED_Green;
LEDValue[7] = LEDValue[8] = LEDValue[9] = LEDValue[10] = LED_Green;
LEDValue[12] = LEDValue[13] = LEDValue[14] = LEDValue[15] = LED_Red;
LEDValue[17] = LEDValue[18] = LEDValue[19] = LEDValue[20] = LED_Red;
}
Just noticed your request was for a 'SIDE Project' attachment - not just the raw lines.
This is my first experience with SimpleIDE - which must be the project file you're talking about.
It's on another computer - I'll get it posted later today.
In the future use the "C" in the toolbar to post code in the forums.
You should be able to post a SIDE file as an attachment.
EDIT: .SIDE are not allowed at this time. The file should be zipped. This can be done from the Simple IDE toolbar under "Project". Then the ZIP file can be uploaded.
commit ae4c6c32a199f7b1cec38881c53b73a8f60446a4
Author: Ken McNamara <navyvet@tds.net>
Date: Sat Jan 7 08:32:52 2017 -0500
Added code to drive LED running lights - per Parallax instructions
diff --git a/elev8-main.cpp b/elev8-main.cpp
index f1ea34b..293fff4 100644
--- a/elev8-main.cpp
+++ b/elev8-main.cpp
@@ -135,6 +135,9 @@ static char MotorPin[4] = {PIN_MOTOR_FL, PIN_MOTOR_FR, PIN_MOTOR_BR, PIN_MOTOR_B
static long LEDModeColor;
+static short RunningLightModeStep; //LED Running light mode setting and counter variables
+static char RunningLightMode;
+
static short BatteryVolts = 0;
@@ -702,6 +705,27 @@ void UpdateFlightLoop(void)
//Test for flight mode change
if( FlightEnabled == 0 )
{
+
+ if( (Radio.Rudd < -750) && (-350 < Radio.Thro) && (Radio.Thro < 350) ) //is the left stick pushed straight to the left?
+{
+ if( (Radio.Aile > 750) && (-350 < Radio.Elev) && (Radio.Elev < 350) ) //is the right stick pushed straight to the right?
+ {
+ RunningLightModeStep++; // add to the counter
+ if (RunningLightModeStep >= 325) // have the sticks been held there for 1.5 seconds?
+ {
+ RunningLightModeStep = 0; // reset the counter
+ RunningLightMode++; // increment to the next running light mode
+ if (RunningLightMode > 1) RunningLightMode = 0; // This must be set for the number of different modes
+ for( int i=0; i <= RunningLightMode; i++ ) // x short beep(s) to indicate the mode
+ {
+ BeepHz(4500, 100);
+ waitcnt( CNT + 5000000 );
+ }
+ loopTimer = CNT; // because the beeper overruns the main loop timer, it must be reset
+ }
+ }
+}
+
ThroOut = Prefs.MinThrottle; // reset this when disarmed so we don't get weird results from filtering
if( ReArmTimer > 0 && AllowRearm )
@@ -1730,7 +1754,29 @@ void All_LED( int Color )
LEDValue[2 + 15] = Color;
#else
- for( int i=0; i<LED_COUNT; i++ )
+// for( int i=0; i<LED_COUNT; i++ )
+ int idx = (LEDColorTable[FlightMode & 3] & LEDBrightMask) >> LEDBrightShift; // get the color representing the current flight mode
+
+ if(RunningLightMode == 0) //Dim Running Lights
+ {
+ LEDValue[0] = Color;
+ LEDValue[1] = LEDValue[6] = LEDValue[11] = LEDValue[16] = idx;
+ LEDValue[2] = LEDValue[3] = LEDValue[4] = LEDValue[5] = LED_Green & LED_Quarter;
+ LEDValue[7] = LEDValue[8] = LEDValue[9] = LEDValue[10] = LED_Green & LED_Quarter;
+ LEDValue[12] = LEDValue[13] = LEDValue[14] = LEDValue[15] = LED_Red & LED_Quarter;
+ LEDValue[17] = LEDValue[18] = LEDValue[19] = LEDValue[20] = LED_Red & LED_Quarter;
+ }
+
+ if(RunningLightMode == 1) //Standard Running Lights
+ {
+ LEDValue[0] = Color;
+ LEDValue[1] = LEDValue[6] = LEDValue[11] = LEDValue[16] = idx;
+ LEDValue[2] = LEDValue[3] = LEDValue[4] = LEDValue[5] = LED_Green;
+ LEDValue[7] = LEDValue[8] = LEDValue[9] = LEDValue[10] = LED_Green;
+ LEDValue[12] = LEDValue[13] = LEDValue[14] = LEDValue[15] = LED_Red;
+ LEDValue[17] = LEDValue[18] = LEDValue[19] = LEDValue[20] = LED_Red;
+ }
+
LEDValue = Color;
#endif
}
diff --git a/elev8-main.h b/elev8-main.h
index 07331d0..372a34d 100644
--- a/elev8-main.h
+++ b/elev8-main.h
@@ -74,7 +74,7 @@ void All_LED( int Color );
#if defined(EXTRA_LIGHTS)
#define LED_COUNT (1 + 20 + 16) // Add-on light kit + 16 neopixel ring
#else
-#define LED_COUNT 2 // basic - one additional status LED automatic
+#define LED_COUNT 21 // basic - one additional status LED automatic
#endif
...and unless you have a NeoPixel ring, you don't need the additional 16.
This describes the changes necessary to upgrade the Flight Controller firmware to manage the 'running lights' add-on - (all of this is available in somewhat different format in the running lights tutorial)
The format below is the output of a diff - after the changes were made, loaded and tested.
This is specific to this firmware:
80204 Flight Controller Firmware v2.0.1
https://www.parallax.com/downloads/elev-8-flight-controller-firmware
If your firmware has no additions then the line numbers should be accurate. But it's more important to find the location in the code, evaluate what's there - then modify it. The addition should make sense, the brackets and control sections should balance. That way you won't get nasty compile errors. A misplaced bracket can be a real pain to find.
Two files are modified:
elev8-main.h
elev8-main.cpp
Only one line is changed in elev8-main.h - there are now 21 LEDs for the code to manage:
Changes to elev8-main.cpp are a little more extensive - 3 sections:
At about line 135 -
At about line 702 --
At about line 1730 --