Brushless motors and FOC, questions and possible misconceptions - Page 1
Forum section: electronics / projects

author: Infraviolet
author_rank: Super Contributor
timestamp: February 02, 2024, 09:34:55 pm
content: I've been looking at how to drive BLDC motors and came across a few things I hoped to clarify, or which I may have misunderstoo, can anyone make suggestions on these matters:Thanks1. Space Vector Modulation and Third Harmonic InjectionBecause it isn't possible to PWM to >100%, when one uses PWM to generate 3 normal sine waves 120 degrees out of phase, the difference between the highest and lowest of the waves can only get to a peak of about 86% of what it could be. So SVM/3rd harmonic injection is used to shift the three signals up an down a bit such that their difference is still a clean sine function, but now the difference peaks at 100%. Does the shape of the 3rd harmonic injection function actually matter? I've played with some graphs and had a go at injecting both sine functions (at 3 times the frequency of the main sine) and triangular waves (again at riple frequency) as additions to the original sines, the resulting curves for the 3 phases are diferent shapes depending which function I inject, but the differences are the same. Is there any reason for one choice versus the other when deciding whether to add a 3*freq sine function or add a triangular wave approximation of this sine function? Also, is it expected that max(of the three phases)-min(of the three phases) still displays the same torque ripple pattern after SVM/3rdHI as it does when normal sine waves are used, just that this pattern has been shifted up so it peaks at 100% rather than 86%?2.Open loop stallingI've found that, when running at relatively low winding currents initially, the motor can be brought up to significant speed by gradually ramping up the frequency of the sinusoidal signals fed to its three wires, with the motor holding a location at a chosen electrical angle if the frequency is then taken to zero. But I also find that if the motor is started immediately with a medium or high frequency signal, it will only vibrate. Also after an application of sufficient torque to stall it at high speeds, the motor simply vibrates, unless the frequency of the input sine signals are lowered then gradually ramped up again. Is this inability to start at full speed related to some effect whereby a quickly commutating sine signal doesn't spend "long enough" at a given angle for its field to "catch" the rotor and start it moving? Will this behaviour improve, in terms of a much higher maximum sine frequency for starting motion (above which the rotor only vibrates), when I start driving at higher currents? Is there any open-loop solution to being able to start the motor moving at any arbitrary speed and resume after a stall without having to ramp the sine frequency right down to near zero then back up again? I would assume that when brushless motors where first invented by Tesla for industrial use, driving a BLDC siunsoidally is surely exactly equivalent to his 3 phases AC motors, just lower voltages, that they had ways to start them without relying on either automated electronic position feedback (nearly impossible with that era's technology) or on having a man watching the motor on startup and gradually turning a handle to ease it up to full speed (even that being not entirely feasible as the 3 phase AC would have been fixed frequency from a generator)? Or is this something I won't be able to tackle until I set up some sort of position feedback? The usual "sensorless" BLDC method of feedback would appear impossible here, as all three wires are being actively PWMed with sine signals, and even the higher speeds I'm reaching probably aren't enough to generate a worthwhile EMF which could then be measured if there were an unused winding.3.Field Oriented ControlSo the idea is to specifically control where the vector of the field generated by the currents in the windings points, and how this relates to where the field of the magnets in the rotor is aimed. Maximum torque is achieved when the field of the windings is 90 electrical degrees ahead of where the rotor is, and no torque is achieved when the winding and rotor fields are at 0 degrees apart. FOC works to keep the windings' field 90 degrees ahead of the rotor, whereas sinusoidal driving works to have the rotor pointed to the windings' field direction? When you want to hold position or move at a specific speed with sinusoidal driving you just set the windings' field to be where you want to, or advance at the rate you wish it to. But to get more torque in FOC you're pointing the winding's vector to where the rotot is not. This means that, under FOC, holding a position providing maximum torque won't be feasible when fighting against smaller shaft loads than the max torque? The rotor will try to move towards the winding's vector, you'd be having to switch back and forth the winding vector constantly between 90deg ahead and 90deg behind the rotor so as to hold a location? Does one then achieve a holding position by initially aligning the winding's field with the rotor's field, and then advance the winding field's angle until it is sufficiently many degrees ahead of the rotor to provide precisely however much torque is need to hold shaft position against whatever the present load is? Also, when trying to move at a selected speed with FOC, if one keeps the winding's field always 90 degrees ahead of the rotor's field, won't this lead to a runaway speed increase until you encounter some practical limit in the system, and the speed will stabilise only at that maximum? How then does one specifically move at a chosen speed below the maximum whilst keeping the windings' field 90 degrees ahead of the rotor? To my understanding FOC is never possible without some sort of angle sensor for the rotor. Are there specific practical requirements about the form this angle sensing must take? Does it have to be an absolute angle, atleast absolute as far as the electrical degrees are concerned, or can incremental tracking do well enough? For incremental encoding is a known starting position, a one-per-rotation zero point or example, always needed? Are three hall latches enough? They would be positioned so as to produce 3 square waveforms in 120 degree separation for each electrical rotation of the rotor, for an outrunner motor it would seem easy to loce them where the rotor's own magnets will provide the magnetic field neede to trip the latches either way. Or is greater precision in the angular measurement necessary?Thanks

author: MarkT
author_rank: Frequent Contributor
timestamp: February 03, 2024, 09:02:03 am
content: 1) no, a triangle wave works just as well and may be easier to generate.2) Failing to ramp the frequency is going to greatly reduce performance, basically you should always commutate a BLDC, not treat it like a mains induction motor!Sensorless BLDC's have a problem - you can't commutate at low speeds (using back EMF sensing), so they don't work well at low speeds, and starting is done open loop - this is OK for a propellor or fan as the load is low at low speeds.3) I don't think you quite have it - FOC will typically use angle feedback to ensure the torque supplied matches the torque needed, so the field is always at 90 degrees or 270 degrees with a magnitude to match the torque requirement for a BLDC. Any other angle wastes power in the windings and isn't useful. For multiphase induction motors you have to use other angles to build up current in the rotor though.

author: jbb
author_rank: Super Contributor
timestamp: February 04, 2024, 12:00:56 am
content: My 2c worth:2: a ‘sensorless’ BLDC drive is doing back EMF measurement (in an indirect way). As MarkT said, this doesn’t work at low / zero speed. There are some fancy systems out there which can find the rotor using ‘saliency’ I.e. the small imbalance in winding inductances caused by the rotor flux. Holtz et al have demonstrated sensorless position & speed control at zero speed using this approach.As it comes to a motor which is already spinning, there are algorithms which can ‘catch’ the motor on the fly. But I’m not familiar with them.3: to clarify; you control the torque by adjusting the currentmagnitude. So you reduce the current (and thus torque) as you approach the desired speed.

author: Infraviolet
author_rank: Super Contributor
timestamp: February 05, 2024, 11:55:25 pm
content: Thanks,"fancy systems...small imbalance in winding inductances caused by the rotor flux" I guess that probably works with high quality BLDCs, but with cheap basic ones I wouldn't be surprised if there are already differences enough between the windings from construction imperfections alone to overwhelm and ushc effects. I guess I'll be fitting hall sensors pretty soon. For outrunner motors this seems easy so long as the motor's outside is not iron-like metal (a lot seem to use some finely corrugated black plastic), as you can just place hall latch sensors externally to sense the rotor magnets. For those with "back iron" outer drums around the rotor there's virtually no field outside it to sense, so I'd either need to fit some tiny magnets in a ring nearby (in phase to match those of the rotot I guess, same number of pole pairs), or try mounting the hall sensors near the gap between the rotor and the base of the stator. There is mechanicalspace enough to do this, but I suspect a hall sensor here might be prone to being overwhelmed by the mag fields generated in the stator*, rather than tracking the rotor's magnets for you?*so it would always see that the ield had commutated even if the rotor had stalled?Now for some good news: Controlling current magnitude has turned out to be much easier than I feared. PWMing each phase to keep the current at a desired level seems to be just a matter of multiplying the results of the sine(angle)+(0.15)*svm(3*angle) value for each phase with a small n value, where n>0 and n<<1.But the half-bridge drivers I'm presently using (BTN7960) only respond to an input PWM pulse if it is longer than several microseconds (how much longer a minimum is needed seems influenced by the value of the slew rate resistor), so I can't PWM at greater frequencies than about 7.8KHz**. At >7.8KHz, for the proportion of time I want to spend with the half-bridge being connected to the power voltage (12V) (the rest of the time being low and letting current in the BLDC slowly decay while recirculating), the time I want to spend high becomes <several milliseconds per 125us cycle. Ought I move to some sort of MOSFET solution, or an alternative half-bridge chip, which can pulse a connection to the high voltage for submicrosecond times?**ATMEGA328P as PWM generator and doing the sine(angle)+(0.15)*svm(3*angle) calculation to control commutation by varying the angle as slowly or quickly as desired, the only PWM frequencies I can generate seem to be be 62.5KHz, 7.8KHz, 1.9KHz and downwards. No intermediate between 7.8KHz and 62.5KHz available, 7.8KHz works but the ratio of the current spikes height to the current level at the end of the decay is big, 62.5KHz wouldn't let me have long enough (>several us) high periods when having the high, even when sine(angle)+(0.15)*svm(3*angle)=1, period be only a small fraction of a cycle.The current waveform in each leg of the BLDC takes the form of a very sharp rising spike (when the half-bridge is high) up to as high as say 10A, then a decay down to <1amp before the next cycle. I am convinced of the accuracy of these spike and decay measurments as they come from putting a scope probe and grounding clip across a 0.05ohm shunt resistor (sold with a 5% tolerance) between a motor lead and its associated BTN7960. I can get the sort of averaged currents I want on the order of 3A, and can go higher or lower by varying the amount high time. At 8KHz I can hear a whine from this. I guess a sharply varying current and this whine is "healthy" for BLDCs? There's no brushes, so nothing to damage by high current spikes or by audible vibration so long as the averaged current is not so high as to cause damaging heating?Also, is there any easy way to make a few one-off measurements of tiny resistances accuratelywith the kit I have to hand right now? Just to get a better feel for what parasitic resistances might be within the loops around which current recirculates before I start transferring the breadboard*** design to a PCB design. I've plenty of multimeters to hand, but none with any worthwhile ability to measure things below 1 ohm. I'd like to make some measurements of a resistance I expect to be <0.9 ohms to an accuracy of +/- 0.02 ohms. I have:High wattage low value current shunt resistors to hand,low power NPN/PNP BJT transistors,normal resistors, caps and inductors in all the usual sizes.Plenty of multimeters all with ohms, current and voltage measurments.Plenty of atmega328p microcontrollers, standalone and on arduino boards.An oscilloscope, but only with normal probes, not current probes.No linear regulators to hand.No purpose built current sources to hand.A few sets of crocodile clip test leads.Lots of sets of spiked point test leads, some of which I'd be hapy to cut up or solder to if it could make a good milli-ohm metering tool.***yes seriously, I've been breadboarding at several amps, I know it is wasteful of power, but for initial testing it still helps to able to swap things around quickly. And it has been working well enough to prove the principle. I know there will be "major" (as vs the 50m ohm deliberate shnts on each motor leg) extra resistances added by wire-rail and other breadboard contact related things, I'd like to quantify them. And I'd like to quantify the motor's internal resistance too, all the meters I have will tell me is "0 ohms", which could mean anything from 0.9 to actually 0 ohms.Thanks