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

fpvdude

1 mW
Joined
May 29, 2018
Messages
19
Hi all,
I have been working on a cool electronics/motor science/electric bike project this semester and I thought I would share it here as it is quite interesting and amusing. As far as I know few people (if any?) have used IPM motors for their E-bikes, as they are quite difficult to use properly. This project has been a ton of effort and time but it’s been worth it, I’ve learned a lot and now have an extremely powerful electric bike. It has much more than wheelie torque at low speed, but it also has quite a good top speed of nearly 50mph. This project was mostly done to see if I could get good performance out of an IPM motor, but had the side effect of making a pretty cool electric vehicle.

Anyways, here goes.
The Bike of Motor Science: a BMX bike powered by the 4kw IPM motor from a Toyota Prius Air Conditioner Compressor. A work in progress.



The big components:
160v 4Ah from 4x electric leaf blower batteries
Custom built FOC motor controller using FNA25060 brick and STM32F303K8 microcontroller
AS5047P rotor position sensor
Homemade motor module built from a ‘06-’08 Toyota Prius air conditioner compressor rotor and stator and KHK module 1.5 spur gears, good for 4kw continuous and 6kw peak
Haro BMX bike

Basically I bought this from a junkyard:


And rehoused the innards into this:


And attached it to a bike. Additionally I spent many months developing a controller and a firmware to run that controller.

Why go to a junkyard, buy an air conditioner compressor, strip it down, use only the rotor and stator, and build an entire custom housing for specifically this motor? Why specifically an air conditioner compressor motor?
Several reasons I chose the air conditioner compressor motor:
  • They can be had at a junkyard for cheap ($75 from my local junkyard)
  • They are quite a good amount of motor per dollar (less than $20/Kw)
  • They are inrunners, meaning they are easier to cool, easier to mount, easier to seal from dirt, etc, etc. Inrunners are also very power dense. They are not as torque dense as an outrunner, but who cares- that’s what gears are for.
  • Motors of this size are not very common- 4kw is bigger than the RC plane market offers (at least cheaply). Possibly some electric bike motors are this powerful but I don’t know the e-bike market that well.
  • Lastly, but most importantly, this air conditioner happens to be an interior permanent magnet (IPM) motor.
What is an IPM motor, and why do we care? IPM stands for interior permanent magnet, where the magnets are embedded inside the rotor instead of glued to the surface. This type of motor is used in almost every electric car on the market these days because they produce good power at a great range of speeds, compared to surface PM motors which are very “peaky”, producing good power at a much narrower range of speeds. Here is a cross-section view:


Additionally IPM motors have great field weakening capabilities, meaning that they, when controlled right, have virtually unlimited top speed. These benefits make them ideal motors for traction applications, where high efficiency is needed at a great range of speeds. IPM motors really deserve more than this several-sentence explanation, so I encourage you to read bayley’s great post about them. http://isopack.blogspot.com/2017/08/fun-with-interior-permanent-magnet.html

Current performance metrics of this bike:
Easily wheelie torque, probably more by a factor of 20-50% (she wheelies hard)
Currently good torque up to maybe 20mph or so, when torque drops down slowly as speed increases
Max speed ever reached: 49.2 mph (!!!!)

Some more pics:




Hopefully in the coming months I will be making additional upgrades, hopefully further boosting performance. Its the good stuff!
Additionally, you can find some more detail and build logs on my website. http://www.austin-b.com/prius-motorbike-the-bike-of-motor-science/
 
I'm surprised that nobody else has replied to this. I found it quite interesting. Thank you for posting. I drilled down and checked out a bunch of your projects, as well as Bayley's. I must confess that a great deal of it was over my head, but that's only made me more curious and inspired me to up my game and learn more.
 
Hey, thanks for the reply! :) IPMs are good stuff- i definitely recommend learning as much as you can about them, as they are very useful. Doing your own motor control is also really fun- extremely difficult, and very annoying at times- but a lot of fun nonetheless. And very cool. If you have any questions, please ask! :)

Also, I never posted a video. Here it is. On this run I *just barely* hit 44.95 mph on a slight downhill, according to the data logger.
[youtube]Q9yDecKHtps[/youtube]
 
I've watched your video and it makes a great cool sound! nice project! but why did you go with a BMX frame? is it comfortable for you or small?
 
Ok.. this probably has to be the coolest thing ive seen on here for months. Thanks for sharing it with us!
 
Rube said:
Great project, nice to see the motor didn't go to waste. Did you fabricate the gears?
I got the gears from KHK, they can be found at www.khkgears.us

icherouveim said:
I've watched your video and it makes a great cool sound! nice project! but why did you go with a BMX frame? is it comfortable for you or small?
I went with a BMX frame for several reasons. The first was compactness. I live in the city, and storing a BMX bike where I live is bad enough. Additionally, if you don't plan on pedaling, you can sit lower because your legs never need to be fully extended. Another reason I chose the BMX frame was BMX frames are built very solidly, with thick axles and fat tires because they are meant to go off jumps and stuff. The final reason for BMX bike is that I found it for cheap on craigslist and thought it would be a hilarious vehicle for attaching a motor that is way too reasonably large onto :D

neptronix said:
Ok.. this probably has to be the coolest thing ive seen on here for months. Thanks for sharing it with us!
:D :D :D :D :D thanks!!

Nuts&Volts said:
Can you share the weight and overall dimensions of the final motor?
The motor has a diameter of 95mm, and the module is about 112mm tall. Here is a bad paint pic.


The mass according to the CAD model is 3.8kg, or 8.3 lbs. Its a pretty dense object, it is pretty much a solid block of steel and copper with very little air. Inrunners are very dense, both mass dense and power dense, none of this air-filled outrunner nonsense!

I am currently writing up a technical document which details a lot of this project. My website contains all the build logs, but most of them were written at 3 or 4 am (lol) so they are a pretty long read and are hard to understand. I'll post that document when I'm done.
 
Have you calculated the Kv of motor? (RPM's per applied volt)

Why such high voltage, 160V? Using 48V or 72V would have been much more common (72V is easily made with two common 36V packs in series). One of the great things about non-hub builds is that the external gears can be easily changed, rather than being forced to raise or lower the voltage to change RPM's and top speed.
 
The Kv of the motor appears to be somewhere around 40.

Four big reasons for high voltage that I could think of:
1) The motor is wound to be run off the Prius HV pack, 208 volts. Rewinding an inrunner by hand is almost certainly a no-go.
2) Higher voltage = less amps. If I were to rewind the motor and go with a 48v system, keeping power constant (lets say 2.5kw) the amp draw would decrease from 18 amps from the battery to about 52. The battery wires now need to be 3x as thick. You also need much larger connectors, larger PCB traces, etc for a low voltage system. Higher voltage = smaller wires, at least to a point.
3) Between 60v and 150v is this awkward middle ground where both mosfets and IGBTs don't operate very well. Mosfets are good between 12 and 60 volts, and IGBTs are good past 150v or so (really 200+ is desirable). A 72v system means you really need 100v mosfets, which is solidly in the awkward middle ground of poor efficiency.
4) There are tons and tons of three phase IGBT modules designed for modern household appliances, meant to run off rectified 120 or 240 depending on the country. I used the FNA25060, there are a ton of similar options in the same power class. There are very few three phase mosfet bridges with integrated gate drive floating around. If you want to use these IGBT modules, high voltage is the way to go.


Really the only thing different for a high voltage system is the switch from MOSFETS to IGBTs. And you just have to be a bit more careful not to lick your batteries....
 
Just make sure you don't have a phase wire touching the frame or other metal parts. A few months ago I rewound my motor and I had a stray wire poking out of the wye termination bundle. Road vibration eventually moved it over a couple of mm to contact the casing. So under throttle touching any bare metal part of the bike gave a slight tingle. This was just 12s so no worries but at 40s the controller ac will be more than a tickle.
 
This is awesome. You said 6kW peak...How'd you come up with that number? Thermal measurements? Any idea what the peak RPM capability is...Like can you tell if there are significant rotor losses past a certain point?
 
Nice conversion and reuse of apparently great parts from the junkjard.
The BMX might be ok for tests, but i would put this drive unit at least on a larger frame with suspension. I think a Q76R frame or a similar one where the motor can be mounted to the swingarm would be a good base :wink:

fpvdude said:
The Kv of the motor appears to be somewhere around 40.

What is the no load RPM and have you ever measured the no-load consumption?
The 40 RPM/V multiplied with a battery voltage of 160V would be about 6400RPM. 160V... WOW :twisted:

regarding IPM motors: i know they respond very well to field weakening, but isn't the max usable RPM still limited by eddy current and hysteresis losses?
 
district9prawn said:
Just make sure you don't have a phase wire touching the frame or other metal parts. A few months ago I rewound my motor and I had a stray wire poking out of the wye termination bundle. Road vibration eventually moved it over a couple of mm to contact the casing. So under throttle touching any bare metal part of the bike gave a slight tingle. This was just 12s so no worries but at 40s the controller ac will be more than a tickle.

Oof- yep, thats a good point- if a short happened it probably would happen inside the motor. I checked for continuity between the motor phases and the housing yesterday, and luckily found no shorts. Probably a good idea to do this test every month or so. I believe most cars that have have high voltage systems have grounded shields around all wires. If any single one wire contacts the ground shield, the car immediately opens its battery contactor. This is meant to save firemen who might be using the jaws of life to pry people out of the car, and happen to slice through some wires. Don't quote me on that though.

160v is less than the 170 peak voltage of the wall, so while it will not feel good it definitely won't remove fingers or anything. I suppose though it could be very bad if you happened to touch the wire while riding at high speed, but that is very unlikely. Luckily the wires which carry the full 160v are only about a foot long, and not super exposed.
 
coleasterling said:
This is awesome. You said 6kW peak...How'd you come up with that number? Thermal measurements? Any idea what the peak RPM capability is...Like can you tell if there are significant rotor losses past a certain point?
The peak RPM achieved when traveling at 50mph is a sizzling 16,000 RPM.. sure makes a nice whine. IPM motors can be pushed pretty hard in terms of top speed because the magnets are physically retained with the rotor steel. I haven't done the math on this rotor to see at what speed it would actually explode at.
In terms of hysteresis and eddy current losses at high speeds, I actually have absolutely no idea how to model or estimate those. I am guessing they are significant at high speed, but the motor gets hot anyways at high speeds due to the amount of power going though the motor to push me through the air. I guess you could find out how much losses by doing some no-load testing. However, even then, a solid number for eddy current/hysteresis losses would be.

In terms of those power numbers, the motor produces 7Nm of torque about 6000 RPM. This is about 4 kw. If you up the battery voltage from 160 to 240v, the power *should* linearly scale to 6kw.

madin88 said:
What is the no load RPM and have you ever measured the no-load consumption?
regarding IPM motors: i know they respond very well to field weakening, but isn't the max usable RPM still limited by eddy current and hysteresis losses?
The no-load speed of the motor is very, very fast. I did some testing at only 80v in which the motor hit 15,000 RPM not even at full throttle.
[youtube]vOo4xejHO4A[/youtube]
The reason the no-load speed is so high has to do with your second question. IPMs field weaken very, very well compared to SPM motors, meaning that the no-load speed can be extremely, extremely high, and you are correct that at a certain point the only thing limiting speed is eddy current/hysteresis losses. However, I'd guess on this motor that limit occurs above 20k rpm, above the range in which I'm using it. In my case, the maximum usable RPM is limited by the number of volts of my setup and how hard I can field weaken. As you field weaken harder, torque drops off a lot, and eventually air resistance catches up and the motor can't push the bike any faster.
TLDR, no-load speed for an IPM motor is sort of a trick question because of the power of field weakening, and the usable RPM is limited more by the number of volts you have and how hard you can field weaken before the motor overheats.

The only no-load tests I did were off power supplies and I forget exactly how much it pulled (maybe 5-10a off the 80v power supply to spin it at 15000 rpm?). However the no-load consumption is again kind of a trick question because of the power needed to field weaken the motor. For example, the motor could pull 100w idling at 6000 rpm if you have a 160v bus voltage, but then could pull 500w if you have an 80v battery to maintain the same RPM.

Sorry for these somewhat convoluted explanations- hope at least some of this makes sense.
 
spinningmagnets said:
Do you think a more common ebike controller that might work with this motor?

Unfortunately an off-the-shelf controller would not likely work with this motor unless it was a very special one. Most controllers are designed for SPM motors, where the maximum torque per amp solution is to put all the current on the Q axis. IPM motors require D axis current to unlock their nice benefits such as field weakening and reluctance torque, the features which make IPMs worth using.

If you have a controller which can set D axis current, it would work, otherwise it would still probably work, but badly.
 
Have you been able to figure out a thermal limit? Looks like there's not much advantage to going with higher voltage due to the already high rpm's, just means more gearing. How long could it do double or even triple the current you're using now at, say, 30% duty?
 
amberwolf said:
Perhaps the Lebowski controller can do this; or could be modified to do so. Similarly, Incememed's SFOC5 might, too.

I am not very familiar with either controller unfortunately. If they use FOC, they they probably could run this motor just fine. If they use block commutation, then the motor would still probably run, but you would be unable to really take advantage of what makes the IPM worth using.
 
coleasterling said:
Have you been able to figure out a thermal limit? Looks like there's not much advantage to going with higher voltage due to the already high rpm's, just means more gearing. How long could it do double or even triple the current you're using now at, say, 30% duty?

Thermal limit: at 35 phase amps the motor got pretty toasty on the dyno stand, so I'd say this is a pretty solid limit. On the dyno stand we were only running about 30% duty cycle so I'd say 35 phase amps is a pretty hard max.

In regards to increasing the volts, your assumption that more volts = more RPM is not entirely correct. The motor only reaches 16,000 RPM due to the fact that I am doing a ton of field weakening. Without field weakening, the motor tops out at about 6500 RPM. After this, I use field weakening to keep the motor spinning, but this causes a huge dropoff in torque.
Here is a simulated torque surface running at 150 volts on a maximum of 35 phase amps, up to 50mph. Notice how torque is only high for the lower ~20% of the speed range, and afterwards torque drops off pretty quickly.

torquecurve_zps9llgoe1o.png


Here is the same torque curve but with a bus votlage of 250 volts instead of 150. Notice how the torque remains high for a little longer, and also how the torque at higher speeds is vastly improved.

250vtorquecurve_zpsuauor1ns.png


We always think that volts = speed and current = torque, but this is not always true with regards to IPM motors. What is going on here is that to achieve high speed at a battery voltage of only 150 volts, the controller has to field weaken *really* hard to get to high speeds. This means that torque at high speed is exceedingly poor. When you increase the bus voltage, the controller has to field weaken less hard, and can therefore put more of the amps into producing torque.
 
Thanks for the response! I missed that you're actually running field weakening somehow, sorry. Reading back through, a Kv of 40 is pretty reasonable. Of course field weakening is extensively used in any commercial application of IPM's, which makes perfect sense. Pushing the torque knee out by running the higher voltage would certainly be beneficial.

Have you quantified, or do you have an idea of the proportion of reluctance to magnetic torque? I would think it can reasonably be driven by a standard controller (definitely sensorless---I've done this on several IPM's), just without the benefit of tuning to take advantage of the reluctance torque capability.
 
coleasterling said:
Have you quantified, or do you have an idea of the proportion of reluctance to magnetic torque? I would think it can reasonably be driven by a standard controller (definitely sensorless---I've done this on several IPM's), just without the benefit of tuning to take advantage of the reluctance torque capability.

We did a bit of dyno testing on this motor, sweeping through 30 phase advances to find the optimal torque per amp setpoints at low speeds. This data was used to generate a stall table, and through other methods we were able to get a complete lookup table with acceptable performance. With all the current on the Q axis (PM torque only) we got 5.5 Nm of torque. With the optimal reluctance torque angle, this increased to 7Nm. So, I guess at stall only 20% of the torque is reluctance torque. Honestly this is a bit less than I expected- we've tested some other motors and on some motors reluctance torque can account for nearly half of the torque at stall.

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.
 
fpvdude said:
We did a bit of dyno testing on this motor, sweeping through 30 phase advances to find the optimal torque per amp setpoints at low speeds. This data was used to generate a stall table, and through other methods we were able to get a complete lookup table with acceptable performance. With all the current on the Q axis (PM torque only) we got 5.5 Nm of torque. With the optimal reluctance torque angle, this increased to 7Nm. So, I guess at stall only 20% of the torque is reluctance torque. Honestly this is a bit less than I expected- we've tested some other motors and on some motors reluctance torque can account for nearly half of the torque at stall.

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

Very interesting stuff!

The guy from the link also used a motor from an EV as you did, the Kia HSG (hybrid starter & generator) which also features an IPM rotor.
I see already some builds coming with motors from the junkjard 8)
The special casing shape of those motors might be often a problem, but if someone has access to CNC machining like you that should be no big deal (though such conversions can be really time consuming).

I like the graph where you can see how much torque can be gained by shifting the angle from pi/2 (100% Q-axis current) to pi (100% D-axis current).

timeseries.jpg


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

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?
eg: Infineon 120% speed, timing on RC controllers (like 10, 15, 20°), Adaptto OVS timing (which is in degree from 0-7°)

Sabvoton or ASI controllers have a separate setting for flux weaken current which should do what those IPM motors really need :)
 
Back
Top