使用推荐的硬件估算PMSM参数
This example determines the parameters of a permanent magnet synchronous motor (PMSM) using the recommended Texas Instruments™ hardware. The tool determines these parameters:
相抵抗,
(Ohm)
d
andq
轴电感,and
(Henry)
Back-EMF constant,
(Vpk_LL/krpm, where Vpk_LL is the peak voltage line-to-line measurement)
Motor inertia,
(kg.m^2)
Friction constant,
(N.m.s)
The example accepts the minimum required inputs, runs tests on the target hardware, and displays the estimated parameters.
笔记:此示例不支持仿真。金宝app使用支持的硬件配置之一来运行此金宝app示例。
Prerequisites
参数估计工具需要由正交编码器,霍尔传感器或无传感器通量观察者检测到的电动机位置。要使用位置传感器正确检测电动机位置,请校准附着在测试电动机上的正交编码器或霍尔传感器。
Ensure that the PMSM is in no-load condition.
如果您使用的是大厅传感器:
Ensure that the PMSM has Hall sensors.
校准霍尔传感器偏移。有关说明,请参阅PMSM电动机的大厅偏移校准。
If you are using a quadrature encoder sensor:
确保PMSM具有正交编码器传感器。
校准正交编码器偏移量。有关说明,请参阅Quadrature Encoder Offset Calibration for PMSM Motor。
笔记:如果您设置传感器选择field in the host model toSensorless
, you can skip the position sensor calibration step.
Supported Hardware
This example supports only these hardware configurations:
Texas Instruments™F28069M控制卡配置:
F28069M control card
DRV8312-69M-KIT inverter
A PMSM with a Hall or a quadrature encoder sensor
DC power supply
笔记:The DRV8312-69M-KIT board has a known issue in the board's power supply section. Due to this limitation, the board does not support all Hall sensor types. For example, it does not support the Hall sensor of Teknic M-2310P motor.
Texas Instruments LAUNCHXL-F28379D configuration:
launchxl-f28379D控制器
BOOSTXL-DRV8305 inverter
A PMSM with a Hall or a quadrature encoder sensor
DC power supply
Required MathWorks® Products
要运行参数估计,您需要以下产品:下载188bet金宝搏
Motor Control Blockset™
定点Designer™
Embedded Coder®
Embedded Coder Support Package for Texas Instruments C2000™ Processors
准备硬件
对于F28069M控制卡配置:
1.将F28069M控制卡连接到DRV8312-69M型逆变器板的J1。
2.Connect the motor three phases to MOA, MOB, and MOC on the inverter board.
3。将直流电源连接到逆变器板上的PVDDIN。
4。If you are using a Hall sensor, connect the Hall sensor encoder output to J10 on the inverter board.
5。如果您使用的是正交编码器传感器,请将正交编码器销(G,I,A,5V,B)连接到逆变器板上的J4。
For the LAUNCHXL-F28379D configuration:
1.Attach the inverter board to the controller board such that J1, J2 of BOOSTXL aligns with J1, J2 of LAUNCHXL.
2.Connect the motor three phases to MOTA, MOTB, and MOTC on the BOOSTXL inverter board.
3。Connect the DC power supply to PVDD and GND on the BOOSTXL inverter board.
4。如果您使用的是霍尔传感器,请将霍尔传感器输出连接到启动XL上的QEP_B(配置为ECAP)。
5。If you are using a quadrature encoder sensor, connect the quadrature encoder pins (G, I, A, 5V, B) to QEP_A on the LAUNCHXL controller board.
For more details regarding these connections, see硬件连接。
For more details regarding the model settings, seeModel Configuration Parameters。
For LAUNCHXL-F28379D, load a sample program to CPU2, for example, program that operates the CPU2 blue LED using GPIO31 (c28379D_cpu2_blink.slx
) to ensure that CPU2 is not mistakenly configured to use the board peripherals intended for CPU1.
Parameter Estimation Tool
参数estimation tool includes a target model and a host model. The models communicate with each other by using a serial communication interface. For more details, seeHost-Target Communication。
Enter the details about the hardware setup and the motor under test in the host model. The target model uses an algorithm to perform tests on the motor and estimate the motor parameters. The host model starts the required tests and displays the estimated parameters.
Prepare Workspace
Open theparameter estimation host model。您也可以使用此命令打开主机模型:
open_system('mcb_param_est_host_read.slx');
Enter these details in the host model to prepare the workspace:
Select Board— Select the target hardware and inverter combination.
Communication Port— Open the blocks Host Serial Setup, Host Serial Receive, and Host Serial Transmit, and select the Port to which the hardware is connected. Select an available port from the list. For more details, seeFind Communication Port。
Required Inputs— Enter the motor specification and hardware setup data. You can obtain these values either from the motor datasheet or from the motor nameplate.
-Input DC Voltage- 逆变器(伏特)的直流电源电压。
-名义电流— The rated current of the motor (Ampere).
-Nominal Speed— The rated speed of the motor (RPM).
-Pole Pairs— The number of pole pairs of the motor.
-标称电压- 电动机的额定电压(伏特)。
-Position Offset— The position (Hall or quadrature encoder) sensor offset value (per-unit position) (seePMSM电动机的大厅偏移校准,Quadrature Encoder Offset Calibration for PMSM Motor, andPer-Unit System。
-传感器选择— The type of position sensor that you are using. You can select one of these values:
-QEP
— Select this option if you are using the quadrature encoder sensor attached to your motor.
-HALL
— Select this option if you are using the Hall sensors available in your motor.
-Sensorless
——选择这个选项如果你想要的至use the Flux Observer sensorless position estimation block instead of a position sensor. For details about this block, see Flux ObserverFlux Observer。
-Total QEP Slits- 正交编码器传感器中可用的缝隙数。默认情况下,此字段具有一个值1000
。
笔记:更新时Required Inputs,考虑以下局限性:
The rated speed of the motor must be less than 25000 RPM.
测试保护硬件免受过度电流故障的影响。但是,为确保不会发生这些故障,请保持电动机的额定电流(输入名义电流field) less than the maximum current supported by the inverter.
如果您有基于SMPS的直流电源单元,则出于安全原因将电流限制设置为安全的限制。
Update Advanced Parameters
You can optionally update the advanced parameters related to the parameter estimation algorithm. Click the link available in the host model to access and update these parameters:
RS估计的OpenLoop VD参考电压— Enter the reference voltage
, in per-unit (PU)(Volts), for open-loop configuration that the algorithm uses to estimate phase resistance,
。The
value should be high enough to bring the rotor to zero position and hold it there. This value should also be high enough to generate readable current feedback from the motor. The
value should be low enough to avoid rapid increase in motor temperature. This parameter uses the default value of
0.1
pu。
Rs estimation time— Enter the time (in seconds) that the algorithm should take to estimate the phase resistance,
。这段时间应该足够高,以使算法获得足够的样品以进行平均值计算(对于特定的开关频率)。如果测得的电压和当前调试信号包含噪声,请增加此参数值,从而使算法捕获更多的平均值计算样本。此参数使用
2
seconds. The maximum Rs estimation time allowed is9
seconds.
Frequency Sweep Range for Ld and Lq estimation— Enter the frequency sweep range (in Hertz) that the algorithm uses for measuring the inductances
and
。The lower and upper frequency limits of this range should be high enough to make the rotor motionless. At the same time, these frequencies should be low enough for the algorithm to obtain sufficient samples (for a particular switching frequency). Very high frequency values result in a higher inductive reactance that can lead to inaccurate current measurements. This parameter uses the default frequency values of
400
and1000
Hertz.
Frequency step size for Ld and Lq estimation- 输入算法用于测量电感的频率扫描的步长(在赫兹)
and
。该参数使用的默认值
10
Hertz.
DC bias for Vd during Ld & Lq estimation- 输入pu(伏特)的直流偏置电压
and
算法使用电压扰动measuring the inductances
and
。The DC bias voltage should be high enough to lock the rotor shaft. At the same time, it should be low enough for the algorithm to avoid overcurrents at the time of application of sinusoidal voltage perturbations. The parameter uses the default value of
0.1
pu。
LD&LQ估计期间VD和VQ的振幅— Enter the amplitude, peak-to-peak value in PU (Volts), of the
and
算法使用电压扰动measuring the inductances
and
。This amplitude should be high enough to avoid introducing noise during ADC measurements. At the same time, it should be low enough for the algorithm to avoid overcurrents at the time of application of sinusoidal voltage perturbations. The parameter uses the default value of
0.05
pu。
Iq reference for torque control— Enter the reference
current, in PU (Amperes), for the closed-loop torque control tests performed by the algorithm. This current should be low enough to avoid sudden jolts to the rotor shaft. At the same time, it should be high enough for the algorithm to overcome the inertia of the rotor shaft. The parameter uses the default value of
0.2
pu。
Under Voltage limit- 输入算法向电动机提供的电压保护的电压电压防护电压(作为输入直流电压的百分比)。参数使用
80
as the default value.
超过当前限制— Enter the current limit (as percentage of PMSM nominal current) for overcurrent protection that the algorithm provides to the motor. This value should be high enough for the algorithm to successfully run parameter estimation tests under normal conditions using the configured parameters. At the same time, this value should not exceed
100
。参数使用100
as the default value.
End speed for Inertia estimation- 输入算法使用的PU(RPM)的电动机速度来计算电动机惯性。该参数使用的默认值
0.25
。
Deploy Target Models
Before starting the tests by using the parameter estimation tool, you need to download the binary files (。hex
/。out
) generated by the target model into the target hardware. There are two workflows to download the binary files:
Workflow 1: Build and Deploy Target Model
Use this workflow to generate and deploy the code for the target model. Ensure that you pressCtrl+D至update the workspace with the required input values from the host model.
点击one of these hyperlinks in the parameter estimation host model to open the target model (for the hardware that you are using):
For F28069M-based controller attached to either Hall or quadrature encoder sensor:mcb_param_est_f28069_DRV8312
For F28069M-based controller that uses the sensorless Flux Observer block:mcb_param_est_sensorless_f28069_DRV8312
对于基于F28379D的控制器,与大厅或正交编码器传感器相连:mcb_param_est_f28379D_DRV8305
对于F28379D的控制器,使用无传感器通量观察者块:mcb_param_est_sensorless_f28379D_DRV8305
点击Build, Deploy & Startin theHardware选项卡将目标模型部署到硬件。
笔记:Ignore the warning messageMultitask data store option in the Diagnostics page of the Configuration Parameter Dialog is none
由模型顾问显示,单击总是忽略按钮。这是预期工作流程的一部分。
Workflow 2: Manually Download Target Model
Use this workflow to deploy the binary files (。hex
/。out
)通过使用第三方工具手动的目标模型(工作流不需要代码生成)。此工作流仅适用于TEKNIC M-2310P电动机。
Locate the binary files (
。hex
/。out
) at these locations:
-< matlabroot >\toolbox\mcb\mcbexamples\mcb_param_est_f28069_DRV8312.out
-< matlabroot >\toolbox\mcb\mcbexamples\mcb_param_est_sensorless_f28069_DRV8312.out
-< matlabroot >\toolbox\mcb\mcbexamples\mcb_param_est_f28379D_DRV8305.out
-
笔记:The filesmcb_param_est_f28069_DRV8312.out
andmcb_param_est_f28379D_DRV8305.out
use a fixed quadrature encoder slits count of1000
。Therefore, when you set the required input传感器选择至QEPin the host model, you can use these files only for motors connected to a quadrature encoder sensor with1000
slits (for example, the Teknic M-2310P motor).
Open a third-party tool to deploy the binary files (
。hex
/。out
).
Download and run the binary files (
。hex
/。out
)在目标硬件上。
Estimate Motor Parameters
Use the following steps to run the Motor Control Blockset parameter estimation tool:
1.Ensure that you deploy the binary files (。hex
/。out
) generated from the target model, to the target hardware.
Then update the required details in the host model. See the section Prepare Workspace for information about the required inputs.
2.In the host model, check if the跑-Stopslider switch position is跑。然后,单击跑in theSimulationtab to run the parameter estimation tests.
3。参数estimation process takes less than a minute to perform the tests. You can ignore the beep sound produced during the tests.
During an emergency, you can manually turn the跑-Stopslider switch to停止停止参数估计测试的位置。
4。The host model displays the estimated motor parameters after successfully completing the tests.
当。。。的时候parameter estimation tests successfully complete, the测试状态LED变绿色。
如果参数估计测试中断,则测试状态LED turns red. The model also interrupts the tests and turns these LEDs red to protect the hardware from the following faults:
- Over-current fault (this fault occurs when actual current drawn from the power supply is more than the名义电流value mentioned in theRequired Inputssection of the host model)
- 电压故障(当输入直流电压下降到80%以下时,发生这种故障Input DC Voltagevalue mentioned in theRequired Inputssection of the host model)
- Serial communication fault
5。当。。。的时候测试状态LED turns red, run the host model again to rerun the parameter estimation tests.
If the测试状态LED is green, check theLdandLqLEDs available in theParameter Validitysection of the host model. These LEDs indicate the following statuses:
绿色 - 表示计算LdandLq值有效。
Amber — Indicates that the computedLdandLqvalues are invalid. Run the host model again to rerun the parameter estimation tests.
6。Use the来自目标的信号field on the host model to select a debug signal that you want to monitor. After selecting a signal, open theSelectedSignaltime scope (available in the信号调理,缩放和高级算法参数subsystem) to view the selected debug signal.
参数estimation tool uses the following algorithm to estimate parameters:
相抵抗,
— The tool uses Ohm's law to estimate this value.
d
轴电感,— The tool uses frequency injection method to estimate these values.
q
轴电感,— The tool uses frequency injection method to estimate these values.
Back-EMF constant,
— The tool measures the currents and voltages and uses the electric motor equation to estimate this value.
Motor inertia,
— The tool estimates this value by using retardation test.
Friction constant,
— The tool estimates this value by using the torque equation for a motor running at a constant speed.
Save Estimated Parameters
您可以导出估计的电机参数,并将其进一步用于仿真和控制系统设计。
To export, click保存参数至save the estimated parameters into a MAT (。垫
) file.
要查看保存参数,请加载垫子(。垫
)在MATLAB®工作区中的文件。MATLAB将参数保存在名为的结构中motorParam
in the workspace.
点击Open Model至create a new Simulink® model with a PMSM motor block. The motor block uses themotorParam
structure variables from the MATLAB workspace.