Changing FOC Switching frequency

The main reason for decreasing noise, at least for my motors the default 20 kHz make almost the same noise as BLDC, at 30 kHz is dead silent

The ESC is like 99% efficient already. Not much to gain here. If the entire system is not totally perfect optimized, there is no need to talk about slightly optimizing the switching frequency.

Question is: how far to the edge of the theoretical output performance do you want to go. If you hardly ever push the ESC to its limits it will stay very cool all the time. If you push to the limits, better cooling will have the biggest impact on efficiency and losses.
Strap a VESC 6 to to 5Kg of alluminum and you can push 120A continuous all day long. If you are not completely off the ideal frequency, we are talking point x gains or losses. Benjamin is the expert, he will be able to give good advice and further explanations. Standard settings work a treat for nearly all bldc outrunner motors used in skateboards.

Then run it like that and see if it impacts temp and range. If not, you have a silent efficient board. Benjamin also plays around with it a bit.

1 Like

Currently the major driving cost of the VESC is the FETs, they have to be high performance. I agree it is 99% efficient in most cases, that isnā€™t the point. The point is that during high power draw 1% is a lot of heat. If you decrease that 1% to 0.5% it saves you basically no energy at a system level, however it does mean that half the heat will be generated within the VESC. Suddenly you donā€™t need to strap it to a giant aluminum block for high power, or use more expensive/larger quantity of fets to push the same amps. The relative efficiency gains within the vesc can go a long way toward reducing its own cost/mass/physical footprint/ longevity due to high operating temperatures. I would never discourage people from analyzing what parameters can impact the efficiency of this system.

4 Likes

Sure, thatā€™s exactly why you want to overrated your ESC. It stays cooler and is more happy on the long run. The more you design it to the edge, the more it will suffer from heat if cooling is limited. If your average Amp draw is low, the .x % doesnā€™t matter so much. If you drain a lot all the time it becomes more relevant. Iā€™m not saying itā€™s not worth to experiment! There is definitely less efficiency if you go for higher switching. I personally enjoy the silence. If it matters in reality, for your setup, can be seen after doing some rides and comparing temp and Wh usage per km. Pull out your phone and read the data. As long as Mosfet temp stays reasonable low you are good. The range will probably not be affected a lot.

I agree range will not be impacted significantly. Higher switching frequency can in theory result in higher efficiency for certain systems, but switching losses will increase. Switching losses are generally not dominant for the regime we are operating in, my tests have shown Rds on is a much more relevant player in the losses for the vesc scale systems.

If there is something funny going on with bad sample timing etc. at switching frequencies which are not the default 20 kHz it would be very useful to identify and fix any small oversight here. Many people would prefer to run 25-30kHz for quieter operation, and simply writing it off saying what we have is good enough isnā€™t the spirit of this forum.

Something like an assumed timestep not being updated in one of the estimators could be culprit. I will be keeping an eye out to see if I can spot any funny business next time I go through the code.

4 Likes

Itā€™s simple: you trade noise with heat. If your ESC is very beefy (relative to the system), it doesnā€™t matter so much, if itā€™s designed to the edge it starts to matter. Simple to find out with a reality check monitoring the temps. Some people ride with PU wheels on tarmac in flat areas, other do hard-core offroad riding in the mountains. Average Amp draw is totally different. Benjamin has implemented all the RT data, so itā€™s easy to see what happens if you change values. Just change the value and have a look what happens. Share your experience - nothing is written off.

If only life were so simpleā€¦ the way you describe it is wildly over-simplifying the problem. As Iā€™ve said many times some motors will operate more efficiently at higher switching frequencies. Especially larger motors with lower resistance or ironless stators with less inductance. If making ESCs efficient was so simple it wouldnā€™t have taken somewhat as smart as Vedder to tackle it in the first place. There are MANY factors contributing to what switching frequency is most efficient, we shouldnā€™t see 20 kHz always being the best like his data is showing. Also if your statement was correct than why isnā€™t 10kHz more efficient? Think a little.

I can guarantee you also that things are sometimes written off. There is no shunt resistor on the input of the vesc so measurements of input current are back calculated from applied motor voltage and measured motor amps. These measurements arenā€™t always accurate for various reasons. Stop acting like the business man with a blindfold on pretending your product is perfect and think like a researcher asking, what possible variables could be contaminating the results?

3 Likes

So i did start a post about my data over on the official vesc forum, and no one seems to have noticed or commented. Please point vedder at this thread or that one. Iā€™d be interesting to hear his take. I do think there is likely something in the firmware thatā€™s assuming 20khz switching, and when you change the value, things donā€™t line up like they should. Lots of code, and i donā€™t really wanna rake through it all if i can avoid it.

Trampa, my application is not skateboards at all, so the talk of whole system efficiency doesnā€™t translate. I have other efficiency losses in my project (solar panel I-V curve, and propeller design/optimization). Iā€™m racing a solar powered boat, and every last percent matters with limited power (iā€™m lowering the oil viscosity in a planetary gearbox tonight to increase efficiency at a loss of lifespan, for instance). The reason i stumbled into this data showing 20khz is preferred is by attempting to squeeze a couple more percent from my system. If race day was tomorrow, iā€™d run it at 20khz. If we can figure out the issue, iā€™ll run the ideal switching frequency for my chosen motor and perhaps pick up a percent or two.

Also, itā€™s just interesting to investigate and understand systems. If there are bugs, we need to identify and squash them. If this is an issue with my methodology (it could be), then i wanna know where and how, so i can get better data. For most of folks, none of this matters. It doesnā€™t really matter to me either, in the end; who cares about a stupid boat race? But the knowledge and process is valuable.

3 Likes

The ESC is like 99% efficient already. Not much to gain here. If the entire system is not totally perfect optimized, there is no need to talk about slightly optimizing the switching frequency.

The thing is, from my data, it seems like up to a 6% difference in peak vesc+motor efficiency changing from 20khz to 18khz. Thatā€™s pretty significant. Not sure if that is going into the motor, or the vesc. If the motor can handle it, it should be more efficient at 18khz, not less efficient, so i presume the extra loss is in the motor.

I would just like to add, if you use VERY large motors, such as hoverboard hub motors, there is a significant difference in upping the switching frequency from the default 20khz to around 28-33khz, both in noise and no-load current draw. If I tried switching frequencies above 35khz, there was a faint high pitched whine coming from the motors.

If you are using default hardware, increasing the switching frequency will actually generate significantly more heat since International Rectifier MOSFETS have literally the worst gate charge characteristics in the industry, resulting in excessive switching losses. Above 30khz, the drv830xā€™s charge pump actually canā€™t keep up with the current draw at those switching frequencies. Gate drive voltage starts to sag and you get excessive conduction loss added to the already terrible switching losses.

Since most hobby motors (5065, 6374, etc.) run fine on trapezoidal control since they are high speed bldc motors (with concentrated windings), changing the switching frequency in field oriented control for those motors often has little effect unless you go below 15khz or above 40khz (in which case the effect is negative).

If you are using larger motors such as hub motors, or a proper PMSM with distributed windings, higher switching frequency is usually better, up to a point. At excessively high frequencies, switching losses will generate excessive heat, resonance and other phenomena start screwing with your motor, and gate drive voltage will sag too much and trigger UVLO.

2 Likes

If I tried switching frequencies above 35khz, there was a faint high pitched whine coming from the motors.

35khz is above human hearing, what whine would you be hearing? Where would it be coming from? What frequency sound? Edit: Perhaps harmonics at the resonant frequencies of various mechanical stuff in the motor would be within the audible range. RPM would shift this into/out of the resonant range though, so itā€™d only be audible at certain frequencies.

changing the switching frequency in field oriented control for those motors often has little effect unless you go below 15khz or above 40khz (in which case the effect is negative).

iā€™ve got a 6% system loss at peak efficiency from two different motors (same controller) going from 20khz to 18khz and 19khz. Thatā€™s not a ā€œlittle effectā€. The motors are similar form factor, same kv rating, different pole counts however.

It was a sub-harmonic in range of 15-20khz, very faint and high pitched, very similar to the whine you would hear from a grid-tie inverter.

Your motor was 100KV, which is reasonably low-speed for switching frequency to have an effect. I was talking about motors that have KVs in range of 200 or even higher. Also, I have a sneaking suspicion that the measured lower efficiency is firmware related, either in inaccuracies in the values reported or something else. The reason why I believe the cause is firmware bugs is because if you run fast decay in BLDC mode, the VESC says that motor draws significantly more no-load current compared to slow decay; HOWEVER, I built my own motor controller from scratch, tested both slow decay and fast decay, I got exactly the same current draw at the same speed (measured current draw using a bench supply).

What would you consider as a bigger motor?

Iā€™m trying to eliminate all unnecessary heat from my build as much as I can so I am able to shred as hard as I can without getting throttled or damaging any components.

Does the switching frequency actually make a big difference in motor sizes such as 6374 and at around 200kv?

Also my focboxes would not have any airflow so keeping it cool is a priority too.

Itā€™s definitely a 2nd order sub harmonic at 15 kHz when running at 30 kHz

@12meterkuk should be, try it and see, maybe some motors dampen the harmonics better, on small 5055 motors

The efficiency part is exactly what we are trying to find, for now we donā€™t know if the measurements taken by the vesc taken at anything other than 20 kHz are valid

Less efficiency means more heat right? Iā€™d say run the motor on a dyno at a constant currant for a bit and see how hot it gets both motor and vesc after a set amount of time using different frequency

Problem is I already disassembled my makeshift dyno :frowning:

1 Like

Would be better if someone knows how switching frequency actually affects different motors (kv, resistance, size, inductance, etc) so Donā€™t have to spend so much time diagnosing each frequency

1 Like

Ok, ok, ok! Iā€™m almost done integrating real voltage and current sensing into the system. Iā€™m keeping the vesc data too, so two plots can be done one top of each other, comparing the measurements. Got a little more code to go, but gotta take a break, get groceries, and that kinda real-world interference :slight_smile: Initial results show my current sensor swinging around a bit more, but i have a filter cap getting it down to 1khz bandwidth now. Only really taking measurements at 10hz though, so a little more filtering is likely in order. Maybe iā€™ll plot what i get after the 10 sample averaging and see whatā€™s up before changing the cap.

2 Likes

Nice work man, excited to see the comparison. Will be awesome to have a better idea how accurate the vesc measurements are.

1 Like

Yep, thought itā€™s likely a toss up as to which is more accurate/true. Theyā€™ll both be off to some extent. It may just confuse matters. I really hope not though. I kinda expect to see the measured numbers stay roughly where they are for 20khz across other switching frequencies, indicating something assumed in the firmware that shouldnā€™t be assumed. Time will tell.

Also, another upshot of making the driven motor esc agnostic (which it will be after this if i write power limit control code for PPM control) is that other controllers can be tested with the same motors. Comparing hobby escs will be interesting. Maybe iā€™ll grab an o-drive as well and see how that stacks up? Itā€™s designed for a different application, but iā€™d be interesting to know.

1 Like