Toyota Prius A/C Compressor Motorbike: The Bike of IPM Motor Science

Timing advance is a different way of looking at id and iq.

If you consider the id and iq torque are at 90 degrees to each other, and you put a a constant current on one axis and rotate it to the other axis, it would be an advance (positive or negative). As with any vector quantity it can be looked at in polar (magnitude and angle) or projected onto the axes and looked at as two separate currents, one on each axis.

So they are just different ways of looking at the same current vector.
 
fpvdude said:
Heres a cool blog article on some stall testing a friend of mine did. http://build-its-inprogress.blogspot.com/2017/11/stall-torque-test-stand.html

Also, what IPMs have you driven sensorless, and with what controller? If I make some electric boat or something and don't want to make my own controller, I'd be OK with the loss of 20% stall torque and no field weakening. I was playing around with sensorless code on this controller, but didn't get that far.

Thanks for the info! I'm surprised it is so low, as well. I would take that to mean that driving it conventionally, is feasible.

I'll check that out!

This was only for testing motor function in a binary sense...Is it blown up, or not? Nothing fancy or high-power. I use an RC controller when I get a salvage transaxle in for that. It has never had an issue spinning them. I've done it with a couple HVH250's, Prius MG1 and MG2, and a couple smaller motors (AC compressor from the Tahoe Hybrid, was one, actually.)
 
madin88 said:
Regarding the text of the testing the sum of the amps going into the motor stayed the same at 180A (is that right?, it looks a bit more?), but the torque increased from about 35Nm to 58Nm somewhere in the middle by just shifting the angle.
Yep, pretty much. I believe the test was done at 180A. One thing to note though is that it was not the sum of the currents, but the total magnitude, so sqrt(D^2 + Q^2). And yep magic torque increase just for doing this!

madin88 said:
This means on IPM motors the speed AND torque can be gained when shifting the angle of the current supply , while on motors which have surface mounted magnets SMPM, only speed can be gained and no torque. No torque because a rotor with SMPM seems to not have any reluctance torque.
Sort of- you can use additional D current to both generate reluctance torque and do field weakening. However the laws of physics are never violated, its not magic torque that comes out of nowhere. Additionally, the relationship between PM torque, reluctance torque, and field weakening is a careful balance. Its not like "put a crapton of D axis current and everything gets better" lol.
madin88 said:
I wonder what it needs to make a normal controller to apply current in the D-axis. Would a "timing advance" do the same, or is this something entirely different?
A timing advance would accomplish the same goal, I THINK. I'm not entirely sure, but I believe so. I've thought of making a hall sensor pass through thing that changes the timing, but its easier to just do it in software.
 
coleasterling said:
This was only for testing motor function in a binary sense...Is it blown up, or not? Nothing fancy or high-power. I use an RC controller when I get a salvage transaxle in for that. It has never had an issue spinning them. I've done it with a couple HVH250's, Prius MG1 and MG2, and a couple smaller motors (AC compressor from the Tahoe Hybrid, was one, actually.)

I see, good to know that a standard RC controller can at least spin it.
Do you work at a junkyard or something? Do you still have the Tahoe compressor? Did you ever open it up? If not, you should, and post some pics!! :D
 
fpvdude said:
Yep, pretty much. I believe the test was done at 180A. One thing to note though is that it was not the sum of the currents, but the total magnitude, so sqrt(D^2 + Q^2). And yep magic torque increase just for doing this!
makes sense. Thanks for the explaination!
Sort of- you can use additional D current to both generate reluctance torque and do field weakening. However the laws of physics are never violated, its not magic torque that comes out of nowhere. Additionally, the relationship between PM torque, reluctance torque, and field weakening is a careful balance. Its not like "put a crapton of D axis current and everything gets better" lol.
Yes it seems that it will be hard to find out the optimal D-axis current (or phase shift) on a given IPM motor without putting the motor on a test bench or dyno.
 
fpvdude said:
I see, good to know that a standard RC controller can at least spin it.

Do you work at a junkyard or something? Do you still have the Tahoe compressor? Did you ever open it up? If not, you should, and post some pics!! :D

Ha, no junkyard (unless you count my scrap pile!). I own a company that does turnkey product development and have an interest in re purposing salvage vehicle motors. My intent is to develop a line of motors and matched controllers for go karts, ebikes, e-motorcycles, etc...I have a few large CNC machines (50 Taper mill, 40 taper - 4 axis mill, 2 axis lathe) and do tons of prototyping, so this is just another prototyping job as far as the manufacturing side is concerned.

I wish I would have taken some pictures of it. It is a nice IPM package with integrated controller, meant for 300V operation. The controller is potted and impossible to interface with and very difficult to remove, unfortunately. I probably could have removed the stator, but decided against it. The rotor is fitted with counterweights for the scroll and not very friendly to work with, either. I ended up scrapping it and all I have left is the scroll, sadly.
 
fpvdude said:
madin88 said:
Regarding the text of the testing the sum of the amps going into the motor stayed the same at 180A (is that right?, it looks a bit more?), but the torque increased from about 35Nm to 58Nm somewhere in the middle by just shifting the angle.
Yep, pretty much. I believe the test was done at 180A. One thing to note though is that it was not the sum of the currents, but the total magnitude, so sqrt(D^2 + Q^2). And yep magic torque increase just for doing this!

madin88 said:
This means on IPM motors the speed AND torque can be gained when shifting the angle of the current supply , while on motors which have surface mounted magnets SMPM, only speed can be gained and no torque. No torque because a rotor with SMPM seems to not have any reluctance torque.
Sort of- you can use additional D current to both generate reluctance torque and do field weakening. However the laws of physics are never violated, its not magic torque that comes out of nowhere. Additionally, the relationship between PM torque, reluctance torque, and field weakening is a careful balance. Its not like "put a crapton of D axis current and everything gets better" lol.
madin88 said:
I wonder what it needs to make a normal controller to apply current in the D-axis. Would a "timing advance" do the same, or is this something entirely different?
A timing advance would accomplish the same goal, I THINK. I'm not entirely sure, but I believe so. I've thought of making a hall sensor pass through thing that changes the timing, but its easier to just do it in software.


So looking through your stall testing, did you do it at different currents? I've read the optimal angle varies with both current and rpm. We (ES) have had discussion about how to best drive IPM's before, and one of the suggestions was to implement a lookup table, similar to injector pulse width if you're tuning a car Alpha-N. Any thoughts on that?
 
I made a lookup table to drive this motor. Unfortunately at least some type of lookup table is more or less mandatory.
The current lookup table is not great, but yields acceptable performance with only a bit of voltage saturation. I'm still in the process of making a good lookup table, was working on that last night.

Not sure what of this information you know already, but I'll describe the complete procedure of what I've done so far:
IPM motors need a certain amount of Q and D current to operate properly. These currents depend on the phase resistance (same for D and Q), the phase inductances (different for D and Q, thats what generates reluctance torque), the flux linkage (effectively the Kv) and the battery voltage. Matters are complicated by the fact that the inductances can saturate, leaving you with reduced reluctance torque.

There are a lot of steps to making the lookup table.
The simplest test that was run first was the stall test. We mounted the motor to a friend's dyno and spun it at about 100RPM to get rid of any cogging effects. This test can also be done stationary as in the post on that same friends blog several posts ago, but should be repeated at several positions.

IMG_61432.jpg

This data was used to generate a lookup table for stall and low speeds.
phase_advance_zpsfief1pus.png


So, stall table for low speeds, down. Unfortunately the higher speed tests are much, much harder....
That dyno couldn't do the high speeds which we needed, so we tried more analytical methods to make the lookup table. The most basic test is to just put the motor on your bike and ride it around while logging currents and voltages. From the logged data, the inductances can be solved for in MATLAB with just a least-squares regression. The inductances are the real hard thing to get right, as the "d axis inductance" is only kind of measureable, and only sort of exists in real life. The best way to observe the inductances is to use your setup to measure itself, that way any measurement biases are inherently compensated for.

This lookup table generator takes in the resistance, phase inductances, battery voltage, and flux linkage, and spits out these lookup tables. I'm now about 80% sure these lookup tables are wrong unfortunately due to wrong inductances :(

D%20current_zpsd8yamnjs.png


Q%20current_zpsfipgqvjm.png


Last night I was doing some inductance measurement on the Q axis. Unfortunately it looks like the Q axis saturates pretty heavily at high currents. Turn up the volume on this video!!

[youtube]5P22xq3bJh8[/youtube]

The Q axis saturates a lot harder than expected. I am doing this testing because I realized that I should be getting a lot more reluctance torque than I actually am- 20% is quite low. I realized that this might be because the Q axis is saturating, meaning it would have an inductance closer to that of the D axis. This seems to be the case, but more testing is necessary to confirm these findings.
 
Very interesting! My somewhat uninformed thoughts on the lookup table were much more simple. Instead of commanding D & Q currents directly, the table would consist of load (throttle),rpm, and timing advance, with the assumption that timing advance is the real-world manifestation of D-axis current. Similar again to Alpha-n tuning, you'd put the motor on a dyno capable of running through the entire rev range and tune timing at each load and RPM point you specify for peak torque.
 
Unfortunately just a phase advance is not enough information to fully define the system. For example think what happens at high speed at zero throttle- even though you are commanding zero throttle, some amount of D axis current is necessary to keep the motor from regen braking ultra hard. I solved this problem with a separate D and Q axis lookup table, but I guess an equally viable solution would be phase advance table as well as extra D current lookup table.

I wish just a phase advance was all it took, unfortunately not :(
At least its a good project where you really have to build a detailed model that takes into account a TON of different factors. Its pretty cool IMHO.
 
coleasterling said:
Is that assuming you've entered the field weakening region? I wouldn't think it would be an issue until then?

Yep. However, the reason an IPM is good is because it can do field weakening very effieciently. Without field weakening, my bike's top speed would be limited to only about 17mph, pretty lame for an electric bike.

Usually, an SPM (surface permanent magnet) motor is operated without field weakening, with the field weakening reserved for short high-speed bursts. Field weakening will buy you 50% extra speed, maybe double, but very inefficiently on an SPM. This is not the case in an IPM. A good general target for an IPM is to have your base speed (the speed you could reach without any field weakening) at about 1/2 to 1/3 of your top speed. Then, you field weaken to get more top speed when you want it, and the IPM will do so with good efficiency. If you gear your motor for one half of top speed, you effectively double your low-end torque, but with the great field weakening you can still get to high speeds.

I will be doing a lot of modeling over the next couple weeks to try and extract even more performance out of this motor. We'll see how it goes!
 
Fpvdude, you are cool 8) and I only understand every second word you say.

How is the bike going? Any plans to sell... the bike... the motors?
 
fpvdude said:
Yep. However, the reason an IPM is good is because it can do field weakening very effieciently. Without field weakening, my bike's top speed would be limited to only about 17mph, pretty lame for an electric bike.

So if you were to coast at 30mph with no field weakening currents, does this mean you could blow your controller or expose it to high voltages?
 
We are making E-Kart prototype with IPM motor. We need the best available acceleration from 40 to 60kmh, top speed would be 80kmh. Is it better to gear it to 80kmh without Flux weakening or gear it to 40-50kmh and apply field weakening to go up to 80kmh. Which scenario has the best acceleration in needed acceleration range. Standstill acceleration is not very important.
 
district9prawn said:
So if you were to coast at 30mph with no field weakening currents, does this mean you could blow your controller or expose it to high voltages?
That is possible but unlikely. You would not see overvoltage because the diodes would freewheel and direct the current to the battery. However, it is possible to overcurrent the diodes and damage the inverter that way if the current went on for too long.
 
billvon said:
district9prawn said:
So if you were to coast at 30mph with no field weakening currents, does this mean you could blow your controller or expose it to high voltages?
That is possible but unlikely. You would not see overvoltage because the diodes would freewheel and direct the current to the battery. However, it is possible to overcurrent the diodes and damage the inverter that way if the current went on for too long.
Tank you for bringing this up.
If i look on the circuit diagram of a power stage, if BEMF is going up above battery voltage it should work like a bridge rectifier and would charge your battery. This would stress the diodes but it should not hurt the Mosfet's itself (in terms of max voltage rating).

Would this also be the case if the controller is using synchronuous rectification? I think it would be but i am not sure..
 
madin88 said:
If i look on the circuit diagram of a power stage, if BEMF is going up above battery voltage it should work like a bridge rectifier and would charge your battery. This would stress the diodes but it should not hurt the Mosfet's itself (in terms of max voltage rating).
Yes, with a minor caveat - in most cases the diodes ARE the MOSFETs.
Would this also be the case if the controller is using synchronuous rectification? I think it would be but i am not sure..
The current stress would be the same. The thermal stress would be lower due to lower heating loads.
 
I don't know how I missed this thread until now. Wow!

You are a rockstar Fpvdude!

Lowest effort and lowest performance way to build your IPM tables at higher RPMs may be a woodworking router motor. They should run fine on DC for speed control, and some achieve 18krpm+

More effort, but a second of the same AC pump motor used as a dyno load/drive also should work.

Thank you for this tremendous project and congratulations on your controller design and skills to run that motor so hard. It would be a dog turd of a motor without your clever controller work.

fpvdude said:
I made a lookup table to drive this motor. Unfortunately at least some type of lookup table is more or less mandatory.
The current lookup table is not great, but yields acceptable performance with only a bit of voltage saturation. I'm still in the process of making a good lookup table, was working on that last night.

Not sure what of this information you know already, but I'll describe the complete procedure of what I've done so far:
IPM motors need a certain amount of Q and D current to operate properly. These currents depend on the phase resistance (same for D and Q), the phase inductances (different for D and Q, thats what generates reluctance torque), the flux linkage (effectively the Kv) and the battery voltage. Matters are complicated by the fact that the inductances can saturate, leaving you with reduced reluctance torque.

There are a lot of steps to making the lookup table.
The simplest test that was run first was the stall test. We mounted the motor to a friend's dyno and spun it at about 100RPM to get rid of any cogging effects. This test can also be done stationary as in the post on that same friends blog several posts ago, but should be repeated at several positions.

IMG_61432.jpg

This data was used to generate a lookup table for stall and low speeds.
phase_advance_zpsfief1pus.png


So, stall table for low speeds, down. Unfortunately the higher speed tests are much, much harder....
That dyno couldn't do the high speeds which we needed, so we tried more analytical methods to make the lookup table. The most basic test is to just put the motor on your bike and ride it around while logging currents and voltages. From the logged data, the inductances can be solved for in MATLAB with just a least-squares regression. The inductances are the real hard thing to get right, as the "d axis inductance" is only kind of measureable, and only sort of exists in real life. The best way to observe the inductances is to use your setup to measure itself, that way any measurement biases are inherently compensated for.

This lookup table generator takes in the resistance, phase inductances, battery voltage, and flux linkage, and spits out these lookup tables. I'm now about 80% sure these lookup tables are wrong unfortunately due to wrong inductances :(

D%20current_zpsd8yamnjs.png


Q%20current_zpsfipgqvjm.png


Last night I was doing some inductance measurement on the Q axis. Unfortunately it looks like the Q axis saturates pretty heavily at high currents. Turn up the volume on this video!!

[youtube]5P22xq3bJh8[/youtube]

The Q axis saturates a lot harder than expected. I am doing this testing because I realized that I should be getting a lot more reluctance torque than I actually am- 20% is quite low. I realized that this might be because the Q axis is saturating, meaning it would have an inductance closer to that of the D axis. This seems to be the case, but more testing is necessary to confirm these findings.
 
Hey all,
Its time to get back into this project... got a few upgrades in the works. The plan is to first make the bike more aesthetically pleasing and then further push performance.

First step is to fix the current trashpile electronics stack. Currently the motor controller is weatherproofed with just a "healthy" load of electrical tape, and the data logger is just taped on top of that as well with a paper towel in between.

Here is the current stack:


The plan is to condense the motor controller and data logger into one small "electronics module" which is packaged nicely.

Here is the old controller (left) and new controller (right). The new controller uses a smaller IGBT brick and 2x 10uf capacitors instead of 4 4.7uf capacitors.



New controller has nice little standoffs to mount the data logger on. This board had a few issues though so I am sending out for a new one.



Also, two days ago I finally put "odometer mode" firmware on it. I took the bike out for a 17-ish mile test ride and then a 0.76 mile calibration ride (measured on google earth between two manhole covers). Apparently the motor spun a total of 354,275 revolutions, which corresponds to 17.86 miles of riding. Pretty insane that the motor turns so many times.

The bike has now been running for just over a year, and I think I've put somewhere between 300 and 500 miles on it. Despite its incredible sketchyness, somehow it has never failed during a ride even once. It is still a joy to ride, and hopefully will get even better as I continue to make upgrades.
 
What is the deal with the login security on your blog?


Do you have any plans to open source your controller? Keep up the great work.
 
Google and bing were for some reason very aggressively crawling the site- I'm currently trying to get it back, should be back online in a few days.

Regarding open sourcing this stuff, I'm not sure. I'll be graduating from grad school in about a year, and was thinking of turning this all into a company as a few people have expressed interest in purchasing this power system. The hard part though is that these motors only really work well at high voltages, which is a bit scary. Not sure what to do about that. Any thoughts?
 
fpvdude said:
Google and bing were for some reason very aggressively crawling the site- I'm currently trying to get it back, should be back online in a few days.

Regarding open sourcing this stuff, I'm not sure. I'll be graduating from grad school in about a year, and was thinking of turning this all into a company as a few people have expressed interest in purchasing this power system. The hard part though is that these motors only really work well at high voltages, which is a bit scary. Not sure what to do about that. Any thoughts?

Open source is great but I fully support anybody who has invested in their personal intellectual capital through higher education monetizing that investment.

Regarding the higher voltage issue my view is that it is overblown by some. Provided you make good engineering choices the risk of mortality due to electrocution is minimal. An objective analysis of the mortality rate in the USA due to electrocution in comparison to say being a pedestrian or a bicycle rider should convince any rational person that the risk is acceptable particularly in light of the fact that we are surrounded by lethal voltages every day.
 
Back
Top