You are incorrect. Induction machines are often used as generators. My employer uses them almost exclusively in the generator configuration. The Lorentz force is symmetric; in the generator mode of operation the magnetizing flux vector leads the torque-producing current vector instead of lags, but the physics still works the same.
The induction torque speed curve is also very performant even when compared to PM machines so I don’t understand your criticism. Source: motor control engineer.
You can use an induction machine as a generator, but it has to be connected to the grid. It will generate reactive power. You need a rotor field to generate power. In a permanent magnet machine this field comes from the magnet, but in an induction machine this comes from the motion of the stator field (Lenz' Law).
To maybe put it another way, there is no way to charge a dead battery with an induction machine.
> You can use an induction machine as a generator, but it has to be connected to the grid.
That's not true.
> You need a rotor field to generate power.
Residual magnetic field is enough to start the process, absent that a quick DC zap will do.
> In a permanent magnet machine this field comes from the magnet, but in an induction machine this comes from the motion of the stator field (Lenz' Law).
Yes. Fortunately rotors retain a bit of magnetism after you run them to a stop, which is enough to get things going again later on.
> To maybe put it another way, there is no way to charge a dead battery with an induction machine.
Yes there is, unless the induction machine is fresh from the factory and has never run at all.
The rotors of induction machines are usually copper, which is not ferromagnetic and will not have any remanent magnetization. In practical terms it is not feasible to "bootstrap" an induction machine in the way that you describe.
You're simply wrong. Again. The rotor windings of induction machines are usually copper or aluminum, the stator windings are usually copper.
As for the rotors and stators themselves, they are good old iron/steel laminates and will hold some magnetism just fine (they're laminates to cut down on the eddy currents). If the rotors themselves would be made out of copper the motor would not function at all, it needs a ferromagnetic part there to focus the field.
Source: have done a number of induction motor to windmill conversions. Also: have you ever tried any of this or are you coming at this from a theoretical angle?
Well, there was that time when I was getting an EE degree where I asked my drives professor if I could use an induction motor as a generator, and that's the response he gave.
With all respect for your professor, you could of course simply try rather than echoing words from long ago.
Fortunately not everybody will take 'it can't be done' as the final answer :) It's not what can't be done in theory that matters but what can be done in practice.
If you battery is dead and your engine isn't running, isn't the battery the priority anyway? Having backup batteries to provide initial excitation for generators should not be difficult. They just need to start it, afterwards you can use the output for self-excitation. Worst case, you'd just use a tiny PM generator to bootstrap the process.
I think there are other more significant trade-offs between induction and PM motors. Induction motors/generators are significantly heavier, and have significantly lower torque (i.e. can extract less lower at low speeds when used as generator). Their main attractiveness comes from lower cost, reliability, and decent efficiency at high speeds.
I stand corrected about not being able to use induction motors as generators, still
As per wikipedia
> An induction generator produces electrical power when its rotor is turned faster than the synchronous speed... An induction generator usually draws its excitation power from an electrical grid
Which is not what they want in a car
Also they do want good torque at zero speeds, while it can be done with induction motors it's not ideal
> Today, all the hybrids are powered by DC brushless drives, with no exceptions. The only notable uses of induction drives have been the General Motors EV-1; the AC Propulsion vehicles, including the tzero; and the Tesla Roadster.
> Induction machines are more difficult to control. The control laws are more complex and difficult to understand. Achieving stability over the entire torque-speed range and over temperature is more difficult with induction than with DC brushless. This means added development costs, but likely little or no recurring costs.
A hybrid has different characteristics and requirements from the motor than a purely electrical vehicle as well
Yes, induction machines do draw power in order to establish a magnetic field where as PM machines get it for "free" by virtue of the magnets. Also the torque production at zero speed is almost identical in induction machines vs. PM machines, so this isn't an issue.
For EV applications one of the cool things about induction machines is that they can actually achieve higher efficiency at high speeds than a PM machine. This is because at high speeds the spinning magnets in a PM machine induce losses (so called eddy-current and hysteresis losses) which are difficult to suppress. In an induction machine you are controlling the field directly so it can be weakened at higher speeds with a control loop to directly optimize the losses vs. torque production. This means that there is a trade-off speed at which an induction machine becomes more efficient than a comparable PM machine.
To mitigate this issue in PMs some vehicle manufacturers have tried to do cool tricks like partially demagnetizing the magnets at high speeds to reduce losses, but this is very difficult to do without damaging the magnets permanently.
Motor size is approximately proportional to torque, not power, so you can imagine a small, low torque induction machine that is fast and will have better efficiencies than a corresponding PM machine. In stop and go traffic or low speed travel the PM machine typically has better efficiencies.
Personally I hope in the long run we end up with induction machines in our electric cars. 1) No safety issues with spinning magnets at high speed during an inverter failure, 2) no reliance on rare-earth materials, 3) the control of induction machines is very cool in its complexity and gives an additional degree of freedom on field flux that is only partially controllable in PM machines, and 4) induction machines have longer lifetimes as there is practically nothing to wear out aside from the bearings.
Yes but apparently the Model 3 uses permanent magnet motors. I would be interested to see the detailed engineering trade offs between these two choices.
The power electronics are built using MOSFET half-bridges, which naturally support the ability to flow current in either direction. This allows current to flow from battery to motor or from motor to battery (regeneration).
In regeneration the motor is actively slowing down the speed (creating negative torque) by pushing energy into the battery. This is achieved in software by regulating a "negative" current, which causes the inverter to produce a voltage that is lower on average than the back EMF generated by the motor. Because the motor is effectively at a higher voltage than the inverter in this condition, current will flow from high voltage to low voltage and therefore flows back through the MOSFETs (and MOSFET body diodes) into the battery.
This is a bit of an over-simplification as brushless DC motors are actually excited by an AC waveform so the current is constantly reversing each half cycle, but the principle remains the same.
Ah, so the circuit with the MOSFET bridges is symmetric and can convert in both directions, and the software is capable of making that happen. That makes sense, thank you for answering my question in a detailed manner.
As a clarification -- is "back EMF" related to the open-circuit voltage that the motor generates when it's forcibly spun?
Very impressive! I love to see this kind of thing on HN. I scanned through your code a bit on mobile, and here are a few quick suggestions:
1) It looks like you are using field oriented control. This is used 99% of the time in industry, but if you really want high torque bandwidth you should check out alternate control techniques. My favorite is an up-and-coming algo developed at UW-Madison called Deadbeat Direct Torque and Flux Control (DB-DTFC when searching for papers). It uses an inverse motor model paired with rotor/stator flux estimators to produce a deadbeat (one timestep later) torque and flux response. I have heard apocryphal stories of people who implement DB-DTFC accidentally snapping motor shafts when they forget to limit the torque slew rate. It is a very high performance algorithm, and beats FOC and DTC hands down at the cost of a bit more complexity.
2) If you are sticking with FOC for now, you can make a few quick improvements that will help a lot. First add qd-axis decoupling on you current loop commands (may have missed them, but I didn't see them in your code). You will want reference frame speed ("omega") decoupling multiplied by current and the transient inductance of the machine, which undoes a lot of the cross coupling that causes issues at high speeds or fast changes in torque. Flux decoupling will help with integrator wind-up, and stator resistance decoupling also helps lessen integrator wind-up at low speeds.
3) Have you considered implementing a sensorless algorithm? It can be done with both FOC or DB-DTFC, although there are some constraints on changing your switching frequency on the fly. If you have a fixed switching frequency a common technique is to superimpose a high frequency carrier on top of your voltage commands and then demodulate the high frequency response in the currents. Since a BLDC has salient poles on the rotor, this technique lets you estimate speed even down to zero! Then you wouldn't need encoder/resolver feedback which would be especially nice for robotics projects.
4) If you really want to get all of the current out of those FETs check out discontinuous PWM strategies. This are especially helpful at low speeds when your applied voltage is low, and can lower your switching losses enough to give you an extra ~40% current rating.
Great work overall. The hardware looks really clean and well designed, and it is easy to tell you put a lot of thought and effort into the site and this project.
1. Thanks for the suggestion, I have DB-DTFC to my motor control theory bookmarks. There are a few reasons I am sticking to FOC for now. The main one is that it is, as you say, the more standard one used, and hence there is more material on it which makes it easier. The other reason is that I read that you need high quality current measurement to get a good flux estimate: if your flux estimators are not high bandwidth, you aren't getting the extra control bandwidth anyway, and there is no point. The ODrive is trying to be as inexpensive as possible, hence the current sensors have a fair bit of noise.
2. Yes the decoupling terms will be added soon, it is something that I know should be there but wasn't a priority to put in once the motor was up and running (there is a thousand of other tasks I have to do to get this product out). The control engineer in me won't rest until all the standard feedforward terms are there ;D
3. Yes, I actually implemented a sensorless estimator based on this paper: http://cas.ensmp.fr/~praly/Telechargement/Journaux/2010-IEEE...
It is a non-linear flux estimator, so it won't work at zero speed. I did look into the high frequency injection techniques as well, but haven't implemented any of them yet.
Right now there is no sensorless estimator in this instance of the code, and I don't think we will need one for the basic demos, since they will all require accurate enocder feedback anyway.
4. Okay, I'll look into it!
Thank you so much! I actually took the liberty of copying your reply over to the ODrive forums: https://discourse.odriverobotics.com/t/control-suggestions/5...
This is so that I can easier refer back to your excellent advice even once this HN topic fizzles out.
Cheers!
Fair point about the quality of the current measurement. I probably take that for granted because I usually don't have to hit low cost targets! But that being said, a flux observer is inherently doing some kind of integration which tends to add a filtering effect. So noisy current sensors may still give you OK results, especially if comparing FOC with noisy sensors vs DB-DTFC with noisy sensors.
Ha, I am the same way with feedforward terms. No rest until the integrators don't budge under the largest command steps!
I will have to keep your site bookmarked. It is rare to see a high quality motor controller in this space. Most others I have seen are pretty underwhelming, so kudos on the cool project!
3) is interesting. Sensorless operation is common for running motors, but usually doesn't sense position when the motor is stopped, or being moved by external forces.
So if you put a carrier on the power signals, you can potentially sense position, even at zero speed? No need for even Hall sensors? There's a paper from 2001 on that.[1] But it doesn't seem to be a mainstream technique. Are there problems with that approach? If it worked well, you'd expect to see it built into common motor control ICs by now. This paper [2] indicates some of the problems. Detecting the sensing signals in the presence of noise is reported to be hard, especially for small motors. It's a PhD thesis topic.[3] Looking for info about this, I'm finding academic papers, but not IC data sheets.
It would sure be nice to have motors with full positional feedback and only 3 wires, instead of 16.
It is not easy per-se, and yes it is used in many dissertations, but most of the limitations up to now have been more related to the performance required to implement a demodulator that runs at high enough frequencies in a low cost microcontroller or FPGA. This is becoming less of a problem with more powerful chips. I don't know if I'd call it a mainstream technique, but it is widely used in high performance IPM motor drives for servo applications.
I think this technique isn't commonly used in lower performance applications because it is an additional cost both in performance (need a more powerful processor) and complexity.
The big problem with high freq injection is that it requires some kind of saliency on the rotor, which means this only works for interior permanent magnet machines and not induction or surface PM machines unless they are specially constructed. I guess I don't know enough about hobby brushless DC machines to know if they are IPM or SPM, but my guess was IPM because they can be cheaper to build for high speed designs and I know hobby BLDCs can spin at 10s of thousands of rpm. Perhaps someone with more hobbyist know-how can chime in.
For this application (robotics) I think the other typical problems with high freq injection are negligible. For example you need a well-defined switching frequency that stays out of the way of your high frequency carrier. Many inverters pull back on switching frequency at high loads in order to lower switching losses, but if you lower the switching frequency too much you won't have enough voltage bandwidth to synthesize the high frequency carrier required for the self-sensing algorithm. I don't think this would be a big deal for robotics applications.
How high a frequency do you have to inject for sensing? Much higher than the power chopping frequency, presumably. Megahertz? Harmonics from the PWM drive are going to interfere. I can see why separating signal from noise is a problem, and why mating a motor and a controller isn't going to be plug and play.
Larger drone prop motors seem to be mostly permanent magnet brushless. Often the stator is on the inside, and the rotor is a rotating shell carrying permanent magnets that fits over the stator. 12 coils and 14 permanent magnets is a common configuration.
Other drone motors look more like standard motors, with an outside stator and an interior rotor. Some of those are definitely permanent magnet.
Here's a good overview.[1] If you wanted to repurpose such motors for
industrial control, the main problem would be cooling. They're intended for
use with the prop blowing air through them, so they can dissipate much more
heat than most motor configurations. Slow speed, high-torque operation would
probably overheat them.
The high freq signal has to be lower than the switching frequency - otherwise you end up with harmonic interference from the PWM like you mentioned. For high performance servo control in the 5-200kW range with switching frequencies up to 20kHz I typically see high frequency injection in the 1-4kHz range. This is high enough to produce negligible torque ripple and minimal estimation error, but low enough to be synthesizable without an ultra high PWM frequency. Of course for smaller systems switching at 100s of kHz or even MHz a higher high frequency signal could be injected.
I suspect that this type of sensorless strategy will become more popular with the rise of GaN and SiC devices, but it is currently implemented with good results today using only standard Si IGBTs and MOSFETs.
Robert Zubrin has discussed the "moon first" strategy, and has made the interesting observation that many of the pro arguments come from entrenched space industries looking to make a buck on existing hardware. The argument being "we already build parts to go to the moon, so let's just do that."
Personally I would love to see both outcomes. But given a limited budget, going to Mars has the advantage of providing a (admittedly risky and uncertain) possibility of extending the survival of the human race, where as going back to the moon seems to provide more indirect benefits.
Given a limited budget, lifting everything from earth, other than for a quick stunt mission to mars, is not economical. Nearly all the mass and elements needed - everything but hydrogen - is on the moon already. And hydrogen (water) may just be available too, at the poles.
Different strokes I guess. I really enjoyed the Three Body Problem trilogy due its expansiveness both in time and in space, and its focus on ideas rather than (solely on) characters.
Then again one of my favorites hard SF authors is Greg Egan, and I've heard many times that people find his work dull (which blows my mind - Egan writes some of the most thought provoking, interesting SF by FAR).
> Different strokes I guess. I really enjoyed the Three Body Problem trilogy due its expansiveness both in time and in space, and its focus on ideas rather than (solely on) characters.
I don't know what ideas or expansiveness you're talking about?
> Then again one of my favorites hard SF authors is Greg Egan, and I've heard many times that people find his work dull (which blows my mind - Egan writes some of the most thought provoking, interesting SF by FAR).
I found the metaphysical stuff in e.g. Permutation City slow and boring - it felt like he'd had a clever idea but wasn't pushing it as hard or as fast as it could go. Had the same experience with a couple of others of his (Distress and Schild's Ladder are the ones I read). To the point where I stopped reading him for a while.
I found the Orthogonal trilogy a lot better; the physics of that is a lot more interesting than metaphysics. Though as a confounding factor I do think the characters in that were much better - still broad-strokes archetypes, but not total nonentities like in his earlier work.
Expansiveness in that Three Body Triology takes place over a large period of time (billions of years), and the fact that it takes place over such a large space (Earth, Trisolaris, outer planets, etc). The ideas were similarly expansive, especially the dark forest philosophy and its implications. That being said, there were several places where I found myself bored and waiting for something to happen. Even so it was an enjoyable read overall.
Permutation City is one of my favorites. When you say "slow and boring", I say "subtle build" to the final realization of what Paul has done and how his realization has proved the "dust" theory.
Really like Schild's Ladder too, and Distress is pretty good but not my favorite.
I agree with you on Orthogonal for the most part. Although I was very disappointed in the ending - it seemed too abrupt and predictable given the rest of the story.
> Expansiveness in that Three Body Triology takes place over a large period of time (billions of years), and the fact that it takes place over such a large space (Earth, Trisolaris, outer planets, etc).
I'm talking solely about the first one, I only read that (and probably wouldn't have bothered finishing it if it hadn't been for the Hugo). There's no large time range that I remember, very little happening anywhere other than Earth, and nothing of philosophical interest that I saw.
> When you say "slow and boring", I say "subtle build" to the final realization of what Paul has done and how his realization has proved the "dust" theory.
I found it just took too long to get around to a "reveal" that was already obvious. And the conclusion of part 2 doesn't really engage properly with the dust theory; if anything the humans' inability to modify the machines the ants' universe is running on undermines it, because under their physics that action would make perfect sense. The ants' reality "wins" by pure authorial fiat; you could - and should, it would be interesting - make an argument for why it should based on kolgomorov complexity or some such, but Egan neglects to.
The Three Body Trilogy is actually one of my all time favorite scifi book series (and I read a lot of scifi). A lot of interesting ideas are developed through the story arc. Perhaps unfortunately, the first book is more setting the stage for the others, which makes it a difficult read for some. The Three Body Trilogy IMO would probably have better merged into a single book, but then doing so would make it seem an impossibly long read for some perhaps. I agree it is a bit slow at times, but worth it.
If you want a denser read (less setup, etc.) that also has a lot of really thought-provoking concepts, I highly recommend also "Blindsight" by Peter Watts. Blindsight is probably my all time favorite scifi novel, actually.
I'd a big fan of Blindsight. That said I'm not averse to long books and I love worldbuilding (e.g. I really liked Anathem, and The January Dancer). Though I think I do also like to have a conventional plot to hold onto - a quest that our viewpoint characters are trying to accomplish - maybe that's what was missing from Three Body Problem for me.
[spoilers] The first time I read Permutation City I really enjoyed the reveal that Paul was originally a simulation (many times over) that only existed in the "real" world because the entire universe spontaneously came into being in order to maintain a simpler reality than the alternative in which his simulation suddenly stopped existing. Almost as if complexity itself has some kind of inertia. If that was obvious to you the first time around, kudos!
I also really enjoyed the commentary on solipsism in the context of transhumanism via the 'Peer' character.
Although part 2 doesn't explicitly explain why the universe of PC has the "complexity momentum" property, it does suggest the universe with the lowest Kolmogorov complexity is preferred (via some undescribed physical law). That is why the "ant's" universe wins; it's relative complexity is simpler than the world which Paul had created. I agree that it could have been fleshed out more fully.
There has been some good discussion on Reddit about how the thrust results shown in the paper are still most likely measurement errors due to thermal effects. It is a shame that they haven't released their actual data for independent analysis.
I've been following along on reddit on several subs, including the EMDrive sub.
This is a fascinating study about the politics and social aspect of science -- i.e., how it's actually done.
I'm just a layman, but so far it looks like this is experimental error. I never knew there were so many ways to screw something like this up!
Having said that, this is a win either way. It teaches all of us about rigorous science, it allows far-fetched ideas to be taken somewhat seriously as long as there is some sort of experimental evidence, and it provides a forum for practicing scientists and interested laymen to cross-pollinate. It's a really good thing. (Only probably no warp drive involved)
I agree this incident has educational value, because it's like a toy research project. The science behind the EM drive and the means to understand why it could never work are accessible to laymen who only have to trust our most well-tested physical laws.
If you're curious, you can find an easy to understand theory about why breaking the conservation of momentum lets you build a perpetual-motion machine, creating infinite energy.
Then, you can find a paper from the inventor of the EM drive explaining why it won't allow that to happen. His explanation spectacularly violates special relatively in a way we could easily detect.
Yeah, but it's more than just getting the natural laws out and beating people over the head with them -- there's emotional involvement from the public, and that's terrific.
For instance, there are quite a few hobbyests that are building their own rigs. There's discussion about noise control, radiation leakage, resonance, and so forth.
For the more theory-minded, there's a great discussion about empirical data versus theory, which you allude to. At the end of the day, of course, if you've got data, you've got data. Once the errors are taken out of the system, observation beats theory hands-down.
I know scientists would probably much rather have a conversation around "This is science, dang it, go read a book!" but for us layman schmucks, the really cool part is a conversation around "This is why science is what it is"
(Note: I'm not addressing you directly. I've just noticed a lot of mockery and impatience from some of the scientific community, and that's a shame. Better to use this as a teaching moment in my opinion)
>Once the errors are taken out of the system, observation beats theory hands-down.
But how do you go about distinguishing signal from noise? That's ultimately the reason data say far less, on their own, than they seem to: because interpretation of data is at least as important as how you collect them, but interpretation brings in all the gooey things people really want to wish away. Or put more bluntly, observation can't "beat" theory, because theory is the way you decide which observations to make, how to carry out those observations, and how to understand the products of the observation. Theory and observation are inseparable; in a sense, all observation is at once theoretical, and all theory is at once observational.
With respect, the idea that most parents could fix the system if they just tried is incredibly naive. I think most parents do the best that they can. If they feel that homeschooling is better for their children then they absolutely should pursue that option.
The big problem in my mind is that Python is the wrong tool for the job. It is 2016, there are more hard-RTOS prototyping platforms than ever before. My favorite is National Instrument's RIO platform, which lets you use C or LabVIEW (imho the best language for prototyping control algorithms by far). Mathworks also has a platform based on Matlab/Simulink, and the list goes on.
Why use Python when there are existing tools that are made for this type of application?
LabVIEW is great until you need a complicated data structure. I tried writing a tree to do kNN, and it turned out that doing a brute force search was faster even with 100k elements.
This is (now) open source project expecting community pull requests. How many would they get if they went with LabView? The big emphasis that I like seeing in modern scientists is reproducibility of results. Jupyter Notebook is a huge step in that direction (not really applicable here), but just using open source platform is still great.
I agree though that once algorithms are developed sufficiently they should be ported to RTOS platform and this box shouldn't be permitted on open roads.
I have a guess: the limit in these designs isn't typically the motor, but instead the power semiconductors in the inverter (the motor has a much longer thermal time constant than the power devices). Therefore the limit is the junction temperature of the power devices. Most high performance drives have some kind of junction temperature estimation algorithm (it is difficult or impossible to put a sensor right at the junction without changing the electrical properties of the semiconductor). When the estimated temperature gets too high, they will start pulling back the current to protect the power devices from overheating. The more accurate the model, the closer they can push the devices to the limit without failure.
I'd bet they have been slowly improving their junction temp. estimation model and are now able to push the power semiconductors a little bit closer to their temperature limit, allowing them to produce more current (or the same current for a longer duration) before pulling back.
The induction torque speed curve is also very performant even when compared to PM machines so I don’t understand your criticism. Source: motor control engineer.