# Highlander Hybrid and Prius motors



## e*clipse (Aug 2, 2009)

To start out with, here are some exterior pics of the rear differential.
Not too much exiting stuff here.
Top right: Right side. That black thing to the right of the output shaft is a piece of cast-iron. It is static and removable; I suppose it's for vibration  There are two connectors on the upper right side. The one on the left is a 6-pin connector for a resolver. The one on the right is a 3 pin connector for a temperature sensor. (I will go into more detail later)

Top left: Front
Second row, left: Left side of motor
Second row, right: Front of motor
3rd row: Top of motor
4th row: Bottom of motor


----------



## e*clipse (Aug 2, 2009)

In this set of pics, some easily removed parts and the right side cover are removed.

The first pic shows the 3 phase connector/extension. It's purpose appears to be an adaptor to the Toyota 3 phase wiring harness. The internal pins are the same as what's built into the motor.

The second pic shows the counterweight. It is a fairly roughly machined part that simply threads into the cover plate.

The third pic shows breaking open the right side cover plate. An ATF-like oil is draining out.


----------



## e*clipse (Aug 2, 2009)

Ok, here's the inside of the right cover plate. The sensor mounted to it is a resolver, that appears to have some clocking adjustment.

For those unfamiliar w/ resolvers, they are extremely accurate absolute position sensors. Basically they are rotary transformers, and work by being fed a sine wave, that is picked up by two coils positioned 90 degrees apart from each other. These coils feed back the sine and cosine of the current position. If you look closely at the rotor, you will see an oval shaped piece of metal (between the rotor and bearing) This piece varies the air gap, thus changing the signal at the output coils. 

Generally resolvers are found in high accuracy servo applications, like CNC machines. They are very robust and can also function well in an electrically noisy environment. 

My feeling is Toyota chose these for a number of reasons, and replacing them merely because I didn't know how they work would be possible, but both expensive and troublesome. 

Their signals can be translated to digital quadrature signals as one option. There are IC's made by TI that can do this for about $12. Other than that, I'm going to look into directly using their output in a DIY motor controller.

The other pics show how the sensor ouputs are run through the case. Each connector has plugs on both the inside and outside, with an o-ring seal between it and the case. BTW, one of mine was broken by a ham fisted junkyard removal.  Does anyone know where to get parts like this?


----------



## e*clipse (Aug 2, 2009)

One of the difficulties I had with this motor is finding any decent information about it. The real name for the Highlander Hybrid rear motor is either "Q211" or "MGR"

Finally, I stumbled upon some amazing testing done at Oak Ridge National Laboratories.  Here is where they are on the internets...
http://www.osti.gov/bridge/

All the testing was done on various generations of Pruises and Camries.
They did complete tear downs to measure all imaginable details, as well as testing torque, maximum speed, back EMF, gear losses, etc. Also, they did not simply use the Toyota controller - they used another design and double checked that the motors output. All the documents are free, and here are some good documents to check into:

"Evaluation of 2004 Toyota Prius Hybrid Electric Drive System"

"REPORT ON TOYOTA/PRIUS MOTOR TORQUE CAPABILITY, TORQUE PROPERTY, NO-LOAD BACK-EMF, AND MECHANICAL LOSSES – REVISED MAY 2007"

"REPORT ON TOYOTA/PRIUS MOTOR DESIGN AND MANUFACTURING ASSESSMENT"

"EVALUATION OF THE 2007 TOYOTA CAMRY HYBRID SYNERGY DRIVE SYSTEM"

Another really good paper is about the development of the Highlander Hybrid electric motors:

"Development of Traction Drive Motors for the Toyota Hybrid System"
www.e-mobile.ch/pdf/2005/321.pdf

There are many similarities between the motor used in the Q211 and the second generation Prius. Part of my goal in taking apart this motor is to see how closely they match.


----------



## Batterypoweredtoad (Feb 5, 2008)

Following with great interest.


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> Ok, here's the inside of the right cover plate. The sensor mounted to it is a resolver, that appears to have some clocking adjustment.
> 
> For those unfamiliar w/ resolvers, they are extremely accurate absolute position sensors. Basically they are rotary transformers, and work by being fed a sine wave, that is picked up by two coils positioned 90 degrees apart from each other. These coils feed back the sine and cosine of the current position. If you look closely at the rotor, you will see an oval shaped piece of metal (between the rotor and bearing) This piece varies the air gap, thus changing the signal at the output coils.
> 
> ...


e*clipse,

That looks like the same resolver as in the Prius. Here is a rather old video of me spinning the prius motor using 24volts. I also got it to push a car around at golf cart speeds with 48 volts from 4 lead acid batteries on their last leg.





I am using an eval board from Analog Devices to do the resolver to digital conversion.

My project got put on hold for quite some time but now I am back at it. My goal is to see how much power these Toyota motors can really put out.

I have been doing quite a bit with the Prius inverter as a battery charger and as DC to DC converter to do some battery cycling. I recently got another analog devices eval board to do simultaneous analog conversions that I needed for measuring the phase current outputs for FOC of the motor.

I hope to get the time for working on the motor control again very soon.

Good luck
Jeff


----------



## e*clipse (Aug 2, 2009)

Very nice work Jeff! 

I see a lot of opportunity for cheap Pruis transmissions. There are soooo many Priuses out there. Most people won't have a clue what to do with them, so they should stay pretty cheap. I checked on prices for the Prius and Camry (70kW) transmissions, and they range from about $500>$1000.

Did you try to get the motor running open loop?

What year of Prius is it from? Did you get measurements of the rotor?

Have you figured out a way to bypass most of the gearing stuff for a simple single speed drive?

Good luck with that - I'm extremely interested in how it goes.


----------



## e*clipse (Aug 2, 2009)

Here is some info from the ORNL paper "REPORT ON TOYOTA/PRIUS MOTOR DESIGN AND MANUFACTURING ASSESSMENT"

It shows the differences between the first and second generation Prius motors, along with giving some important dimensions.

First, the output curves. Note the increase in power from 33kW to 50kW. Torque increases from 350Nm to 400Nm. This was achieved without increasing the size of the motor. These numbers are tested in the other ORNL papers.

Second, note the 2004 stator and rotor. I'll post a pic soon which shows the MGR stator and rotor.

3rd & 4th pics are the stator and rotor dimensions and weight. I'll verify the rotor dimensions on my MGR soon...

The last pic show the rotor stampings from the 1st & 2nd generation Prius motors. Changing to a V shaped permanent magnet was instrumental in increasing the output power. Technically, these motors are "Interior Permanent Magnet Synchronous Motors." They rely on reluctance (like a switched-reluctance motor) to provide power past the base speed.


----------



## Arlo (Dec 27, 2009)

Wow good thread. I was/am very interested in these motors.


----------



## e*clipse (Aug 2, 2009)

Here is the stator and rotor of the MGR with the right side cover plate removed. Compare this to the 2004 stator in the previous post. Like I said, I'll get rotor dimensions to verify the similarity.


----------



## Arlo (Dec 27, 2009)

Do you have measurements on the highlander rotor?


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> Very nice work Jeff!
> 
> I see a lot of opportunity for cheap Pruis transmissions. There are soooo many Priuses out there. Most people won't have a clue what to do with them, so they should stay pretty cheap. I checked on prices for the Prius and Camry (70kW) transmissions, and they range from about $500>$1000.
> 
> ...



I agree that they are cheap and may have some untapped potential.

The video is from a Gen1 prius that I got for free as a reject from a local transmission shop. It may have some defect that I haven't found yet.

To spin the motor I observed the BEMF of the motor in relation to the resolver output on the scope to get a reference point. I then modulated the phase voltages to track the BEMF based on the resolver readings I was getting. No current control at this point.

However the big discovery for me was when I put the motor in a car under a load and had some problems. I was trying to drive the motor like a BLDC motor which worked fine without being under load on the bench. Come to find out the reluctance torque is very significant even at low speeds. By advancing my phase voltage about 30 degrees everything worked much better. This phase shift also matches up with the stall torque graph in one of the ORNL report. Still very crude but it made me research these internal magnet motors a little more.

I am now working with GenII motors and inverters. I am making some progress but it is slow going.

I have some crazy ideas on what I can do with these things. I am far from having a mature controller but the experimenting is a great hobby.

The package I am working towards is a liquid cooled 100kw peak drive train + 20kw battery charger, 12V DC/DC, electric air conditioning compressor for about $1000 by using salvaged Prius components.

Jeff


----------



## e*clipse (Aug 2, 2009)

jddcircuit said:


> To spin the motor I observed the BEMF of the motor in relation to the resolver output on the scope to get a reference point. I then modulated the phase voltages to track the BEMF based on the resolver readings I was getting. No current control at this point.
> 
> However the big discovery for me was when I put the motor in a car under a load and had some problems. I was trying to drive the motor like a BLDC motor which worked fine without being under load on the bench. Come to find out the reluctance torque is very significant even at low speeds. By advancing my phase voltage about 30 degrees everything worked much better. This phase shift also matches up with the stall torque graph in one of the ORNL report. Still very crude but it made me research these internal magnet motors a little more.
> 
> Jeff


VERY interesting! Thanks for the tip.  I was going to feed the encoder a sin wave from my signal generator and watch the output on my scope. I had no idea how to correlate that with the actual rotor magnets.

Have you found that phase advance to be constant, or change (with speed, etc) ?


----------



## e*clipse (Aug 2, 2009)

Ok, here are some very interesting (and somewhat discouraging ) dimensions. This rotor is significantly smaller than the Prius rotor.

Please take these numbers as "comparative" They were measured with my shop calipers, so I wouldn't use these dimensions for anything critical, like bearing fits. I also apologize for the non-SI units. 

Rotor laminate OD: 5.825"
Rotor laminate width: 1.8" Width with both endcaps: 2.368"
Bearing OD's: 2.675"
Drive spline OD: 1.375"
Drive spline ID: 1.235"
Drive spline tooth #: 30
Resolver rotor width: 0.156" (made of laminates)

The laminates had 8 flats on the OD, corresponding with 8 notches on the encoder side endcap and 8 flats on the spline side endcap. There are 8 highly magnetic regions in the rotor.


----------



## e*clipse (Aug 2, 2009)

Well, THAT throws a big monkey-wrench into the whole "it's the same as a Prius motor" theory. 

Just to make sure I wasn't too insane, I verified the specs (right off a Toyota Highlander spec sheet )



> Motor Generator Rear (MGR)
> -Function
> Drives rear wheels, regeneration during braking
> - Type
> ...


I guess it sort of works out if you plug these #'s into the classic Horsepower sanity check equation, IF the rpm is high enough.

HP = Torque (ft-lb) * n (rpm) / 5252
Torque = 68 hp *5252 / 4610 rpm = 77 ft-lb
rpm = 68 hp * 5252 / 96 ft-lb = 3720

However, 96 ft-lb * 610 rpm/ 5252 = 11 hp.

Something's not right here. Could they have included the gear reduction?

Any suggestions from any BLDC motor experts out there??


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> VERY interesting! Thanks for the tip.  I was going to feed the encoder a sin wave from my signal generator and watch the output on my scope. I had no idea how to correlate that with the actual rotor magnets.
> 
> Have you found that phase advance to be constant, or change (with speed, etc) ?


I forget the resolver excitation frequency I used. For some reason I think I read 7kHz somewhere but I am not using that. My documentation is sketchy at best and I will need to revisit the resolver at some point since my Resolver to Digital board has the Loss of Signal Error LED constantly on but it still gives me the position so I moved on.

You can spin the motor by hand to produce back emf while apply the resolver excitation. Once I had the bemf to resolver alignment I could do the commutation electronically based on rotor position without regards to phase current just to get it spinning. This would be like running a DC motor with voltage control.

As far as the phase offset needed to take advantage of the reluctance torque being constant I think it is pretty close to fixed but don't take my word for it. I think that is why the ORNL report has the stall torque graph in it to show the interaction of magnetic and reluctance torques.

I forget all the technical jargon but Id=0 does not produce max torque for the minimum amount of stator current for these motors. In some Id Iq graphs showing the Max Torque Min Current for IPM motors there is a slight bend. A straight line (which would represent a fixed offset) looks like a good enough fit for me. The field or flux (not sure which is appropriate) weakening part of the control happens when I run out of voltage headroom and it looks as simple as increasing the Id magnitude with respect to Iq.

My Prius transaxle has two motors in it. Once I get the phase current control working the way I want it to I can use one motor to load the other and perhaps get some power efficiency mapping while adjusting the phase shift angle. You could do the same with two of your motors.

The main thing that I am working on right now is trying to figure out the best way to capture the analog signals coming out of the inverter that represent the phase currents. They are very noisy.

I am going to finish my battery charger development before I get back on the motor control part. However all the things I am having to learn for this piece (like how to measure currents and how to program the micro processor) will apply.

Regards
Jeff


----------



## PStechPaul (May 1, 2012)

I'm not an expert on BLDC motors but I found some references that show a peak torque at a lower RPM and then a lower rated torque at the highest RPM where power is greatest. 
http://motion.control.com/thread/1276775704
http://www.linengineering.com/line/contents/stepmotors/pdf/BrushlessDC_Basics.pdf
http://en.wikipedia.org/wiki/Talk:Brushless_DC_electric_motor
http://www.appliancemagazine.com/editorial.php?article=551
http://what-when-how.com/electric-m...-load-and-peak-torque-values-electric-motors/

It seems unusual for the peak torque to be at such low RPM, but the rated torque (77 lb-ft) is only a bit less than the peak torque (96 lb-ft). It may be related to the higher power losses at higher RPM (and higher voltage), where heating and high frequency core losses may reduce the safe level of continuous torque.


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> VERY interesting! Thanks for the tip.  I was going to feed the encoder a sin wave from my signal generator and watch the output on my scope. I had no idea how to correlate that with the actual rotor magnets.
> 
> Have you found that phase advance to be constant, or change (with speed, etc) ?


Another tip to align rotor and resolver is to apply a dc voltage to two phases at a time and you can step the motor like a stepper motor while recording the resolver outputs.


----------



## e*clipse (Aug 2, 2009)

Thanks for all the tips, Jeff! It really helps to hear from someone who's been there. 
Thanks also PSTechPaul - those last two links combined w/ the ORNL papers should lead somewhere...

Right now I'm trying to resolve what seem to be some really big motor output issues. Something in their specs just refuses to make sense. I can make things work by fudging numbers (like the base speed of the motor.)

Let's assume this motor has a torque-speed and power-speed relationship similar to the ones I posted for the 2004 Prius. Obviously, with the rotor being a completely different diameter and length, this curve will be different, but follow a similar pattern.

The Highlander Hybrid has a "governer limited" top speed of 114 mph, according to Car&Driver:
http://www.caranddriver.com/reviews/2011-toyota-highlander-hybrid-road-test-review

With stock P245/65 R17 (Base) tires, the tire circumference would be 93 inches, and would make 681.5 revolutions/mile. Thus, the rear axle would be spinning @ 1294.9 rpm. With a gear ratio of 6.86:1, the motor would be spinning @ 8882.7 rpm. It would probably be safe to say the rotor is balanced to spin at 10,000 rpm, although a gernading rotor would make a very exiting stop. 

IF the 50kW specification is correct, the peak horsepower (assuming a curve similar to the 2004 Prius) occurs right around or slightly after it's base speed. Further assuming the 96 ft-lb torque specification is corrrect, then the corresponding rotor speed would be:
rpm = HP*5252/Torque = 68hp * 5252 / 96ft-lb = 3720 rpm

This is nearly double the Prius' base speed, but corresponds roughly with the base speed spec of 610 RPM if the 6.86:1 gearing is included. Perhaps they were referring to the AXLE speed? 

So, given that the rotor can physically handle high rpm, is it reasonable to think the base speed is 3720 rpm?

Because the diameter is smaller, would the back EMF generated be smaller than the Prius? Otherwise, the voltage is going to be much higher than 650V. In fact according to the ORNL test, at 6000 rpm, the Prius back EMF was 850V peak.

I'm still trying to wrap my head around the fact that this significantly smaller rotor could put out the same power. I've seen it frequently in examples like geared starter motors, but this situation has some serious back-EMF limits. I mean, I really don't want to have a 1000V battery pack! 

Would any motor experts out there have any advice for practical limits that can be put on these rough analyses?


----------



## major (Apr 4, 2008)

e*clipse said:


> Because the diameter is smaller, would the back EMF generated be smaller than the Prius


Don't forget that the generated voltage is proportional to the series turns in the circuit; ie. # of turns per coil and the coil connection scheme.


----------



## Arlo (Dec 27, 2009)

e*clipse said:


> Ok, here are some very interesting (and somewhat discouraging ) dimensions. This rotor is significantly smaller than the Prius rotor.
> 
> Please take these numbers as "comparative" They were measured with my shop calipers, so I wouldn't use these dimensions for anything critical, like bearing fits. I also apologize for the non-SI units.
> 
> ...


 That's encouraging for someone like me....  Thanks for posting the numbers.


----------



## e*clipse (Aug 2, 2009)

Arlo:


> That's encouraging for someone like me....


And it should be for me as well!  I was just stuck with the thought that it should be physically similar to a Prius. Lighter is almost always better. 

Bottom line: The dimensions and my rough analysis agree.

I simply needed to read & understand the link I posted previously:
"Development of Traction Drive Motors for the Toyota Hybrid System"

That paper details how Toyota thought it would be better to make the motor lighter, and details how they did it. Granted, they are talking about the MG2, not the MGR. However, there are enough details in the MGR that match to say the MGR is a smaller version of the MG2 from the Highlander, not the Prius.

Some specific changes:
1) design the rotor to be able to physically handle 12000 rpm. 
To do this, the "bridges" that surounded the magnets were optimized.
2) Don't change the maximum DC bus voltage of 650V.
To do this, the motor relies more on reluctance torque and field weakening
3) increase the proportion of reluctance torque to magnet torque.
To do this, the magnet shape and rotor OD were optimized.
4) improve the efficiency, particularly in the frequently used area of the speed-torque map.

The graphs below are from the MG2, and match the Toyota Highlander spec sheet. I think it would be reasonable to scale them for the MGR.


----------



## jddcircuit (Mar 18, 2010)

e,
The smaller rotor you have resembles the smaller motor in the Prius called MG1. I don't have any dimensional measurements. MG1 spins about twice as fast as MG2 for the same voltage so yes the bemf is half for the same rpm.

I am hooking MG1 and MG2 mechanically together so they will spin at the same speed. This way MG1 will still be able to provide torque at higher speeds when MG2 is out of voltage headroom. Hopefully this combo will make for a better all electric drive.

A single motor with the proper characteristics would be more simple but this is what I have to work with for now.

j


----------



## toddshotrods (Feb 10, 2009)

I've been subscribed and limping along through the technical discussion. I've been searching for a more open source set of "internals" to develop a motor for my e-bike, Scrape. This sounds and looks tantalizingly like what I am after - 12K being the "jump-in" tipping point for me. I doubt that I'll be able to contribute much on the electronic side of things, other than a lot of pesky questions, but if this works and you guys don't mind me riding your coattails I would be willing to openly share what I do physically.

When I find the right "guts", my plan is to develop my own CAD/CNC case. Scrape's specific case will be a bit intense and expensive to machine, but if there are people interested in adapting this motor to other applications (than using the Prius or Highlander cases) I would be able to easily simplify the design to suit the need. A person would be able to download the files and have the case cut, or prototyped and cast, locally or through an online vendor.

The "IFs" are whether this motor will work for me, and if there is enough interest in this for it to benefit the community? In the meantime, a couple questions:


This is the MGR motor you're disassembling and measuring e*clipse, correct?
What is the O.D. of the stator?
Fascinating, fun, thread!


----------



## tylerwatts (Feb 9, 2012)

Todd I've been following this also wondering about rehousing these motors. I'd certainly be interested. Remember 12krpm would require gearing down. I'd think using the two motors and planetary gear set as a variable ratio transmission would be great for a bike though very big and heavy. Otherwise only one motor MG1 with a reduction gearing to drive a bike. 

Sorry for the thread hijack. 

Jeff, how easily can the motor be Rd moved from a transmission for this purpose? Could we use the gears to create a reduction drive also and 'recycle' the parts? Thanks


----------



## e*clipse (Aug 2, 2009)

jddcircuit:


> The smaller rotor you have resembles the smaller motor in the Prius called MG1. I don't have any dimensional measurements. MG1 spins about twice as fast as MG2 for the same voltage so yes the bemf is half for the same rpm.


Yes, it does... I was just noticing that as I re-read one of the ORNL papers this morning. I wonder how much power that generator can kick out. That wasn't addressed in those ORNL tests. The other thing I'd like to find out is what the wiring scheme for the stator is. That would help a lot for figuring out the maximum current for this (MGR) motor. 

Major - would you have any suggestions, short of disassembling the stator, for figuring out the stator wiring scheme?

Welcome tylerwatts & toddhotrods!  No, you're not hijacking this thread as far as I'm concerned. In fact, I had a similar evil plan....I am considering making a 2 motor case for a 100kw module.

To answer Tylerwatts first point - the drive has a 6.86:1 reduction built in.

To answer toddshotrods' questions:
1) Yes, it is a MGR
2) What accuracy would you like? Is "big ruler" type accuracy ok? Right now I can say the OD has 3 evenly spaced tabs for mounting bolts.

It seems to me that building a case is very do-able. On the other hand, making gears is difficult and all that R&D Toyota put into those motors would be nearly impossible - might as well put their work to good use! 

One of the goals of this disassembly is to figure out if putting the motor in another case is feasable. I'll definitely post more picks along the way and try to obtain any dimensions folks are interested in.  

So far I've learned a couple things:
1) parts are all precision slip fit into the case. Fortunately I haven't run into any press or shrink fits. I've read the stator fits the case in a similar manner. Right now, I don't want to remove it.
2) (I'll post picks showing this) The case has an intricate oil circulation scheme built in. It uses the differential drive gear for a pump. Also, the motor's stator relies on this circulation/oil flinging to cool the windings. So, it would be very bad to run this thing backwards. Additionally, this oil circulation will need to be replicated in any different case, so there are some opportunities/challenges involved with that.


----------



## toddshotrods (Feb 10, 2009)

e*clipse said:


> ...Welcome tylerwatts & toddhotrods!  No, you're not hijacking this thread as far as I'm concerned. In fact, I had a similar evil plan...


Thanks and awesome! 






e*clipse said:


> ...To answer toddshotrods' questions:...
> 2) What accuracy would you like? Is "big ruler" type accuracy ok?...


"Big ruler" is fine at this point - I just want to see if the size is in the ballpark of what I can stuff in my bike. If it looks good, I will eventually get a diff, and disassemble it to get super accurate measurements.






e*clipse said:


> ......the OD has 3 evenly spaced tabs for mounting bolts.
> 
> It seems to me that building a case is very do-able. On the other hand, making gears is difficult and all that R&D Toyota put into those motors would be nearly impossible - might as well put their work to good use!
> 
> ...


I noticed the tabs and figured those were for mounting the stator. I can usually reverse engineer things if I get my hands on them, so if and when I get one I should be able to get all that stuff translated into CAD - from there it's usually just a matter of how a person wants/can afford to realize it...

I'm not planning on any internal gear reduction. That will be by conventional chain and sprocket in my case. I just wanted a motor with 10K rpm potential to make trying to kill myself a more feasible proposition! 


Thanks, looking forward to exploring this with you guys!


----------



## e*clipse (Aug 2, 2009)

*Highlander Hybrid gearbox*

Here's the gearbox side of the MGR.

The pic of the gearbox is upside-down, sorry about that. In this view the differential spins clockwise when going forward. Oil is pulled up around the outside then deflected to the other half of the gearbox when it reaches the top. From there, it is deposited into multiple "holding tanks" (those lumps that seemed to have no purpose when viewing the MGR from the outside.)

These holding tanks have small holes near their bottoms to meter oil flow out to bearings, cooling the stator, etc.

The third shot is the differential; it also has interesting lubrication channels.


----------



## e*clipse (Aug 2, 2009)

toddshotrods said:


> Thanks and awesome!
> 
> I just wanted a motor with 10K rpm potential to make trying to kill myself a more feasible proposition!


LOL! That's sort of my goal. 

I want to build a sleeper that can use my extra solar power for daily commutes. But it will also have a wild side: AWD w/ a motor for each wheel. Torque vectoring will make for fun track days!

BTW, the stator OD is 235mm (not including the tabs)


----------



## e*clipse (Aug 2, 2009)

Here's some stator info that might help determine what this bugger can really do.

There are 48 slots in the stator.
The wires are grouped into 8 groups around the stator (see pic)
The phase connections are split into 3 wires each, color coded red, green and white.
To my best ability to count, there are 12 winding wires connect at each phase connection. (see pic)

The winding wires measure 0.030" in diameter with insulation.
I believe the motors are connected in a wye pattern. The phase to phase resistance (measured w/ a Fluke dmm) is 0.3 Ohms.

To figure out the max current, I checked out these sources:
http://www.powerstream.com/Wire_Size.htm
www.smma.org/pdf/conferences/2010/F10 Current Density.pdf
https://www.highpowermedia.com/blog/3296/electric-motors-cooling-concepts


The easiest was powerstream's suggestion of 9A/wire this would limit motor current to 12*9A = 108A.
The other sources were much more comprehensive and suggested current densities between 7000A/in^2 to 15,000A/in^2, depending on cooling method, duty cycle, etc. This would result in maximum currents ranging from 51A to 110A.

Am I in the right ballpark w/ this?


----------



## jddcircuit (Mar 18, 2010)

I think your calculations of about 100 amps sounds right for this motor but with the temp sensor and with the right cooling you might be able to safely get more for a while.

My hope is the larger motor in the Prius (MG2) can handle 200 amps and the smaller MG1 can handle 100 amps. That way I may approach 150kw with a 500 volt pack.

However I did read that at these currents the motor heats up very quickly in someones thesis paper that I can't locate at the moment.


----------



## jddcircuit (Mar 18, 2010)

tylerwatts said:


> Todd I've been following this also wondering about rehousing these motors. I'd certainly be interested. Remember 12krpm would require gearing down. I'd think using the two motors and planetary gear set as a variable ratio transmission would be great for a bike though very big and heavy. Otherwise only one motor MG1 with a reduction gearing to drive a bike.
> 
> Sorry for the thread hijack.
> 
> Jeff, how easily can the motor be Rd moved from a transmission for this purpose? Could we use the gears to create a reduction drive also and 'recycle' the parts? Thanks


Everything comes apart very easily. I have considered some configurations that only use the smaller MG1. It appears rather doable to remove MG2 stator and rotor and cut away all the casing for it while still keeping MG1 and reduction gearing intact for a light weight application. You will need to plug some openings to keep the transmission fluid in but it is not under any pressure. ( at least for the Gen 1 Prius, before 2004). I haven't take the Gen II transaxle apart yet but I expect very much the same thing.

You could also just use MG1 stand alone cut away all the casing for reduction gearing and for MG2. MG1 has a splined open center rotor which looks ideal for installing a shaft and sprocket. I am thinking they will mount nicely on an outboard boat motor.

Lot's of cool Frankenstein possibilities if you ask me.


----------



## major (Apr 4, 2008)

e*clipse said:


> Major - would you have any suggestions, short of disassembling the stator, for figuring out the stator wiring scheme?


With this: 










It's kinda of tough  But possible. Need an accurate resistance measure. Take a string and get the LMT (Length Mean Turn) which is the average distance for one turn in the coil. Also need the total cross sectional area of the coil. Then use a D²N calculation to figure the number of strands in the coil. The resistance per unit length of the wire size considering the parallel strands. The number of phases and number of poles. The connections, star or delta, and the series parallel coil or coil group connections. Follow logical calculations for total length of wire in circuit with various connections until calculated resistance matches measured value.

Or take a look at the other end of the stator. Photo is of the nodes. Opposite end should have a clearer view of the coil end turns. Knowing the parallel strands from the terminals should enable you to estimate the turns from the total strands in the end turn. You'd still need to figure the coil connection schematic to get the equivalent series turns for the machine constant, Kv.

Or can you measure the generated voltage at no load at speed for an Eg/RPM constant? With that you could normalize between machines with air gap areas and get the turns ratio assuming equal flux densities.


----------



## few2many (Jun 23, 2009)

Have you thought about changing from wye, to delta?


----------



## e*clipse (Aug 2, 2009)

jddcircuit: ORNL tested the 2nd gen Prius motor @ 250A for their locked rotor test. I think they found it could do more, but limited it because the testing they were doing required relatively long ( > 10 sec ) measurements.

I do plan to implement some sort of oil cooling system for this. It will basically consist of a circulating pump and small radiator; I may be able to simply tap the oil drain/fill holes for this. The main issue will be to ensure the motor always has enough oil, even if the circulating pump quits.

Major: Thank you very much for the help. I'm going to need to digest this for a while...  BTW, what sort of accuracy is necessary for the resistance measurement? 

I plan to get a set back EMF measurement. I do have a scope, and I *think* I can drive it at a fixed speed, maybe with my mill.

I don't exactly have ORNL type facilities here , so I'd like to get enough info to determine how to get the most from this motor. If this can be done w/o dynos and load cells, I'd love to hear about it.

few2many: To be perfectly honest, I don't know if its star or delta.  I assumed it was delta from the diagrams on the ORNL tests with the Prius motor.

noob 3phase motor question: what is the advantage of wye (or star) vs delta? Can it be changed w/0 taking the stator apart? I'm fairly sure I don't want to take it apart, as I figure Toyota knew what they were doing when they chose made it. Considering the subtleties they investigated when developing it, basic wiring should have been covered long ago.


----------



## tylerwatts (Feb 9, 2012)

Jeff sorry to keep digging, but you mention cutting away the housing. Can the stator not be disassembled from the housing rather than 'cut out' of it? Thanks.


----------



## e*clipse (Aug 2, 2009)

Yea! I got the resolver working. Currently feeding it a 10kHz sin wave.

Jeff: Is it me, or does the output of the resolver repeat every 90degrees (physically). If it repeated every 180degrees, that would make sense because there is a 2 lobe rotor...

Tylerwatts: You can simply unbolt 3 bolts & remove the stator.


Edit: I double checked the resolver, and when I set up the scope properly with an external trigger, it's pretty obvious that the sine waves repeat every 180 degrees, like jddcircuit says in post #41. 

I just want to make sure there is good info on this thread, and I'll post corrections along the way.


----------



## kennybobby (Aug 10, 2012)

It may be a 4x resolver used for commutation, especially since there are eight poles, i.e. 4 pole pairs. 
With 8 poles it takes 4 sine wave cycles from the controller to get one revolution of the rotor, or put another way, one controller sine wave results in 90 degrees of rotatation. 
This would match well with a 4-times resolver which outputs one complete sine cycle for 90 degrees of shaft rotation.


----------



## tylerwatts (Feb 9, 2012)

Thanks! Just what I needed to hear. Now if only these were easy to get hold of in the UK with it's crappy rules...


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> Yea! I got the resolver working. Currently feeding it a 10kHz sin wave.
> 
> Jeff: Is it me, or does the output of the resolver repeat every 90degrees (physically). If it repeated every 180degrees, that would make sense because there is a 2 lobe rotor...
> 
> Tylerwatts: You can simply unbolt 3 bolts & remove the stator.


Like eclipse says the stator slips into the housing and is held with three bolts. The cutting away possibility was only to preserve the nicely machined precision slip fit parts you might want.


I think I remember the resolver repeating every 180 mechanical degrees which made sense to me with the two lobes like you mention. So you get 2 electrical commutation cycles per each resolver cycle since there are 4 commutation cycles per mechanical revolution.

I also found that the alignment turned out not to be arbitrary. In the end it logically lined up with one of the motor phases so if you start to see a pattern you might consider rounding it off to match the closest motor phase.

The other thing that confused me if i remember correctly is that I had to keep reminding myself that I was measuring the phase differential of the bemf and I had to do some calculations (subtraction) to get a common reference point for each phase. I was flying blind with very little experience. I don't have instructions so I can't offer much detail. I remember being confused at many points but then later on they made more sense.

For example I am assuming that this motor is a Wye configuration so I would model it that way but I am not so sure. In my trial and error mode of operation two wrongs can make a right.

In the end I got close and then did some trial and error until things started working. When I was doing this I was unaware of the reluctance torque effects and trying to do the dc voltage one phase pair at time like a stepper motor, things are a little squishy. Rounding the alignment points off to logical resolver segments was helpful. The zero magnetic torque point is not necessarily the zero reluctance torque point.

The bemf alignment method might be better because I think it is solely the magnetic effects.

Good luck
jeff


----------



## toddshotrods (Feb 10, 2009)

e*clipse said:


> ...BTW, the stator OD is 235mm (not including the tabs)


Thanks.  So far, this is perfect. Hopefully, what's discovered/developed technically will ice the cake...

There usually always seems to be some obstacle that prevents these things from being adapted but, so far, it's almost like this motor was designed for us to reclaim and tinker with.


----------



## kennybobby (Aug 10, 2012)

*1/4 stator winding diagram (12 teeth)*

Edit Note: See post #65 below--revised again as it was found to be single coil per PPG and not concentric coils. 

Here is a [typical] winding schematic for the stator phases (red, green and blue=white) in a 3-phase motor with [concentric] windings in each phase pole group (PPG). This is just for 90 degrees so it repeats the pattern 3 more times for the entire stator.


----------



## e*clipse (Aug 2, 2009)

Regarding physical gearbox & motor stuff:
1) The MGR a very integrated case, from the stress and lubrication perspective. My guess is the Prius transmission case is as well; jddciruit will be able to answer that one.  I'm not sure what a person would do, cutting parts out, but it would be difficult to attach those cut out parts to anything without messing up either a location or a fit.  Also the oil distribution would need to be replicated. The oil system is an important part of the stator cooling system. I suppose it would be possible to use another form of cooling or derate the current.
2) Because I plan to build another case, I will get accurate positions for all the axles. As you can see from the pics, they are offset in both X-Y and Z. I plan to use my mill with it's DRO to get these measurements. Granted, it's not a CMM, but it should be close enough. Bearing fits can be derived from the bearings themselves.  I'll post the dimensions when I finish that.


----------



## e*clipse (Aug 2, 2009)

Regarding resolver stuff:

kennybobby & jddcircuit: Thank you very much!  That makes perfect sense - so there are 4 "electrical" revolutions for every physical revolution on an 8 pole motor.

How about building a silly simple open loop motor controller (it could be that first step in building a real motor controller) and running just enough voltage to get the motor to spin. The controller's open loop timing could be tracked on a scope along with the resolver. I remember one of the sensorless BLDC motor controllers in a Microchip app note started in open loop mode.

Thoughts?


----------



## kennybobby (Aug 10, 2012)

Would you be able to measure the stator lamination width, the stator ID, and maybe a tape measure to get stator OD--i'll run some wire length calculations to estimate resistance. 

i've seen surplus off the shelf controllers for brushless dc servos with resolver commutation fairly cheap--search for surplus servo controllers.


----------



## e*clipse (Aug 2, 2009)

Motor wiring stuff:

Ok, some of this is old-school, and I should understand it before even embarking on a project like this.  So, please have some patience for my stupid questions and definitely feel free to correct any misunderstandings. 

kennybobby: The motor wiring makes sense - if repeated 4 times for a 48 slot motor. The only thing is there appear to be 2 outer coils every 90degrees, each outer coil spanning 6 slots. Major zoomed in my stator shot - it shows fairly clearly. I just double checked the other side of the winding to verify this.

Wye vs Delta: It seems most schematics, like the illustrations in the Microchip app notes or the ORNL schematics show a wye configuration. For example, pg 10 of "REPORT ON TOYOTA/PRIUS MOTOR TORQUE CAPABILITY, TORQUE PROPERTY, NO-LOAD BACK EMF, AND MECHANICAL LOSSES"

When I look into wye vs delta, there is a lot of stuff about "wye-delta soft starting." Why use wye?  According to a Rockwell paper,with a delta connection, the motor coils see the full line-to-line voltage, and the resulting current is higher than that of a wye connection. The wye connection the voltage seen by a motor coil is reduced by the square root of 3, or V/sqrt(3). This reduces the current, resulting in softer motor starts.

This makes sense for an induction motor, where the inrush currents can be huge. If there is no control of the current (like an inverter), connecting the motor in a wye configuration would be a logical way of reducing inrush currents at start up. Once the motor is running, they are switched to delta.

According to wikipedia, "A motor with windings in delta configuration gives low torque at low speed, but can give higher top speed. Wye configuration gives high torque at low speed, but not as high top speed.[6]"
http://en.wikipedia.org/wiki/Brushless_DC_electric_motor

If I remember correctly, there was mention of series/parallel issue mentioned in the ORNL comparison of the 1st/2nd gen Prius:

From "REPORT ON TOYOTA/PRIUS MOTOR DESIGN AND MANUFACTURING ASSESSMENT:"



> How did Toyota improve the motor performance without increasing the motor size? In fact, the motor core length is even slightly shorter in the 2004 model (3.3 in. versus 3.5 in.). In dissecting the motor, ORNL researchers assessed that the windings of the 2004 and 2003 models have the same gauge wires, same number of turns per coil, same winding distribution, and the same stator punching. The only difference between the stators is that the windings are connected in series instead of in parallel in the 2004 model.


In the Wikipedia article, they refer to Delta as series and Wye as parallel - could this be what ORNL was referring to? Also, when comparing the statements about start up torque, Wikipedia seems to contradict Rockwell - but we are talking about BLDC motors vs induction motors.

In the context of this motor, it kind of makes sense that this motor is wound delta - there will be lower back-emf at high speed, and delta connected motors performs better at high speed, which was one of the Toyota design goals.


----------



## e*clipse (Aug 2, 2009)

kennybobby:

The stator measurements, measured @ the laminates:
OD: 235mm - the major diameter not including the mounting tabs
ID: 150mm - corresponds with the rotor diameter of 148mm > 1mm air gap.
Width: 45mm

I don't know if this makes a difference, but the "outer coil" (referring to the wiring diagram you posted) spans 6 slots on this motor. There are 8 of these coils on the stator. The others are buried and difficult to pick out, but it looks like the "inner coil" spans 4 slots, with the innermost two going to adjacent coil groups. (does that make sense?? )

Thanks for the help!


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> Regarding resolver stuff:
> 
> kennybobby & jddcircuit: Thank you very much!  That makes perfect sense - so there are 4 "electrical" revolutions for every physical revolution on an 8 pole motor.
> 
> ...


Tried it.
You can ramp the frequency from zero and you can get it to lock and spin up but it won't do much for you. You won't be able to produce much torque and stay synced.

I found this to be the easiest way for me:
I posted a video of the 2001 prius motor spinning in the earlier post. I also drove a car around at golf cart speeds with 48 volts of thrown out lead acid batteries using a silly simple controller and the 2001 prius MG2 motor.

All I had to do was to poll the rotor position using a Resolver to Digital eval board I bought for $100 and apply to appropriate phase voltages based on rotor position that I determined from my BEMF to resolver alignment experiment. I used a Gen 1 prius inverter and an Arduino board as the controller.

This method did not regulate or limit phase currents in any way but it is a way to spin the motor rather simply and guaranteed to stay synced up.


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> Motor wiring stuff:
> 
> Ok, some of this is old-school, and I should understand it before even embarking on a project like this.  So, please have some patience for my stupid questions and definitely feel free to correct any misunderstandings.
> 
> ...


It is my understanding that the 2004 prius motor produces more torque at less current than the 2003. This translates to higher bemf at a given speed thus the higher bus voltage and boost converter required in the 2004 model over the 2003. This higher voltage less current winding change could translate to higher peak power since the heat is a function of current which is less in the 2004.

The highlander electric differential may use a different winding configuration.

I still don't know if it is Wye or Delta.

Jeff


----------



## kennybobby (Aug 10, 2012)

i know the terminal lug shows 12 wires, but can you tell if the coil winding is grouped as 6-in-hand or 12-in-hand? If 6 then delta wound, if 12 then wye.


----------



## e*clipse (Aug 2, 2009)

kennybobby said:


> i know the terminal lug shows 12 wires, but can you tell if the coil winding is grouped as 6-in-hand or 12-in-hand? If 6 then delta wound, if 12 then wye.


What do you mean "in hand"  I have no motor winding experience; I've just read a lot about motors and remember a little bit...


----------



## e*clipse (Aug 2, 2009)

jddcircuit said:


> Tried it.
> You can ramp the frequency from zero and you can get it to lock and spin up but it won't do much for you. You won't be able to produce much torque and stay synced.
> 
> I found this to be the easiest way for me:
> ...


Perfect!  I'm not asking much; If it goes around while sitting on my desk, I'll be extremely happy. In fact - if it does produce any "usable" torque I'm libel to do something stupid, causing it to fall off my desk and smash my toe. 

If it can work - and it sounds like it should - to build a silly simple controller and then add layers of sophistication, it may be easier to debug things when they don't work.




> It is my understanding that the 2004 prius motor produces more torque at less current than the 2003. This translates to higher bemf at a given speed thus the higher bus voltage and boost converter required in the 2004 model over the 2003. This higher voltage less current winding change could translate to higher peak power since the heat is a function of current which is less in the 2004.


You're completely right.  It seems w/ the 2004, they boosted the voltage from 274V to 500V, then w/ the highlander boosted things yet again to 650V.

At the same time the maximum *practical speed* , limited by BEMF, of the Prius was about 6700RPM. This was DOUBLED to 12,400 RPM for the Highlander. (structural improvements were made to the rotor as well)

Since the rotors (for the MG2) are *roughly* the same diameter and it's still an 8 pole motor, something very substantial electrically must have changed, because the BEMF would be well over 1000V @ 12,000 RPM if you extrapolate the BEMF data from the Prius.

This raises another question: Does the bus voltage need to be at least the peak or RMS voltage of the back emf?  

All this is observations about the MG2; I would love to get some solid data on the MGR.


----------



## few2many (Jun 23, 2009)

Do the 12 wires go into the stator together (12 in-hand), or do they split, 6 in-hand going one way, 6 going the other? In hand is the wires paralleled as one. I believe, in another thread, or forum, the wye point was found and identifiable. A lot of wires going to a single connection point.


----------



## e*clipse (Aug 2, 2009)

few2many said:


> Do the 12 wires go into the stator together (12 in-hand), or do they split, 6 in-hand going one way, 6 going the other? In hand is the wires paralleled as one. I believe, in another thread, or forum, the wye point was found and identifiable. A lot of wires going to a single connection point.


I checked how the wires were split when they left the phase connection. As posted previously, there are three groups of 4 wires. They appear to enter the winding mass at approximately 120degrees apart. So, would this be 3 groups of 4 in-hand?


----------



## e*clipse (Aug 2, 2009)

Here are some details of the oil flow.

First, look at the gearbox cover. (last pic) The pic is oriented top-bottom as the case would sit on a vehicle. There are multiple oil reservoirs (2nd to last pic) that meter oil flow as it gets pumped to the top by the differential gear. Also note the oil drain below the output shaft on the left side. On the right side is an "inspection port" to ensure the oil level is correct, like a normal differential or transmission. This defines the static oil level in the case. There is also a fill port at the top of the motor's case.

There are many drains throughout this assembly, implying fairly large oil flow. The closeup of the output bearing shows one of these drains.

There are also small holes for metering oil vor various bearings, shown in the second pic.

There might be an opportunity to supply cooling oil for the stator here in the first pic. If you check out the last pic, oil flows to the space behind the right side bearing from the oil reservoirs above it. The port shown in the first pic connects to this space. It then flows through the hollow motor shaft into the motor side of the case.


----------



## e*clipse (Aug 2, 2009)

Here are some details of the drive gears and differential. I'm posting this detail because:
1) anyone who wants to use this thing will need the driveshaft bolt pattern.
2) I plan to lock the differential for future work. Hopefully I can find a spool that would make the job easy. I would rather not weld it.


The output drive gear is bolted to the differential with a 6 bolt pattern.
The bolts are 12mm fine thread and they are on a 110mm bolt circle.

The second to last shot shows the motor drive and idler shafts. Both are hollow, and the rotor's spline fits on the spline on the left.

The last pic shows the output shafts. The passenger side shaft is the longer one, on the left. Both shafts are retained by circlips.

The spline for both is identical:
22 teeth
0.987" OD > 25mm
Spline length is 1.1"
Pilot diameter (step up next to spline) 1.0585" Length from shaft end to start of pilot diameter: 1.225"

For passenger side:
Length from shaft end to start of bearing diameter: 2.400"
Bearing diameter (next step up) 1.178"
Length from shaft end to start of seal diameter: 3.780"
Seal diameter: (last step up) 1.494"
Length from shaft end to end of seal diameter: 4.325"

For Driver's side:
Length from shaft end to start of seal diameter: 2.380"
Seal diameter: (last step up) 1.652"
Length from shaft end to end of seal diameter: 3.025"

Yes, the seal diameters are different - I double checked that. 

The 4-bolt driveshaft uses 10X1mm studs. The pilot diameter is 2.716" > 69mm. The bolts are 67mm center to center.


----------



## kennybobby (Aug 10, 2012)

e*clipse said:


> ... As posted previously, there are three groups of 4 wires. They appear to enter the winding mass at approximately 120degrees apart. So, would this be 3 groups of 4 in-hand?


sorry but i didn't see anything about the 3 groups of 4 wires posted anywhere...if they wound the coils in the stator slots using 4 wires together then that would be wound 4-in-hand.

Makes me think there is some sort of parallel winding scheme here, 3 parallel windings per coil using 4-in-hand wire and the motor is a wye configuration.


----------



## e*clipse (Aug 2, 2009)

Oh WOW! Here is an amazing resource. 
Unfortunately it doesn't cover the MGR. 

Check out this list of links by fireblade:
http://www.diyelectriccar.com/forums/showthread.php/ripperton-electric-track-bike-41173p70.html

On post #693, look at the 2010 Prius and 2008 Lexus. The stuff Toyota learned in the 2005 paper about the Highlander has REALLY been expanded on. The rotors are all designed for high RPM like the Highlander.

I'll grind through this stuff and post some summaries. 

kennybobby: It even seems to cover wiring schemes in the 2008 Lexus. Maybe this can shed some light on the MGR's wiring...


----------



## kennybobby (Aug 10, 2012)

Wow, that is a gold mine cache of porn for nerds-- and what an amazing amount of advanced electronics technology going into those Toyota and Lexus hybrids, e.g. bi-directional dc-dc converters. How can they fund such advanced development and packaging on relatively low volumes of production? 

ORL didn't dissect the small 'generators' like they did the bigger motors, so no real details on the winding. Maybe you want to consider trying to get/use one of the motors on which they have done the most testing, in order to leverage off of their intensive investigations--that way you get the government lab doing all the reverse engineering for you and giving you a nice report with all the results!


----------



## e*clipse (Aug 2, 2009)

kennybobby said:


> Wow, that is a gold mine cache of porn for nerds--


LOL! 



> Maybe you want to consider trying to get/use one of the motors on which they have done the most testing, in order to leverage off of their intensive investigations--that way you get the government lab doing all the reverse engineering for you and giving you a nice report with all the results!


I'd LOVE to get my paws on that LS600 motor. A couple of those would satisfy my power craving. But, I've already got 3 MGR's so I'm going to commit to them. The good point is it seems Toyota settled on 650V for now - 2010 Prius, 2007 Camry, 2005 Highlander, and Lexus LS600h. Stuff I learn from this project should transfer pretty directly to those motors.


----------



## e*clipse (Aug 2, 2009)

Here's a nice summary of the details of the newer motors from Toyota:
The amazing thing is how different they are from each other. They seem to be developing a new motor for each new model every few years. Fortunately, they are improving the power density with each model.


----------



## e*clipse (Aug 2, 2009)

Ok, back to the stator windings.

For the MGR, there is a pic of the one I took apart on post #11

This may not mean anything, but I've noticed a few common things with all the Toyota motor stators:
1) All the windings are terminated on one side (axially speaking) The other side generally has the "back" sides of the windings with no terminations.
2) Most of the windings are wye configurations, with all the wires terminating/joining under a large orange insulator. The one exception seems to be the 2010 Prius (see pic), which is a wye configuration but the wye connection terminates next to the phase connections. The other exception seems to be the MGR motor (see post 11) I cannot find a common wye connector. 
3) All stators have 48 slots
4) wire is 20 guage (see previous summary) for all the 2005+ motors
5) all windings are for 8 pole motors
6) Starting after the 2004 Prius, all motors are designed to spin > 10,000RPM

I would like to know WHAT'S DIFFERENT with these new motors' designs that allows them to operate at nearly DOUBLE the RPM of the 2004 Prius without the Back EMF limiting the output??? 

First Pic: 2004 Prius
2nd Pic: 2007 Camry
3rd Pics: Lexus LS600
4th pic: MGR (my disassembly shot) Note 4 insulated (white, ~3" long) sections around the perifery - not sure if this is important
last Pic: 2010 Prius


----------



## e*clipse (Aug 2, 2009)

Here's the winding scheme for the Lexus LS600h:

The diagram shows one phase's winding. The winding splits (X in-hand) with half going to one side (blue) and the other half going to the other side (red) Note also how the winding is not completely symmetrical, and that the winding span 6 slots. Also, the windings are wound clockwise for one set of slots, then counter-clockwise for the directly adjacent set of slots.


----------



## kennybobby (Aug 10, 2012)

Here is a new 3-phase coil winding schematic for a 6 slot pole as was shown for the lexus. Also a shot of the page showing the back-emf voltage and waveform for the lexus motor. Notice the distortion at the peaks of the waveforms--This is due to the 7.5 degrees overlap at the middle tooth region of a pole (e.g. A) by the other two phases (e.g. B- and C-).


----------



## Coulomb (Apr 22, 2009)

e*clipse said:


> I would like to know WHAT'S DIFFERENT with these new motors' designs that allows them to operate at nearly DOUBLE the RPM of the 2004 Prius without the Back EMF limiting the output???


The main thing is just the number of turns per slot and the number of wires in hand; that affects the back EMF directly. Remember also that despite the permanent magnet of the rotor, you can buck the magnet strength with appropriate phase of the stator current, reducing the back EMF and torque (so producing a higher speed, lower torque motor, like using a taller gear).

To support the higher speeds, the newer models have an additional ~ 2.7x speed reduction on MG2, and they have some sort of support for the magnets that I can't seen in the PDF where they say it "can be seen". Remember, the rotor forces increase with the square of the speed, so 14k vs 6k (a ratio of 2.33) causes the forces to increase by the square of that, or 5.44). Bearings need to be designed to handle this increased speed. This is all in one or more of the PDFs, I think I read this in the Camry 2007 one.

What I don't get is how the extra speed reduction on MG2 is supposed to enable faster all-EV operation (ICE not powered, or even spinning), as Wikipedia and some YouTube video I came across seem to indicate (I could be misunderstanding). I suspect that the MG1 speed limit must be increased to around 14k RPM as well; I haven't seen the maximum speed specification for MG1. My suspicion is that this is the main factor allowing greater all-EV speed. (Another factor is allowing the ICE to spin without fuel being used, for higher speed EV-only operation.)

[ Edit: another smallish (+30%) factor is the DC bus voltage; the 2004 Prius was limited to 500 VDC, whereas the newer bidirectional power converters output up to 650 VDC. This obviously allows higher speed, higher back-EMF operation. ]


----------



## e*clipse (Aug 2, 2009)

I dragged one of my motors up to my office and set it up next to my scope. Glad they ***only*** weigh 96lbs. 

I then plugged in my scope with the center connection for the scope reference. I connected channel 1 to the left side and channel 2 to the right side.

Just by turning the output shafts by hand, I was able to get some decent back EMF data. Do we know enough about the motor stator and rotor to be able to translate the frequency in Hz to a physical RPM? If so, I could put the data into Xcell and make a nice little graph like ORNL's. 

A ***guess*** would be since it's an 8 pole motor, there will be 4 electrical cycles per physical revolution. The scope pics show one electrical cycle peak to peak. If, for example the electrical frequency is 27.5kHz, so the mechanical frequency would be 27.5Hz/4 = 6.875Hz. 1Hz = 60cycles/minute (cycle>revolution), so the motor is spinning @ 412RPM. Does this sound reasonable? The output shaft would be spinning at 412RPM/6.86 (rear ratio) = 60.1 RPM, or 1 rev/sec.

The first pic shows a speed of 11.4Hz with a peak to peak amplitude of 27.66V.
In the second pic, speed was 27.5Hz and the peak to peak EMF was 67V.
In the third pic, speed was 46.3Hz and the peak to peak EMF was 104V.
In the last pic, I had to change the scope probes to 10X. Speed was 59.2Hz and the peak to peak EMF was 139V. That's the fastest I can turn it by hand.


----------



## kennybobby (Aug 10, 2012)

Good work, thanks for sharing the interesting traces. Your frequency calculatus looks right to me. 

i wish the neutral point (where all three phases are connected together) was readily marked so you could use that as your scope reference. It may seem counter-intuitive but you might want to try using the dc coupling (instead of ac) on the scope to see any bias or offset. 

You can see the 7.5 degree slot spacing in the waveforms near the peaks. The 60 degree phasing of the traces is due to the scope reference, otherwise it would be 120. The single phase voltage is likely half of what you measured since you are measuring phase-to-phase.


----------



## e*clipse (Aug 2, 2009)

kennybobby said:


> Good work, thanks for sharing the interesting traces. Your frequency calculatus looks right to me.
> 
> i wish the neutral point (where all three phases are connected together) was readily marked so you could use that as your scope reference. It may seem counter-intuitive but you might want to try using the dc coupling (instead of ac) on the scope to see any bias or offset.
> 
> You can see the 7.5 degree slot spacing in the waveforms near the peaks. The 60 degree phasing of the traces is due to the scope reference, otherwise it would be 120. The single phase voltage is likely half of what you measured since you are measuring phase-to-phase.


Thanks! 

I wish the neutral point were more obvious as well. It would certainly lay to rest the wye vs delta question. Thanks for the tips on dc coupling. I'll try it, and post if anything interesting comes of it. How should I connect the scope reference to get rid of the 60 degree phasing?

So that lumpy waveform is built into the winding scheme? I noticed a less dramatic, but similar lumpiness in the graphs you posted in post #65. Would the combination of this output + the stuff we can physically see in the winding allow one to say the wiring diagram you posted is correct for this motor? Or could other wiring diagrams produce the same output?

Also, I noticed the (phase to phase) vs (phase to neutral) difference in various back-EMF charts published by ORNL. 

My dumb question: from an inverter's perspective, wouldn't the bus voltage need to be greater than the phase to phase voltage to override back-EMF? Or would it only need to be phase to neutral voltage? Why? 

Thanks for all your help!


----------



## e*clipse (Aug 2, 2009)

Coulomb said:


> To support the higher speeds, the newer models have an additional ~ 2.7x speed reduction on MG2, and they have some sort of support for the magnets that I can't seen in the PDF where they say it "can be seen". Remember, the rotor forces increase with the square of the speed, so 14k vs 6k (a ratio of 2.33) causes the forces to increase by the square of that, or 5.44).


Sorry about my lack of clarity. I was focusing on the back EMF limitation issue with the Highlander MGR. 

Here's some stuff I've learned from the ORNL reports, etc. The pic is taken from the ORNL 2010 Prius report.

Since 2005, Toyota has done some extensive optimization of the rotor design. Here is a shot showing the different rotor punchings; all of these rotors can spin @ over 10,000 rpm w/o gernading. An important contribution for this was to add the "bridge" of material in the center of the magnet "v's". From a magnetic pole perspective, each "V" is considered "1 magnet." Note how the Lexus stamping have a third magnet near the edge, centered in the "v." Apparently this magnet (used to control the back emf waveform ) weakens the rotor enough that the Lexus motor is limited to ~10,000 rpm, while the Camry and 2010 Prius motors can spin at 14,000 rpm.


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> My dumb question: from an inverter's perspective, wouldn't the bus voltage need to be greater than the phase to phase voltage to override back-EMF? Or would it only need to be phase to neutral voltage? Why?


From the inverter perspective it is the phase to phase voltage that matters based on a simple schematic model of a motor and inverter switches. The phase to phase voltage being sqrt(3) times greater than phase to common voltage.

However using flux weakening the motor can produce torque even at speeds greater than base speed. Base speed being when the phase to phase bemf matches the bus voltage.
These motors rely heavily on flux weakening and the reluctance torque vector to spin at these higher speeds.
I haven't fully wrapped my head around this yet but producing torque is the name of the game and torque exists above this base speed. I also think that the modulation phase shift needed to do flux weakening is in the same direction as what produces higher reluctance torque by design.

jeff


----------



## kennybobby (Aug 10, 2012)

To see the correct 120 degree spacing will require finding the neutral point to use as the scope reference. I'm not sure that you can get a true picture of phase bemf voltage unless you measure wrt the neutral point because the voltage of your reference (as measured now) is varying. But you are making good progress to reversing this motor...


----------



## jddcircuit (Mar 18, 2010)

jddcircuit said:


> From the inverter perspective it is the phase to phase voltage that matters based on a simple schematic model of a motor and inverter switches. The phase to phase voltage being sqrt(3) times greater than phase to common voltage.
> 
> However using flux weakening the motor can produce torque even at speeds greater than base speed. Base speed being when the phase to phase bemf matches the bus voltage.
> These motors rely heavily on flux weakening and the reluctance torque vector to spin at these higher speeds.
> ...


eclipse,
I may need to correct myself.
In your scope capture example you show 139Vpp @ 59.2Hz.
139/sqrt(3) = 80.25V
It is my understanding that 59.2Hz would be the no load base speed of this motor given a bus voltage of 80.25V.

My math says this 8pole motor would have a base speed of 7192 rpm with a bus voltage of 650V.
Axle rpm = 7192/6.86 = 1048. I am not sure if this is fast enough but with a large tire it might be.

However with flux weakening the motor can be made to spin faster than the base speed.

Let me know if this passes the common sense test given the vehicle performance specs.

Jeff


----------



## jddcircuit (Mar 18, 2010)

Here is the way I visualize the bemf measurements that you made.

The diff120 and diff240 lines represent the measurements you made.
The sinNorm, sinNorm120, sinNorm240 represent the bus voltage modulation needed at each phase to match it from an inverter perspective.


----------



## e*clipse (Aug 2, 2009)

kennybobby said:


> To see the correct 120 degree spacing will require finding the neutral point to use as the scope reference. I'm not sure that you can get a true picture of phase bemf voltage unless you measure wrt the neutral point because the voltage of your reference (as measured now) is varying. But you are making good progress to reversing this motor...


I did these measurements on one of my motors that I haven't disassembled. It seems that I would need to take the encoder side cover off, add a 4th wire (the neutral) to the harness - I might be able to run the wire out the temp sensor connector. Then re-assemble the motor and run the test. The main problem with this is I still have no idea where the neutral point is.

I'm fairly certain this motor is set up with a wye configuration; I just can't find the **&^#*!!!  neutral point.

Any suggestions? I'll double check, but I'm fairly certain the neutral isn't on the other side of the winding.

Thanks again for all your help!


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> I did these measurements on one of my motors that I haven't disassembled. It seems that I would need to take the encoder side cover off, add a 4th wire (the neutral) to the harness - I might be able to run the wire out the temp sensor connector. Then re-assemble the motor and run the test. The main problem with this is I still have no idea where the neutral point is.
> 
> I'm fairly certain this motor is set up with a wye configuration; I just can't find the **&^#*!!!  neutral point.
> 
> ...


Why do you need the neutral? I think the individual phase voltages are contained in the measurement you already made. See my above post with a graph showing the relationship between your measurements and the individual phase voltages.


----------



## tylerwatts (Feb 9, 2012)

Toyota didn't do something stupid, I mean clever, like make the casing neutral did they? Is it mounted on isolating rubber mounts? Just a random thought.


----------



## e*clipse (Aug 2, 2009)

jddcircuit said:


> eclipse,
> I may need to correct myself.
> In your scope capture example you show 139Vpp @ 59.2Hz.
> 139/sqrt(3) = 80.25V
> ...


I guess I'm a bit confused.

The part about the phase-neutral voltage being Vp/sqrt(3) makes perfect sense. My question about that is, since the controller does not have access to the neutral line, why is the L-N peak voltage used instead of the L-L peak voltage.  It must work, after all, these motors all use the system and ORNL does their back-emf tests based on L-N. It's just my stubborn noggin' that's having trouble with it. 

The graph you posted showing the L-N and L-L makes sense, from an amplitude perspective. Are the time offsets due to the reluctance? 

I did extrapolate the back-EMF data to see how this motor compares to the others. ****BIG DISCLAMER***** The data shown on this graph is derived by a linear extrapolation from data taken below 59Hz. There are no _measured_ data points along the graph lines. I added the L-N rms plot, because that's how ORNL was posting their data. 

It seems to agree with your calculations, if the L-N peak voltage limitation of 650V is used as a limitation.

As I understand it, the measurement taken at 59hz was just a data point in a series of other data points. It has no real significance, like pointing out the motor's base speed. Unless one has to start field weakening at the base speed.

It seems that the base speed of the other motors is significantly slower. For example the Camry's base speed is about 2500rpm and the Lexus LS600h's base speed is about 5500rpm.

It would be nice is the base speed was that high. 

Please take these as "interested student" questions  I really appreciate your help with this.


----------



## e*clipse (Aug 2, 2009)

tylerwatts said:


> Toyota didn't do something stupid, I mean clever, like make the casing neutral did they? Is it mounted on isolating rubber mounts? Just a random thought.


I don't know. I've never crawled under a Highlander to look, and I didn't get any bushings w/ my motors. Also, They would need to Isolate the drive shaft, because there are many metal-metal contact points through that path. I'll measure continuity between case and one of the phases to verify.


----------



## e*clipse (Aug 2, 2009)

Good news! Toyota isn't stupid!  LOL

It is my understanding that the HV systems in EV's must be completely isolated from other electrical stuff AND the chassis.

I did a continuity check between the power lines and the case - it's isolated.


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> The graph you posted showing the L-N and L-L makes sense, from an amplitude perspective. Are the time offsets due to the reluctance?


Disclaimer: I am also learning so bare with me.

I was trying to graph the phase voltages from the inverter perspective or as the individual PWM duty cycle percentages for each phase. The inverter does not see the neutral point so this is how it would output the equivalent of what you measured directly. This matching point is when torque and current would equal zero thus being a theoretical speed limit.

In the graph sinNorm, sinNorm120, sinNorm240 are 120 degrees out of phase and modulate from 0 to 100% of bus voltage. This is what will resemble the voltage if you were to measure phase to neutral as you mechanically spin the motor. The only difference will be that they will be centered around 0 instead of .5 . I call them Norm because I normalized from 0 to 1.

"diff120" = "sinNorm120" - "sinNorm"
"diff240" = "sinNorm240" - "sinNorm"

The diff120 and diff240 resemble the differential measurements that you made using one of the phases as your scope reference.

i was only trying to show how you might extract the 3 phase to neutral voltages from your 2 differential measurements.

clear as mud I'm sure


----------



## e*clipse (Aug 2, 2009)

On another related topic, I did learn a bit more about the resolver.

My evil plan is to build a FOC motor controller and directly use the resolver output in the code. No extra translation devices, etc.

Regarding the input sine wave. Yes, it must be a sine wave. Any distortion of that input wave will be replicated in the output. I pushed my signal generator to its limits for this test, and any time the sine wave was distorted because of the signal generator's limitations, the output faithfully replicated it. 

The input sine wave can be offset by a constant DC voltage. I tested this with a +/- 1VDC offset at 5kHz. The output was consistant, centered close to 0V. This could be valuable because it shows that the driving signal could be created with a pulse from the controller, then amplified and filtered with single supply op-amps.

The output amplitude of the resolver is frequency dependant. To test this, I set the signal generator's output amplitude to 5V and measured the resolver's peak output amplitude. The test was run between 5kHz and 125kHz.

Generally, the output was consistant between 5kHz and 20kHz. The ratio of input to output amplitude was 4.8:1 in this range.

Above 50kHz, the resolver's output amplitude increased relative to the input amplitude as the frequency increased. There appears to be a peak of this effect at 125kHz, where the input to output amplitude ratio was 1.09:1

Between 50kHz and 125kHz, the phasing relative to the input signal also changed. At 50khz the phase angle was 158degrees and at 125kHz, the phase angle was 85 degrees.

This could affect timing and amplitude of the AtoD samples. While it may be easy to change driving signal frequency in controller code, it could cause problems with data acquisition.


----------



## e*clipse (Aug 2, 2009)

jddcircuit said:


> Disclaimer: I am also learning so bare with me.
> 
> I was trying to graph the phase voltages from the inverter perspective or as the individual PWM duty cycle percentages for each phase. The inverter does not see the neutral point so this is how it would output the equivalent of what you measured directly. This matching point is when torque and current would equal zero thus being a theoretical speed limit.
> 
> ...


Ahhh, I'm starting to understand. I needed to re-read a few of your posts for stuff to sink in.  Believe me, the problem isn't your explanations...


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> My evil plan is to build a FOC motor controller and directly use the resolver output in the code. No extra translation devices, etc.


Good plan. I'm right there with you.

Good work with the resolver. Now if you align your resolver output with the bemf measurements you made and use the graph I made for the individual phase duty cycles relative to them both it will spin.

I am struggling a bit the phase current sensors coming out of the Prius inverter at the moment but there is light at the end of the tunnel. They are noisy as hell when IGBTs are switching higher currents.

I hope to have a working FOC controller for the motors and inverters eventually.

I am also planning to use the inverter as high voltage battery charger as well.

I will be following closely.

Good luck
Jeff


----------



## Coulomb (Apr 22, 2009)

e*clipse said:


> I guess I'm a bit confused.


It's not hard with this stuff. I'm no expert either.



> The part about the phase-neutral voltage being Vp/sqrt(3) makes perfect sense.


I believe that this is always the case, regardless of the shape of the waveform. I think that's because it's a phasor trigonometry thing, and the phasors apply instantaneously. Though as I write this, it makes less sense.



> My question about that is, since the controller does not have access to the neutral line, why is the L-N peak voltage used instead of the L-L peak voltage.


It can't, and it isn't.



> It must work, after all, these motors all use the system and ORNL does their back-emf tests based on L-N.


I didn't believe you about that, till I went and looked at the report carefully. Sure enough, line to neutral, RMS. I certainly can see no good reason to quote the back EMF in line to neutral terms. Three phase voltages are almost always given as line to line.



> The graph you posted showing the L-N and L-L makes sense, from an amplitude perspective. Are the time offsets due to the reluctance?


No. These voltages are 60 degrees apart because one is inverted from the usual direction. One voltage peaks at 240 degrees, and the next troughs at 60 degrees, so that's 120 degrees apart, as expected. He's done that presumably to match your oscilloscope measurements. Presumably, you just needed to press "invert" on one channel.

One final point. The "base speed" of the Camry and Lexus motors is a little rubbery, since the DC bus voltage is a little rubbery (it can vary from the voltage of the battery to 650 VDC), but the highest efficiency of the converter is when the DC bus is the same as the pack voltage (so the boost converter "passes through" and doesn't boost at all). So that's why the base speed for these motors is rather low, when the back-EMF is only about 140 V RMS line to neutral (so about 240 V RMS line to line). The sine waves are somewhat clipped, so the peak voltage isn't 1.414 x the RMS, perhaps only 1.2x (wild ass guess). So that's about 290 V, hardly boosting at all. Hence the Camry has peak power at 4500 RPM, only 32% of maximum speed, and the back EMF is only about 130 V RMS L-N. I think the peak power of the whole car would be when the battery is assisting, and that will provide most assistance at "the base speed for near hybrid battery voltage".

Of course, when one motor is providing power to the other, the boost converter doesn't come into it, so then the base speed is "the base speed for 650 VDC".

Did someone mention that this stuff is rather confusing?


----------



## PStechPaul (May 1, 2012)

It should be possible to add three equal resistors from each of the three phases to a common point, which can be used as a neutral reference. Otherwise, using phase B as reference, A-B and C-B should be 60 degrees apart, and you should be able to view the A-B waveform by using the scope in differential mode.

Another way to establish a neutral is to use a three phase transformer. You can also provide a phase reference for phase B by using two resistors or a center tapped transformer between phases A and C, and phase B will be in phase (or 180 degrees out of phase) with that reference point.

It should also be possible to do the conversion mathematically, by using vector sums and differences, or trigonometry. 

Some discussion of this:
http://www.control.com/thread/1026239915

Here is explanation of the "phantom neutral" and ways to derive an effective neutral from three phase delta, or a third phase from two legs of a three phase wye source.
http://www.marcspages.co.uk/pq/4510.htm

Other possibly helpful references:
http://en.wikipedia.org/wiki/High_leg_delta
http://elect.mrt.ac.lk/EE201_3phase_sym_comp.pdf (for math whizzes)

And this is interesting, with a calculator and graphical vector addition:
http://www.electrician2.com/electa1/electa5htm.htm


----------



## e*clipse (Aug 2, 2009)

jddcircuit said:


> Good plan. I'm right there with you.
> 
> Good work with the resolver. Now if you align your resolver output with the bemf measurements you made and use the graph I made for the individual phase duty cycles relative to them both it will spin.
> 
> ...


I did step the motor around a full electrical cycle, using a 12V battery and connecting according to the space vector modulation concept. 

As I did this, I measured the output of the resolver, dividing the sin output by the cos output and calculating the angle by taking the arcTan.

I noticed a discrepencies from the expected values. Perhaps it's measurement error, or maybe something more important. For example, instead of 30 degrees, the resolver would read 36.4 degrees. Generally, the measurements were off by about 4>6 degrees from the expected value.

That charger you're building looks like a perfect solution. 
Is it possible to just buy the boost converter? (ebay or whatever)
Can you feed it a DC input? I'd love to plug my EV directly into my solar array. The array puts out about 300V mppt. These hot days, I give our utility an average of 25kWh per day!  That would power my car just fine.

Or perhaps using the inverter would be even better. I remember AC propulsion did that with their system. (used the motor and inverter as part of the charger) I just have trouble figuring out how it can work without moving the motor. If it can be pulled off w/ a BLDC motor (AC propulsion used induction motors) I would be all over it! It would be both lighter (no extra equipment) and cheaper (no extra equipment) 

Do you plan on building a separate controller, using the Prius power stage? If so, there will be a lot of interesting info we can share.  All the control stuff would be nearly identical.

Regarding the current sensors, you can build really effective filters using op-amps. I did that with a current sensor on a brushed dc motor controller I was fooling around with.

When I get closer, I'll start a motor controller thread so this one stays on topic.

Good luck w/ the MR2!


----------



## jddcircuit (Mar 18, 2010)

PStechPaul said:


> using phase B as reference, A-B and C-B should be 60 degrees apart, and you should be able to view the A-B waveform by using the scope in differential mode.


Damn that's a much better way to say it.

I was trying to show what the individual A,B,C look like based on the A-B and C-B measurements.

Since A,B,C is what the inverter outputs.


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> I noticed a discrepencies from the expected values. Perhaps it's measurement error, or maybe something more important. For example, instead of 30 degrees, the resolver would read 36.4 degrees. Generally, the measurements were off by about 4>6 degrees from the expected value.


I mentioned in an earlier post that this method was prone to error. I think I called it squishy. My theory is that the reluctance torque curve is fighting against the magnetic torque curve in this static state. There is a stalled torque graph in the ORNL report that shows the interaction between reluctance and magnetic torques. It creates some interesting peaks and valleys that you are probably falling into.

You may have to finish your resolver tracker circuit and then have it output a zero degree pulse that you can use as a scope trigger to align the bemf using the spinning method.


----------



## e*clipse (Aug 2, 2009)

PStechPaul: Thank you for the links. That's exactly what I've been looking for. 

Coulomb: That phasing suggest makes a lot of sense. I'll try it tonight. 
Regarding base speed: I thought the base speed was built into the physical design of the motor, regardless of controller capability or bus voltage.  A properly designed controller and adequate bus voltage would allow the motor to meet its design capability.

jdcircuit: I'm grinding through a bunch of trig identities to see if there are some tricky possibilities for directly using the resolver output without finding the angle. So far I've found it's possible to synchronise the resolver output with the electrical cycle by using double angle identities. This would work fine for the transforms used in FOC. So, if all that one cares about is synchronising the controller with the motor, then the absolute position of the motor may not be important. It could be in any one of the four quadrants, and that would be ok. Perhaps PStechPaul's links will help me get to the bottom of this...


----------



## vehiculeselectriques (Oct 2, 2008)

Hi,

happy to read others are working on this interesting motor as i'm on the same boat 
here is information i have on my 2010 Prius motor, enjoy or pass if you already have 

"""""
What i found is this MG2 is a internal permanent magnet motor, 8 poles, 48 slots... 
Each phase of the 2010 Prius motor stator windings consist of
twelve – 20 AWG wires with 8 coils (poles) in series, with each coil having 11 turns.

from motor data is here


about 20kW continuous and 60kW peak (18 seconds to 150°C) oil cooled
200Nm max
13000rpm max 
with 650VDC bus so i presume 460VAC RMS ?(i'm not sure about the real RMS voltage rating on this motor)
Thermistor is 3900-3950K 47kohm (source)
Resolver 2X-VR (Source)

For sure IPM are really new curiosity beast for EV community though with such impressive performances numbers (real power/torque from low to 3/4 max speed) these easy to find motors seems very interesting solution for our hobbyists EVs...

there is lots of studies about IPM motors and their driving specifications 

but

afaik actually no commercial controller available made it to this motor... 

have a nice day,
Phil


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> jdcircuit: I'm grinding through a bunch of trig identities to see if there are some tricky possibilities for directly using the resolver output without finding the angle. So far I've found it's possible to synchronise the resolver output with the electrical cycle by using double angle identities. This would work fine for the transforms used in FOC. So, if all that one cares about is synchronising the controller with the motor, then the absolute position of the motor may not be important. It could be in any one of the four quadrants, and that would be ok. Perhaps PStechPaul's links will help me get to the bottom of this...


Sorry if I am restating what you already said.

FOC only cares about an electrical cycle so I am not sure what you mean about absolute position. Position within the electrical cycle even at a stand still makes the algorithm that much more simple. If you have a way to identify where you are in the electrical cycle then you are there. It does not matter which one of the 4 mechanical quadrants of this 8 pole motor the rotor is in.


----------



## jddcircuit (Mar 18, 2010)

vehiculeselectriques said:


> Hi,
> 
> happy to read others are working on this interesting motor as i'm on the same boat
> here is information i have on my 2010 Prius motor, enjoy or pass if you already have
> ...


excellent
there will be controllers soon I am pretty sure.
I was working with a 2001 prius motor but I am switching to the 2004 because they are much more readily available on ebay.
The 2001 motor might have some lower bus voltage attraction for hobbyists.
From a controller point of view all the Toyota motors appear so very similar.

Good luck
Jeff


----------



## vehiculeselectriques (Oct 2, 2008)

thanks, good luck to all of us 

rewinding MG2 to take 12000rpm with 240VAC from an industrial IPM VFD (or an afordable EV designed controller if it exist someday)
is my graal , hope it will not take a lifetime though...

Phil


----------



## kennybobby (Aug 10, 2012)

From looking at the Aussie site they have really beat on these IPM motors and transaxles trying to figure out how to use them in an EV. 

They are strange machines indeed--what were Toyota's design goals. Embedding the magnets deep in the iron reduces the bemf and generates a weaker field than magnets on the surface, so it can turn at higher rpm but the torque constant is lower than a typical BLDC. Single coils instead of concentric in the phase pole groups produces a more distorted sinusoidal waveform. It seems that they were designed and optimized for a specific duty cycle--it makes you wonder how much torque they could actually deliver in a continuous duty application.


----------



## e*clipse (Aug 2, 2009)

Hi Phil! 

Welcome to the thread! 
Thank you for the information. Hopefully we can de-mystify these motors and make a practical option for DIY EV folks.


----------



## toddshotrods (Feb 10, 2009)

Does IPM require a radically different type of inverter from the normal AC units; _i.e._, would a something like a Rinehart drive _not_ work on these motors?


----------



## vehiculeselectriques (Oct 2, 2008)

thanks for your welcome

toddshotrods, yes and no... induction can be autotuned by their moderne drivers, IPM still not afaik.
So the problem is not really finding the driver, some should be capable of, rinehart probably is, as the tritium probably is also;
no the real problem is you need specialist motor benchtesting for loging full data about the saliency part of this motor and this is premium fee !
it will double the cost of the motordriver alone ...and you are still not done as it's not a plug and drive system.
Seems to me it should not cost such as real added value is for seller business (this motor is everywhere at cheap cost) not for the purchaser of one system...
but business companies must have futur and time is money so i understand the point.

so i'm still looking for a >>>800HZ<<< driver solution not costing 1$ per rpm capability  
for this motor.

waiting for that i'm studying some new stator foundry housing to suit my needs and then will also look after rewind information, 
in that time driver may comme one day or other ?
hopefully once my motor rehoused and rewinded is fully ready to scream is first kw ...


Phil


----------



## e*clipse (Aug 2, 2009)

jddcircuit said:


> Sorry if I am restating what you already said.
> 
> FOC only cares about an electrical cycle so I am not sure what you mean about absolute position. Position within the electrical cycle even at a stand still makes the algorithm that much more simple. If you have a way to identify where you are in the electrical cycle then you are there. It does not matter which one of the 4 mechanical quadrants of this 8 pole motor the rotor is in.


Exactly. I meant by "absolute position" the rotor's physical position. It would be very important in a servo application, but for an EV, we really don't care what quadrant the rotor is in. This should be a bit easier for us.


----------



## e*clipse (Aug 2, 2009)

PStechPaul said:


> It should be possible to add three equal resistors from each of the three phases to a common point, which can be used as a neutral reference.
> 
> It should also be possible to do the conversion mathematically, by using vector sums and differences, or trigonometry.
> 
> ...


The information above is extremely interesting. The paper for math whizzes (I'm definitely NOT one ) did a great job of explaining the wye vs delta thing. One thing I found VERY interesting is that industrial 3 phase systems will often have a 4th connection for the neutral. If the system is working properly, it should be balanced, and there should be no current in the neutral line. It did go into whether the SOURCE was wye or delta connected. I wonder.... Is the standard 6 switch inverter considered a wye or delta source?? 

So, I connected a "phantom neutral" using some BIG wirewound 1K resistors I have sitting around. I then replicated my back-EMF test. 

Here is the data from the phantom neutral back emf test. The numbers are all out of my 'scopes "waveform parameters" display, except for the motor rpm column. One thing I found interesting and cannot explain are the AC RMS and AC+DC RMS numbers. Note that the phase difference was the expected 120 degrees, except the first number, I don't know why. The last set of numbers, at 41.9Hz were taken by moving the probe from phaseC to phaseB.

I also included a couple of waveform examples. They have similar "bumps" within the waveform as the previous test. It may be worsened by my lousy phantom neutral connections.


----------



## e*clipse (Aug 2, 2009)

More interesting stuff! Well, I think it is....

Now that I had a phantom neutral working for the motor, I was curious how the resolver timing worked with this. It took a bunch of messing with resolver drive frequencies, etc. The tests were run with resolver frequencies that were much lower than I would run for a real motor control, But I got some cool graphs illustrating the resolver working along with the back EMF. I triggered the scope with the BEMF signal.

VERY cool: There is a definite point where the resolver's sine output zero crossing and the phase A zero crossing happen at the same time! 

The first pic is phaseA and the resolver sin output. Resolver frequency:1.5 kHz.
The second pic is phaseA and the resolver cos output. Resolver frequency: 1.5 kHz.
The third pic is phaseB and the resolver sin output. Resolver frequency: 1.5 kHz.
The last pis is zoomed up on phaseA and the resolver sin output. Resolver frequency: 5 kHz.


----------



## jddcircuit (Mar 18, 2010)

that is awesome


----------



## PStechPaul (May 1, 2012)

That is quite interesting. I would expect the resolver sine and cosine outputs to provide the precise angular position of the motor shaft. So there should not be any angle at which both values are zero. However, if the resolver corresponds to electromagnetic phase rotation, and if the number of pole pairs of the resolver do not match the poles of the motor, then this may occur. 

So, if the resolver shows absolute motor shaft position, but the motor has four poles, the "A" phase will have a zero crossing at 0, 90, 180, and 270 degrees. I'm not sure this is what is being seen, but it seems to make sense. Also, I'm not sure how the resolver output is converted to the sine and cosine, which is positive and negative. The output seems to be centered on the zero reference (since it is energized by the higher frequency AC signal), so perhaps the true reference is at half its peak value. 

I'm just "thinking out loud", trying to understand what seems to be shown, but maybe it sheds some light on what's going on. Fascinating stuff, and this appeals to my "Sherlock Ohms" investigative nature. Watt's up, Wattson?


----------



## jddcircuit (Mar 18, 2010)

PStechPaul said:


> That is quite interesting. I would expect the resolver sine and cosine outputs to provide the precise angular position of the motor shaft. So there should not be any angle at which both values are zero. However, if the resolver corresponds to electromagnetic phase rotation, and if the number of pole pairs of the resolver do not match the poles of the motor, then this may occur.
> 
> So, if the resolver shows absolute motor shaft position, but the motor has four poles, the "A" phase will have a zero crossing at 0, 90, 180, and 270 degrees. I'm not sure this is what is being seen, but it seems to make sense. Also, I'm not sure how the resolver output is converted to the sine and cosine, which is positive and negative. The output seems to be centered on the zero reference (since it is energized by the higher frequency AC signal), so perhaps the true reference is at half its peak value.
> 
> I'm just "thinking out loud", trying to understand what seems to be shown, but maybe it sheds some light on what's going on. Fascinating stuff, and this appeals to my "Sherlock Ohms" investigative nature. Watt's up, Wattson?


I thought the same thing but then I noticed that the A zero crossing is at min for sin and max for cos so the sin and cos are never zero at the same time.

I guess the way you get polarity for sin and cos is to subtract the excitation signal from each of them.


----------



## e*clipse (Aug 2, 2009)

jddcircuit said:


> I thought the same thing but then I noticed that the A zero crossing is at min for sin and max for cos so the sin and cos are never zero at the same time.
> 
> I guess the way you get polarity for sin and cos is to subtract the excitation signal from each of them.


I think you guys are right. I mislabled sin and cos. Sorry about that. 

If you look at the one I labeled "cos," the resolver signal is increasing in amplitude starting at the zero crossing where the BEMF signal is also increasing. It makes more sense to call this a "sin" function.

Similarly, the function I labeled as "sin" is at a maximum when the BEMF signal is increasing past the zero crossing. That function goes through a minimum as the BEMF signal crosses zero into the negative part of its cycle.

It is pretty clear that the resolver's amplitude does a full cycle for every two electrical (BEMF) cycles.

It may be possible to just sample the appropriate peaks of the sin and cos functions, using the microcontroller to generate the timing signal. The sample could be taken every time the timing signal goes "high" for example. That way, it would avoid taking both the negative and positive values of these waveforms. 

The problem with trying to read a full 360 degrees by using the tangeant function is that the tangeant function is discontinuous around 90 degrees. It may be possible to avoid the problem by not using the value whenever the cos function is zero.

Thinking aloud here:
Also, as I'm grinding my way through the space vector modulation stuff, I've noticed that SVM only cares about 0>60 degrees. Perhaps it would be possible to use this and avoid the 90 degree discontinuity? It would only be necessary to know very roughly which 60 degree quadrant you're in, then do an accurate calculation once that's determined.


----------



## kennybobby (Aug 10, 2012)

use a demodulation circuit to separate the carrier frequency from the 'packet' or beat frequency, then use trig identity to solve for angle (b), i.e. [sin(b)]^2 + [cos(b)]^2 = 1


----------



## e*clipse (Aug 2, 2009)

kennybobby said:


> use a demodulation circuit to separate the carrier frequency from the 'packet' or beat frequency, then use trig identity to solve for angle (b), i.e. [sin(b)]^2 + [cos(b)]^2 = 1


Great idea!  That will make taking AtoD samples much easier. They will be much less sensitive to hitting the perfect peaks of the resolver carrier frequency. While it would be smart to trigger samples using the driver frequency signal, the exact lag between initiating the process and sampling data would be much less sensitive.

Thus, the resolver driving frequency can be whatever's convenient, AND it can be a voltage that is always positive, not requiring special power supplies. It should be relatively easy to take a 0>5V square wave, then filter it and amplify it to produce a 0V>12V sine wave. 

The output signals can be demodulated easily with a bridge rectifier and a lowpass filter. The resulting "envelope" could easily be controlled by adjusting the driver amplitude and/or the op-amp filters until a 0>5V signal is put out by both the resolver outputs.

The simplest way to get the angle would be:
angle = arctan( sintheta/costheta)

Note that the numbers sintheta and costheta should always vary proportionally together, so whether the peak is 1V, .5V, or 5V wouldn't matter. This would also be very robust, because the output frequency and amplitude of the driver would have very little affect on the final output. 

Also, the sintheta function would vary from 0V>5V>0V over 360 electrical degrees. Thus, everything could be reset every time the sintheta function approaches 0.

At the same time, the costheta function will vary from 5V > 0V > 5V, due to the diode in the demodulation circuit. Whether the final output angle is less than 180 degrees or greater than 180 degrees could be determined by sampling the BEMF voltage at phaseA or the current in phaseA, which will need to be done for FOC anyway. If BEMF > 0, the output should be <180 degrees. If the BEMF <0, the output should be > 180 degrees.

Thoughts?


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> I think you guys are right. I mislabled sin and cos. Sorry about that.
> 
> If you look at the one I labeled "cos," the resolver signal is increasing in amplitude starting at the zero crossing where the BEMF signal is also increasing. It makes more sense to call this a "sin" function.
> 
> ...


I was going to try and decode the resolver signals myself but instead I am using an EVAL-AD2S1210 Resolver to Digital board for the time being in order to get some other things tested. It does count from zero to max twice per mechanical revolution of the motor. Simply dropping the most significant bit gives 4 aligned mechanical quadrants.

Full integration is in my future but this was a quick way for me to get rotor position into my code. It was quite some time ago when I was researching the resolver tracking functions but I remember that there was a formula that had less mathematical overhead to estimate the angle in an iterative fashion for tracking the angle.

However I always enjoy trying to do things at the fundamental level as much as possible. That is where the learning is.

Thanks for sharing.
Jeff


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> The simplest way to get the angle would be:
> angle = arctan( sintheta/costheta)


I think the overhead of the arctan function is an issue but I could be wrong.
Another way is to use something like:
cosA*sinB - sinA*cosB = AngleError

A = actual angle, B = expected angle
Your ADC gives you cosA and sinA and a simple look up table for cosB and sinB.
You then set up a PI filter to drive B to equal A which is zero AngleError.


----------



## e*clipse (Aug 2, 2009)

jddcircuit said:


> I think the overhead of the arctan function is an issue but I could be wrong.
> Another way is to use something like:
> cosA*sinB - sinA*cosB = AngleError
> 
> ...


How do you figure out the expected angle? Previous angle and speed?

Good point about the overhead. That's one reason I'm trying to use those sintheta and costheta numbers directly. One of the PIC app notes about vector control used a look-up table; I guess there may be less execution overhead in that.

I'm using a DSPic, which has an available math library:
ww1.microchip.com/downloads/en/DeviceDoc/51459b.pdf

But, if you look at it, functions like arcsin take 363 execution cycles and arctan requires roughly twice that, at 696 cycles. 

The real time-hogs are the sin and cos functions, believe it or not, requiring about 3000 execution cycles! 

So, lets say I take the arcsin and arccos of my resolver output to get an angle, then use arctan or make a guess and correct. All that would require several thousand execution cycles. Then I would have some value for the electrical angle that would be accurate for 1 control loop. On the other side, I would need to take the sin and cos of that angle for the FOC transforms and the space vector modulation. If I was slick and did it once, it would still require over 5000 execution cycles! ACK!!

There is some real value in keeping things to unsigned integers, and using only addition, subtraction, and multiplication. Even simple division takes twice as long as multiplication.

This is another reason I like doing the filtering and averaging of resolver output in hardware using single input op-amps. It requires no microprocessor overhead and no extra hardware over that suggested in the TI resolver decoder app note.

Thanks for the tip - I really see the value of grinding through all that trig. IF I can come up w/ something that does not require all that back and forth conversion.


----------



## jddcircuit (Mar 18, 2010)

jddcircuit said:


> I think the overhead of the arctan function is an issue but I could be wrong.
> Another way is to use something like:
> cosA*sinB - sinA*cosB = AngleError
> 
> ...


I picture two PI loops. One for angle and one for speed.

A = unknown rotor angle
Let's assume cosA and sinA are the adc values that you measure synced with the excitation signal peaks.
You don't do any actual sin or cos operation just an adc.
The magnitude doesn't matter a whole lot since you are going to maintain zero error. Filtering and shifting is optional I guess.
sinB = LUT(B)
cosB = LUT(B-90)
No actual sin or cos equations needed so only a couple clock cycles.

The first B is arbitrary so it may produce lots of error. Multiple iterations of the angle PI loop will force B to match A in short order. Once lock (small error) is achieved (B=A), the next B is approximated by LastB + speed*dt.

The speed can also be tracked using a PI loop with the angle error of your first angle estimation. If you overshoot the angle estimation then speed estimation is too fast. If you undershoot the angle error the speed estimation is too slow. This angle error is the input into your speed regulation loop.

I don't have all the details since I have not done it. I just wanted to encourage you to explore it.

Jeff


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> So, lets say I take the arcsin and arccos of my resolver output to get an angle, then use arctan or make a guess and correct.


I don't think you can use the arcsin and arccos directly. It will be too sensitive to variations is carrier magnitude.

As I am writing this I may need to reread your post.


----------



## PStechPaul (May 1, 2012)

I think a lookup table with linear interpolation should work quite well. See:
http://jfdube.wordpress.com/2011/12/06/trigonometric-look-up-tables-revisited/

You could also use a much smaller table and a cubic spline method to achieve pretty good accuracy with fairly low overhead:


```
/*****************************************************************************
   This spline function returns a floating point y value for the given x_value
   n is the number of points in the input array
*****************************************************************************/
float spline( float x_val, int n, float *x, float *y )
 {
 float y_val = 0;
 float num, den;
 int i,j;
 for (i=0; i<n; i++)
   {
   num = 1;
   for (j=0; j<n; j++)
     {
     if (j != i)
       num *= (x_val - x[j]);
     }
   den = 1;
   for (j=0; j<n; j++)
     {
     if (j != i)
       den *= (x[i] - x[j]);
     }
   y_val += (y[i] * ( num/den ) );
   }
 return(y_val);
 }
```
You can download this code as well as the Delphi project and source files needed to build an executable, which is also included. The application uses points on a time/current curve for a protective device and shows the result for a number on the x axis (current) in terms of the y axis (time).

http://enginuitysystems.com/files/Spline.zip

[Edit] I also made a version (Spline_Sine.exe) that sets up an 18 member sine table for each 20 degrees of a full 360 and you can enter any value from 0-360 to get the spline interpolated value and the actual value and the error. You can set the number of samples used, as well as the number of values used by the spline function (which must be enough to include the desired angle). It also shows the number of iterations to get an idea of the execution time. The calculations are all floating point addition, subtraction, multiplication, and division. Of course, the sine table really only needs to be set up for zero to 90 degrees, and all other angles can be adjusted to use just those values. And the cosine table is also the same, just shifted 90 degrees. It should also be possible to use the same procedure in reverse, to get arcsin() and arccos().


----------



## jddcircuit (Mar 18, 2010)

this may already be obvious but

It looks like an arctan Look Up Table from -45 to 45 degree (-1 to 1 at whatever bit resolution) would work fine.
This would require a single division of the two adc results, sinA and cosA

if abs(cosA) > abs(sinA) then sinA/cosA 
else cosA/sinA 
this if statement will avoid dividing by small numbers and produces the reciprocal of tan for two of the quadrants. (see graph)
Shifting all values into the unsigned integer region to further reduce computation overhead is also doable.
A few if/then statements will be needed to resolve quadrant ambiguity to bias the look up table results appropriately.








With so many ways to code it up, I guess the first thing to do is to make the analog measurements


----------



## e*clipse (Aug 2, 2009)

jddcircuit & pstechpaul,

Thank you very much for the suggestions and explanations on dealing with the resolver input. I love hearing about these different ways to approach stuff - it definitely nudges me out of my little box. 

I have been convinced that a look-up table isn't too kludgy a solution; in fact it's probably the best solution when one considers microcontroller processing time.  I'm currently looking into whether the DSPIC has any built-in functions for this stuff. Apparently some DSP's have some sort of hardware that makes multiplications and divisions (for example) a one or two cycle command.

An "envelope filter" is definitely worth looking into for reducing the noise and sample timing issues involved with the the ADC and the resolver. For an easy example, look into how AM radios work. I would like to get a full cos wave, rather than a rectified 1/2 wave. It should be possible by offsetting the center of the cosine signal by 2.5V before doing the AtoD conversion.

Also, I've made some progress in understanding FOC and space vector modulation. Believe it or not, they can work together to simplify things. The only thing that's difficult is plulling your head through two coordinate transformations, then back again.  I'll post a possibility when I understand it well enough to explain to someone else. 

Thanks again,

E*clipse


----------



## e*clipse (Aug 2, 2009)

OK, I've made some progress with Field Oriented control and Space Vector Modulution.

As I guessed earlier, they can work together.

However, I think this stuff is way into the "motor controller" field and pretty off-topic for this specific motor.

Here it is in a nutshell:

The current samples (taken in phase with the correct motor phases) can be transformed from a 120degree offset motor coordinate system to an orthoganal system aligned with one of the motor phases using the Clarke transform. This sounds complicated but only involves multiplying by the correct constants.

You can use the sin and cos output of the resolver directly in the Park transform. This moves the orthoganal output of the Clarke transform (that is aligned with the motor stator) into another orthoganal coordinate system that is aligned with the direct axis of the rotor. This is no big deal - it is merely multiplying by the correct variable values > no trig involved.

At this point, it's very easy to do PI control loops of, say, current treating the problem like a brushed DC motor. 

After monkeying around with the motor control, then transform back into the stator's orthoganal plane using the inverse Park transform. This only requires the sin and cos output values of the resolver, again. These values are the "Direct" and "quadrature" voltages

To transform the orthoganal "Direct" and "Quadrature" VOLTAGES into the motor stator's coordinate system, use the inverse Clarke transform, which again, is simply multiplying by some constants.

The tricky part to me was figuring out how to actually put these voltages in the right place at the right time with a DSPic microcontroller. This is the heart of "space vector modulation" but most of the hard work was already done with FOC. I was able to change the voltages to an appropriate PWM value and put it in the right place with some very simple equations (multiplication and addition, no trig). No look-up tables necessary, just some nested "if-then" type logic.

It works. To test this, I made a spreadsheet that simulated 1 electrical revolution every 5 degrees. I'll go into real details on a motor controller thread. 

For now, would anyone like any details, measurements, etc. for this motor?


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> OK, I've made some progress with Field Oriented control and Space Vector Modulution.
> 
> As I guessed earlier, they can work together.
> 
> ...


Very cool

I look forward to the motor control thread.
I am currently laying out an Arduino Due shield for the Prius Inverter.
I think I have the phase current sensors figured out but I still need work on the resolver side. I would also like more info on the temp sensors in motor and also the MIVT, GIVT, and CT temp signals coming out of the inverter.

Post your simulation. I am curious how you use the cos and sin values directly since the peak value is unknown. I can't figure out what denominator you use on your ADC values for getting cos and sin to vary between -1 and 1. It is this common mode amplitude that needs to be canceled by taking the ratio of these two measurements and a tan look up table to get an angle.

Thanks
Jeff


----------



## e*clipse (Aug 2, 2009)

I'm curious - what does the Ardiono Shield have for motor control? Does it do center aligned PWM?

I would also like to figure out the temp sensors. Ideas for tests?

In my simulation, i didn't solve for the motor's angle. That information is inherent with the sin and cosine input from the encoder. I'll go into more details on my motor controller thread. For now, here is a graph of the output and input. For the simulation, I calculated values for sin and cos as well as two phase currents from 0 > 360 degrees on 5 degree increments.

1) In the simulation, the sin and cos amplitude and offset values are completely adjustable and the adjustments do not affect the output. Most likely an AtoD converter will be used to measure the values from the resolver, so the center will be 2.5V and range from 0V to 5V.

2) Like the angle input, the current feedback's amplitude and offset values are completely adjustable and the adjustments do not effect the output. Most likely an AtoD converter will be used to measure the values from the resolver, so the center will be 2.5V and range from 0V to 5V. These numbers MUST be properly aligned with the resolver's output like a real motor. There is a provision to clock the current relative to the resolver input in this simulation.

In reality, the sin, cos, current1, and current2 values will be amplified and offset in hardware. Ideally the values will range from 0>5 volts to be measured by the controller's AtoD converter. The amount off offset and amplification will need to be compensated in software. Tuning this may be a potential difficulty. 

The simulation uses the Clarke transform and the Park transform to provide an Id and Iq value that is centered at 0 and can range from -1 to +1. Generally, Id = 0 and Iq = 1 if the current input and anglular input are aligned. However, there is a provision to offset this with a % of lag to simulate misalignment or a motor that has a lot of reluctance torque.

At this point in a real system, there would be a PI controller with a user input for torque or current. The ouput of the control loop would be values for Vd and Vq. These values are transformed to the stator orthoganal plane with the inverse Park transform. Here the sin and cos values from the Resolver as measured by the AtoD converter (amplified and offset) are used again. In my simulation these output values are Vref_alpha and Vref_beta.

The inverse Clarke transform moves things back to the motor stator's 120 degree offset 3phase system. These output values are Vrefa, Vrefb, and Vrefc.

That was all the FOC stuff. The State Vector Modulation stuff is also in the simulation. At this point it puts out the values that a DSPic would use to create a pulse in single pulse center aligned mode. This is all done with a bunch of nested "if-then" loops and directly uses the Vrefa, Vrefb, and Vrefc values to derive the pulse timing.

At no time in any of this was a discrete angle calculated or a look-up table used.


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> I'm curious - what does the Ardiono Shield have for motor control? Does it do center aligned PWM?
> 
> I would also like to figure out the temp sensors. Ideas for tests?
> 
> ...


After review the FOC stuff, I think you are right that the resolver outputs can represent the sin and cos values directly in the Park and invPark transforms without look up table or trig functions.

That is Brilliant.
Thanks for the insight.

Nothing special about the Arduino Due microprocessor board other than I already have one and I am using it for other projects.

It does have center aligned PWM channels.
It also has a DAC that I might use to create the signal to excite the resolver.
I am adding an IC to the "shield" plug on board that performs simultaneous sample and hold of upto 8 analog inputs.


----------



## Siwastaja (Aug 1, 2012)

jddcircuit said:


> Nothing special about the Arduino Due microprocessor board other than I already have one and I am using it for other projects.
> 
> It does have center aligned PWM channels.


Hi,

AFAIK, ATMega168/328 does not have three _synced_ PWM channels (only two IIRC, but please check to make sure) and deadtime generation which would be needed for three-phase operation. A carefully timed software kludge might work (but not with Arduino IDE/library) but probably not worth the hassle.

Just ditch the Arduino and use a proper microcontroller for the job. I have seen ATMega640 being used for three-phase generation with analog deadtime kludge. It has three synced channels. Still, I'd consider some of the parts meant for 3-phase inverter operation. Microchip PIC series at least has those. Not sure about Atmel.


----------



## jddcircuit (Mar 18, 2010)

Siwastaja said:


> Hi,
> 
> AFAIK, ATMega168/328 does not have three _synced_ PWM channels (only two IIRC, but please check to make sure) and deadtime generation which would be needed for three-phase operation. A carefully timed software kludge might work (but not with Arduino IDE/library) but probably not worth the hassle.
> 
> Just ditch the Arduino and use a proper microcontroller for the job. I have seen ATMega640 being used for three-phase generation with analog deadtime kludge. It has three synced channels. Still, I'd consider some of the parts meant for 3-phase inverter operation. Microchip PIC series at least has those. Not sure about Atmel.


The Arduino Due is a microcontroller board based on the Atmel SAM3X8E ARM Cortex-M3 CPU. The data sheet is almost 1500 pages long.

It has up to 8 highly configurable synced PWM pairs. No kludge needed as far as I can tell. Deadtime is configurable through registers but in my case I don't use it.
The Prius inverter that I am controlling does not give you access to both high and low switches. It has deadtime built into the hardware and only gives you a single control signal for each switch pair and another control signal to disable all three pairs so it is impossible to turn both on at the same time. You get either High, Low, All Disable.
There may be some other shortcomings with this CPU but pwm configuration does not seem to be one of them.

Regards
Jeff


----------



## jddcircuit (Mar 18, 2010)

jddcircuit said:


> After review the FOC stuff, I think you are right that the resolver outputs can represent the sin and cos values directly in the Park and invPark transforms without look up table or trig functions.
> 
> That is Brilliant.
> Thanks for the insight.
> ...


eclipse,
I may have jumped the gun with my enthusiasm.

I was excited when I realized I could use the sin cos outputs directly in the Park transforms and only have a gain factor residual that could easily be absorbed in the PI regulator for Id and Iq.

However I forgot that there are two phase commutation cycles per resolver cycle which threw a wrench into my plan.

Back to the drawing board.
Jeff


----------



## jddcircuit (Mar 18, 2010)

eclipse,
What do you think

Since the electrical commutation cycles twice for every resolver cycle, check out how one might double the resolver frequency using a couple trig identities.

A*sin and A*cos are the resolver input signals.
The sin(2x) and cos(2x) are the values that will be used in the Park transforms.
The ref a, ref b, ref c are just calculated using the inverse clark transform of sin2x (alpha) and cos2x (Beta)








Jeff


----------



## e*clipse (Aug 2, 2009)

jddcircuit said:


> eclipse,
> After review the FOC stuff, I think you are right that the resolver outputs can represent the sin and cos values directly in the Park and invPark transforms without look up table or trig functions.
> 
> That is Brilliant.
> ...


Thanks! But the real credit goes to the folks who figured out those transforms in the first place. 

Regarding what to do about the resolver/rotor cycle mismatch:

I think you're right about using the 4 electrical cycles/ 2 resolver cycles trick. That way we only need to figure out how to double the number of resolver cycles (effectively).

A person on the EVTech list suggested double angle identities. Very smart. It is what got me thinking the answer might be in trig trickiness. 

Here are the double angle identities:



> Double angle formulas for sine and cosine
> 
> sin (2_t)_ = 2 sin_(t_) cos(_t_)
> 
> ...


http://www.clarku.edu/~djoyce/trig/identities.html

Siwastaja - Welcome to the thread!  Very impressive work with your motor controller. I really like the KISS/know how things really work philosophy.


----------



## Siwastaja (Aug 1, 2012)

jddcircuit said:


> The Arduino Due is a microcontroller board based on the Atmel SAM3X8E ARM Cortex-M3 CPU. The data sheet is almost 1500 pages long.


OK. I though you were speaking about a different product. (Some "hobbyists" had been shortening Duemilanove to Due.)


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> More interesting stuff! Well, I think it is....
> 
> Now that I had a phantom neutral working for the motor, I was curious how the resolver timing worked with this. It took a bunch of messing with resolver drive frequencies, etc. The tests were run with resolver frequencies that were much lower than I would run for a real motor control, But I got some cool graphs illustrating the resolver working along with the back EMF. I triggered the scope with the BEMF signal.
> 
> ...


eclipse,
I am in the process of laying out the resolver excitation portion of my control board design.

Perhaps you have some feeling for the optimal frequency and amplitude of the excitation signal while making your measurements.

For example if I apply an 8kHz 8Vp-p sive wave to the primary what would I expect on the sin and cos returns and what impedance or loading will my drive signal experience?

Thanks
Jeff


----------



## e*clipse (Aug 2, 2009)

jddcircuit said:


> eclipse,
> I am in the process of laying out the resolver excitation portion of my control board design.
> 
> Perhaps you have some feeling for the optimal frequency and amplitude of the excitation signal while making your measurements.
> ...


Hi Jeff!

Are you going with a built-in decoder with a digital quadrature output, or directly using the signals?

I was going to start on the other side, processing the output. If you're using the converter, how clean of a signal does it require? Could it use a 5V p-p signal centered at 2.5V?

Here's what I found while testing the resolver:
1) If there is DC offset in the drive signal, it doesn't seem to affect the output.I tested this at 5kHz with a p-p amplitude of 5V. I varied the DC offset from -0.84V > 0V > 1.03V. The output was always centered around -0.14V with an amplitude of 1.08V p-p.

Of course that could change at higher offsets - I would be cautious about saturation. Saturation is what limited my tests because of my signal generator's limitations. When the offset was above the values shown above, the peaks of the output signals were clipped.

Because the input signal's DC offset doesn't seem to affect the output, it may be possible to build a driver that uses only positive power. That should make things easier. ​2) The driver frequency did not affect the input/output amplitude ratio significantly between 5kHz and 20kHz. In this frequency range, the input/output ratio was ~4.825:1 (requires higher input > output ) 
3) The driver input/output amplitude ratio decreased (higher output/input) between 20kHz and 125kHz, where this behavior peaked. At 125kHz input frequency, the ratio was 1.09:1. A 2:1 ratio happens somewhere between 50kHz and 75kHz.

I guess one could say there is an optimum at 125kHz. If an envelope filter is used and one doesn't have to catch precise peaks at such a high frequency, this could be valuable.  OTOH, the stability of the input/output amplitude ratio between 5kHz and 20kHz may prove valuable because changes in driver frequency would not affect the output amplitude. 


Here's where we are definitely getting into "motor controller" territory. 
It seems we have the same goals for this project - what do you think about an "open source" Motor controller thread?

I would like to make the "open source" motor controller truly "open source." There are a lot of interesting "home built" motor controller threads, but they often don't post critical details, such as the ones we're discussing, or the code necessary to run the controller in the first place. It may be excruciating  to drag people through all this, but I think it would be valuable because everyone could learn a lot from each other. 

Thoughts?


----------



## jddcircuit (Mar 18, 2010)

e*clipse said:


> Hi Jeff!
> 
> Are you going with a built-in decoder with a digital quadrature output, or directly using the signals?
> 
> ...


I will explore multiple methods. You got me thinking about what would be needed to drive the resolver directly and decode it right along with my motor current regulation attempts.

I don't know what you mean by "truly open" but I love to have somewhere that I can bounce my ideas. I am not sure what the outcome so I do not make claims or predictions of what fruits it will bare. My signature states that my project requires a custom ECU for the Prius Inverter so yes we may have a common goal. There are others trying to use these motors but are not as vocal. I am sure they will be lurking.

After I asked you about the resolver drive signals, I did some searching and came to this site
http://www.tamagawa-seiki.com/english/lvdt/post.html

I think Toyota uses one of these "Singlsyn" models. This gave me a rough idea of the input impedance, frequency, and transfer ratio.

Here is a sketch of my resolver excitation driver circuit. I am planning to drive the two opposing sine wave inputs (D_EXEC, D_nEXC) from the two DACs on my uP board. Resolution TBD.








My uP board is 3.3V so I centered my DAC sin outputs at 1.65V +/- 1V. The opamps shift, amplify (4x), and smooth. This results in a differential output of 16Vp-p. I am only using positive voltage supplies. See my simulation: (click on image to expand)








I am going to measure the SIN and COS returns using a AD7609 which I am also using to measure the motor phase currents. It can simultaneously sample and converter 8 differential measurements. Once I get this hardware spun up I can start hacking on some code.

Is that open source enough for you? I would post this in the "Toyota IPM Motor Control Design Details Thread" if you had one
Jeff


----------



## jddcircuit (Mar 18, 2010)

eclipse,
i spun off a thread
http://www.diyelectriccar.com/forums/showthread.php/toyota-ipm-motor-controller-design-details-87535.html


----------



## FireChief (Dec 23, 2013)

e*clipse said:


> Here are some details of the drive gears and differential. I'm posting this detail because:
> 1) anyone who wants to use this thing will need the driveshaft bolt pattern.
> 2) I plan to lock the differential for future work. Hopefully I can find a spool that would make the job easy. I would rather not weld it.
> 
> ...


Thanks for posting this awhile ago. I just want to clarify that it is for the Highlander MGR rear diff ? Thanks.


----------



## marcexec (Feb 11, 2009)

Stupid question after reading all this:
The problem driving these is just the low kV, otherwise they are not fundamentally different from typical ("RC") brushless inrunners, yes?
Some points on the thought:
- power levels are an order of magnitude higher of course
- high voltage is a problem
- rewinding is probably difficult? 

I'd think Lebowski's sine/FOC with a IGBT powerstage could work: http://endless-sphere.com/forums/viewtopic.php?f=30&t=57877
(need to figure out resolver->expected hall input or maybe rely on sensorless).
Or it's just very late at night again


----------



## arber333 (Dec 13, 2010)

marcexec said:


> Stupid question after reading all this:
> The problem driving these is just the low kV, otherwise they are not fundamentally different from typical ("RC") brushless inrunners, yes?
> Some points on the thought:
> - power levels are an order of magnitude higher of course
> ...


I am using Leaf motor with Volt inverter and Lebowski control. 
https://endless-sphere.com/forums/viewtopic.php?f=30&t=99812
I removed resolver because i didnt have a solution for UVW signals that Lebowski required. Here you can see i mechanicaly replaced resolver with RLS commutation encoder. This works really well. https://leafdriveblog.wordpress.com/tag/encoder/

Lately however i found Toyota Prius/Auris/Yaris uses resolver chips Tamagawa AU6802N that can transmitt commutation signals also. 
I am not at application yet, but schematic shows promise for all BLDC motors with Lebowski brain....


----------



## Don Glassford (Jun 4, 2021)

Can anyone tell me if I can replace seals on Q211 electric axle without disassembling the case it's self.Seal on driver's side leaking next to CV axle.


----------



## John_G (Jun 6, 2020)

Don Glassford said:


> Can anyone tell me if I can replace seals on Q211 electric axle without disassembling the case it's self.Seal on driver's side leaking next to CV axle.


Sure looks like they are standard flange seals like any transaxle would have to me. A slide hammer or seal puller and an appropriate install tool that fits the OD of the seal is all you should need after pulling the flange out (expect oil leakage).


----------

