Registration Notice

Due to increased spam, forum registration must be manually approved by a moderator! Please see this post for instructions.

*

Offline LukeZ

  • 1241
    • View Profile
  • France
Re: Open Source Sound using Teensy 3.2 and PJRC Audio Library
« Reply #105 on: July 21, 2020, 04:02:26 PM »
I am looking forward to seeing what you create!
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline Rongyos

  • 44
    • View Profile
  • Hungary
Re: Open Source Sound using Teensy 3.2 and PJRC Audio Library
« Reply #106 on: September 05, 2022, 04:07:38 AM »
Hi Tankers!

Very easy but confusing question. Connecting PCB and sound card serial should be like:
TCB RX  - SOUND TX
TCB TX - SOUND RX
GND - GND

Am I right? I attached a picture but I connect it to the wrong connector just for reference.

Regards
Rongyos
IMG_20220905_104553.jpg
Open Source Sound using Teensy 3.2 and PJRC Audio Library IMG_20220905_104553.jpg
Views: 5206

*

Offline LukeZ

  • 1241
    • View Profile
  • France
Re: Open Source Sound using Teensy 3.2 and PJRC Audio Library
« Reply #107 on: September 05, 2022, 08:22:10 AM »
Hi Rongyos, your connections are correct!

It is easy to get confused with the labels, but another way to be sure is simply to connect ground (GND) to ground, the middle connector from one is connected to the middle connector of the other, and that only leaves one connector on each board which by default will be connected to each other. This is true for the TCB, the sound card, and the Scout ESC.

NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline Rongyos

  • 44
    • View Profile
  • Hungary
Re: Open Source Sound using Teensy 3.2 and PJRC Audio Library
« Reply #108 on: October 16, 2022, 08:20:41 AM »
Hello LukeZ!

Finally I managed to try the sound card. I have a problem: on cold start (first start from tcb startup) there is an unecessary cannon fire before is starting ignition.
I have no cannon fire in the sound file. Soundfiles seems good and other sounds (warmstart too) are working fine.

Can you please help me out in this? I just refreshed the firmware on teensy.

Thanks
Rongyos


*

Offline LukeZ

  • 1241
    • View Profile
  • France
Re: Open Source Sound using Teensy 3.2 and PJRC Audio Library
« Reply #109 on: October 17, 2022, 01:09:31 PM »
Hi Rongyos, that is a strange problem. What I can say is that the sound card will only play the sound that it is being commanded to play. So there are two basic possibilities:
1. You have a sound file on your SD card that plays the cannon sound, but you gave it the file name for something else (in other words, something other than "cannonf.wav")
2. Or for some reason the TCB is sending the signal to fire the cannon at the same time it sends the signal to start the engine.

For #1, I would put the SD card into your computer and listen to all your sound files once again, just to verify that the cannon sound didn't somehow get named to something else.

For #2, examine all your function triggers in OP Config. Did you maybe link the "Cannon Fire" function to the "Engine Start" trigger by mistake? Did you maybe assign the "Cannon Fire" function to the same switch on your transmitter you are using to start the engine?

You can post your OPZ file if you want me to look at it.

There is something else I noticed in your video, which may or may not be related to your problem. I notice there is a delay of several seconds from the time you flip the switch on your transmitter, to the time when the engine starts. Do you know why that is?

By any chance do you have an engine "Preheat time" specified? (In OP Config on the Motors tab, under the Smoker section, when Type is set to "Separate Heat & Fan").

On your SD card do you have a sound file called "preheat.wav"?

If so, you may want to do a test where you delete "preheat.wav" or set "Preheat time" to 0, and see if that makes any difference.
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline Rongyos

  • 44
    • View Profile
  • Hungary
Re: Open Source Sound using Teensy 3.2 and PJRC Audio Library
« Reply #110 on: October 18, 2022, 03:26:12 PM »

1. You have a sound file on your SD card that plays the cannon sound, but you gave it the file name for something else (in other words, something other than "cannonf.wav")
2. Or for some reason the TCB is sending the signal to fire the cannon at the same time it sends the signal to start the engine.

For #1, I would put the SD card into your computer and listen to all your sound files once again, just to verify that the cannon sound didn't somehow get named to something else.

For #2, examine all your function triggers in OP Config. Did you maybe link the "Cannon Fire" function to the "Engine Start" trigger by mistake? Did you maybe assign the "Cannon Fire" function to the same switch on your transmitter you are using to start the engine?

I checked all that options but did not see any suspicious user error (I also checked the radio switch reading on Opconfig everything works fine)


You can post your OPZ file if you want me to look at it.

Yes sir attached

There is something else I noticed in your video, which may or may not be related to your problem. I notice there is a delay of several seconds from the time you flip the switch on your transmitter, to the time when the engine starts. Do you know why that is?

Well I dont know what it is but realized I dont have to use the ignition switch teensy plays it anyway, its like a "startup" sound or IDK... Before that it doesnt play any sound.

By any chance do you have an engine "Preheat time" specified? (In OP Config on the Motors tab, under the Smoker section, when Type is set to "Separate Heat & Fan").
Dont have this LOV, maybe my OPConfig outdated? V.093.51 version installed. Please see the pic attached

On your SD card do you have a sound file called "preheat.wav"?
no sound file

EDITEDIT: no its not a soundfile. The tcb shoots after first startup (it uses the servo once and next action is cannon fire with sound and recoil)... :) strange.
EDIT2: similar with the latest OP app and latest TCB firmware
OP_motortab.PNG
Open Source Sound using Teensy 3.2 and PJRC Audio Library OP_motortab.PNG
Views: 434
*
OPsound_test.opz
(23.16 kB ~ Downloads: 168)

*

Offline LukeZ

  • 1241
    • View Profile
  • France
Re: Open Source Sound using Teensy 3.2 and PJRC Audio Library
« Reply #111 on: October 19, 2022, 04:52:58 PM »
Hi Rongyos, if I understand you correctly, the cannon fire happens when the TCB first starts. And this involves not only the sound, but also the recoil servo. If that is the case, then we can eliminate the sound card as being related to your problem, it is clear that the TCB is the one firing the cannon.

Plug your TCB in to your computer with a USB cable and connect to it with Snoop (on the Firmware tab of OP Config) to see what is happening. Does the TCB report a "Cannon Fire" event when it first starts?

I wonder if maybe you have Aux Channel 6 in Position 2 when the TCB starts?

I see you have Aux Channel 6 set to "Reversed" in OP Config. Maybe un-reverse it in OP Config, and reverse it in your radio's settings. You can also try changing the cannon fire function to a different aux channel.

I can't say what the problem is, but I am confident it is not an error in the code. Somehow the TCB thinks that the cannon should be fired, which implies that your radio is telling it to. You will have to do some more troubleshooting yourself. Even if you don't solve the problem right away, hopefully you can discover a piece of information that will help us solve the problem.
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline Rongyos

  • 44
    • View Profile
  • Hungary
Re: Open Source Sound using Teensy 3.2 and PJRC Audio Library
« Reply #112 on: October 20, 2022, 04:50:17 AM »
Hi Rongyos, if I understand you correctly, the cannon fire happens when the TCB first starts. And this involves not only the sound, but also the recoil servo. If that is the case, then we can eliminate the sound card as being related to your problem, it is clear that the TCB is the one firing the cannon.

Yes, thats the case. Maybe posts related to this issue should be replaced somewhere else, sorry. I didnt put servo on the first try and only heard the cannon fire so I assumed that the sound card is failed somehow.

Plug your TCB in to your computer with a USB cable and connect to it with Snoop (on the Firmware tab of OP Config) to see what is happening. Does the TCB report a "Cannon Fire" event when it first starts?

snoop results attached (on the second try I put the cannon fire switch to channel 16 on radio and there is no cannon fire function triggered anymore) please search for #####First try  and #####Second try keywords

I wonder if maybe you have Aux Channel 6 in Position 2 when the TCB starts?

I see you have Aux Channel 6 set to "Reversed" in OP Config. Maybe un-reverse it in OP Config, and reverse it in your radio's settings. You can also try changing the cannon fire function to a different aux channel.

I can't say what the problem is, but I am confident it is not an error in the code. Somehow the TCB thinks that the cannon should be fired, which implies that your radio is telling it to. You will have to do some more troubleshooting yourself. Even if you don't solve the problem right away, hopefully you can discover a piece of information that will help us solve the problem.

Yes this might be my radio. I recently updated the firmware on this because with the old firmware I could not manage to bind new sbus receiver I use for another TCB. I tried several receivers (Original is  Flysky i8a i-bus, others Radiomaster R191 Sbus and Radiomaster R168 sbus) whit get the same results. Its not related to radio protocols, I think its some failsafe or precheck stuff in the radio but I cannot figure it out myself (disabled preflight and so on but nothing helps). Regarding reverse / not reverse channel I could set this and except this startup issue everything works fine.

Regards
Rongyos

EDIT: I reload the min/max values and stick centers, not helping
OP_SNOOP_TEST.txt
(8.29 kB ~ Downloads: 184)
« Last Edit: October 21, 2022, 02:10:34 AM by Rongyos »

*

Offline LukeZ

  • 1241
    • View Profile
  • France
Re: Open Source Sound using Teensy 3.2 and PJRC Audio Library
« Reply #113 on: October 23, 2022, 02:07:20 PM »
Hi Rongyos. I looked at your snoop file. You're right, it is definitely something that is happening at the very beginning, when the TCB first makes a connection with the receiver. There are several functions it runs right away (MG Stop, turn the light off, set the volume) and these are what we would expect to see as it starts reading the channel values and applying the functions that you have set for your switches based on the position they are in (it is easy to see that you have your MG and light switches in the middle position). So everything is working as we would expect, but it also fires the cannon which means that it believes your cannon switch is in position 2.

I know you believe the cannon switch is in position 1. You can try this experiment: instead of starting the TCB with the cannon switch in the "off" position, put it in the "on" position and start the TCB. If the cannon doesn't fire, then it was just a confusion that can be fixed by reversing the channel.

If it fires no matter what, then it might be as you say some kind of failsafe setting. Maybe the TCB boots up faster than your receiver can create a connection to the transmitter. If that is the case, the first signals the TCB reads from the receiver are actually failsafe positions rather than the actual positions of the switches on your transmitter.

You could see what happens if you press the "Reset" button on the TCB. This will cause the TCB to reboot, but it will not interrupt power to the receiver. So your receiver will already be connected to the transmitter when the TCB starts. Does the cannon behave correctly then?

What software are you running on your TX16? If it is OpenTx, here is a video on how to set the failsafe values. I don't know if that is your problem or not, but you could experiment with it anyway. You will want to set the failsafe position of Aux Channel 6 to position 1, so that if the connection between the receiver and transmitter is lost, or hasn't been established yet, the cannon will not fire.
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline Rongyos

  • 44
    • View Profile
  • Hungary
Re: Open Source Sound using Teensy 3.2 and PJRC Audio Library
« Reply #114 on: October 23, 2022, 02:24:03 PM »
What software are you running on your TX16? If it is OpenTx, here is a video on how to set the failsafe values. I don't know if that is your problem or not, but you could experiment with it anyway. You will want to set the failsafe position of Aux Channel 6 to position 1, so that if the connection between the receiver and transmitter is lost, or hasn't been established yet, the cannon will not fire.

 Hi Luke! I get connected to OpenTX developers for TX16S and tried several tips. I think the new firmware on radio is messed up something or makes a "preflight" test.

Anyway I managed to solve the problem with raising the offset of the cannon fire channel (it is a toggle switch) to the middle (like a middle position of a 3pos switch) and no cannon fire on startup but when I activate it it works fine.

regards
Rongyos

*

Offline LukeZ

  • 1241
    • View Profile
  • France
Re: Open Source Sound using Teensy 3.2 and PJRC Audio Library
« Reply #115 on: October 23, 2022, 02:34:01 PM »
That is a clever solution! I'm glad you succeeded, even if you had to do something unorthodox.  ;)
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline Rongyos

  • 44
    • View Profile
  • Hungary
Re: Open Source Sound using Teensy 3.2 and PJRC Audio Library
« Reply #116 on: December 12, 2022, 11:02:25 AM »
Hi Luke!

I made a soundset for KV-1 (only engine). How can I share with the community?

regards
Rongyos
*
KV-1 ENGINE SOUNDS by Rongyos.rar
(5512.6 kB ~ Downloads: 152)

*

Offline LukeZ

  • 1241
    • View Profile
  • France
Re: Open Source Sound using Teensy 3.2 and PJRC Audio Library
« Reply #117 on: December 13, 2022, 08:36:23 AM »
Thanks Rongyos, it sounds really good! I posted them to the GitHub where anyone can download them.
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

*

Offline Rongyos

  • 44
    • View Profile
  • Hungary
Re: Open Source Sound using Teensy 3.2 and PJRC Audio Library
« Reply #118 on: May 25, 2023, 08:59:32 AM »
Hi Everybody!

Can you recommend a cheap RFI/EMI filter for my homebuilt sound card? In lower volumes I hear annoying buzz or high pitch noise and if I put my tx closer to the device a buzz going crazy. Maybe I need shielded cable for the speaker? Can I make it better with shielded cable?

Thanks
Rongyos

*

Offline LukeZ

  • 1241
    • View Profile
  • France
Re: Open Source Sound using Teensy 3.2 and PJRC Audio Library
« Reply #119 on: May 25, 2023, 10:10:19 AM »
I'm afraid I don't have a suggestion, the fact is I am not too experienced with sound circuits even though I designed one. Hopefully someone else will have a suggestion. I think this is definitely an application where it helps to have the components on a board and a DIY one with lots of wires will certainly be susceptible to interference.
NO SUPPORT THROUGH PM - Read why
Need a forum account? Read here
Open Panzer FAQs

 

bomber-explosion