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

Show off your E-bike creation here.
User avatar
Alan B   100 GW

100 GW
Posts: 7490
Joined: Sep 11 2010 7:43am
Location: San Francisco Bay Area, USA
Contact:

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

Post by Alan B » Aug 17 2018 10:22am

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.

coleasterling   100 W

100 W
Posts: 141
Joined: Sep 21 2010 3:37am

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

Post by coleasterling » Aug 17 2018 11:55am

fpvdude wrote:
Aug 16 2018 4:16pm
Heres a cool blog article on some stall testing a friend of mine did. http://build-its-inprogress.blogspot.co ... 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.)

fpvdude   1 mW

1 mW
Posts: 16
Joined: May 29 2018 5:51pm

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

Post by fpvdude » Aug 19 2018 6:17pm

madin88 wrote:
Aug 17 2018 6:18am
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 wrote:
Aug 17 2018 6:18am
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 wrote:
Aug 17 2018 6:18am
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.

fpvdude   1 mW

1 mW
Posts: 16
Joined: May 29 2018 5:51pm

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

Post by fpvdude » Aug 19 2018 6:19pm

coleasterling wrote:
Aug 17 2018 11:55am
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

User avatar
madin88   100 MW

100 MW
Posts: 2801
Joined: May 27 2013 2:02am
Location: Austria

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

Post by madin88 » Aug 20 2018 7:17am

fpvdude wrote:
Aug 19 2018 6:17pm
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.
- 10kW belt drive with Neumotor 8057: viewtopic.php?f=30&t=91144&start=50#p1377787
- Fully road legal (L1E approval) e-bike based on Votec V-FR frame
/ MXUS 3T / 17" Mitas MC11 / Adaptto Max-E / 20s12p 25R
- KTM Hardtail Pedelec / eZee V2 6T / 27,5" / Kelly KBSX @ 1,5kW / Torque PAS / CA-V3 / 13s4p Sanyo GA in Shark case

coleasterling   100 W

100 W
Posts: 141
Joined: Sep 21 2010 3:37am

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

Post by coleasterling » Aug 20 2018 10:47am

fpvdude wrote:
Aug 19 2018 6:19pm
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.

coleasterling   100 W

100 W
Posts: 141
Joined: Sep 21 2010 3:37am

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

Post by coleasterling » Aug 20 2018 10:51am

fpvdude wrote:
Aug 19 2018 6:17pm
madin88 wrote:
Aug 17 2018 6:18am
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 wrote:
Aug 17 2018 6:18am
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 wrote:
Aug 17 2018 6:18am
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?

fpvdude   1 mW

1 mW
Posts: 16
Joined: May 29 2018 5:51pm

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

Post by fpvdude » Aug 20 2018 4:57pm

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.

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

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 :(

Image

Image

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!!



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.

coleasterling   100 W

100 W
Posts: 141
Joined: Sep 21 2010 3:37am

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

Post by coleasterling » Aug 21 2018 12:02pm

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.

fpvdude   1 mW

1 mW
Posts: 16
Joined: May 29 2018 5:51pm

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

Post by fpvdude » Aug 21 2018 1:14pm

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   100 W

100 W
Posts: 141
Joined: Sep 21 2010 3:37am

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

Post by coleasterling » Aug 21 2018 4:34pm

Is that assuming you've entered the field weakening region? I wouldn't think it would be an issue until then?

fpvdude   1 mW

1 mW
Posts: 16
Joined: May 29 2018 5:51pm

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

Post by fpvdude » Aug 22 2018 11:50am

coleasterling wrote:
Aug 21 2018 4:34pm
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!

StuRat   100 W

100 W
Posts: 121
Joined: Mar 15 2018 7:18pm

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

Post by StuRat » Oct 24 2018 12:25am

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?

district9prawn   100 W

100 W
Posts: 165
Joined: Jul 20 2013 10:46pm
Location: Sydney

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

Post by district9prawn » Oct 24 2018 7:05pm

fpvdude wrote:
Aug 22 2018 11:50am

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?
Neu 8057 6kW left hand drive hardtail: viewtopic.php?f=6&t=96754

redline2097   100 W

100 W
Posts: 162
Joined: Jun 18 2015 1:43am

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

Post by redline2097 » Nov 13 2018 2:45pm

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.

billvon   10 MW

10 MW
Posts: 2003
Joined: Sep 16 2007 9:53pm
Location: san diego

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

Post by billvon » Nov 13 2018 3:38pm

district9prawn wrote:
Oct 24 2018 7:05pm
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.
--bill von

User avatar
madin88   100 MW

100 MW
Posts: 2801
Joined: May 27 2013 2:02am
Location: Austria

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

Post by madin88 » Nov 14 2018 6:13am

billvon wrote:
Nov 13 2018 3:38pm
district9prawn wrote:
Oct 24 2018 7:05pm
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..

billvon   10 MW

10 MW
Posts: 2003
Joined: Sep 16 2007 9:53pm
Location: san diego

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

Post by billvon » Nov 14 2018 11:15am

madin88 wrote:
Nov 14 2018 6:13am
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.
--bill von

User avatar
liveforphysics   100 GW

100 GW
Posts: 13986
Joined: Oct 29 2008 1:48am
Location: Santa Cruz, CA, USA

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

Post by liveforphysics » Jan 06 2019 3:30pm

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 wrote:
Aug 20 2018 4:57pm
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.

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

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 :(

Image

Image

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!!



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.
Each carcinogen vapor exposure includes a dice roll for cancer.

Each mutagen vapor exposure includes a dice roll for reproductive genetic defects in your children.

Each engine start sprays them into a shared atmosphere which includes beings not offered an opportunity to consent accepting these cancer experiences and defective genetics life experiences.

Every post is a free gift to the collective of minds composing the living bleeding edge of LEV development on our spaceship.

Post Reply