fiduciary

Author Topic: TeensySaber Software Discussion  (Read 67044 times)

0 Members and 2 Guests are viewing this topic.

Offline KanyonKris

  • Padawan Learner
  • **
  • Posts: 72
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #285 on: February 09, 2018, 08:06:47 AM »
Just for fun / reference:

My Kingston 8 GB microSDHC Class 4 Flash Memory Card in a TeensySaber board with a Teensy 3.2 reports:

Code: [Select]
SD card speed:
1018.65 kb/s = 11.55 simultaneous audio streams.

The same microSD card in the card slot of a Teensy 3.5 reports:

Code: [Select]
SD card speed:
1989.24 kb/s = 22.55 simultaneous audio streams.

Nearly twice as fast.

The Teensy 3.5 schematic shows all 8 pins of the card slot connected to the CPU so it should be using all 4 data lines in SD mode. Whereas the TeensySaber board is using SPI mode which has one data channel.

I'm impressed that SPI mode is only has half the transfer rate of SD mode. And let's be clear, SPI mode at 1Mb/s (11 streams) is more than enough for lightsabers.

Offline KanyonKris

  • Padawan Learner
  • **
  • Posts: 72
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #286 on: February 09, 2018, 08:22:59 AM »
I'm back from testing the device. But again, i have mixed thoughts. Today, it was planned to put the whole thing in to the prop shield but again, i encoutered a problem. First i rewired the whole thing and soldered the aviator plugs onto electronics, added booster and li-on battery, powered the electronics... and it worked - for a while. LEDs were powering on, the sound was working and i even managed to change the fonts. As i said, it worked for a while.

Now when i power on the saber, all i can hear is the quiet high frequency sound, comming from the speaker and no LEDs turning on. If i change the preset, it speaks the infamous "bank open failure".

I'm using a Panasonic Li-On 3200mAh protected battery. One thing i noticed is, that Voltage level in serial monitor is changing from aprox 3.50V - 3.70V. I added 100kohm resistor and changed the valie of pullup resistor to "100000". Blade recognision resistor is valued to 56ohm, but i leave it to default value of 7800ohm (default). Number of blades is set to "1".

Any solutions?
If it's a protected Li-Ion that may be the problem. Here's profezzorn's comments:

Quote
A note about batteries
At first, i tried using a 3200mAh protected battery that supports 10A. It's a good solid battery, but if it wasn't fully charged, the protection circuit would kick in when I turned on all the LEDs at the same time in the PL9823 blade. I am now using an unprotected battery that can provide 20A continuous and 100A peak. Such a battery should be respected as it can make any wire glow white hot if short-circuited. If you want to use protected batteries for the extra safety, make sure you have some head-room, because WS2811 and PL9823 can draw more than it says on the data sheet when you turn them on. Also, batteries that are rated for high current will have lower internal resistance, which means that the voltage will drop less when you put load on them. This is an important consideration for this electronics, since it does not have buck-boost driving circuits, and the brightness of the LEDs will drop if the voltage goes too low.
from here - Teensy Saber Electronics

What did you see in the serial monitor? The serial output provides a lot of useful info that is very helpful when troubleshooting. And you don't need to do a screen capture of the serial monitor, just select the serial output and copy and paste it into a post.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #287 on: February 09, 2018, 10:24:26 AM »
I'm back from testing the device. But again, i have mixed thoughts. Today, it was planned to put the whole thing in to the prop shield but again, i encoutered a problem. First i rewired the whole thing and soldered the aviator plugs onto electronics, added booster and li-on battery, powered the electronics... and it worked - for a while. LEDs were powering on, the sound was working and i even managed to change the fonts. As i said, it worked for a while.

Now when i power on the saber, all i can hear is the quiet high frequency sound, comming from the speaker and no LEDs turning on. If i change the preset, it speaks the infamous "bank open failure".

I'm using a Panasonic Li-On 3200mAh protected battery. One thing i noticed is, that Voltage level in serial monitor is changing from aprox 3.50V - 3.70V. I added 100kohm resistor and changed the valie of pullup resistor to "100000". Blade recognision resistor is valued to 56ohm, but i leave it to default value of 7800ohm (default). Number of blades is set to "1".

Any solutions?

This is the actual battery:

Panasonic NCR18650PF 10A High Drain Li-ion 2900mAh Battery with Tabs/Solders |


Well, my first thought is to check the battery with a volt meter to make sure it's still charged.
Are you sure that's a protected battery? The page you link doesn't actually say it's protected.
Second, check the voltage after the booster, is it ~5 volts?
The voltage level changes you're seeing are weird though, it's not supposed to change that much. Do you see the same thing if you hook up a multimeter to the battery while it's running? If the battery is unprotected, it's possible that the battery has gotten damaged by discharging it below 2.6 volts. Damaged batteries can behave kind of odd.


Offline KanyonKris

  • Padawan Learner
  • **
  • Posts: 72
  • Um...Hello?
Error notifications
« Reply #288 on: February 09, 2018, 05:33:42 PM »
profezzorn, I've been thinking and playing around a bit with error notifications.

Currently there are 3-4 errors that have talkie voice notifications. While it's cool to have voice messages with a pretty low memory footprint, they don't sound very good (and are often hard to make out) and the message itself is not exactly what the error is (ie Bank Open means a file was not found).

I wondered about putting recorded audio messages in program memory.  Paul Stoffgren (Mr. Teensy) has done some work on this. Paul estimated that you could put 20 seconds of audio in program memory of a Teensy 3.2. I made 4 error messages using a test-to-speech website and came up with 4 seconds of total audio, so that would take 1/5 of program memory. Is this a direction you think is worth pursuing? The plus side is the audio error messages would sound better and be exactly what you want, but is it worth 1/5 of the program space? Let me know what you think.

Another option would be to put error audio files on the SD card. Of course this doesn't work for SD card or file errors. Perhaps beeps could be used if the SD card can't be read (ie 1 beep means low battery, 2 beeps means no SD card, 3 beeps means file not found, 4 beeps means bad blade). Or maybe just use beeps and no voice messages. Again, your thoughts?
« Last Edit: February 09, 2018, 09:05:47 PM by KanyonKris »

Offline spearson

  • No Force
  • *
  • Posts: 20
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #289 on: February 09, 2018, 05:50:02 PM »
I'm getting compile errors with the 202 build:

Code: [Select]
lightsaber:5398: error: 'StyleAllocator' does not name a type
 StyleAllocator StylePtr() {

Any thoughts?

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #290 on: February 09, 2018, 05:58:39 PM »
I'm getting compile errors with the 202 build:

Code: [Select]
lightsaber:5398: error: 'StyleAllocator' does not name a type
 StyleAllocator StylePtr() {

Any thoughts?

Yeah, I noticed that too. It's because I changed blade styles to be dynamically allocated instead of using global variables to allocate them. I think I mirrored the fix to github if you're in a hurry, otherwise I'll have another beta later tonight.

Offline spearson

  • No Force
  • *
  • Posts: 20
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #291 on: February 09, 2018, 06:10:28 PM »
No hurry, I merged the the fadeAndStop fix into the previous build, so going to do some testing with that.  I had an unusual issue last night in that the the hold aux and clash sound effect didn't stop playing until I powered off (the lighting effect went away, but the sound kept clashing).  I wasn't able to recreate it, so I am going to try and do that again.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #292 on: February 09, 2018, 06:56:31 PM »
No hurry, I merged the the fadeAndStop fix into the previous build, so going to do some testing with that.  I had an unusual issue last night in that the the hold aux and clash sound effect didn't stop playing until I powered off (the lighting effect went away, but the sound kept clashing).  I wasn't able to recreate it, so I am going to try and do that again.

Monophonic or polyphonic font?

Offline spearson

  • No Force
  • *
  • Posts: 20
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #293 on: February 09, 2018, 07:29:01 PM »
Poly, same I sent a while back, along with one of thexter's swingl/h zip's of swing files.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #294 on: February 09, 2018, 11:23:52 PM »
Poly, same I sent a while back, along with one of thexter's swingl/h zip's of swing files.

I found something that could cause that. (Push power, clash, push aux, release power)
I also fixed the allocation problem, and I've been breaking out code into sub-files a lot....
New beta: http://fredrik.hubbe.net/lightsaber/lightsaber-1.209.ziip

Offline KanyonKris

  • Padawan Learner
  • **
  • Posts: 72
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #295 on: February 10, 2018, 09:18:13 AM »
I found something that could cause that. (Push power, clash, push aux, release power)
I also fixed the allocation problem, and I've been breaking out code into sub-files a lot....
New beta: http://fredrik.hubbe.net/lightsaber/lightsaber-1.209.ziip
Link doesn't work because of a typo (ziip). Corrected/working link: lightsaber-1.209.zip

Offline KanyonKris

  • Padawan Learner
  • **
  • Posts: 72
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #296 on: February 10, 2018, 09:43:00 AM »
Looks like the /sound directory is missing from the 1.209 zip. Went to Github to get the files in /sound.

also, I'm getting this error:

Code: [Select]
lightsaber:3163: error: 'StyleAllocator' does not name a type
 StyleAllocator StylePtr() {
« Last Edit: February 10, 2018, 09:51:26 AM by KanyonKris »

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #297 on: February 10, 2018, 10:00:25 AM »
Looks like the /sound directory is missing from the 1.209 zip. Went to Github to get the files in /sound.

also, I'm getting this error:

Code: [Select]
lightsaber:3163: error: 'StyleAllocator' does not name a type
 StyleAllocator StylePtr() {

Ops, uploaded a new lightsaber-1.209.zip that hopefully has all the files.

Offline KanyonKris

  • Padawan Learner
  • **
  • Posts: 72
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #298 on: February 10, 2018, 01:12:47 PM »
I don't understand. Is this StyleAllcoator error a bug or something I'm doing wrong? I get the error even if I use the supplied default_v3_config.h

Code: [Select]
lightsaber:3163: error: 'StyleAllocator' does not name a type
 StyleAllocator StylePtr() {

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #299 on: February 10, 2018, 01:53:52 PM »
I don't understand. Is this StyleAllcoator error a bug or something I'm doing wrong? I get the error even if I use the supplied default_v3_config.h

Code: [Select]
lightsaber:3163: error: 'StyleAllocator' does not name a type
 StyleAllocator StylePtr() {

Well it's not you. I tried to make sure everything compiled using the makefile, but when I compiled within arduino, I get the same error, but I don't know why.
I change StyleAllocator from a typedef to a #define (shudder) and the problem went away.

New beta: http://fredrik.hubbe.net/lightsaber/lightsaber-1.210.zip

 

retrousse