fiduciary

Author Topic: Teensysaber V1 with Teensy 3.5  (Read 484 times)

0 Members and 1 Guest are viewing this topic.

Offline Elthion

  • Trade Count: (0)
  • No Force
  • *
  • Posts: 6
  • Um...Hello?
Teensysaber V1 with Teensy 3.5
« on: April 11, 2020, 08:01:11 AM »
Hi,

I am pretty new to lightsaber building and at first I wanted to try to make a Teensysaber V1 based on the great website of Fredrik Hübinette. Below I will give as much information as I can to explain my current setup.

As the Teensysaber V1 needs a SD card adapter, I thought that using a Teensy 3.5 will allow me to avoid buying the Teensy + SD adapter and simplify soldering. So I did that.

At the moment I am using the Teensy 3.5, PropShield, LiPower boost converter Sparkfun (I removed the capacitor as described on the website), one strip of WS2812B (for now to test the working principle, then I will stick an other strip with this one to have both sides and add more blades), only one FET (one of the two models described on the website: FQP30N06L), a 18650 Keeppower 3120mAh with protection circuit built-in, a 28mm TCS Wow Speaker.

In my setup I only have one button to switch ON/OFF the saber that I soldered to pin 17 (so I changed the power button of v1_config.h to 17).

I did my configuration file as described on the website based on V3 first (because there is the configurator). I modified v3_config.h to v1_config.h and added the following lines based on what is needed for v1 configs:
#define DUAL_POWER_BUTTONS
#define BATTERY_PULLUP_OHMS 20000
#define ENABLE_SERIALFLASH

Right now, when I use the saber no sound is coming out and only the first LED of the strip is green (with one small red dot) when the saber is "off".

When I launch the software here is what I see in the monitor:
Amplifier off.
I2C TRY
I2C pullups found, initializing...
Accel setup ...  Done
Gyro setup ...  Done

Then, if I press the button (quick) I have the following:

EVENT: Power-Pressed millis=12079
EVENT: Power-Released millis=12246
EVENT: Power-Shortclick millis=12247
Ignition.
unit = 0 vol = 0.00, Playing TeensySF/hum01.wav
channels: 1 rate: 44100 bits: 16
unit = 1 vol = 0.50, Playing TeensySF/out01.wav
channels: 1 rate: 44100 bits: 16
humstart: 1890
unit = 2 vol = 0.50, Playing TeensySF/swingl04.wav
channels: 1 rate: 44100 bits: 16
unit = 3 vol = 0.50, Playing TeensySF/swingh04.wav
channels: 1 rate: 44100 bits: 16
Playing TeensySF/swingl04.wav
channels: 1 rate: 44100 bits: 16
Playing TeensySF/swingh04.wav
channels: 1 rate: 44100 bits: 16
Battery voltage: 4.31

If I press again the button (quick):
EVENT: Power-Pressed ON millis=21221
EVENT: Power-Released ON millis=21367
EVENT: Power-Shortclick ON millis=21367
unit = 1 vol = 0.50, Playing TeensySF/in02.wav
channels: 1 rate: 44100 bits: 16
No sounds found: pstoff
Amplifier off.

With the dir command I have the following:
SYSTEM~1 32768
RGUECMDR 32768
SMTHFUZZ 32768
SMTHGREY 32768
SMTHJEDI 32768
TEENSYSF 32768
TRACKS 32768
TTHCRSTL 32768
Done listing files.

The beep command make no sound and just return:
Amplifier off.

If I move the PropShield I have information about sound that should play etc...

I tried to debug on my own but I have no idea what to do more... I checked the connections many times with a multimeter, I read many many information on internet but none were useful to my case...

My questions are the following:
- Has someone already tried to use a Teensy 3.5 to make a Teensysaber V1? If yes, what did you change from hardware/software to make it works? (compared to using a Teensy 3.2)
- Even if nobody did that in the past. What would you suggest to do to make it works?

If you need more information I can provide pictures or explain more details on specific parts.

Thank you very much for your help, any insight would be very helpful! =)

Offline profezzorn

  • Mining Colony Members
  • Trade Count: (0)
  • Master Force User
  • *
  • Posts: 894
  • May the source be with you.
    • Hubbe's Corner
Re: Teensysaber V1 with Teensy 3.5
« Reply #1 on: April 14, 2020, 01:46:07 PM »
So, it looks like things are working reasonably well, except for the sound.
Now, the Teensy 3.5 has "audio out" in a different place than the Teensy 3.2, did you take that into account?

If that's not the problem, try posting your config file and some images of your setup, maybe we can spot something there.

Offline Elthion

  • Trade Count: (0)
  • No Force
  • *
  • Posts: 6
  • Um...Hello?
Re: Teensysaber V1 with Teensy 3.5
« Reply #2 on: April 15, 2020, 09:14:42 AM »
Dear profezzorn, thanks a lot for answering this topic.

Concerning the "audio out" I connected the "AudioIN"pin of the PropShield to the pin A14 (33) of the Teensy. This is the white wire that you can see below the Teensy. So I assumed it was the good wiring because it was not possible to connect it directly through headers since there is no hole to connect on Teensy 3.5 at this place.


There are 2 things that do not work, the light and the sound. Only one green LED (with one red dot) is enlightened when the saber is normally "OFF". When I turn the saber "ON", no LEDs are turning ON.

I tried to do photos of the setup and I hope this is enough detailed. I wrote on each image some information. Here is the link to the photos: Teensysaber V1 with Teensy 3.5 - Google Drive

What couldn't fit on the images was the wiring through headers between Prop Shield and Teensy 3.5. At first I put header everywhere, then I realized I shouldn't do that so I cut the headers instead of unsoldering (I checked every connections and there is no contact when there should not be). So here is described what pins are connected between Prop Shield and Teensy 3.5 on left side of the Teensy:
GND connected
0 connected
1
2 connected
3
4
5 connected
6 connected
7 connected
8
9
10
11 connected
12 connected


On the other side of the Teensy 3.5:
Vin connected
Analog GND connected
3.3V connected
23
22
21
20
19 connected
18 connected
17
16
15
14
13 connected

and at the end of the Teensy:
33 connected to AudioIN

Thanks, I hope I just did a silly mistake =). If you need more details do not hesitate to ask me.

EDIT: here is the Teensy 3.5 pinout (in order to have it directly here: http://www.pjrc.com/teensy/card8a_rev2.png)

And there is my config in the link with the photos.
« Last Edit: April 15, 2020, 09:18:56 AM by Elthion »

Offline profezzorn

  • Mining Colony Members
  • Trade Count: (0)
  • Master Force User
  • *
  • Posts: 894
  • May the source be with you.
    • Hubbe's Corner
Re: Teensysaber V1 with Teensy 3.5
« Reply #3 on: April 15, 2020, 10:24:53 AM »
So far I've spotted two potential problems, so let's start with those:

1. Audio will come out from DAC0 on the Teensy 3.5, not A14. DAC0 is also called A21 on the Teensy 3.5
2. In your config file, your blade configuration says that you only have one LED, try changing this line:

 { 0, WS2811BladePtr<1, WS2811_ACTUALLY_800kHz | WS2811_GRB>(), CONFIGARRAY(presets) },

To:

 { 0, WS2811BladePtr<144, WS2811_ACTUALLY_800kHz | WS2811_GRB>(), CONFIGARRAY(presets) },

(Or, however many LEDs you actually have in your strip.)

Offline Elthion

  • Trade Count: (0)
  • No Force
  • *
  • Posts: 6
  • Um...Hello?
Re: Teensysaber V1 with Teensy 3.5
« Reply #4 on: April 16, 2020, 08:30:45 AM »
You are completely right, I wired the AudioIN to the wrong pin! Now, I soldered it to DAC0 and I can hear sound! Thank you to have spotted this!

Thank you also to have spotted the mistake in the config file. As I tried many things to debug I modified the file at some point and forgot to put it back to the initial state (with 144 LEDs).


I still have some issues with sound and LEDs. When I plug the battery, I can hear a sound, then if I click on the button, the sound of ignition and hum start (most of the time). Sometimes it doesn't work. I just here a small noise and nothing is working until I disconnect the battery. By the way I have a kill switch that I did not wired, maybe I should add it... Sometimes it is working and then stop working as soon as I click on the button. Finally sometimes it is working even when I move the Prop Shield (sound of clash etc...), but at some point it stops working and I can't do anything except remove and reconnect the battery.

I put 3 different files + 2 pictures and 1 video in a new folder (160420) from the drive (Teensysaber V1 with Teensy 3.5 - Google Drive), to explain in more details the remaining problems.

- the 2 pictures correspond to the WS2812B when the saber is ON or OFF (nothing is turning ON, should I wire things
  differently?)
- the video shows the sound that is stopping at some point when I touch the Prop Shield
- the 3 files contain information from the monitor that I gathered from different scenario:
  --> first scenario: "sound_stay_constant_no_more_output_on_the_monitor.txt" this scenario happens sometimes when I
      try to touch the Prop Shield to get sound. At the last line, sound stopped (I can hear a constant noise), and
      nothing is responding anymore. I have to disconnect the battery.
  --> second scenario: "sound_stop_because_too_much_solicited.txt" in this scenario, I am touching a lot the Prop
      Shield and very rapidly sound stops. But as you can see it is different from the first scenario because in this
      case the program is not able to find the .wav files and the monitor does not freeze. I still have to disconnect
      battery to make it work again.
  --> third scenario: "sound_stop_wav_file_not_found.txt" this scenario is similar to the second one (probably same
      problem) but in this case I am not soliciting too much the Prop Shield and it stops working randomly after some
      time. Sometimes it happened without doing anything.

You are giving me great hope to have a working lightsaber =), thanks again for your help.

Offline Elthion

  • Trade Count: (0)
  • No Force
  • *
  • Posts: 6
  • Um...Hello?
Re: Teensysaber V1 with Teensy 3.5
« Reply #5 on: April 19, 2020, 07:26:11 AM »
Since the last time, I did multiple tests to find the reason why it was not working properly. I figured it out. So I am writing the reason here so that it might help someone in the future. At the end of this post I still have one last question.

First I tried to connect 3 FET instead of the single one I had in the first place. LEDs still didn't work properly. I checked again on internet and all connections again etc... long story short --> I decided to remove the aviation connector. In the same time I added a 10kOhm blade ID resistor. After removing the aviation connector, LEDs worked!
Concerning the sound, it was still doing the same problems as mentioned in the previous post. I read many thread to finally discover that in some cases, some SD cards are not working properly (probably not fast enough) and were causing problems such as the ones I observe (sound cut etc...). For reference I am using this SD card: Kingston Micro SD 16 Go Class 10 U1. So my next move will be to buy a new SD card. Any recommendations?

Finally I have a question. As I am using 3 FET for the main blade. How can I proceed to add 2 side blades (crossguard)? I have remaining FETs but is there any pins that are already "ready" to connect without having to code anything more?

EDIT: The SD card should be ok... This is the result from the sdtest: "Time to read blocks: Average speed: 1499.08 kb/s, 17.00 simultaneous audio streams." Any ideas why sound is not working properly?
« Last Edit: April 19, 2020, 08:05:33 AM by Elthion »

Offline profezzorn

  • Mining Colony Members
  • Trade Count: (0)
  • Master Force User
  • *
  • Posts: 894
  • May the source be with you.
    • Hubbe's Corner
Re: Teensysaber V1 with Teensy 3.5
« Reply #6 on: April 20, 2020, 05:24:31 PM »
With the kind of FETs you are using, one should be enough for the main blade, that way you the other for the quillions.
I think you can use pin 3 and 4 for driving additional FETs.
As for the sound problem, clearly something is crashing, which is not good. It might something in the code, or a power problem that is causing that.
Unfortunately teensys don't support debuggers AFAIK, which can make it very difficult to figure out what is going on when a crash occurs.


Offline Elthion

  • Trade Count: (0)
  • No Force
  • *
  • Posts: 6
  • Um...Hello?
Re: Teensysaber V1 with Teensy 3.5
« Reply #7 on: April 22, 2020, 10:45:39 AM »
Ok thanks, I will try to use one FET for the main blade and the two others for side blades.

I did some new tests to find where does this sound problem comes from. I soldered again some connections that looked like bad. It doesn't change anything. I tried an other SD card (san disk) without success too. Do you think that removing the capacitor on the booster could be related to this sound problem or clearly not at all?

To avoid power problem connections, I soldered the battery and added a kill switch. It does not change anything. I fully charged the battery too.

Something that might help is that I am able to play the music or change lightsaber mode without any problem. Sound is working, music is playing and I can even move the board a lot without any stop of the sound.

However, as soon as I try to turn ON the saber problems appear. Most of the time the saber stop his enlightenment before the end of the saber and the saber reboot (I can hear the first clash when software begin). If I click again to turn ON the saber it does exactly the same (reboot etc...). Sometimes everything is frozen (enlightenment and sound), saber is half enlighten for example and I have to use the kill switch to turn off the battery.

Finally, I noticed that the sound is not clear. There is like a "rattling" when sound is playing (music or voices like "smooth jedi" etc...). I don't really care about this point because the sound of the saber will "hide" this but I wanted to mention it in case it is related to the problem.

With these information, do you have any idea where the problem could be? (in case it is code related)
« Last Edit: April 22, 2020, 10:48:27 AM by Elthion »

Offline Elthion

  • Trade Count: (0)
  • No Force
  • *
  • Posts: 6
  • Um...Hello?
Re: Teensysaber V1 with Teensy 3.5
« Reply #8 on: April 26, 2020, 11:15:49 AM »
I finally found the solution so I am writing it here to help people if they have similar problems. After many tests, on the hardware/software/configs etc... the solution was to comment the line "#define LOUD" on the ProffieOS arduino code. Haha it is simple, if only I tried this first ^^'.

Anyway, it works now, let's say, most of the time. I have some problems more related to the fact that I have too many wires and have probably some disconnections (it worked for 20 min then stopped) while I am moving the saber. My blades are not removable, and the LEDs on the side blades do not go until the end of the blades. But I will try to find a solution in the future.

I tried to find Kylo Ren style sound font but at the moment I do not have something good enough. The sound is very low. I have the sound at 2000 but cannot do much more because the saber crashes if the sound is too loud.

Anyway, it is working now so I am happy =), thank you for your help profezzorn.

If you have any ideas or someone else about the Kylo Ren sound fonts and how to increase sound it would be very much appreciated. In any case, I will try to figure out at some point anyway.