vedderb / bldc

The VESC motor control firmware
2.16k stars 1.35k forks source link

Startup music tune function #324

Closed supercrazysam closed 3 years ago

supercrazysam commented 3 years ago

As mentioned in the title.

Many commercial BLDC ESCs produce a start-up tune. Have anyone tried this on VESC? Would like to know more on this.

Probably will implement it once figured out.

Sam.

surfdado commented 3 years ago

VESCs don't have any built-in beeper/buzzer so this is not possible without a hardware change or the addition of external modules

Addy771 commented 3 years ago

@surfdado it's possible without any hardware changes, only software. Modulating the PWM frequency would work, think about the sounds VESC makes during motor detection or the beeps that hobby ESCs make using the motor.

surfdado commented 3 years ago

The sounds I hear on my drone and other ESC based devices come from the motor? Not the ESC? I had no idea

Addy771 commented 3 years ago

Yeah. There was a video I saw a couple years ago where someone had programmed the ESC for their scooter's brushless motor to play music as it powered the scooter along. I can't seem to find the video now, but I would love to see this kind of feature in VESC.

supercrazysam commented 3 years ago

The sounds I hear on my drone and other ESC based devices come from the motor? Not the ESC? I had no idea

I think so.. in the past I am just not quite exactly sure how they do it, I saw people use stepper motor+driver to produce music tunes, there are some people did that with bldc motors+driver as well

supercrazysam commented 3 years ago

My guess is controlling the motor to produce vibration frequency in audible range?? Does anyone have a idea how they actually do it?

So just controlling PWM frequency to audible frequency range will do it?

arpan0193 commented 3 years ago

Maybe add some soundwave signal to the reference signal?

On Thu, 5 Aug, 2021, 6:45 pm Sam Shum, @.***> wrote:

My guess is controlling the motor to produce vibration frequency in audible range?? Does anyone have a idea how they actually do it?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vedderb/bldc/issues/324#issuecomment-893450602, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIVF7UZWGJXX6BTOGD6OP2TT3KFHFANCNFSM5AWPO3WQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

hexakopter commented 3 years ago

There was a video I saw a couple years ago where someone had programmed the ESC for their scooter's brushless motor to play music as it powered the scooter along.

I think you are talking about this video: https://www.youtube.com/watch?v=7BQ9lei_24Y You can also read a little bit about it on Shanes website: http://scolton.blogspot.com/2010/12/midi-scooter.html

There was also a request on the vesc-project website for a "beep" implementation a few years back. (https://vesc-project.com/node/647) Maybe with the recent HFI implementation some fundamentals are build into the VESC code that can be used to utilize the motor as a speaker more easy.

supercrazysam commented 3 years ago

Guys I found out how to do it. Just set the switching frequency to (audible frequencies).

Just very quickly tested it on FOC with different switching frequency

Currently writing a prototype to test out the beeping function. :D

supercrazysam commented 3 years ago

Just submitted a pull request on this, it works really well.

Unfortunately I don't have my phone right now, I will upload the demo video once I return home.

supercrazysam commented 3 years ago

Here is the video (using a small drone motor): [Outdated, video from yesterday, please refer to the new video] Demo here

supercrazysam commented 3 years ago

Updated version from #328 : The motor does not move anymore when playing tunes.

Demo Video (small drone motor): Demo here

Demo Video (6" inch direct drive scooter motor): Demo here

supercrazysam commented 3 years ago

Based on the pull request #328 I made earlier, I was able to made a VESC startup tune prototype. This is the result. Demo here (I tested and it worked on both small drone motor and my 6" direct drive scooter hub motor.)

I will wait for Benjamin @vedderb to review/approve #328 first, make necessary changes (if any), then submit this completed startup tune feature as another new pull request.

Right now I uploaded the prototype and opened a draft pull request #330

Also, since "startup tune" will be a general feature, I will do more testing on it first. Will also add options for enable/disable startup tune.