fiduciary

Author Topic: Announcing the Teensy Saber open source sound board  (Read 91771 times)

0 Members and 1 Guest are viewing this topic.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: Announcing the Teensy Saber open source sound board
« Reply #300 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 :

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, and then put a SN74LV1T125 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.)

Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: Announcing the Teensy Saber open source sound board
« Reply #301 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 :

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, and then put a SN74LV1T125 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.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: Announcing the Teensy Saber open source sound board
« Reply #302 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.)

Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: Announcing the Teensy Saber open source sound board
« Reply #303 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.

Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: Announcing the Teensy Saber open source sound board
« Reply #304 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.

Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: Announcing the Teensy Saber open source sound board
« Reply #305 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)?

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: Announcing the Teensy Saber open source sound board
« Reply #306 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?

Offline gmcivor

  • Force User
  • ***
  • Posts: 140
  • Do or do not. There is no try.
Re: Announcing the Teensy Saber open source sound board
« Reply #307 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

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: Announcing the Teensy Saber open source sound board
« Reply #308 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. :)

Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: Announcing the Teensy Saber open source sound board
« Reply #309 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.

Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: Announcing the Teensy Saber open source sound board
« Reply #310 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.

Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: Announcing the Teensy Saber open source sound board
« Reply #311 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.

Offline gmcivor

  • Force User
  • ***
  • Posts: 140
  • Do or do not. There is no try.
Re: Announcing the Teensy Saber open source sound board
« Reply #312 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

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: Announcing the Teensy Saber open source sound board
« Reply #313 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)
  • 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)

Offline gmcivor

  • Force User
  • ***
  • Posts: 140
  • Do or do not. There is no try.
Re: Announcing the Teensy Saber open source sound board
« Reply #314 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

 

retrousse