INTRODUCTION
In this module of the 3Phase PMSM Control Workshop with NXP's ModelBased Design Toolbox , we are going to spin the PMSM for the first time with S32K and MotorGD Development Kits, learn more about ModelBased Design approach by building a PMSM mathematical model in Simulink to facilitate the development and validation of control algorithm and ultimately deploy that algorithm on the real hardware and check the experimental results against the one obtained in simulation environment.
First, lets see what do we want to achieve in this module ?
Based on these considerations, the simplest control method I can think off that allows us to achieve all these goals is: V/F Scalar Control. Another name for this method is Volts per Hertz (V/Hz) but the main principle behind it is the same: the ratio between voltage and frequency is kept constant throughout the motor speed range.
In Fig. 1, which represent the global application mapping diagram as discussed in Module 3: System Partitioning , are shown the main hardware blocks that are going to be configured and the control path we are going to follow (with red line). To achieve V/F scalar control we are going to configure the S32K FlexTimer peripheral to generate six PWM signals that are used to control the MotorGD Development Kit DC to AC power inverter via a dedicated MOSFET predriver chip: MC34GD3000. To enable the MC34GD3000 chip operation we will need to control two additional signals : Enable and Reset via dedicated GPIO.
The interactions between host PC and hardware will be done via OpenSDA serial communication that will be used to download the code generated from MATLAB and to visualize various control signals with FreeMASTER.
Fig. 1: Application Mapping  HW & SW modules used for V/F Scalar Control are highlighted in green 
After the control algorithm verification & validation but prior to connecting the PMSM Linix motor, we are going to check the PWM signals with an oscilloscope. This will ensure we are following all hardware recommendations and since we do not have yet active protections, it will spare us from unpleasant surprises.
V/F SCALAR CONTROL
If you recall the picture from Fig. 3, the 3Phase PMSM Control Workshop with NXP's ModelBased Design Toolbox article, then you know that V/F Scalar Control is the term used to describe a very basic form of motor control that is using a nonvector approach scheme. A PMSM can be led to steady state regime by one of the following control techniques:
To explain how this technique works lets recall first the Module 2: PMSM and FOC Theory . It that module we have discussed various reference frames used to describe the PMSM theory of operation and we have obtained the main equations of the motor in the shown here as (eq. 1 and eq. 2)
(eq. 1) 

(eq. 2) 
where:
voltages and current in daxis and qaxis respectively  
d and qaxis inductances and stator winding resistance  
d and qaxis flux linkage and permanent magnet flux linkage  
electrical rotor speed 
Rewriting (eq.1) in scalar from and time domain we will obtain:

(eq. 3) 
In steady state regime, the flux linkage variation is zero, and for further simplification we are going to assume the stator winding resistance is neglectable. Taking into consideration these simplifications and the flux linkage equation (eq. 2) then the equations (eq. 3) becomes:

(eq. 4) 
At this point we can transform the electric speed in frequency and rewrite the (eq.4) as a ratio of V/F:

(eq. 5) 
In V/F scalar control method the frequency of the stator magnetic flux is set according with the desired synchronous rotor speed while the magnitude of the stator voltage is adjusted to keep the ratio between them constant. No control over voltage or current vectors angles is utilized, hence the name scalar control.
The V/F ratio is calculated from the nominal values of the PMSM voltage and frequency parameters. By maintaining a constant V/F ratio between the amplitude and frequency of 3phase voltage waveforms, then the stator flux of the PMSM can be maintained relatively constant in steady state. However, in practice a typical V/F profile is not constant over the entire range of motor speed.
As can be seen in Fig. 2, the V/F profile may be divided in three main regions:
Fig. 2: V/F profile practical aspects 
The V/F scalar control is the most common control strategy used for induction motor drives. In case of PMSM, the V/F scalar control is a good alternative in applications where good dynamic performance is not required (e.g.: HVAC, fans, pumps or blowers). In such cases the V/F scalar control is performed without the need of a position/speed sensor.
By using V/F scalar control there is no need for high capability CPU as in the case of FOC, but keep in mind that this kind of simplicity also comes with some disadvantages:
In case of PMSM, both open and closedloop control of the speed can be implemented based on the V/F scalar control. Openloop control is used in applications where system dynamic response is not a concern. For such use cases, the frequency is determined based on the desired speed and the assumption that the rotor will ultimately follow the synchronous speed.
Throughout this module we are going to implement an openloop control system topology for a 3phase PMSM using V/F scalar control as the one shown in Fig. 3. Such control structure will allow us to control the PMSM speed without any feedback of motor parameters or rotor position. The motor is driven by the conventional 3 phase voltagesource inverter via MotorGD DevKit. The NXP's S32K MCU is being used to generate the six PWM signals using a modified SVM PWM technique with 3rd harmonic injection.
Fig. 3: V/F scalar control block diagram 
In order to maintain a similar topology with two control loops and similar data structures for the examples that we are going to use in this workshop, we are going to implement the V/F scalar control application based on:
MATLAB MODELLING OF CONTROL ALGORITHM
MATLAB/Simulink environment and NXP toolbox for S32K1xx allow us to approach the motor control algorithm development very straightforward. Using ModelBased Design strategy we can develop, implement, simulate and test the control method entirely in simulation environment and once we are satisfied with the results we can proceed further by deploying the generated code on the real target and perform final validation and testing.
Fig. 4 shows the Simulink model we are going to use for V/F scalar control implementation, testing and validation. The model can be find attached at the end of this article.
Fig. 4: Simulink model for the entire plant: MCUDC2AC INVERTERPMSM 
The model shown in Fig. 4 consists in three major subsystems that mimics the actual hardware arrangement, each one of them implementing a specific functionality:
S32K14x EVB Subsystem
This is a discrete model that implements the V/F scalar control block diagram shown in Fig. 3. There are 2 subsystems that are triggered based on specific timing intervals. These 2 subsystem mimics the existance of the separated digital control loops: SLOW & FAST
Fig. 5: FAST and SLOW control loop model 
The SLOW Loop Subsystem Fig. 6, updates the commands for the FAST Loop Subsystem shown in Fig. 7. Based on the SPEED_CMD set by the user as motor target speed, a trapezoidal speed profile is generated using a dedicated Simulink block exposed by the AMMCLIB Addon. Based on this SPEED_REF the electrical angle used for Inverse Park transformation is going to be derived.
Fig. 6: SLOW control loop model 
The quadrature voltages alphabeta are computed based on the electrical angle and the (dq) reference voltages obtained in SLOW Loop. In case of UD_REF the value is set to 0 just to emulate the theory behind FOC and in case of UQ_REF the value is obtained from a LookUpTable (LUT) that implement the concept of V/F scalar control.
Fig. 7: FAST control loop model 
At each 0.1ms the PWM commands are computed and updated based on AMMCLIB specialized Simulink block that implements and optimized Space Vector Modulation with 3rd harmonic injection. These PWM commands are then passed to the next subsystem that emulates the operations for power inverter.
MotorGD DevKit Subsystem
This subsystem implements a basic model to emulate the DC2AC power inverter. The PWM commands are converted into high voltage signals (depending on the Vdc value selected) that are then applied to the motor windings.
Fig. 8: Simplified Power Inverter model 
PMSM Model Subsystem
The Simulink model consists in standard 3phase PMSM motor equations shown in Module 2: PMSM and FOC Theory. Within the model you can easily identify:
Fig. 9: 3phase PMSM model 
Note 1: we are not going into details about PMSM modelling since this is not the purpose of this module. Feel free to follow the link indicated in the model to get more details. As usual, if you have any questions about it, feel free to ask.
Note 2: I've choose to implement this simplified model to avoid the usage of other MATLAB toolboxes. If you have access to Simscape Power System you could use one of the motors from there.
MATLAB SIMULATION OF THE PLANT
The entire V/F scalar control algorithm (...and not only) can be validated using this simulation environment provided in MATLAB/Simulink. This way we can validate the Space Vector Modulation, V/f scalar control and PMSM motor dynamic responses even without having the actual hardware setup. For those of you planning to use NXP hardware in the future, this approach might be useful in getting familiar with motor control.
Fig. 10, 11 and 12 show the main control signals and outputs for each subsystems discussed earlier. At this point we can investigate various quantities that might not be easily accessible on the real plant.
Fig. 10: V/F scalar control commands in case of startup ramp: (1) Speed Profile, (2) Electric Angle, (3) quadrature voltage references and (4) 3phase stator voltages references 
Fig. 11: Space Vector Modulation verification: Inputs & Outputs 
Fig. 12: PMSM Model Responses in case of startup sequence: (1) Command vs. Actual Motor Speed, (2) Rotor angle vs. Rotor position, (3) Stator Currents and (4) Back EMF voltages 
As can be seen there is a good match between the results obtained in simulation and the PMSM motor theory. Now that we have built confidence in the results it's time to move on to next stage.
EMBEDDED TARGET VERIFICATION OF CONTROL ALGORITHM
Since the modelling and simulation phases are completed with satisfactory results, it is time to convert the Simulink model and adapt it for Code Generation. The Fig. 13, shows the actual model that we are going to use the Code Generation.
Fig. 13: Simulink model for S32K embedded target code generation 
The model depicted in Fig. 13 is derived from the one shown in Fig. 4 and almost 90% of it share the same similarities. To have the model suitable for code generation there are a few modifications that needs to be done:
Video training: Open Loop V/F Scalar Control Model for PMSM  

MC34GD3000 PreDriver Enablement
The MC34GD3000 is a field effect transistor (FET) predriver designed for 3phase motor control and similar applications. The IC contains three highside and three lowside FET predrivers. Three external bootstrap capacitors provide gate charge to the high side FETs. The IC interfaces to a S32K MCU via six direct input control signals, an SPI port for device setup and asynchronous reset, enable and interrupt signals. As it is shown in Fig. 14, the MC34GD3000 MOSFET predriver needs to be enabled before PWM signals generation.
The predriver can be configured over SPI communication to enable various features. Please check the MC34GD3000 for details. In this module we are not going to use this feature.
After IC initialization phase is complete, the device goes into the enable mode and operates normally. Normal operation continues in this mode as long as both enable pins EN1/EN2 and RSTB are high.
Fig. 14: MC34GD Predriver pins 
Add S32K dedicated peripheral blocks for GPIO to enable the MC34GD3000 predriver normal operation and remove the existing simplified simulation model blocks.
Fig. 15: MotorGD subsystem: on the left  simplified inverter Simulink block diagram, on the right  S32K GPIO peripherals that set EN1/EN2 and RST pins to high 
Fig. 16: GPIO Configuration for Enable and RST signals 
S32K FlexTimer(FTM) Enablement
The most important aspect of the whole application is to be able to generate the PWM signals based on the Space Vector Modulation technique and pass these signals to MC34GD3000 predriver. NXP's ModelBased Design Toolbox for S32K1xx address this issue in a very simple and convenient way by providing a S32K dedicated peripheral block for FTM as shown in Fig. 1
Fig. 17: PWM generation in Simulink modelling vs. PWM generation used for code generation on S32K 
The FTM Simulink block is configured to initialize the FTM3 module since the output signals from that specific module are routed on the PCB to control the actual power inverter MOSFETs. The schematic for the MotorGD DevKit Fig. 18, shows the actual signal routing.
The MotorGD DevKit was designed to be compatible with Arduino shields, therefore only some specific signals are available on the pinheaders. In case you design your own power inverter you might need to reconfigure the actual pins that controls the MOSFETs.

Fig. 18: MC34GD3000 and MotorGD DevKit Power Inverter signal routing 
Based on the pins assignment on both MotorGD DevKit Fig. 19 and S32K14x EVB Fig. 20, we can configure the actual FTM peripheral as shown in Fig. 21.
Fig. 19: MotorGD DevKit Pin Assignment 
Fig. 20: S32K144 Evaluation Board Pin Assignment 
Fig. 21: FTM Peripheral Block Configuration for controlling the power inverter from MotorGD DevKit 
FreeMASTER Support for Data Visualization
Before generating the Ccode for the application and deployment on the hardware, we need to enable and configure the FreeMASTER embedded driver to allow us the visualize the data in real time. Since most critical part of the V/F control algorithm is done in the FAST loop that is executed at each 0.1ms, we will need to configure the FreeMASTER to capture the data in that specific routine.
NXP's ModelBased Design Toolbox lets you configure and call the FreeMASTER anywhere in your model. For this application, since the goal is to check the real hardware data against the ones obtained from Simulink simulation we are going to configure the FreeMASTER as shown in Fig. 22.
Fig. 22: FreeMASTER configuration 
Please note that we have configured the FreeMASTER to work in Short Interrupt mode, with a relative high priority  less than the ones needed for actual motor control loops and we have enabled the Recorder option for a timebase of 0.1ms. All these settings and the actual function call for the FreeMASTER Recorder (Fig. 23) are needed to make sure you capture the data in the FAST loop  otherwise we might read wrong data.
Fig. 23: Place the FreeMASTER Recorder Call Simulink Block in the FAST Loop Sybsystem 
EMBEDDED TARGET VERIFICATION AGAINST SIMULINK SIMULATION
At this point we can run the application on the embedded side and verify the results against the ones obtained in simulation. Since we want to verify the algorithm behavior prior to running the actual motor, then for these kind of tests, we do not have to power on the MotorGD DevKit. This verification step can be done using PIL cosimulation as well but for getting closer to the final application setup, I've choose to run the application completely independent of MATLAB environment. In this case the real time data from S32K are obtained and visualized via FreeMASTER in RECORDER mode. The FreeMASTER project used in conjunction with Simulink model shown in Fig. 13 is attached at the end of the article.
First, we will check the correct generation of the commands for SVM and the PWM duty cycles waveforms associated with these commands. In the next figures, on the left hand side we can see the waveforms generated with MATLAB/Simulink environment in SIMULATION mode while on the right hand side the same data are RECORDED with FreeMASTER on real hardware S32K MCU for the same scenario. As you can see there is a remarkable similarities between these sets of data, giving us confidence that once the PMSM will be connected the motor will behave as predicted in SIMULATION environment.
Fig. 24: SIMULATION vs. REAL Startup Sequence (1) Speed Reference Profile, (2)Electric Angle Transformation, (3) Fixed Frame Quadrature Voltages, (4) 3phase PWM dutycycles for each PMSM phase 
Fig. 25: SIMULATION vs. REAL Space Vector Modulation in Steady State Regime Inputs: (1) DQ Frame Voltages, (2) Fixed Frame Quadrature voltages, (3) Electric Angle for 500[rpm] equivalent Output: (4) SVM Sector Identification 
Fig. 26: SIMULATION vs. REAL PMSM Steady State Zoom (1) Electric angle variation for 500[rpm] motor speed and equivalent (2) SVM 3phase voltage references 
VALIDATION ON REAL PLANT
Once the verification phase is completed successfully, we can start to validation on the real plant: MCUDRIVERPMSM
We start with PWM signal generation. The scope of this verification is to check the correct waveform generation (polarity and frequency) and signal integrity (rising/falling slopes, signal levels, deadtime). For this test we are going to use an oscilloscope to scope the digital signals directly on MotorGD DevKit PCB.
Fig. 27: PWM High (yellow) and Low (cyan) Commands 
Note PWM HIGH and LOW are configured to be complementary but due to HW restrictions the low side PWM signals are active LOW.
As can be seen in Fig. 27, the PWM signal generation is done correctly with 10KHz frequency and correct polarities based on the settings from Fig. 21.
At this point we can connect the PMSM and let is spin. If you power on the boards, the motor should start sniping, acceleration from 0 to 1000[rpm] in 1[sec]. From FreeMASTER watch variable window you can change the Speed_Command variable to increase and decrease the motor speed.
With the motor running, we can do some additional verification with the oscilloscope directly on the motor windings.
Fig. 28: Phase A &B terminal voltages and Line AB resulting voltage. Check Module 4: Space Vector Modulation for details 
CONCLUSIONS
In V/F scalar control the stator currents are not controlled directly. A V/F controlled PMSM can become unstable easily especially when the load torque increases. Considering its disadvantages the V/F scalar control is not suitable for low speed control in high dynamic applications but might be a good choice for PMSM used for HVAC applications, where high performance is not required.
In general, open loop V/f control is not stable in the whole frequency range, it may become unstable, even at noload, from a certain excitation frequencies lower than the rated speed. To address such usecases, it is necessary to have a stabilizing loop in the system. This stabilizing loop can be implemented by means of an speed measurement system, increasing cost, and complexity.
At point we have reached our main goal and we now have a control simple method to spin the PMSM in open loop. We've validated the PWM generation techniques and we are now ready for the next step: implementing a proper Field Oriented Control technique for PMSM.
We hope you find this information useful. Feel free to LIKE this article and comment below.
Update January 28th 2019  This Simulink model is now available on MATLAB 2018b and MBDT for S32K14x 2018.R1 release
Before using the new models make sure you apply all the hotpatches from here: HotFix: MBD Toolbox 2018.R1 for S32K
Update revisions:
March 18, 2019
May 06, 2020
Hi yongcheolshin,
It depends on the motor you are using and the available Vdc. At this point you need to "tune" the V/f LookupTable to match your case: too much or too little voltage at a specific speed might stall the motor.
Hope this helps!
Daniel
Your comment is right.
The motor rotate very well when I tuned the LookUpTable.
Thank you very much...^^
Hi ! dumitrudaniel.popa.
Thank you for your Motor Control Workshop with MBDT.
This workshop is very useful for the engineers who want to know Motor control.
I have a problem when I try to execute FreeMaster to simulate V/F control.
I am using MATLAB 2017b version and ModelBased Design Toolbox for S32K1xx Series 2018.R1 (R2016bR2018a) 23Jul2018.
Below are the images of Simulink and FreeMaster for the V/F control using your M5 zip file.
< FreeMaster Image>
If you look at FreeMaster images, Electric Angle and SVM_Sector waveforms are different from the
simulink waveforms. These are not the waveforms and data that I expected.
May be this problem come from new version of MBDT or others.
Could you help me?
And I aslo have same problem about M1 Verification simulation sample.
I am using below MTRDEVSPNK144kit
Look at FreeMaster variable watch window , it only displays " ? "
no values are displayed in the graph?
I think simulink FreeMaster Configuration block may have errors.
I attached my zip files that is used in this simulation.
I hope your reply, thank you
Hello,
Sorry for delay. It seems that for older threads we do not get correct notification when someone adds a comment. Perhaps it would be better to start a new discussion if you do not get an answers with 24h.
Can you please increase the FreeMASTER interrupt priority in the FreeMASTER configuration block? Is the issue still reproducible?
Thank you!
Daniel
I had a look in your simulink pmsm model and don't understand the Tc and wc constants.
I searched in your link but didn't found them
Chapter 14
Could you explain them ?
Best regards
Leon
For parametrizing my own Motor I also have one more question:
I know the Motor induces 0.023 V / 1/min.
So at 1000 rpm it is Ui = 23 V.
How could I calculate the Back EMF constant?
Does this result in KV = 0.023 V / 1/min * 60 * 1000 = 1380 mWb ?
In your model the Back EMF constant is 2.15 mWb = 0.00215 Vs
Does this mean the your motor induces 0.00215 Vs * 60 = 0.129 V / 1/min ?
This would result in 129 V at 1000rpm ??!!
Kind regards
Leon
With my Parameters it becomes to an error:
An error occurred while running the simulation and the simulation was terminated
Caused by:
Derivative of state '1' in block 'V_f_Scalar_Control_SIM/PMSM Model/Transfer Fcn3' at time 0.0016975 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
Maybe you could help? Reducing the step size did not solve the problem.
Parameters are:
R = 2.58Ohms
L = 23.2mH
KV = 1380mWb
J = 2.342e4 kg*m^2
B = 3e4Nm/rad*s^1
pp = 3 (pole pairs)
Hello dumitrudaniel.popa
I manually configured the Motor Parameters step by step and it seems that the Back EMF constant "KV" leads to the problem.
An error occurred while running the simulation and the simulation was terminated
Caused by:
Derivative of state '1' in block 'V_f_Scalar_Control_SIM/PMSM Model/Transfer Fcn3' at time 0.0031500000000000005 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
Could you explain how to configure my back emf constant ?
For parametrizing my own Motor I also have one more question:
I know the Motor induces 0.023 V / 1/min.
So at 1000 rpm it is Ui = 23 V.
How could I calculate the Back EMF constant?
Does this result in KV = 0.023 V / 1/min * 60 * 1000 = 1380 mWb ?
In your model the Back EMF constant is 2.15 mWb = 0.00215 Vs
Does this mean the your motor induces 0.00215 Vs * 60 = 0.129 V / 1/min ?
This would result in 129 V at 1000rpm ??!!
Kind regards
Leon
Thank you
Leon
Hi Leon,
In the PMSM Simulink model provided in M5 support package, the backEMF constant KV is expressed in weber [Wb] as derived SI unit.
So, lets consider KV = 0.00215306398564147[Wb] is just KV = 0.00215[Wb] = 0.00215[Vs] (same thing but in a different SI)
Now, you want to transform the [Vs] > [V/rpm]  lets see the procedure:
#1: divide [Vs] to radians in order to get the magnetic flux relative to position [Vs/rad]
#2: rearrange the fraction in order to highlight the speed (rad/s) at the denominator : [V/(rad/s)]
#3: transform (rad/s) > (rpm): 1 [rpm] = 0.104719755 [rad/s]
#4: transform [V/(rad/s)] into [V/rpm]: 0.00215[V/(rad/s) = 0.00215*0.104719755[V/rpm] > KV = 0.000225[V/rpm]
#5: @1000rpm electrical speed the induced backEMF: e = KV * 1000[rpm] = 0.000225[V/rpm]*1000[rpm] = 0.2251[V] @1000rpm
Note that i'm using the 1000 rpm electrical speed  since we have to think everything in mathematical form used by motor equations.
If you want to transform in mechanical speed then simply multiply the #5 result with the number of pole pairs. In case of the model we have pp =2 and the get an induced backemf e=0.4503[V] @1000rpm_mec
The value 0.4503[V] @1000rpm is right about there if we run the model.
Hope this helps!
Daniel
so now I'm able to simulate something !
In my case the induced back emf is KV(rms) = 0,0230 V / rpm
Your Back emf constant is given in the peak, so: KV(Peak) = 0,0230 V / rpm * sqrt(2) = 0.0325 V / rpm
Now I have to convert V / rpm in V / rad/s
KV(Peak) = 0.0325/((2*pi/60)) V / rad/s = 0.310609129074202 Vs / rad = 0.310609129074202 Wb / rad
The result is this with Udc = 325 V.
At the beginning we have huge swinging in the Motor Speed, and because of that really big back emf.
The current is far to high. After raching 1000rpm it is still 35 A(peak)
What could I try to optimize the Simulation result ??
Maybe we have to limit the current because our 3ph Inverter only supports +8A ??
Only for checking the back emf constant after reaching 1000rpm:
e = 0,0230 V / rpm * sqrt(2) * 1000 * 3 = 97,58 V
Kind regards
Leon
Please sent me your model to have a look at. Thank you!
Daniel
Hi Leo,
Do you have the datasheet of your motor? I need to have a look at its rated speed and voltage in order to rebuild the V/f LUT. That is happening here (i think) is you apply too much voltage at startup that cause speed oscillation.
Best regards,
Daniel
Hi Daniel,
in my case there aren't rated voltage and speed.
Speed is up to 20000 rpm.
I know the Motor is in field weakening at 5400 rpm with U = 210V (effective, concatenated) = 121,24V (effective, strand)
One rated Point is 610 rpm and 25,5V (effective, concatenated) = 14,722 (effective, strand)
The Rs parameter is 2,58 Ohm, so as Boost I have to apply U = 2,58 Ohm * 100mA = 0,258V (effective, strand)
How I have to configure the lut ?
Best regards
Leon
Hi Leon,
It is shown in Fig. 2.
You need to find a proper V/f profile. If you apply too much or too less voltage to soon/late you will see oscillation.
E.g: if i change your model to us a LUT like this:
Then the result is:
In the beginning there are some speed oscillations that are translated into large backemf value. So, at this point i think is important to have various checkpoint on the V/f profile to match with the motor itself.
Also, the acceleration slope might play an important role here. Perhaps you should try with a lower acceleration. Do do that you will need to update your model as it has been suggested here: https://community.nxp.com/message/984460?commentID=984460&et=watches.email.thread#comment981795
Hope this helps!
Daniel
like you explained here in your answer to wangxuan
https://community.nxp.com/message/984403?commentID=984403&et=watches.email.thread#comment980948
Keep in mind that via the Inverter we control the Phase Voltage.
Depending on your motor connection the relation between Line and Phase is:
 Y(star) V_line = sqrt(3) V_phase
 D(delta) V_line = V_phase
for my Motor, which is connected in star, the field weakening begins at 5400rpm and V_lineY (rms) = 210V
then Maximum voltage is: V_phaseY (rms) = 210V / sqrt(3) = 121,24V
so I would allow a Maximum peak voltage: V_phaseY (peak) = 121,24V * sqrt(2) = 171,46V
Would you agree ?
But Maximum voltage is Udc/2 = 325V/2 = 162,5V
this would lead to End of LUT value = 171,46V / 162,5V = 1,055 which isn't possible
For example in the model i've used the 0.9 corresponds to the maximal voltage i'm going to apply for the motor phase. Using a 12V DC power supply then the actual phase voltage allowed in this model is: 0.9 * Vdc/2 = 0.9 * 12 / 2 = 5.4 Volts.
If I check your Phase signals which came out of the Inverter and are supplied to the Motor then I see this, so your Maximum Phase voltage is greater than 5,4V or not ?
Therefore, from the LUT  i'm going to apply 5.4V on phase if the desired speed is 5000rpm
If I Change the Initial Speed_cmd to 5000rpm then U max is 12V * 0,9 = 10,8V ??
The "rated" frequency can be obtained from the rated speed
f_rated [Hz] = Speed_rated [rpm] * pp / 60
If you have a single pole pair configuration: f_rated[Hz] = 3000 * 1 / 60 = 50Hz
in my case the frequency at the Point of the beginning field weakening is:
f_rated[Hz] = 5400 rpm * 3/60 = 270 Hz
your LINIX Motor has pp = 2 and speed_rated = 5000rpm, so:
f_rated[Hz] = 5000 rpm * 2/60 = 166,67 Hz
where do you consider this value in the LUT ?
To start the spinning i'm going to apply 0.4 * 12/2 = 2.4V
In my case I want to have a current I = 100mA
In reference to the voltages there is only Phase_B and Phase_C at Startup (Phase_A = 0), so the double Stator resistance is effective:
Because only the resistance of the Stator B and C windings are effective at the Moment of Startup this leads to:
U line start Y = 2 * 2,58 Ohm * 100 mA = 0,516V
and U Phase start Y = 0,516V / 2 = 0,258V
LUT Startup value = 0,258V / Udc/2 = 0,258V / 162,5V = 0,00159
Am I right ?
Hi Leon,
I was expecting such questions  that being one of the reasons i've provided the crossreference link to the original model I used for inspiration.
If you check the motor equations there are not such parameters/quantities needed  but since the model is simulated my understanding is that those represents a numeric "trick" to avoid Simulink numeric errors due division by 0 (this is true for wc).
I like to think about these 2 constant as motor initial conditions  that might help to simulate various scenarios.
Hope it helps!
Daniel
Ok,
I don't wanted to disappoint you...
Also a Simulation with a Standard Motor out of the simscape power Systems Toolbox would be useful.
In principle you should get nearly the same results.
perhaps you could Show how to use such a block for the module 5 example, because I don't have any experiences with that at this Moment.
Best regards
Leon
Hi Leon,
That would be the way to go  but i do not have a license to for that toolbox. That is why a built a model using standard blocks  someone suggested that in a different topic and i wanted to highlight how you can check the simulation against the real things.
If you have a simpowersystem license then  that's the way to go :)
Best regards,
Daniel
I want to make a second post with your pmsm, which I atteched.
Instead of my Simscape model with my owm Motor here the Simulation with a fixed step solver works.
So it has to do with the Parameters of the pmsm block why this don't work with my Motor.
The structure of the model is the same like obove.
Here is the comparison of the effects (left old simulink model, right new simscape model):
Please not the Parameters of your Motor:
Here the yellow marked values are not clear for your Motor.
Standard values in the help are:
permanent magnet flux linkage: 0.03 Wb
Ls = 0.0002H = 0.2mH
Lm = 0.00002 H = 0.02mH (which is 1/10 of Ls, so I configured 0.0435mH)
Ms = 0.00002 H = 0.02mH (which is 1/10 of Ls, so I configured 0.0435mH)
Best regards
Leon