-
plane integration and propeller synchronization
10/24/2024 at 12:16 • 0 commentsMustang plane integration
To integrate the sound machine into the Mustang plane we glued an epoxy plate into the cockpit and the exciter was glued on this plate.
The cockpit cover, being as well made with epoxy and fiber glass, acts as a resonating chamber.
Then the sound machine is hidden into the plane and ready to run
And we discovered that the propeller was starting to rotate too quickly before the start sound of the engine was played...
So I made a small modification into the code to handle this behavior :
- start the "start sound" as fast as possible before the propeller is rotating
- start the "stop sound" when the propeller is still rotating
The specification is easy but the implementation needs some tricky modifications into the code...
We have to introduce 2 new thresholds into the code, let these tresholds accessible for tuning and compute the "derivative" of the throttle to know in which direction we move the throttle stick...
the "start" and "stop" thresholds are parameters that you can modify as usual: use a serial link to your ESP32 and type this command:
- STA=20 (or Sta=20 or sta=20) to set the start throttle to 20 (value between 0 and 200)
- STO=80 (or Sto=80 or sto=80) to set the stop throttle to 80 (value between 0 and 200)
And here is the result with the mustang plane :
-
Add a Stuka siren to your plane !
10/09/2024 at 08:46 • 0 commentsIn the default implementation of the firmware, the sound files are located into two different folders selected by the "gun switch".
Why not adding a third folder to embed the siren sound of a "Stuka" warbird.
This was an easy modification of the firmware!
now 3 folders :
- 00: motor only sound at various speeds
- 01: motor + siren (at various speeds)
- 02: motor + siren + gun (at various speeds)
Of course you will need to decode the "gun" channel at three states instead of two to address the right folder. And that's it.
Here is the zip file contaning the sounds : siren sound pack
Firmware is also modified to accomodate both sounds packs. to select siren use a serial link to your ESP32 and type this command:
- SIR=1 (or Sir=1 or sir=1) to activate the siren option
- SIR=0 (or Sir=0 or sir=0) to desactivate the siren option and stay with "motor+gun" files
-
change sound volume
10/09/2024 at 08:32 • 0 commentsif you want to change the sound volume you have several options :
- use a receiver channel
- use default value
- set it with the serial USB cable
change volume with a receiver channel
This is probably the easiest option:
connect a receiver channel on the pin "vol" of your board. Then you can cahnge the volume with the potentiometer of your radio; Easy
use the default value
If you do not connect the Vol Pin to a receiver channel, this is detected by the ESP32 and it will set volume to the latest received value.
To be sure to keep the latest value you should remove the power to your board (VCC pin) while the radio is stiff on and conencted to "Vol" pin
set volume with the serial link
You can use your smartphone to connect it to the usb port of your ESP32 (with an OTG cable) or to the Serial port of your PC with a regular USB cable.
Then ope a serial terminal. It can be the arduino IDE on a PC or the excellent Serial USB application on your android phone.
Then enter the command : Vol=xx or VOL=xx or vol=xx with xx between 0 and 30 to setup the default volume.
-
Struggling with DFPlayer
10/02/2024 at 10:09 • 0 commentsMy first idea was to use the DFRobotDFPlayerMini Arduino library. But I quite soon discovered that my DFPlayer was not a genuine one ...
I got the bad error message at startup :
Unable to begin: 1.Please recheck the connection! 2.Please insert the SD card!
Looking at the Audio chip on the back of the DFplayer I found a reference which was not the genuine one
I ordered this one
I got that one:
Well... After searching on internet I found the datasheet of this TD5580A chip... but in chineese !
So I translated this document with the help of Google Translate. And I got a readable document : TD5580A datasheet
I carefully read this document and found that it was the same as the original one excepted the end byte of the frame which was said to be 0xEE instead of 0xEF.
Original:
TD5580A:
Unfortunately it was a mistake into the Chineese datasheet... End byte is actually 0xEF as with the original chip.
So after digging into the DFPlayer serial output I finally discovered that this clone was sending an error message after receiving a chip reset command :
Of course this 0x7E error code was not documented into the datasheet nor implemented into the library!
So I finally decided to skip this error and to write my own code as the protocol was quite simple and as I didn't need all the commands offered by the DFrobotDFplayerMini libray...