Design Motor Cooling Systems with Motor-CAD and Simscape
Husain Adam, Ansys
Explore this demonstration to see how cooling systems can boost a motor's performance, efficiency, and safety. Find out how Ansys Motor-CAD enables the evaluation of diverse cooling strategies and facilitates the integration of thermal models into Simulink and Simscape, allowing for a holistic approach to system design and performance optimization.
Key takeaways include:
- Thermal design is critical and non-trivial.
- Cooling strategies determine machine continuous performance.
- Integrating system models enables holistic design optimization.
- You can import Motor-CAD thermal models to Simulink.
Speakers:
Angel Gonzalez Llacer, Senior Software Engineer, MathWorks
Angel Gonzalez Llacer is a senior software engineer at MathWorks. Working in the Simscape Electrical team, he develops modeling and simulation tools for electrical, magnetic, thermal, and fluid systems. Multiphysics simulations, design automation, and reliability analysis through fault modeling are his main interests. He focuses on mechatronic systems, including actuators, electric motors, and power electronics. His recent contribution to electric motor cooling is a MATLAB tool that automatically generates an equivalent Simulink model from a Motor-CAD file in order to easily integrate detailed FEM thermal models into full-system Simulink models. He received an industrial engineering B.Sc. from the Polytechnic University of Valencia and a fundamental physics M.Sc. from Paris-Sud University.
Husain Adam, Senior Application Engineer, Ansys
Husain Adam is a senior application engineer at Ansys. He works on the thermal management of electric machines, using simulation tools to characterize thermal performance. His main focus is on solution development, tying together concept stage and detailed design simulation tools as well as creating workflows between products. He holds a MEng degree in chemical engineering from the University of Cambridge, with a focus on heat transfer and optimization.
Published: 27 Aug 2024
Welcome to this webinar on motor cooling system design with Motorcad, Simulink and Simscape, brought to you by Mathworks and ANSYS.
I'm Angel, an engineer from The Sims Electrical team at Mathworks and I work on modelling and simulation of motor drive systems.
You need me today is Hussein, who is an engineer at Ansys working on thermal modelling of electric motors.
Hi Angel, thanks for having me today.
I'm looking forward to this webinar and two, likewise saying you have extensive experience in thermal modelling of electric motors and I wanted to ask you why is it so important to carefully design your cooling system?
Well, ankle, designing electric motors is not simply an electromagnetic problem.
It's important to consider all aspects of a design.
We look at MVH to analyse noise and vibration, we do mechanical stress analysis to ensure the machine has structural integrity and just as importantly thermal analysis which will impact the machine performance and its lifetime.
So as the motor operates, heat is generated internally within the windings, within the magnets, within the stator and the rotor, and the effectiveness of the cooling design in extracting that heat and rejecting it from the motor determines the continuous performance of the machine.
So there's several reasons why this is the case.
Firstly, the resistivity of copper increases with temperature, so as the copper windings get hotter, their resistance increases and this leads to increased resistive losses within the windings which then reduces the machine efficiency.
In addition, as a rule of thumb, for every 10° rise in the temperature of the windings, the life expectancy of the insulation on the windings is reduced by half.
So having a hotter machine both reduces the efficiency, but it also reduces the life expectancy of the motor.
Wow, this is remarkable.
So not only we are reducing the efficiency if we operate at high temperatures, we're also reducing the lifespan of the motor.
So it's it's not going to live for that long.
Yeah, exactly.
And it's not just the winding that we have to, you know, bear in mind the magnets of inside the machine also perform differently at different temperatures.
So it's important to know what what temperature exactly we expect to have inside the motor.
If the temperatures are too great, we also run the risk of irreversibly demagnetizing all the magnets within the motor.
Wow.
So, OK, so when looking at the magnets, once you have figured out the temperatures you're operating in, you may need to go back to to designing the electromagnetics of of you.
Does that impact the electromagnetics?
Yeah, absolutely.
That's why it's very important that you undertake thermal design at the same time or in parallel with the electromagnetic design and the mechanical design.
The choices you make will impact, for example, the materials you select, the configuration of the slots and the and the and the number of magnets you have inside the machine.
If your thermal simulations predict that the magnet is too hot, you may need to reconfigure how exactly your machine is is designed in order to then, you know, move the losses from the magnet to the windings which might be better cooled in the machine.
So if the thermal simulations are an afterthought, it might not be possible to obtain the motor you expect, or your machine insulation might fail and you'll be left with a costly problem.
Wow, this problem is definitely more complex than I initially thought.
Like there's so many things to take into account and I'm very glad that that we have tools to be able to systematically analyse this.
And I also wanted to ask you what are the most popular cooling solutions given all these complexity?
Well, there's lots of different cooling systems available, some more popular than others.
And typically it depends on the performance you're trying to extract from the machine, any cost considerations and also any integration with other cooling systems present where the machine is finally deployed.
So a common and low cost solution which you might see in in industry is just to have a fan cool machine.
So you'll have a fan mounted on the end of the on the shaft and we blow out over the housing of the machine.
And this is called a blown over cooling system in Motorcad.
It's easy to manufacture, I'm sure it's reliable, but it has low effectiveness.
As you know, our cooling medium is far from the hot components inside the machine.
If instead we allow the air to be pulled inside the machine and flow around the components and then be exhausted, this is a you know, we're bringing our fluid closer to the hotter components, so this provides enhanced heat transfer.
In Motor Guard we call this the through ventilation cooling system, which you can see in the list of cooling systems in the Motor Guard screenshot.
So to enable the cooling systems emoticate is very easy.
We simply go to the cooling tab and and we choose the cooling systems we want to enable and you can enable them in parallel as well.
And then you set up the flow rates and the fluid properties etcetera that that you require.
Alongside the simple those simpler cooling systems, we might have a more complex cooling system like a jacketed cooling system.
In this the housing has channels through which fluid flows that can be seen in the images on the on the bottom of the of the slide here.
In a typical automotive application, this fluid will be shared with other powertrain components.
And so for this kind of system, maybe a system level design might be important to to consider.
There's also very high performance cooling systems, so oil cooling systems or slot water jacket cooling systems that we call them Emoticad.
In these cases we have the fluid directly impinging or in contact with the windings, the magnets and flowing through the slot.
It's quite a high performance and costly cooling system design, but it's becoming increasingly common for attractive automotive applications.
Thanks for showing us all these variety of cooling solutions that exist and, and strategies and designs.
I really like how depending on how much you're ready to invest in your design and you you can cool either like in a general way from the exterior of the motor or you can go inside the motor and cool specific components inside the motor that really need cooling in your design.
Absolutely.
And I guess one of the things I haven't discussed are constraints such as the the volume of the machine or the, or the weight of the machine.
Those are all very important as some of the cooling systems result in more compact machines, whereas say an an air cooled machine might have to be larger and have a larger housing to allow the same amount of cooling performance.
Definitely, And it's great that motor car includes models for all those cooling strategies.
I particularly like the fact that you can combine multiple cooling systems and analyze transient responses.
I imagine the coolant inlets and outlets are often, as you described, part of a larger system.
For example, let's consider an electric vehicle.
Here we have two motors, which has been the focus so far of the cooling for us.
But there's also battery packs, chargers, DCDC converters, DCAC converters, lots of components that need also cooling.
And there can be opportunities to to integrate all of the system together and optimize from a holistic perspective.
Yeah, that's right.
So the Motocad model focuses on the thermal performance of simply the electric machine.
But many of our users then want to use this detail model and integrate it into the larger system such as what you're showing here.
So that the larger system which contains the motor, but also the power electronics and the battery pack.
And then the cooling of the motor is then integrated with the coolant, the flowing through all of these different elements.
And that can be done in a, in a smart way that improves the overall system efficiency.
That's great.
And a typical platform where people can integrate models and design the full systems is Simulink and Simscape.
Like this is a Simulink model of an electric vehicle and Simscape can be used for also multi body simulation.
So it's a multi physics multi body platform that supports integrated modelling.
So another thing I wanted to ask you is how can you export a thermal model from Motorcad into Simulink and Simscape?
There's a few different strategies to export the Motorcad thermal model.
The simplest way of doing it, and one that's existed for quite some time, is to simply export the Motorcad thermal matrices into Simulink.
And that is a simple export at a fixed operating point, a fixed flow rate and fixed inner temperature.
The problems with this is that it's only truly valid at the single operating point that you chose during the export.
So if you change the coolant flow rate, if you change the coolant inlet temperature, if you change the speed, then the model is no longer truly valid.
So you'll have some deviations from the real machine behaviour.
Another strategy that can be used to export the Motocad thermal model is to use the Motocad FMU.
Effectively the way it works is that Simulink will use the FMU to directly open Motocad and run the thermal model in Motocad and then transfer the results back into into Simulink.
And it will do this at each time step.
As you can imagine, that's a much more accurate solution because it's using the the physics built into the Motocad thermal solver.
But because it's calling Motocad at every time step, it means that it's, it takes a lot longer to to execute.
And it also requires a, a license of Motocad to to run this.
Is there any alternative to this simple export that's only valid as a single operating point or the Co simulation of motor car and Simulink with FMU that takes a long time to run?
Yes, there is.
There's a third option and that's the option that we're talking about today.
And we'll and we'll give a a demo of that is the Motocad thermal model import into Simulink and Simscape.
This effectively takes the best of both worlds.
So it has the speed of the Motocad Simulink export, but it also has increased accuracy much like the FMU does.
The way this works is that instead of the users choosing a single speed, flow rate and temperature, they're allowed to select from a range of these values and motor SCAD will then export the thermal resistance network at each of these different operating points.
Simulink will then take these thermal resistance matrices and then automatically interpolate between them depending on what the user selects as the inlet temperature or the flow rate or or the OR the shaft speed.
What this means is that the model is now valid over a whole range of different operating points and duty cycles, and system integration can be done with the resulting model without losing any accuracy that that you might have otherwise.
Thanks Khusain for sharing with us all the different ways we can export models from motor car into Simulink.
For the rest of the webinar, let's focus on the latest export technique.
That is what we think also the most valuable for you that consists of this repository that you can find in the Internet if you just Google it.
And then you can just click here and don't download and you'll have all the files, all the MATLAB files and Simulink files that you need for performing the export.
So once you have downloaded it, you can open this project file and it will it will open 3 live screens for you.
Generate, validate and use Simulink thermal model.
We're going to cover them three in this webinar.
And let's start with the first one.
So in the first one, you can here specify the motor cut file that you want to use for exports.
So we have chosen the E8 template for this webinar and we're going to cover it from the beginning to the end, all the export and validation.
But bear in mind that you can do the exact same process for your own motor, so and it should work.
So it's a very flexible way to do the export.
So once you run this first part, it will open your motor file.
And here's what it looks like.
Who's saying what do you think about this motor?
What can you comment a bit on it?
Yeah, of course.
So the E8 template is an interior permanent magnet synchronous motor.
It's rated at 80 kilowatts and it has a maximum speed of 10,000 RPM.
So this particular design is based on an automotive traction motor, and it has a distinctive design with two layers of magnets and various ducts within the rotor structure.
You can see the cooling configuration for this machine is as we can see a housing water jacket which is the dark blue material on the top and and bottom of the machine through which fluid is flowing and also internal air cooling.
So the ventilated cooling system is enabled, which are the lighter blue arrows flowing into the machine from the right hand side through the through the the rotor structure and through the air gap and being exhausted out of the left hand side of the machine.
These cooling systems can be enabled by going to the input data cooling system.
So here we can see the through ventilated and the housing water jacket cooling systems are both enabled and to set the flow rates and inlet temperatures of those it's it's very simple.
We simply go to the appropriate cooling system tab in this case housing water jacket.
We set a fluid volume flow rate here of of 5 liters per minute and inlet temperature that we want and then motor scan will then use that in at temperature and flow rate in the calculations.
The same also applies for the through ventilation tab.
In this case we can see here of a higher volume flow rate of 500 litres per minute because we are using air and a slightly higher in at temperature of 40° which represents the higher temperature surroundings of the machine.
Great.
Thanks very much for this exploration of the motor cooling systems.
So once we have run these two lines and Motorcad has been loaded and connected to MATLAB using our interface included in this, in this project, we can then select here the ambient temperature that we want to use for this export and then also the operating points that we want to include in this export.
So this these are the speeds in this case we have 3 speeds here 503,000 and 7000 RPM of the shaft.
And then we have flow rates and in the temperature for each of the cooling systems as as Hussein described before, we have the housing, water jacket and ventilation.
So we need to give all these dimensions.
So what are the kind of guidelines Angel for users to choose?
How many break points should they choose and and how many combinations of calculations will the will mat up Simulink run?
That's a good question, Hussein.
So the rule of thumb is the more breakpoints you add here, the more accurate your reduce order model will be because the interpolation's fitting better the nonlinearities between each dimension.
And so the problem is the more breakpoints you add, the longer it's going to take to run the export because the total number of predating points is going to be larger.
So if we start adding many points here, then in this case, if you multiply the number of points in each dimension, we have 108 operating points.
That's we have more points, it quickly goes up.
So it's a trade off between how quickly you want to get your reduce order model and how accurate you want your reduce order model to be between break points, because at the exact break points you are, you're going to get the best results because we're not interpolating in between.
OK, thanks for that explanation, ankle.
So how long will it take to actually run this on a computer in this case, with these break points, it takes about 15 minutes in my computer to run.
So it's not that long.
And yeah, so let's let's run this.
Great.
So after 15 minutes of calculations, this model has been created for you.
It has a reduce of the model and certain inputs that are configured as constants for us to to quickly test it.
So I'm going to click run while I comment a little bit on the inputs.
So the inputs are the the shaft torque and speed.
And then we also have the housing, water jacket and ventilated inlet conditions.
So in terms of flow rate and inlet temperature, you can see here we predicted the no temperatures for 1000 seconds of simulation.
And yeah, these are the results.
Wow ankle that was very quick to generate those results.
So when you when you ran this simulation, did it require Motocad to run in the background or are we now free from using Motocad?
That's a very good question.
So actually, no, once we have run the this script that generates the the model, this model is completely standalone.
You only need the Simulink to run it MATLAB and Simulink.
And you know all the data that has been generated through motor card calculations has been stored in this model as arrays.
And you know, you can find all the values from the export here.
So you you know, once you have exported the model, you can close motor card and and you can also share it with your colleagues and you can you can directly use it here with MATLAB and Simulink, right?
And what are the other outputs available to to the user?
So we can also see the power, the heat flow in each node in in this output.
And we can also see the outlet temperature.
So this is for the housing, water jacket and for the ventilation so that we can quickly understand how our fluid is warming up as it as it goes through the motor.
And also, let me quickly show you how you can use this model not only for constant inputs like we do here, but I'm going to add like a constant plus a ramp in torque.
So imagine like this is an automotive traction model, as you said, and you know your driver is pressing the pedal more and more slowly to request more torque.
But like 0.1, I'm going to add a scope here to know what the torque value is.
Let's run this again, but we're asking a torque that goes from 20 to 120 Newton meters and we can see how our temperatures are increasing faster and faster since we are investing more torque and current to the motor.
Now that we have generated the model, people might wonder how can they validate the model?
How can they ensure that it results match motor cuts results.
So for that we we can use this script called validate Simulink thermal model.
But it will perform a transient calculation in motor cut and it will compare it to the same simulation in in Simulink.
So the particular point we're going to study here to compare is constant talk of 70 Newton meter.
And then we're going to also select here which break points we we we're testing in the table.
So here's the third speed, so 7000 RPM and the second flow rate, etcetera.
I, I think I just finished here we have the results.
Let's have a quick look.
So we can see in blue is the Simulink results and in red is in is the motor car transfer results.
We can see they generally match quite well.
There's a slight difference for certain nodes of about two degrees and here we can see the the exact operating conditions.
We are running this test for 7000 RPMS, 10 litre per minute for the housing, water jacket, 10 litre per minute for the ventilation, etcetera.
I think overall, what's the temperature range there from 65 to to 25° to degree temperature difference, it's not so bad.
Yeah, I hear it computes the maximum difference between the two for all points and it's about 1.8° is the maximum error that we're getting.
We could do better if the the loss maps here.
So yeah, I'm going to quickly go through how the model looks like from the inside.
So we have several modules here.
There's the the loss maps from Motor Cut Lab that compute for a torque, a given torque and speed.
They will compute the losses for each type, which are the losses that the motor cut thermal model has here in this column, this table here.
So it's figuring out the loss for each type.
And then this module here, the this subsystem, the power loss distributor is going to figure out how this losses distribute into the nodes inside the motor.
So once we have this array of node losses, in this case, I think we have around 123 nodes.
So this vector has size of 123 and is passed to the the interpolated state space thermal model, which is the all the collections of states of thermal matrices state space model that motor car exported.
And they're all put together here stored in this state space and the array and it interpolates the state based models based on speed, flow rate and temperature and also injects the losses at the at the nodes with this value here.
That's the architecture of the reduce on the model.
And we have here temperature feedback to to the copper losses that is applied in the power loss distributor subsystem.
So all of that thermal matrix knowledge is built into into the interpolated state space thermal model block.
And also the power loss distributor also has knowledge in terms of how the power is distributed over the different nodes, right?
That's right.
And all of that knowledge is is transferred from motor car into this model, stored into these variables here that are also saved into the model workspace here.
Great.
But if I wanted to use different losses in this machine, if I didn't want to use the loss maps from Motocad Lab, could I just remove that block and and add my own?
Absolutely.
So if you have a way to figure out loss for each type, that is custom to you.
For example, you don't have torque and speed as inputs, but you have D axis current, Q axis current as inputs and you have exported from a different way other than the labs with torque and speed.
You could totally just delete this subsystem here and replace it with your version of the lookup tables and place it here.
As long as you pass the loss of each type to the power loss distributor subsystem, then your model should be fine.
Oh, great.
That seems very flexible.
And I guess people who are familiar with Motorcad will will know the losses of each type necessary to to input for a particular model.
That sounds great, right?
So let's move on to the what we can, how we can use this model now that we passed it to Simulink, how we can integrate it with other systems.
So we have this U Simulink thermal model script that is it covers a little bit of the architecture of the model that I already showed.
So one thing we can do once we have exported the model is to do a drive cycle study.
So we're going to have a drive cycle of vehicle speed and a simple model of vehicle dynamics that takes from a reference vehicle speed.
What is the torque and and rotor speed that we need.
And we just put this with the OR the generated model.
And here we're also pledging with some dynamic changes in, in operating conditions like housing water jackets flow rate changing as a step and the inlet temperature of the house water jacket ramping up.
As you know, it's, it's running and we're imagining it runs as a cycle like the outlet of the housing water jacket fluid comes eventually back in as in the inlet.
So it's continuously heating.
And we're going to try to mimic a little bit all of that and see how we can get some insights about the temperature in different components inside the motor.
So here we're running a 2000 second simulation.
And since we have now more dynamically changing inputs, the model takes a bit longer to run, but it's still significantly faster than real time.
So you can see how we've already simulated 260 seconds in time.
It, it took me to to to say this sentence.
So it's, it's still useful at this at this rate and I'm going to stop it here.
But you know, you can run it and then answer certain questions like, OK, in this drive cycle, what is the maximum temperature we get for the magnets or the copper?
Are we at risk of breaking up the insulation or the magnetism?
So this comes back to the observations saying earlier about what is this useful for, right?
Thanks very much for that demo.
I think you really showed how easy it is to both export the model and also then use the model with varying Dr.
cycles and, and how simple that that can be to set up.
I'm glad you think it's useful.
And another model that I wanted to show you is how you could then integrate this motor cooling motor thermal model into a bigger system that has other components that also either need cooling or provide coolant.
And so we have we typically use Simscape when we want to model multi components, multi physics systems.
And in this case we have our motor that has a housing, water jacket, inlets and outlets, which is then driven by a pump that is driving the the water in the motor and through our radiator that will dissipate the heat to the ambient.
And then on the other side, we have inlet and outlet for the ventilation which is air.
So this here is a thermal liquid domain.
It's a liquid that can change the temperature and that here we have a gas domain.
So we have air that also can enter here and then come out hotter from the motor.
And in this case, it's being driven by a fan which is driving here at a constant speed of 1000 RPM.
And we also have a vehicle dynamics to kind of how the motor would then provides torque for a car, for example.
And we have a driver model here in Simulink, which is trying to track.
So if there's just APID controller, which represents a driver trying to request a torque from the motor, that will make the speed match the reference speed.
So we have again a drive cycle here and I click run.
So you can see how once you have integrated your model into the bigger system, you could then find out opportunities for trade-offs with other components and also helping other teams working on this cooling system to, to provide to, to find the specifications and, and and performance measure the performance.
Again, since this model contains more components and it's more rich in, in, in behaviour, it, it will take a bit longer to run than the others, but it's still a reasonable around a bit faster than real time so that it can still provide you insights fast enough for you to, to, to improve your design.
So in this case, it's not just the fixed analysis that you might do in Motocad with the fixed flow rate and and temperature by here you're incorporating the real physics of the the radiator, the fan.
And I guess these you said these results would generally be shared with other team members and be used for their design as well.
That's right.
Yeah.
You could share models and have people replace components with their own models so that they can evaluate how their iterations in design have impacts on the other team's requirements and performance.
So it's a great way to collaborate.
Like there could be a team working on designing the radiator, another team working on the vehicle dynamics or like the, the driving style of of the user.
And, and you could, you could figure out how all these things impact each other in this, in this kind of collaborative model.
Amazing.
And within that main block of the Motocad model, were there a lot of changes you needed to make to set this up or was that fairly simple to do?
So I'm glad you asked this question.
I wanted to show you that.
So if you look at it, we have the original reduce of the model subsystem that motor car like we generated before.
And we just put it put it here and we just put some adapters here, shaft interface, ventilation interface and housing, water jacket interface.
And we connect it in a loop.
So we connect the outlet temperatures that are calculated from the reduce of the model.
We pass it to each of the cooling interfaces and then the cooling interfaces figure out the inlet conditions and pass it to the motor car and running this in the loop and then then works.
So it's kind of a little trick there to use the outlets of the reduce order model temperatures as the inlets of the cooling systems.
Exactly, exactly.
It's a little trick modelling trick.
And yeah, then you can iterate this in a in a Sims key model.
So it can be useful and is all of this available for our customers to to access and to modify directly or will they have to set all of this up themselves?
This is this is available.
They they, they need to run the export for their own motor.
And once they have the the Simulink subsystem that has been generated for them, they just delete this one and replace it with them their their system and they can test it in this particular condition.
I guess for bigger motors, you may need bigger radiators.
So you can come here and modify your radiator model so that it can radiate more heat, but with some modifications you could, you could then see how this this you can integrate it in Sims Scape.
For example, we have some we have certain examples of electric vehicle cooling systems and you can see here we have Sims Scape models similar to what we had before, but with many more components is a more complicated one.
But you can come here and in the same way I described before, you can place your motor here and then observe how it impacts in the cooling of the inverter, charger, battery, etcetera.
And you can then rearrange everything to your particular vehicle design and, and and have everything modified.
But yeah, this is this would be how you can integrate it in into Simscape models.
Great, thanks for that ankle.
I I think very comprehensive and and there's lots of different pre-existing templates already available for our customers.
Great.
So it's time to bring this webinar into conclusion.
And I wanted to ask you, Hussein, what do you think are the takeaways that we should leave this webinar with?
Oh, thanks ankle.
Well, we've shown that the thermal design of electric motors is critical to the machine performance and it's also a non trivial.
It needs to be done at the early stage alongside electromagnetic analysis and needs to be comprehensive.
We've also shown how there's several different cooling strategies available depending on the the parameters and the machine performance you are trying to extract.
And overall, depending on the the strategy you choose, the continuous performance of the machine will be determined.
We've also shown how simply by doing component level analysis is, is not enough.
We can get good results, but we are not getting a full overview of how the the machine would behave in a real system.
So the integration of the components into system models allows for this holistic design and also then optimization, optimization of the individual components, optimization of the whole system as well.
So we achieve a final better design.
And finally, we've shown you a new automated Motocad thermal model import to Simulink, which is available to you today to download from the Mathworks website, which allows you to take the the Motocad model and, and integrate it into a system model easily, effectively, and with with accuracy.
That's right.
And we invite you all viewers to download this repository and try it out with your own machine designs.
And please let us know what do you think?
Yep, thank you so much for your time today, Angel.
It was really great to collaborate with you on this.
My pleasure.
It was a privilege to work with you on this.
Looking forward for more collaborations and for the feedback from our viewers.
Absolutely.
Take care, take care.
Bye bye.