Main Content

直流电动机模型

在此示例中,您将建模由恒定输入信号驱动的直流电动机,该电动机近似于脉冲宽度调制信号,并查看电动机输出处的电流和旋转运动。

To see the completed model, open thePWM控制的直流电动机example.

选择Blocks to Represent System Components

选择块以表示输入信号,直流电动机和电动机输出显示。

The following table describes the role of the blocks that represent the system components.

Block

Description

Solver Configuration

定义适用于所有物理建模块的求解器设置

PS-Simulink Converter

Converts the input physical signal to a Simulink®信号

受控的PWM电压

Generates the signal that approximates a pulse-width modulated motor input signal

H桥

Drives the DC motor

直流电动机

将输入电能转换为机械运动

当前传感器

Converts the electrical current that drives the motor into a measurable physical signal proportional to the current

直流电压源

生成直流电压

Electrical Reference

提供电气接地

机械旋转参考

提供机械场

理想的旋转运动传感器

Converts the rotational motion of the motor into a measurable physical signal proportional to the motion

范围

Displays motor current and rotational motion

Build the Model

  1. 创建一个新模型。

  2. 将下表中列出的块添加到模型中。表的库列指定了每个块的层次路径。

    Block

    Library

    Quantity

    Solver Configuration

    Simscape>Utilities

    1

    PS-Simulink Converter

    Simscape>Utilities

    2

    受控的PWM电压

    Simscape>Electrical>Integrated Circuits

    1

    H桥

    Simscape>Electrical>半导体和转换器>转换器

    1

    直流电动机

    Simscape>Electrical>Electromechanical>拉丝电动机

    1

    当前传感器

    Simscape>基金会图书馆>Electrical>Electrical Sensors

    1

    直流电压源

    Simscape>基金会图书馆>Electrical>Electrical Sources

    1

    Electrical Reference

    Simscape>基金会图书馆>Electrical>电元素

    1

    机械旋转参考

    Simscape>基金会图书馆>机械的>旋转元素

    1

    理想的旋转运动传感器

    Simscape>基金会图书馆>机械的>机械传感器

    1

    范围

    金宝app>常用块

    2

    笔记

    您可以使用SIMSCAPE™功能ssc_new使用域类型electrical至create a Simscape model that contains these blocks:

    • Simulink-PS Converter

    • PS-Simulink Converter

    • 范围

    • Solver Configuration

    • Electrical Reference

  3. Rename and connect the blocks as shown in the diagram.

Now you are ready to specify block parameters.

指定模型参数

Specify the following parameters to represent the behavior of the system components:

模型设置参数

The following blocks specify model information that is not specific to a particular block:

  • Solver Configuration

  • Electrical Reference

  • 机械旋转参考

与SIMSCAPE模型一样,您必须在每个拓扑不同的物理网络中包含一个求解器配置块。此示例具有一个物理网络,因此请使用一个默认参数值的一个求解器配置块。

You must include an Electrical Reference block in eachSIMSCAPE Electrical™网络。您必须在每个网络中包含一个机械旋转参考块,其中包括机电块。这些块没有任何参数。

For more information about using reference blocks, see基础规则

电机输入信号参数

您使用以下块生成电动机输入信号:

  • 直流电压源块(PWM参考电压) generates a constant signal.

  • 受控的PWM电压块生成脉冲宽度调制信号。

  • The H-Bridge block drives the motor.

In this example, all input ports of the H-Bridge block except the PWM port are connected to ground. As a result, the H-Bridge block behaves as follows:

  • When the motor is on, the H-Bridge block connects the motor terminals to the power supply.

  • When the motor is off, the H-Bridge block acts as a freewheeling diode to maintain the motor current.

在此示例中,您用一个常数电流模拟其值是PWM信号的平均值。通过使用这种类型的信号,您可以设置一个快速模拟,以估计电动机行为。

  1. 设置DC电压源块参数如下:

    • 恒定电压2。5

  2. 设置受控的PWM电压块参数如下:

    • PWM频率4000

    • Simulation mode平均

      该值告诉块生成一个输出信号,其值是PWM信号的平均值。使用平均信号模拟电动机会在存在PWM信号的情况下估计电动机行为。要验证此近似值,请使用PWM对于此参数。

  3. 设置H桥块参数如下:

    • Simulation mode平均

      该值告诉块生成一个输出信号,其值是PWM信号的平均值。使用平均信号模拟电动机会在存在PWM信号的情况下估计电动机行为。要验证此近似值,请使用PWM对于此参数。

笔记

受控PWM电压和H桥块的仿真模式必须相同。

电机参数

配置建模电动机的块。

设置直流电动机堵塞parameters as follows, leaving the unit settings at their default values where applicable:

  • 电扭矩tab:

    • 模型参数化By rated power, rated speed & no-load speed

    • 一个rmature inductance0.01

    • No-load speed4000

    • Rated speed (at rated load)2500

    • 额定负载(机械功率)10

    • Rated DC supply voltage12

  • 机械的tab:

    • Rotor inertia2000

    • Rotor damping1E-06

Current Display Parameters

指定的参数块创建the motor current display:

  • 当前传感器堵塞

  • PS-Simulink Converter1堵塞

  • Current范围

Of the three blocks, only the PS-Simulink Converter1 block has parameters. Set the PS-Simulink Converter1 block输出信号单元参数为一个指示块输入信号具有安培单位。

扭矩显示参数

指定的参数块创建the motor torque display:

  • 理想的旋转运动传感器堵塞

  • PS-Simulink Converter堵塞

  • RPM范围

Of the three blocks, only thePS-Simulink Converter块具有您需要为此示例配置的参数。设置PS-Simulink Converter堵塞输出信号单元参数为rpm为了表明块输入信号具有每分钟的旋转单位。

笔记

您必须键入此参数值。它在下拉列表中不可用。

配置求解器参数

Configure the solver parameters to use a continuous-time solver becauseSimscape Electrical模型仅使用连续的时间求解器运行。增加求解器所需的最大步长,以便模拟运行速度更快。

  1. 在模型窗口中,选择造型>模型设置打开“配置参数”对话框。

  2. 选择ode15s (Stiff/NDF)from theSolverlist.

  3. 扩张一个dditional optionsand enter1for the最大步长大小参数值。

  4. 点击OK

For more information about configuring solver parameters, seeSimulating an Electronic, Mechatronic, or Electrical Power System

运行模拟并分析结果

在示例的这一部分中,您运行模拟并绘制结果。

在模型窗口中,选择Simulation>运行模拟。

To view the motor current and torque in the Scope windows, double-click the Scope blocks. You can do this before or after you run the simulation.

笔记

默认情况下,示波器显示器出现在屏幕上彼此堆叠,因此您只能看到其中之一。单击并拖动窗口以重新定位它们。

以下图显示了电动机电流。

Motor Current

The next plot shows the motor rpm.

电动机RPM

一个s expected, the motor runs at about 2000 rpm when the applied DC voltage is 2.5 V.