Motor Control Design with MATLAB and Simulink

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] welcome everyone my name is doc ihu and I'm part of the math works application engineering team my job at the math works mostly focuses on supporting motor and power control engineers in the automotive industry to adopt model-based design in this video I'm going to show you some industry examples for motor control design using MATLAB and Simulink motor control is a very important topic for transportation electrification typically in electric or hybrid electric vehicles the motor drive system consists of three parts motors power electronics and the controls as of now 2018 the majority of vehicle traction motors are permanent magnet synchronous machines or PMS M because of their high efficiency and power density as well as the ability to maintain constant power over a wide range of speed on the other hand we also seen an increasing presence of induction machines and switch reluctance machines as traction motors each having their all unique advantages in this video we will focus on the control of PMS M but some of the tools and techniques discussed here are applicable to other types of machines as well the major control topics for PMS M I'm going to cover throughout this video include field oriented control auto tuning PI controller gains dynamic decoupling control and flux weakening control the general approach I'm going to use in this video is that first I will introduce the concept and then I will walk you through a similar model that demonstrates the concept so you will get a concrete understanding of how these concepts are implemented in industry to begin with we are going to look at the most fundamental concept in PMS M control which is field oriented control or FOC engineers designing controllers for PMS M motors usually rely on FOC control to provide the basic controller structure so that they can decouple the control of flux and tour here you can see a schematic of the FOC control system the core pieces of this FOC controller are the park clock transform current controller and also the inverse spark transform let's see how this is implemented in Simulink if I have model 1 opened up here here model 1 is the system level model for implementing FOC control for PMS M I have partitioned to the controller model to the left side and the plant model to the right side when you step into the plot model you will notice a permanent magnet synchronous machine model that's part of SIM escapes Power Systems library it can access that library from here there's a library button they can click and that machine model is inside sim scape inside the Power Systems library and under specialized technology under fundamental blocks under the machines and this is the model that we used this permanent magnet synchronous machine model okay so you can just drag-and-drop here once you open the model you'll notice that it can initialize the parameters in here in this panel it can either directly type in a values or in my case if you look inside this model I actually used the parameters here and they initialize them in my MATLAB script one thing I want to mention is that when you select the mechanical input for this machine model it can either select speed input or a torque input so when you select the talking boot basically you're saying that I want the TM as my load torque when you select a speed input this is similar to basically controlling the machine on a dyno and controlling the speed of the machine using this speed source so in my case I'm using the speed as the mechanical input I'm basically telling the machine to constantly operate at a thousand rpm while I'm tuning all those controller gains so this guy and like I mentioned I have a script to initialize the parameters here so if I pull up model one initialization script here you can see let me zoom in a little bit so here I've got a set of machine parameters so I have the DQ axis inductance as well as the winding resistance and lambda M which is the permanent magnet flux linkage and also the pole pair number and besides the machine parameters I've also have in here initial set of controller parameters so here I said the controller gains for my PI controller to be 1 and I have set a hundred and a 250 for my Q and D axis current reference so the set of PMS and parameters that I used here are actually comparable to the first generation Prius motor now let me just press the Run button and run this script after running a script it will notice that all the parameters are popping up in the workspace ok let's go back to the model so on the plant model side you also notice that we can access the motor measurements through this import which includes no standard car and ABC which is currents on this stationary reference rank also the DQ currents as well as the rotor mechanical speed Omega M and the rotor mechanical angle theta and if we go back to the top level model you will see that on the top level model there's a unique delay block inserted in a feedback loop this is necessary because of two reasons first for digital control there is always going to be some kind of delay in the assembling loop adding a delay here actually is true to the real system second this unique delay block will help break any algebraic loop should they exist in this closed loop control system then on the controller side you can see inside here there are two PI controllers that are used to control ID and IQ and therefore to effectively control flux and torque and then downstream we have inverse Park and Clark transform to compute alpha beta and ABC voltage commands further downstream space vector PWM modulation algorithm and also inverter models often used to transform the voltage commands into PWM signals that are applied to the stator windings but in our case we wanted to focus on control up with him development not on the PWM switching or modulation techniques and therefore we are using ideal voltage source in the model as you can see in here ok now from here if you go back to the top level model and that's press the Run button here and to start the simulation the first thing you'll notice once you start running the model is that all these Simulink blocks will have distinct colors these colors actually indicates the sampling rate that each block is sampled at and you can turn on the color legend from over here and the internal colors and then we'll see from this legend that the red block which is a controller block here is sampled at 100 microseconds after simulation is finished you want to check if the current is following a command so let's look at this scope here I'm looking at IQ current reference and response it looks like there's some overshoot and the current is not reaching steady state within point three second simulation time keep in mind that when we initialize the controller parameters we used one as the default gain for both the proportional and integral gain and obviously that gain is not optimal and we need to tune those gains to achieve better performance the industry engineers will use simulation to calculate the ballpark's of those gains and then fine-tune them during actual hardware testing as a matter of fact the controller gains are usually not fixed in the real case instead they're scheduled based on different operating points this is what we call gain scheduling but that concept is beyond what we are discussing in this video okay now back to how to auto tune the PI controller gains within Simulink here I'm introducing you to a new tool called Simulink design optimization which can help you tune those gains automatically Simulink design optimization is an add-on Simulink toolbox that allows engineers to analyze and to model parameters and controller gains to start similar design limitation go to analysis response optimization from here select new and step response envelope the reason we are selecting this is because in our case we wanted to specify a time domain step response requirements this is where we should set up the time domain requirements remember in our initialization file we set up IQ command to be a hundred so we're going to use a hundred here our entire simulation time is 0.3 seconds so here I want the rise time to be 0.1 second and the percent rise to be 90 percent and I won the settling time to be 0.2 seconds and settling is 0.5 percent for overshoot I wanted to use 1% in undershoot also 1% here we also need to select the signals to bounce and in this case IQ is the signal that we control to have a step response so we have to go to the model and actually highlight the IQ feedback there we go back and go over here and now you see that it's available in here for you to select click OK ok now you will see this bounded envelope and this is where we want to see the IQ signal to converge into and then we also need to select the design variable set over here and in this case the design variable set are the gains that we want it to tune so if you go over here add new and you'll see that there's already a bunch of them populated here and I just need to select the gain eye and game P click OK now from here all you have to do is to press the optimize button you will see a window popping up showing you the progress report it listed how many optimization iterations had already been done and you will notice that during the first cup of iterations here the Accu response is not convergent it's out of bounds then the optimization tool is tweaking the P AI gains in order to make the response to settle into the amulet here you might take a minute or two so I'm actually going to cut some time so after about 10 iterations the optimization converged which means that the step response settled into your preset envelope now if you go back to the workspace in that lab you will notice that the game values are already updated by the similarities optimization and that's simulate with that game so we go back to the top level model simulate again now you'll notice that the IQ current response is much better than before ok now we have done tuning the gains for the PI controller next I wanted to introduce you to the third topic which is dynamic decoupling control actually cross-coupling control has already been implemented a model one if you go inside the controller model and go inside current controller you'll notice that we have a controller module around here called dynamic decoupling control so I want you to try one thing just go ahead and highlight these blocks around here and then select comment them out you'll likely get a warning saying that you cannot comment out this input port but that's fine so after being commented out this part won't play a role in the control system ok now go back to the top-level model and simulate it again now you will see that if you look at the response it is not as good as before now let me explain what is cross decoupling control and why it has an impact on the controller performance let's look at the machines voltage equation from the DQ axis that means room in a little bit so ideally we would like to have the D axis current to be controlled by the D axis voltage and also the Q axis current to be controlled by the Q axis voltage but if you look at these two equations you will see that VD instead of just controlling ID it will also have an impact on our Q and also for V Q instead of just controlling IQ it will also have an impact on ID this is called cross coupling between D and Q axis as you can see this cross coupling will become stronger as speed increases because speed is the coefficient here so at a higher speed this cross coupling term will negatively affect the motors dynamic performance therefore the cross coupling terms need to be taken care of in the control so this part over here is the part that cancels out the cross decoupling terms and therefore implementing decoupling control what you are seeing here in the model is actually a simplified version of dynamic decoupling control and it doesn't really consider the variations of motor parameters at different operating conditions in industry engineers will use look-up tables instead of fixed parameters to calculate the dynamic decoupling terms and also other types of decoupling control might be used as well so from here after tuning the P R controllers and also taking care of the cross coupling term we will move on to model two which is basically an extension of model 1 so this is model 2 before running model to you please remember to run the model 2 initialization so you model 2 we added a speed loop on top of the current control loop and the reassigned ID equals zero all the time then we use the output from the speed P I loop as the command for the IQ current this is so called ID equals zero control this type of control strategy is not necessarily the best control strategy for this type of PMS and machine I use this here just as an example to show you how to do speed closed loop control so if you go back to the top level model and just press the simulation button you can look in the scope and see the speed loop response I see that the speed follows the command pretty well so here as an exercise you can actually try to use similar design ization to to the pi controller gains for the speed loop now let's move on to topic for flux weakening control this is a very important topic for PMS and control electric and hybrid electric vehicles we parse the PMS and motor to operate in a wide range of speed but without flux we can control and due to voltage limitations PMS and machines cannot operate in the high speed region let's look at the torque speed map of a PMS M machine this is a typical torque speed operation envelope for PMS and motors there are basically two operating regions one is the constant torque region and the other one is the constant power region there's possibly another region beyond the constant power region depends on the characteristics of that particular machine but we are going to ignore that in this example the corner point between the constant torque region and the constant power region corresponds to the base speed of this PMS M motor the base speed is primarily determined by the DC bus voltage of the inverter that drives this motor in the example that are provided the base speed is about 876 rpm when the machine operates above base speed the inverters DC bus voltage will be utilized to the maximum and therefore won't be able to drive enough currents into the machine to generate the required torque if the torque commands continue to increase we can look at this issue from the torque speed up radio mule off so all regions below the green envelope are regions physically possible for the PM SMT operates for example at 2500 rpm and a torque command of 180 Newton meter such as indicated by the star here it is impossible for this motor to operate at this operating point simply because it's outside of the envelope we can look at the operation envelope from another angle on the current IDIQ axis this axis is what motor control engineers commonly use in industry to analyze motor operating points so here first ignore the read trajectories and focus on this light blue ellipse this is the so-called speed limit contour or speed limit ellipse the physical limitation of the inverter that's driving a motor requires that the motor always operate either on or inside is contour so at 2500 rpm this motor can only operate either on this contour or inside the contour notice that we have contours for the torque as well here this blue contour is 180 Newton meter and then the other one is 50 Newton meter apparently here this 180 Newton meter torque counter does not have any intersection with the speed limit ellipse therefore this particular torque command cannot be achieved when the motor operates at 2500 rpm so under this circumstance we will need to downgrade to the torque command and use flux weakening control to find the most appropriate operating points such that the losses in the machine can be minimized to help you better understand flux we can control I'm going to use this industry example to show you how to select flux weakening operating points basically there are three cases I'd like to discuss case 1 when the speed is below base speed so let me repeat here the first thing you have to keep in mind when you are analyzing machine operating points on the IDIQ plane is that the voltage limit ellipse right here dictates the operating region that's physically achievable so anywhere on this part of the ellipse or inside the ellipse is achievable by the inverter hero salami explained the rat trajectories which consists of three parts the first part is called mtpa which stands for maximum torque per ampere and the second part is the current limit and then the third part is MTV V which stands for maximum torque per volt you can find their definitions in text books and so I'm now going to spend more time here in the first case when the speed is below base speed we're actually not doing any flux weakening control in this case assume that now we have two torque commands one is 180 Newton meter and the other one is 50 Newton meter they're both intersect with MTPA line under base speed the intersections between the torque contour and the MTPA line are actually the most efficient operating points for that machine so here point a and point B are actually the optimized operating points that we wanted to put in our lookup table in the second case speed is above base speed let's say 1300 rpm remember our base speed for this machine is around 900 rpm the speed limit ellipse shrinks as speed goes higher and remember only the points that are located either on or inside the speed limit contour can be achieved in this case you can see that the 180 Newton meter torque contour intersects this mtpa line outside the speed limit ellipse and therefore this point right here is not achievable and in this case we have to select point B as the optimal operating point which is the intersection of the torque contour and the speed limit ellipse because this is the operating point that can achieve the required torque while generating minimum loss as for the 50 Newton meter command because point a is still inside this speed limit contour and therefore we continue to use this point as the optimal operating point in a third case or a case to be this is where the speed is above base speed and we have a torque command that's not a available as you can see here clearly the 180 Newton meter counter does not intersect with a speed limit ellipse and in this case we cannot achieve this torque still we are going to put point B in the lookup table because point B is the intersection of the speed limit contour and the MT PV line which indicates the maximum torque that can be achieved under this speed limit as for the 50 Newton meter torque contour because it intersect the speed limit ellipse at Point a therefore this torque is achievable in the end when we look at all the torque commands and speed limit contours this is what the final flux bikini lookup table points will look like in industry we will automate this lookup table calibration process by either scripting in MATLAB or use toolboxes such as the model-based calibration tool box now let's jump to model 3 this model demonstrates the implementation of the flux we can in control algorithm so first let's take a look at the initialization file as you can see here all the lookup table points for flux we can control have been populated here so let me run the initialization and then from here let's go to model 3 again and ROM model 3 so your model 3 instead of having a speed closed loop on top of the current loop it actually has a torque control loop so let's look inside here the inputs to this controller are the torque command and also the speed feedback that's coming from the motor so the flux weakening control lookup tables will take the torque command and the speed feedback and then generate the ID and IQ current command you can actually look inside this lookup tables and visualize the lookup table points just click added table on break points and then from here click this and then you will see the lookup table surface now let's go back to the top level model and just run it check the results so basically what you're seeing here is a torque control response so we're giving the tour command and see how the actual torque follows the command and in this case in the beginning the torque command is 100 Newton meter and then at one point five one point two five seconds the torque command steps up to 200 Newton meter and if you check the speed the speed is actually controlled by what you call the Dino speed source in this case the speed rumps up from zero rpm to 1500 rpm within one second and as we know 1500 rpm in this case is already in a flux weakening region and then the speed maintains 1500 rpm for one second and then ramps down to zero rpm as you can see whether this machine is operating below base speed or above base speed the torque response is always following a command now we are close to the end of this motor control with MATLAB and Simulink video to summarize we talked about FOC control auto tuning P our controller dynamic decoupling control and flux we can in control so the models that we walked through in this video are provided for you hopefully you can play with them and to get familiar with this control topics if you have not already and if you're interested in learning more about this topic search motor and power control design with Simulink here this mathworks page you will find a lot of information so that brings us to the end of this video I hope you have learned something here and that you can apply what you have learned to your future work and projects thank you very much for watching
Info
Channel: MATLAB
Views: 51,539
Rating: undefined out of 5
Keywords: MATLAB, Simulink, MathWorks, Simscape
Id: lP4jbmthiyc
Channel Id: undefined
Length: 28min 46sec (1726 seconds)
Published: Thu Aug 15 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.