MATLAB:电机控制(Motor Control)

这篇具有很好参考价值的文章主要介绍了MATLAB:电机控制(Motor Control)。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

前言

        花了好大心血完成了一份留学作业系列——1:电机控制设计;供大家参考,文末有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.
matlab电机控制,MATLAB,matlab,电机控制,PID
                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).

matlab电机控制,MATLAB,matlab,电机控制,PID

                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.
matlab电机控制,MATLAB,matlab,电机控制,PID

  • 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
matlab电机控制,MATLAB,matlab,电机控制,PID

  • 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).
matlab电机控制,MATLAB,matlab,电机控制,PID

  • Fig.4 (a) Block diagram for a motor
    matlab电机控制,MATLAB,matlab,电机控制,PID
  • 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.

matlab电机控制,MATLAB,matlab,电机控制,PID

  • 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:
matlab电机控制,MATLAB,matlab,电机控制,PID

matlab电机控制,MATLAB,matlab,电机控制,PID
matlab电机控制,MATLAB,matlab,电机控制,PID
        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.
matlab电机控制,MATLAB,matlab,电机控制,PID
        After open Model Linearizer the window below is popped up for you to run Bode plot.
matlab电机控制,MATLAB,matlab,电机控制,PID
        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.
matlab电机控制,MATLAB,matlab,电机控制,PID

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

matlab电机控制,MATLAB,matlab,电机控制,PID

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.
matlab电机控制,MATLAB,matlab,电机控制,PID

  • 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.
matlab电机控制,MATLAB,matlab,电机控制,PID

  • 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.
matlab电机控制,MATLAB,matlab,电机控制,PID
        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.
matlab电机控制,MATLAB,matlab,电机控制,PID

  • Eq.(2.4)
    matlab电机控制,MATLAB,matlab,电机控制,PID
  • 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 .
    matlab电机控制,MATLAB,matlab,电机控制,PID
  • 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
matlab电机控制,MATLAB,matlab,电机控制,PID
Eq.2
matlab电机控制,MATLAB,matlab,电机控制,PID

Eq.3
matlab电机控制,MATLAB,matlab,电机控制,PID
        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.
matlab电机控制,MATLAB,matlab,电机控制,PID

  • 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?
matlab电机控制,MATLAB,matlab,电机控制,PID

        As can be seen from the figure window, the response speed of the system is slowed down after the limiter is added.
matlab电机控制,MATLAB,matlab,电机控制,PID

  • 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.
matlab电机控制,MATLAB,matlab,电机控制,PID

  • Fig.12 Schematic diagram of current and speed control of DC motor with DC buck converter
    matlab电机控制,MATLAB,matlab,电机控制,PID

matlab电机控制,MATLAB,matlab,电机控制,PID
        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.
matlab电机控制,MATLAB,matlab,电机控制,PID
        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.
matlab电机控制,MATLAB,matlab,电机控制,PID
matlab电机控制,MATLAB,matlab,电机控制,PID
         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为过程程序供大家参考。
matlab电机控制,MATLAB,matlab,电机控制,PID

matlab电机控制,MATLAB,matlab,电机控制,PID文章来源地址https://www.toymoban.com/news/detail-733116.html

到了这里,关于MATLAB:电机控制(Motor Control)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • PID控制参数整定(调节方法)原理+图示+MATLAB调试

    原文链接:https://blog.csdn.net/viafcccy/article/details/107988093 首先最重要的是了解每个参数调节了系统响应的那些属性,通过观察响应从而调节参数改变属性。 PID的作用概述: 1、P产生响应速度和力度,过小响应慢,过大会产生振荡,是I和D的基础。 2、I在有系统误差和外力作用时

    2024年02月03日
    浏览(39)
  • 毕业设计-基于 PID 控制算法仿真算法研究- Matlab

    目录 前言 课题背景和意义 实现技术思路 一、 基本原理  二、无超调 PID 控制器的设计 三、无超调 PID 设计的验证 代码 实现效果图样例 最后     📅大四是整个大学期间最忙碌的时光,一边要忙着备考或实习为毕业后面临的就业升学做准备,一边要为毕业设计耗费大量精力。

    2024年02月06日
    浏览(56)
  • 基于Matlab自抗扰控制器及其PID控制(附上完整源码+数据)

    自抗扰控制器(Active Disturbance Rejection Control, ADRC)是一种新型的控制策略,它具有强大的抗干扰能力和良好的控制性能。与传统的PID控制器相比,ADRC能够更好地抑制系统的干扰,提高控制系统的稳定性和鲁棒性。 在ADRC中,核心思想是引入一个扰动观测器(Disturbance Observer,

    2024年02月16日
    浏览(51)
  • 浅谈BP神经网络PID控制算法及matlab仿真

    本文是对BP神经网络PID控制算法的数学描述及仿真实验,若有错误之处,欢迎指正! 老规矩不废话,直接上链接 BP神经网络维基百科 BP神经网络是人工神经网络中的一种常用结构,其由输入层(input)-隐含层(hidding)-输出层三层构成(output)。 上图中, B 1 B1 B 1 是输入层, B 2 B2 B

    2024年02月05日
    浏览(40)
  • Matlab实现PID控制仿真(附上30个完整仿真源码+数据)

    本文介绍了如何使用Matlab实现PID控制器的仿真。首先,我们将简要介绍PID控制器的原理和控制算法。然后,我们将使用Matlab编写一个简单的PID控制器,并使用仿真环境来验证其性能。最后,我们将通过调整PID控制器的参数来优化控制系统的响应。 PID控制器是一种经典的控制算

    2024年02月07日
    浏览(83)
  • MATLAB EXPO 2023会议记录|基于STM32的MATLAB电机控制方案

       算法导出工作流视频:(99+ 封私信 / 82 条消息) Simulink 算法导出工作流 —— stm32电机控制示例(v2) - 知乎 (zhihu.com) Algorithm-Export Workflows for Custom Hardware 示例: Algorithm-Export Workflows for Custom Hardware - MATLAB Simulink Example (mathworks.com)    Open-Loop Control and ADC Offset Calibration - MATLAB Si

    2024年02月07日
    浏览(46)
  • 反激式开关电源输出电压的PID控制之MATLAB仿真

    反激 是开关电源中最常见的电路之一。像手机充电器、笔记本电脑的电源适配器,电动车充电器大都采用该电路。基本作用就是将高压直流将至低压直流。 反激电路的特点表现在结构简单,体积小。缺点是输出功率很难做到很大,一般只适用于150W以下的情况。 其基本电路如

    2024年01月17日
    浏览(42)
  • 双容水箱液位模糊PID控制系统设计与仿真(Matlab/Simulink)

    前些天发现了十分不错的人工智能学习网站,通俗易懂,风趣幽默,没有广告,分享给大家,大家可以自行看看。(点击跳转人工智能学习资料) 微信公众号:创享日记 发送:双容模糊 获取完整无水印报告+仿真源文件+相关文献 双容水箱液位控制系统的设计与仿真 1、基于

    2024年02月07日
    浏览(53)
  • 增强型PID-自适应-前馈-神经网络控制研究(Matlab代码实现)

    💥💥💞💞 欢迎来到本博客 ❤️❤️💥💥 🏆博主优势: 🌞🌞🌞 博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。 ⛳️ 座右铭: 行百里者,半于九十。 📋📋📋 本文目录如下: 🎁🎁🎁 目录 💥1 概述 📚2 运行结果 2.1 RBFNN_Optimized_hideen_node_20 ​2.2 RBFNN_Lat

    2024年02月01日
    浏览(54)
  • 【GUI】使用PID控制器进行台式过程控制实验,以保持热敏电阻的温度(Matlab代码实现)

    目录 💥1 概述 📚2 运行结果 🎉3 参考文献 🌈4 Matlab代码、操作说明 本实验是温度控制的反馈控制应用。特别是,本实验讲解: 手动和自动控制的区别 生成动态数据的 步进测试 拟合动态数据以构建简单的一阶加死区时间 (FOPDT) 模型 从标准调整规则 获取 PID 控制的 参数

    2024年02月15日
    浏览(50)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包