MATLAB:电机控制(Motor Control)

news2024/12/29 10:59:24

目录

  • 前言
  • 1、Overview
    • 1.1、Specific objectives
    • 1.2、Resources
    • 1.3 、Industrial context
    • 1.4 、Architecture of the system
    • 1.5 、Approach/Steps
  • 2、MODELLING THE MOTOR AND THE LOAD
    • 2.1Simulate a DC motor by its physical model
    • 2.2、Modelling the motor / load by its mathematical models (transfer functions)
  • 3、CONTROL LOOP DESIGN
    • 3.1、 Design the Current Control Loop
      • 3.1.1、Identification of the transfer function
      • 3.1.2、Calculating the current controller
    • 3.2、Designing the speed control loop
      • 3.2.1、Identification in an open loop in the time domain
      • 3.2.2、Designing the speed controller
  • 4、COMPLETE CONTROL SYSTEM
    • 4.1、Current limiting
    • 4.2、Development of the entire system
  • Reference
  • 5、工程及文档获取

前言

        花了好大心血完成了一份留学作业,供大家参考,文末有MATLAB程序及无水印Word文档。

1、Overview

        Control design is very important in for power electronics, such as the application on converters and motor control. In this lab, we will learn how to design a PI controller for a DC motor to meet the required specifications. The lab will be conducted on the simulation software Matlab Simulink. The design of PI controllers requires background knowledge and theories on both DC machine as well as the control, such as the derivation of transfer functions for motor current and speed, which are presented as supporting documentations and posted on the Canvas. They should be studied before this lab to ensure you can follow up in the lab class.

1.1、Specific objectives

  • To understand the process of deriving the model of a control system
  • To measure the stability and accuracy of a control loop
  • To implement a tuning strategy for a closed loop system (PI controller)
  • To check the system operation against the technical specifications

1.2、Resources

Following documents are provided for you to understand and develop the lab section by section:

  • Modeling of a dc motor - mod_DC_Motor [1]
  • PI analog controllers and first order systems - PI_order1 [2]

These documents can be downloaded from the Canvas site under Module->Laboratory note.

1.3 、Industrial context

        In the context of an industrial application, we want to implement a system to control the speed of a dc motor which may drive a conveyor belt that dispatches mechanical parts. The system is controlled by an analog controller operating in the first quadrant. It is supplied through a power converter such as a dc buck converter. With controlling duty cycles of the converter, the supply voltage of the dc motor can be varied, and the speed of the motor can be controlled to meet the load variations.

1.4 、Architecture of the system

        The block diagram in Fig 1 (a) illustrates a general control scheme, while the Fig.1 (b) shows the flowchart of the control loops to be used in this lab.
在这里插入图片描述
                Fig.1 (a) Block diagram of general control loop

        For this type of servo mechanical system, the current (and therefore the torque) should be controlled in order to avoid lurching and vibrations that can be destructive for the motor. We will use a classical two-loop structure with one inner loop (current control) and one outer loop (speed control).

在这里插入图片描述

                Fig.1 (b) Block diagram of control loop for this lab

1.5 、Approach/Steps

        After the system is modelled, the simulation tool can be used to analyze the behaviour, to adjust the controllers and to ensure the motor performance.

  • Search for variables associated with the operating point by modelling of the motor and the load. In this step, you need to set up a buck converter model and dc motor model in Simulink to conduct open-loop operation.
  • Modelling the buck converter and dc motor by using their transfer functions and compare with one modelled by their physical modules.
  • Identification of the response signal and adjustment of the current controller. You need to run a Bode plots to work out PI controller (Kp and Ki) for the current to meet the control requirements.
  • Identification of the response in terms of speed and adjustment of the controller. You need to run step response to work out PI controller for the speed to meet the control requirements.
  • Setting limitations on voltage and current, defined by the field of application.
  • Analysis of the results and tests on the real structure with the physical modules of converter and motor.

The steps above will be implemented section by section below.

2、MODELLING THE MOTOR AND THE LOAD

2.1Simulate a DC motor by its physical model

        A separately excited dc machine with the constant flux will be used to model a dc motor in Matlab. Fig.2 shows the schematic diagram in Matlab Simulink. Please refer to details in the Tutorial on how to establish an open-loop dc motor control the physical models.
在这里插入图片描述

  • Fig. 2 Schematic diagram of buck converter and DC motor with a load

        The load torque (friction) is proportional to the speed. It can be expressed as Cr = K1Ω, where Ω is the speed and the constant K1 = 0.0005 Nm/(rad/sec). The parameters of the motor are shown in Fig.3
在这里插入图片描述

  • Fig.3 DC motor parameters

        Check the parameters for the models in Fig.2 and enter values for each model. Apart from the motor parameters shown in Fig.3, the rest of parameters for the models in Fig.2 are shown or to be calculated below.
Check the parameters for the models in Fig.2 and enter values for each model. Apart from the motor parameters shown in Fig.3, the rest of parameters for the models in Fig.2 are shown or to be calculated below.

  • Buck converter: input voltage Vs=24V, duty cycle is 60.4%, and C=100 uF
  • Calculate inductance of Lc of the buck converter to achieve the current ripple less than 5% with the switching frequency of 40 kHz;
  • DC motor: the parameters of the motor are shown in Fig.3. In the Simulink block diagram of Fig.2, the field voltage is 24 V. What is the motor armature voltage Va out of the buck converter?

        Build and simulate the system shown in Fig.2 and check if you obtain a speed of 1500 rpm in the steady state. Record below the response time at 90 % (Tr) of the final value as well as the armature current (Ia) in the steady state. You may record the waveforms for the lab report. Measure the current ripple and see if it is less than 5%.

  • V = 14.1V ; Tr = 61.5ms ; Ia = 1.077A Ia = 18.33mA .

2.2、Modelling the motor / load by its mathematical models (transfer functions)

        Fig.4 (a) is the block diagram of the motor transfer functions while the diagram in Fig.4 (b) shows the Simulink blocks based on it. Refer to the resource document mod_DC_Motor [1] to derive the parameters for TF1 and TF2 for the dc motor in Fig.4 (b).
在这里插入图片描述

  • Fig.4 (a) Block diagram for a motor
    在这里插入图片描述
  • Fig.4 (b) Simulink diagram of the DC motor and buck converter by transfer functions

        The value of the friction coefficient for Block TF2 is: f = 5.17 μN*m/(rad/sec). For the TF1 block (check the format of a transfer function in Simulink), the numerator and denominator are: (Note the total inductance in the denominator of TF1 should include both inductors from the armature of the motor as well as the Lc from the buck converter)

  • num(s) = 1 ; den(s) = 0.92e-3S+2.85 ;

For the TF2 block :

  • num(s) = 1 ; den(s) = 63.5e-6S+2.17e-6 ;
            Enter the parameters for the blocks TF1 and TF2 and use the armature voltage V obtained in Section 2.1 for Va. Build and simulate the circuit shown in Fig.4 (b). Record the speed response and measure values for the parameters below from it. Note the speed shows the speed in the unit of rad/s.

  • Tr = 59.69mS ; Ia = 1.053A .

        Compare values of Tr and Ia with those from Fig.2 in the section 2.1. What can you conclude?
        Load motor can be represented by mathematical model or transfer function. By comparing the mathematical model and transfer function, it can be concluded as follows: under current conditions, the motor load expressed by mathematical equation is the same as that directly used in simulink DC Machine module, and the Tr and Ia values obtained are very close.

3、CONTROL LOOP DESIGN

        As shown in Fig.1 (b), two control loops will be designed for the motor control: current control and speed control. You need to study the resource document mod_DC_Motor [1] as well as the PI_order1 [2], to be able to follow up the tasks in this section.

3.1、 Design the Current Control Loop

3.1.1、Identification of the transfer function

        Refer to the Resource document mod_DC_Motor [1]. Re-draw the dc motor block diagram in Fig.4 (a) as below, the transfer function of I(s)/Um(s) can be derived.

在这里插入图片描述

  • Fig.6 The block diagram for current control

        The theoretical analysis gives the expression of the transfer function of the current in the open loop circuit:
在这里插入图片描述


在这里插入图片描述
        Use the Matlab file built in Fig.4 (b) to measure the bode plot for the system in Fig.6. To do it, click APPS and then open Model Linearizer as highlighted below.
在这里插入图片描述
        After open Model Linearizer the window below is popped up for you to run Bode plot.
在这里插入图片描述
        Before run the Bode plot, first add perturbation to the input voltage Va and take the output from the current. In this case, an input perturbation is added to Va and output measurement is set at the current output Ia, as highlighted in yellow in Fig.7.
在这里插入图片描述

  • Fig.7 Run Bode plot for the current control transfer function

在这里插入图片描述

3.1.2、Calculating the current controller

        We will choose a PI type controller with an integration time constant Ti (=Kp/Ki) so that Ti = 1/ω2 (see the asymptotic Bode plot in Section 3.1.1). Moreover, we will set a response time, Tr , at 90 % in a closed loop so that Tr = 1 ms bearing in mind that for a first order system we can estimate that (ω0 = cut-off frequency). Note Ti= Kp/Ki, where Kp and Ki are the proportional and integral gain respectively.
        On the Bode diagram obtained in Section 3.1.1 (for the system in Fig.7), locate the frequency ω2 and calculate Ti.

  • ω2 =314rad/S ;
    Ti = 1/ω2 = 0.00318471337579617834394904458599

        Calculate the value of ω0 in order to obtain a response time (Tr) equal to 1 ms.

  • ω0 = 3000 rad/S ;

        Now build the block diagram in Fig.8 (a) in Simulink, and enter parameters for the PI controller as: Ti = 1/ω2 (so Ki= ω2) and Kp=1. Simulate the open loop circuit in Fig.8(a). Measure the value of the circuit gain at the cut-off frequency 0.
在这里插入图片描述

  • Fig. 8 (a) PI controller for current control loop
  • G(0) = -11.9dB ;

Determine the value of Kp so that achieve a gain of 0 dB at the frequency 0 by G(0)=20*log(Kp).

  • Kp = 3.93955 .
  • Ki = 1.2357e3 .
  • The rise time is 1.82ms, which is greater than 1ms.

        With the proportional gain worked out above, the integral gain Ki can be recalculated by Ti=Kp/Ki. These should be the final values for the current PI controller. Confirm your calculations by setting the parameters of the controller again and running the simulation for the system in Fig. 8 (b) in which the current control loop is closed. Observe the step response in the closed loop for the armature current Ia in the time domain and check if the rising time less than 1ms.
在这里插入图片描述

  • Fig. 8 (b) Step response test for the current control loop

3.2、Designing the speed control loop

        In this section we are going to work out a PI controller for the speed control loop.
        From the supporting documentation mod_DC_Motor [1], we know the transfer function for the motor speed control in Fig.4 (a) can be derived as equation below with an assumption, which is the first order system.
在这里插入图片描述
        Then we can use the equations derived in the supporting documentation PI_order1 (showing below as well), to design the Kp and Ki of the speed PI controller.
在这里插入图片描述

  • Eq.(2.4)
    在这里插入图片描述
  • Eq.(2.3)
            The rising time Tr for the speed is expected to be less than 100 ms. To work out Ti we need to find out the time constant of the system first.

3.2.1、Identification in an open loop in the time domain

        Build the schematic diagram in Fig.9 in Simulink. Calculate the scaling factor Ktac, so that for Vcons = 5 V, we want to obtain a speed equal to 157 rad/s (=1500 rpm). Note: as mentioned in the section 1.2, the unit of speed derived from the transfer functions is rad/s.

  • Ktac = 5/157 =0.03184713375796178343949044585987 .

        Run the simulation and observe the signal Vcons (speed reference) and V(speed feedback). Then refer to the resource document PI_order1 [2] and identify the time constant τ, as well as the circuit gain for the loop K (in the steady state). Note these parameters are referred to the ones in the transfer function H(s) in resource document PI_order1 [2].

        That is the time constant τ is at 63% of the full scale output value, and the static gain K=V/Vcons.

  • τ = 127.571mS ; K = 2.182 .
    在这里插入图片描述
  • Fig.9 Work out the parameters of the first order transfer function of the motor

3.2.2、Designing the speed controller

        Determine the parameters A and Ti of the speed PI controller (series) that ensures a response time Tr in a closed loop of approximately 100 ms.
        Refer to the Equation (2.3) and (2.4) in resource document PI_order1 [2], plus the time constant τ and the loop gain K from the section 3.2.1, and determine the following parameters

  • KB = 6.6543 ; A = 3.0496 ; Ti = 0.0580 ;

Can you please explain your calculations?
According to the following 3 formulas:
Eq.1
在这里插入图片描述
Eq.2
在这里插入图片描述

Eq.3
在这里插入图片描述
        And the previous calculated values into formula 1, formula 2, formula 3, using matlab to calculate. The matlab code is as follows:
Tr=100e-3;
TAO=127.571e-3;
K=2.182;
A=(6TAO/Tr-1)/K
Ti=4
KATAO/((1+KA)(1+KA))
KB=K
A
        Build the schematic diagram in Fig.10 to establish the close loop of the speed control. Enter the parameter Ktac, and PI controller for the speed loop. Simulate the circuit. Visualize the speed and conclude on the stability, accuracy, and response time.
在这里插入图片描述

  • Fig.10 Close loop of speed control

4、COMPLETE CONTROL SYSTEM

4.1、Current limiting

        So far you have built the PI controller for the speed and current control. Look at the diagram in Fig.10 and simulate the circuit again in order to visualise the amplitude of the current of the motor.
        What is the maximum value of the current in transient state? Ia_max = 12.33A .

        The large starting current of the motor can cause damage to the insulation. To limit the maximum current, modify the circuit in Fig.10 to Fig.11 by adding a limiter that limits the current amplitude at 3 A. Then run the simulation again and see the effect of this limitation on armature current Ia. Record the waveform and compare with the one without the limiter. How does this limiter affect the response time of the speed?
在这里插入图片描述

        As can be seen from the figure window, the response speed of the system is slowed down after the limiter is added.
在这里插入图片描述

  • Fig.11 Add current limiter in the control loop to cap the maximum current

4.2、Development of the entire system

        With the models of different parts of the system, we can study the relationship between different variables, and design the control loops. We are now going to conclude the study by simulating the complete system, as shown in Fig.12. Note the first limiter in Fig.12 is to limit maximum transient current and the second limiter is to limit the reference voltage which can be set to 0 to 6.
在这里插入图片描述

  • Fig.12 Schematic diagram of current and speed control of DC motor with DC buck converter
    在这里插入图片描述

在这里插入图片描述
        You will carry out a test with the change of the speed reference from 1200 rpm to 1800 rpm which correspond to Vcons = 4 V~6 V). In these conditions the motor is operating at its nominal power. The table below shows the settings for the reference speed Vcons.
在这里插入图片描述
        Run the simulation and observe the speed reference (Vcons), the actual speed (Speed), and the armature current as well as other parameters of interest. Record the response waveforms and identify the specifications of the control loop are met or not.
        Comment on the speed waveform with reference to the target speed Vcons and identify the problem.
在这里插入图片描述
在这里插入图片描述
         Running the simulation, it can be seen that with the change of the reference speed Vcons, the speed of the motor also changes with the same trend. And the response speed is fast. When the Vcons input is 4V, the motor speed output is 1200rpm. When the Vcons input is 6V, the motor speed output is 1800rpm. However, the motor has inertia, and the response of inertia cannot be eliminated, and it takes about 700ms from 1800rpm to 0rpm.

Reference

[1] Modeling of a dc motor - mod_DC_Motor , on Canvas of UoS
[2] PI analog controllers and first order systems - PI_order1, on Canvas of UoS

5、工程及文档获取

下载链接:https://download.csdn.net/download/weixin_46423500/88347742
MATLAB:电机控制(Motor Control)
其中,zz为最终程序,gc为过程程序供大家参考。
在这里插入图片描述

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1017782.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

堆内存与栈内存

文章目录 1. 栈内存2. 堆内存3. 区别和联系参考资料 1. 栈内存 栈内存是为线程留出的临时空间 每个线程都有一个固定大小的栈空间,而且栈空间存储的数据只能由当前线程访问,所以它是线程安全的。栈空间的分配和回收是由系统来做的,我们不需…

《C++ primer plus》精炼(OOP部分)——对象和类(5)

“学习是照亮心灵的火炬,它永不熄灭,永不止息。” 文章目录 类的自动和强制类型转换原始类型转换为自定义类型将自定义类型转换为原始类型 类的自动和强制类型转换 原始类型转换为自定义类型 可以用一个参数的构造函数来实现,例如&#xff…

【Linux操作系统】信号的产生捕获

🔥🔥 欢迎来到小林的博客!!       🛰️博客主页:✈️林 子       🛰️博客专栏:✈️ Linux       🛰️社区 :✈️ 进步学堂       &#x1f6f0…

destoon关于archiver归档的性能优化

今天在处理一个项目时候发现archiver单个模块归档超过百万数据,打开速度就特慢,所以打开archiver下index.php文件进行分析,发现有句sql作怪,查询需要三四分钟,所以要修改这个。 $result $db->query("SELECT …

login (mobile email usercode)

手机、邮箱、用户编码登录 package login;/*** 常量类(改造拉到你自己项目里面)** author ZengWenFeng* date 2023.09.17* email 117791303qq.com* mobile 13805029595*/ public class Constant {// 登录界面的登录方式:手机、邮箱、用户名public static final Str…

YOLOv8学习

1 YOLOv8训练自己的数据集 1.1 部署和运行 1.1.1 第一步,下载代码 源码地址 1.1.2 第二步,创建环境 默认已经安装好conda conda create -n yolopy38 python3.8conda activate yolopy38安装所需要的包,先cd到代码目录下 pip install -r…

深眸科技自研工业AI视觉检测设备,检测精度99.9%加速智造进程

随着机器视觉技术的持续升级,国内制造行业不断发展,工艺水平持续优化,产品的数量和种类与日俱增。当前社会将产品质量标准提高,在满足正常的性能使用外,还需要具有良好的表面外观质量。但在工业制造过程中,…

【C语言】【数据存储】用%d打印char类型数据,猜结果是啥

题目代码如下&#xff1a; #include <stdio.h> int main() {char a -1;signed char b-1;unsigned char c-1;printf("a%d,b%d,c%d",a,b,c);return 0; }解题关键&#xff1a; 1.二进制存储&#xff1a;原码&#xff0c;反码&#xff0c;补码 互换 2.截断 3.整型…

密码学入门——Feistel网络

文章目录 参考书一、引入二、Feistel网络计算流程三、Feistel网络的解密四、Feistel网络的性质 参考书 图解密码技术&#xff0c;第三版 一、引入 DES的基本结构是由Horst Feistel设计的&#xff0c;因此也被成为Feistel网络&#xff08;Feistel结构&#xff0c;Feistel密码…

《动手学深度学习 Pytorch版》 6.6 卷积神经网络

import torch from torch import nn from d2l import torch as d2l6.6.1 LeNet LetNet-5 由两个部分组成&#xff1a; - 卷积编码器&#xff1a;由两个卷积核组成。 - 全连接层稠密块&#xff1a;由三个全连接层组成。模型结构如下流程图&#xff08;每个卷积块由一个卷积层、…

分布式电源接入对配电网影响分析(Matlab代码实现)

&#x1f4a5;&#x1f4a5;&#x1f49e;&#x1f49e;欢迎来到本博客❤️❤️&#x1f4a5;&#x1f4a5; &#x1f3c6;博主优势&#xff1a;&#x1f31e;&#x1f31e;&#x1f31e;博客内容尽量做到思维缜密&#xff0c;逻辑清晰&#xff0c;为了方便读者。 ⛳️座右铭&a…

汽车电子——产品标准规范汇总和梳理(电磁兼容)

文章目录 前言 一、辐射发射 二、传导发射 三、沿电源线瞬态传导发射 四、辐射抗扰 五、大电流注入抗扰 六、磁场抗扰 七、便携式发射机抗扰 八、沿电源线瞬态抗扰 九、非电源线瞬态抗扰 十、电快速脉冲群抗扰 十一、静电抗扰 总结 前言 见《汽车电子——产品标准规…

Oracle数据库安装卸载

文章目录 一、数据库版本说明二、软件的下载和安装1.下载软件2.安装数据3.创建数据库4.PLSQL 三、数据库的卸载1.关闭相关服务3.卸载软件3.删除注册信息 四、用户和权限 一、数据库版本说明 1998年Oracle8i&#xff1a;i指internet&#xff0c;表示oracle向互联网发展&#xf…

bootstrap柵格

.col-xs- 超小屏幕 手机 (<768px) .col-sm- 小屏幕 平板 (≥768px) .col-md- 中等屏幕 桌面显示器 (≥992px) .col-lg- 大屏幕 大桌面显示器 (≥1200px) 分为12个格子 -后面的1代表占12分子1也就是一份 1.中等屏幕 <div class"container-fluid a">&l…

ARM Linux DIY(十二)NES 游戏

文章目录 前言交叉编译工具链使能 Cnes 游戏模拟器移植游戏手柄调试 前言 很多小伙伴为了不让自己的 V3s 吃灰&#xff0c;进而将其打造成游戏机。 我们 DIY 的板子具备屏幕、扬声器、USB Host&#xff08;可以接游戏手柄&#xff09;&#xff0c;当然也要凑一凑热闹。 交叉编…

SpringBootTest

SpringBootTest注解 --基于SpringBoot2.5.7版本 可以在运行基于Spring Boot的测试的测试类上指定的注释。在常规的Spring TestContext框架之上提供了以下特性: 默认提供SpringBootContextLoader作为ContextLoader&#xff0c;也通过 ContextConfiguration(loader…)来自定义 若…

docker安装zookeeper(单机版)

第一步&#xff1a;拉取镜像 docker pull zookeeper第二步&#xff1a;启动zookeeper docker run -d -e TZ"Asia/Shanghai" -p 2181:2181 -v /home/sunyuhua/docker/zookeeper:/data --name zookeeper --restart always zookeeper

基于改进莱维飞行和混沌映射的粒子群优化BP神经网络预测股票价格研究(Matlab代码实现)

&#x1f4a5;&#x1f4a5;&#x1f49e;&#x1f49e;欢迎来到本博客❤️❤️&#x1f4a5;&#x1f4a5; &#x1f3c6;博主优势&#xff1a;&#x1f31e;&#x1f31e;&#x1f31e;博客内容尽量做到思维缜密&#xff0c;逻辑清晰&#xff0c;为了方便读者。 ⛳️座右铭&a…

1990-2022年上市公司常用控制变量数据(1300+变量)

1990-2022年上市公司常用控制变量数据&#xff08;1300变量&#xff09; 1、时间&#xff1a;1990-2022年 2、指标&#xff1a;共计1391个变量&#xff0c;包括但不限于以下类别&#xff1a;、基本信息&#xff08;性质、行业、地址&#xff09;、股票市场&#xff08;发行、…

阿里云无影云电脑详细介绍_无影优势价格和使用

什么是阿里云无影云电脑&#xff1f;无影云电脑&#xff08;原云桌面&#xff09;是一种快速构建、高效管理桌面办公环境&#xff0c;无影云电脑可用于远程办公、多分支机构、安全OA、短期使用、专业制图等使用场景&#xff0c;阿里云百科分享无影云桌面的详细介绍、租用价格、…