Simplorer-Maxwell co-imulation

I have been working on Simplorer-Maxwell Co-simulation recently. There is so little information on this topic that I can only summarize some experience on my own. I am going to share it with you to prevent you from being stuck with similar problems in the future.
1. About the setting of external inductance and resistance of the motor
Many people say that this place should be set to the winding resistance and leakage inductance of the motor, otherwise the current will not converge at all, as shown in the figure below.
In fact, this is not that it has not converged, but it has converged slowly, because the tutorial converges quickly. At first, I thought that mine had not converged (the tutorial directly used the inverter to simulate, and I used open-loop SVPWM control here). Once I went to the cafeteria to eat, I suddenly had the idea to extend the simulation time. When I came back, I found that it had converged, as shown in the figure below.
Some people will say, why don’t you just follow other people’s experience? Why talk about so many useless things? I think so too, but the video tutorial does not use the Maxwell 2D model, he uses the RMprt model, the resistance and leakage inductance are known, I use the Pruis model I built, and only found the stator resistance from the Internet, and there are very few other data, so the parameters can only be guessed. Okay, let’s continue to talk about convergence. After that, I tried several methods to make it converge faster. After all, it takes a long, long, long time to simulate once… I changed a lot of parameters, but they didn’t change well, but I summarized a few things:
The inductance cannot be too small. If it is too small, it will not have much effect on the convergence speed. If it is too small, it will be like the picture below, not sinusoidal.
If the resistance is too small, the current will be large; if the resistance is a little larger, it is easier to converge, but the current will become very small (open-loop SVPWM is just equivalent to giving a signal, there is no current loop feedback, and the current is of course determined by the stator resistance)
Later, I felt that I couldn’t adjust it well, so I closed the current loop directly, that is, I replaced the Ahpal and Beta voltages given by SVPWM with the measured current after Clark transformation. As a result, I found that the convergence was very fast. I don’t know the specific reason, but I want to tell you that it is OK to adjust it almost. What is almost? Look at my first simulation diagram, there are two voltmeters VM2 and VM3. As long as their voltage phases are almost the same, it will be OK, as shown in the figure below.
2. Measuring components connected to the motor
Connect the output terminals of the motor together (Y type), and connect the rest as I do, because everyone does it this way, and there is no explanation why. Set the moment of inertia and initial position angle in MASS_ROT.
One thing to note is that I use the purple measuring element XX_ROT, and there is also a pink XX_ROTB, which are essentially the same. Look carefully, the two wires connected to the motor are both pink, and there is a square on FM_ROT1 that automatically converts.
Another thing is that you must pay attention to the data from your position and speed sensors, either all positive or all negative, otherwise the waveform transformed by Park will not be a constant because it is reversed (you can see this by deriving Thet negatively), and the wrong result is shown in the figure below.
3. Setting of simulation time
During Co-simulation, Maxwell and Simplorer run at the same time, and the programs run according to the time and step size set by each. Among them, Simplorer is the active one and Maxwell is the passive one. When Maxwell finishes running but Simplorer is still running, Maxwell will rerun and exchange data with Simplorer. In practice, it is found that the setting of simulation time has a certain impact on the results. For example, if the simulation time and step size of the two are set to the same, the simulation results will be incorrect. Under the premise of repeated experiments, the following experience is obtained: set the time and step size of Simplorer longer, and set the time and step size of Maxwell shorter, so that the experimental results are close to the correct value.
However, the step size of Simplorer is set longer. It was set to 100us before, which is not good, because the cycle of SVPWM is very close to it, 5000Hz.
The problem here is that the phase voltage of the inverter is very small, only single digits, which is wrong; and when looking at the saddle wave and carrier, it is found that the amplitude is wrong. It is all right if it is reduced. This has also stuck me for a long time. However, the problem caused by the smaller step size is that the simulation becomes slower.
4. Closed current loop
When adjusting the current loop, a constant speed source is given, no torque is given, and the PI parameters are adjusted. I remember that it seems that it can be adjusted casually (the premise is to solve the above problems), but in fact, one thing is overlooked here, which leads to problems later. In fact, in this step, as long as the current is stabilized, it will be fine. The dual closed-loop control mainly depends on the speed loop. Here, I would like to mention the adjustment of the PI parameters. When adjusting, if you find that the given value is 300, but there are only more than 100, it means that P is small. If you increase P and find that it is still a few dozen away from 300, it means that I is small. If it is still a little short in the end, I don’t seem to be able to adjust it well, and it is also because the simulation is too slow!
One more thing to add, the advantage of connecting like this is that the reference quantity of each quantity can be clearly defined. For example, when you see that the torque of the motor is negative, would you think it is working in the generator state? In fact, the negative torque is the reference direction. In fact, to see what state it is working in, it depends on which of the three-phase currents is ahead of whom.
Another point, the torque is negative, and the corresponding iq is also negative. When the loop is closed, the given iq is negative, so pay attention here.
When the current closed loop was first made, the constant speed source gave a positive value, and the motor inexplicably worked in the power generation state, and should have given a negative value. The reason is still unknown (it may imply that the reference direction of the speed is negative, just a blind guess), but it has little impact on the subsequent process.
– Now you may know, you can read the analysis in my Maxwell Learning Summary blog. Maxwell 2D does not allow users to change the rotation direction, and you cannot change it here, otherwise there will definitely be problems. Please read the blog for details. It is that the transformation formula is not corrected, resulting in the reverse sign of the dq axis quantity.
5. Closed speed loop
In fact, as long as there is no problem with the current loop, the speed loop is also closed. The problem here is that the speed often runs away inexplicably. The torque given is negative, and it is actually negative, but the speed is also negative, that is, it is different from the result obtained in the current loop before.
In fact, the reason is that the initial position angle is not set. Because in Maxwell, in order to align the d-axis with the A-phase axis, we gave an initial angle of 30°, and it should be given here as well. Click SM_ROT1 to set it.
Of course, it is mentioned above that there is a slight difference between pink and purple. The pink component cannot be set, but you can add a position angle to it from the output. It is amazing that the result is very different with just 30°.
Therefore, the conclusion is that the torque is given as negative, but the measured value is positive, so iq is positive, id is negative, and the speed is given as positive, and the measured value is also positive.
6. Result graph
I won’t say much about the weak magnetic field part. I’ve mentioned it in my other blogs. Lead angle weak magnetic field is used. To save trouble, I just add a PI controller to the ID, and the speed can meet the requirements.
The following are the simulation and result diagrams, just take a look.
7. Supplement
Personally, I feel that the SVPWM model is not easy to build if you don’t understand the principles. The Matlab I used before was built by others. This time I did it myself and found many problems, and I have a deeper understanding of it.
Source Post:https://blog.csdn.net/qq_42628795/article/details/104209982