FX-Sabers.com

FX-Sabers Discussion => New Ideas and Technologies => Topic started by: profezzorn on August 16, 2016, 12:59:36 AM

Title: Announcing the Teensy Saber open source sound board
Post by: profezzorn on August 16, 2016, 12:59:36 AM
The Teensy Saber is a light saber sound board based on a Teensy 3.2. The code is open source and the electronics is easy to build.
It has some unique features:


Of course, most of the standard features are there as well.

All instructions, including how to build the electronics, software downloads and graflex chassis models can be found here:

fredrik.hubbe.net/lightsaber/ (http://fredrik.hubbe.net/lightsaber/)

Demo video



Questions, requests, or mindless rants can be posted on this thread, and I'll do my best to answer.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Sithilis on August 16, 2016, 05:11:12 AM
Looks sweet by the way, I just wanted to know did you use the teensy3.2 or the prop shield board. Also would a novice be able to replicate you're results using the information you have provided
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Kolgrima on August 16, 2016, 05:58:56 AM
Most impressive. Nice board design, simple construction out of all stock hobby parts, and very clear instructions with loads of visuals, I'll definitely take a page from your book. When I do documentation. I can't wait to see some of these get built by the community. awesome work man!
Title: Re: Announcing the Teensy Saber open source sound board
Post by: BEN KENOBI on August 16, 2016, 06:01:49 AM
 :huh: :huh:

wow that's sweet!!
Title: Re: Announcing the Teensy Saber open source sound board
Post by: SpaceWindu on August 16, 2016, 07:55:07 AM
Most impressive. Nice board design, simple construction out of all stock hobby parts, and very clear instructions with loads of visuals, I'll definitely take a page from your book. When I do documentation. I can't wait to see some of these get built by the community. awesome work man!

Seconded!

You are so awesome. I love the video you show is amazing. Very, very, very cool. I could add 1,000 more 'verys'.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on August 16, 2016, 09:05:28 AM
Looks sweet by the way, I just wanted to know did you use the teensy3.2 or the prop shield board. Also would a novice be able to replicate you're results using the information you have provided

Both, (follow the link and click on "electronics" for more information.)

It's certainly my intention that a novice can replicate my results. The build requires more work than a commercial sound board, but the work isn't more difficult, there is just more of it.  Knowing how to solder, program and use a dremel certainly helps, but if you don't, I don't see why you couldn't learn on this project.

Ultimately you'll have to decide for yourself though, read through the instructions, and if there are any parts that are unclear, please let me know so that I can improve the instructions.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: TheBaconWizard on August 16, 2016, 12:27:00 PM
Congrats on the culmination of your hard work! This has lots of win.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Onli-Won Kanomi on August 16, 2016, 12:52:56 PM
BRAVO and Congratulations!
Title: Re: Announcing the Teensy Saber open source sound board
Post by: JakeSoft on August 21, 2016, 11:05:50 AM
Nice one! And welcome to the "built my own sound board" club!  :smiley:
Title: Re: Announcing the Teensy Saber open source sound board
Post by: ShogunLogan on August 22, 2016, 04:08:23 AM
Most impressive indeed! For neo pixels its actually surprisingly bright!  Really hope the best for this in the future as one day i want to give string blades a shot and would love a budget friendly board to accommodate.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi_1 on August 22, 2016, 01:12:45 PM
Wow, welcome in the fellowship of Arduino Lightsaber Enthusiastics! There are only a couple of people worldwide who managed to build a working lightsaber electronics on their own and you are now one of us :)

I love the exchangable blade, but what I found extraordinary and unique is the charging with a plug-in blade-dummy! As I downright hate the recharge port, this is an idea I have to look at more closely!

Well done!!! I sense a real potential in this one!
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on September 03, 2016, 12:43:33 AM
Finished the LED star adapter. It makes it possible to use standard hollow blades my teensysaber. (Or potentially some other string saber.)  It's pretty easy to make and requires no expensive tools.

Full instructions here (http://fredrik.hubbe.net/lightsaber/blade4.html)

(https://drive.google.com/thumbnail?authuser=0&sz=w320&id=14RbpMWyhrcUBNSpHn6v6bPUSPE1KqHUqqw) (https://drive.google.com/open?id=14RbpMWyhrcUBNSpHn6v6bPUSPE1KqHUqqw)(https://drive.google.com/thumbnail?authuser=0&sz=w320&id=14n5AAKbmQAUABO7vmjg1GO2RQ3fe9ic4Ig) (https://drive.google.com/open?id=14n5AAKbmQAUABO7vmjg1GO2RQ3fe9ic4Ig)

Here is a shot using an empty trans-white tube, no blade film.
(https://drive.google.com/thumbnail?authuser=0&sz=w320&id=1kX3-BMYgWoUv3-TJYxZuP0bh0DfGiS13Jw) (https://drive.google.com/open?id=1kX3-BMYgWoUv3-TJYxZuP0bh0DfGiS13Jw)

I think using modules like this would be cool for other types of electronics as well, as it makes it super-easy to change the color of your saber, without resorting to RGB stars, which are just not as bright.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on September 03, 2016, 06:35:55 PM
I just want to make sure there is no confusion here:

I am not selling anything[1]. All the instructions, 3d-models, source code and links to where you can buy all the required parts are available on my site.
If you don't want to build it yourself, there are lots of saber smiths on this board who can do it for you[2].

[1] I put up a Shapeways store to make it easier to obtain the 3d-printed parts. The models are available for free if you have access to a 3d printer.
[2] If you are a saber smith, and you want me to send people your way, PM me.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: McFarticus on December 01, 2016, 05:06:07 PM
I've searched far and wide about this, so I'll ask here.  I came across the teensy 3.6 at the local microcenter (it has the MicroSD already on it, plus a faster processor).  I have the prop on order from sparkfun, but I imagine there are changes in regards to the SDcard script.   I'm mostly new to programming. 

It comes down to two things here:

What changes will I have to make in the code for the SD, and where can I figure out how to make this thing work with a single 3.2-3.5V 1A XP-E cree LED? (I have a white LED I can squeeze in for the clash effect if needed, same voltage with 0.7A)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on December 02, 2016, 05:08:49 PM
I've searched far and wide about this, so I'll ask here.  I came across the teensy 3.6 at the local microcenter (it has the MicroSD already on it, plus a faster processor).  I have the prop on order from sparkfun, but I imagine there are changes in regards to the SDcard script.   I'm mostly new to programming. 

It comes down to two things here:

What changes will I have to make in the code for the SD, and where can I figure out how to make this thing work with a single 3.2-3.5V 1A XP-E cree LED? (I have a white LED I can squeeze in for the clash effect if needed, same voltage with 0.7A)

Short answer: I don't know.

Much longer answer: I don't think you have to change much, as the SD card interface is very simple. Teensy 3.6 has some new features that lets you access the SD card faster, but I don't know what you would need to do to use those features. I have a Teensy 3.6 sitting on my desk at home, but I have not tried to use it yet.

One thing to watch out for though: The Teensy 3.6 has the Audio Out (A14) in a different position than the Teensy 3.2, so you'll need to make that connection with a wire instead of a pin. Shouldn't be a big deal, but could be very confusing if you didn't know about it.  (The rest of the pins near the short side of the prop shield are not required, so I don't think you have to worry about those.)

A FET and a resstor per LED is all you need for the LEDs.

For the 1A LED, the resistor should eat 0.2 volts, which at 1A means you need 0.2 ohms. The means the resistor will emit 0.2 watts of heat.

For the 0.7A led, you'd want a 0.14 ohm resistor, which will emit 0.1 watts of heat.

I assume you've looked at the circuit diagram: Teensy Saber Electronics (http://fredrik.hubbe.net/lightsaber/electronics.html)

PS: This the intended place to ask questions, feel free to ask more!
Title: Re: Announcing the Teensy Saber open source sound board
Post by: McFarticus on December 03, 2016, 05:26:05 PM
I've searched far and wide about this, so I'll ask here.  I came across the teensy 3.6 at the local microcenter (it has the MicroSD already on it, plus a faster processor).  I have the prop on order from sparkfun, but I imagine there are changes in regards to the SDcard script.   I'm mostly new to programming. 

It comes down to two things here:

What changes will I have to make in the code for the SD, and where can I figure out how to make this thing work with a single 3.2-3.5V 1A XP-E cree LED? (I have a white LED I can squeeze in for the clash effect if needed, same voltage with 0.7A)

Short answer: I don't know.

Much longer answer: I don't think you have to change much, as the SD card interface is very simple. Teensy 3.6 has some new features that lets you access the SD card faster, but I don't know what you would need to do to use those features. I have a Teensy 3.6 sitting on my desk at home, but I have not tried to use it yet.

One thing to watch out for though: The Teensy 3.6 has the Audio Out (A14) in a different position than the Teensy 3.2, so you'll need to make that connection with a wire instead of a pin. Shouldn't be a big deal, but could be very confusing if you didn't know about it.  (The rest of the pins near the short side of the prop shield are not required, so I don't think you have to worry about those.)

A FET and a resstor per LED is all you need for the LEDs.

For the 1A LED, the resistor should eat 0.2 volts, which at 1A means you need 0.2 ohms. The means the resistor will emit 0.2 watts of heat.

For the 0.7A led, you'd want a 0.14 ohm resistor, which will emit 0.1 watts of heat.

I assume you've looked at the circuit diagram: Teensy Saber Electronics (http://fredrik.hubbe.net/lightsaber/electronics.html)

PS: This the intended place to ask questions, feel free to ask more!


Ok a few more questions for you.

1) I've searched far and wide for the right FET.  I've been using LM317s for constant current on some other LED projects.  Will that suffice? 

2) After studying the pins on the 3.2, I found no A14.  Is it A13?

3) I've had a little bit of trouble understanding which pin connects to which pin based on your schematics, given that I'm using the 3.6, not the 3.2. Do I blindly treat it as the 3.2 and ignore the extra pins?

4) You said it's safe to leave the coding AS-IS, but since the SD reader is built in, what change would have to be made in the code for that one?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: McFarticus on December 03, 2016, 07:49:28 PM
Also, I attempted to verify the code and got this error:

Arduino: 1.6.13 (Windows 10), TD: 1.32-beta1, Board: "Teensy 3.6, Serial, 180 MHz, US English"

Build options changed, rebuilding all
C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino: In member function 'void TouchButton::BeginRead()':

C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino:3536:5: error: 'TSI0_PEN' was not declared in this scope

     TSI0_PEN = (1 << ch);

     ^

C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino:3537:5: error: 'TSI0_SCANC' was not declared in this scope

     TSI0_SCANC = TSI_SCANC_REFCHRG(3) | TSI_SCANC_EXTCHRG(CURRENT);

     ^

C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino:3537:37: error: 'TSI_SCANC_REFCHRG' was not declared in this scope

     TSI0_SCANC = TSI_SCANC_REFCHRG(3) | TSI_SCANC_EXTCHRG(CURRENT);

                                     ^

C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino:3537:66: error: 'TSI_SCANC_EXTCHRG' was not declared in this scope

     TSI0_SCANC = TSI_SCANC_REFCHRG(3) | TSI_SCANC_EXTCHRG(CURRENT);

                                                                  ^

C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino:3538:85: error: 'TSI_GENCS_SWTS' was not declared in this scope

     TSI0_GENCS = TSI_GENCS_NSCN(NSCAN) | TSI_GENCS_PS(PRESCALE) | TSI_GENCS_TSIEN | TSI_GENCS_SWTS;

                                                                                     ^

C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino: In member function 'virtual void TouchButton::Loop()':

C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino:3592:37: error: 'TSI0_CNTR1' was not declared in this scope

     Update(*((volatile uint16_t *)(&TSI0_CNTR1) + ch));

                                     ^

Multiple libraries were found for "SD.h"
 Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD
 Not used: C:\Program Files (x86)\Arduino\libraries\SD
Error compiling for board Teensy 3.6.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on December 04, 2016, 11:44:08 AM
I've searched far and wide about this, so I'll ask here.  I came across the teensy 3.6 at the local microcenter (it has the MicroSD already on it, plus a faster processor).  I have the prop on order from sparkfun, but I imagine there are changes in regards to the SDcard script.   I'm mostly new to programming. 

It comes down to two things here:

What changes will I have to make in the code for the SD, and where can I figure out how to make this thing work with a single 3.2-3.5V 1A XP-E cree LED? (I have a white LED I can squeeze in for the clash effect if needed, same voltage with 0.7A)

Short answer: I don't know.

Much longer answer: I don't think you have to change much, as the SD card interface is very simple. Teensy 3.6 has some new features that lets you access the SD card faster, but I don't know what you would need to do to use those features. I have a Teensy 3.6 sitting on my desk at home, but I have not tried to use it yet.

One thing to watch out for though: The Teensy 3.6 has the Audio Out (A14) in a different position than the Teensy 3.2, so you'll need to make that connection with a wire instead of a pin. Shouldn't be a big deal, but could be very confusing if you didn't know about it.  (The rest of the pins near the short side of the prop shield are not required, so I don't think you have to worry about those.)

A FET and a resstor per LED is all you need for the LEDs.

For the 1A LED, the resistor should eat 0.2 volts, which at 1A means you need 0.2 ohms. The means the resistor will emit 0.2 watts of heat.

For the 0.7A led, you'd want a 0.14 ohm resistor, which will emit 0.1 watts of heat.

I assume you've looked at the circuit diagram: Teensy Saber Electronics (http://fredrik.hubbe.net/lightsaber/electronics.html)

PS: This the intended place to ask questions, feel free to ask more!


Ok a few more questions for you.

1) I've searched far and wide for the right FET.  I've been using LM317s for constant current on some other LED projects.  Will that suffice? 

2) After studying the pins on the 3.2, I found no A14.  Is it A13?

3) I've had a little bit of trouble understanding which pin connects to which pin based on your schematics, given that I'm using the 3.6, not the 3.2. Do I blindly treat it as the 3.2 and ignore the extra pins?

4) You said it's safe to leave the coding AS-IS, but since the SD reader is built in, what change would have to be made in the code for that one?

(1) I'm no expert on LM317, but it seems like a good choice to me. A linear regulator will make the LED brightness consistent as the power runs down, which is great.

(2) Look again, It's called "A14/DAC" on the pinout diagram, and it's on the short end of the Teensy 3.2. If you're using a Teensy 3.6, you'll want to connect that pin on the prop shield (called AudioIN on the prop shield diagram) to A21 (DAC0) or A22 (DAC1) on the Teensy 3.6.  (It's possible that using DAC0 will work with no modifications to the code, but the modifications would be minimal.)

(3) The teensy 3.6 is supposed to be pin-compatible with the teensy 3.2, (With A14 being an obvious exception...)  So hopefully you can just hook things up just like the circuit diagram shows.  (Skipping the SD card bits of course.)

(4) Did I? I didn't mean to say that. I have not tried running my code on a 3.6, and some bits were specifically written for the Teensy 3.2. Hopefully the changes needed are minimal though. (more about that in the next post.)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on December 04, 2016, 11:48:26 AM
Also, I attempted to verify the code and got this error:

Arduino: 1.6.13 (Windows 10), TD: 1.32-beta1, Board: "Teensy 3.6, Serial, 180 MHz, US English"

Build options changed, rebuilding all
C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino: In member function 'void TouchButton::BeginRead()':

C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino:3536:5: error: 'TSI0_PEN' was not declared in this scope

     TSI0_PEN = (1 << ch);

     ^

C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino:3537:5: error: 'TSI0_SCANC' was not declared in this scope

     TSI0_SCANC = TSI_SCANC_REFCHRG(3) | TSI_SCANC_EXTCHRG(CURRENT);

     ^

C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino:3537:37: error: 'TSI_SCANC_REFCHRG' was not declared in this scope

     TSI0_SCANC = TSI_SCANC_REFCHRG(3) | TSI_SCANC_EXTCHRG(CURRENT);

                                     ^

C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino:3537:66: error: 'TSI_SCANC_EXTCHRG' was not declared in this scope

     TSI0_SCANC = TSI_SCANC_REFCHRG(3) | TSI_SCANC_EXTCHRG(CURRENT);

                                                                  ^

C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino:3538:85: error: 'TSI_GENCS_SWTS' was not declared in this scope

     TSI0_GENCS = TSI_GENCS_NSCN(NSCAN) | TSI_GENCS_PS(PRESCALE) | TSI_GENCS_TSIEN | TSI_GENCS_SWTS;

                                                                                     ^

C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino: In member function 'virtual void TouchButton::Loop()':

C:\Users\CptnYellowStain\Downloads\lightsaber-1.14\lightsaber-1.14.ino:3592:37: error: 'TSI0_CNTR1' was not declared in this scope

     Update(*((volatile uint16_t *)(&TSI0_CNTR1) + ch));

                                     ^

Multiple libraries were found for "SD.h"
 Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD
 Not used: C:\Program Files (x86)\Arduino\libraries\SD
Error compiling for board Teensy 3.6.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


I will have a go at compiling the code for Teensy 3.6.
I won't have time to actually test it today, but I should be able to make it compile at least.

For the record, most of the problems listed above have to do with the touch-button code, which you may or may not need.
I didn't like that touchRead() can take several ms to run, so copied and modified the code, and the code apparently needs
to be different for the Teensy 3.2.


Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on December 04, 2016, 06:32:17 PM
Ok, I have uploaded a new lightsaber.ino, which compiles cleanly with board set to Teensy 3.6.
I think the way to make the SD card work is to change the line:

  sdCardSelectPin = 0

to

  sdCardSelectPin = BUILTIN_SDCARD

(I have added a comment in the code about this.)

I have not tested it on a Teensy 3.6, but I'm optimistic that it will work.

The new code upload also has a bunch of code for the TeensySaber V2 board, but that should not affect anything.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: McFarticus on December 05, 2016, 05:27:45 PM
I'll thoroughly test this out.  I'll let you know how it works out.  I had to try this 3.6 since it's more low profile due to the SD reader, and I can't tell you how much of a nightmare it was trying to figure out how to flash the prop board.  I still haven't figured it out.....oh lawd.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: McFarticus on December 05, 2016, 06:20:56 PM
I'm checking other forums for this error:

C:\Users\CptnYellowStain\Documents\Arduino\lightsaber-1.18_for_3.6\lightsaber-1.18_for_3.6.ino:82:21: error: 'BUILTIN_SDCARD' was not declared in this scope


I tried copying the code, deleting the file and saving it as a new file (as suggested in another post), but I get the same error.  I'll keep looking
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on December 05, 2016, 08:17:20 PM
I'm checking other forums for this error:

C:\Users\CptnYellowStain\Documents\Arduino\lightsaber-1.18_for_3.6\lightsaber-1.18_for_3.6.ino:82:21: error: 'BUILTIN_SDCARD' was not declared in this scope


I tried copying the code, deleting the file and saving it as a new file (as suggested in another post), but I get the same error.  I'll keep looking

I am officially a dufus! (I didn't actually *try* setting  sdCardSelectPin to BUILTIN_SDCARD...)
The fix is simple, as I just needed to make sure to #include <SD.h> before trying to use BUILTIN_SDCARD.
I've uploaded a new version.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: McFarticus on December 06, 2016, 07:45:58 PM
I can't get it to power on, but I'm also using a crappy 5V boost.  I'll pick up a new one tomorrow and see if that remedies the problem.  This is my first attempt at this, so I wasn't expecting it to go smoothly. 
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on December 06, 2016, 09:41:50 PM
Have you tried the serial monitor to see if the card is doing something?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: McFarticus on December 08, 2016, 03:50:10 PM
Have you tried the serial monitor to see if the card is doing something?

The how-to must be old, because it looks NOTHING like the current interface, and I have the latest version.  I tried inserting the code, but I have no response. 

I have been playing with the 5V boost, and wiring it exactly as shown in the schematic you posted.  No luck yet. 
Title: Re: Announcing the Teensy Saber open source sound board
Post by: McFarticus on December 08, 2016, 05:31:15 PM
Also, I have the DAC wire from the prop connected to the DAC1 on the 3.6.  I dug into the code and found the DAC marked as DAC0.  I switched them to DAC1.  Still no function that I can see.  I have both your original and my edit saved.  I'm not very skilled with Code, so I can't be relied upon for it.  hahahaha


Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on December 08, 2016, 08:49:54 PM
I wonder if your Teensy 3.6 is toast? Have you managed to program it?
(Before you program it the first time, it blinks when you plug it in, once you've program it, it won't do that unless of course you program it with a blinky program...)

I hooked up my Teensy 3.6 to my computer, and uploaded lightsaber.ino with no modifications.
Then I opened the serial monitor (Ctrl-Shift-M), which said:

Code: [Select]
No sdcard found.

ID: 916 volts 2.95 resistance= 279888.97
blade= 0
WS2811 Blade with 97 leds
Normal Style
Scanning sound font: font01/

The "no sdcard found" is normal, since (a) I have no sdcard inserted and (b) I haven't configured the SD enable pin correctly.
Note that this is with nothing connected to the Teensy except for the USB cable. (no prop shield)
After printing this, it hangs because it tries to talk to the sd card even though it's not there.
If I comment out #define ENABLE_SD, it gets a little further, but then it fails to talk to the motion chip, since that's not there either. So I comment out #define ENABLE_MOTION too. After that, it it doesn't hang anymore I and the chip responds when I type "help" in the serial monitor.

As for DAC0 -> DAC1, you have the right idea: Replacing DAC0 with DAC1 should work, but you should see things printed through
the serial monitor either way.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on December 08, 2016, 08:56:26 PM
I also got the builtin SD card reader to work by setting sdCardSelectPin = BUILTIN_SDCARD
(I was able to run "dir" in the serial monitor and see the contents of the memory card, obviously I can't play sounds without a prop shield...)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: McFarticus on December 12, 2016, 06:54:28 PM
I got no response from the 3.6, so i opened up the brand new 3.2 and tried a simple code. 
******
void setup() {
  // put your setup code here, to run once:
Serial.begin (9600);
}

void loop() {
  // put your main code here, to run repeatedly:
Serial.println("Teensy, you're giving me a migraine");
delay(290);
while(true);
}



I can't get it to do anything in serial monitor, not even on a barely touched 3.2 on COM1.  I switched between 3 and 4, but the monitor says offline.  I don't know what I'm missing.  I'm a dufus of all dufusry with programming. I did C++ for a year in high school.  That was it. 

I'm mostly a Smith and designer, not much of a programmer.  hahaha


Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on December 12, 2016, 09:09:54 PM
You might have better luck checking the Teensy forums/howtos.

I have no idea what exactly is wrong, so I'm just going to outline all the steps you need to do;

1) Install Arduino & Teensy  (For 3.6, I recommend the latest beta Teensy version)
2) Windows/Mac may also need some sort of driver installation. I'm not sure if this happens automatically when you install the Teensy software or not. The "driver" is just an INF file which maps the USB ids to the right driver.
3) Plug a teensy into a USB port. If you never programmed it before it should start blinking. (Unless you cut the  V-USB pads apart. If you did that you also need to power the Teensy externally.)
4) Start up Arduino, Load a sketch and select the right board. Also make sure that that you select "USB Type: Serial", or the serial monitor won't work.
5) If you're using your sketch as listed here, remove this line: while(true);
6) Click upload. After compilation the teensy programming utility should show up, and programming should begin automatically. If it doesn't, press the programming button on the teensy.
9) Teensy should stop blinking, and if you open the serial console (Ctrl-Shift-M) you should see the printline repeated every 290 ms.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: McFarticus on December 12, 2016, 09:29:04 PM
I did a quick coding (learning over here) to have the LED flash an SOS with a 3 second break in between.  It works on both boards.  I'll try again tomorrow, and see about those USB drivers.   

Title: Re: Announcing the Teensy Saber open source sound board
Post by: Supercheez on December 20, 2016, 02:45:18 PM
This is some hugely impressive work, I'm very tempted to get myself a Teensy and see if I can follow the build guide through!

Out of interest, does a Teensy LC have what it takes to run a lightsaber? I'm guessing that it won't have sufficient grunt but thought it worth checking.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: jbkuma on December 20, 2016, 03:49:44 PM
Depending on what you want your saber to do, you can even run it off of a ATTiny85.  I've set up a few prototypes this way, and I'm pretty sure Jakesoft has as well.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: JakeSoft on December 21, 2016, 04:10:08 PM
Depending on what you want your saber to do, you can even run it off of a ATTiny85.  I've set up a few prototypes this way, and I'm pretty sure Jakesoft has as well.

Yes, indeed. Behold! Minimis (https://www.fx-sabers.com/forum/index.php?topic=50153.0)

You do have to dial back your expectations a little when you go to such a simple chip, of course. Needless to say that with only 8K of program space you wouldn't be able to simply upload profezzorn's sketch. ;-)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Supercheez on December 22, 2016, 05:53:06 AM
Depending on what you want your saber to do, you can even run it off of a ATTiny85.  I've set up a few prototypes this way, and I'm pretty sure Jakesoft has as well.

Yes, indeed. Behold! Minimis (https://www.fx-sabers.com/forum/index.php?topic=50153.0)

You do have to dial back your expectations a little when you go to such a simple chip, of course. Needless to say that with only 8K of program space you wouldn't be able to simply upload profezzorn's sketch. ;-)

"Minimis" indeed! Well I have an LC on order so I'll see how I get on, thanks for the responses.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on December 28, 2016, 11:54:29 PM
The Teensy LC has enough "grunt", the biggest limit is the 8Kb ram I think.
In the TeensySaber code, two features use up most of the ram:

   1) The DMA buffer used to drive the LEDs. You can easily compile this out, but then you can't drive neopixel blades.

   2) The audio buffers. If you limit yourself to using monophonic (plecter style) fonts, you might be able to hack the code to fit in 8kB. The SD card reading code also uses some memory, but you could use the serial flash on the prop shield. The size is limited, but it's very fast, and the code for accessing is small and efficient.

My recommendation: Stick to the Teensy 3.2
Title: Re: Announcing the Teensy Saber open source sound board
Post by: theholyduck on January 16, 2017, 10:03:42 AM
I found an error in the "electronics" section of your instructions. where it says
"Next, cut three short wires, strip the ends and solder them to the MISO, MOSI and CLK on the sd card shield. Put the sdcard shield in place (but don't solder it yet). These wires are going to connect to pin 13, 12 and 14 on the teensy AND the prop shield"
It should say pin 12, 11 and 13. you have it right in the photos and the schematic drawing but the text is wrong.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 16, 2017, 01:38:46 PM
I found an error in the "electronics" section of your instructions. where it says
"Next, cut three short wires, strip the ends and solder them to the MISO, MOSI and CLK on the sd card shield. Put the sdcard shield in place (but don't solder it yet). These wires are going to connect to pin 13, 12 and 14 on the teensy AND the prop shield"
It should say pin 12, 11 and 13. you have it right in the photos and the schematic drawing but the text is wrong.

Thank you. Will fix tonight.

Update: Now fixed.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: theholyduck on January 20, 2017, 10:22:18 PM
Ok. so the mosfets arrived today. and i managed to get things part way working. i had to redefine the aux pins since i had no touch sensor. but everything related to blade detection. activating/FoCing. motion sensing and what not seems to work great. but i ran into an issue with the SD card stuff.

Basically if i dont coment out #define ENABLE_SD then the program no longer works. i cant interact with the teensy through the serial monitor and it no longer responds to my buttons. I tested to see if my wiring was at fault using some other sd card interacting code which worked perfectly. there is no instructions on your site for how the filesytsem on the sdcard should be organized but im guessing thats my problem
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 20, 2017, 10:35:23 PM
The TouchButton can be changed to a regular button by doing:

1) Replace "TouchButton" with "Button" on line 4220
2) remove "1700, " from line 3871

(This assumes lightsaber-1.19.ino)

Those kind of SD card problems sound like wiring problems to me.  lightsaber.ino scans the sd card to see what files it can find when it starts up, but if the files aren't found, nothing should fail. However if an SD card is detected, but we're unable to talk to it, you get exactly that behavior. Also make sure that sdCardSelectPin is set correctly for your configuration.

I've noticed that it can be helpful to put a delay(1000) at the beginning of setup() (line 4878) as you tend to miss any printouts that happen during startup otherwise.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 20, 2017, 11:23:01 PM
It can also be useful to comment out ENABLE_AUDIO (but leave ENABLE_SD)
This avoid the scanning for audio files during setup.
You can see if the SD card is working by typing "dir" in the serial monitor.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: theholyduck on January 21, 2017, 07:50:43 AM
yeah it works just fine with either audio or sd card enabled. but when both are enabled its frozen.

i can do DIR just fine in the serial monnitor whenn is just sd enabled.
im guessing i have to edit your presets there so its not looking for files that don't exist.

but for now im going tto bed
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 21, 2017, 09:49:03 AM
I had a similar problem for a while when I was testing the V2 board.
SOunds suspiciously like a bug somewhere, I will investigate....
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 21, 2017, 10:00:49 AM
Huh, adding  "delay(1000);" at the beginning of setup() (line 4878) seems to help.
I guess the SD card needs some time to wake up before we can access it.
Or maybe it's a "let the voltage stabilize" kind of thing?
Wonder how long a delay you actually need?
I'd prefer not to have a delay in setup(), but it seems to be needed...

Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 21, 2017, 04:06:26 PM
The delay(1000) turned out to be a red herring.
It seemed to work better because it printed out more things, but then just hung while scanning.
The problem is apparently that SD.open() hangs if you give it a filename with a trailing slash, which I was doing...
(The same thing happens if you type "dir font01/" in the serial monitor.)
I've uploaded new version (1.20), which avoids using paths with trailing slashes. Let me know if it works better for you.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: theholyduck on January 21, 2017, 08:29:15 PM
http://fredrik.hubbe.net/lightsaber/lightsaber-1.20.ino (http://fredrik.hubbe.net/lightsaber/lightsaber-1.20.ino) this does seem to work yes. no more hanginng with both sd and audio
Title: Re: Announcing the Teensy Saber open source sound board
Post by: twing207 on January 22, 2017, 09:26:15 AM
Would it be possible to port this code to a different microcontroller? Like the Atmega32U4 or the SAMD21. The teeney chips are too proprietary to make for great open hardware projects.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: JakeSoft on January 22, 2017, 11:05:37 AM
Would it be possible to port this code to a different microcontroller? Like the Atmega32U4 or the SAMD21. The teeney chips are too proprietary to make for great open hardware projects.

A board and open source code already exist based on 8-bit AVR MCU.

See World's first Arduino lightsaber board - DIYino v1 (https://www.fx-sabers.com/forum/index.php?topic=49722.0)

The Teensy code won't port directly and work well anyway because the 8-bit AVR chips don't have enough grunt to do all that audio processing with high-fidelity playback. The solution above offloads the audio processing to a separate chip.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 22, 2017, 11:11:01 AM
Would it be possible to port this code to a different microcontroller? Like the Atmega32U4 or the SAMD21. The teeney chips are too proprietary to make for great open hardware projects.

Probably, the requirements are fairly generic:

1. The chip has to be fast enough
   (Not sure how fast it really needs to be though, I don't think I'm using all that much of what the teensy
    can do right now...)
2. It needs DMA or a programmable IO engine to drive audio and neopixels.
3. It needs enough RAM for audio buffers (32kb *may* work, teensy has 64kb, and I use quite a lot of it...)
4. A proper DAC will produce better audio than a PWM-based "analog out", not sure how much that matters though.
5. Needs i2c and SPI to talk to motion chip and sdcard (but I think all MCUs have that...)
6. It needs to fit in a lightsaber. :)

I wouldn't want to try porting the teensysaber code to something that uses an external audio chip though. It would just be too different.

The Atmega32u4 wouldn't work, it just doesn't have enough RAM.
The SAMD21 looks more promising, but I might have to reduce the number of audio mixing channels to be able
to fit in 32kb RAM.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: twing207 on January 22, 2017, 06:05:53 PM
I would very much like to try designing an open source board with the SAMD21 chip in it to run this software. Although ideally it would be better to use an external DAC something like the MCP4725 than a PWM for sound output. How much of a task would it be to make this software work with an external DAC and use the SAMD21? I could design a single board to contain all the parts together and do a small run of them for anyone else interested.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 22, 2017, 07:27:19 PM
MCP4725 looks easy enough to work with. It's the integrated sdcard-to-audio solutions that I don't want to try to port to. If possible, try connecting the MCP4725 to it's own i2c bus, as that simplifies driving it from an interrupt a great deal.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: twing207 on January 23, 2017, 07:43:10 AM
Let me ask , would it be possible to compile the hex of the existing software and then install it directly onto a blank MK20DX256 without the teensy bootloader using an ISP?  If I'm not mistaking the bootloaders only job is to allow the uploading on new sketches?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 23, 2017, 08:48:26 AM
Let me ask , would it be possible to compile the hex of the existing software and then install it directly onto a blank MK20DX256 without the teensy bootloader using an ISP?  If I'm not mistaking the bootloaders only job is to allow the uploading on new sketches?

Yes, but being able to upload through USB is a in important feature IMHO. I think there are alternative bootloaders available though.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 23, 2017, 09:21:30 AM
Let me ask , would it be possible to compile the hex of the existing software and then install it directly onto a blank MK20DX256 without the teensy bootloader using an ISP?  If I'm not mistaking the bootloaders only job is to allow the uploading on new sketches?

Yes, but being able to upload through USB is a in important feature IMHO. I think there are alternative bootloaders available though.

Actually, if I was working on an integrated design with cpu on board, I would probably replace the SD card with a large SPI flash chip. (At least 64Mb)  SPI flash chips tend to be much faster and would make audio mixing easier and less RAM-intensive. However, I would have to implement one of the USB storage standards to make it easy to add/remove files from the flash chip. As an additional bonus, the board would become a fair amount smaller by removing the sd card slot.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: twing207 on January 23, 2017, 09:43:24 AM
Let me ask , would it be possible to compile the hex of the existing software and then install it directly onto a blank MK20DX256 without the teensy bootloader using an ISP?  If I'm not mistaking the bootloaders only job is to allow the uploading on new sketches?

Yes, but being able to upload through USB is a in important feature IMHO. I think there are alternative bootloaders available though.

Actually, if I was working on an integrated design with cpu on board, I would probably replace the SD card with a large SPI flash chip. (At least 64Mb)  SPI flash chips tend to be much faster and would make audio mixing easier and less RAM-intensive. However, I would have to implement one of the USB storage standards to make it easy to add/remove files from the flash chip. As an additional bonus, the board would become a fair amount smaller by removing the sd card slot.


Yea I like the idea of flash on board. Being able to upload the sketch is ideal, but I was not aware of alternative bootloaders. If you are interested in working on such a board shoot me an email. I would like to design a new board as an alternative to the expensive boards currently available. I have the equipment to make production pcbs including double sided SMT. 
Title: Re: Announcing the Teensy Saber open source sound board
Post by: twing207 on January 24, 2017, 06:57:37 AM
Do you use both the accelerometer and the gyro in your code or only the accelerometer?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 24, 2017, 08:46:27 AM
Do you use both the accelerometer and the gyro in your code or only the accelerometer?

I use both.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: theholyduck on January 25, 2017, 04:03:16 AM
Would it be possible/are you planning too add user programmable pwn "drive" for the mosfets on a per detected blade type level? for instance. i have a set of leds whos factory rated voltages are 3.2-3.6v where as my battery will run from 4.2 to 3.0 or whatever. you can run these without a resistor but its not ideal. meanwhile resistors themselves are not ideal either. especially when you are talking really big powerful led strings.

a possible solution for this as i understand it is to reduce the pwm on time to the mosfets to let those bleed the excess voltage instead. at least for small drops like driving green/blue in parallel on 1 18650 or green/blue in series on 2 18650s. or 3 reds in series on 2 18650s.

I could probably hard code in specific pwm rate which is safe for 1 blade but im not much of a programmer and it seems like it could be pretty useful to implement a universal version of this. it would allow driving led stars and various types of led strings without resistors. and you could also potentially make the on time increase as battery voltage decreases thereby maintaining a consistent brightness for longer. also this would allow for some flash on clash effects for single string blades by temporarily over driving the string to boost brightness. and finally it would allow introducing some blade shimmering to the simple blades.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 25, 2017, 08:40:47 AM
I have been considering this, but I have not implemented it yet.
In fact, I think there are three different ways to implement this.....

A) The first way I considered was to use an actual hardware feedback loop.
   This would be a true constant-voltage drive. However, it turns out to
   be somewhat difficult to implement, and the FET would have to absorb the
   extra voltage, making it heat up and possibly damage it.

B) The second way is to use a very very fast PWM signal to achieve something
   similar. Since the gate on the FET is basically a capacitor, it would smooth
   out the PWM signal. However, I don't think that would work well because the
   transition region for the FET can vary from transistor to transistor, so without
   a feedback loop there is no way to know exactly what the output voltage would be.
   And, even if it worked, the FET would still heat up a lot.

C) The third way is to stay at the same PWM rate as before, but simply reduce the
   time we spend in the "on" state per cycle if the voltage is too high.
   Basically, if your led is made for 3.8 volt, but the battery is currently at 4.0 volt,
   we would turn the PWM to 3.8/4.0 = 95%. The LED would still get hit with the full 4.0
   voltage, but hopefully it wouldn't over-heat and die since it's not on 100%.
   Doing it this way would prevent the FET from over-heating, but I also don't know how well it
   works. LEDs are non-linear and turning it off for 5% of the time might not be enough to
   protect it from dying. It might also affect the brightness and color of the LEDs in ways
   that could be annoying. (Or not, I simply don't know yet.)

For my setup, I use resistors to bring down the voltage a bit to match the LEDs, but I
use the nominal voltage of the battery (3.7 volts) for the resistor calculations. Since
the voltage of the battery is often higher than this when fully charged, I was thinking
that using one of the solutions above might be good. But as I said: I have not actually
tried this yet. Option (C) would be fairly easy to implement though.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: theholyduck on January 25, 2017, 09:35:05 AM
Im partial to option B but yeah. i think it would require using a known mosfet or having the user configure it for their particular mosfets. as i understand it the DIYino/LSOS uses method B. im going to do some testing with my sacrificial Chinese led string to see how much the Mosfets heat up dropping say 0.25-0.5v for various loads. but it might only be an option for segmented led strings/serialel setups where the total amperage is pretty low.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 25, 2017, 09:48:40 AM
Remember that your FETs will live in a cramped enclosed space with little or no air circulation.... Whatever your data sheet says about heat dissipation will probably have to be divided by 10 or so...
Title: Re: Announcing the Teensy Saber open source sound board
Post by: theholyduck on January 25, 2017, 10:01:53 AM
yeah. im actually going to test it instead of looking at the datasheet. also worst comes to it. it would not be impossible to use some bent sheet aluminium and some non conductive thermal adhesive to jury rig a the saber hilt into a not very efficient heat sink. but im testing how far just cramped non circulating air cooling will get me right now.

But the fact they were able to make option B work in the DIYino without any active cooling or heat sinks tells me its definitely doable up to a certain amperage.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 25, 2017, 02:37:20 PM
I don't see this in LSOS, is it on a branch or something?
Do you have a link or something?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: theholyduck on January 25, 2017, 02:52:52 PM
If im reading it right the MAX_BRIGHTNESS in this is the definition for the drive fraction for the mosfet https://github.com/neskweek/LightSaberOS/blob/master/Config.h (https://github.com/neskweek/LightSaberOS/blob/master/Config.h)
at least based on how that is used in https://github.com/neskweek/LightSaberOS/blob/master/Light.cpp (https://github.com/neskweek/LightSaberOS/blob/master/Light.cpp)
the max brightness is moddified based on the sound of the saber/clashes/etc

ctrl+f GitHub - neskweek/LightSaberOS: Operating System for Arduino based LightSaber (https://github.com/neskweek/LightSaberOS) for MAX_BRIGHTNESS for some more info



Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 25, 2017, 03:17:29 PM
I don't think MAX_BRIGHTNESS represents option (B), even if the DIYino manual makes it sound that way. A few reasons:

1) It doesn't depend on the battery level. So if your battery is at 3.0 volt, it will still won't run the LED at 100%

2) As far as I can tell, they use the default (1000Hz) PWM frequency. Since the FET they used have a rise time of
   35 ns[1] (MAX), the FET will spend almost no time in a half-on where the voltage is actually reduced. Option (B)
   either requires additional capacitors, or a much much higher PWM frequency.

What DIYino has is more like option (C), but without the battery feedback.


[1] 35ns is if Vgs is 10 volts. Since VGS will probably be 3.3 volt in our case, the rise time will actually be bigger, but not 10000 bigger, which it what it would need to be to become more like "option B".
Title: Re: Announcing the Teensy Saber open source sound board
Post by: theholyduck on January 25, 2017, 04:03:31 PM
i guess i misunderstood it then. either way. i just copy and pasted parts code they use and it seems to very effectively dim my leds and draw less amps from my bench PSU and the mosfets stay ice cold

being able to add some blade shimmer and removing the need for resistors in somoe cases seems like it could be worthwhile
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 25, 2017, 06:32:56 PM
I have three important questions, that maybe you can test:

LED A: runs at the exact voltage it's rated for
LED B: runs at a higher voltage, but uses PWM @ 1000 hz to compensate[1]
LED C: runs at a higher voltage, but does not use PWM to compensate

Question 1: Will A and B be (roughly) equally bright?
Question 2: Will B become hotter than A?  (Note, the LEDs, not the FETs[2])
Question 3: Will the life span of B be closer to A or C?  (probably related to question 2)

Because LEDs are not linear, I suspect that the answers are no, yes, C.
If that is correct, using PWM to compensate for higher voltage won't work very well.

[1] It runs at 20% more volts, it would use set the PWM duty cycle to 100/1.2=83% percent.
[2] FETs should not heat up much at 1000Hz, regardless of the amount of dimming.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: theholyduck on January 26, 2017, 02:03:47 AM
as i understand it. as long as the amperage is high enough. A and B wouldn't be too far from equally bright. in my current leds datasheet. its rated for 110mA at a 10% cycle. it draws 110ma at 4.2 volts and is rated to be 3 times brighter at 110ma vs 20ma. so in an ideal world at say a 30%? cycle it ought to be pretty close in brightness.

running it at 30% would eat into its lifetime but honestly probably not too badly. the thing that damages the led is junction heat and its not like we are able to power the leds 24/7 off batteries so they have thermal mass in terms of bodies. legs and and wiring to heat up (my leds have silver plated copper legs for extra heat dissipation) also we spend little time at 4.2 volts.

then there are the naturally limiting factors like our batteries and our mosfets and our wiring all off which have resistance and will help slow things down

all in all id say B is probably closer to A.

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.535.7942&rep=rep1&type=pdf (http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.535.7942&rep=rep1&type=pdf) here is a paper studying PWM vs constant current on power leds. same average amperage through all leds. and same lifetime so far. despite 1 of them running at 3 times peak amperage. 


the NB seems to have something like whatt we were dicussing earlier in terms of absorbing voltage in the mosfet. atleast http://www.plecterlabs.com/Media/Doc/Nano%20Biscotte%20v3-GB.pdf (http://www.plecterlabs.com/Media/Doc/Nano%20Biscotte%20v3-GB.pdf) page 21 is suggestive of it. the NB isnt using a constant current driver. and the manual explicitly say not to use a drive under 80%. presumably due to overheating tthe mosfettt.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 26, 2017, 09:59:51 AM
Sounds like an interesting paper. The key to making this work well seems to be to accurately predict the current for a given voltage. This could probably be done with an affine model, but I will have to consult the crew datasheets...
Title: Re: Announcing the Teensy Saber open source sound board
Post by: theholyduck on January 26, 2017, 11:16:39 AM
i think its probably fine to just leave it user configurable with say 2 values for any given blade/mosfet combo. like "duty cycle at max volts and "voltage to go 100% duty cycle. then just find out some sensible reasonably conservative way to ramp the duty cycle between those 2 numbers. it would be up to the user to configure a sensible value for the 2 depending on how much they value brightness vs led lifetime.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 26, 2017, 12:45:15 PM
Actually, I think what I'm going to implement is a class LEDModel which will replace the #define BLUE (or red or whatever).

An LEDModel class could look like this:

class CreeXPE2Blue {
  public:
    const float MaxAmps = 1.0;  // these four values are from the cree datasheet
    const float MaxVolts = 3.4;
    const float P2Amps = 0.35;
    const float P2Volts = 3.2;
    const float R = 0.51;   // resistor value, 0 if there is no resistor
    const int Red = 0;
    const int Blue = 255;
    const int Green = 0;
};

Then I will assume that thee curve between P2 and Max is roughly linear (and also beyond Max).
If the voltage across the LED is higher than MaxVolts, I will calculate what I think the current is and scale the PWM frequency back accordingly.
There will be one of these for each channel.

If the paper you linked to is right, this would practically eliminate the need for resistors, and the FETs will not heat up since I am not increasing the PWM frequency.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 27, 2017, 12:19:31 AM
Ok, I implemented it, but I haven't tested it much yet.
I uploaded version 1.22 to my website but didn't publish the link yet.
If you want to try it out, you can download it here (http://fredrik.hubbe.net/lightsaber/lightsaber-1.22.ino).
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi_1 on January 27, 2017, 04:30:27 AM
I don't think MAX_BRIGHTNESS represents option (B), even if the DIYino manual makes it sound that way. A few reasons:

1) It doesn't depend on the battery level. So if your battery is at 3.0 volt, it will still won't run the LED at 100%

2) As far as I can tell, they use the default (1000Hz) PWM frequency. Since the FET they used have a rise time of
   35 ns[1] (MAX), the FET will spend almost no time in a half-on where the voltage is actually reduced. Option (B)
   either requires additional capacitors, or a much much higher PWM frequency.

What DIYino has is more like option (C), but without the battery feedback.


[1] 35ns is if Vgs is 10 volts. Since VGS will probably be 3.3 volt in our case, the rise time will actually be bigger, but not 10000 bigger, which it what it would need to be to become more like "option B".

Actually the DIYino Manual is a purely hardware manual, not dealing with software topics. It does say however a few words about PWM and how to control your LEDs. I follow a practical and straightforward solution, at least with LED strings and high=power LEDs: make sure your battery voltage is less than the Vmax of your LEDs in order not to damage them or use resistors to absorb the delta, so that you are in the safe range, not overdriving your LEDs. Then use can use the mofsets to control the brightness using PWM. The PWM itself will of course vary with supply, but for simplicity's sake assume 5V supply, so the mosfet gate will see 5V pulses, but the gate capacitance will smooth it (integrate) to the desired voltage. What this means for the LEDs hanging on the drain of the fet depends on a lot of factors like characteristics of the used mosfets, you battery solution etc. IN other words it is hard to impossible to standardize it without spending considerable effort in hardware and/or software.

One can of course burn some voltage over the fets, but you need to know what you are doing if going down that path. To certain extent it is doable, for instance I never ever consider putting a resistance to blue or green LED using a 3.7V battery, because even with 4.2V max charge the drops on the lines will be enough to constrain the power to the LEDs. If you consider using the fets as a voltage controlled resistor, take a look at the total power dissipation parameter, for one type of fet I used for DIYino this says 0.83W. Means if you want to burn voltage maintaining 1A, you can burn 0.83V over the fet, maximum. But LEDs are inherently diodes, so reducing the voltage means you reduce the current exponentially. Which helps. I think personally that this topic gets hot only if someone tries to apply 7.4V (2x18650) and use the fets to dissipate the voltage surplus using single LEDs instead of a serial solution. THat will lead to problems. Another factor is what your PCB can conduct without heating up. Lightsaber boards are supposed to be small, so there is no area to waste by making huge planes for heat dissipation. It's the reason for instance why PL boards are restricted up to 2A. But Unless you have an exotic solution or using neopixels with a crazy strong battery without protection, LED strings and high-power LEDs can give you more than decent brightness without exceeding the 2A.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: theholyduck on January 27, 2017, 06:30:48 AM
Yeah. i think you would ideally use a resistor for red/yellow/etc.

But as a counterpoint to running resistor less. my test green led string draws 2 amps a 3.3 volts and 3.2 amps at 3.6 volts. maxing out my bench power supply at 5 amps at 4.0 volts. yes the internal resistance of the 18650 and mosfet and wiring will help when running in a saber. but will it help enough to be safe/sensible to run without some sort of additional limiting like pwm or voltage drops? (i blew both fuses on my multimeter whoopsie) so im not quite sure how to verify how sane it would be to run it off a full 18650
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 27, 2017, 11:55:44 AM
I want to be absolutely crysstal clear about what I implemented.

It uses a linear model to estimate the current over the LED, and reduces the duty cycle in proportion to how much over the max amps that estimate is.

Will this cause the FET to heat up? Technically, yes, but not really.
During PWM, we'll be transitioning from on to off 2000 times per second. Reading the datasheet from the FET I use on the V2 board, that transition takes about 20ns. If we assume that the FET were to absorb ALL the 3.7 watts that the LED might generate for during those 20ns, we get: 3.7 * 2E-9 * 2000 = 0.000148. Which means that for a 1-amp led the FET would have to dissippate an extra 150 microwatts, which is almost nothing.

However, I think you still need resistors in most cases, because LEDs are not linear, and the amps go up very quickly as the voltage goes up.
Take an white Cree XP-E2 as an example:

At 2.9 volts you get 350mA. At 3.05 volts you get 700mA. At 3.15 volts you get 1000mA.
This is roughly 300mA per 0.1 volts. So if we extrapolate, at 3.8 volts we would get about 3A.
I'm almost certain that the LED will not be 3 times brighter, but my math will assume that it is and set the PWM duty cycle to about 30%.
I have no idea what will happen if you do that. It may work perfectly, or it may not.
I think what I will do in the future is that I will use a smaller nominal voltage (say 3.5 volts) when I calculate my resistors, and let the PWM code make up for the rest. Futher experimentation is needed to decide if resitors can be done away with completely or not.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 27, 2017, 01:49:31 PM
Apparently CREE has studied the effects of driving your LED like this:

http://www.cree.com/~/media/Files/Cree/LED%20Components%20and%20Modules/XLamp/XLamp%20Application%20Notes/XLampPulsedCurrent.pdf (http://www.cree.com/~/media/Files/Cree/LED%20Components%20and%20Modules/XLamp/XLamp%20Application%20Notes/XLampPulsedCurrent.pdf)

TL;DR; it works, but reduces efficiency and may reduce the lifetime of the LED.
For practical purposes, it seems like it's ok to do this for currents up to ~1.5x the rated current. And it's better than not doing it (meaning that you drive the LED at 1.5 the current all the time.)

Note that the datasheets will not say what voltage you can handle to get 1.5x the rated current, so you either have to measure or extrapolate to figure that out.

Once I/we have tested this some more, I will write up some instructions/recommendations and put on my site.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: G3DI on January 29, 2017, 10:29:20 PM
Thanks for sharing your design. It's making my job of building a light saber for my daughter much easier. I'm using the Teensy 3.5 with your code, and it's working with just a few minor changes.

I am experiencing an issue when using polyphonic fonts. The background hum goes away if I swing the saber for more than a few seconds. Clashes don't seem to cause the hum to stop, and it will hum forever if the saber remains still. When the hum does disappear, the other sounds (swing / clash) still continue to work. Do you have any idea as to what might cause this? Also, when using polyphonic fonts do I need to remove the monophonic fonts?

Regarding the discussion on PWMing the LED, have you considered putting an inductor in series with the LED? (A parallel diode would also be required to allow the current to recirculate when the FET turns off.) With the inductor sized properly, the LED would see a lower continuous current with a bit of ripple on top of it rather than alternating between zero current and peak current. As a bonus, per the Cree paper you linked to earlier, the LED efficiency should increase. Note that the switching frequency would need to be increased at least into the tens of kHz range to keep the inductor a reasonable size. I might try this with my daughter's saber.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 29, 2017, 11:57:18 PM
I am experiencing an issue when using polyphonic fonts. The background hum goes away if I swing the saber for more than a few seconds. Clashes don't seem to cause the hum to stop, and it will hum forever if the saber remains still. When the hum does disappear, the other sounds (swing / clash) still continue to work. Do you have any idea as to what might cause this? Also, when using polyphonic fonts do I need to remove the monophonic fonts?

I shall have to investigate this.
It might be helpful to know more about the font you're using.
Normally, each font should live it's own directory on the sdcard, and it's fine to have both polyphonic and monophonic fonts. (Just not in the *same* directory...)

Quote
Regarding the discussion on PWMing the LED, have you considered putting an inductor in series with the LED? (A parallel diode would also be required to allow the current to recirculate when the FET turns off.) With the inductor sized properly, the LED would see a lower continuous current with a bit of ripple on top of it rather than alternating between zero current and peak current. As a bonus, per the Cree paper you linked to earlier, the LED efficiency should increase. Note that the switching frequency would need to be increased at least into the tens of kHz range to keep the inductor a reasonable size. I might try this with my daughter's saber.

Hmm, it's an interesting idea. I'm trying to figure out how to code for it, because we would want to adjust the PWM rate to adjust the voltage and the PWM duty cycle to control the brightness. (Not sure if there are enough timers in the teensy to have per-pin PWM frequencies...)

Also, there are options for as to where the inductors would go. They could either go in the hilt, or they could go in the blade adapter. (In a TeensySaber V2, they could potentially go on the board) However, if they go in the hilt, they would also be in-line when I hook up a neopixel blade, which can eat as much as 17 amps, so the inductors would have to be pretty beefy.  Putting them in the blade adapter might be a better option, as they would not need to handle as much current.

Another option might be to use parallel capacitors instead of serial inductors. The result should be the same, but since the current doesn't go through the capacitors, they don't have to be sized to handle 17A, and perhaps that could be in the hilt and/or on the TeensySaberV2 board.

Of course, if you just add a resistor and a feedback loop, it's a proper constant-current drive system, which would be nice....
Title: Re: Announcing the Teensy Saber open source sound board
Post by: G3DI on January 30, 2017, 11:29:26 PM
It might be helpful to know more about the font you're using.
Normally, each font should live it's own directory on the sdcard, and it's fine to have both polyphonic and monophonic fonts. (Just not in the *same* directory...)
I am using the Star Wars Pack by joe93barlow at freesound.org. On the SD card I put the following folders and files:
  -- font01
      -- blst
         -- blst01.wav
         -- blst02.wav
         -- blst03.wav
         -- blst04.wav
         -- blst05.wav
      -- clsh
         -- clsh01.wav
         -- clsh02.wav
         -- clsh03.wav
      -- hum
         -- hum01.wav
      -- in
         -- in.wav
      -- out
         -- out.wav
      -- swng
         -- swng01.wav
         -- swng02.wav
         -- swng03.wav
         -- swng04.wav
         -- swng05.wav
         -- swng06.wav
         -- swng07.wav
         -- swng08.wav
         -- swng09.wav

Also, after losing the background hum, when I turn the saber off the 'hum' clip plays once instead of the 'blade off' clip.

Do you have any recommendations for fonts?

Quote
Hmm, it's an interesting idea. I'm trying to figure out how to code for it, because we would want to adjust the PWM rate to adjust the voltage and the PWM duty cycle to control the brightness. (Not sure if there are enough timers in the teensy to have per-pin PWM frequencies...)
I think the PWM rate could remain constant. The duty cycle will vary the current in the LED, and as long as the duty cycle is not 100% the LED will not see the full battery voltage.

The LED dimmer circuit 'f' on Highly Efficient 0-100% LED Dimmer (http://www.opensourcepartners.nl/~costar/leddimmer/) is what I'm thinking about, but I would put the transistor between ground and the LED so it can be driven directly from the teensy.

Quote
Of course, if you just add a resistor and a feedback loop, it's a proper constant-current drive system, which would be nice....
It looks like the teensy has 3 analog comparaters that can connect to the analog inputs. I have not looked into the details but maybe you could use them with a current sense resistor for cycle-by-cycle current limiting. That could be a simple constant-current drive on your TeensySaberV2...
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on January 30, 2017, 11:58:15 PM

Also, after losing the background hum, when I turn the saber off the 'hum' clip plays once instead of the 'blade off' clip.


That is a very good hint, I haven't had time to debug yet, but I think that will help a lot.

Quote
Do you have any recommendations for fonts?

Not really, fonts are very personal, and depends very much on what feels good for your saber.
I tend to go for sounds from the movies, but I really haven't decided what font(s) I like best.

Quote
I think the PWM rate could remain constant. The duty cycle will vary the current in the LED, and as long as the duty cycle is not 100% the LED will not see the full battery voltage.

The LED dimmer circuit 'f' on Highly Efficient 0-100% LED Dimmer (http://www.opensourcepartners.nl/~costar/leddimmer/) is what I'm thinking about, but I would put the transistor between ground and the LED so it can be driven directly from the teensy.

It's definitely interesting. I think I'm going to keep it simple for now. The cree paper indicates that keeping it simple isn't as bad for the LEDs as I thought it would be, and using PWM to keep the leds from overheating should work fairly well.  As for efficiency, I think that you loose a few percent of efficiency when the LED is over-volted, but if you add an inductor/capacitor and up the PWM frequency, you loose a few percent that way too.

A constant-current setup would be really nice, but I'm not sure it's worth the extra complexity and components.

Quote
Quote
Of course, if you just add a resistor and a feedback loop, it's a proper constant-current drive system, which would be nice....
It looks like the teensy has 3 analog comparaters that can connect to the analog inputs. I have not looked into the details but maybe you could use them with a current sense resistor for cycle-by-cycle current limiting. That could be a simple constant-current drive on your TeensySaberV2...

Another good idea. Although probably overkill since the load isn't going to be varying wildly.
Probably easier to just average over time and just adjust the PWM accordingly.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: twing207 on February 01, 2017, 01:31:24 PM
What is the purpose of the LiPower board? I can't see why it is *needed*.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on February 01, 2017, 01:42:01 PM
When I built my V1 setup, I just followed the guidelines for the prop shield, which says to provide 5V.
Now that I know hwo everything works better, I agree: It's not required, but there are a few caveats:
1. Once the battery goes low enough, the 3.3v power supply will start to drop. The teensy itself can handle this, but it's less clear if the other components that use 3.3 volts can: sd card and IMU.
2. The amplifier will keep working, but it will produce a lot less sound at lower voltages.

Right now I'm considering an upgrade for the TeensySaber V2 design which would replace the power booster with one that can also handle higher input voltages, (up to 12 volts) which would make two-battery setups very easy.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Zephisto on February 04, 2017, 05:56:42 AM
ohh this will be fun
Title: Re: Announcing the Teensy Saber open source sound board
Post by: theholyduck on February 04, 2017, 02:09:30 PM
I had a little bit of an issue with a wire shortingand accidentally sending the power of my unprotected 18650 directly through my teensy and letting out the magic smoke (whoopse) The teensysaber was a bit too bulky to really fit inside my application anyway so i went and ordered a DIYino. but i am still interested in your v2 board when its ready for sale. i really liked the tensy saber right until i fried it.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on February 04, 2017, 11:24:02 PM
That's a darn shame. I managed to hook up my battery backwards a few times, which made both the teensy and the LiPower VERY hot, but did not seem to cause any permanent damage. The teency 3.2 is 5v tolerant, which makes it hard to fry it with a 3.7-volt battery, but it is possible.

If everything goes well, I will have a small amount of V2s to sell in a couple of weeks.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: theholyduck on February 05, 2017, 04:54:21 PM
Im pretty sure its dead. there i s a dead short between gnd/agnd/3.3v and i cant find any solder bridges or solder mask issues im pretty sure i killed the power regulator part of it.
Title: A proposal for swing synthesis
Post by: Lolwel21 on February 17, 2017, 11:13:39 PM
The following method can be implemented with only slight modifications to the already implemented audio system. As a proof of concept, I made a Processing sketch that demos the technique (from scratch) in less than 2 hours using only Minim's most basic features (volume control, looping, and file playback).

Disclaimer: The following technique will require serious modification of all sound-fonts used.
Namely, the swing sound needs to be turned into a (non-pulsating) looping sound, much like the idling hum sound. More details on that later.

Basically, the operating system will constantly loop both the humming and the swinging sounds. When the gyroscope (and/or accelerometer) detects blade motion, the program mixes the swinging sound in and ducks the hum.

As the blade reaches its max speed (determined by sensitivity), the swing sound is amplified to the point of clipping, resulting in that classic, clipped sound fast-moving lightsaber blades make. At this point, the idle hum is at 0 volume.

To enhance the sound when twirling the lightsaber, I suggest that as the blade approaches straight up, the 'sensitivity' is reduced, resulting in a desirable pulsating sound when you twirl the lightsaber (Vertical orientation sensed either using the magnetometer or the accelerometer).

What do you think? How easy would this technique be to implement? Would sound-font makers consider the additional difficulty worth it?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on February 17, 2017, 11:34:00 PM
Interesting! This would be relatively easy to implement in the teensysaber code.
It would be enough to simply name the swings differently to tell the code that we need to play them differently.
We wouldn't have to modify all sound fonts, this would just be one more way to make sound fonts.

I can try putting it in the teensysaber code this weekend. Access to an appropriately looped font and the processing sketch you made would make it quicker and easier. :)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Lolwel21 on February 18, 2017, 08:50:33 AM
I'd love to! However, I'm a new member, and haven't figured out how to attach something yet. I'll just link to a Google Drive of the Zipped project I guess...
I've already packed the sound files into the Processing sketch, and have set it up so that you just move the mouse cursor around to see how the swing works! I haven't figured out how to do the whole clipping effect with Minim, but oh well. That would be much easier to do on the Teensy than it would in Minim.

Just a note, the sound-font I made is makeshift (compiled from online resources), and mostly the swing and maybe the hum will  be useful.

Here it is! Lightsaber_Motion_Test.zip - Google Drive (https://drive.google.com/file/d/0BznPsR-1haUacTdod3QxYXMwcUE/view?usp=sharing)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on February 18, 2017, 10:28:05 AM
I'd love to! However, I'm a new member, and haven't figured out how to attach something yet. I'll just link to a Google Drive of the Zipped project I guess...

That's probably the right way to do it! :)

Quote
I've already packed the sound files into the Processing sketch, and have set it up so that you just move the mouse cursor around to see how the swing works! I haven't figured out how to do the whole clipping effect with Minim, but oh well. That would be much easier to do on the Teensy than it would in Minim.

Just a note, the sound-font I made is makeshift (compiled from online resources), and mostly the swing and maybe the hum will  be useful.

Here it is! Lightsaber_Motion_Test.zip - Google Drive (https://drive.google.com/file/d/0BznPsR-1haUacTdod3QxYXMwcUE/view?usp=sharing)

Thanks, I will have a go at this later. :)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Thexter on February 18, 2017, 12:28:19 PM
Lolwel21, it's funny you mentioned this. I have been working on something very similar for a while now. I've just posted another thread in New Ideas and Technologies so as not to hi-jack this thread. The gist of it is that I found I needed 3 sounds to get the effect I was going for.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on February 22, 2017, 08:53:59 PM
I've uploaded new TeensySaber software to the usual place (http://fredrik.hubbe.net/lightsaber/teensy_saber.html).

ChangeLog (since 1.20)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: bobi-one on February 24, 2017, 12:20:53 AM
 one question though, why do you write everything in the same file :D
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on February 24, 2017, 09:45:24 AM
I could go into a long debate about the pros and cons, but ultimately I have just been too lazy to split it up. :)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 01, 2017, 02:16:09 PM
Quote

ChangeLog (since 1.20)
  • Updated LED configuration system
  • Uses PWM to reduce heat when over-volting
  • Fixed a bug in audio hum looping
  • Improved audio buffering
  • Better help system in console
  • Support for multiple touch buttons
  • Code cleanup
  • Support for TeensySaber V2 almost complete

I am building the Teensy Saber with a few students of mine and we encountered a problem with uploading the software to the Teensy 3.2. I can upload the 1.20 software version to the board, but when I try the new version 1.38 I get this error message (I apologize in advance for the long message)

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:336:3: warning: multi-line comment [-Wcomment]

   // Swing rotation speed   \

   ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'virtual void SaberBasePassThrough::Clash()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:324:24: error: expected primary-expression before ')' token

   SABERFUN(Clash, (), ());   \

                        ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:361:22: note: in definition of macro 'SABERFUN'

     delegate_->NAME (ARGS);   \

                      ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:364:3: note: in expansion of macro 'SABERBASEFUNCTIONS'

   SABERBASEFUNCTIONS();

   ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'virtual void SaberBasePassThrough::Stab()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:325:23: error: expected primary-expression before ')' token

   SABERFUN(Stab, (), ());   \

                       ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:361:22: note: in definition of macro 'SABERFUN'

     delegate_->NAME (ARGS);   \

                      ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:364:3: note: in expansion of macro 'SABERBASEFUNCTIONS'

   SABERBASEFUNCTIONS();

   ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'virtual void SaberBasePassThrough::On()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:326:21: error: expected primary-expression before ')' token

   SABERFUN(On, (), ());    \

                     ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:361:22: note: in definition of macro 'SABERFUN'

     delegate_->NAME (ARGS);   \

                      ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:364:3: note: in expansion of macro 'SABERBASEFUNCTIONS'

   SABERBASEFUNCTIONS();

   ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'virtual void SaberBasePassThrough::Off()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:327:22: error: expected primary-expression before ')' token

   SABERFUN(Off, (), ());   \

                      ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:361:22: note: in definition of macro 'SABERFUN'

     delegate_->NAME (ARGS);   \

                      ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:364:3: note: in expansion of macro 'SABERBASEFUNCTIONS'

   SABERBASEFUNCTIONS();

   ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'virtual void SaberBasePassThrough::Lockup()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:328:25: error: expected primary-expression before ')' token

   SABERFUN(Lockup, (), ());   \

                         ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:361:22: note: in definition of macro 'SABERFUN'

     delegate_->NAME (ARGS);   \

                      ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:364:3: note: in expansion of macro 'SABERBASEFUNCTIONS'

   SABERBASEFUNCTIONS();

   ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'virtual void SaberBasePassThrough::Force()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:329:24: error: expected primary-expression before ')' token

   SABERFUN(Force, (), ());   \

                        ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:361:22: note: in definition of macro 'SABERFUN'

     delegate_->NAME (ARGS);   \

                      ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:364:3: note: in expansion of macro 'SABERBASEFUNCTIONS'

   SABERBASEFUNCTIONS();

   ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'virtual void SaberBasePassThrough::Blast()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:330:24: error: expected primary-expression before ')' token

   SABERFUN(Blast, (), ());   \

                        ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:361:22: note: in definition of macro 'SABERFUN'

     delegate_->NAME (ARGS);   \

                      ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:364:3: note: in expansion of macro 'SABERBASEFUNCTIONS'

   SABERBASEFUNCTIONS();

   ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'virtual void SaberBasePassThrough::Boot()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:331:23: error: expected primary-expression before ')' token

   SABERFUN(Boot, (), ());   \

                       ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:361:22: note: in definition of macro 'SABERFUN'

     delegate_->NAME (ARGS);   \

                      ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:364:3: note: in expansion of macro 'SABERBASEFUNCTIONS'

   SABERBASEFUNCTIONS();

   ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'virtual void SaberBasePassThrough::NewFont()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:332:26: error: expected primary-expression before ')' token

   SABERFUN(NewFont, (), ());   \

                          ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:361:22: note: in definition of macro 'SABERFUN'

     delegate_->NAME (ARGS);   \

                      ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:364:3: note: in expansion of macro 'SABERBASEFUNCTIONS'

   SABERBASEFUNCTIONS();

   ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'virtual void SaberBasePassThrough::BeginLockup()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:333:30: error: expected primary-expression before ')' token

   SABERFUN(BeginLockup, (), ());  \

                              ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:361:22: note: in definition of macro 'SABERFUN'

     delegate_->NAME (ARGS);   \

                      ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:364:3: note: in expansion of macro 'SABERBASEFUNCTIONS'

   SABERBASEFUNCTIONS();

   ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'virtual void SaberBasePassThrough::EndLockup()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:334:28: error: expected primary-expression before ')' token

   SABERFUN(EndLockup, (), ());   \

                            ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:361:22: note: in definition of macro 'SABERFUN'

     delegate_->NAME (ARGS);   \

                      ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:364:3: note: in expansion of macro 'SABERBASEFUNCTIONS'

   SABERBASEFUNCTIONS();

   ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: At global scope:

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:1799:1: error: 'BufferedWavPlayer' does not name a type

 BufferedWavPlayer* GetFreeWavPlayer()  {

 ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:1815:12: error: 'T' has not been declared

   int read(T* data, int elements) override {

            ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:1815:7: error: 'int VolumeStream::read(int*, int)' marked override, but does not override

   int read(T* data, int elements) override {

       ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In constructor 'VolumeStream::VolumeStream()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:1811:36: error: unable to find numeric literal operator 'operator"" _'

   VolumeStream() : volume_(16384 / 100_) {

                                    ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'int VolumeStream::read(int*, int)':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:1816:44: error: no matching function for call to 'DataStream<short int>::read(int*&, int&)'

     elements = source_->read(data, elements);

                                            ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:1816:44: note: candidate is:

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:602:15: note: int DataStream<T>::read(T*, int) [with T = short int]

   virtual int read(T* data, int elements) = 0;

               ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:602:15: note:   no known conversion for argument 1 from 'int*' to 'short int*'

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:1822:3: warning: no return statement in function returning non-void [-Wreturn-type]

   }

   ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: At global scope:

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:1997:8: error: 'void MonophonicFont::Motion(float)' marked override, but does not override

   void Motion(float speed) override {

        ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:2012:8: error: 'void MonophonicFont::XMotion(float)' marked override, but does not override

   void XMotion(float speed) override {}

        ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:2143:8: error: 'void PolyphonicFont::Motion(float)' marked override, but does not override

   void Motion(float speed) override {

        ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:2158:8: error: 'void PolyphonicFont::XMotion(float)' marked override, but does not override

   void XMotion(float speed) override {}

        ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:2170:8: error: 'void SyntheticFont::Motion(float)' marked override, but does not override

   void Motion(float speed) override {

        ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:2181:8: error: 'void LoopedSwingWrapper::Activate()' marked override, but does not override

   void Activate() override {

        ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'void LoopedSwingWrapper::Activate()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:2182:16: error: 'class SaberBase' has no member named 'Activate'

     delegate_->Activate();

                ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: At global scope:

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:3201:8: error: 'void WS2811_Blade::IsOn(bool*)' marked override, but does not override

   void IsOn(bool* on) override {

        ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:3216:8: error: 'void WS2811_Blade::Top()' marked override, but does not override

   void Top() override {

        ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:3395:8: error: 'void Simple_Blade::IsOn(bool*)' marked override, but does not override

   void IsOn(bool *on) override {

        ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'void Parser::ParseCmd()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:4890:7: error: 'DoTop' is not a member of 'SaberBase'

       SaberBase::DoTop();

       ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'virtual void Orientation::Loop()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:5221:2: error: 'DoXMotion' is not a member of 'SaberBase'

  SaberBase::DoXMotion(gyro.x);

  ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:5222:2: error: 'DoMotion' is not a member of 'SaberBase'

  SaberBase::DoMotion(speed);

  ^

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino: In member function 'virtual void Amplifier::Setup()':

C:\Users\17991\Downloads\TeensySaber1.38\TeensySaber1.38.ino:5276:21: error: 'allocate_wav_players' was not declared in this scope

     for (size_t i = allocate_wav_players; i < NELEM(wav_players); i++) {

                     ^

Multiple libraries were found for "SD.h"
 Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD
 Not used: C:\Program Files (x86)\Arduino\libraries\SD
Error compiling for board Teensy 3.2 / 3.1.


Any ideas of what the problem could be? Is it because I am trying to upload the sketch without the other pieces attached to the teensy. Do I need to upload the sketch before I cut the vin/vusb. Because I tried connecting after and it didn't work.  So if that is the case how can you change the code once you cut the connection?

Also in the source code how to I can the touch button back to a regular button? I looked in previous messages and it said edit line 4220 but then code you had is not there anymore.

How do I change the default color in the code (if i am using one button) This way I can select what color I want without needing extra buttons.

I look forward to hearing from you

GMcIvor [/list]
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 01, 2017, 03:07:57 PM
No, looks like I screwed up and uploaded a different version than the one I tested. Sorry about that.
Try this one: http://fredrik.hubbe.net/lightsaber/lightsaber-1.40.ino (http://fredrik.hubbe.net/lightsaber/lightsaber-1.40.ino)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 01, 2017, 05:25:54 PM
Thank you I will give that a go tomorrow.

We appreciate all the work you have done.

regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 01, 2017, 07:52:17 PM
I missed answering some of the other questions earlier...


I am building the Teensy Saber with a few students of mine and we encountered a problem with uploading the software to the Teensy 3.2. I can upload the 1.20 software version to the board, but when I try the new version 1.38 I get this error message (I apologize in advance for the long message)


No worries, although usually only the first couple of errors are actually useful. :)

Quote
Any ideas of what the problem could be?

As stated before, this was all my fault. :)

Quote
Is it because I am trying to upload the sketch without the other pieces attached to the teensy.

No, it will upload just fine, but it might hang when it's trying to communicate with the motion chip.
You can comment out the #define ENABLE_MOTION near the top, which should prevent it from hanging.
Just put it back and re-upload once you have everything hooked up.

Quote
Do I need to upload the sketch before I cut the vin/vusb.
Because I tried connecting after and it didn't work.  So if that is the case how can you change the code once you cut the connection?

Once you cut vin/vusb, you need to provide external power to power the teensy. (In the V1 schematics, this means battery + LIPower board.)  Once it has power, you can upload new code.


Quote
Also in the source code how to I can the touch button back to a regular button? I looked in previous messages and it said edit line 4220 but then code you had is not there anymore.

There are two things you need to change:

1) Change the line
Code: [Select]
TouchButton power_; to just
Code: [Select]
Button power_;2) Change the line
Code: [Select]
power_(powerButtonPin, 1700, "pow") to
Code: [Select]
power_(powerButtonPin, "pow")
Quote

How do I change the default color in the code (if i am using one button) This way I can select what color I want without needing extra buttons.

TeensySaber is currently setup for two buttons. However, if you don't need to change presets, you can
just wire up one. The colors are defined by the presets (currently at line 3781). I'm going to have to put together a true one-button mode for my OWK saber though.

If you know a little programming, you can change what the buttons does yourself by modifying Saber::Loop() (around line 4586).

You probably also want to change the blades array (line 3838), to only have one blade.

There is is instructions for how to change the blade/color/led configuration, both on the website and in the code, but please don't hesitate to ask questions as that will help me improve the instructions.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 02, 2017, 09:00:28 AM
No worries, thank you for getting back to me. Yes, my students and I are using similar hilts to your OWK saber. We had to design our own chassis to fit our saber works well so far. I'll keep you updated on the progress and if any other problems arise. We will be using the PL9823 leds to create the blade. I will edit those configurations and get back to you.

regards,

gmcivor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 03, 2017, 10:24:01 AM
How did you get the solder to stick to the aviation connector? It does not want to stick at all. or did you use some other connector to attach the wires to the aviation connector?

regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 03, 2017, 10:46:06 AM
I soldered my wires directly to the aviation connector. The female connector (blade end) is easy, but the male end can be a little finnicky. However, there is a small hollow at the end of the pin, and if you heat the pin for a few seconds you should be able to get a small glob of solder to stick there, then tin the wire. (Keep the stripped part short, maybe 1/8" or so.) Then all you should need to do is to heat the pin until the solder melts and insert the wire. Make sure you have enough to flux btw. Liquid flux can be your friend for making all this stuff easier.  (Most of the time the flux in the solder is enough though, assuming you're using rosin-core solder.)

Oh, and it's possible that the connector is just oily/dirty. An oil film can make soldering a pain.

If all else fails, try using a small file to rough up the surface of the pins.

The pictures on my site will show bigger versions if you click them. This page shows what my soldering looks like if you click on the picture and zoom in a little: Teensy Saber Electronics (http://fredrik.hubbe.net/lightsaber/electronics.html)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 07, 2017, 02:27:09 PM
That seemed to work. I was so excited today I had to whole thing prototyped. I made a one led blade to see if it all works before I make the whole thing. I plugged it in and a light came on the teensy then disappeared. I touch the button wires together and nothing at all. I unplugged it move it around made sure everything was okay and nothing was shorting. But then i touched the teensy and it was scorching hot. I took the blade end out and undid the wires for the button. Then it cooled off. It might be shorted somewhere. Any ideas of what the problem maybe if you have encountered this? I really do not want to undo all the work we have put in to find the problem or cause.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 07, 2017, 03:12:59 PM
This sounds exactly like what happened when I plugged the battery in backwards.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 07, 2017, 05:31:05 PM
Okay, I will trouble shoot tomorrow. The side with the divet is the positive and the flat piece is the negative on the battery correct ? That is how I have it wired.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 07, 2017, 11:44:00 PM
Use a multimeter if you're not sure.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 08, 2017, 10:14:30 AM
The battery seems to be hooked in correctly. I must have 5v and gnd mixed up somewhere.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 08, 2017, 12:23:06 PM
Found the problem, I had the single LED blade wired wrong. I read the pin numbers wrong on the actual connector. So it now works, well half works onto my new problem. When I plug the connector in the led lights up and stays on. There is no sound, a slight noise from the speaker weather the SD card is in or not. The button does nothing. I have looked over the schematic and my wiring and it all seems to be in order. How do the sound fonts need to be categorized on the SD card? Any suggestions as to it half working?

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 08, 2017, 01:45:45 PM
This means that your Teensy isn't doing what it's supposed to.
Since my schematic doesn't have any pull-down resistors for the FETs, they will often (but not always) start up in an "on" state.
The teensy pins that controls the FET start in "input" (high impedance) mode, which will neither pull the FET control down, nor up, so they kind of stick in whatever state they are in.
Once the teensy boots, it should turn the FETs off, if that doesn't happen, there is a problem with the teensy or it's programming.

1) Plug in the teensy to a usb port on a computer, load up the arduino environment and power the teensy on using a battery.
2) Verify that you can re-program the teensy (hit the program button in arduino, and if you need to, push the program button on the teensy) (if you have problems with this step, go here: Troubleshooting common problems with the Teensy USB development board (https://www.pjrc.com/teensy/troubleshoot.html))
(If you reach this point, congratulations, your teensy is alive, now we just need to figure out the programming part...)
3) Verify that Tools -> USB Type is set to "Serial" (if not, do that and re-program)
4) Open up the serial monitor (ctrl-shift-m) and see what it says.
5) Try typing "help" in the serial monitor, if the teensy responds with a bunch of lightsaber-related commands, your teensy programming is working. (However, if the programming is working, why didn't the LEDs turn off?)

The file layout on the SD card is almost entirely up to you. Just create a directory for each sound font, then edit the blades and presets arrays to point to those directories. If the chip is responsive in the serial monitor, you can also test sound by typing "beep" or "play somefile.wav".

Btw, it's not *required*, but I recommend putting a USB hub between the teensy and your computer. This should protect your computer from damage if you short something while experimenting. I also don't recommend powering the teensy from a bench supply while hooked up to an USB port, as ground potential differences can cause problems.  (I only follow these recommendations some of the times myself though, so use your best judgement...)



Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 09, 2017, 09:19:35 AM
I tired that and it doesn't seem to be working. It registers the teensy and I can push programming button and it will say programming and then say reboot. But it doesn't seem to do anything to the teensy. I think I may have fried the teensy when it overheated by wiring the blade backwards.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 09, 2017, 04:20:38 PM
If you can program it, you should be able to make the serial monitor work. (Programming uses a large portion of the chip.)
(But, it's possible that some of the pins are fried, making it impossible to control the FETs.)

I would start from the basics: hello world  (tutorial here: Teensyduino: Using USB Serial with Teensy on the Arduino IDE (https://www.pjrc.com/teensy/td_serial.html))
If you can get that to work, then clearly programming, the chip, and the serial monitor works, so then
it's just a matter of figuring out what is wrong with TeensySaber.

I suspect that it's hanging in setup, either during audio setup or motion setup, both of which can be disabled
by changing the defines near the beginning of lightsaber.ino. This happens on my test rig all the time when I
run the test program without a TeensySaberV2 hooked up to the rig.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 10, 2017, 08:35:40 AM
So I remade the teensy/propshield/SD card module and I can get the serial monitor to work. It prints hello world as expected. I load the TeensySaber.ino on and I can get it to show the bat voltage but when I type help it doesn't give me any commands. When I pressed the power button it it says power on then off right away. When I first replaced it serial monitor would print power on when I pressed it then power off when I pressed it. When I press the button it turns it off but will not turn the led back it every time I press it it flashes dimly.

I built the battery charging unit to charge the battery because it had a low voltage what is the average charge time? It seems to be taking forever to actually charge any amount.

I was looking through the TeensySaber.ino and I found the blade configurations to change the blade ID resistor but I cant seem to see the sound font configuration. I probably have been staring at it to long and missed it. That always happens when you are looking for something you can never find it and when you aren't it will pop up and show its face.

Regards,

GMcIvor

 
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 10, 2017, 10:40:39 AM
Also, the serial monitor said the battery voltage was 1.51 and it was a brand new battery. The battery I took out said 1.6 and it was charging. I put a multi meter on it and it said it was 4.02v. Is this maybe the cause of my problem? or a factor? I wonder....

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 10, 2017, 10:53:01 AM
So I remade the teensy/propshield/SD card module and I can get the serial monitor to work. It prints hello world as expected.

Yay! Progress!

Quote
I load the TeensySaber.ino on and I can get it to show the bat voltage but when I type help it doesn't give me any commands.

If it's printing the battery voltage every 20-30 seconds, then we know it's not hanging, so that's good.
Help not working is weird though. What OS are you running? (I wonder if I have a CR-LF parsing issue?)

Quote
When I pressed the power button it it says power on then off right away. When I first replaced it serial monitor would print power on when I pressed it then power off when I pressed it. When I press the button it turns it off but will not turn the led back it every time I press it it flashes dimly.

The power button defaults to a touch button, did you follow the directions for changing it to a regular button?
The other reason it could be turning off is that it thinks the battery is too low. What voltage is it printing?
(Currently the limit is 3.0 volts.)  You might want to check that the battery voltage it's printing out is right
with a multimeter.

Quote
I built the battery charging unit to charge the battery because it had a low voltage what is the average charge time? It seems to be taking forever to actually charge any amount.

Depends on your battery and charger. Normally it takes a few hours for a full charge.
The batteries are generally capable of faster charge than the TCSS chargers allow, so you can hook it up to a bench power supply, limit it to 1 A and 4.2 volts, which will charge it faster. But don't leave it there for a long time, since the bench supply doesn't have a shut-off circuit.

Quote
I was looking through the TeensySaber.ino and I found the blade configurations to change the blade ID resistor but I cant seem to see the sound font configuration. I probably have been staring at it to long and missed it. That always happens when you are looking for something you can never find it and when you aren't it will pop up and show its face.

Regards,

GMcIvor

Each entry in the blades[] array looks like this:
Code: [Select]
  {   2600, WS2811BladePtr<97, WS2811_580kHz>(), CONFIGARRAY(presets) },
The first entry is the resistor value, the second is the blade driver, and the third is the array of presets.
In this example, the array of presets is called "presets", so let's go find that.
Each entry in the preset[] array looks like this:

Code: [Select]
{ "font01", "tracks/title.wav", StyleNormalPtr<CYAN, WHITE, 300, 800>() },
The first entry on this line is the sound font directory.
The second is the sound track. (Started by holding the power button for 2+ seconds and then letting go.)
The third entry is the style of the blade.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 10, 2017, 10:59:18 AM
Also, the serial monitor said the battery voltage was 1.51 and it was a brand new battery. The battery I took out said 1.6 and it was charging. I put a multi meter on it and it said it was 4.02v. Is this maybe the cause of my problem? or a factor? I wonder....

Regards,

GMcIvor

Yes, that's a problem.
I raelize now that my V1 electronics page never specifies what size resistor to use for the battery monitor.
In my saber I used a 23kOhm resistor, which is what the code expects.
If you used a different resistor, find the line that says
Code: [Select]
float pullup = 23000; and change it to the value of your resistor.
(I will update the web page to specify 23kOhm, but anything from a few k to a few hundred k should work find if you update the code.)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 10, 2017, 11:13:49 AM
Alright we have progress!!

Changing the pull up resistor value worked for reading to correct battery voltage so far. Fixed.

Serial monitor will display power on and power off when I press the button on the switch. Fixed.

But it will not display the options still. I am running windows 7 and Arduino 1.8.1.

So half the problems were fixed. The LED still stays on when I press the button... and there is no sound I cant get the program to read the hum, clash, on, off sound fonts. Do these directories get specified

 ({ "font01", "tracks/title.wav", StyleNormalPtr<CYAN, WHITE, 300, 800>() },)
(The first entry on this line is the sound font directory.
The second is the sound track. (Started by holding the power button for 2+ seconds and then letting go.)
The third entry is the style of the blade.)

Or are they classified in a different section of the code?

At least we are making progress.

Thank you for all the help. Will make it easier to help trouble shoot my students sabers.

Regards,

GMcIvor

Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 10, 2017, 12:00:09 PM
So, I just noticed that when I have the test blade plugged in and I push the button on the LED brightens and when I push it off the LED dims. So the saber in theory is working. The LED inst completely turning off which is weird....

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 10, 2017, 04:13:06 PM
That's weird, list of things to check:

1. Check your blades[] array and remove then ones you're not using. In particular, try commenting out or remove the charging blade, as the charging blade style keeps the blade on all the time. (Even when the saber is off.)
2. Double-check that you hooked up everything right. ( Battery+ -> resistor -> LED -> FET -> Battery- )  (resistor and LED can switch places, but the FET must go last in this chain.)
3. What FETs did you use?
4. Use a multimeter and measure the voltage between gate on the source on the FET. (on an N-channel fet, the left pin is the gate, the right pin is the source) Measure both when the saber is on (should be ~3.3v, but might be doing PWM to avoid over-volting.) and when it is off (should be ~0 volts)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 11, 2017, 12:29:56 AM
Alright we have progress!!

Changing the pull up resistor value worked for reading to correct battery voltage so far. Fixed.

Serial monitor will display power on and power off when I press the button on the switch. Fixed.

But it will not display the options still. I am running windows 7 and Arduino 1.8.1.

So half the problems were fixed. The LED still stays on when I press the button... and there is no sound I cant get the program to read the hum, clash, on, off sound fonts. Do these directories get specified

 ({ "font01", "tracks/title.wav", StyleNormalPtr<CYAN, WHITE, 300, 800>() },)
(The first entry on this line is the sound font directory.
The second is the sound track. (Started by holding the power button for 2+ seconds and then letting go.)
The third entry is the style of the blade.)

Or are they classified in a different section of the code?

At least we are making progress.

Thank you for all the help. Will make it easier to help trouble shoot my students sabers.

Regards,

GMcIvor


I think I know why the serial monitor commands aren't working.
At the bottom of the serial monitor, there is a drop-down menu which by default says "No line ending", change it to "Newline" and I think it will work better.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 11, 2017, 03:25:39 PM
gmcivor, you've inspired me to create a troubleshooting page for the TeensySaber: Teensy Saber Troubleshooting (http://fredrik.hubbe.net/lightsaber/troubleshooting.html)

Love the questions, so keep them coming. :)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 11, 2017, 06:50:00 PM
The FETS I am using are from a local electronics store they are IRFZ48N P222D 8998 That is the info that is one the front of the FET. I double checked that everything was in place it seems to be all good. Yes, I changed the serial monitor setting then it worked perfectly.

Thank you I am glad that I can help. Well, your in luck I have some more questions. 

1) I was able to change the blade arrays and isolate the ones I am using for testing purposes and changed the configurations. The LED still stays on but it no longer dims and brightens with the push button.

2) In the serial monitor it gives all the start information, it says amplifier off but when I type beep it beeps then says amplifier off again. I changed the presets to play the Starwars theme in the sound found. I type play Starwars it says playing but no sound what so ever.

3) Then it recently started saying no SD card even though I have it in and it was working a few minutes before that. I assume some wires are loose or broken I will rewire and get back to you on that.

But before I can continue trouble shooting I have to remake the sandwich again. But I might as well re wire everything to make sure everything is correct. I accidentally broke the micro USB off the teensy. Don't ask how, I am still confused as to how that was possible but none the less I some fixes to make before I can test your possible solutions.

I again thank you for all your help. Hopefully I will have a working one soon. Maybe its time I try to V2 electronics on my next one?

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 11, 2017, 07:52:44 PM
The FETS I am using are from a local electronics store they are IRFZ48N P222D 8998 That is the info that is one the front of the FET.

I looked up a data sheet for these: http://www.infineon.com/dgdl/irfz48n.pdf?fileId=5546d462533600a40153563ea45a222a (http://www.infineon.com/dgdl/irfz48n.pdf?fileId=5546d462533600a40153563ea45a222a)

Unfortunately it looks like Vgs potentially more than 3.3v, meaning that they might not be
possible to control properly with the 3.3 volt logic that the teensy puts out. They still
should turn *off* properly though...

Quote
I double checked that everything was in place it seems to be all good. Yes, I changed the serial monitor setting then it worked perfectly.

good!

Quote
Thank you I am glad that I can help. Well, your in luck I have some more questions. 

1) I was able to change the blade arrays and isolate the ones I am using for testing purposes and changed the configurations. The LED still stays on but it no longer dims and brightens with the push button.

That's weird, what does your blades[] and preset arrays look like?

Quote
2) In the serial monitor it gives all the start information, it says amplifier off but when I type beep it beeps then says amplifier off again. I changed the presets to play the Starwars theme in the sound found. I type play Starwars it says playing but no sound what so ever.

Hmm, I might need better error messages...
Assuming starwars.wav is in the root directory on your sd card, the command would be "play starwars.wav".
The amplifier off message is normal.

Quote
3) Then it recently started saying no SD card even though I have it in and it was working a few minutes before that. I assume some wires are loose or broken I will rewire and get back to you on that.

It happens.

Quote
But before I can continue trouble shooting I have to remake the sandwich again. But I might as well re wire everything to make sure everything is correct. I accidentally broke the micro USB off the teensy. Don't ask how, I am still confused as to how that was possible but none the less I some fixes to make before I can test your possible solutions.

Unfortunately the teensy micro-usb connector is not super-strong, so it can break off if force is applied sideways. The teensy 3.5/3.6 fixes this by using through-hole connectors. I've never broken off the connectors on my teensys, but I've managed to damage them in a pletora of other ways. It happens.. :)

Quote
I again thank you for all your help. Hopefully I will have a working one soon. Maybe its time I try to V2 electronics on my next one?

Regards,

GMcIvor

You're welcome. I like doing this stuff, and I think it's AWESOME that someone is doing this in school, so this is the least I can do.  As for the V2, I still don't have any for sale, and the process of getting them is very slow. Of course, you can make them yourself, but it's fair amount of work.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 13, 2017, 11:13:41 AM
Sorry for the late response, enjoying the first couple days of spring break!

So,

1) I have a couple of these FETS (1F42AA FQP 30N06L) laying around would they work? What FETS would you suggest I pick up so I can eliminate those from the problem factors.

2) They blade and preset array look exactly like yours. I added an extra one for a 2 led blade instead of 97 (for testing and two will fit nicely in the blade plug). That way it will fit with the belt clip and still emit light and sound. Then I can take the blade plug out and but the blade in for full effect.

3) So, I have the folder named Starwars and in that folder I have the sound font and the tracks. So it said sound font starwars I should be able to type starwars.wav and it will play the starwars theme but it wasn't. Unless this is the incorrect folder structure. Do the sound fonts have to be .wav I have some that are .lsu will those work? I ahve some sound tracks that are .mp3, will those work as well?

4) I like doing this stuff as well. Thank you my students love it and some other teachers are very jealous. One even wants us to build him one! I hope to add more projects like to my courses it engages the students and they get to take something away at the end they can be proud of.

   I have one student who finished writing the script for a short film he is wanting to make. He is trying to have it all filmed and edited for May the 4th. That way we can play it on the TV's around the school. I'm hoping to get the sabers figured out soon. One of the students in the film is using the one she is building as hers in the film. Which she is excited about.

Let me know when you have some for sale I would definitely be interested in picking some up. Yes, it takes time I have ordered circuits from OSH Park too it takes awhile. The time and work is not a problem I have full confidence that I could build on the only thing I don't have would be a re-flow oven to bake the circuits. Also I don't have the tested rig you posted on your build for it to takes the V2 board.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 13, 2017, 11:43:44 AM
Sorry for the late response, enjoying the first couple days of spring break!

So,

1) I have a couple of these FETS (1F42AA FQP 30N06L) laying around would they work? What FETS would you suggest I pick up so I can eliminate those from the problem factors.

The 1F42AA has a gate-source threshold max of 2.5 volts, so I think they should work fine.
The sparkfun FETs linked from my site are the ones that I used.

Quote
2) They blade and preset array look exactly like yours. I added an extra one for a 2 led blade instead of 97 (for testing and two will fit nicely in the blade plug). That way it will fit with the belt clip and still emit light and sound. Then I can take the blade plug out and but the blade in for full effect.

You probably want to remove all entries you don't want though.
Having LEDs in the blade plug is cool, but make sure you take it out when you're putting the saber away, as
leaving anything plugged into the battery for an extended period of time can damage the battery.

Quote
3) So, I have the folder named Starwars and in that folder I have the sound font and the tracks. So it said sound font starwars I should be able to type starwars.wav and it will play the starwars theme but it wasn't. Unless this is the incorrect folder structure. Do the sound fonts have to be .wav I have some that are .lsu will those work? I ahve some sound tracks that are .mp3, will those work as well?

Currently everything has to be WAV files. 11, 22 or 44khz sampling rate. Mono and stereo both works, but stereo is just wasteful.
I had never heard of an LSU file before this. Apparently LSU files are 44100khz 16-bit RAW mono files.
Currently TeensySaber does not support LSU files, but now that I know about them, I can fairly easily add support. :)
MP3 files are currently not supported,

I don't know what naming conventions are used with LSU fonts, teensysaber currently assumes plecter or NEC naming conventions.
I usually keep my tracks separately from my sound fonts, but there is no particular reason for it.

So, my sd card looks like this:
tracks/title.wav
tracks/duel.wav
font01/hum.wav
font01/boot.wav
font01/poweron.wav
font01/poweroff.wav
font01/.... more font files
font02/hum.wav
font02/boot.wav
font02/.... more fonts

The directories could be called anything, as long as they match what's in the "preset" arrays.
To test sound playback I usually use the command "play tracks/title.wav"

Quote
4) I like doing this stuff as well. Thank you my students love it and some other teachers are very jealous. One even wants us to build him one! I hope to add more projects like to my courses it engages the students and they get to take something away at the end they can be proud of.


   I have one student who finished writing the script for a short film he is wanting to make. He is trying to have it all filmed and edited for May the 4th. That way we can play it on the TV's around the school. I'm hoping to get the sabers figured out soon. One of the students in the film is using the one she is building as hers in the film. Which she is excited about.

Wish all schools had teachers like you! :)

Quote
Let me know when you have some for sale I would definitely be interested in picking some up. Yes, it takes time I have ordered circuits from OSH Park too it takes awhile. The time and work is not a problem I have full confidence that I could build on the only thing I don't have would be a re-flow oven to bake the circuits. Also I don't have the tested rig you posted on your build for it to takes the V2 board.

Regards,

GMcIvor
Will do!

A I use a $22 electric skillet to bake my circuits. :)
At some point I will open-source the test rig as well, I just havne't gotten around to it.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 13, 2017, 12:38:52 PM
1) I will give those a try and if not I will order the ones from sparkfun.

2) Yes, I removed all blade arrays except for the charging, 97 LED, and the 2 LED for the blade plug. I can certainly remove the blade plug it will have the same connector as the regular blade just less LED's. I will keep that in mind.

3) Okay I will try find tracks that are WAV file. The reason I asked was because I have found more free sounds fonts that are .LSU When and if you add support let me know. If I am reading this correct is each part of the sound font in its own Font01 folder or in the Font01 folder it will have poweron, poweroff, hum etc..

4) Thank you, that means a lot! This project wouldn't be possible if you haven't paved the way, made everything open source, and are so willing to answer questions from simple to complex. So thank you!!

5) Really? Sometimes low tech is the best solution! What temperature and time do you bake them for?

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 13, 2017, 12:58:32 PM
3) Okay I will try find tracks that are WAV file. The reason I asked was because I have found more free sounds fonts that are .LSU When and if you add support let me know. If I am reading this correct is each part of the sound font in its own Font01 folder or in the Font01 folder it will have poweron, poweroff, hum etc..
You can just conver them.
just do sox -b 16 -c 1 -r 44100 -e signed-integer -t raw idle.lsu idle.wav.
Then you'll have to rename some files to match what TeensySaber expects:
idle.wav -> hum.wav
impact*.wav -> clash*.wav
motion*.lsu -> swing*.wav

Btw, What I call "tracks" is background music that can optionally play while other sounds are playing.
Auddacity can convert mp3 files to wav I think.

Quote
5) Really? Sometimes low tech is the best solution! What temperature and time do you bake them for?

The skillet goes to 400 degrees, so I just put the lid on, turn it on to max and watch it intently.
Once all the solder has melted, I give it another ~minute, then I turn it off and let it cool down with the lid on.
After it's down to touchable temperatures I take it out and call it done.

SparkFun has a handy guide: Reflow Skillet - SparkFun Electronics (https://www.sparkfun.com/tutorials/59)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 13, 2017, 01:44:41 PM
1) I can convert them? What do I type that into to convert the files? And yes I figured that would be the case.
   Success! Since I cant reprogram the teensy until I fix the usb, I used the current sound font configuration and it plays sound!! Hurray! But the LED still stays on. I think it might be the fets I am going to switch those out later this week.

Which sound font are you using on your sabers?

2) Sounds easy, but you know what they say easier said then done! I'll take a look into it.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 13, 2017, 02:23:59 PM
1) I can convert them? What do I type that into to convert the files?

sox is a command-line tool. Probably the eaiest way to run in on a windows computer is to install cygwin and type those commands
into a cygwin terminal. I use linux for all my stuff myself, so I tend to prefer command-line tools over windowed programs.
You can also convert lsu files to wav using Audacity. Just google "Converting WAV Files to LSU Using Audacity".

Quote
And yes I figured that would be the case.
 Success! Since I cant reprogram the teensy until I fix the usb, I used the current sound font configuration and it plays sound!! Hurray! But the LED still stays on. I think it might be the fets I am going to switch those out later this week.

Nice!

Quote
Which sound font are you using on your sabers?

I use a variety of fonts. The primary ones are called "Graflex IV HD" and "Graflex V HD" and are available from soundfont.com.
I have some other fonts that I use primarily for testing.
There are some free fonts available from Naigon Electronics which are meant for use with the Igniter boards, which should also
work with TeensySaber.

I'll probably add support for LSU files (and the alternate names) tonight though. Seems easy enough. :)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 13, 2017, 09:10:09 PM
Hmm, weird.
Implementing support for raw / lsu files is easy, but there doesn't seem to be a consistent naming scheme for these types of fonts, so there isn't a way to just drop it in a directory and have TeensySaber just find the various files. I'm going to document how the files should be named though.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 13, 2017, 09:25:46 PM

The Naigon Electronics fonts worked out great. I didn't need to change the naming just plug and play from what I can tell.

Well, at least one part of supporting the lsu files is easy. It shouldnt be to hard to change the naming of the lsu files to match.

regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 13, 2017, 10:23:08 PM
I've added a section to the software page (http://fredrik.hubbe.net/lightsaber/teensy_saber.html) which describes the file name expectations. Let me know if there is anything in there that doesn't make sense.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 13, 2017, 10:30:48 PM
I saw the section added, and it looks great. It will definitely help people categorize and understand their sound fonts. Just one question under polyphonic it says:

    boot - Played when TeensySaber boots up.
    swng - Played when you move the saber around
    hum - Played when you don't move the saber around. (looped)
    out - Played when you turn the saber on.
    in - Played when you turn the saber off.
    clsh - Played when you hit something with the saber.
    force - Force use sound.
    stab - Played when you make a stabbing motion. (Not yet implemented)
    blst - Played when you press the AUX button.
    lock - Lockup (not yet implemented)
    font - Played when you switch to this font / preset.

Is saber in and out reversed? But I guess it makes sense because the saber is going out when its turned on and going in when it is turned off. Look at that answered my own question.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 14, 2017, 08:29:53 PM
For the sound fonts section on the software page, I know someone will ask but just to clarify. You can have sub directories on a SD card for example:
     Fonts
     -- Jedi
       -- Clash.wav
       -- Hum.wav
       -- Swing. wav
       -- etc...
     -- Sith
       -- Clash.wav
       -- Hum.wav
       -- Swing. wav
       -- etc...
     -- E 7 Graflex
       -- Clash.wav
       -- Hum.wav
       -- Swing. wav
       -- etc...
In the preset[] array you would type E 7 Graflex, for example, if you wanted that particular sound font from the SD card.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 14, 2017, 11:10:32 PM
Directory names can't be longer than 8 characters (it's an FAT32 file system)
so let's call the directory E7GRAF instead. Since E7GRAF is a subdir of FONTS, you would put "fonts/e7graf" or "FONTS/E7GRAF" in the preset array. (Upper case and lower case should both work.) Normally msdos uses \ instaed of /, but since you have to quote slashes, it's easier to use / in the code.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 16, 2017, 03:29:27 PM
Yes, that makes sense. I forgot about the file naming system that was mentioned.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 20, 2017, 05:21:06 PM
I have a question,

Would it be possible to add an on hilt menu? Something like this (Diamond Controller - ON SABER MENU - YouTube (https://www.youtube.com/watch?v=uBnP6jMnG-E))

It would allow you to change sound fonts on the fly and what ever else you would program into the menu? I just saw this and thought it was a neat addition to the many amazing things that are already in the teensysaber.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 20, 2017, 07:27:12 PM
Yes, although I personally prefer the simplicity of the current system, where presets are configured in the code. (As many as you like) and you select the next preset by holding aux while pressing power. (You should hear a short beep, then the "font.wav" sound should play.)

Obviously this only works if you have two buttons. :)
I really need to add support for single- and triple-button setups, but I haven't really figured out how I want them to work yet.  (suggestions are welcome!)

Menues would also be a nice addition, but since I probably wouldn't use it myself, it's not high on my list of things to implement. The menu system could become a bit complicated, as you could choose effect, sound font, colors, and potentially other parameters as well. I'd also need to add some code to read and write configurations from sd card or eeprom.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: jbkuma on March 20, 2017, 07:41:04 PM
Having worked on a few different style menus, I agree, it can easily take on a life of its own.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 20, 2017, 08:46:42 PM
Yes, it can get very complicated, was just a thought. It is very easy to change everything you need in the code. Yes, that is what I would be doing if I had an AUX button. Since I don't have an AUX button or probably wont have one on future builds (depends on hilt) figuring out a true one button saber would be ideal how ever that will look.

I have been thinking of how a one button saber would work as well. But it is a tough one depending on how you would want it to function and be user friendly. One thought was, you have it set for if you press and hold the power button for 2+ seconds it plays a track you have set. What if you do two long presses and then it switches though your presets with a beep or notification between. Or you could do a single long press and have the track set to a certain timed press.

Just a couple basic ideas.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 21, 2017, 04:51:09 PM
Probably the easiest thing to do for a single-button setup is something like:

while OFF:
  short click: turn saber on
  long-click: start soundtrack
  hold+clash: go to next preset

while ON:
  short click: blast
  long click: turn off
  hold+clash: lockup until you let go

What other functions are important?  How does it compare to other one-button setups?

Title: Re: Announcing the Teensy Saber open source sound board
Post by: jbkuma on March 21, 2017, 06:10:03 PM
We're using double clicks in LSOS and frankly I am not a fan. It's too easy to accidentally double click when trying to increment the setting, or increment instead of going to the next menu (double click).

One method I've seen that I really like is a wrist gesture.  Twist the hilt to increment the setting, tap the button change menues.  Long press to enter and exit.  Really, I guess it could be any threshold based gesture.  If you are already detecting swings and clashes, may as well save code by using one of those.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on March 21, 2017, 09:31:26 PM
Probably the easiest thing to do for a single-button setup is something like:

while OFF:
  short click: turn saber on
  long-click: start soundtrack
  hold+clash: go to next preset

while ON:
  short click: blast
  long click: turn off
  hold+clash: lockup until you let go

What other functions are important?  How does it compare to other one-button setups?



I think that would work out to begin testing the one button saber. I don't know what other functions would be needed. From what I have seen most one button sabers have what you listed at functions. They are then plugged in to change sound fonts or blade colors that are not already in a present menu.

We're using double clicks in LSOS and frankly I am not a fan. It's too easy to accidentally double click when trying to increment the setting, or increment instead of going to the next menu (double click).

One method I've seen that I really like is a wrist gesture. Twist the hilt to increment the setting, tap the button change menus.  Long press to enter and exit.  Really, I guess it could be any threshold based gesture.  If you are already detecting swings and clashes, may as well save code by using one of those.

I can see how that style of selection would be confusing. With the diamond controller video I posted is a gesture related selection style I was trying to say. That style of menu you are talking about is what they are using, but in their own way. I think a gesture style would be cool and more expandable in some fashion. This is what I have seen on most one button sabers.

But reusing the clash and swing code would be a huge time saver and make things easier on the initial start to a one button saber.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: JakeSoft on March 28, 2017, 04:42:41 PM
I have a question,

Would it be possible to add an on hilt menu? Something like this (Diamond Controller - ON SABER MENU - YouTube (https://www.youtube.com/watch?v=uBnP6jMnG-E))

It would allow you to change sound fonts on the fly and what ever else you would program into the menu? I just saw this and thought it was a neat addition to the many amazing things that are already in the teensysaber.

Regards,

GMcIvor

It's certainly possible. I've been doing that for years with my Arduino builds (Heck, even my Mk. I from 2013 had a color-change menu). The CPU on the Teensy out-classes the AVR chips I've been using, so no problems there. Somebody just needs the will write the code.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi_1 on March 29, 2017, 03:06:18 AM
While menus can in deed easily start a life of their own I kinda like them. They are a means to make a saber user friendly by allowing the wielder to change settings on the fly. For LSOS I plan to add even more menues in order to have less parameters which are hard-coded. I guess simply because hard coded stuff tends to deters people for using such code. And frankly there are not soooo many things which need to be configured:
- sound font
- volume (OK, since people usually want it very loud or totally silent, even this could be replaced by silence-on-the-go)
- color (here I currently use gestures in the Gravity color change menues) profiles for each sound font
----- this is the list currently available in LSOS ---------- and now to what would make sense to add:
- swing sensitivity (thanks God the MPU6050 clash detection does not need any threshold setting)
- flicker effect selection

Anything else?
 oh yeah, the last menu item is the pre-stage of entering sleep mode
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on March 29, 2017, 09:33:54 AM
Menues for the teensysaber might also be a bit more complicated than your average system.

First of all: It would need to have a completely separate setting-storage for each different blade.
Second: Besides font, volume and color, you'd also need to be select which "effect" you want.
        (strobe, rainbow, normal, charging, etc.)  However, some effects don't make sense for
        some types of blades.
Third: Each "effect" has it's own set of configuration options, some take a color, some do not.
       Also, for those that do take a color, changing the color only makes sense if the blade can
       actually do it.

I personally think that presets is a more user-friendly way to handle this. Each preset encapsulates
*all* the settings, and you just need one button combination to go to the next preset.

Not that I haven't thought about adding menues mind you. However, because of the dynamic nature of the
menues, and the many different settings, I was thinking that I would want to add a speech synthesizer
to the code. That way I wouldn't have to rely on recorded samples for everything. It could also be used
for error handling (like telling you that the sd card cannot be found... )

Title: Re: Announcing the Teensy Saber open source sound board
Post by: JakeSoft on March 29, 2017, 02:25:20 PM
Menues for the teensysaber might also be a bit more complicated than your average system.

...

I personally think that presets is a more user-friendly way to handle this. Each preset encapsulates
*all* the settings, and you just need one button combination to go to the next preset.

Not that I haven't thought about adding menues mind you. However, because of the dynamic nature of the
menues, and the many different settings, I was thinking that I would want to add a speech synthesizer
to the code. That way I wouldn't have to rely on recorded samples for everything. It could also be used
for error handling (like telling you that the sd card cannot be found... )

It's amusing to me that you characterize branch logic based on selected blade type as complicated but have no problem mentioning adding speech synthesis.  :cheesy:
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on April 02, 2017, 01:35:32 PM
It's been quiet around here, but that doesn't mean I haven't been doing anything!
I have been quietly slaving away over a hot keyboard, day and night to bring you updated TeensySaber software. (1.45)

Release highlights:

As usual, you can find the latest version here: Teensy Saber OS (beta) (http://fredrik.hubbe.net/lightsaber/teensy_saber.html)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: bobi-one on April 03, 2017, 08:16:17 AM
It's been quiet around here, but that doesn't mean I haven't been doing anything!
I have been quietly slaving away over a hot keyboard, day and night to bring you updated TeensySaber software. (1.45)

Release highlights:
  • MTP support!!!!! (You can now drag-and-drop sound fonts to the sd card over the USB connection from windows) Currently requires some patches to the teensy code base, see here (https://forum.pjrc.com/threads/43050-MTP-Responder-Contribution) for more information.
  • Power button + clash = previous preset (good for single-button setups)
  • Support for RAW & USL audio files.
  • Lots more comments in the code.
  • Doesn't hang anymore without a motion chip. (Means you don't have to commend out ENABLE_MOTION if you want to try the code without a prop shield or TeensySaber V2 anymore.)

As usual, you can find the latest version here: Teensy Saber OS (beta) (http://fredrik.hubbe.net/lightsaber/teensy_saber.html)
xxx you are a SW guru :D, I've ordered  a lot of variants of the IMUs with the same pinout, and will add sw support for them as soon as they arrive. Meantime Do you use some version tracking, as I try to track your changes and the stuff I change in my github?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on April 03, 2017, 08:28:26 AM
Do you use some version tracking, as I try to track your changes and the stuff I change in my github?

I use CVS. (On my own server.)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on April 04, 2017, 01:42:04 PM
Do you use some version tracking, as I try to track your changes and the stuff I change in my github?

I use CVS. (On my own server.)

I'm experimenting with mirroring my CVS repository to github here:

   https://github.com/profezzorn/TeensySaber/commits/master/lightsaber.ino (https://github.com/profezzorn/TeensySaber/commits/master/lightsaber.ino)

Not sure how well it will work long-term, but initial tests are good.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on April 07, 2017, 07:51:08 AM
It's been quiet around here, but that doesn't mean I haven't been doing anything!
I have been quietly slaving away over a hot keyboard, day and night to bring you updated TeensySaber software. (1.45)

Release highlights:
  • MTP support!!!!! (You can now drag-and-drop sound fonts to the sd card over the USB connection from windows) Currently requires some patches to the teensy code base, see here (https://forum.pjrc.com/threads/43050-MTP-Responder-Contribution) for more information.
  • Power button + clash = previous preset (good for single-button setups)
  • Support for RAW & USL audio files.
  • Lots more comments in the code.
  • Doesn't hang anymore without a motion chip. (Means you don't have to commend out ENABLE_MOTION if you want to try the code without a prop shield or TeensySaber V2 anymore.)

As usual, you can find the latest version here: Teensy Saber OS (beta) (http://fredrik.hubbe.net/lightsaber/teensy_saber.html)

Wahoo! Drag and dropping sound fonts is an amazing addition to the teensysaber, will make changing it super easy! Thank you!

I know you use linux to do your coding(as previously mentioned) on a windows how would my students and I add the mtp files needed to run this on the teensysaber? 

Great work! I cant wait to see what you come up with next. I'm almost done rebuilding the teensysaber. hopefully the lights turn off this time. I think I found the issue=, well lets hope.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on April 07, 2017, 08:15:15 AM
It's been quiet around here, but that doesn't mean I haven't been doing anything!
I have been quietly slaving away over a hot keyboard, day and night to bring you updated TeensySaber software. (1.45)

Release highlights:
  • MTP support!!!!! (You can now drag-and-drop sound fonts to the sd card over the USB connection from windows) Currently requires some patches to the teensy code base, see here (https://forum.pjrc.com/threads/43050-MTP-Responder-Contribution) for more information.
  • Power button + clash = previous preset (good for single-button setups)
  • Support for RAW & USL audio files.
  • Lots more comments in the code.
  • Doesn't hang anymore without a motion chip. (Means you don't have to commend out ENABLE_MOTION if you want to try the code without a prop shield or TeensySaber V2 anymore.)

As usual, you can find the latest version here: Teensy Saber OS (beta) (http://fredrik.hubbe.net/lightsaber/teensy_saber.html)

Wahoo! Drag and dropping sound fonts is an amazing addition to the teensysaber, will make changing it super easy! Thank you!

I know you use linux to do your coding(as previously mentioned) on a windows how would my students and I add the mtp files needed to run this on the teensysaber? 

Great work! I cant wait to see what you come up with next. I'm almost done rebuilding the teensysaber. hopefully the lights turn off this time. I think I found the issue=, well lets hope.

Regards,

GMcIvor

Follow the link to the PJRC forum above. If you're ok with following the directions there, then you can get MTP support now.
If not, just wait until Paul updates the teensyduino distribution, and then just select "MTP disk" in the "USB Type" menu.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on April 10, 2017, 07:44:27 AM
Sounds good, I'll take a look at that today. Over the weekend, I have been trying to fix, yet again, the teensy saber. This is the third build and I am stumped. I am confident in my abilities, but I cant seem to find the issue. Maybe I have been staring at it to long. I rebuilt the whole project since I broke the usb connector and had extra parts laying around. It worked (minus turning the LEDS off, but I bought the FETS you used) then I was making sure all the sounds played properly. I triggered the clash sound lightly against my table then it stopped working. Now if I plug in a blade  the power boost heats up and nothing turns on. I checked everywhere for shorts and I do not see any. I even plugged in the charge adapter (maybe the short was in the blade) and it still did the same thing. I followed the schematic and I cant see why it wouldn't be working.... I am at a loss. Any ideas? Have you encountered this problem ?

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on April 10, 2017, 11:07:16 AM
Sounds good, I'll take a look at that today. Over the weekend, I have been trying to fix, yet again, the teensy saber. This is the third build and I am stumped. I am confident in my abilities, but I cant seem to find the issue. Maybe I have been staring at it to long. I rebuilt the whole project since I broke the usb connector and had extra parts laying around. It worked (minus turning the LEDS off, but I bought the FETS you used) then I was making sure all the sounds played properly. I triggered the clash sound lightly against my table then it stopped working. Now if I plug in a blade  the power boost heats up and nothing turns on. I checked everywhere for shorts and I do not see any. I even plugged in the charge adapter (maybe the short was in the blade) and it still did the same thing. I followed the schematic and I cant see why it wouldn't be working.... I am at a loss. Any ideas? Have you encountered this problem ?

Regards,

GMcIvor

When I've had things heat up, it has either meant a short, or something was plugged in backwards.
I recommend taking a pair of aviation connectors, get 8 colored breadboard wires, cut them in half and solder them up to the two connectors. Then grab a breadboard and start experimenting. Start with just connecting the two black wires together. That should power things on, but nothing else.

However, it occurs to me that since you have two blades that have the same problem, you either connected both blades wrong. (Beware that pins 1-8 are clockwise on the female connector and counter-clockwise on the male connector.)  Or, the problem is somewhere else.  Some pictures of your build might help if something is hooked up backwards, but it won't show a short.

To find a short, measure the resistance between + and - in various places in your circuit with a multimeter. If it's near zero, you have a short.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 03, 2017, 07:58:08 AM
Hey sorry for the late response and going dark. How has it been over there? It has been crazy around here. Had report cards to due and I started a game jam with a few of my students. And prepping for the car show that we have this weekend. I decided to take a break from the saber and work on that. Now I have a good amount of code blocked out I thought I would come back to the saber.

So I tried to find a short and I didn't see one, although the multi-meter wasn't working that great so I have to check again. Here are some pictures (shared with my google drive) of my build it will look different from yours, well mainly the chassis and orientation of parts, but everything should be connected in the same fashion. If you see anything let me know. I haven't attached the SD card reader because I am not sure how I want in orientated in the chassis. I don't think this would be causing the power boost to over heat. Light saber build pics - Google Drive (https://drive.google.com/drive/folders/0BwqZ0qtAgdt_OVE0Qk4wamppdFk?usp=sharing)

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 03, 2017, 10:47:22 AM
Hey sorry for the late response and going dark. How has it been over there? It has been crazy around here. Had report cards to due and I started a game jam with a few of my students. And prepping for the car show that we have this weekend. I decided to take a break from the saber and work on that. Now I have a good amount of code blocked out I thought I would come back to the saber.

I've been quite busy too, but I'm back to working on saber-related stuff as well. (May the 4th tomorrow... :)

Quote
So I tried to find a short and I didn't see one, although the multi-meter wasn't working that great so I have to check again. Here are some pictures (shared with my google drive) of my build it will look different from yours, well mainly the chassis and orientation of parts, but everything should be connected in the same fashion. If you see anything let me know. I haven't attached the SD card reader because I am not sure how I want in orientated in the chassis. I don't think this would be causing the power boost to over heat. Light saber build pics - Google Drive (https://drive.google.com/drive/folders/0BwqZ0qtAgdt_OVE0Qk4wamppdFk?usp=sharing)

Regards,

GMcIvor

I agree that the missing SD card shouldn't cause any over-heat issues.
In fact, apart from not having any sounds to play, it shouldn't cause any issues at all. :)
I looked at the pictures for a while, but nothing jumped out at me as obviously wrong.
One thing that occured to me though: Since you seem to have a roomier chassis than I did for my build, you may want to incorporate more connectors in your build. That way, parts can be disconnected, tested and measured in isolation. Ideally you could build test rings that makes it easy to verify that each component is doing what it's supposed to that the students can use before hooking things up.


Anyways, back to your current build...

1) I would wire up a female aviation connector to only short the two black wires, nothing else. Plugging this in should
   be enough to boot up the teensy. If it doesn't heat up with this, the problem is in the blade connector somewhere.

2) Get a working multimeter, plug in the connector from (1) and measure the voltage coming in and out of the lipower booster. It should be 3 to 4.2 on the input side and about 5 on the output side. Triple-check the polarity!

3) Get another multimeter, insert between the teensy and lipower and measure the current flowing.
   It should be pretty low, less than 100mA.

4) Cut the connection between the teensy and the lipower. Hook up a 50 ohm resistor to the lipower and make sure that it still produces a steady 5 volts without heating up. Try it again with a 10 ohm resistor (now it may heat up a bit). Try hooking up a 5v bench power supply to the teensy instead of the lipower input and make sure that it boots, runs and draws a reasonable amount of current. (< 100mA)  (Note that it can draw more than 100mA when audio is playing.)

Cutting and re-soldering is not a lot of fun, which is why connectors can help....

Hope this helps.

(PS, you can get super-cheap multimeters from harbor freight)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 03, 2017, 12:22:01 PM
yes, I would have liked to have my saber working for tomorrow! But I do not think that will happen haha. I'll just play some starwars movies for my students instead of saber duels. For the lights not turning off could the fets be in backwards from the pictures I sent you? I built my unit the same way as before (when it worked the lights still wouldn't turn off the fets seems to be doing what they were suppose to).

Well I will give that a try. For shorting the black wires. can I un solder from the connector and attach them or do they have to be in a aviation connector?

Yeah for my next built I am going to incorporate more connectors. I am planning to use the breadboard male and female connectors and tape them together once everything works. It  will make trouble shooting a heck of
 a lot easier (I hope). 
 
Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 03, 2017, 12:26:46 PM
yes, I would have liked to have my saber working for tomorrow! But I do not think that will happen haha. I'll just play some starwars movies for my students instead of saber duels. For the lights not turning off could the fets be in backwards from the pictures I sent you? I built my unit the same way as before (when it worked the lights still wouldn't turn off the fets seems to be doing what they were suppose to).

Well I will give that a try. For shorting the black wires. can I un solder from the connector and attach them or do they have to be in a aviation connector?

Yeah for my next built I am going to incorporate more connectors. I am planning to use the breadboard male and female connectors and tape them together once everything works. It  will make trouble shooting a heck of
 a lot easier (I hope). 
 
Regards,

GMcIvor

Of course you can unsolder them. :) But a female connector that just turns everything on can be a handy tool to have.
(Even better, get some breadboard wires, cut them in half and solder them to the female connector, this makes an excellent trouble-shooting tool as well.)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 03, 2017, 12:35:01 PM

For the lights not turning off could the fets be in backwards from the pictures I sent you?
 

I forgot: It looks like the FETs are hooked up correctly as far as I can tell from the pictures.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 03, 2017, 12:41:53 PM
okay, So I un soldered one of black wire and pressed it to the other one. Nothing happened, but the power boost heated up. So something is plugged in backwards or shorted. So I wondered what is tied in wrong. I looked over the wires and the diagram and they all seem to be connected properly...


When I place the multimeter on the ground wire from the battery (which is the one I un soldered) and to the power cable on the connector I get 4V So it is giving the correct voltage to the connector.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 03, 2017, 04:16:09 PM
Got POV mode mostly working:

(https://drive.google.com/thumbnail?authuser=0&sz=w320&id=18hV07PjuvLYceYLdcAQ5FevBUmoTZurltA) (https://drive.google.com/open?id=18hV07PjuvLYceYLdcAQ5FevBUmoTZurltA)

This is a 1.6 second exposure where I wave the saber through the air in an arc using my 144-neopixel strip blade.
Unfortunately it's not fast enough that you can observe the effect without a slow-exposure picture, but it's still kind of cool.
(With dotstar/SPI LEDs it might be fast enough, but I don't really have support for dotstar LEDs...)

Working on some other changes right now, once they are done I will upload new firmware.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: JakeSoft on May 03, 2017, 06:35:46 PM
Got POV mode mostly working:

Working on some other changes right now, once they are done I will upload new firmware.

You are the very best kind of lunatic. Now there's something other sabers don't do!
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 03, 2017, 06:38:49 PM
That sir is amazing! Truly a one of a kind addition to any saber!
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 04, 2017, 12:28:11 AM
Yeah for my next built I am going to incorporate more connectors. I am planning to use the breadboard male and female connectors and tape them together once everything works. It  will make trouble shooting a heck of
 a lot easier (I hope). 

I would recommend using polarized connectors. For the students I would recommend a different connector for every component... :)
Of course, you can polarize breadboard connectors by plugging holes and pulling out pins...
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 04, 2017, 08:20:23 AM

I agree that the missing SD card shouldn't cause any over-heat issues.
In fact, apart from not having any sounds to play, it shouldn't cause any issues at all. :)
I looked at the pictures for a while, but nothing jumped out at me as obviously wrong.
One thing that occured to me though: Since you seem to have a roomier chassis than I did for my build, you may want to incorporate more connectors in your build. That way, parts can be disconnected, tested and measured in isolation. Ideally you could build test rings that makes it easy to verify that each component is doing what it's supposed to that the students can use before hooking things up.


Anyways, back to your current build...

1) I would wire up a female aviation connector to only short the two black wires, nothing else. Plugging this in should
   be enough to boot up the teensy. If it doesn't heat up with this, the problem is in the blade connector somewhere.

2) Get a working multimeter, plug in the connector from (1) and measure the voltage coming in and out of the lipower booster. It should be 3 to 4.2 on the input side and about 5 on the output side. Triple-check the polarity!

3) Get another multimeter, insert between the teensy and lipower and measure the current flowing.
   It should be pretty low, less than 100mA.

4) Cut the connection between the teensy and the lipower. Hook up a 50 ohm resistor to the lipower and make sure that it still produces a steady 5 volts without heating up. Try it again with a 10 ohm resistor (now it may heat up a bit). Try hooking up a 5v bench power supply to the teensy instead of the lipower input and make sure that it boots, runs and draws a reasonable amount of current. (< 100mA)  (Note that it can draw more than 100mA when audio is playing.)

Cutting and re-soldering is not a lot of fun, which is why connectors can help....

Hope this helps.

(PS, you can get super-cheap multimeters from harbor freight)

May the Fourth be with you!


So I tried #1 and the power boost heated up and the teensy didn't boot. So I went to #4 and used my power supply at 5v and connected the leads directly to the leads going to the 5v and gnd on the propshield. The teensy led came on. This tells me that it booted and i felt it it didn't over heat.

So I am guessing the problem is with the powerboost. Do you think it might be faulty? Or it is something else in that side of the circuit. But at least I am isolating possible suspects...

With the teensy power leads still disconnected I attached the main ground wire to the other black wire and the power boost heated up...

Any ideas now?

Regards,

GMcIvor

Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 04, 2017, 10:52:55 AM
I even replaced the powerboost and shorted the black wires together and still heated up... Is it something in the male connector that is faulty then? I don't see what else it could be...
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 04, 2017, 11:03:38 AM
Did you measure the output from the power booster?
Does the booster work by itself, or does it only heat up when you hook it up to the teensy?

If it only heats up when you hook it up to the teensy, I would very much suspect that you've hooked up the booster backwards to the
teensy. (It should be hooked up + to + and - to -)

If it heats up with nothing else hooked up, you either have a short, or you've hooked up the battery backwards.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 04, 2017, 11:22:12 AM
The booster does not work by itself it heats up with or without the teensy. And I checked I have the red connected to red and black connected to black. I assume I have a short. I have the black wire hooked to the flat side of the battery. The red wire is hooked to the side with the indent.

So I am assuming I have a short.. But where is the question..
 I connected the ground lead of my multimeter to the negative on the battery. The positive on the to in + on the input and i read about 4v. I put the positive on the vcc on the output of the booster and I read about 3.7v

Regards,

GMcIvor 

Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 04, 2017, 12:01:05 PM
The booster does not work by itself it heats up with or without the teensy. And I checked I have the red connected to red and black connected to black. I assume I have a short. I have the black wire hooked to the flat side of the battery. The red wire is hooked to the side with the indent.

So I am assuming I have a short.. But where is the question..
 I connected the ground lead of my multimeter to the negative on the battery. The positive on the to in + on the input and i read about 4v. I put the positive on the vcc on the output of the booster and I read about 3.7v

Regards,

GMcIvor

It certainly sounds like s a short, but if the booster heats up without the teensy, how is that possible?

The nice thing about shorts is that you can find them with a multimeter by simply measuring resistance.
If the resistance between + and - (or gnd and vcc) is less than an ohm, then you have a short.
One thing I've learned from building boards is that is a really good idea to measure the resistance between + and - before you plug in a battery. If the resistance is low, *something* is going to get hot...
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 04, 2017, 01:39:51 PM
The booster does not work by itself it heats up with or without the teensy. And I checked I have the red connected to red and black connected to black. I assume I have a short. I have the black wire hooked to the flat side of the battery. The red wire is hooked to the side with the indent.

So I am assuming I have a short.. But where is the question..
 I connected the ground lead of my multimeter to the negative on the battery. The positive on the to in + on the input and i read about 4v. I put the positive on the vcc on the output of the booster and I read about 3.7v

Regards,

GMcIvor

It certainly sounds like s a short, but if the booster heats up without the teensy, how is that possible?

The nice thing about shorts is that you can find them with a multimeter by simply measuring resistance.
If the resistance between + and - (or gnd and vcc) is less than an ohm, then you have a short.
One thing I've learned from building boards is that is a really good idea to measure the resistance between + and - before you plug in a battery. If the resistance is low, *something* is going to get hot...

your guess is as good as mine. I will use the multimeter to see if I can find the short. if not I will buy some connectors and rebuilt that side of the circuit.

Thanks for the help. Hopefully I can find the problem soon. I want this thing to finally work :)

regards,

GMcIvor 
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 04, 2017, 01:50:36 PM
Alright, So doing some investigating I think it may be the female aviation connector. Everything is soldered to its own pin, but no matter what resisting setting I choose when I place it on the ground pin and the power pin it goes from 1 ohm to almost 0. So I am assuming something is touching inside the connector? Unless it is farther down the line.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 04, 2017, 01:56:45 PM
Sounds like good progress.
If you think the connector is fault, cut it off or de-solder it and measure it again to make sure that's where the problem is.
The female connector side can be a bit tricky, I like to fill up the housing with hot glue after I've tested everything to make
sure everything stays in place...

Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 04, 2017, 02:13:44 PM
Sounds like good progress.
If you think the connector is fault, cut it off or de-solder it and measure it again to make sure that's where the problem is.
The female connector side can be a bit tricky, I like to fill up the housing with hot glue after I've tested everything to make
sure everything stays in place...

Well I thought I had it for a second. I un soldered all the connectors from the battery and the fets from the aviation connector. When I checked between the positive and the ground coming from input on the booster it when from 1 to 15 ohm. Then I tried a different connection and now it goes to 0 when I try the previous connection. I also measure the voltage coming from the battery. coming from the fets and the power cable it shows 4.2v. Which means full charge, or close too.

The power wire from the batter is completely isolated it doesn't touch the ground wire anywhere. The ground wire is small from the input on the power boost to the connector. Then I check the main power line and it shorts. I changed power boosts and the connections are separate, I made sure.

one step forward, two steps back...

Regards,

GMcIvor

Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 06, 2017, 08:47:46 PM
Got POV mode mostly working:

(https://drive.google.com/thumbnail?authuser=0&sz=w320&id=18hV07PjuvLYceYLdcAQ5FevBUmoTZurltA) (https://drive.google.com/open?id=18hV07PjuvLYceYLdcAQ5FevBUmoTZurltA)

This is a 1.6 second exposure where I wave the saber through the air in an arc using my 144-neopixel strip blade.
Unfortunately it's not fast enough that you can observe the effect without a slow-exposure picture, but it's still kind of cool.
(With dotstar/SPI LEDs it might be fast enough, but I don't really have support for dotstar LEDs...)

Working on some other changes right now, once they are done I will upload new firmware.

Ok, new lightsaber.ino is uploaded to the usual place (http://fredrik.hubbe.net/lightsaber/teensy_saber.html).
It has a bunch of bugfixes, POV mode and experimental APA102/dotstar support.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on May 08, 2017, 06:37:17 PM
Profezzorn... first let me say amazing work on the Teensy Saber project and thanks for all the hard work you've put into the project.

I'm just starting out and am very interested in building a Teensy Saber for myself.  I've had a good amount of experience with Arduino projects and code development but no experience with the Teensy family of boards or SK6812 LED strips.  I have been reading through your Teensy based lightsaber pages as well as read through this entire thread.  I've been working on sourcing all the parts to build a saber and I'm somewhat stuck on the LED strips.  I've searched and found many many options and have gotten quite confused as to what my choice should be.  I've found the Adafruit Mini Skinny NeoPixel 1m LED strips (see Product ID 2969 on the Adafruit site) but these appear to be three times the price of most of the other options (and I'm not sure they are a good choice).  I've found units based on 5050 LEDs and 3535 LEDs and the widths vary from 7 to 10 mm.  Can you (or someone following this thread) provide any recommendations as to the specifics I'm looking for and where to purchase my LED strips from?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 08, 2017, 09:26:45 PM
Generally, any of them will work. These are the ones that I bought:

1M 60 leds 4mm / 144 Pixel 7mm SK6812 SMD 3535 RGB pixel strip light build-in 5V (http://www.ebay.com/itm/1M-60-leds-4mm-144-Pixel-7mm-SK6812-SMD-3535-RGB-pixel-strip-light-build-in-5V-/282004602333/)

The most important thing is that the strips you choose have 144 LEDs per meter.
Secondly, the slimmer they are the easier they are to wrap in diffusion material.
It's helpful if they are white, as black strips will absorb some light.
Make sure it's WS2811-compatible. There are other types (Dotstar/APA102/etc.) which will probably not work.

Naigon recommends building ladders out of 5mm straw-hat through-hole neopixels instead, he claims that this is brighter and more even. It should also draw a little bit less power. Most of Naigons posts can be found on another board though.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on May 09, 2017, 04:09:31 AM
Generally, any of them will work. These are the ones that I bought:

1M 60 leds 4mm / 144 Pixel 7mm SK6812 SMD 3535 RGB pixel strip light build-in 5V (http://www.ebay.com/itm/1M-60-leds-4mm-144-Pixel-7mm-SK6812-SMD-3535-RGB-pixel-strip-light-build-in-5V-/282004602333/)

The most important thing is that the strips you choose have 144 LEDs per meter.
Secondly, the slimmer they are the easier they are to wrap in diffusion material.
It's helpful if they are white, as black strips will absorb some light.
Make sure it's WS2811-compatible. There are other types (Dotstar/APA102/etc.) which will probably not work.

Naigon recommends building ladders out of 5mm straw-hat through-hole neopixels instead, he claims that this is brighter and more even. It should also draw a little bit less power. Most of Naigons posts can be found on another board though.

Thanks so much for the reply and the link.  I believe my Teensy Saber project should start it's build soon.  :grin: :grin:

So according to the link you provided the LED strip used 3535 LED (3.5mm x 3.5mm)...  is that correct?  This gives you a 7.2mm width instead of the 10mm width of the 5050 LEDs making them easier to wrap in diffuser material.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on May 09, 2017, 04:44:13 AM
One more question...

 Your schematic / wiring diagram shows connection to a single LED strip. Am I to assume the two LED strips are wired in parallel?

 Thanks again for your help!
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 09, 2017, 08:34:11 AM
One more question...

 Your schematic / wiring diagram shows connection to a single LED strip. Am I to assume the two LED strips are wired in parallel?

 Thanks again for your help!

Yes
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on May 09, 2017, 09:34:18 AM
Sorry... one more question...

The eBay listing you provided has ended.  I've found several listings for 144 LED/m SK6812 strips that have RGBW (4 in 1) LEDs.  Can these be used with the current Teensy lightsaber code?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 09, 2017, 11:08:27 AM
Not with the current code.
Fixing it wouldn't be that difficult, but I don't really see the advantage of RGBW. It seems like RGBW gives you brigheter whites, but that's just not a high priority for me. I'd rather have brighter colors than brighter whites.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 09, 2017, 02:04:36 PM
So I rebuilt the whole top half of the circuit. Everything past the fets and including them as well. I isolated everything with heat shrink and double checked the wires. I haven't attached the teensy to the power boost yet. But when I plug in the two LED blade and even the charge adapter the power boost still heats up. I am at a loss as to why this is happening. I am positive I do not have a short. and everything is wired correctly.

This is turning into a huge pain. And it will probably be the simplest fix too...

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 09, 2017, 03:04:54 PM
Making electronics is always a huge pain.

I don't remember what advice I've already given, and exactly what things you've already tried, so I'm going to dump whatever ideas I have left:
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 10, 2017, 10:23:05 AM
Making electronics is always a huge pain.

I don't remember what advice I've already given, and exactly what things you've already tried, so I'm going to dump whatever ideas I have left:
  • Do you have current coming out of the booster? Do you have the right voltage? It's possible the booster is just fried and will heat up whenever you give it power.
  • I don't know if I already said this, but the pin numbers on the connectors are counter-clockwise on the male connector and clockwise on the female connector, so beware of that.
  • Also, it's possible to have shorts through the casing on the female connector unless you heat-shrink them properly.
  • To actually find the problem, start disconnecting things that *shouldn't* matter, one at a time and re-test each time.
  • The short could be one of two things: A) VCC is shorted to any of the ground wires  B) BATT+ is shorted to GND  (This would cause the *traces* inside the board to heat up, not the chips.)
  • Note that BATT- and GND are directly connected inside the booster, so VCC can short to either one.
  • Hook up an unused male connector to one of the blades, turn on the "beep when connected" mode on your multimeter and test that only things that you expect to be connected, are connected
  • Giving the booster negative volts, or more than 4.5 volts can also cause it to heat up.
  • Disconnect everything from the booster except the battery. Make sure that it doesn't heat up and that you get 5 volts out. Connect one thing at a time until the problem happens.

you got that right.

Well I started at #1 I came in this morning and I plugged the blade in and didn't heat up right away and burn my finger. It got warm but not like before... I checked the input voltage which is about 4.2v and I checked the output voltage and it is sitting around 3.5v which means the booster isn't working. But I would hate to replace it and have it get fried again.. But if its not heating up like before something fixed itself maybe!

I will still check the other connections and go through the list but I wil replace the booster first to see if that makes a difference.

regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 11, 2017, 09:48:00 AM
Alright, So it was a faulty powerboost causing all the trouble. I put a brand new one on and it worked fine!! So that problem is now solved.

But wait there is more!! we are back to my original problem where the LED's aren't being controlled by the FETs and turning on and off. I purchased the same FETs as you too. I tripled checked the wiring to see and they are wired correctly.

I am confused... Hopefully fourth time is the charm? I am in the home stretch now.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 11, 2017, 10:42:21 AM
Ok, progress is good. I don't remember the details of the original problem, so here is another troubleshooting list:


What kind of blade are you actually using? Does it have nepixels, because in that case we need to debug the data line next....
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 11, 2017, 11:06:24 AM
Sorry I should rephrase my problem. The LED's turn on when the blade is pluged in, but they do not turn off when the button is pressed or from commands in the serial monitor. But I will give the check list a go through as well.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 11, 2017, 11:14:16 AM
Is the teensy even booting up then?

Since there are no pull-down resistors on the FETs, they may start in the "on" state when you power things on. This is normal, but as soon as the teensy boots it should turn the FETs off. In lightsaber-1.60.ino  and later, this happens a few microseconds after boot. In older versions, it would happen 1-2 seconds after boot.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 11, 2017, 11:17:15 AM
Is the teensy even booting up then?

Since there are no pull-down resistors on the FETs, they may start in the "on" state when you power things on. This is normal, but as soon as the teensy boots it should turn the FETs off. In lightsaber-1.60.ino  and later, this happens a few microseconds after boot. In older versions, it would happen 1-2 seconds after boot.

Yes, The teensy boots, I can press the button (or in serial monitor) and have the hum play, the clash, and sound tracks. Everything seems to work except the LED's turning off. I am currently using lightsaber-1.60.ino

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 11, 2017, 11:41:07 AM
I went back and looked at the pictures again.
Unfortunately there are no pictures of the "top" edge of the teensy. (Where most of the connections are.)
Also, there are no pictures of the connections inside the blade.

What I can see looks right, I just can't see everything.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 11, 2017, 12:05:21 PM
I will get those pictures to you after I teach my woodwork class, that's when I back in the computer lab. Also When I plug the blade in the lights start off dim then when the teensy boots they brighten up.. I will take a video of it and add it to the new photos. Its almost the opposite effect of what is suppose to happen.

Regards,

GMcIvor


Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 11, 2017, 12:15:25 PM
Hmm, double-check the part numbers on the FETs.
It almost sounds like you have P-channel FETs instead of N-channel FETs.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 11, 2017, 01:21:48 PM
Hmm, double-check the part numbers on the FETs.
It almost sounds like you have P-channel FETs instead of N-channel FETs.

Part number is FQP30N06L for the FET's

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 11, 2017, 01:31:54 PM
Hmm, double-check the part numbers on the FETs.
It almost sounds like you have P-channel FETs instead of N-channel FETs.

Part number is FQP30N06L for the FET's

Regards,

GMcIvor

Well, that rules out that particular problem. :)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 11, 2017, 02:48:31 PM
Hmm, double-check the part numbers on the FETs.
It almost sounds like you have P-channel FETs instead of N-channel FETs.

Part number is FQP30N06L for the FET's

Regards,

GMcIvor

Well, that rules out that particular problem. :)

Yes it does :) I took the pictures of the top of the teensy and added them here https://drive.google.com/open?id=0BwqZ0qtAgdt_OVE0Qk4wamppdFk (https://drive.google.com/open?id=0BwqZ0qtAgdt_OVE0Qk4wamppdFk)

I couldn't open the blade to show you. I put hot glue on the end to keep it in place.... But I am going to be finish the full length blade soon. So I can send you pics of that one before it is enclosed...

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 11, 2017, 03:58:21 PM
Ok, so what's actually in that blade?
Piece of advice: Never glue anything together before it's fully tested. :)

I looked pictures, and as far as I can tell everything is hooked up right.
I also looked at the video, and that's just weird. I wonder if the LED is being
driven in series with the booster or something?

Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 11, 2017, 07:51:09 PM
Ok, so what's actually in that blade?
Piece of advice: Never glue anything together before it's fully tested. :)

I looked pictures, and as far as I can tell everything is hooked up right.
I also looked at the video, and that's just weird. I wonder if the LED is being
driven in series with the booster or something?

Yes, hindsight isn't always 20/20. I might try and break it open tomorrow. Use a vise and twist should break loose.

The testing blade is 2 of the PL9823 LED's inside of a blade plug. The bigger blade will 97 or so of them too. Im also going to make a 144 led strip blade.

I did solder it like your diagram on the website. The + lead attach to pin 7,8. - attach to pin 4,5,6. Data to pin 3 with the blade id resistor and blade id and data leach resistor to pin 1 and 2.

 But I will make a connector and attach it to the larger blade. Do some tests and send you pictures of that connector aswell.

And it could be, but I follow your schematic should it ?

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 11, 2017, 08:06:08 PM
Hmm, it's possible that everything is working, but misconfigured.
The PL9823 LEDs can draw enough power from the data pin to light up, and if the teensy picks the wrong blade configuration, it may leave the LEDs glowing. You might be able to avoid cracking that thing open... :)

What resistors did you use? What resistance does it actually list on startup?
What blade in the blade array does it pick on startup? Does that entry match your blade?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 12, 2017, 07:49:17 AM
Hmm, it's possible that everything is working, but misconfigured.
The PL9823 LEDs can draw enough power from the data pin to light up, and if the teensy picks the wrong blade configuration, it may leave the LEDs glowing. You might be able to avoid cracking that thing open... :)

What resistors did you use? What resistance does it actually list on startup?
What blade in the blade array does it pick on startup? Does that entry match your blade?

I put a 2200 ohm resistor in the 2 PL9823 blade. The resistance it lists on start up says

ID: 3 Volts 0.01 Resistance = 96.96
 
Blade = 1

WS2811 Blade with 2 leds

Normal Style

Scanning sound font: Starwars

Activating polyphonic font.

Welcome to TeensySaber, type 'help' for more info

Amplifier off.

To my knowledge it is selecting the 2 LED blade. But the resistance seems weird... unless Its suppose to be around there.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 12, 2017, 09:13:34 AM
ID: 3 Volts 0.01 Resistance = 96.96

That's an interesting clue.
This means that the data-out and blade ID is being pulled towards ground by something.
Sometimes there is some weirdness during startup, but you can try typing "id" after startup has
completed to confirm these values.

During startup, teensysaber turns on an internal 33k pull-up resistor on the blade id pin, then
it waits a few microseconds and then does a analogRead on that pin. The result was 3 out of 1024,
which means that it's only reading ~0.01 volts. That means that there seems to be a resistor of
about 100Ohms pulling the data pin towards ground.  Maybe switched the two resistors around in the
blade?

Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 12, 2017, 09:43:51 AM
ID: 3 Volts 0.01 Resistance = 96.96

That's an interesting clue.
This means that the data-out and blade ID is being pulled towards ground by something.
Sometimes there is some weirdness during startup, but you can try typing "id" after startup has
completed to confirm these values.


I typed ID and this is what displayed:

ID = 4volts 0.01 resistance = 129.41

Then I unplugged the blade and to see what values it triggered and it was the same as the ID written above.

I will crack the blade open and try to switch the resistors around if I can get it open.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 12, 2017, 10:15:43 AM
ID: 3 Volts 0.01 Resistance = 96.96

That's an interesting clue.
This means that the data-out and blade ID is being pulled towards ground by something.
Sometimes there is some weirdness during startup, but you can try typing "id" after startup has
completed to confirm these values.


I typed ID and this is what displayed:

ID = 4volts 0.01 resistance = 129.41

Then I unplugged the blade and to see what values it triggered and it was the same as the ID written above.

I will crack the blade open and try to switch the resistors around if I can get it open.

Regards,

GMcIvor

Wait, what? How can it be the same without the blade?
Without the blade, the ID should come out to about 1024, or near-infinite resistance.
How do you even power the thing up if there is no blade?
Maybe there is a short between the blade ID/data pin and the FET control pin next to it?



Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 12, 2017, 10:19:09 AM
sorry I phrased that wrong. I unplugged the blade and plugged it back in to check the values on start up and it was the same as when I typed ID.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 12, 2017, 10:29:28 AM
PS: The blade ID circuit, and associated code (the Saber::id() function) might be cool to explain and walk through with students as a simple example of ohms law.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 12, 2017, 10:39:56 AM
PS: The blade ID circuit, and associated code (the Saber::id() function) might be cool to explain and walk through with students as a simple example of ohms law.

Thats a good idea. I will might just do that :)

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 13, 2017, 08:50:51 PM
Software version 1.84 uploaded.
The big new feature is multi-blade support. Accent LEDs can also be treated as additional blades.
Each blade can be configured and controlled individually. All blade types should be compatible
and can run at the same time as long as there is enough pins to support them.

PS: I'm getting 20 TeensySaber V2.3 board made, which will be on sale on this board soon.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Sethski on May 14, 2017, 04:42:09 AM
Continually pleasing and exciting to see your development of the Teensy Saber solution. Thanks as always for sharing your cool work. With the most recent update, having an array of accent LEDs addressable as a separate, additional 'blade' is a huge plus! 

I bought a Teensy 3.2 a bit ago and was intending to bite the bullet and attempt the hotplate reflow with the components and TeensySaber 2.3 board(s) you've made available through OSH Park - defo good to learn, but with slooow scratch build and learning as I go with current reveal saber build, I'm chuffed to read that you'll be making a small batch available - it'll potentially be a great timesaver to pick up two of these from you when you make them available. I'll keep a keen eye on here. If there's any possibility of reserving a couple of them subject to prompt follow up/payment when they are ready that'd be massively appreciated, but also appreciate and respect if you want to keep them on a 'first come, first served' basis.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 14, 2017, 08:46:18 AM
Software version 1.84 uploaded.
The big new feature is multi-blade support. Accent LEDs can also be treated as additional blades.
Each blade can be configured and controlled individually. All blade types should be compatible
and can run at the same time as long as there is enough pins to support them.

PS: I'm getting 20 TeensySaber V2.3 board made, which will be on sale on this board soon.

I left my saber at work, tomorrow I will rebuild that connector and see if it all works!

Thank you for all the continued development.

Wahoo. Do you know approx how much each V2.3 will be ? I'd like to grab a couple before they are gone.

Regards,

GMcIvor

Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 14, 2017, 08:48:12 PM
Wahoo. Do you know approx how much each V2.3 will be ? I'd like to grab a couple before they are gone.

For now I think they are going to be $60 each. (without teensy)
I'd love to make them cheaper, but I need to order larger volumes to do that, which is expensive. :(
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 14, 2017, 08:55:42 PM
Thats still not to bad considering the cost od the propshield, sd card reader, and powerboost is quite abit as well.

Yeah bulk orders are expensive. You could always try a presale then use the money to order a substantial bulk making it cheaper. Are you ordering from oshpark then making them or getting a company to make them ?

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Sethski on May 14, 2017, 10:51:25 PM
For now I think they are going to be $60 each. (without teensy)
I'd love to make them cheaper, but I need to order larger volumes to do that, which is expensive. :(

I was expecting in that ballpark and I think that's pretty reasonable. Look forward to hearing more!
Title: Re: Announcing the Teensy Saber open source sound board
Post by: QUI-GON JINN on May 15, 2017, 05:08:00 AM
Thats still not to bad considering the cost od the propshield, sd card reader, and powerboost is quite abit as well.

Yeah bulk orders are expensive. You could always try a presale then use the money to order a substantial bulk making it cheaper. Are you ordering from oshpark then making them or getting a company to make them ?

Regards,

GMcIvor
FYI, Pre-sales are only to be conducted on this forum by members of the Mining Colony or SABER Guild. Anyone else would be in violation of the forum's Trade federation Rules and Regulations,  and would be subject to disciplinary measures.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 15, 2017, 10:23:10 AM
FYI, Pre-sales are only to be conducted on this forum by members of the Mining Colony or SABER Guild. Anyone else would be in violation of the forum's Trade federation Rules and Regulations,  and would be subject to disciplinary measures.

I'm aware.
My plan is to pay for the initial run myself and sell boards at a modest profit. That profit would go towards increased run sizes, which would help reduce prices in the future. Strong sales would also boost my interested in developing new boards and software features. I'm already envisioning a TeensySaber V3 which integrates the teensy onto the board itself. :)

Strangely, the part that excites me the most about all of this is interacting with people who are using it. Basically I think the customer support will be fun. (I think there must be something wrong with me...)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 15, 2017, 11:03:57 AM
So, I built the full length blade and the LED's do not turn off... Attached you will find the pictures of the connector (http://drive.google.com/open?id=0BwqZ0qtAgdt_OVE0Qk4wamppdFk (http://drive.google.com/open?id=0BwqZ0qtAgdt_OVE0Qk4wamppdFk)). I used a 100 ohm resistor to prevent data leech, and a 3.3 kohm resistor for the blade ID. This was entered in the to blade array. When I get a chance I am going to check the blade ID and resistance in the serial monitor..

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 15, 2017, 11:24:49 AM
So, I built the full length blade and the LED's do not turn off... Attached you will find the pictures of the connector (http://drive.google.com/open?id=0BwqZ0qtAgdt_OVE0Qk4wamppdFk (http://drive.google.com/open?id=0BwqZ0qtAgdt_OVE0Qk4wamppdFk)). I used a 100 ohm resistor to prevent data leech, and a 3.3 kohm resistor for the blade ID. This was entered in the to blade array. When I get a chance I am going to check the blade ID and resistance in the serial monitor..

Regards,

GMcIvor

The connector end looks good, but I'm not sure about the LED hookup. The pictures aren't quite enough to show me what is hoked up to what, but it looks a little suspicious to me. Are you sure the yellow lead is hooked up to DI (data-in) on the LED?


Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 15, 2017, 11:34:13 AM
So, I built the full length blade and the LED's do not turn off... Attached you will find the pictures of the connector (http://drive.google.com/open?id=0BwqZ0qtAgdt_OVE0Qk4wamppdFk (http://drive.google.com/open?id=0BwqZ0qtAgdt_OVE0Qk4wamppdFk)). I used a 100 ohm resistor to prevent data leech, and a 3.3 kohm resistor for the blade ID. This was entered in the to blade array. When I get a chance I am going to check the blade ID and resistance in the serial monitor..

Regards,

GMcIvor

The connector end looks good, but I'm not sure about the LED hookup. The pictures aren't quite enough to show me what is hoked up to what, but it looks a little suspicious to me. Are you sure the yellow lead is hooked up to DI (data-in) on the LED?

Yes, I am sure it is. I checked the pin out on the ones I bought and it seems to be correct here is the link to them (PL9823 F8;8mm round hat RGB LED with P9823 chipset inside;full color;frosted-in (https://www.aliexpress.com/item/PL9823-F8-8mm-round-hat-RGB-LED-with-PD9823-chipset-inside-full-color-frosted/1707244439.html?spm=2114.13010608.0.0.lbYTtE)) . I added pictures of the connections to the LED. I also added pictures of the blade ID from the serial monitor. One thing that is not expected is the 2 led blade has a blade id of 2.2kohm and the long blade of 3.3kohm. When I plug the full blade in it says its the two LED blade (see pictures http://drive.google.com/open?id=0BwqZ0qtAgdt_OVE0Qk4wamppdFk (http://drive.google.com/open?id=0BwqZ0qtAgdt_OVE0Qk4wamppdFk))

Regards,

GMcIvor

Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 15, 2017, 12:16:14 PM
So, I built the full length blade and the LED's do not turn off... Attached you will find the pictures of the connector (http://drive.google.com/open?id=0BwqZ0qtAgdt_OVE0Qk4wamppdFk (http://drive.google.com/open?id=0BwqZ0qtAgdt_OVE0Qk4wamppdFk)). I used a 100 ohm resistor to prevent data leech, and a 3.3 kohm resistor for the blade ID. This was entered in the to blade array. When I get a chance I am going to check the blade ID and resistance in the serial monitor..

Regards,

GMcIvor

The connector end looks good, but I'm not sure about the LED hookup. The pictures aren't quite enough to show me what is hoked up to what, but it looks a little suspicious to me. Are you sure the yellow lead is hooked up to DI (data-in) on the LED?

Yes, I am sure it is. I checked the pin out on the ones I bought and it seems to be correct here is the link to them (PL9823 F8;8mm round hat RGB LED with P9823 chipset inside;full color;frosted-in (https://www.aliexpress.com/item/PL9823-F8-8mm-round-hat-RGB-LED-with-PD9823-chipset-inside-full-color-frosted/1707244439.html?spm=2114.13010608.0.0.lbYTtE)) . I added pictures of the connections to the LED. I also added pictures of the blade ID from the serial monitor. One thing that is not expected is the 2 led blade has a blade id of 2.2kohm and the long blade of 3.3kohm. When I plug the full blade in it says its the two LED blade (see pictures http://drive.google.com/open?id=0BwqZ0qtAgdt_OVE0Qk4wamppdFk (http://drive.google.com/open?id=0BwqZ0qtAgdt_OVE0Qk4wamppdFk))

Regards,

GMcIvor

Ok, this is going to hurt....
That page is super-confusing.
The headline says PL9823, but there are no less than three different pin-assignments listed on that page.
One is for PL9823, one is for PL9834, and the third one I have no idea what it's for.

If we assume that you got what you ordered, (which I'm going to assume is PL9823) then only the image containing the PL9823 datasheet is correct. (PDF here: https://cdn.instructables.com/ORIG/FW0/YN1X/IHDUL683/FW0YN1XIHDUL683.pdf (https://cdn.instructables.com/ORIG/FW0/YN1X/IHDUL683/FW0YN1XIHDUL683.pdf)) This datasheet specifies that DIN is next to VCC, which is not how you have it hooked up in the image.

Assuming that PL9823 is in fact what you have, and all you did was to get DIN and DOUT backwards, you can fix it by turning your string around and feeding in the data from the other end...

Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 15, 2017, 12:45:22 PM
WAHOO!!! IT WORKS!! that was the problem. So now I know how to fix it for future reference. Okay, How do I change presets with the single button I held the power button down and put the clash and it stayed blue...

But I am so happy I have the lights working!!!

when I activate clash on the serial monitor it works great. but when I activate from the saber. some of the LED's go different colors. in a small section of the blade. I will take video and show you. It also sometimes does it on first power on when I plug the blade in.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 15, 2017, 01:29:29 PM
I figured out the rainbow issue. One if the LEDS was dim and I think shorting. But i straighten out the wire and bam, solved that issue. :)

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 15, 2017, 01:42:05 PM
Nice progress!

Changing presets: hold power and whack the saber (clash). You should hear a short beep and the *previous* preset should be selected. (If it's at the first one, it will go to the last one.) You can also type "next preset" or "prev preset" in the serial monitor to change preset.
If that doesn't work, post your blades and presets arrays.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 15, 2017, 01:43:13 PM
Does the saber have to be on or off to change presets when holding the power and the clash.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 15, 2017, 01:49:25 PM
Off.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 15, 2017, 01:55:40 PM
That works in the serial monitor and on the saber itself.

Thanks for all your help. This was a long trouble shooting process. Having you to ask question made the process a lot easier :). I will post pictures when I finishes assembling the whole thing. Now my students and other students in the school can see what I have been working on since February. Hopefully they will sign up for my courses :)

Then I will start the next one :)

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: jbkuma on May 16, 2017, 07:14:56 PM
Strangely, the part that excites me the most about all of this is interacting with people who are using it. Basically I think the customer support will be fun. (I think there must be something wrong with me...)

I'm not really going to comment on this, I'm just going to quote this here.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 16, 2017, 11:43:56 PM
New lightsaber.ino upload, version 1.89
Got a cool new templated system that makes it easier to build blade styles. I've updated the website to outline how to do it: Teensy Saber OS (beta) (http://fredrik.hubbe.net/lightsaber/teensy_saber.html)

I'm going to try to make some videos this weekend to show off it off.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 17, 2017, 08:42:31 AM
New lightsaber.ino upload, version 1.89
Got a cool new templated system that makes it easier to build blade styles. I've updated the website to outline how to do it: Teensy Saber OS (beta) (http://fredrik.hubbe.net/lightsaber/teensy_saber.html)

I'm going to try to make some videos this weekend to show off it off.

A template system, that sounds very interesting! I was just wondering about how to build your own blade styles.

I am just doing the final touches on my saber before assembling the whole thing in the hilt. For sound tracks I have them in the track file and the Cantina and Imperial march will play. The other three sound tracks I have will not play. It says cannot find sound "insert sound name", even though they are in the same place as the other. All are .WAV files.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 17, 2017, 10:17:19 AM

A template system, that sounds very interesting! I was just wondering about how to build your own blade styles.


If you have trouble figuring it out, or if you have ideas that aren't easy to implement with the
available components, let me know and I'll have a go at implementing it.

Quote
I am just doing the final touches on my saber before assembling the whole thing in the hilt. For sound tracks I have them in the track file and the Cantina and Imperial march will play. The other three sound tracks I have will not play. It says cannot find sound "insert sound name", even though they are in the same place as the other. All are .WAV files.

Checklist:
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 18, 2017, 07:19:00 PM
So I figured it out. I had to many characters in the file names. It all works now. Just have to put the string blade into the tube.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 18, 2017, 07:32:42 PM
Now I just need to figure out how to add the MTP support. I went to the link and downloaded the files but I couldn't figure out how to change the Teensy board base and add those downloaded files to add the support. Where I put my SD card it makes it had to remove, would be easier to do it over USB.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 18, 2017, 07:39:45 PM
Probably easier to just wait, or maybe ask Paul (the teensy guy) to hurry up and make it a properly selecetable option...
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 18, 2017, 07:44:02 PM
Probably easier to just wait, or maybe ask Paul (the teensy guy) to hurry up and make it a properly selectable option...

Alright sounds good. Yes, I could ask him, but I can probably make do for now.

The new gradient feature in the blade array is pretty nice:) So many possibilities now!

Regards,
 
GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 18, 2017, 07:58:14 PM
The new gradient feature in the blade array is pretty nice:) So many possibilities now!

Feel free to share your favorites here.
While there aren't many teensysaber users around (yet), future users are sure to appreciate it. :)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 18, 2017, 08:04:16 PM
The new gradient feature in the blade array is pretty nice:) So many possibilities now!

Feel free to share your favorites here.
While there aren't many teensysaber users around (yet), future users are sure to appreciate it. :)

Once I create some I will definitely share! Yes, and my students (if they decide to make one) will be supporting you and be future users. :)

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 19, 2017, 08:09:20 AM
Alright, So I have encountered a problem. I charged the battery the saber was working I left it (with the blade out) for a few mins then I plugged the blade in and no boot up sound or anything. So I took it out of the hilt. thought maybe it didn't charge and the battery is low so its not booting the teensy. Batt voltage is at 4.88 it says. I tried to upload the software to re image it just to see if something was corrupt and it wont load software. I hear a buzz coming from the teensy. In the serial monitor I can turn the blade on and off change presets(the beep sound distorted now). But when I turn it on in the serial monitor I hear a horrid buzzing coming from the speaker not the sound font. and it wont shut off unless i pull out the blade.

I am at a loss since it was working perfectly normal last night.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 19, 2017, 11:45:37 AM
First of all, battery voltage of 4.88 is alarmingly high and can damage your battery.
(Assuming the voltage measurement is correct of course. Double-check with a multimeter.)
Normally, li-ion chargers should stop charging when the battery gets to 4.2 volt, this is especially important since the teensy circuits aren't designed for anything over 5 volts.

So, I have to ask: You didn't use a 2-cell (7.4v) charger, right?

Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 19, 2017, 12:03:33 PM
Oh dang! How do I fix that? The battery is jammed in there pretty good. I bought the 3.7v smart charger from the custom saber shop. I looked at the info on the back and it says
Model: 37li-ion charger
Input: 100-240Vac 50/60hz
Output: 4.2V 500mAdc

The multi meter currently says 4.33V.

I hope I can salvage the build and not have to restart!!

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 19, 2017, 01:21:02 PM
4.33v is a smidge high, but nothing to worry about. (4.8v would be bad, but the battery can probably handle it once or twice, it would just age the battery faster I think.) The battery charger you have *should* be fine (I think it's the same I have), so I don't really know what went wrong.

If the sound is bad, here is the checklist:
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 19, 2017, 01:31:15 PM
4.33v is a smidge high, but nothing to worry about. (4.8v would be bad, but the battery can probably handle it once or twice, it would just age the battery faster I think.) The battery charger you have *should* be fine (I think it's the same I have), so I don't really know what went wrong.

If the sound is bad, here is the checklist:
  • If the sound is crap, but the volume is largely unchanged, try a different speaker. The speaker could be cracked or have metal parts in it, attracted by magnets.
  • Cross-talk from the SD card can cause audio problems. Try routing the the writes from pins 11, 12 and 13 differently.
  • Audio chip runs on 5v, check that the output from the booster is actually 5 volts.
  • Audio chip needs the 5 volts to be stable. To find out if it is, set your multimeter to AC and measure between 5v and GND. If it reads more than a few millivolts, there might be a problem.
  • Audio chip can die if overheated or shorted. It has built-in protection for this, but it can happen anyways. If that happens you need a new prop shield. Note that de-soldering the prop shield from the teensy without damaging anything is difficult. In most cases I've had to just start over. Usually, broken audio chips results in NO audio though. However, the audio chips have 2 H-bridges in them,
     which mean four separate FETs. If only one of them dies, the result could be bad audio. You might also want to check the pjrc forums as they might have more ways to diagnose prop shield problems.
  • If you have an oscilloscope, measure pin A12 on the teensy while playing audio and see what it looks like. Compare with output from audio amplifier.

I think its the power boost. Man those things fry easy. Its out putting 2.97V. I am leaning towards it being screwed.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 19, 2017, 03:23:24 PM
It was a fried powerboost. I dunno how it fried, probably when the battery overcharged I'm guessing. But at least it works. Hopefully I don't have to replace it every so often....


Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 19, 2017, 03:27:48 PM
You shouldn't. I've been using mine for almost a year now with no problems.
Keep an eye on it next time you charge though. It shouldn't take more than a few hours, so don't leave it over night. Check the voltages and make sure nothing is heating up while charging.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 19, 2017, 03:33:01 PM
You shouldn't. I've been using mine for almost a year now with no problems.
Keep an eye on it next time you charge though. It shouldn't take more than a few hours, so don't leave it over night. Check the voltages and make sure nothing is heating up while charging.

I will keep an eye on it. Yes I only put it on charge for 2 hours or so. I will keep a better eye on it, while charging.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 20, 2017, 04:35:43 PM
When buying soundfonts which do you recommend for the teensysaber NEC(polyphonic) or Plectar(monophomic)? I know teensysaber will support both.

Which do you use ?

Regards,

GMcIvor 
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 20, 2017, 05:43:51 PM
For me it depends more on how they sound than what kind of font it is.
Generally speaking, I think that polyphonic fonts are better than monophonic ones though.
I don't think anybody is offering fonts with looped swing sounds yet, which is too bad, because I highly recommend it.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 20, 2017, 05:46:22 PM
For me it depends more on how they sound than what kind of font it is.
Generally speaking, I think that polyphonic fonts are better than monophonic ones though.
I don't think anybody is offering fonts with looped swing sounds yet, which is too bad, because I highly recommend it.

Oh okay, why do you recommended looped swing sounds ? Better sound overall?

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 20, 2017, 09:04:45 PM
For me it depends more on how they sound than what kind of font it is.
Generally speaking, I think that polyphonic fonts are better than monophonic ones though.
I don't think anybody is offering fonts with looped swing sounds yet, which is too bad, because I highly recommend it.

Oh okay, why do you recommended looped swing sounds ? Better sound overall?

I like the looped swing sounds because the motion of the saber directly affects the sound.
The feedback that you get from the saber makes it feel much more "real" than discrete swing sounds.
Also, it sounds great. :)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 20, 2017, 09:07:18 PM
New lightsaber.ino upload, version 1.89
Got a cool new templated system that makes it easier to build blade styles. I've updated the website to outline how to do it: Teensy Saber OS (beta) (http://fredrik.hubbe.net/lightsaber/teensy_saber.html)

I'm going to try to make some videos this weekend to show off it off.

Video made:


The colors aren't quite right, and even though I turned down exposure a LOT, many colors still come out pretty much white.
However, the reflection in the glass table really helps sometimes. :)

In order:
Cyan blade
Blue with white tip extension
Red fire blade
Red blade
Blue fire
Green blade which starts white and fades to green.
White blade
Yellow blade
Purple blade with white tip extension
Red-Blue gradient blade
Rainbow blade
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 20, 2017, 11:36:15 PM
For me it depends more on how they sound than what kind of font it is.
Generally speaking, I think that polyphonic fonts are better than monophonic ones though.
I don't think anybody is offering fonts with looped swing sounds yet, which is too bad, because I highly recommend it.

Oh okay, why do you recommended looped swing sounds ? Better sound overall?

I like the looped swing sounds because the motion of the saber directly affects the sound.
The feedback that you get from the saber makes it feel much more "real" than discrete swing sounds.
Also, it sounds great. :)

That makes all the difference. Hopefully more people makes fonts like that :)

Great video of the blade configurations! very neat to see them all. I also like the sports almanac under the table! Back to the future 2! :)

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 21, 2017, 12:44:12 AM
I've released a new version of lightsaber.ino (1.93) which fixes a couple of audio bugs and and makes the in/out animations work better when used quickly.

Next I'm probably going to work on cleaning up the button handling, as there are some bugs there. Also, it's probably time to implement a lockup mode.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on May 22, 2017, 04:34:12 PM
Profezzorn, How import is the value of the blade ID resistor?  I'm building a blade using WS2811 compatible LED strips and your instructions call for an 8.2K resistor for blade identification.  The closest resistor I have on hand is a 10K one and I don't intend to have more than one blade.  Also, I see the "#define NUM_BLADES 1" statement in the lightsaber-1.86.ino code and have found the id() function where blade identification takes place but I don't quite understand how the blade identification resistor value matches up to the blade ID.  Can you explain?

Thanks again for all your work on this project!
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 22, 2017, 04:58:35 PM
Profezzorn, How import is the value of the blade ID resistor?  I'm building a blade using WS2811 compatible LED strips and your instructions call for an 8.2K resistor for blade identification.  The closest resistor I have on hand is a 10K one and I don't intend to have more than one blade.  Also, I see the "#define NUM_BLADES 1" statement in the lightsaber-1.86.ino code and have found the id() function where blade identification takes place but I don't quite understand how the blade identification resistor value matches up to the blade ID.  Can you explain?

Thanks again for all your work on this project!

Note that NUM_BLADES defines how many blades you intend to have connected at the at the same time, so just leave that one alone for now. :)

What you want to do is to modify the blades array to only contain one entry for each blade you have. Since you only have one blade, there will only be one entry and the code will always choose that entry, regardless of the blade ID resistor. If you only have one blade, the blade ID resistor serves no purpose and can be omitted.

If you have multiple blades, you can still choose whatever resistors you want for the blade ID, as long as you adjust the blades array to match. The code that actually chooses the right entry from the blades array is in Saber::FindBlade if you want to take a look.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on May 22, 2017, 06:49:31 PM
Note that NUM_BLADES defines how many blades you intend to have connected at the at the same time, so just leave that one alone for now. :)

What you want to do is to modify the blades array to only contain one entry for each blade you have. Since you only have one blade, there will only be one entry and the code will always choose that entry, regardless of the blade ID resistor. If you only have one blade, the blade ID resistor serves no purpose and can be omitted.

If you have multiple blades, you can still choose whatever resistors you want for the blade ID, as long as you adjust the blades array to match. The code that actually chooses the right entry from the blades array is in Saber::FindBlade if you want to take a look.


I found the BladeConfig_blades[] section which contains an ifdef for ENABLE_WS2811.  Based on what I see there I would need to still use a unique resistor for my WS2811 string blade 144 LEDs blade (10K in my case) and my charging adapter... correct?

Thanks again for your help.  :grin:
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 22, 2017, 07:14:14 PM
Note that NUM_BLADES defines how many blades you intend to have connected at the at the same time, so just leave that one alone for now. :)

What you want to do is to modify the blades array to only contain one entry for each blade you have. Since you only have one blade, there will only be one entry and the code will always choose that entry, regardless of the blade ID resistor. If you only have one blade, the blade ID resistor serves no purpose and can be omitted.

If you have multiple blades, you can still choose whatever resistors you want for the blade ID, as long as you adjust the blades array to match. The code that actually chooses the right entry from the blades array is in Saber::FindBlade if you want to take a look.


I found the BladeConfig_blades[] section which contains an ifdef for ENABLE_WS2811.  Based on what I see there I would need to still use a unique resistor for my WS2811 string blade 144 LEDs blade (10K in my case) and my charging adapter... correct?

Thanks again for your help.  :grin:

That is correct. A active charging adapter (which turns the saber on while charging) counts as a separate blade, and needs it's own blade ID resistor.

A passive charging adapter, or a charging port wired into the hilt does not need it's own ID.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 23, 2017, 01:04:21 PM
So I put it all together and it works great, just a couple questions. I bought some sound fonts from saberfont.com and when I put them on they seem to be very quiet. I can barely hear the hum of some but the effects are loud on, off, clash.

Also When I press the button and clash to switch a preset sometimes it will give me two beeps. So it is skipping two presets ahead rather then one.

I also have 23 boot sounds in the boot folder that it will play on stop up (I have it set to display the battery voltage on boot). But it likes to always pick boot6 (I can change any font to boot6 and it will play that font) I am wondering how to make it pick any one of the 23 boot sounds I have. if that is possible that is. If not no big deal... 

Any ideas?

I'm in the home stretch I can see the light at the end of the tunnel.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 23, 2017, 02:47:46 PM
So I put it all together and it works great, just a couple questions. I bought some sound fonts from saberfont.com and when I put them on they seem to be very quiet. I can barely hear the hum of some but the effects are loud on, off, clash.

What font(s) are you using?
I'm doing some work on the sound code right now, and I've realized that the volume
is a bit of a mess. Originally I lowered the volume of the hum to make room to make it
louder when you swing the saber around, which might be part of the problem.

The other problem may be that NEC fonts have some volume settings which I have not implemented
yet, so I need to look into that.


Quote

Also When I press the button and clash to switch a preset sometimes it will give me two beeps. So it is skipping two presets ahead rather then one.


I should probably make the time minimum time between clashes a bit longer.
As it is it is only 0.1s. You can easily change it yourself too, just find the line that
says:
Code: [Select]
if (t - last_clash < 100) return; and change it. (100 is in milliseconds.)

Quote
I also have 23 boot sounds in the boot folder that it will play on stop up (I have it set to display the battery voltage on boot). But it likes to always pick boot6 (I can change any font to boot6 and it will play that font) I am wondering how to make it pick any one of the 23 boot sounds I have. if that is possible that is. If not no big deal... 

Any ideas?

I'm in the home stretch I can see the light at the end of the tunnel.

Interesting. That's what happen when you use a pseudo-random generator without seeding it.
Ideally I'd use the motion chip to get some random data to feed into the random generator, but the motion chip takes a little while to initiate, so I might have to look for another source of randomness.

I will post updates as problems are worked out.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 23, 2017, 08:13:02 PM
I will post updates as problems are worked out.

I have a version that fixes the random boot sounds and the double-preset-skip problems.
I have not fixed the volume issues yet. (It would be helpful to know what font you used...)
Anyways, it's not very well tested yet, so I haven't uploaded it to my site yet, but if you want
to try it out, you can get it here: https://raw.githubusercontent.com/profezzorn/TeensySaber/master/lightsaber.ino (https://raw.githubusercontent.com/profezzorn/TeensySaber/master/lightsaber.ino)

Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 23, 2017, 08:15:47 PM
Quote
What font(s) are you using?
I'm doing some work on the sound code right now, and I've realized that the volume
is a bit of a mess. Originally I lowered the volume of the hum to make room to make it
louder when you swing the saber around, which might be part of the problem.

The other problem may be that NEC fonts have some volume settings which I have not implemented
yet, so I need to look into that.

I am using several some are NEC and some are plectar they are listed below.

LB-FormIV (NEC)
L-Kylo (NEC)
L-CW-GG (PLectar)
LB-E7 Graflex  (NEC)
JS-GraflexIVHD (Plectar)
NS-MasterWindu  (Plectar)
JS-MPPHD (Plectar)
LB-SkywalkerROTJ (NEC)

I plan to get more eventually as well. This is what I have bought so far. I have some default Niagon electronics ones as well.

below is the font setup in the code.
Code: [Select]
{ "Boot", "tracks/Ftheme.wav", &style_charging },
//{ "Fonts", "Tracks/Cantina.wav", &style_pov },
//{ "Fonts", "Tracks/Cantina.wav", StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>() },
  { "Fonts/EssEpII", "Tracks/Cantina.wav", StyleRainbowPtr<300, 800>() },
  { "Fonts/standIs", "Tracks/Gintro.wav", StyleNormalPtr<WHITE, RED, 300, 800>() },
  { "Fonts/ATEasy", "Tracks/Cantina.wav", StyleNormalPtr<YELLOW, BLUE, 300, 800>() },
  { "Fonts/Grievous", "Tracks/Gintro.wav", StyleFirePtr<GREEN, CYAN>() },
  { "Fonts/Kylo", "Tracks/Kintro.wav", StyleFirePtr<RED, YELLOW>() },
  { "Fonts/Yoda1", "Tracks/Cantina.wav",
    StylePtr<InOutHelper<SimpleClash<OnSpark<GREEN> >, 300, 800> >() },
  { "Fonts/Windu", "Tracks/Cantina.wav",
    StylePtr<InOutSparkTip<SimpleClash<MAGENTA, WHITE>, 300, 800> >() },
  { "Fonts/MPP", "Tracks/Vader.wav", StyleNormalPtr<RED, WHITE, 300, 800>() },
  { "Fonts/ROTJ", "Tracks/Cantina.wav", StyleNormalPtr<Gradient<BLUE, CYAN>, WHITE, 300, 800>() },
  { "Fonts/Graflex7", "Tracks/SIntro.wav",
    StylePtr<InOutSparkTip<SimpleClash<BLUE, WHITE>, 300, 800> >() },
  { "Fonts/Graflex4", "Tracks/Ftheme.wav", StyleNormalPtr<CYAN, WHITE, 300, 800>() },

That would make sense. Speaking of sound code, I know you were implementing a potential lockup. I notice some sound fonts come with a spin sound. S when you continually spin the saber it initiates the sound. Is that something you are thinking of implementing?


Quote
I should probably make the time minimum time between clashes a bit longer.
As it is it is only 0.1s. You can easily change it yourself too, just find the line that
says:
Code: [Select]
if (t - last_clash < 100) return; and change it. (100 is in milliseconds.)

Thank you, I will change that fora  longer delay time. Hopefully that fixes the double preset.

Quote
Interesting. That's what happen when you use a pseudo-random generator without seeding it.
Ideally I'd use the motion chip to get some random data to feed into the random generator, but the motion chip takes a little while to initiate, so I might have to look for another source of randomness.

I will post updates as problems are worked out.

Alright, not a big deal right now but would be nice to hear different ones.

Thank you again for your development and continued support.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 23, 2017, 08:34:09 PM

LB-FormIV (NEC)
L-Kylo (NEC)
L-CW-GG (PLectar)
LB-E7 Graflex  (NEC)
JS-GraflexIVHD (Plectar)
NS-MasterWindu  (Plectar)
JS-MPPHD (Plectar)
LB-SkywalkerROTJ (NEC)


Is the hum quiet on all of these fonts, or just some of them?
I'm going to go buy some (but not all) of these, so I want to make sure that I get ones that reproduce the problem you have.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 23, 2017, 08:40:48 PM
Quote
Is the hum quiet on all of these fonts, or just some of them?
I'm going to go buy some (but not all) of these, so I want to make sure that I get ones that reproduce the problem you have.

My saber is at work, but if I remember correctly it is all of them. I will check first thing in the morning when I arrive (730am). And I will specially let you know which ones.

A couple I could hear but they were quiet, others were alot quieter.

Which sound fonts did you purchase on yours? Maybe I will buy a couple and see if their is a difference from yours as well.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 24, 2017, 08:02:34 AM
Good Morning,

Alright so hear is the information I gathered. Sometimes it skips playing the Font sound when a new font is selected. The ones listed could be louder are okay, but Id like to see the volume go up. The other ones are quiet or barely audible.

JS-GraflexIVHD (Plectar)
hum and clash

LB-E7 Graflex  (NEC)
hum

LB-SkywalkerROTJ (NEC)
hum 1 Hum2 is a soundtrack/hum that is okay.

JS-MPPHD (Plectar)
hum and clash could be louder

NS-MasterWindu  (Plectar)
hum is super quiet could barely hear
clash could be louder

LB-FormIV (NEC)
hum and clash audible but could be louder sometimes hard to hear.

L-Kylo (NEC)
hum and clash could be louder

L-CW-GG (PLectar)
hum and clash could be louder

What are a couple you have purchased you know are happy with and sound great? Maybe I will buy them and do some testing as well...

Regards,

GMcIvor

Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 24, 2017, 10:22:33 AM
I'm going to do some tuning on the sound volume over the next few days.
The current state of things is that in a NEC font, the hum is played more quietly than everything else, and in a plecter font, everything is played fairly quietly. The reason for this is to avoid clipping when he volume is increased, which happens when you swing the saber around.

What I'm going to do is actually to reduce the volume of NEC effects and sound tracks so that everything is at the same level initially, and then I'm going to tune the dynamic compressor to produce louder sounds in general.

One of the fonts I use a lot is the JS-Graflex IV HD. It's pretty quiet on my test bench,
but  not on my actual saber, so clearly what speaker you use matters.

Anyway, expect another update in a day or two.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 24, 2017, 10:30:33 AM
I'm going to do some tuning on the sound volume over the next few days.
The current state of things is that in a NEC font, the hum is played more quietly than everything else, and in a plecter font, everything is played fairly quietly. The reason for this is to avoid clipping when he volume is increased, which happens when you swing the saber around.

What I'm going to do is actually to reduce the volume of NEC effects and sound tracks so that everything is at the same level initially, and then I'm going to tune the dynamic compressor to produce louder sounds in general.

One of the fonts I use a lot is the JS-Graflex IV HD. It's pretty quiet on my test bench,
but  not on my actual saber, so clearly what speaker you use matters.

Anyway, expect another update in a day or two.

okay sounds good, yeah you don't want clipping in the sounds when you are moving your saber around.

Yeah I think that is the font I have listed as well. I am using the 28mm bass boosted speaker from the custom saber shop.

I look forward to hearing the update when it comes.

Thanks again.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on May 24, 2017, 05:48:53 PM
Profezzorn,
First let me apologize if this question has been asked before...

I am working on the V1 electronics this evening and have run into a question.  I have soldered the headers to the Prop Shield as your instructions describe.  Your instructions mention not connecting the 3.3V pin through to the SD adapter (because... "It's easier to just feed it 5 volts") but it doesn't mention the AGND pin.  As far as I can tell both the 3.3V and AGND pins are not shown connected through to the SD adapter in your circuit diagram. Both the 3.3V and the AGND pins appear to be connected through to the SD adapter in your photo titled "When it's all hooked up, it should look something like this".  Should I connect these pins through or not?

Thanks in advance for your help.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 24, 2017, 07:00:07 PM
Sorry about the confusion.

On that side of the SD adapter, only the 5v pad is actually connected. The rest are not connected to anything, so it doesn't matter if you put pins there or not.  (See this page: SD Adaptor, to use SD flash cards with Teensy, Arduino and other AVR boards (https://www.pjrc.com/teensy/sd_adaptor.html), note that SW is also not connected to anything since the resistor is not populated by default.)

I recommend connecting them simply to hold the sd adapter better in place.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on May 24, 2017, 07:06:43 PM
Thanks.  That makes perfect sense.  I should have checked the PJRC.com info myself.

Again, thanks for all your help.  My Teensy Saber is getting closer to being complete.  :grin:
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 24, 2017, 09:47:20 PM
I'm going to do some tuning on the sound volume over the next few days.
The current state of things is that in a NEC font, the hum is played more quietly than everything else, and in a plecter font, everything is played fairly quietly. The reason for this is to avoid clipping when he volume is increased, which happens when you swing the saber around.

What I'm going to do is actually to reduce the volume of NEC effects and sound tracks so that everything is at the same level initially, and then I'm going to tune the dynamic compressor to produce louder sounds in general.

One of the fonts I use a lot is the JS-Graflex IV HD. It's pretty quiet on my test bench,
but  not on my actual saber, so clearly what speaker you use matters.

Anyway, expect another update in a day or two.

Ok, I did exactly this, and I think the sounds are now roughly three times louder than before, while still leaving a little room for swings, clashes and background music. As before, it's not very well tested yet, but it's uploaded to github:
https://raw.githubusercontent.com/profezzorn/TeensySaber/master/lightsaber.ino (https://raw.githubusercontent.com/profezzorn/TeensySaber/master/lightsaber.ino)

I'll probably have time to do proper testing this weekend, and then I can upload it to hubbe.net.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 26, 2017, 02:20:31 PM
I thought of a couple questions as I was thinking of ways to pitch to students.

1) well, this isn't one but will a spin mode be implemented ? Some sound founts have that sound. 

2) When will the V2 boards be available ? I think these boards will make it easier for students to complete the sabers. Less places for things to go wrong.

3) I looked through the code and couldn't find it, but is their a way to change the POV to display something other then starwars? Like students names or our school name or something if kids wanted to change it or to promote it to other students?

Regards,

GMcIvor 
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 26, 2017, 02:50:00 PM
I thought of a couple questions as I was thinking of ways to pitch to students.

1) well, this isn't one but will a spin mode be implemented ? Some sound founts have that sound.

Probably. It's not high on my list, and it's not clear to me how you distinguish a swing motion from a spin motion. As always, if someone else wants to implement it and send me a patch I'd be happy to include it (after some testing).
 
Quote
2) When will the V2 boards be available ? I think these boards will make it easier for students to complete the sabers. Less places for things to go wrong.

Very soon. I'm considering selling some of the ones I made myself, and I expect to have ~20 for sales within two weeks. Unfortunately I cannot promise a steady supply.

Quote
3) I looked through the code and couldn't find it, but is their a way to change the POV to display something other then starwars? Like students names or our school name or something if kids wanted to change it or to promote it to other students? 

The POV is controlled by a gargantuan array of numbers inside lightsaber.ino.
It would probably be better to read it from the SD card, but I'm not sure if that would slow it down or not....

Either way, I wrote a tool that computes that array from an input image, and I've been meaning to open-source that tool so that you could switch out the array for something else. I just haven't gotten around to it yet. Maybe I will have time to do that this weekend.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on May 26, 2017, 09:18:29 PM
Quote
Probably. It's not high on my list, and it's not clear to me how you distinguish a swing motion from a spin motion. As always, if someone else wants to implement it and send me a patch I'd be happy to include it (after some testing).

Makes sense, I'm sure someone will, but their are more things on the priority list that are probably better for the teensysaber overall.
 
Quote
Very soon. I'm considering selling some of the ones I made myself, and I expect to have ~20 for sales within two weeks. Unfortunately I cannot promise a steady supply.

That's awesome! I'm excited for these to become available. Will it be one per person or any ideas of a purchase cap? Understandable, over the summer, I might biuld your test rig and try building some of the boards (for the new semester and new sabers) myself to see if I can. On the test rig, it says you need two of the boards, but the bottom one is unpopulated of parts. What purpose does the bottom board serve?


Quote
The POV is controlled by a gargantuan array of numbers inside lightsaber.ino.
It would probably be better to read it from the SD card, but I'm not sure if that would slow it down or not....

Either way, I wrote a tool that computes that array from an input image, and I've been meaning to open-source that tool so
that you could switch out the array for something else. I just haven't gotten around to it yet. Maybe I will have time to do

oh wow, sounds like a lot numbers. No rush, was just an idea. I am happy to wait to when ever that happens, not a big deal right now. For more in the future.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 27, 2017, 12:14:43 PM
The pre-run teensysaber v2 is now live: TeensySaber V2 for sale (https://www.fx-sabers.com/forum/index.php?topic=51864.0)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on May 28, 2017, 08:44:09 PM
Profezzorn,
So I've gotten to the point where I have my Teensy Saber electronics working (sort of).  There are two issues I can't seem to figure out. 

The first is that the "aux2" button doesn't seem to trigger.  It's not a wiring issue either because I've jump'ed the Teensy pins to GND and both other buttons ("pow" [pin 16] and "aux" [pin 15]) function but the "aux2" button (pin 17) doesn't seem to do anything (it doesn't show being triggered in the serial monitor either). I'm assuming that this is preventing me from selecting the next preset.  I can however use the "next pre" command in the serial monitor and step through all my presets.  I did change the touch button to a normal button using the change I found in an earlier post (see below).

  // CONFIGURABLE, use "monitor touch" to see the range of
  // values from the touch sensor, then select a value that is
  // big enough to not trigger the touch sensor randomly.
            // power_(powerButtonPin, 1700, "pow"),
            power_(powerButtonPin, "pow"),
            aux_(auxPin, "aux"),
            aux2_(aux2Pin, "aux2") {}

Any ideas what is wrong?  Am I expecting the buttons to function correctly?  If not, how should I step through the presets?

My second issue is most likely a blade array configuration issue.  My blade is a pair of 144 LED WS2811 compatible RGB strips.  I've tested them all individually using a test rig I built using an Arduino Uno and every LED lights and changes colors correctly.  I've configured my BladeConfig as follows...

BladeConfig blades[] = {
#ifdef ENABLE_WS2811
  {   10000, WS2811BladePtr<144, WS2811_800kHz | WS2811_GRB>(), CONFIGARRAY(my_presets) },
#endif
};

I've configured "my_presets" as follows...

Preset my_presets[] = {
  { "", "", StyleNormalPtr<GREEN, WHITE, 300, 800>() },
  { "", "", StyleNormalPtr<BLUE, WHITE, 300, 800>() },
  { "", "", StyleNormalPtr<CYAN, WHITE, 300, 800>() },
  { "", "", StyleNormalPtr<RED, YELLOW, 300, 800>() },
  { "", "", StyleNormalPtr<MAGENTA, WHITE, 300, 800>() },
  { "", "", StyleNormalPtr<YELLOW, RED, 300, 800>() },
  { "", "", StyleNormalPtr<WHITE, RED, 300, 800>() },
};

So here's my issue...  I am getting a sparkling rainbow of colors when the blade animates on and off.  The sparkling rainbow appears in the portion of the blade that shouldn't be lit.  Any idea what could be wrong and how to correct it?

You should also note that I'm using the SerialFlash on the Prop Shield to store my single Soundfont (I do not have the SD Adapter connected and instead connected MISO, MOSI and SCK through to the Teensy 3.2 so I could access the SerialFlash).  This is why I left the directory/folder name blank in all my presets.  I also don't have any music tracks loaded... just the following in the root folder of the SerialFlash...

\teensytransfer>teensytransfer -l
   47404 clash1.wav
   49580 clash2.wav
   56492 clash3.wav
   37676 clash4.wav
   78636 clash5.wav
   30508 clash6.wav
   23980 clash7.wav
   25644 clash8.wav
   28076 poweroff1.wav
   75820 poweron1.wav
   28332 swing1.wav
   43436 swing2.wav
   89516 swing3.wav
   23980 swing4.wav
   25644 swing5.wav
   54316 swing6.wav
   23852 swing7.wav
   22444 swing8.wav
   89134 hum1.wav

All of these sound effects work without issue.

Thanks in advance for your help.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 28, 2017, 10:31:15 PM
Profezzorn,
So I've gotten to the point where I have my Teensy Saber electronics working (sort of).  There are two issues I can't seem to figure out. 

The first is that the "aux2" button doesn't seem to trigger.  It's not a wiring issue either because I've jump'ed the Teensy pins to GND and both other buttons ("pow" [pin 16] and "aux" [pin 15]) function but the "aux2" button (pin 17) doesn't seem to do anything (it doesn't show being triggered in the serial monitor either). I'm assuming that this is preventing me from selecting the next preset.  I can however use the "next pre" command in the serial monitor and step through all my presets.  I did change the touch button to a normal button using the change I found in an earlier post (see below).

  // CONFIGURABLE, use "monitor touch" to see the range of
  // values from the touch sensor, then select a value that is
  // big enough to not trigger the touch sensor randomly.
            // power_(powerButtonPin, 1700, "pow"),
            power_(powerButtonPin, "pow"),
            aux_(auxPin, "aux"),
            aux2_(aux2Pin, "aux2") {}

Any ideas what is wrong?  Am I expecting the buttons to function correctly?  If not, how should I step through the presets?

I don't have any functions assigned to the aux2 button. It probably works well, but doesn't do anything.
What would you like it to do?

Quote

My second issue is most likely a blade array configuration issue.  My blade is a pair of 144 LED WS2811 compatible RGB strips.  I've tested them all individually using a test rig I built using an Arduino Uno and every LED lights and changes colors correctly.  I've configured my BladeConfig as follows...

BladeConfig blades[] = {
#ifdef ENABLE_WS2811
  {   10000, WS2811BladePtr<144, WS2811_800kHz | WS2811_GRB>(), CONFIGARRAY(my_presets) },
#endif
};

I've configured "my_presets" as follows...

Preset my_presets[] = {
  { "", "", StyleNormalPtr<GREEN, WHITE, 300, 800>() },
  { "", "", StyleNormalPtr<BLUE, WHITE, 300, 800>() },
  { "", "", StyleNormalPtr<CYAN, WHITE, 300, 800>() },
  { "", "", StyleNormalPtr<RED, YELLOW, 300, 800>() },
  { "", "", StyleNormalPtr<MAGENTA, WHITE, 300, 800>() },
  { "", "", StyleNormalPtr<YELLOW, RED, 300, 800>() },
  { "", "", StyleNormalPtr<WHITE, RED, 300, 800>() },
};

So here's my issue...  I am getting a sparkling rainbow of colors when the blade animates on and off.  The sparkling rainbow appears in the portion of the blade that shouldn't be lit.  Any idea what could be wrong and how to correct it?

You should also note that I'm using the SerialFlash on the Prop Shield to store my single Soundfont (I do not have the SD Adapter connected and instead connected MISO, MOSI and SCK through to the Teensy 3.2 so I could access the SerialFlash).  This is why I left the directory/folder name blank in all my presets.  I also don't have any music tracks loaded... just the following in the root folder of the SerialFlash...

\teensytransfer>teensytransfer -l
   47404 clash1.wav
   49580 clash2.wav
   56492 clash3.wav
   37676 clash4.wav
   78636 clash5.wav
   30508 clash6.wav
   23980 clash7.wav
   25644 clash8.wav
   28076 poweroff1.wav
   75820 poweron1.wav
   28332 swing1.wav
   43436 swing2.wav
   89516 swing3.wav
   23980 swing4.wav
   25644 swing5.wav
   54316 swing6.wav
   23852 swing7.wav
   22444 swing8.wav
   89134 hum1.wav

All of these sound effects work without issue.

Thanks in advance for your help.

I really should fix it so that MTP works on serialflash so you don't have to use teensytransfer...

Anyways, the blade issue can be difficult, and could be caused by a number of different here is a checklist:


It's weird that it only (primarily) affects the dark area of the blade, or is it perhaps just easier to see there?
If none of the easy thing works, testing it with the arduino again is probably a good idea, and then change one thing
at a time until we can get it working.




Title: Re: Announcing the Teensy Saber open source sound board
Post by: bobi-one on May 29, 2017, 12:12:34 AM
Btw a small warning/ I managed to kill the amp of one of my teensysabers just by shorting the speaker. It is a delicate little thingie :).

I tested the board for battles and stumbled upon trickie situation, the sd card wobbles from its socket, and stops responding. Maybe re-init routine should be considered.



btw - reversing the direction of fireblade when turned off ( the old way looked really strange -  as the saber is fueled by burning gasoline :D)

        if (blade->is_on()) {
      blade->set(i, c);
    }
        else {
          blade->set(num_leds - 1 - i, c);
        }
      }






Title: Re: Announcing the Teensy Saber open source sound board
Post by: Sethski on May 29, 2017, 01:29:21 AM
I have a couple of questions and suggestions.

Questions re current functions/effects:

Does the board currently have a configurable flicker function for the blade? I'd assumed so as a 'standard' function in boards that have been around for a bit, but couldn't find anything to indicate this skimming back through threads and your site. It'd be great to add this if not currently implemented.

I read a 'lockup' effect is something you're considering implementing, and maybe soemthing like the 'tip drag' effect that Hyperdydne showes in his demo of board in development - which would be great. Does the standard setup with the board currently use a second auxilliary switch to trigger effects and navigate options?It'd also be great to have a localised 'blaster bolt deflect' with a tap and release of an aux button and a lockup effect with the aux button held. (Plecter Prizm v5 and NEC Igniter 2 seem to have implemented a nice blaster bolt deflect for neopixels, but not lockup effects that take full advantage of neopixel and similar strips yet).

I've been giving thought to the possibilities that addressable LEDs offer for lockup type effects and how one might configure the actions to control these in a straightforward way.

I guess there are three possible lockup effects that come to mind:

1) A lockup effect with colour change/flashes and flash/shimmer/flicker along the whole blade, similar to what's familiar from in-hilt LEDs.
2) Localised lockup where a central section of the blade displays the effect, fading out somewhat towards top and bottom of the blade.
3) Localised blade tip effect for draging the blade along a surface or stabbing a surface.

I guess it could be configured whether the effect was local or along the whole.

For localised effects, perhaps aux button held down for the mid blade, saber-on-saber type lockup and twist of hilt + aux for the tip effect?

Another idea that would be pleasing would be to be able to control (2) and (3) with a further twist of the hilt while the ux button is being held - a reasonably sharp twist clockwise to start the area of effect moving up the blade or anti-clockwise to start moving it down the blade, with a twist in the opposite direction to stop the effect moving (e.g. if the contact point between two locked blades moves, or the effect slowly moving down from the tip of the saber as it gradually pushes through something?). I guess this would be fed by info from the change in the gyro values of the motion detector within certain bounds. Maybe also possible/pleasing effect to correlate how hard the hilt's twisted with the speed the effect moves?)

Anyway, thought I'd share in case interesting to yourself or other folks. I'll be looking at what I can contribute myself when I have my Teensysaber 2 board wired up and working with the rest of electronics, but I no prior experience of coding, so it may take a bit of time to get a ahndle on this ;-)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 29, 2017, 11:24:53 AM
Btw a small warning/ I managed to kill the amp of one of my teensysabers just by shorting the speaker. It is a delicate little thingie :).

I have done that too. Supposedly the amp does have short-circuit protection, but obviously it doesn't
work very well. I'm experimenting with a different chip, maybe it will work better. I've only burned
one amp in the last year though, and I'm pretty sure I've shorted them more often then that, so I don't
think shorting the amp means instant death.

Hot-air rework stations are pretty cheap nowadays though if you wan to replace the amp.

Quote
I tested the board for battles and stumbled upon trickie situation, the sd card wobbles from its socket, and stops responding. Maybe re-init routine should be considered.

Interesting, I don't think that has happened to me, but I haven't tried serious battle with it either.
re-initing would be nice, but may not be simple as several of the SD functions simply don't return if
things go wrong.

I wonder if there is an easy way to secure the SD card so it doesn't wobble?

Quote
btw - reversing the direction of fireblade when turned off ( the old way looked really strange -  as the saber is fueled by burning gasoline :D)

        if (blade->is_on()) {
      blade->set(i, c);
    }
        else {
          blade->set(num_leds - 1 - i, c);
        }
      }

I can make that a template argument so that people can choose the direction they want.
Sucking in the flames seems weird to me... :)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 29, 2017, 11:42:50 AM
I have a couple of questions and suggestions.

Questions re current functions/effects:

Does the board currently have a configurable flicker function for the blade? I'd assumed so as a 'standard' function in boards that have been around for a bit, but couldn't find anything to indicate this skimming back through threads and your site. It'd be great to add this if not currently implemented.

No, but it should be easy to implement.
How do you want it to work?
I don't have any other boards myself, so I don't know what is standard and how they work. :)
I imagine that popular choices would be sound-based flickering and random flickering?

Quote
I read a 'lockup' effect is something you're considering implementing, and maybe soemthing like the 'tip drag' effect that Hyperdydne showes in his demo of board in development - which would be great. Does the standard setup with the board currently use a second auxilliary switch to trigger effects and navigate options?

No.
I don't have a saber with three buttons yet, so I haven't assigned any functions to aux2.
Also, I've actually tried to stay away from using configuration menues on the saber itself, as I think that seems really difficult to implement *well*. Instead everything is currently done through the "presets" array. Holding aux while tapping power goes to the next preset, holding power and tapping the blade goes to the previous preset. The presets are managed in the source itself.

Quote
It'd also be great to have a localised 'blaster bolt deflect' with a tap and release of an aux button and a lockup effect with the aux button held. (Plecter Prizm v5 and NEC Igniter 2 seem to have implemented a nice blaster bolt deflect for neopixels, but not lockup effects that take full advantage of neopixel and similar strips yet).

Right now, blaster and lockup are only partially implemented, they do the sound, but do not have blade effects.
This will be fixed, I just haven't gotten around to it yet.

Quote
I've been giving thought to the possibilities that addressable LEDs offer for lockup type effects and how one might configure the actions to control these in a straightforward way.

I guess there are three possible lockup effects that come to mind:

1) A lockup effect with colour change/flashes and flash/shimmer/flicker along the whole blade, similar to what's familiar from in-hilt LEDs.
2) Localised lockup where a central section of the blade displays the effect, fading out somewhat towards top and bottom of the blade.
3) Localised blade tip effect for draging the blade along a surface or stabbing a surface.

I guess it could be configured whether the effect was local or along the whole.

For localised effects, perhaps aux button held down for the mid blade, saber-on-saber type lockup and twist of hilt + aux for the tip effect?

My current plan is this:

Hold aux to activate lockup mode (nothing actually happens)
When a clash occurs, if the blade is pointing mostly up, activate lockup mode and have a flickering effect
in the bottom third of the blade.
If the blade is held downwards when the clash occurs, activate the drag effect where only the last 1-3 LEDs are flickering.
Either mode ends when aux is released.

Quote
Another idea that would be pleasing would be to be able to control (2) and (3) with a further twist of the hilt while the ux button is being held - a reasonably sharp twist clockwise to start the area of effect moving up the blade or anti-clockwise to start moving it down the blade, with a twist in the opposite direction to stop the effect moving (e.g. if the contact point between two locked blades moves, or the effect slowly moving down from the tip of the saber as it gradually pushes through something?). I guess this would be fed by info from the change in the gyro values of the motion detector within certain bounds. Maybe also possible/pleasing effect to correlate how hard the hilt's twisted with the speed the effect moves?)

Using hilt twists to control location is an interesting idea.
I've been thinking of ways to have the regular "clash" effect be localized, and if I can't
decduce it from the actual motion detector, maybe twists could work...
Either way, I will definitely implement *some* of this stuff, and since it's open-source, everybody can
change it any which way they want to if they don't like how I do it... :)

Quote
Anyway, thought I'd share in case interesting to yourself or other folks. I'll be looking at what I can contribute myself when I have my Teensysaber 2 board wired up and working with the rest of electronics, but I no prior experience of coding, so it may take a bit of time to get a ahndle on this ;-)

If you're serious about contributing, you'll need to learn a *little* coding to do it.
There is no better way to learn how to code than to customize something you love though.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 29, 2017, 03:37:04 PM
I think this thread is starting to get a little long and unwieldy, so I started a new thread specifically about the teensysaber software.

TeensySaber Software Discussion (https://www.fx-sabers.com/forum/index.php?topic=51871.0)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 29, 2017, 03:48:00 PM
Does the board currently have a configurable flicker function for the blade? I'd assumed so as a 'standard' function in boards that have been around for a bit, but couldn't find anything to indicate this skimming back through threads and your site. It'd be great to add this if not currently implemented.

So I added three different flickering effects to version 1.110:

Then I used the audio-flickering effect to implement the lockup effect.
Everything is configurable of course. :)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on May 29, 2017, 06:59:11 PM
I don't have any functions assigned to the aux2 button. It probably works well, but doesn't do anything.
What would you like it to do?

I guess I'm confused.  What button do I use to step through my presets?  I have tried multiple scenarios and can't get this to work.

Quote
It's weird that it only (primarily) affects the dark area of the blade, or is it perhaps just easier to see there?
If none of the easy thing works, testing it with the arduino again is probably a good idea, and then change one thing
at a time until we can get it working.

The sparkling effect is actually present in the blade when it is fully lit and it's just much harder to see.  I will work through testing everything but I'm leaning towards the timing issue because the sparkling effect is always the same and happens in a very uniform and repeating way.

Thanks for the checklist of troubleshooting steps.  I'll let you know how I do.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on May 29, 2017, 08:16:01 PM
So I now understand that you need to press both the "pow" and "aux" button to step through the presets.  Possibly allow "aux2" to do this might be nice (just my opinion).

Quote
Anyways, the blade issue can be difficult, and could be caused by a number of different here is a checklist:

  • It could be a timing issue, try WS2811_580kHz or WS2811_400kHz
  • Timing issue #2, teensysaber actually uses 740kHz instead of 800kHz, it's possible the strip doesn't like that. (Try search and replace 740000 with 800000 in the code.)
  • What kind of strip is it? Does it have a datasheet we can look at to determine the timing? Maybe what you need is WS2813_8000kHz?
  • Do you have a 30-100 ohm resistor between pin 20 on the teensy and data-in on the LED strip?
  • If the rainbow effect usually starts at a particular spot, you may have a bad led or cracked solder joint in the strip itself.
  • Voltage issues / weak battery, if the voltage drops too much, it can cause communication failures in the strip. Try measuring the voltage at the end of the strip.
  • Noise, cross-talk and noisy power to the teensy can also cause issues. Try putting a large capacitor between + and - and see if that helps.
  • It's possible that the strips don't like being back-to-back. Did you try it with the arduino after gluing them together?

So from the list above here's what I've tried so far along with the results...


I'll continue to work on the remaining steps you gave.

Thanks again for your assistance.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 29, 2017, 09:17:32 PM
So I now understand that you need to press both the "pow" and "aux" button to step through the presets.  Possibly allow "aux2" to do this might be nice (just my opinion).

I would prefer to use aux2 for things that you would need more immediate access to.
(Although, I'm not sure what that would be, so maybe "next preset" would be reasonable for now.)

Quote
  • It could be a timing issue, try WS2811_580kHz or WS2811_400kHz - RESULT: Neither of these works at all.  The blade lights full white with no animations when I use either of these profiles.
  • Timing issue #2, teensysaber actually uses 740kHz instead of 800kHz, it's possible the strip doesn't like that. (Try search and replace 740000 with 800000 in the code.) - RESULT: I made this change and it had no effect on my issue.  Everything still worked but still had the rainbow sparkling effect.
  • What kind of strip is it? Does it have a datasheet we can look at to determine the timing? Maybe what you need is WS2813_8000kHz? - RESULT: Unfortunately my LED strips were purchased from AliExpress and they don't seem to have a datasheet available.  I tried WS2813_800kHz and this yielded the same results.
  • Do you have a 30-100 ohm resistor between pin 20 on the teensy and data-in on the LED strip?  - ANSWER: Yes, I have a 100Ohm resistor installed in the blade between the pin on the connector and the data-in pins on the strips.
  • If the rainbow effect usually starts at a particular spot, you may have a bad led or cracked solder joint in the strip itself. - ANSWER: the rainbow effect happens over the entire blade in what appears to be a random pattern.
  • Voltage issues / weak battery, if the voltage drops too much, it can cause communication failures in the strip. Try measuring the voltage at the end of the strip. - No result yet.
  • Noise, cross-talk and noisy power to the teensy can also cause issues. Try putting a large capacitor between + and - and see if that helps. -
     QUESTION: Can you recommend a specific capacitor and specify exactly where I should place this between + and 1?
  • It's possible that the strips don't like being back-to-back. Did you try it with the arduino after gluing them together? - RESULT: I connected the blade to my Arduino Uno test rig and had now issues running various test patterns up and down the blade.  I am limited however as I'm using the 5V pin from the Uno to power the LED strips.  If I try to light both strips fully the Uno will brown-out and reset.  I can however run test patterns that light only a few LEDs at a time without issue (no rainbow effect).


I think we can probably rule out power drops actually, because power drops cause effects which are much more pronounced towards the
end of the blade. Timing, weak power and noise are still on the table though.

A few more things to add to the list:

1) Try setting the blade color in the preset to Rgb<0,0,30> or something. Does that significantly change the problem? (The idea would be that using less power might work better.)
2) Try disconnecting one of the strips. Does that significantly change the problem?
3) What battery are you using? Maybe try something with a little more omph?

As for the capacitor: Basically the bigger the capacitor the better. Just beware that the capacitor can trigger the battery cut-off
circuit if it's *too* big. And if it's an electrolytic capacitor, make sure to hook up + and - correctly.
Ferrite cores can also help eliminate noise.

It could be that 100 ohm is too much, maybe try 30 ohms instead? (Or maybe remove the resistor and hook it up directly.)
My experience is that it works better *with* the resistor, but I'm not sure what the problem is with your strips, so you
might need to try a few different things.

One more thing: What library are you using on the uno? I could see if I can figure out what timing parameter it uses and see
if they are different from the one I use.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on May 30, 2017, 10:54:46 AM

Quote
I think we can probably rule out power drops actually, because power drops cause effects which are much more pronounced towards the
end of the blade. Timing, weak power and noise are still on the table though.

A few more things to add to the list:

1) Try setting the blade color in the preset to Rgb<0,0,30> or something. Does that significantly change the problem? (The idea would be that using less power might work better.)
2) Try disconnecting one of the strips. Does that significantly change the problem?
3) What battery are you using? Maybe try something with a little more omph?

As for the capacitor: Basically the bigger the capacitor the better. Just beware that the capacitor can trigger the battery cut-off
circuit if it's *too* big. And if it's an electrolytic capacitor, make sure to hook up + and - correctly.
Ferrite cores can also help eliminate noise.

It could be that 100 ohm is too much, maybe try 30 ohms instead? (Or maybe remove the resistor and hook it up directly.)
My experience is that it works better *with* the resistor, but I'm not sure what the problem is with your strips, so you
might need to try a few different things.

One more thing: What library are you using on the uno? I could see if I can figure out what timing parameter it uses and see
if they are different from the one I use.

Thanks for the additional feedback and ideas.  I will try some of these tests later this evening. 

You mention the 100 Ohm resistor possibly being too big.  Would we be able to rule that out if my Arduino Uno testing is connected with the 100 Ohm resistor in line and I don't have any of these issues )It is a much lower power setup though)?

I found two sizes of Electrolytic Decoupling Capacitors on Sparkfun... one at 100uF/25V and one at 1000uF/25V.  The later is about 2 cm long and 1 cm in diameter which I probably could fit it (barely).  The 100uF one is about 1.3 cm long and .6 cm in diameter which I could fit fairly easily.  Do you think the 100uF is enough?

Also, the library I used for testing on the Uno is the Adafirut_NeoPixel library found at github.com/adafruit/Adafruit_NeoPixel.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 30, 2017, 11:05:12 AM
Thanks for the additional feedback and ideas.  I will try some of these tests later this evening. 

You mention the 100 Ohm resistor possibly being too big.  Would we be able to rule that out if my Arduino Uno testing is connected with the 100 Ohm resistor in line and I don't have any of these issues )It is a much lower power setup though)?

Arduino uno is a 5v part, so it will have a much easier time pushing signals through the resistor. The teensy only puts out 3.3 volts. One way to explore if this is the problem or not is to send the signal through a level shifter, like this one: ttps://www.adafruit.com/product/1787

If that works, there are smaller parts that might fit better inside a saber.
Quote

I found two sizes of Electrolytic Decoupling Capacitors on Sparkfun... one at 100uF/25V and one at 1000uF/25V.  The later is about 2 cm long and 1 cm in diameter which I probably could fit it (barely).  The 100uF one is about 1.3 cm long and .6 cm in diameter which I could fit fairly easily.  Do you think the 100uF is enough?


If you don't have capacitors already, don't worry about it. It's unlikely to actually work anyways. Mostly it's just a way to try things out. 100uF would definitely be big enough.

Quote
Also, the library I used for testing on the Uno is the Adafirut_NeoPixel library found at github.com/adafruit/Adafruit_NeoPixel.

I'll have a look at it later to see if there is anything else we can try.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 30, 2017, 11:22:58 AM

Quote
Also, the library I used for testing on the Uno is the Adafirut_NeoPixel library found at github.com/adafruit/Adafruit_NeoPixel.

I'll have a look at it later to see if there is anything else we can try.

I'm not good at "later"...
I took a look, and you might want to try changing WS2811_TIMING_T1H to 200 and see if that helps.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 30, 2017, 11:30:29 AM

Quote
Also, the library I used for testing on the Uno is the Adafirut_NeoPixel library found at github.com/adafruit/Adafruit_NeoPixel.

I'll have a look at it later to see if there is anything else we can try.

I'm not good at "later"...
I took a look, and you might want to try changing WS2811_TIMING_T1H to 200 and see if that helps.


Actually, no, that's not right...
The timing used by the adafruit library seems to be:

#define WS2811_TIMING_T0H 85
#define WS2811_TIMING_T1H 170

(At roughly 800kHz)

It's an easy thing to try, but I suspect it won't help.
(Although, increaing T0H will give the signal a little bit longer to rise to 3.3v, so maybe it will help?)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on May 30, 2017, 12:47:35 PM
Quote

Actually, no, that's not right...
The timing used by the adafruit library seems to be:

#define WS2811_TIMING_T0H 85
#define WS2811_TIMING_T1H 170

(At roughly 800kHz)

It's an easy thing to try, but I suspect it won't help.
(Although, increaing T0H will give the signal a little bit longer to rise to 3.3v, so maybe it will help?)

I will give this a try as soon as I get home this evening (I'm actually at work and shouldn't really be doing this right now.)  :wink:
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on May 30, 2017, 05:45:16 PM
Quote

Actually, no, that's not right...
The timing used by the adafruit library seems to be:

#define WS2811_TIMING_T0H 85
#define WS2811_TIMING_T1H 170

(At roughly 800kHz)

It's an easy thing to try, but I suspect it won't help.
(Although, increaing T0H will give the signal a little bit longer to rise to 3.3v, so maybe it will help?)

I will give this a try as soon as I get home this evening (I'm actually at work and shouldn't really be doing this right now.)  :wink:

So I gave this a try and it did not help.  What I did notice is that increasing the T0H timing did slightly slow down the rate of the sparkling effect.

Now for some good news.  while testing this on my bench I discovered that touching and/or handling the signal wire from pin 20 on the Teensy to the blade connector greatly increases the sparkling effect.  On top of that if I grab this wire in two places with both my hands the effect goes to extreme which is an almost solid white blade with just a slight flicker.  Obviously there is noise being introduced so now for the key questions...  What do you think will resolve this?

1) Adding a ferrite core?
2) or... Adding the capacitor across the power leads?
3) or... both?

Do you have any other ideas?  Is there such a thing as a shielded single strand wire?

Thanks again for your help.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 30, 2017, 08:22:05 PM

1) Adding a ferrite core?
2) or... Adding the capacitor across the power leads?
3) or... both?

Do you have any other ideas?  Is there such a thing as a shielded single strand wire?

Thanks again for your help.

That's a good clue. It means the problem is almost almost certainly electrical.
Not sure what would cause it to be that sensitive though.
Capacitors and ferrite cores might help, but I don't really think they should be needed.
I think the first thing to try is a smaller resistor on the data pin.
However, it should be noted that it's just as likely that the noise comes from the negative power.
Do you have a Blade ID resistor? If so, what value is it?  (should be a few Kohm or more.)

Perhaps you could post some pictures of your build, it's often quite helpful.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on May 30, 2017, 09:33:46 PM
Well... I think I'm done for a while.  While trying to re-do things with a smaller resistor on the pin 20 line I seem to have fried my LED strips.  All I get is a section at the end of one strip the lights solid all the time and nothing else.  I've worked now for quite some time redoing the solder connections, etc. and can't get the blade to work any more.  :angry: 

Would you have a source and a specific LED strip you would recommend?  Obviously the ones I bought from AliExpress for a cheap price were just that... cheap.

Once I can get some new strips I'll start over.  :sad:

To answer your question about the blade ID resistor it was 10K Ohms.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on May 30, 2017, 10:27:48 PM
Well... I think I'm done for a while.  While trying to re-do things with a smaller resistor on the pin 20 line I seem to have fried my LED strips.  All I get is a section at the end of one strip the lights solid all the time and nothing else.  I've worked now for quite some time redoing the solder connections, etc. and can't get the blade to work any more.  :angry: 

Would you have a source and a specific LED strip you would recommend?  Obviously the ones I bought from AliExpress for a cheap price were just that... cheap.

Once I can get some new strips I'll start over.  :sad:

To answer your question about the blade ID resistor it was 10K Ohms.

Aliexpress and ebay can be a little hit-and-miss. Ebay is a little better since you can look at feedback.
Try to look for vendors that actually specify what the chip is. I've used Sk6812 chips, WS2812B chips should be fine I think, and the new WS2813 chips look good too. (Ideally I'd like to find some WS2812A-based strips, as those have higher brightness, but I have not found any of those.)  Also, I recommend "slim" strips, since those are easier to diffuse.

Unfortunately a lot of people say WS2812B even though they are not, which is a little harder to fix. :(
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Sethski on June 03, 2017, 12:07:18 AM
Thanks for comprehensive answers to questions  :smiley:

(Re flicker)

How do you want it to work?
I don't have any other boards myself, so I don't know what is standard and how they work. :)
I imagine that popular choices would be sound-based flickering and random flickering?

I think your initial implementation sounds good. I like the idea of it being sound-based and having that sync between sound and light effects. I think its only the other open source solutions that currently implement this and not the Plecter and NEC boards, but I may be wrong in that.

I guess if used for clash and lockup and maybe blaster deflect, the main distinction between the blade flicker and clash/lockup/other effects is the colour change for the latter, but I guess this could be implemented with some sort of volume/amplitude threshold beyond which colour changing effects kick in as well as a more pronounced flicker/shimmer.

Ive owned Plecter boards and know that the flicker has two settings for flicker, which (I think) control the variability and depth of the effect. As I undertstand, there are different settings and effects for shimmer/lockup and clash and blaster deflect.

I guess it comes down to tweaking the final effect to look subjectively good to the eye as much as the basis of the approach.

 
Also, I've actually tried to stay away from using configuration menues on the saber itself, as I think that seems really difficult to implement *well*. Instead everything is currently done through the "presets" array. Holding aux while tapping power goes to the next preset, holding power and tapping the blade goes to the previous preset. The presets are managed in the source itself.

I agree having presets/fonts you can cycle through with the saber is important to me, perhaps along with basic functions like controlling or muting volume, but, beyond this, it seems easier and more straightforward to alter these from the keyboard.

I think the variation in clash lockup/tip drag depending on orientation of the saber you suggest may be more straightforward/user friendly to distinguish between activation of these effects and would cover most instances.

Deducing approximate location on the blade for localised effects from the motion detector would be great if possible I guess this is something that the builder might need to tailor to work with the variations in the physical materials and build of the saber.

If you're serious about contributing, you'll need to learn a *little* coding to do it.
There is no better way to learn how to code than to customize something you love though.

Absolutely, this is my intention. A good starting place for me in the past with making a website and digital modelling and animation has been to comb through and play with existing source material to tweak it to understand it and better meet my needs.

I have materials for a test blade, so will be putting that together while Teensysaber is en route. I also have a DIYino board and may treat myself to a Prizm v5 when available soon, all of which will find homes-in-hilts. The polyphonic swing sound mixing is the standout feature for Teensysaber that puts that at the front of the queue for my personal saber.  :wink:

I'll post further thoughts and questions on software in the thread you've created for that.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 06, 2017, 08:44:55 AM
That's a good clue. It means the problem is almost almost certainly electrical.
Not sure what would cause it to be that sensitive though.
Capacitors and ferrite cores might help, but I don't really think they should be needed.
I think the first thing to try is a smaller resistor on the data pin.
However, it should be noted that it's just as likely that the noise comes from the negative power.
Do you have a Blade ID resistor? If so, what value is it?  (should be a few Kohm or more.)

Perhaps you could post some pictures of your build, it's often quite helpful.

So I received my replacement LED strips and put the blade back together.  I dropped down to a 22 Ohm resistor (from the 100 Ohm one I originally used) and I still had the flicker issue.  I then removed the resistor altogether and still have the same issue.  Obviously the resistor is not contributing to this issue at all.  I'm going to check all my connections again tonight (I may resort to resoldering them).  I also obtain a handful of ferrite cores which I'll try on the battery power line into the Sparkfun power boost board and on the signal wire to the DIN on the LEDs.  I'll let you know what happens.

Also, in case I didn't answer this previously the blade ID resistor is 10K.

Thanks again for all your support.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on June 06, 2017, 10:28:30 AM
What is the make up of your blade.

I know it is 40" with 97 PL9823 LED's. Is it transwhite with just the packing foam wrapped around the LED's? Is it clear with an inner diffuse film with the packing foam? I am just curious and I am experimenting with different diffusion ideas.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 06, 2017, 10:50:15 AM
What is the make up of your blade.

I know it is 40" with 97 PL9823 LED's. Is it transwhite with just the packing foam wrapped around the LED's? Is it clear with an inner diffuse film with the packing foam? I am just curious and I am experimenting with different diffusion ideas.

Regards,

GMcIvor

97 PL9823 wrapped in packing foam stuffed inside a TCSS diffuser shoved into a trans-white 7/8" blade.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 06, 2017, 10:52:44 AM
That's a good clue. It means the problem is almost almost certainly electrical.
Not sure what would cause it to be that sensitive though.
Capacitors and ferrite cores might help, but I don't really think they should be needed.
I think the first thing to try is a smaller resistor on the data pin.
However, it should be noted that it's just as likely that the noise comes from the negative power.
Do you have a Blade ID resistor? If so, what value is it?  (should be a few Kohm or more.)

Perhaps you could post some pictures of your build, it's often quite helpful.

So I received my replacement LED strips and put the blade back together.  I dropped down to a 22 Ohm resistor (from the 100 Ohm one I originally used) and I still had the flicker issue.  I then removed the resistor altogether and still have the same issue.  Obviously the resistor is not contributing to this issue at all.  I'm going to check all my connections again tonight (I may resort to resoldering them).  I also obtain a handful of ferrite cores which I'll try on the battery power line into the Sparkfun power boost board and on the signal wire to the DIN on the LEDs.  I'll let you know what happens.

Also, in case I didn't answer this previously the blade ID resistor is 10K.

Thanks again for all your support.

I really doubt it's the connections.
Did you get the same type of strips as last time?
(If so, can you point me to where you got them?)
Also, have you tried a different (high-amp) battery?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 06, 2017, 08:59:01 PM
I really doubt it's the connections.
Did you get the same type of strips as last time?
(If so, can you point me to where you got them?)
Also, have you tried a different (high-amp) battery?

Yes, I got the same ones.  I also ordered another set (from an ebay seller) and will be assembling another blade as soon as they arrive.  The ones I'm using now are from an AliExpress seller. 

Here's the link...
ttps://www.aliexpress.com/item/addressable-1m-144LEDs-m-DC5V-SK6812MINI-3535-led-pixel-strip-NON-waterproof-with-144pixels-M-WHITE/32451691714.html?spm=2114.13010608.0.0.9rKCy6

This page has a link to the LED chip source which contains a link to the following specifications for the SK6812 MINI-3535 LED chips used...
ttps://www.aliexpress.com/store/product/SK6812MINI-3535-SK6812-adressable-full-color-RGB-3535-LED-light-source-with-built-in-chip-1000pcs/701799_32434844290.html?spm=2114.10010108.1000023.1.iquqCr


Also, to answer your question about batteries I'm using the SAMSUNG INR18650-25R 20A/100A pulse batteries you recommended on your website in the V1 electronics section.  It doesn't seem to matter if the battery is fully charged or not... the issue still occurs.

I am also using the Sparkfun LIPower 5V Boost Converter you recommended as well and I've removed the small under-voltage circuit capacitor per your instructions.  The only thing I've done differently is 1) I'm not using the SD adapter and have instead connected the MISO, MOSI and SCK pins from the Teensy 3.2 to the Prop Shield in order to enable access to the internal SerialFlash on the Prop Shield and 2) I added a Switchcraft 2.1mm barrel connector inline to battery negative (-) which allows me to use a "Kill Plug" on my saber (both parts purchased from The Custom Saber Shop).  My wiring looks virtually identical to the photo on your website of the V1 electronics.

I am willing to start replacing components if that's what it would take to correct this.  I just don't know where to start.

Right now the saber is fully functional with the soundfont on the Serial Flash and minor customization I've done to v1.110.  I've downloaded v1.119 tailored it to match my 1.110 implementation but I'm actually having a problem with it.  I changed VERSION_MAJOR to 1 and VERSION_MINOR to 0, commented out the "#define POWER_TOUCHBUTTON" (I'm not using a touch button) and tailored by blade array and presets.  It compiles cleanly but when it activated on the Teensy it gets up to a message "I2C pullups found, initializing..." and then seems to stop functioning.  It does accept serial command input and will return the output from the "help" command but it does not light the blade nor does it play any soundfont files.  Any ideas?

Thanks again for your support.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 06, 2017, 09:32:16 PM
New TeensySaber V2 sales thread is live:
TeensySaber V2 for sale (https://www.fx-sabers.com/forum/index.php?topic=51903.0)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 06, 2017, 09:50:51 PM
I really doubt it's the connections.
Did you get the same type of strips as last time?
(If so, can you point me to where you got them?)
Also, have you tried a different (high-amp) battery?

Yes, I got the same ones.  I also ordered another set (from an ebay seller) and will be assembling another blade as soon as they arrive.  The ones I'm using now are from an AliExpress seller. 

Here's the link...
ttps://www.aliexpress.com/item/addressable-1m-144LEDs-m-DC5V-SK6812MINI-3535-led-pixel-strip-NON-waterproof-with-144pixels-M-WHITE/32451691714.html?spm=2114.13010608.0.0.9rKCy6

This page has a link to the LED chip source which contains a link to the following specifications for the SK6812 MINI-3535 LED chips used...
ttps://www.aliexpress.com/store/product/SK6812MINI-3535-SK6812-adressable-full-color-RGB-3535-LED-light-source-with-built-in-chip-1000pcs/701799_32434844290.html?spm=2114.10010108.1000023.1.iquqCr


These look like they should be the same as my strip blade.
I re-tested my strip blade to make sure I hadn't screwed up the code recently, but it seems to work.

Quote
Also, to answer your question about batteries I'm using the SAMSUNG INR18650-25R 20A/100A pulse batteries you recommended on your website in the V1 electronics section.  It doesn't seem to matter if the battery is fully charged or not... the issue still occurs.

Recommended might be a strong word. That's the same battery I use, so it shouldn't be an issue.
Just be careful with those batteries, ok?

Quote
I am also using the Sparkfun LIPower 5V Boost Converter you recommended as well and I've removed the small under-voltage circuit capacitor per your instructions.  The only thing I've done differently is 1) I'm not using the SD adapter and have instead connected the MISO, MOSI and SCK pins from the Teensy 3.2 to the Prop Shield in order to enable access to the internal SerialFlash on the Prop Shield and 2) I added a Switchcraft 2.1mm barrel connector inline to battery negative (-) which allows me to use a "Kill Plug" on my saber (both parts purchased from The Custom Saber Shop).  My wiring looks virtually identical to the photo on your website of the V1 electronics.

None of these things should cause any problems.

Quote
I am willing to start replacing components if that's what it would take to correct this.  I just don't know where to start.

Everything sounds great though.
I'll be curious to see if a different LED strip works differently.

Quote
Right now the saber is fully functional with the soundfont on the Serial Flash and minor customization I've done to v1.110.  I've downloaded v1.119 tailored it to match my 1.110 implementation but I'm actually having a problem with it.  I changed VERSION_MAJOR to 1 and VERSION_MINOR to 0, commented out the "#define POWER_TOUCHBUTTON" (I'm not using a touch button) and tailored by blade array and presets.  It compiles cleanly but when it activated on the Teensy it gets up to a message "I2C pullups found, initializing..." and then seems to stop functioning.  It does accept serial command input and will return the output from the "help" command but it does not light the blade nor does it play any soundfont files.  Any ideas?

Hmm, did you comment out ENABLE_SD ?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 07, 2017, 01:46:50 AM
I am willing to start replacing components if that's what it would take to correct this.  I just don't know where to start.

Everything sounds great though.
I'll be curious to see if a different LED strip works differently.

Ok, so I think I have some good-news and bad news.

The good news is that I found data sheet for SK6812: https://cdn-shop.adafruit.com/product-files/1138/SK6812+LED+datasheet+.pdf (https://cdn-shop.adafruit.com/product-files/1138/SK6812+LED+datasheet+.pdf)

The bad news is that it says that it need the input signal to be 3.4 volts for it to register as "high", and the teensy only puts out 3.3 volts. (So why does mine work? No idea, maybe it's an older model?)

That basically leaves two choices:

1. Use a different strip (the WS2813A/B datasheet looks compatible with 3.3v logic.)
2. Bring the voltage of the data signal up, using a transistor or logic gate that can run at 5 volts. The teensysaber has a 5v pin you can take the voltage from, so it's just a matter of finding the right transistor.


Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 07, 2017, 07:24:09 AM
That basically leaves two choices:

1. Use a different strip (the WS2813A/B datasheet looks compatible with 3.3v logic.)
2. Bring the voltage of the data signal up, using a transistor or logic gate that can run at 5 volts. The teensysaber has a 5v pin you can take the voltage from, so it's just a matter of finding the right transistor.

So... I'm willing to build the transistor based circuit but unfortunately I'm not experienced enough to know how to proceed.  If you pointed me in the right direction I'll buy the necessary parts and build it.  I wouldn't know where to begin in finding the right transistor though.  Your help would be greatly appreciated plus the design change would hopefully improve the Teensy Saber project to now fully support the SK6812 based strips (which seem to be widely available compared to the WS2813A/B strips).
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 07, 2017, 09:44:48 AM
That basically leaves two choices:

1. Use a different strip (the WS2813A/B datasheet looks compatible with 3.3v logic.)
2. Bring the voltage of the data signal up, using a transistor or logic gate that can run at 5 volts. The teensysaber has a 5v pin you can take the voltage from, so it's just a matter of finding the right transistor.

So... I'm willing to build the transistor based circuit but unfortunately I'm not experienced enough to know how to proceed.  If you pointed me in the right direction I'll buy the necessary parts and build it.  I wouldn't know where to begin in finding the right transistor though.  Your help would be greatly appreciated plus the design change would hopefully improve the Teensy Saber project to now fully support the SK6812 based strips (which seem to be widely available compared to the WS2813A/B strips).

I found the following which looks like it addresses the exact issue I'm having with my SK6812 (WS2812 compatible) LED strips...

ttp://hackaday.com/2017/01/20/cheating-at-5v-ws2812-control-to-use-a-3-3v-data-line/

The only thing I would need your help with is identifying the appropriate signal diode to use.  It's been years since I've messed with electronics at this level and at my age I can't remember half of what I learned 25+ years ago.  :embarrassed:
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 07, 2017, 10:51:16 AM

So... I'm willing to build the transistor based circuit but unfortunately I'm not experienced enough to know how to proceed.  If you pointed me in the right direction I'll buy the necessary parts and build it.  I wouldn't know where to begin in finding the right transistor though.  Your help would be greatly appreciated plus the design change would hopefully improve the Teensy Saber project to now fully support the SK6812 based strips (which seem to be widely available compared to the WS2813A/B strips).

I found the following which looks like it addresses the exact issue I'm having with my SK6812 (WS2812 compatible) LED strips...

ttp://hackaday.com/2017/01/20/cheating-at-5v-ws2812-control-to-use-a-3-3v-data-line/

The only thing I would need your help with is identifying the appropriate signal diode to use.  It's been years since I've messed with electronics at this level and at my age I can't remember half of what I learned 25+ years ago.  :embarrassed:

This hack seems drops the input voltage of the first LED to 4.3 volt. However, assuming that you drive your strip directly from the battery, your strip will already be at 4.2 volts (or lower).  (You're not feeding the LED strips 5V, right?)

Unfortunately, the SK6812 datasheet doesn't actually specify what happens if you feed it less than 5V. So it's not clear if that is actually the problem or not. :(

The first thing to do is probably to buy one of these:
74AHCT125 - Quad Level-Shifter (3V to 5V) [74AHCT125] ID: 1787 - .50 : (https://www.adafruit.com/product/1787)

and then try it out on a breadboard to make sure that level shifting actually fixes your problem.

Assuming that level shifting fixes the problem, there are a number of possible solutions to try:

1. If you have room for it, the level shifter above is a quick and easy solution.
2. It may be possble to do level shifting with a simple resistor and some code hackery. The idea is to hook the data out pin up to a resistor which is hooked up to 5V, then hack the code so that instead of using 3.3 volt for HIGH output, it just switches the pin to input mode instead. That puts the pin in high impedance mode and the pull-up resistor would win. Since the teensy is 5v-tolerant, it should just work.
3. It should be possible to use a PEX to drive the data pin. There are two issues: 1, it will invert the signal (Which is easy to fix in the code) and 2. I'm not entirely sure that the PEX will switch fast enough to not mess up the signal.
4. If the level shifter from (1) is too big, probably the best thing to do is to buy a SOT-23 breakout board (https://www.digikey.com/product-detail/en/sparkfun-electronics/BOB-00717/1568-1098-ND/5318740), and then put a SN74LV1T125 (https://www.digikey.com/product-detail/en/texas-instruments/SN74LV1T125DBVR/296-37172-2-ND/4555571) on it. Hopefully this will be small enough to fit. (This might be something that I could incorporate into the V2 design in the future, if this turns out to be a common problem.)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 07, 2017, 01:14:20 PM

This hack seems drops the input voltage of the first LED to 4.3 volt. However, assuming that you drive your strip directly from the battery, your strip will already be at 4.2 volts (or lower).  (You're not feeding the LED strips 5V, right?)

Unfortunately, the SK6812 datasheet doesn't actually specify what happens if you feed it less than 5V. So it's not clear if that is actually the problem or not. :(

The first thing to do is probably to buy one of these:
74AHCT125 - Quad Level-Shifter (3V to 5V) [74AHCT125] ID: 1787 - .50 : (https://www.adafruit.com/product/1787)

and then try it out on a breadboard to make sure that level shifting actually fixes your problem.

Assuming that level shifting fixes the problem, there are a number of possible solutions to try:

1. If you have room for it, the level shifter above is a quick and easy solution.
2. It may be possble to do level shifting with a simple resistor and some code hackery. The idea is to hook the data out pin up to a resistor which is hooked up to 5V, then hack the code so that instead of using 3.3 volt for HIGH output, it just switches the pin to input mode instead. That puts the pin in high impedance mode and the pull-up resistor would win. Since the teensy is 5v-tolerant, it should just work.
3. It should be possible to use a PEX to drive the data pin. There are two issues: 1, it will invert the signal (Which is easy to fix in the code) and 2. I'm not entirely sure that the PEX will switch fast enough to not mess up the signal.
4. If the level shifter from (1) is too big, probably the best thing to do is to buy a SOT-23 breakout board (https://www.digikey.com/product-detail/en/sparkfun-electronics/BOB-00717/1568-1098-ND/5318740), and then put a SN74LV1T125 (https://www.digikey.com/product-detail/en/texas-instruments/SN74LV1T125DBVR/296-37172-2-ND/4555571) on it. Hopefully this will be small enough to fit. (This might be something that I could incorporate into the V2 design in the future, if this turns out to be a common problem.)

You are correct... I am running the strip off the LiPo battery directly (4.3V or less) as your circuit shows.

Thanks for all the research and information.  I will order the level shifter so I can try this.  I will need a little assistance in how I should wire this into the V1 hilt electronics.  If you could provide this I'll be able to wire it up and try it.  I took a look at the datasheet but I'm not totally familiar with everything I'm reading there.  It does look like this chip could possibly fit inside my hilt close to the blade aviation connector.  If I keep it tight to the connector it should clear everything else.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 07, 2017, 01:51:56 PM
Basically, just hook up:

1 -> GND  (gnd from the booster)
7 -> GND  (gnd from the booster)
14 -> Vin (5v from the booster)
2 -> teensy pin 20
3 -> neopixel data

There are already level shifters on the prop shield, but they way they are hooked up makes it a tricky to use them for neopixels. (Basically share pins with the serial flash chip.)

Note that this kind of hookup makes it impossible to use blade id.
(It may be possible to still use blade id by hooking up nepixel data to another pin, also hook up pin 1 (Output Enable) to yet another pin though, which is what I would do if I include something like this on a V2 board.)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 07, 2017, 02:55:23 PM
Basically, just hook up:

1 -> GND  (gnd from the booster)
7 -> GND  (gnd from the booster)
14 -> Vin (5v from the booster)
2 -> teensy pin 20
3 -> neopixel data

There are already level shifters on the prop shield, but they way they are hooked up makes it a tricky to use them for neopixels. (Basically share pins with the serial flash chip.)

Note that this kind of hookup makes it impossible to use blade id.
(It may be possible to still use blade id by hooking up nepixel data to another pin, also hook up pin 1 (Output Enable) to yet another pin though, which is what I would do if I include something like this on a V2 board.)

Thanks.  This is exactly what I was looking at but I was not certain if you were looking to level shift any of the other pins involved.  I ordered this part and will hopefully have it in a few days.  I'll let you know the results of my test with this.

btw... for me blade id is not that important as I only have one blade at this point.  I actually built the charging adapter blade but haven't been using it since I built my hilt with access to the batteries at the pommel end.

Thanks again for your support.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 07, 2017, 05:36:02 PM

Right now the saber is fully functional with the soundfont on the Serial Flash and minor customization I've done to v1.110.  I've downloaded v1.119 tailored it to match my 1.110 implementation but I'm actually having a problem with it.  I changed VERSION_MAJOR to 1 and VERSION_MINOR to 0, commented out the "#define POWER_TOUCHBUTTON" (I'm not using a touch button) and tailored by blade array and presets.  It compiles cleanly but when it activated on the Teensy it gets up to a message "I2C pullups found, initializing..." and then seems to stop functioning.  It does accept serial command input and will return the output from the "help" command but it does not light the blade nor does it play any soundfont files.  Any ideas?

Hmm, did you comment out ENABLE_SD ?

I commented out the ENABLE_SD and v1.119 is now working on my Teensy Saber setup.  Thanks for your help.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 07, 2017, 06:11:03 PM
On a new topic... When the "blast" effect is triggered (by pressing "aux" when the blade has been ignited using "pow" or by pressing "pow" when the blade has been ignited using "aux") is there a way to get the blade to flash (like it does on clash)?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 07, 2017, 07:34:52 PM
On a new topic... When the "blast" effect is triggered (by pressing "aux" when the blade has been ignited using "pow" or by pressing "pow" when the blade has been ignited using "aux") is there a way to get the blade to flash (like it does on clash)?

Totally.
Although, I wonder if we would want some other effect for blasts?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on June 07, 2017, 08:02:09 PM
On a new topic... When the "blast" effect is triggered (by pressing "aux" when the blade has been ignited using "pow" or by pressing "pow" when the blade has been ignited using "aux") is there a way to get the blade to flash (like it does on clash)?

Totally.
Although, I wonder if we would want some other effect for blasts?

What about everytime the blaster effect is triggered there is a ripple down and up the blade from a central point. And that central point is random everytime like it would be is a blaster hit the saber.

Just a possible idea?

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 07, 2017, 08:04:45 PM
On a new topic... When the "blast" effect is triggered (by pressing "aux" when the blade has been ignited using "pow" or by pressing "pow" when the blade has been ignited using "aux") is there a way to get the blade to flash (like it does on clash)?

Totally.
Although, I wonder if we would want some other effect for blasts?

What about everytime the blaster effect is triggered there is a ripple down and up the blade from a central point. And that central point is random everytime like it would be is a blaster hit the saber.

Just a possible idea?

Regards,

GMcIvor

Sounds more interesting, but I will probably implement both. :)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 07, 2017, 08:07:31 PM
What about everytime the blaster effect is triggered there is a ripple down and up the blade from a central point. And that central point is random everytime like it would be is a blaster hit the saber.

Just a possible idea?

Regards,

GMcIvor

I like this or something close to it.  Maybe an effect similar to the battery level display (possible a little larger) on the blade but in the clash color and flickering quickly like the clash.  This would look like where the blaster shot impacted the blade.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 07, 2017, 08:56:23 PM
Basically, just hook up:

1 -> GND  (gnd from the booster)
7 -> GND  (gnd from the booster)
14 -> Vin (5v from the booster)
2 -> teensy pin 20
3 -> neopixel data

There are already level shifters on the prop shield, but they way they are hooked up makes it a tricky to use them for neopixels. (Basically share pins with the serial flash chip.)

Note that this kind of hookup makes it impossible to use blade id.
(It may be possible to still use blade id by hooking up nepixel data to another pin, also hook up pin 1 (Output Enable) to yet another pin though, which is what I would do if I include something like this on a V2 board.)

Thanks.  This is exactly what I was looking at but I was not certain if you were looking to level shift any of the other pins involved.  I ordered this part and will hopefully have it in a few days.  I'll let you know the results of my test with this.

btw... for me blade id is not that important as I only have one blade at this point.  I actually built the charging adapter blade but haven't been using it since I built my hilt with access to the batteries at the pommel end.

Thanks again for your support.

Well... you're not going to believe this.  I found a link in the OctoWS2811 library in your v1.119 sourcecode that takes you to a PJRC.com forum article that discusses various issues with flickering and makes mention of making the issue somewhat better by changing the WS2811_TIMING values.  I know we tried setting these values to match those in the Adafruit_NeoPixel library earlier which didn't help but what I decided to do is basically some trial-and-error tests with various values.  What I found was that there was a very tight range for WS2811_TIMING_T0H that almost completely eliminated the issue.  I then played a little with the WS2811_TIMING_T1H value but this caused the blade to not work if I changed the value very far from the original value of 176.  In any case here's what I ended up with...

#define WS2811_TIMING_T0H  46
#define WS2811_TIMING_T1H  180

These values all but eliminate the rainbow flicker effect I was getting across the blade.  Just to give you an idea of how precise the T0H value had to be a value of 44 or 48 brings the problem back.  I'm not sure why this works but I'm happy it does.  I'd love to hear your thoughts on this.

Thanks again for all your time an effort spent helping me with this issue.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 07, 2017, 09:49:23 PM
Well... you're not going to believe this.  I found a link in the OctoWS2811 library in your v1.119 sourcecode that takes you to a PJRC.com forum article that discusses various issues with flickering and makes mention of making the issue somewhat better by changing the WS2811_TIMING values.  I know we tried setting these values to match those in the Adafruit_NeoPixel library earlier which didn't help but what I decided to do is basically some trial-and-error tests with various values.  What I found was that there was a very tight range for WS2811_TIMING_T0H that almost completely eliminated the issue.  I then played a little with the WS2811_TIMING_T1H value but this caused the blade to not work if I changed the value very far from the original value of 176.  In any case here's what I ended up with...

#define WS2811_TIMING_T0H  46
#define WS2811_TIMING_T1H  180

These values all but eliminate the rainbow flicker effect I was getting across the blade.  Just to give you an idea of how precise the T0H value had to be a value of 44 or 48 brings the problem back.  I'm not sure why this works but I'm happy it does.  I'd love to hear your thoughts on this.

Thanks again for all your time an effort spent helping me with this issue.

I spoke too soon.  As soon as I stuff all the electronics inside my hilt the problem returned.  I guess I'll wait for the level shifter chip to arrive and hopefully that resolves this issue.  I'll let you know as soon as I have an update.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on June 09, 2017, 08:26:55 AM
Alright, I thought I was done rebuilding the V1 electronics but that didnt happen. Yesterday I plugged in my blade, it stayed on there was no boot sound, the LED's didn't turn off. So, I tried again nothing. So, I took it apart and measured the voltage on the powerboost and sure enough it was 1.42 so it wasn't working. Yet again I have to replace the powerboost (4th one). I thought this would be the fix (it usually was) but no it still did not boot on. So I measured the voltage out of the powerboost and it was 5 volts. So in theory it should be working. So I test the 5v and the GND on the power in on the prop shield and the voltage is 1.42. So how can voltage drop 3 volts over a length of tiny wire? The bigger question is does this mean my prop shield is fried? If so, I thik I am done with the V1 electronics and will retire this saber to display only and only build V2 from now on. which is probably for the best  :).

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 09, 2017, 09:15:54 AM
Alright, I thought I was done rebuilding the V1 electronics but that didnt happen. Yesterday I plugged in my blade, it stayed on there was no boot sound, the LED's didn't turn off. So, I tried again nothing. So, I took it apart and measured the voltage on the powerboost and sure enough it was 1.42 so it wasn't working. Yet again I have to replace the powerboost (4th one). I thought this would be the fix (it usually was) but no it still did not boot on. So I measured the voltage out of the powerboost and it was 5 volts. So in theory it should be working. So I test the 5v and the GND on the power in on the prop shield and the voltage is 1.42. So how can voltage drop 3 volts over a length of tiny wire? The bigger question is does this mean my prop shield is fried? If so, I thik I am done with the V1 electronics and will retire this saber to display only and only build V2 from now on. which is probably for the best  :).

Regards,

GMcIvor


First of all, are you sure you don't just need to charge the battery?
The booster won't turn on when the battery is low.

Second, if you were dropping 3 volts over ~4 inch of cable, you would know it.
(Because it would radiate 250+ watts of heat.)

So possibilities: (assuming charging the battery doesn't help)
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on June 09, 2017, 09:20:12 AM
Alright, I thought I was done rebuilding the V1 electronics but that didnt happen. Yesterday I plugged in my blade, it stayed on there was no boot sound, the LED's didn't turn off. So, I tried again nothing. So, I took it apart and measured the voltage on the powerboost and sure enough it was 1.42 so it wasn't working. Yet again I have to replace the powerboost (4th one). I thought this would be the fix (it usually was) but no it still did not boot on. So I measured the voltage out of the powerboost and it was 5 volts. So in theory it should be working. So I test the 5v and the GND on the power in on the prop shield and the voltage is 1.42. So how can voltage drop 3 volts over a length of tiny wire? The bigger question is does this mean my prop shield is fried? If so, I thik I am done with the V1 electronics and will retire this saber to display only and only build V2 from now on. which is probably for the best  :).

Regards,

GMcIvor


First of all, are you sure you don't just need to charge the battery?
The booster won't turn on when the battery is low.

Second, if you were dropping 3 volts over ~4 inch of cable, you would know it.
(Because it would radiate 250+ watts of heat.)

So possibilities: (assuming charging the battery doesn't help)
  • The wire is broken
  • The two GND spots you used to measure against are not at the same potential. (maybe because the GND wire is broken)
  • Something changed between the two measurements. (Like, maybe the booster was on in one case and off in the other)

Will I still be able to use the charger and charge blade to charge the battery even though the teensy doesn't power up?

After I charge the battery I will check for those broken connections (if they are there).

Thanks for the input. I hope this helps :)

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 09, 2017, 10:14:58 AM
Will I still be able to use the charger and charge blade to charge the battery even though the teensy doesn't power up?

Yes. The teensy only provides some sound and lights, it is not involved with the actual charging.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on June 09, 2017, 11:06:18 AM
Well I charged the battery(mostly). I measured the voltage off the battery and it was 3.92. I measured the output on the power boost it was 5.29V. I remeasured the 5V and GND on the prop shield and it was 1.49V. So it is not the battery so I guess the GND wire from the power boost to the prop shield is broken or frayed. I will check the connection to the prop shield it is under hot glue...

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on June 09, 2017, 02:04:05 PM
It was the ground connection. Some how it broke.. At least I know another possible problem if it ever stops working again.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 09, 2017, 06:47:02 PM
I spoke too soon.  As soon as I stuff all the electronics inside my hilt the problem returned.  I guess I'll wait for the level shifter chip to arrive and hopefully that resolves this issue.  I'll let you know as soon as I have an update.

Well I'm frustrated now...

The level shifter chips (I bought 2 just in case) came in today so I went to work connecting one up.  Here's what I connected where (as you recommended)...

1 -> GND  (gnd from the booster)
7 -> GND  (gnd from the booster)
14 -> Vin (5v from the booster)
2 -> teensy pin 20
3 -> neopixel data

I tried it through a breadboard first using jumpers I soldered to my saber wiring.  I cut both the +5V and GND leads leading from the LiPower Booster to the Prop Shield 5V and GND connections and spliced the jumper wires into each.  The GND jumper was then connected to pins 1 & 7 on the level shifter chip.  The 5V line was connected to pin 14 on the Level Shifter.  I was very careful to verify the orientation of the chip based on the notch and verified the pins based on the data sheet I downloaded from Adafruit.  I then cut into the lead that goes from pin 20 of the Teensy to the blade LED DataIn and connected the side from pin 20 on the Teensy to pin 2 on the level shifter chip and the side that goes to the LED DataIn to pin 3 on the level shifter.  At this point I gave it a try and the blade didn't light at all.  The Teensy powered up and played my boot sound.  When I attempted to light the blade it would play one of my poweron sounds and then the hum sound.  I checked VDC using my multimeter between pin 1 & 2 on the level shifter and saw 3.3V.  I check between pins 1 & 3 and saw 5V so the level shifter appears to be working.  I then powered off and connected the 2nd level shifter chip just to be sure I didn't have a bad one (which also gave the same result).  After this I decided to check that everything was still working the original way so I disconnecting the 5V and GND connections and resoldered the Teensy pin 20 data line back to the blade LED DataIn pin.  Everything worked again but I was back to the original flickering issue (as you would expect).

At this point I thought maybe the connections on the breadboard were not solid enough for this application so I took the time to solder one of the level shifter chips to the wires I had spliced again being very very careful to verify everything before applying power.  Again the Teensy powered on, played the appropriate sounds but the blade did not light at all.  Just to be sure at this point I powered down and connected the blade to my Arduino Uno LED test setup and the blade LED test pattern worked flawlessly.

Frustrated I decided to put everything back the way it was.  I disconnected the spliced in wires and reconnected the Teensy pin 20 line to the blade connector.  Unfortunately now I get the same symptom.  The Teensy boots and plays the appropriate sounds but the blade does not light.  I have spent quite some time now verifying connections and can't get it working again.

Another symptom I am also seeing now is that when I have the Teensy connected to my computer via USB I can't seem to get commands to work through the Serial Monitor.  It displays the boot up output, button actions and periodic battery voltage but does not respond to any commands.  I have the "Newline" option on and have retried this several times and even rebooted my computer.

Any idea what could be wrong?  Could I have damaged the Teensy or Prop Shield somehow?  Obviously the power connections from the battery to the LiPower Booster are good because I am getting power to the Teensy.  The Prop Shield is producing audio.  The button pins for "pow" and "aux" are both working.  The USB "emulated serial" (it's been running in "emulated serial" mode at 115200 baud ever since I used the teensytransfer tool to load my sound font to the Serial Flash on the Prop Shield) is working because the Serial Monitor is displaying the output from the Teensy.

I'm lost and frustrated.  Help!
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 09, 2017, 10:57:53 PM
I spoke too soon.  As soon as I stuff all the electronics inside my hilt the problem returned.  I guess I'll wait for the level shifter chip to arrive and hopefully that resolves this issue.  I'll let you know as soon as I have an update.

Well I'm frustrated now...

The level shifter chips (I bought 2 just in case) came in today so I went to work connecting one up.  Here's what I connected where (as you recommended)...

1 -> GND  (gnd from the booster)
7 -> GND  (gnd from the booster)
14 -> Vin (5v from the booster)
2 -> teensy pin 20
3 -> neopixel data

I tried it through a breadboard first using jumpers I soldered to my saber wiring.  I cut both the +5V and GND leads leading from the LiPower Booster to the Prop Shield 5V and GND connections and spliced the jumper wires into each.  The GND jumper was then connected to pins 1 & 7 on the level shifter chip.  The 5V line was connected to pin 14 on the Level Shifter.  I was very careful to verify the orientation of the chip based on the notch and verified the pins based on the data sheet I downloaded from Adafruit.  I then cut into the lead that goes from pin 20 of the Teensy to the blade LED DataIn and connected the side from pin 20 on the Teensy to pin 2 on the level shifter chip and the side that goes to the LED DataIn to pin 3 on the level shifter.  At this point I gave it a try and the blade didn't light at all.  The Teensy powered up and played my boot sound.  When I attempted to light the blade it would play one of my poweron sounds and then the hum sound.  I checked VDC using my multimeter between pin 1 & 2 on the level shifter and saw 3.3V.  I check between pins 1 & 3 and saw 5V so the level shifter appears to be working.  I then powered off and connected the 2nd level shifter chip just to be sure I didn't have a bad one (which also gave the same result).  After this I decided to check that everything was still working the original way so I disconnecting the 5V and GND connections and resoldered the Teensy pin 20 data line back to the blade LED DataIn pin.  Everything worked again but I was back to the original flickering issue (as you would expect).

At this point I thought maybe the connections on the breadboard were not solid enough for this application so I took the time to solder one of the level shifter chips to the wires I had spliced again being very very careful to verify everything before applying power.  Again the Teensy powered on, played the appropriate sounds but the blade did not light at all.  Just to be sure at this point I powered down and connected the blade to my Arduino Uno LED test setup and the blade LED test pattern worked flawlessly.

Frustrated I decided to put everything back the way it was.  I disconnected the spliced in wires and reconnected the Teensy pin 20 line to the blade connector.  Unfortunately now I get the same symptom.  The Teensy boots and plays the appropriate sounds but the blade does not light.  I have spent quite some time now verifying connections and can't get it working again.

Another symptom I am also seeing now is that when I have the Teensy connected to my computer via USB I can't seem to get commands to work through the Serial Monitor.  It displays the boot up output, button actions and periodic battery voltage but does not respond to any commands.  I have the "Newline" option on and have retried this several times and even rebooted my computer.

Any idea what could be wrong?  Could I have damaged the Teensy or Prop Shield somehow?  Obviously the power connections from the battery to the LiPower Booster are good because I am getting power to the Teensy.  The Prop Shield is producing audio.  The button pins for "pow" and "aux" are both working.  The USB "emulated serial" (it's been running in "emulated serial" mode at 115200 baud ever since I used the teensytransfer tool to load my sound font to the Serial Flash on the Prop Shield) is working because the Serial Monitor is displaying the output from the Teensy.

I'm lost and frustrated.  Help!

Wow, I really wish I could just magically fix it for you, and I can feel your frustration from here!
From what I can tell, it seems like you're doing everything right, although pictures is always helpful to verify these things.

First of all: I don't think you've damaged anything. The way USB works, it's not possible to receive data without also being able to transmit data, so if it works one way but not the other, that almost have to be a software issue of some sort. Did you try switching "newline" to something else and then back?

Next step: Try hooking up the the arduino uno again and make sure the strip works. Then have it go through the level shifter to make sure you have that part figured out.

Oh, and before I forget: you did cut the vusb-vin bridge on the teensy, right?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 10, 2017, 11:08:20 AM
Wow, I really wish I could just magically fix it for you, and I can feel your frustration from here!
From what I can tell, it seems like you're doing everything right, although pictures is always helpful to verify these things.

First of all: I don't think you've damaged anything. The way USB works, it's not possible to receive data without also being able to transmit data, so if it works one way but not the other, that almost have to be a software issue of some sort. Did you try switching "newline" to something else and then back?

Next step: Try hooking up the the arduino uno again and make sure the strip works. Then have it go through the level shifter to make sure you have that part figured out.

Oh, and before I forget: you did cut the vusb-vin bridge on the teensy, right?

Sorry I vented my frustrations a little in my last post.  I've spent quite a bit of time debugging this since then.  All I'm trying to do now is return the saber to it's previous condition... working but having the LED flicker issue.  I've replaced and re-soldered all the wires I messed with when trying the level shifter. This include the +5V and GND wires from the LiPower Booster to the Prop Shield +5V and GND.  It also included the signal wire from Teensy pin 20 to the blade connector pin 3 (which connects to the LED strip DataIn).  At this point the saber turns on, plays all the sounds and responds to all the button presses but does not light the LED blade at all.  Also, the Serial Monitor is now working but I can't explain why I couldn't get it to work yesterday.  Here's what is displayed when I boot the Teensy...

ID: 1 volts 0.00 resistance= 32.26
blade= 0
WS2811 Blade with 144 leds
Scanning sound font:  done
Activating monophonic font.
unit = 0 vol = 0.50, Playing boot.wav
channels: 1 rate: 22050 bits: 16
Welcome to TeensySaber, type 'help' for more info.
I2C pullups found, initializing...
Gyro setup ...  Done
Accel setup ...  Done
Battery voltage: 4.25
Battery voltage: 4.25

I went on to re-soldered my connections from Teensy pins 21, 22 & 23 to the Gate pins of the 3 N-Channel MOSFETs because I didn't like how one of the wires felt/looked after all the moving around and bending.  From here I've taken some voltage readings in an attempt to find my issue.  Here's my results...

1) Voltage between GND on the Teensy and pins 21, 22 and 23 read 3.3V when the blabe is turned on (hum sound plays and Serial Monitor shows the blade being turned on).  These pins drop to 0V when the blade is turned off.
2) Following this up to the MOSFETs the Gate on each of the MOSFETs reads 3.3v when the blade is on and 0V when off.
3) The Source and Drain pins on each MOSFET read 4.19V (source LiPo battery voltage which reads 4.21V when read directly and not attached to the saber) when the blade is turned on and the Teensy raises 3.3V on the Gate pins.  Also, please note that the TeensySaber sketch is returning 4.25V which is very close and would indicate that the connection to +5V through the pullup resistor is good.
4) Following this up to the blade connector the voltage readings between the pin 7 & 8 (+ from battery) and any of the three lines from the MOSFETs (pins 4,5 & 6 on the connector) read 4.19V when the blade is turned on and 0V when off.

Based on these results I know the MOSFET part of the circuit is working and the Teensy is turning on and off power to the blade.

At this point I retested the LED blade through my Arduino UNO test rig and everything works (btw... the test rig has just three connections, the Arduino 3.3V pin connects to the center pin [8] of the aviation connector, the Arduino GND pin connects to pin 4 and Arduino pin 6 connects to pin 3 on the aviation connector).  The test project simply uses the Adafruit_NeoPixel library to light and turn off each LED all the way up the blade changing the colors through some of the basic colors repeatedly.  This lets me see that every LED on both strips are working properly plus it verifies at least pin 3, 4 and 8 on my blade connector.  I really doubt anything happened to the assembled blade and any of the connections there.

At this point I would guess something is wrong with the data signal coming from the Teensy to tell the blades to light.  Do you have any further ideas?  Any other multimeter readings I can do to test the circuit further?

Thanks again for your help and support.  Also... to answer your question... Yes, I cut the VUSB-VIN bridge on the Teensy.

Here are some photos of my electronics as they stand now.  Please not that all the exposed connections were originally covered in shrink tube or electrical tape before all this debugging.

(https://www.fx-sabers.com/forum/proxy.php?request=http%3A%2F%2Fwww.cmdi.us%2Fimages%2FTeensySaber%2FTeensyPropShield.JPG&hash=465b6bca8c66f83d0c6c067e28e03d9c)

(https://www.fx-sabers.com/forum/proxy.php?request=http%3A%2F%2Fwww.cmdi.us%2Fimages%2FTeensySaber%2FLiPower.JPG&hash=f98678f034e8344f4ad474973467102f)

(https://www.fx-sabers.com/forum/proxy.php?request=http%3A%2F%2Fwww.cmdi.us%2Fimages%2FTeensySaber%2FMOSFETAssembly.JPG&hash=cd29951de164c455463a0810ddaab41e)

(https://www.fx-sabers.com/forum/proxy.php?request=http%3A%2F%2Fwww.cmdi.us%2Fimages%2FTeensySaber%2FBladeConnector.JPG&hash=ba996aeb688e2f75a79028cc7bfd8989)

(https://www.fx-sabers.com/forum/proxy.php?request=http%3A%2F%2Fwww.cmdi.us%2Fimages%2FTeensySaber%2FArduinoRig.JPG&hash=ee5096c4a5e9e6db395e5314c9bd42fe)




Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 10, 2017, 11:35:11 AM
Sorry I vented my frustrations a little in my last post.

Don't worry about it, venting is all good... :)

First of all: Let me say that it sounds like you're doing everything right. The connections look good, the debugging is great, even though it hasn't uncovered the problem yet.

Quote
ID: 1 volts 0.00 resistance= 32.26

This part is a little weird to me. It says that there is a 32ohm (or less) connection between GND and pin 20.
Let me clarify that: When the teensy performs tries to figure out the blade ID resistance, it puts pin 20 in
INPUT_PULLUP mode, which basically connects an internal 33kOhm pullup to pin 20. In spite of that, AnalogRead
returns 1 (on a scale from 0 = zero volts and 1023 = 3.3 volts.)

Basically, this indicates a short between pin 20 and ground.

If this turns out to not be the problem, the next step is probably to look for an arduino sketch that lets you use the arduino kind of like a digital analyzer or oscilloscope. Then you can plug in pin 20 on the teensy into the arduino and actually look at the output signal and see what it looks like.  (Unless you have an actual oscilloscope or digital analyzer, in which case ignore what I say and just use that...)


Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 10, 2017, 12:12:35 PM
At this point I would guess something is wrong with the data signal coming from the Teensy to tell the blades to light.  Do you have any further ideas?  Any other multimeter readings I can do to test the circuit further?

One other piece of information.  When the Teensy is booted but the blade is off pin 20 on the Teensy reads 3.335V.  When I turn the blade on the voltage drops to 3.146V.  Is this normal?  If not is it an indication of a problem and what the issue might be?  Also, through the Serial Monitor I can turn off the hum sound (amp off) leaving the blade on and the voltage doesn't change so it doesn't seem to have anything to do with the sound from the Prop Shield.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 10, 2017, 12:18:35 PM
At this point I would guess something is wrong with the data signal coming from the Teensy to tell the blades to light.  Do you have any further ideas?  Any other multimeter readings I can do to test the circuit further?

One other piece of information.  When the Teensy is booted but the blade is off pin 20 on the Teensy reads 3.335V.  When I turn the blade on the voltage drops to 3.146V.  Is this normal?  If not is it an indication of a problem and what the issue might be?  Also, through the Serial Monitor I can turn off the hum sound (amp off) leaving the blade on and the voltage doesn't change so it doesn't seem to have anything to do with the sound from the Prop Shield.

I don't think that's abnormal, when the blade is powered on it will cause some changes in the pin 20 voltage. (Which sometimes causes problem for the blade ID procedure..)

If nothing else, the blade id resistor will pull the voltage down slightly.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 10, 2017, 12:25:06 PM
This part is a little weird to me. It says that there is a 32ohm (or less) connection between GND and pin 20.
Let me clarify that: When the teensy performs tries to figure out the blade ID resistance, it puts pin 20 in
INPUT_PULLUP mode, which basically connects an internal 33kOhm pullup to pin 20. In spite of that, AnalogRead
returns 1 (on a scale from 0 = zero volts and 1023 = 3.3 volts.)

Basically, this indicates a short between pin 20 and ground.

I had been looking at this and questioning it myself.  I hadn't found the code where you calculate this yet but I sort of thought it should be showing the resistance value of my blade ID resistor (which is 10K).  The 32.26 Ohm value seemd to not make sense at all.

One more question... could the blade ID resister connected between pin 3 on the aviation connector (pin 20 signal from the Teensy) and pin 1 & 2 of the aviation connector (which are connected in line with the negative side of the battery) be part of the issue?  I don't intend to have multiple blades and my blade array only has one blade defined so could I simply remove this connection?  I already have a kill plug on the negative leg of the battery anyway so I don't really need the blade to complete this part of the circuit.  Let me know your thoughts.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 10, 2017, 12:48:23 PM
One more question... could the blade ID resister connected between pin 3 on the aviation connector (pin 20 signal from the Teensy) and pin 1 & 2 of the aviation connector (which are connected in line with the negative side of the battery) be part of the issue?  I don't intend to have multiple blades and my blade array only has one blade defined so could I simply remove this connection?  I already have a kill plug on the negative leg of the battery anyway so I don't really need the blade to complete this part of the circuit.  Let me know your thoughts.

As a test I did just what I proposed above... I disconnected pin 1 & 2 from the aviation connector and tied them together.  This effectively removed the blade cut-off and the blade ID resistor from the circuit.  The boot up of the Teensy now shows the following...

ID: 0 volts 0.00 resistance= 0.00
blade= 0
WS2811 Blade with 144 leds
Scanning sound font:  done
Activating monophonic font.
unit = 0 vol = 0.50, Playing boot.wav
channels: 1 rate: 22050 bits: 16
Welcome to TeensySaber, type 'help' for more info.
I2C pullups found, initializing...
Gyro setup ...  Done
Accel setup ...  Done

Unfortunately this did not correct the issue.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 10, 2017, 01:00:39 PM
I've now completely disconnected the signal wire from pin 20 on the Teensy and have no battery connected to complete the power circuit.  If I test continuity from GND (or AGND) on the Teensy to pin 20 I get 0 ohms resistance (continuity).  This doesn't seem right.  Pins 21, 22 & 23 all read infinite resistance (no continuity).  Does this mean there a short on the Teensy somewhere?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 10, 2017, 03:48:13 PM
While I will still continue to debug my original Teensy 3.2 / Prop Shield saber electronics I'm probably going to build a second setup.  I have another Prop Shield and a Teensy 3.6 on hand plus I have all the other parts necessary to put this together.  Plus the build should be easier / quicker because of what I learned on the first build.

I've been reviewing this option and saw that everything on the Prop Shield lines up with the Teensy 3.6 except for the A14/DAC pin.  When I look at the Teensy 3.6 pin configuration I see there are two DAC pins, A21/DAC0 and A22/DAC1.  Should I assume I should hook up A21/DAC0 to AudioIn on the Prop Shield?

Also, could you summarize what changes need to be made (if any) in the sourcecode to utilize the Teensy 3.6?  I know I will have to uncomment "#define ENABLE_SD" to utilize the built in SD card on the Teensy 3.6 (instead of using the Serial Flash like I'm doing now on my Teensy 3.2 set up) and I will need to tailor my soundfonts on a micro SD card.  I saw the comment "// Set to BUILTIN_SDCARD for Teensy 3.5/3.6" on the "sdCardSelectPin = 0" statement.  Does this mean this needs to be changed to "sdCardSelectPin = BUILTIN_SDCARD"?  I didn't find any other comments related to the Teensy 3.6.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 10, 2017, 04:14:00 PM
One more question... could the blade ID resister connected between pin 3 on the aviation connector (pin 20 signal from the Teensy) and pin 1 & 2 of the aviation connector (which are connected in line with the negative side of the battery) be part of the issue?  I don't intend to have multiple blades and my blade array only has one blade defined so could I simply remove this connection?  I already have a kill plug on the negative leg of the battery anyway so I don't really need the blade to complete this part of the circuit.  Let me know your thoughts.

The blade id resistor could indeed be part of the problem.

Quote


As a test I did just what I proposed above... I disconnected pin 1 & 2 from the aviation connector and tied them together.  This effectively removed the blade cut-off and the blade ID resistor from the circuit.  The boot up of the Teensy now shows the following...

ID: 0 volts 0.00 resistance= 0.00
blade= 0
WS2811 Blade with 144 leds
Scanning sound font:  done
Activating monophonic font.
unit = 0 vol = 0.50, Playing boot.wav
channels: 1 rate: 22050 bits: 16
Welcome to TeensySaber, type 'help' for more info.
I2C pullups found, initializing...
Gyro setup ...  Done
Accel setup ...  Done

Unfortunately this did not correct the issue.


If you remove the blade ID resistor, don't tie the remaining leads together, that creates the short we're trying to avoid.

Quote
I've now completely disconnected the signal wire from pin 20 on the Teensy and have no battery connected to complete the power circuit.  If I test continuity from GND (or AGND) on the Teensy to pin 20 I get 0 ohms resistance (continuity).  This doesn't seem right.  Pins 21, 22 & 23 all read infinite resistance (no continuity).  Does this mean there a short on the Teensy somewhere?

That seems bad. Unless you have solder globs on the teensy, that kind of seems like the teensy is fried.

While I will still continue to debug my original Teensy 3.2 / Prop Shield saber electronics I'm probably going to build a second setup.  I have another Prop Shield and a Teensy 3.6 on hand plus I have all the other parts necessary to put this together.  Plus the build should be easier / quicker because of what I learned on the first build.

I've been reviewing this option and saw that everything on the Prop Shield lines up with the Teensy 3.6 except for the A14/DAC pin.  When I look at the Teensy 3.6 pin configuration I see there are two DAC pins, A21/DAC0 and A22/DAC1.  Should I assume I should hook up A21/DAC0 to AudioIn on the Prop Shield?

If you hook it up to A21/DAC0, you don't need to make any changes to the code.
However, A22/DAC1 is a little closer, and all you have to do is to replace all references to DAC0 with DAC1 in the code to make it work.
(I should probably make an option for this.)
Just beware that the teensy 3.6 is *not* 5v tolerant, so keep the 5v stuff away from all the digital input/outputs.

Quote
Also, could you summarize what changes need to be made (if any) in the sourcecode to utilize the Teensy 3.6?  I know I will have to uncomment "#define ENABLE_SD" to utilize the built in SD card on the Teensy 3.6 (instead of using the Serial Flash like I'm doing now on my Teensy 3.2 set up) and I will need to tailor my soundfonts on a micro SD card.  I saw the comment "// Set to BUILTIN_SDCARD for Teensy 3.5/3.6" on the "sdCardSelectPin = 0" statement.  Does this mean this needs to be changed to "sdCardSelectPin = BUILTIN_SDCARD"?  I didn't find any other comments related to the Teensy 3.6.

That should be all you need to do. (Except maybe for the DAC thing above.)




Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 10, 2017, 06:44:47 PM
If you remove the blade ID resistor, don't tie the remaining leads together, that creates the short we're trying to avoid.

Let me clarify.  Here's what I'm talking about in a modified version of your circuit diagram...
(https://www.fx-sabers.com/forum/proxy.php?request=http%3A%2F%2Fwww.cmdi.us%2Fimages%2FTeensySaber%2Fcircuit_diagram_modified.png&hash=13f6e018ef46527fea93df391b687e23)

As you can see all I did was complete the circuit from the negative side of the battery to the LiPower input negative connection.

Thanks again for all the help and support.  I'll be working on rebuild this with the Teensy 3.6 I have and hopefully I can get everything working fairly quickly.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on June 10, 2017, 07:01:11 PM
If you remove the blade ID resistor, don't tie the remaining leads together, that creates the short we're trying to avoid.

Let me clarify.  Here's what I'm talking about in a modified version of your circuit diagram...
(https://www.fx-sabers.com/forum/proxy.php?request=http%3A%2F%2Fwww.cmdi.us%2Fimages%2FTeensySaber%2Fcircuit_diagram_modified.png&hash=13f6e018ef46527fea93df391b687e23)

As you can see all I did was complete the circuit from the negative side of the battery to the LiPower input negative connection.


Ah, that makes sense.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: Obi-Ken Wanobi on June 10, 2017, 11:43:17 PM
If you remove the blade ID resistor, don't tie the remaining leads together, that creates the short we're trying to avoid.

Let me clarify.  Here's what I'm talking about in a modified version of your circuit diagram...
(https://www.fx-sabers.com/forum/proxy.php?request=http%3A%2F%2Fwww.cmdi.us%2Fimages%2FTeensySaber%2Fcircuit_diagram_modified.png&hash=13f6e018ef46527fea93df391b687e23)

As you can see all I did was complete the circuit from the negative side of the battery to the LiPower input negative connection.


Ah, that makes sense.

Well... if you're anything like me you understand why it 2:38 am and I'm posting on this forum.  I spent the last several hours rebuilding the electronics of my saber.  I have excellent news to report.  My rebuilt saber works PERFECTLY!  The issue must have been the Teensy all along and the more I fussed with it the worse it got until it wouldn't work at all.  You should also note that I didn't need the level shifter in the circuit.  Everything follows the diagram I provided with the exception that I'm using all momentary buttons (no touch button) and the blade pin 3 to DataIn on the LED strip does not have a resister in line.

Thanks again for all your help.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: gmcivor on June 14, 2017, 02:37:20 PM
Well, I got the V2 board yesterday, we (student and I) wired it up today (about an hour) and sure enough bam it works! This makes making the Teensysaber super easy, and alot less wiring. I cant wait for my other boards to arrive.

Regards,

GMcIvor
Title: Re: Announcing the Teensy Saber open source sound board
Post by: arusiasotto on August 31, 2017, 12:48:40 PM
This interests me a lot. I am currently using a pair of Nano Biscotte inside some ultrasabers. So some questions. Why do we need the 5v Booster? Can a Teensy not work on 3.7v?
Which is the more economical version to build? I already have a speaker, a 18650, a bag of tactile buttons, and an RGBW led star.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on August 31, 2017, 03:36:02 PM
This interests me a lot. I am currently using a pair of Nano Biscotte inside some ultrasabers. So some questions. Why do we need the 5v Booster? Can a Teensy not work on 3.7v?
Which is the more economical version to build? I already have a speaker, a 18650, a bag of tactile buttons, and an RGBW led star.

Originally I added the booster because of paranoia; I wasn't sure that the battery voltage would be enough.
However, it turns out you really want to drive the amplifier at 5 volts to get the maximum volume out of it, so having a booster turns out to be a good thing. The booster also isolates the cpu and audio circuitry from battery ripple, which can otherwise cause some problems.

As for the economics:

NB costs $67 (at TCSS)

teensysaber V1 costs something like $20 for the teensy, $20 for the prop shield, $8 for the SD card, $15 for the booster + $5 for the FETs = $68, but is much larger, doesn't fit most hilts and requires a lot more work to put together.

teensysaber V2 costs sometning like $60, plus $20 for the teensy = $80, so it's a little more expensive, but fits in most hilts. I don't have any teensysaber V2 for sale right now, I should have more in a couple of weeks though.

I hope to get the price of teensysabers down in the future, but that is dependent on volume of sales and will take a while.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: arusiasotto on September 01, 2017, 10:24:33 AM
I may have to jump on a V2 then. For a bit more would you add a 4th FET?
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on September 01, 2017, 10:33:52 AM
I may have to jump on a V2 then. For a bit more would you add a 4th FET?

Are you worried about your soldering skills for adding the FETs to the bottom of the teensysaber?
It's really quite easy, basically:

1. apply liquid flux to the area where the FET(s) are going to go
2. put the FETs in place with tweezers or similar
3. melt a small amount of solder onto the tip of your soldering iron
4. While holding the FET in place with something (like maybe a sharpened chopstick) touch one of the pads with the soldering iron for a few seconds, the solder should fairly quickly settle into place
5. repeat for all the other pads

It might look fiddly, but it's actually pretty hard to fail. Liquid flux is pretty much a requirement though.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: arusiasotto on September 01, 2017, 12:05:35 PM
My eyes and hands aren't what they used to be. Took a chunk out of my knuckle last week soldering a led star. And finding a single FET that matches the rest is a hassle for less than 7$. Everyone wants you to order 20 of any component.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on September 01, 2017, 12:24:18 PM
My eyes and hands aren't what they used to be. Took a chunk out of my knuckle last week soldering a led star. And finding a single FET that matches the rest is a hassle for less than 7$. Everyone wants you to order 20 of any component.

First of all, the FETs don't have to match. Secondly, I sell FETs as well as teensysaber boards.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: arusiasotto on September 01, 2017, 12:31:33 PM
Well that makes it simpler then. I'll have to remember to order an additional get then. Thank ye.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: arusiasotto on September 21, 2017, 03:26:49 PM
So, some troubleshooting. The amber LED on the Teensy just flickers and the device keeps plugging/unplugging itself in windows.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on September 21, 2017, 03:35:33 PM
So, some troubleshooting. The amber LED on the Teensy just flickers and the device keeps plugging/unplugging itself in windows.

The plugging/unplugging sounds bad, I don't think that's supposed to happen.

The amber led however, is not supposed to stay lit.
The first time you power up a teensy, it will go directly into "program me" mode, and the amber LED should blink steadily. Once you put put the teensysaber program on there, the amber LED will only light up dimly when teensysaber is reading from the SD card. (Because pin 13, which controls the LED, is also the clock signal for the SD card.)

It's possible that the problem is related to the MTP functionality, and you can try selecting serial emulation instaed of MTP Disk from the usb type menu and see if that makes a difference.  Also, check if there are any messages in the serial monitor.

If none of this helps, I need more information about what you're doing in order to provide more help. Pictures can also be very helpful.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: arusiasotto on September 21, 2017, 05:47:47 PM
Well, i made sure the batteries were charged and resoldered the power lines. I lost the leads on the board doing so and had to solder both to the other side. Fun times. I did get it to flash the Teensy, and now it tries to boot up as MTP, but then losses connection. Not sure if still power, or if it's just a shitty USB port on the Teensy. Until I get my button parts in the mail, I can't really boot it up to find out.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on September 21, 2017, 07:08:04 PM
Well, i made sure the batteries were charged and resoldered the power lines. I lost the leads on the board doing so and had to solder both to the other side. Fun times. I did get it to flash the Teensy, and now it tries to boot up as MTP, but then losses connection. Not sure if still power, or if it's just a shitty USB port on the Teensy. Until I get my button parts in the mail, I can't really boot it up to find out.

You really don't need the buttons to test things. You can just type "pow" in the serial console.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: arusiasotto on September 21, 2017, 07:36:56 PM
Can't use the serial console, as the Teensy can't stay connected to my system for more than a second. I don't know if the teensy itself is constantly rebooting, or if the port can't maintain a connection. It seems to do odd things if i wiggle the cable.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on September 21, 2017, 08:00:55 PM
Can't use the serial console, as the Teensy can't stay connected to my system for more than a second. I don't know if the teensy itself is constantly rebooting, or if the port can't maintain a connection. It seems to do odd things if i wiggle the cable.

I don't think there is any point in waiting for buttons, because if it behaves like that you won't be able to update the programming, which you are going to want to do.

Here is a list of things to try:
1. Use a multimeter to measure if the 5v input is stable when the battery is connected. If not, there is a problem with the power booster. (Which is covered by the warrenty.)
2. Try a different USB cable. Try a powered USB hub if you have one.
3. Disconnect the battery, close VIN-VUSB (this can be done on the top of the teensy with a short wire) and see if the teensy behaves better. If not, there is a problem with your teensy.

Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on September 21, 2017, 08:02:49 PM
Can't use the serial console, as the Teensy can't stay connected to my system for more than a second. I don't know if the teensy itself is constantly rebooting, or if the port can't maintain a connection. It seems to do odd things if i wiggle the cable.

I don't think there is any point in waiting for buttons, because if it behaves like that you won't be able to update the programming, which you are going to want to do.

Here is a list of things to try:
1. Use a multimeter to measure if the 5v input is stable when the battery is connected. If not, there is a problem with the power booster. (Which is covered by the warrenty.)
2. Try a different USB cable. Try a powered USB hub if you have one.
3. Disconnect the battery, close VIN-VUSB (this can be done on the top of the teensy with a short wire) and see if the teensy behaves better. If not, there is a problem with your teensy.

I forgot: Also measure the battery and make sure that it is producing 3.0 volts or more while connected to the teensysaber.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: arusiasotto on September 29, 2017, 01:47:06 PM
Sorry it took so long to get back to you. I got frustrated and wired up a Nano Biscotti v4. Finally went to the garage and dug up my multimeter. Of the three batteries I have tried, they range in output from 3.5-4.1 volts. On the TeensySaber board, 5V pin will register 5V for like 30 seconds, then drop to 1.4ish, then climb back to 5v. The 3.3v pin registers nothing.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on September 29, 2017, 01:57:12 PM
Sorry it took so long to get back to you. I got frustrated and wired up a Nano Biscotti v4. Finally went to the garage and dug up my multimeter. Of the three batteries I have tried, they range in output from 3.5-4.1 volts. On the TeensySaber board, 5V pin will register 5V for like 30 seconds, then drop to 1.4ish, then climb back to 5v. The 3.3v pin registers nothing.

That doensn't sound good. Sounds like both the teensy and the teensysaber boards might be broken.
If you desolder the teensysaber and send me a picture, I'll send you a replacement teensysaber board.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: arusiasotto on September 29, 2017, 02:01:00 PM
Alright. May take a bit of work, as I used Header pins for space. Going to have to get me a new solder wick first, as my old one is pretty much shot.
Title: Re: Announcing the Teensy Saber open source sound board
Post by: profezzorn on September 29, 2017, 02:07:48 PM
Alright. May take a bit of work, as I used Header pins for space. Going to have to get me a new solder wick first, as my old one is pretty much shot.


Pins can be tricky, but please be careful as I will ask you to send the broken teensysaber back to me. I will attempt to repair it and send it to the next person who needs a replacement.  Usually it's possible to heat the pins up enough to just pull it out with some pliers (one at a time), but don't pull to hard or plating will come right off the board(s). Do not try to clip the pins, as the sideways mechanical motion is often enough to damage the board(s).
Good solder wick is probably a good idea.