fiduciary

Author Topic: Profezzorn's first build (graflex 2.0, teensy, prop shield, neopixel led string)  (Read 11133 times)

0 Members and 1 Guest are viewing this topic.

Offline SwampFox

  • No Force
  • *
  • Posts: 19
I'm looking forward to this bigtime, awesome work so far.  If you don't mind, where did you order those connectors?  Looking forward to seeing how it sounds and how it controls the blade.

Offline profezzorn

  • Master Force User
  • *****
  • Posts: 618
  • May the source be with you.
    • Hubbe's Corner
I bought them from Amazon: http://www.amazon.com/dp/B00G9IVM5E
They seem to be available from lots of places, usually called "cb radio microphone connector" or something similar. I haven't found a part number or standard identification that makes them easier to find unfortunately.

Thanks for the encouragement, this forum can be a bit quiet sometimes, it's nice to hear that people appreciate the extra effort of taking pictures and sharing information. :)

Offline profezzorn

  • Master Force User
  • *****
  • Posts: 618
  • May the source be with you.
    • Hubbe's Corner
TheBaconWizard, are you still up for helping me up with some sounds?

I did some coding today, and realized why the sound founts I bought are so big, and why they won't really work the way I want to. It's because most of the effects have a long tail of "idle" sound. I assume this is to make less repetition and fewer cuts between sounds, but since I intend to synthesize idle and swing sounds, I really need clash/on/off/lookup sounds *without* the idle sound in the background. These sounds would also be significantly shorter, and might possibly fit in the 8Mb flash chip that's on the prop shield. (If not, I have an sdcard shield just in case.)

Btw, if you send me some sounds, make them 44100Hz if you can, as that is the native playback rate for the teensy.

Offline TheBaconWizard

  • Experienced Force User
  • ****
  • Posts: 421
  • Font artist
    • CrystalSonix
Sure, I can do that... I could also look at the hum itself and see if it can be shortened and looped more frequently without hurting too much.

But is there any way you can work with a lower sample-rate? It is literally taking double the memory of any other sound font because of that, and it really isn't worth the difference without studio speakers or headphones.

Either way, send me the font you are currently using and I'll knock it into shape as best as it can be.

Offline smaneesint

  • Force User
  • ***
  • Posts: 104
  • You can call me Gibson. That's my nickname. ;)
    • Facebook
Have you found 7/8 Graflex Blade Plug yet? If not, Khal does sell a decent one on his Etsy store. Look up KRSabers and you should find one. =)

Offline profezzorn

  • Master Force User
  • *****
  • Posts: 618
  • May the source be with you.
    • Hubbe's Corner
I can absolutely make it play 22Khz files. However, I'm trying to keep the code simple, and the audio library that comes with the Teensy is hard-coded to run at 44Khz. For now, I would say that you shouldn't worry about making it fit, just give me some sound effects without the idle and swing sounds and if they don't fit, I'll consider what the best way is to solve it. Options include:
  • sdcard support
  • 22Khz support (real-time upsampling)
  • 12bit support (the teensy builtin audio is only 12-bit anyways, so I could fit 2 samples in 3 bytes)
  • flac/mp3/aac support
  • all of the above

I've already looked into all of these, and I'll probably add support for some of these eventually, I just haven't gotten there yet.

Offline profezzorn

  • Master Force User
  • *****
  • Posts: 618
  • May the source be with you.
    • Hubbe's Corner
Have you found 7/8 Graflex Blade Plug yet? If not, Khal does sell a decent one on his Etsy store. Look up KRSabers and you should find one. =)

I did find one here: Graflex 2.0 "Accurate" Razor Blade plugs - Limited Run | Imperial Royal Arms

Offline TheBaconWizard

  • Experienced Force User
  • ****
  • Posts: 421
  • Font artist
    • CrystalSonix
Ok, only just seen this and have already replied to your priv. message.

Commercial fonts are 16bit, I dunno if you will simply experience a slight drop in audio quality or encounter bus problems or what... but meanwhile I can certainly whip your current font into better shape for your memory, I'll get on it tomorrow.

So are you planning to manufacture a whole run of these for sale, once you have this prototype done?

Offline profezzorn

  • Master Force User
  • *****
  • Posts: 618
  • May the source be with you.
    • Hubbe's Corner
So are you planning to manufacture a whole run of these for sale, once you have this prototype done?

No, I plan to open-source everything.
If someone else wants to make a run, they are welcome to.


Offline TheBaconWizard

  • Experienced Force User
  • ****
  • Posts: 421
  • Font artist
    • CrystalSonix
I emailed you the corrected version of your sound font dude. Hopefully you got it?

Offline profezzorn

  • Master Force User
  • *****
  • Posts: 618
  • May the source be with you.
    • Hubbe's Corner
I emailed you the corrected version of your sound font dude. Hopefully you got it?

Yes, I did, thank you!
I'm currently on vacation, so I don't expect to get anything done for a week, but I did get the modified font and I did try it out a little before I left. Once I'll get back I'll record a little video and post it. In the meantime I might try to play with some filters on shadertoy.com. :)

I did try to to play a bit with changing pitch and volume of the idle sound based on swing speed before I left, which is really cool for slow movements, but doesn't seem to do much for generating "swing" sounds.


Offline TheBaconWizard

  • Experienced Force User
  • ****
  • Posts: 421
  • Font artist
    • CrystalSonix
Yeah, doppler shift is a little more complex. I have a suspicion that it affects different elements of the hum differently, ie that you may need to vary the algorithm for the low buzz vs the top hum and any other sounds involved. Not sure on that, but if so it's another way to vary according to x,y,z as well as may sound better.

The rise/fall in volume is almost an exponential curve, it starts like any other but much more rapidly builds/falls the closer it is to your ear maybe with distortion at that point, and the same point is a sudden pitch change downwards compared with the beginning which would be higher than the idling hum, and then there's a more gradual continuing fall thereafter. The latter reminds me of a phaser actually. 


Offline profezzorn

  • Master Force User
  • *****
  • Posts: 618
  • May the source be with you.
    • Hubbe's Corner
Not a lot of progress, since I'm on vacation, but I thought I'd share my power calculations for the blade.

Basically, I intend to have about 100 neopixel-type LEDs in the blade. Each one is rated at 0.3W. 0.3 * 100 = 30W, which sounds kind of scary.

What is actually in these neopixels is three 20mA LEDs paired with constant-current drivers and a control chip. This means that if you only have the blue LEDs on, you use 10W instead of 30W.  Also, the LEDs are rated for running at 4.5 to 6 volts. Since we know that the current is going to me 20mA per powered LED, we can see that the wattage is actually somewhere between 4.5 * 0.02 = 0.09W and 6 * 0.02 = 0.16W per led. The LED will not be brighter when we feed it higher voltage though, the constant-current driver will just dump the extra power as heat. This is both a blessing and a curse. It's a blessing, because it means that the resistance of the LED ladder itself, and any associated voltage drop is not going to cause the blade to light up unevenly and it's a curse because it's a waste of energy.  Ideally, I'd feed just enough voltage in that I still have 4.5 volts at the end of the blade. Unfortunately, I have not found an adjustable voltage converter of sufficient power that is small enough. The one I'm planing to use can produce 7A @ 5.5 volts.  What I expect to need is 20mA * 3 * 100 = 6A, so I have some head-room.

The voltage converter can accept anything from 7 to 36 volts as input. I'd like to drive it with a bunch of serial li-ion cells to reduce the amperage (and heat) on the "feed" side. Unfortunately, the voltage regulator I got for the teensy is limited to 6-23v, which limits me to 6 cells in serial. 5 if I want ot be safe. For now I've picked up a 4xAAA battery holder and 4xAAA protected li-ion cells. When the batteries are close to depleted, this will produce about 10.8 volts, which would mean I would need to draw up to 5.5 * 6 / 10.8 / 0.85 ~= 3.5A through the batteries when all the LEDs are on.  I'm not sure if the batteries can handle that sort of draw or not, if not, I shall have to figure out how to cram more batteries in. It is certainly possible to cram 7 AAA cells into one hilt section, but it will require a black belt in cram-fu to do so.


Offline oswaldkefo

  • Trade Count: (+3)
  • Force User
  • ***
  • Posts: 155
  • aka MandaloreLives
Wow this seems like a really cool build. I like the idea of using the blade as the "kill-key", a nice space saver. I am interested in LED string blades, and I am really liking what you are putting together for that too!

I will be watching this build with great interest!
_________________________________________

I came here to conquer the galaxy and drink milk...and I've finished my milk.

Offline profezzorn

  • Master Force User
  • *****
  • Posts: 618
  • May the source be with you.
    • Hubbe's Corner
Speaking of cram-fu, here is my preliminary pin-map for the teensy:

// Teensy 3.2 pin map:                                                                                                                     
// 0 - FREE (reserve for serial?)                                                                                                           
// 1 - FREE (reserve for serial?)                                                                                                           
// 2 - input, motion sensor interrupts                                                                                                     
// 3 - used by octo library                                                                                                                 
// 4 - output, SD card chip select (optional)                                                                                               
// 5 - output, enables amplifier                                                                                                           
// 6 - output, serial flash memory chip select                                                                                             
// 7 - output, spi led chip select (optional)                                                                                               
// 8 - AUX button (optional)                                                                                                                         
// 9 - AUX2 button (optional)                                                                                                                         
// 10 - used by octo library (used to be pin 4)                                                                                             
// 11 - SPI data out (flash memory, spi led, sd card)                                                                                             
// 12 - SPI data in (flash memory, sd card)                                                                                                       
// 13 - SPI clock (flash memory, spi led, sd card)                                                                                               
// 14 - output, WS2811 led (blade)                                                                                                         
// 15 - used by octo library (connected to 16)                                                                                             
// 16 - used by octo library (connected to 15)                                                                                             
// 18 - I2C (motion sensors)                                                                                                               
// 19 - I2C (motion sensors)                                                                                                               
// 20 - input, Battery level                                                                                                               
// 21 - input, Blade identify                                                                                                               
// 22 - FREE                                                                                                                               
// 23 - power button         

The teensy also has pads on the bottom which can be used, but I'm hoping to avoid using them as they are a bit of a pain to solder to. Especially *after* I've soldered the prop shield in place.

I hacked up the OctoWS2811 library, which is normally used to control 8 neopixel strings in parallel, so that it would only output data to one pin. It's a bit inefficient memory-wise, but offloading the LED communication to the DMA engine will leave a lot more cpu for audio processing.

I'm reserving pin 0 and 1 for a serial port, but I'm not sure why anybody would want one since the USB port can fulfill the same function with no additional hardware needed. (I already have command-line interface that let's you enter commands through the arduino serial monitor to play sounds, turn the saber on/off, etc.)

The "blade identify" pin is intended to make it possible to have several different blades with different default sounds and colors. The idea is to put different resistors in the blade and measure them against the internal pull-up resistor in the teensy. This also makes it possible to have blades of different lengths with different number of LEDs.

I figure I'll draw up a full connection diagram this weekend.