Main Content

Estimate Initial Rotor Position Using Pulsating High-Frequency and Dual-Pulse Methods

This example estimates initial position (in electrical radians) of a stationary interior PMSM by using pulsating high frequency (PHF) injection and dual pulse (DP) techniques.

The example determines the best possible initial estimation for the rotor position using open-loop PHF injection, which it uses further for running closed-loop PHF.

It executes closed-loop PHF by injecting a high frequency signal into the estimated rotor position to determine the actual rotor position, without spinning the motor. This technique works when the motor has a saliency ratio (Lq/Ld) greater than 1. Due to a limitation in the PHF method, the estimated position may show ambiguity of π(pi). The dual-pulse (DP) method uses polarity detection to resolve the ambiguity of π and applies π compensation if there is an error. The estimated rotor position ranges from 0 to 2π electrical radians.

The example uses the Pulsating High Freq Observer block to implement the position estimation algorithm. For more details, see Pulsating High Freq Observer.

The example runs only for Stage 1 - initial position estimation (IPE) (as defined in the Pulsating High Freq Observer block page), which includes 3 parts.

Stage 1 focuses on determining the initial position of rotor when the rotor is stationary. This stage includes the following 3 parts:

Note: Stage 2 is an extended operation mode where you can use this technique to compute position while the motor runs using closed loop control. The example does not cover Stage 2.

Part A: Find best possible initial estimation

The example relies on pulsating high frequency (PHF) injection technique. PHF injection needs initial estimation to start the algorithm.

When we use only one initial estimation, ${\theta _{i\_est}}$, (for PHF) for all possible rotor actual positions, the algorithm may not work accurately for certain rotor actual positions if motor has low saliency. These ambiguous positions are:

1. When ${\theta _{actual}}$ lies in the range $\left[ {\left( {{\theta _{i\_est}} + {\pi \over 2} - 0.1} \right),\left( {{\theta _{i\_est}} + {\pi \over 2} + 0.1} \right)} \right]$

2. When ${\theta _{actual}}$ lies in the range $\left[ {\left( {{\theta _{i\_est}} - {\pi \over 2} - 0.1} \right),\left( {{\theta _{i\_est}} - {\pi \over 2} + 0.1} \right)} \right]$

3. When ${\theta _{actual}}$ lies in the range $\left[ {\left( {{\theta _{i\_est}} + \pi - 0.1} \right),\left( {{\theta _{i\_est}} + \pi + 0.1} \right)} \right]$

To make PHF work for motors with low saliency, we need to pick different initial estimation for different rotor actual positions.

When executing this part, the example picks the best possible initial estimation among these three alternatives:

1. ${\theta _{i\_est}} = 0$

2. ${\theta _{i\_est}} = {{2\pi } \over 3}$

3. ${\theta _{i\_est}} = - {{2\pi } \over 3}$

Therefore, the example injects 3 high frequency voltage signals (approximately 2000 KHz) across the preceding 3 ${\theta _{est}}$ values and measures the resulting ${i_q}$ currents. For each ${i_q}$:

$${i_q} \propto PHF\_signal \times sin\left( {2{\theta _{err}}} \right)$$

Therefore, ${i_q} \propto \left| {sin\left( {2{\theta _{err}}} \right)} \right|$ or ${i_q} \propto \left| {sin\left( {2({\theta _{actual}} - {\theta _{i\_est}})} \right)} \right|$.

Where,

${\theta _{i\_est}}$ — initial estimation of rotor position (which can be either 0, ${{2\pi } \over 3}$, or - ${{2\pi } \over 3}$ (in degrees, per-unit, or radians)

${\theta _{actual}}$ — actual rotor position (in degrees, per-unit, or radians)

${\theta _{err}} = {\theta _{actual}} - {\theta _{i\_est}}$

Let us define:

${i_{q1}} = {i_q}$ for ${\theta _{i\_est}} = 0$

${i_{q2}} = {i_q}$ for ${\theta _{i\_est}} = {{2\pi } \over 3}$

${i_{q3}} = {i_q}$ for ${\theta _{i\_est}} = - {{2\pi } \over 3}$

For ${\theta _{i\_est}} = 0$, when we vary ${\theta _{actual}}$ from 0 to 2π, we find that ${i_{q1}} \propto \left| {sin2({\theta _{actual}} - 0)} \right|$ is maximum among the preceding 3 ${i_q}$ currents when the rotor lies in the following 4 highlighted regions.

If ${\theta _{i\_est}} = 0$ is used for all ${\theta _{actual}}$ = 0 to 2π, the algorithm would have failed for the following ambiguous regions (when motor saliency is low):

1. When ${\theta _{actual}}$ lies in the range $\left[ {\left( {0 + {\pi \over 2} - 0.1} \right),\left( {0 + {\pi \over 2} + 0.1} \right)} \right]$

2. When ${\theta _{actual}}$ lies in the range $\left[ {\left( {0 - {\pi \over 2} - 0.1} \right),\left( {0 - {\pi \over 2} + 0.1} \right)} \right]$

3. When ${\theta _{actual}}$ lies in the range $\left[ {\left( {0 + \pi - 0.1} \right),\left( {0 + \pi + 0.1} \right)} \right]$

Because these ambiguous regions are not present in the preceding 4 regions, we eliminate the regions where the algorithm might fail.

For ${\theta _{i\_est}} = {{2\pi } \over 3}$, when we vary ${\theta _{actual}}$ from 0 to 2π, we find that ${i_{q2}} \propto \left| {sin2({\theta _{actual}} - {{2\pi } \over 3})} \right|$ is maximum among the 3 ${i_q}$ currents when the rotor lies in the following 4 highlighted regions.

If ${\theta _{i\_est}} = {{2\pi } \over 3}$ is used for all ${\theta _{actual}}$ = 0 to 2π, the algorithm would have failed for following ambiguous regions (when motor saliency is low):

1. When ${\theta _{actual}}$ lies in the range $\left[ {\left( {{{2\pi } \over 3} + {\pi \over 2} - 0.1} \right),\left( {{{2\pi } \over 3} + {\pi \over 2} + 0.1} \right)} \right]$

2. When ${\theta _{actual}}$ lies in the range $\left[ {\left( {{{2\pi } \over 3} - {\pi \over 2} - 0.1} \right),\left( {{{2\pi } \over 3} - {\pi \over 2} + 0.1} \right)} \right]$

3. When ${\theta _{actual}}$ lies in the range $\left[ {\left( {{{2\pi } \over 3} + \pi - 0.1} \right),\left( {{{2\pi } \over 3} + \pi + 0.1} \right)} \right]$

Because these ambiguous regions are not present in the preceding 4 regions, we eliminate the regions where the algorithm might fail.

For ${\theta _{i\_est}} = - {{2\pi } \over 3}$, when we vary ${\theta _{actual}}$ from 0 to 2π, we find that ${i_{q3}} \propto \left| {sin2({\theta _{actual}} - ( - {{2\pi } \over 3}))} \right|$ is maximum among the 3 ${i_q}$ currents when the rotor lies in the following 4 highlighted regions.

If ${\theta _{i\_est}} = - {{2\pi } \over 3}$ is used for all ${\theta _{actual}}$ = 0 to 2π, the algorithm would have failed for the following ambiguous regions (when motor saliency is low):

1. When ${\theta _{actual}}$ lies in the range $\left[ {\left( { - {{2\pi } \over 3} + {\pi \over 2} - 0.1} \right),\left( { - {{2\pi } \over 3} + {\pi \over 2} + 0.1} \right)} \right]$

2. When ${\theta _{actual}}$ lies in the range $\left[ {\left( { - {{2\pi } \over 3} - {\pi \over 2} - 0.1} \right),\left( { - {{2\pi } \over 3} - {\pi \over 2} + 0.1} \right)} \right]$

3. When ${\theta _{actual}}$ lies in the range $\left[ {\left( { - {{2\pi } \over 3} + \pi - 0.1} \right),\left( { - {{2\pi } \over 3} + \pi + 0.1} \right)} \right]$

Because these ambiguous regions are not present in the preceding 4 regions, we eliminate the regions where the algorithm might fail.

Therefore, using this approach we have three sets of regions corresponding to 3 different initial estimates. These three sets or regions cover all the motor sectors where the rotor may lie:

In part A, the example picks the ${\theta _{i\_est}}$ corresponding to the maximum ${i_q}$ current value among ${i_{q1}}$, ${i_{q2}}$, and ${i_{q3}}$ for Part B.

Part B: Pulsating High-Frequency (PHF) Method

After determining the best possible initial estimate ${\theta _{i\_est}}$, the example injects a sinusoidal high-frequency voltage along the finalized $\left( {{\theta _{est}}|t = 0} \right) = {\theta _{i\_est}}$ (resulting in unbalanced three-phase voltage in the motor) and reads the current response from the motor. The example then performs numerical analysis of the resulting stator current response to compute the initial position of the stationary rotor (in electrical radians) by making corrections to ${{\theta _{est}}}$.

The example performs iterative tests on the motor. Therefore, when the example executes, the estimated position is initially ${\theta _{i\_est}}$, but it rises steadily to saturate at the actual rotor-angle (with respect to a-axis).

The PHF method has a limitation due to which it might compute rotor position with an ambiguity of π. If the rotor lies in the range ${\theta _{actual}} = \left[ {0,{\pi \over 2}} \right) \cup \left( {{{3\pi } \over 2},2\pi } \right]$ electrical radians (region 1), the estimated position is accurate (π compensation is not required).

If the rotor lies in the range ${\theta _{actual}} = \left( {{\pi \over 2},{{3\pi } \over 2}} \right)$ electrical radians (region 2), the estimated position shows an ambiguity of π (π compensation is required).

Therefore, the example uses the dual-pulse method to determine if the estimated position needs π compensation.

Part C: Dual-Pulse (DP) Method

The example injects two very short duration voltage pulses (with the same width and magnitude) into the following positions:

  • Pulse-1 that uses the rotor position estimated in Part B

  • Pulse-2 that uses the rotor position estimated in Part B + π

Because pulse width is very short, the motor does not run and the rotor remains stationary after pulse injection.

The interaction between the resulting stator magnetic flux and the rotor permanent magnets result in two current impulses along the d-axis of the rotor that rise and fall quickly.

Because the stator core is saturated, it shows a nonlinear behavior. A small ${L_d}$ results in higher current ${I_d}$, and a high ${L_d}$ results in smaller current ${I_d}$. Therefore the ${I_d}$ current impulses generated by Pulse-1 and Pulse-2 show different peak values.

Note: The pulse duration of the injected voltage pulses is large enough to obtain a measurable difference between the peak current values. At the same time the duration is not too high (when the pulse duration exceeds a certain limit, the rotor may start spinning).

The example computes the difference between the peak values of the two current impulses $\Delta {I_d}$ to determine if the position estimated in Part B needs π compensation.

$$\Delta {I_d} = \left| {{I_{d1}}} \right| - \left| {{I_{d2}}} \right|$$

PHF injection benefits the use cases that require rotor to remain stationary or when the position estimation must occur without starting the motor. PHF injection technique also benefits cases where open loop runs to estimate position (before transition to closed loop speed control) needs to be avoided or requirements where the motor should begin directly in closed loop operation. Stage 1 algorithm addresses these use cases by estimating position while keeping the rotor stationary and avoiding open loop run.

Note:

You can update the Pulsating High Freq Observer block parameters using the block mask. For details, see Pulsating High Freq Observer.

Alternatively, you can also update the variables defined in the model initialization script mcb_ipmsm_pos_est_f28379d_data.m to customize the algorithm.

The example also computes the following attributes using the motor parameters specified in the model initialization script:

1. PHF voltage frequency, ${\omega _h}$

$${\omega _h} = {{2\pi } \over {10{T_s}}}$$

2. PHF peak voltage, ${U_{(p.u)}}$

$${U_{(p.u)}} = {{0.05{I_{sensemax}}{\omega _h}{L_d}} \over {{V_{base}}}}$$

3. Duration of open-loop PHF injection during Stage 1 Part A, ${T_{oPHF}}$ and duration between algorithm steps (belonging to Stage 1 Part A and Stage 1 Part B) to allow fading of transient dynamics, ${T_{Delay\_oPHF}}$

$${T_{oPHF}} = {T_{Delay\_oPHF}} = {{\log \left( {1000} \right){L_q}} \over {{R_s}}}$$

4. Cut-off frequency for low-pass filter of PHF, ${\omega _c}$

$${\omega _c} = 2{\omega _h}{r \over {\sqrt {1 - {{\left( r \right)}^2}} }},r = {{2{\omega _h}\left( {\Sigma {L^2} - \Delta {L^2}} \right){I_{sensemax}}} \over {U\Delta LAD{C_{maxcount}}}}$$

5. Proportional gain for PI controller of PHF, ${k_p}$ and integral gain for PI controller of PHF, ${k_i}$

$${k_p} = {{9.8} \over {G{T_{settling}}}},{k_i} = {\left( {{{\sqrt G {k_p}} \over {2\delta }}} \right)^2},G = {{{U_{(p.u)}}\Delta L} \over {{\omega _h}{L_d}{L_q}{I_{base}}}}$$

6. Voltage amplitude of injected pulses, ${V_{(p.u)}}$

$${V_{(p.u)}} = {{\left( {1 - {e^{ - 0.5}}} \right){I_{base}}{R_s}} \over {{V_{base}}}}$$

7. Duration of injected pulses, ${T_{DP}}$ and duration between two pulses during dual pulse injection, ${T_{Delay\_DP}}$

$${T_{DP}} = {{0.5{L_d}} \over {{R_s}}},{T_{Delay\_DP}} = {{\log \left( {1000} \right){L_d}} \over {{R_s}}}$$

Where,

${T_s}$ — Sampling time used by the example

${L_d}$ — Stator d-axis inductance

${L_q}$ — Stator q-axis inductance

${R_s}$ — Stator resistance

$$\sum L = {{{L_d} + {L_q}} \over 2}$$

$$\Delta L = {{{L_d} - {L_q}} \over 2}$$

$$\sum {{L^2}} - \Delta {L^2} = {L_d} \times {L_q}$$

${V_{base}}$ — Base voltage for per-unit computation

${I_{base}}$ — Base current for per-unit computation

$AD{C_{\max count}}$ — Maximum count of the ADC

${I_{sense\max }}$ — Base current of the control system

${T_{settling}}$ — Amount of time ${\theta _{i\_est}}$ takes to settle

δ — Damping ratio of second order equivalent of PHF

Note that the example supports both floating point and fixed point data-types.

Model

The example includes the target model mcb_ipmsm_pos_est_f28379d.

You can simulate this model or run it on the hardware. Use the open_system command to open the model.

open_system('mcb_ipmsm_pos_est_f28379d.slx');

Required MathWorks® Products

  • Motor Control Blockset™

  • Embedded Coder®

  • Embedded Coder Support Package for Texas Instruments C2000™ Processors

  • Simscape™ Electrical™ (only for simulation)

Prerequisites

1. Determine the motor parameters. The target model uses default parameters that you can replace with values from either the motor datasheet or other sources.

However, if you have motor control hardware, you can estimate the parameters for your motor by using the Motor Control Blockset parameter estimation tool. For instructions, see Estimate PMSM Parameters Using Recommended Hardware. The parameter estimation tool updates the motorParam variable (in the MATLAB® workspace) with the estimated motor parameters.

2. Update the motor and inverter parameters in the model initialization script associated with the target model. For instructions, see Estimate Control Gains and Use Utility Functions.

Simulate Model

Follow the instructions in the Simulate Nonlinear Stator Core Behavior section to introduce high saliency in the motor block. Then follow these steps to simulate the target model.

1. Open the target model included in this example.

2. Enter the initial rotor position value (that the Interior PMSM block should use for simulation) in the Input electrical rotor position (radians) field available in the Simulation Input & Output area of the target model.

3. Click Run on the Simulation tab to simulate the target model. The model estimates the rotor position using the PHF method. Then it uses the DP method to determine if the estimated rotor position needs π compensation. The target model applies π compensation if needed.

It then displays the estimated rotor position in the Estimated electrical rotor position (radians) field.

4. Observe the logged signals in the Simulation Data Inspector.

This plot shows the current along the d-axis $({I_d})$ during simulation.

This plot shows the estimated rotor position when the target model does not apply π compensation $({\theta _{init}} = {\theta _{est}})$ and when the target model applies π compensation $({\theta _{init}} = {\theta _{est}} + \pi )$.

5. The Estimated Rotor Position (Electrical Radians) display block in the Output area of the target model shows the initial rotor position estimated by the target model.

Generate Code and Deploy Model to Target Hardware

Follow the instructions in this section to generate code and run the example on the target hardware.

This example uses a host and a target model. The host model is a user interface to the controller hardware board. You can run the host model on the host computer. Before you can run the host model on the host computer, deploy the target model to the controller hardware board. The host model uses serial communication to command the target Simulink® model and run the motor in closed-loop control.

Required Hardware

The example supports this hardware configuration. You can also use the target model name to open the model from the MATLAB® command prompt.

LAUNCHXL-F28379D controller + BOOSTXL-DRV8305 inverter + iPMSM (such as Adlee BM-180 motor): mcb_ipmsm_pos_est_f28379d

For connections related to this hardware configuration, see LAUNCHXL-F28069M and LAUNCHXL-F28379D Configurations.

Generate Code and Run Model on Target Hardware

1. Simulate the target model and observe the simulation results.

2. Complete the hardware connections.

3. By default, the model computes the ADC offset values for phase current measurement. To disable this functionality, update the value of the inverter.ADCOffsetCalibEnable variable in the model initialization script to 0.

Alternatively, you can compute the ADC offset values and update them manually in the model initialization script. For instructions, see Run 3-Phase AC Motors in Open-Loop Control and Calibrate ADC Offset.

4. Open the target model. If you want to change the default hardware configuration settings for the model, see Model Configuration Parameters.

5. Load a sample program to CPU2 of the LAUNCHXL-F28379D board. For example, load the program that operates the CPU2 blue LED by using GPIO31 (c28379D_cpu2_blink.slx). This ensures that CPU2 is not mistakenly configured to use the board peripherals intended for CPU1.

6. Click Build, Deploy & Start on the Hardware tab to deploy the target model to the hardware. Verify the variables that the target model adds to the workspace.

7. Click the host model hyperlink in the target model to open the associated host model. You can also use the open_system command to open the host model.

open_system('mcb_ipmsm_pos_est_f28379d_host_model.slx');

For details on serial communication between the host and target models, see Host-Target Communication.

8. In the host model, open the blocks Host Serial Setup, Host Serial Receive, and Host Serial Transmit, and select a Port

9. Click Run on the Simulation tab to run the host model.

10 Change the position of the Estimate Position switch to Start to start running the example algorithm. The target model estimates the rotor position using PHF method. Then it uses the DP method to determine if the estimated rotor position needs π compensation. The target model applies π compensation if needed.

The host model obtains the estimated rotor position from the target hardware and displays it in the Estimated rotor electrical position (radians) field.

11 To estimate a different rotor position, change the position of the Estimate Position switch to Stop. The Estimated rotor electrical position (radians) field displays the value 0.

Turn the motor shaft to a new position. Then change the position of the Estimate Position switch to Start to run the example algorithm again and estimate the new position.

12 Observe the estimated position, Id, and Iq signals in the time scope available in the host model.

This plot shows the estimated rotor electrical position (${\theta _{init}}$) and the stator currents (Id) and (Iq).

13 The Status field displays the following statuses:

  • "IPE not started" — Stage 1 operation not yet started.

  • "IPE running" — Stage 1 operation is presently running.

  • "IPE completed" — Stage 1 operation is complete.

  • "IPE failed" — Stage 1 operation failed due to high error in estimated position.

Simulate Nonlinear Stator Core Behavior

The DP method algorithm works only when the stator core saturates and shows a nonlinear behavior. To generate this behavior in simulation, the target model uses the PMSM (Simscape Electrical) block from Simscape™ Electrical™. Follow this procedure to experimentally determine the tabulated ${L_d}$, ${L_q}$, and ${I_d}$ data for the actual motor and use this data to make the motor block nonlinear for simulation purposes.

Determine ${L_d}$ Data

1. Create a target model to run a PMSM using open-loop control. Modify the algorithm so that it injects the voltages ${V_d} = {V_{ac}}\sin (\omega t) + {V_{dc}}$ and ${V_q} = 0$ into the actual motor. This generates the current ${I_d} = {I_{ac}}\sin (\omega t + \phi ) + {I_{dc}}$ in the motor where:

    ${V_d}$ is the voltage that the algorithm computes and injects along the rotor's d-axis.

    ${\omega}$ is the frequency at which we can measure the phase difference. This frequency should be approximately 10 times lower than the PWM switching frequency but should be high enough to keep the rotor stationary (a frequency value that is too low can spin the rotor).

    ${V_{ac}}\sin (\omega t)$ is the AC component of ${V_d}$ (such that ${V_{ac}}$ and ω are constants that the algorithm should assume).

    ${V_{dc}}$ is the DC component of ${V_d}$ that you provide as an input.

    ${I_d}$ is the current along the d-axis of the rotor that the algorithm computes from the measured ${I_a}$ and ${I_b}$ phase currents.

    ${I_{ac}}\sin (\omega t + \phi )$ is the AC component of ${I_d}$ (ϕ is the phase difference between ${V_d}$ and ${I_d}$ that the algorithm should measure).

    ${I_{dc}}$ is the DC component of ${I_d}$, which is fixed for a ${V_{dc}}$ input (the algorithm should compute this value by using ${V_{dc}}$ and the motor resistance).

Note: Because ${V_q} = {I_q} = 0$, the rotor remains stationary.

a. Add an algorithm to read the ${I_a}$ and ${I_b}$ phase currents that the motor draws.

b. Add an algorithm to convert the ${I_a}$ and ${I_b}$ phase current values into the equivalent ${I_d}$ value by using Clarke and Park transforms.

c. Add an algorithm to compute ϕ and ${I_{dc}}$.

d. Add an algorithm to compute ${I_{ac}}$.

$${I_{ac}} = \left( {{{{I_d} - {I_{dc}}} \over {\sin (\omega t + \phi )}}} \right)$$

e. Add an algorithm to compute ${L_d}$.

${L_d} = {{\sqrt {V_{ac}^2 - I_{ac}^2{R^2}} } \over {\omega {I_{ac}}}}$ (for a fixed ${I_{dc}}$)

For details about designing a control algorithm and configuring it for deployment to the target hardware, see Control Algorithm Design and Deployment and Validation.

2. Create a model initialization script (.m file) to initializate the paramters and perform other calculations. Use the Model Properties > Callbacks to integrate this script with the target model. For details about how Motor Control Blockset™ uses this script, see Estimate Control Gains and Use Utility Functions.

3. Configure the target model to run on the target hardware. For instructions, see Model Configuration Parameters.

4. Create a separate host model to control and communicate with the target model running on the motor-control hardware in real-time. You can add an Edit box on the host model and use it to send ${V_{dc}}$ input to the target hardware. Use Display boxes to obtain the computed ${L_d}$ and ${I_{dc}}$ values from the target hardware.

For details about the host-target communication interface, see Host-Target Communication.

5. Click Build, Deploy & Start on the Hardware tab to deploy the target model to the hardware.

6. Simulate the host model. Send a ${V_{dc}}$ input to the target hardware and record the ${L_d}$ and ${I_{dc}}$ values that you obtain.

7. Change ${V_{dc}}$ manually across a range between a negative and positive voltage and record the resulting ${L_d}$ and ${I_{dc}}$ values for each operating point.

Determine ${L_q}$ Value

Perform these steps to determine a ${L_q}$ value that is higher than the sequence of ${L_d}$ values obtained from the Determine Ld section. This is necessary to maintain a high saliency ratio (${L_q} > {L_d}$) for the simulated motor block.

1. Modify the target model that you used in the Determine Ld section so that it injects the voltages ${V_d} = {V_{dc}}$ and ${V_q} = {V_{ac}}\sin (\omega t)$ into the actual motor. This generates a current ${I_q} = {I_{ac}}\sin (\omega t + \phi )$ in the motor where:

    ${V_d} = {V_{dc}}$ is the constant DC voltage that the algorithm injects along the d axis of the rotor. ${V_{dc}}$ should be high enough to hold the rotor at zero position and keep it stationary.

    ${V_q} = {V_{ac}}\sin (\omega t)$ is the AC voltage that the algorithm computes and injects along the q-axis of the rotor. (such that ${V_{ac}}$ and ω are constants that the algorithm assumed in the Determine Ld section)

    ${I_q} = {I_{ac}}\sin (\omega t + \phi )$ is the AC current along the q-axis of the rotor that the algorithm computes from the measured ${I_a}$ and ${I_b}$ phase currents (ϕ is the phase difference between ${V_q}$ and ${I_q}$ that the algorithm should measure)

a. Update the existing algorithm to convert the ${I_a}$ and ${I_b}$ phase current values into the equivalent ${I_q}$ value by using Clarke and Park transforms.

b. Update the existing algorithm to compute ϕ.

c. Update the existing algorithm to compute ${I_{ac}}$.

$${I_{ac}} = \left( {{{{I_q}} \over {\sin (\omega t + \phi )}}} \right)$$

d. Add an algorithm to compute ${L_q}$.

${L_q} = {{\sqrt {V_{ac}^2 - I_{ac}^2{R^2}} } \over {\omega {I_{ac}}}}$

2. Update the model initialization script to perform the preceding modified calculations.

3. Update the host model to obtain and display the ${L_q}$ value computed by the target hardware.

4. Click Build, Deploy & Start on the Hardware tab to deploy the target model to the hardware.

5. Simulate the host model. Send a ${V_{dc}}$ input to the target hardware and record the ${L_q}$ value that you obtain.

Design High Saliency Motor Block

Sections Determine Ld Data and Determine Lq Value provide the following data:

  • Sequence of ${L_d}$ values

  • Sequence of ${I_{dc}}$ (${I_d}$ for a DC current) values

  • Constant ${L_q}$ value

In addition, we can assume a set of ${I_q}$ values that we can use to add high saliency to the motor block.

Use the variables pmsm.nonlin.idVec, pmsm.nonlin.Ld_data, pmsm.nonlin.iqVec, and pmsm.nonlin.Lq_data to store this data in the model initialization script mcb_ipmsm_pos_est_f28379d_data.m associated with the example target model mcb_ipmsm_pos_est_f28379d.slx.

Note: This script is different from the model initialization script used in sections Determine Ld Data and Determine Lq Value.

In addition, define the variables pmsm.nonlin.LdMatrix, pmsm.nonlin.LqMatrix, and pmsm.nonlin.PmMatrix.

In the PMSM (Simscape Electrical) block parameter dialog box, set the Modeling fidelity parameter to Tabulated Ld, Lq and PM and add these variables as shown in the following figure.

The variables pmsm.nonlin.idVec, pmsm.nonlin.Ld_data, pmsm.nonlin.iqVec, and pmsm.nonlin.Lq_data help saturate the stator core and introduce a nonlinear behavior during simulation. This enables the algorithm of the DP method to generate the ${I_d}$ current impulses (corresponding to Pulse-1 and Pulse-2) with different peaks.

References

[1] W. Zine, L. Idkhajine, E. Monmasson, Z. Makni, P. Chauvenet, B. Condamin, and A. Bruyere, "Optimisation of HF signal injection parameters for EV applications based on sensorless IPMSM drives", IET Electric Power Applications, Volume 12, Issue 3, March 2018, p. 347 - 356 (doi:10.1049/iet-epa.2017.0228).

[2] Gaolin Wang, Guoqiang Zhang, and Dianguo Xu, "Position Sensorless Control Techniques for Permanent Magnet Synchronous Machine Drives", Springer, Singapore, 2020 p. 41 - 43 (doi: https://doi.org/10.1007/978-981-15-0050-3).