Beeping
The controller can generate sounds by vibrating its motor coils. It can play melodies using its onboard synthesizer.
Synthesizer features (ESCx)
- The sound generation produces best results with PMSM motors (with permanent magnets).
- The sequence pattern was designed to minimize producing torque or movement, although this may sometimes happen (particularly during low notes).
- By default, the driver will allow to generate sound only if the motor is standing still to prevent any unwanted torque generation.
- On request, siliXcon can enable run-time generation (modulation of sound onto the active motor control) for your application.
- If the motor is back-driven during a melody playback, the sound generation will stop until the motor becomes still again.
- The generation is not dependent on the knowledge of the rotor position and works even when sensor malfunction is present.
- The volume is derated by protections and limiters.
Sequencing
This section is common for all siliXcon devices equipped with audio output.
While the application typically handles the sequencing, you can test sounds or create your own melodies using the following commands. These melodies can later be incorporated into your application.
beep [note] [length] [modulation]
note
- note (same notes as used inplay
)length
- default value is 100 time quanta (if not specified)modulation
- the modulation parameter (optional)
Notes
Note values range from 1 to 253.
Basic notes:
Note | Note number |
---|---|
C1 | 46+0 |
C1x | 46+1 |
D1 | 46+2 |
D1x | 46+3 |
E1 | 46+4 |
F1 | 46+5 |
F1x | 46+6 |
G1 | 46+7 |
G1x | 46+8 |
A1 | 46+9 |
A1x | 46+10 |
H1 | 46+11 |
C2 | 46+13 |
Modulations
Amplitude modulation (exponential envelope):
Modulation | number |
---|---|
DECAY 0 | 0 |
DECAY 1 | 16 |
DECAY 2 (default) | 32 |
DECAY 3 | 48 |
The high bits of the modulation affect frequency modulation. Feel free to experiment!
play [song]
Usage:
- Three predefined songs are available. Play them using:
play 0
,play 1
orplay 2
. - Play your custom song
play
- (without an argument) will stop actual sequence.
How to create and play a custom song
You can create an array variable using YOS scripting:
# Create array variable for your sequence. This can store 10 commands for the synthesizer.
var song.20 uint8
# Fill-in the variable with the sequence. Each command consists of two bytes: length (in time quanta) and note number (do not put spaces between numbers).
set song 8,47,8,48,8,49,8,50
# Play the song!
play song
Set the modulation envelope (timbre)
Use the value 255 for length to indicate a modulation set command. The following value will be interpreted as a modulation set command.
set song 8,47,8,48,255,16,8,50
# Order: length1, note1, length2, note2, 255, modulation = DECAY2, length3, note3
The modulation setting persists until changed.
Change volume in song
Use the value 254 for length to indicate a volume command. The following value sets the volume (range: 0-255).
set song 8,47,8,48,254,128,8,50
# Order: length1, note1, length2, note2, 255, volume = 50%, length3, note3
The volume setting persists until changed.