Matlab/Simulink simulation analysis of permanent magnet synchronous motor constant voltage-frequency ratio open-loop control system (Part 1)

Publisher:eta17Latest update time:2023-10-07 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Preface

This chapter uses a constant voltage-frequency ratio open-loop control method to drive the rotation of a permanent magnet synchronous motor. First, the control principle of the constant voltage-frequency ratio is analyzed, and then a simulation analysis of the constant voltage-frequency ratio open-loop control system of the permanent magnet synchronous motor is performed in Matlab/Simulink. Finally, the constant voltage-frequency ratio control algorithm generated code in Simulink is loaded into the actual project for engineering implementation.


1. Constant voltage-frequency ratio (V/F) control principle

picture

The constant voltage-frequency ratio control method of permanent magnet synchronous motor is similar to the constant voltage-frequency ratio control method of asynchronous motor, which also controls the motor input voltage and frequency to change simultaneously, so as to keep the air gap flux constant. This control method does not have the feedback of physical quantities such as motor current, voltage, position, etc., and has poor dynamic performance. It is easy to cause loss of step and oscillation when the given target speed changes or the load changes suddenly. However, this control method is simple and is mostly suitable for occasions where the speed accuracy requirement is not high.

The Matlab/Simulink simulation block diagram of the permanent magnet synchronous motor constant voltage-frequency ratio open-loop control system is as follows:

picture

2. Matlab/Simulink simulation analysis of permanent magnet synchronous motor constant voltage-frequency ratio open-loop control system

2.1. Simulation circuit analysis

2.1.1. Constant voltage-frequency ratio control algorithm

picture

Constant voltage-frequency ratio control algorithm: The conversion relationship between the speed and frequency of a permanent magnet synchronous motor is as follows:

picture

First, the motor target speed is converted to frequency using the above formula. Since the open-loop control system does not automatically limit the starting current, a ramp function is added to make the frequency change smoothly. For example, the target speed set in the simulation is 1200r/min, and the process of converting it to frequency is shown in the figure below:

picture

Then, the constant voltage-frequency ratio V/F control algorithm characteristics (as shown in the figure below) make the input voltage change synchronously with the frequency, so as to keep the air gap flux constant. At low frequencies, both Us and Eg are small, and the stator resistance and leakage inductance voltage drop account for a significant proportion and can no longer be ignored. At this time, the stator voltage is artificially raised to approximately compensate for the stator impedance voltage drop, as shown in line b of the figure below:

picture

From the above figure, we can see that the relationship between input voltage and frequency is (line b with low-frequency compensation, given (0, U0) (f1N, UsN)):

picture

Convert the frequency to voltage using the above formula, and calculate the rated frequency f1N (the relationship between the speed and frequency of a permanent magnet synchronous motor) from the rated speed of the motor. The constant voltage-frequency ratio control of the permanent magnet synchronous motor is speed regulation below the base frequency, and the maximum frequency of the system cannot exceed the rated frequency f1N. For example, the rated speed of the permanent magnet synchronous motor selected in the simulation is 12540r/min, and the calculated rated frequency f1N is 1463Hz, which is the maximum set frequency of the system.

The target speed is set to 1200r/min, the speed is converted to frequency, and then the change in input voltage is obtained from the change in frequency, as shown in the following figure:

picture

A normalization process is performed here, dividing the voltage change by the rated voltage of the motor so that the output voltage range falls within the [0,1] interval.

picture

Convert the frequency to angular velocity, and then integrate the angular velocity to get the current angle, as shown in the following figure:

picture

At this time, the input voltage amplitude Um and phase angle wt have been obtained, and then the voltage representation of the amplitude and phase angle is converted into the voltage representation in the two-phase αβ coordinate system by the following formula:

picture

The voltage in the αβ coordinate system is expressed as:

picture

Then, the inverse Clark transformation is used to obtain the final three-phase voltage input to the motor:

picture

2.1.2. Output processing

picture

The output voltage of the constant voltage-frequency ratio control algorithm is processed so that it falls within the range of [0,1]:

picture

2.1.3. Main circuit

picture

The main circuit includes an inverter circuit and a permanent magnet synchronous motor. The inverter circuit is shown in the figure below. The Average-Value Inverter module is used to directly generate a three-phase sinusoidal voltage. The figure below shows the voltage waveform input to the motor at a target speed of 1200r/min.

picture

picture

The permanent magnet synchronous motor uses a BR2804-1700 motor (the motor parameters are measured using ST Motor Proflier), the parameters are as follows:

picture

picture

2.2. Analysis of simulation results

2.2.1. Set the target speed to 1200r/min

Waveform curve of target speed and actual speed:

picture

In steady state, the error between the target speed and the actual speed is:

picture

In steady state, the motor stator current is:

picture

Motor rotor position:

picture

Stator current value in dq coordinate system:

picture

Electromagnetic torque:

picture

2.2.1. Set the target speed to a variable value

Target speed:

picture

Target speed and actual speed:

picture

It can be seen from the figure that there is a ramp time for motor acceleration and deceleration. The speed of motor acceleration and deceleration is related to the slope of the ramp function set when converting the speed to frequency in the constant voltage-frequency ratio control algorithm.

3. Code Generation and Engineering Implementation of Constant Voltage-Frequency Ratio Open-Loop Control System for Permanent Magnet Synchronous Motor

3.1. Functional requirements

Realize constant voltage-frequency ratio control of permanent magnet synchronous motor, and adjust the speed of permanent magnet synchronous motor by pressing buttons.

3.2 Hardware Design

picture

Control board: STM32F302R8

Driver board: X-NUCLEO-IHM07M1

Permanent magnet synchronous motor: BR2804-1700

picture

3.3. Software Design

3.3.1.STM32CubeMX bottom-level configuration

1. RCC settings external HSE (Crystal/Ceramic Resonator), clock set to 72MHz

2. PC10, PC11, and PC12 are set to push-pull output, no pull-up and pull-down resistors, and high speed, and the initialization state is set to 0; PB13 is set to push-pull output, pull-down resistor, high speed, and the initialization state is 0; PC13 is set to input, without pull-up and pull-down resistors.

3. Set the TIM1 clock source to the internal clock, TIM1_CH1 (PA8) to PWM output, TIM1_CH2 (PA9) to PWM output, and TIM1_CH3 (PA10) to PWM output; set the TIM1 prescaler value to 3-1, select the counting mode as central counting mode 1, and set ARR to 1200-1 (1/(1/(72000000/3))*1200=20KHz), and the internal clock has no frequency division; enable TIM1 update interrupt, and set the interrupt priority to (1,0)

4. USART2 is set to asynchronous, 115200 baud rate, 8 data bits, no parity bit, 1 stop bit

5. Project Manager->Project name+IDE configuration, Code Generator configuration, generate project code

picture

picture

picture

picture

3.3.2. Interface development between application layer and bottom layer

picture

Speed_Ref is used to set the target speed; Duty[3] is used to receive the three-phase voltage generated by the constant voltage-frequency ratio control algorithm. The three-phase voltage is used as the modulation wave, and the TIM1 counter (central counting mode) is used as the carrier. The frequency of 20KHz is consistent with the Simulink simulation design. The modulation wave and the carrier are modulated to generate PWM to control the drive output of the three-phase inverter circuit. Here, the SPWM control method is used for control; Vmin is used to set the compensation voltage value U0 in the constant voltage-frequency ratio control algorithm.

3.3.3.Matlab/Simulink Constant Voltage-Frequency Ratio Control Algorithm Code Generation

picture

picture

3.3.4. Code integration between application layer and underlying layer

Call in the main function: PMSM_VF_initialize() initialization function.

/**

* @brief The application entry point.

* @retval int

*/

int main(void)

{

/* USER CODE BEGIN 1 */

uint8_t count = 0;



/* USER CODE END 1 */



/* MCU Configuration------------------------------------------------- ----------*/



/* Reset of all peripherals, Initializes the Flash interface and the Systick. */

HAL_Init();



/* USER CODE BEGIN Init */



/* USER CODE END Init */



/* Configure the system clock */

SystemClock_Config();



/* USER CODE BEGIN SysInit */



/* USER CODE END SysInit */



/* Initialize all configured peripherals */

MX_GPIO_Init();

MX_TIM1_Init();

MX_USART2_UART_Init();

/* USER CODE BEGIN 2 */

PMSM_VF_initialize(); //Simulink initialization function



/* USER CODE END 2 */



/* Infinite loop */

/* USER CODE BEGIN WHILE */

while (1)

{

/* USER CODE END WHILE */



/* USER CODE BEGIN 3 */

if(Key_Scany(KEY_GPIO_Port,KEY_Pin)==1)

{

HAL_GPIO_WritePin(GPIOC, EN1_Pin|EN2_Pin|EN3_Pin, GPIO_PIN_SET); //Enable three-phase bridge arm


HAL_TIM_PWM_Start(&htim1,TIM_CHANNEL_1); //Enable three-channel PWM

HAL_TIM_PWM_Start(&htim1,TIM_CHANNEL_2);

HAL_TIM_PWM_Start(&htim1,TIM_CHANNEL_3);


__HAL_TIM_ENABLE_IT(&htim1,TIM_IT_UPDATE); //Enable TIM1 update interrupt

[1] [2]
Reference address:Matlab/Simulink simulation analysis of permanent magnet synchronous motor constant voltage-frequency ratio open-loop control system (Part 1)

Previous article:Matlab/Simulink simulation analysis of permanent magnet synchronous motor constant voltage-frequency ratio open-loop control system (Part 2)
Next article:How to correctly connect PLC to peripheral devices

Recommended ReadingLatest update time:2024-11-16 09:29

MATLAB strengthens academic research and provides unlimited expansion and collaboration opportunities in education
MathWorks announced expanded access to MATLAB Parallel Server to help accelerate academic research. Now, all researchers and students at academic institutions with a MathWorks Campus-Wide License that includes MATLAB Parallel Server have unlimited access to scale MATLAB programs and Simulink simulations to clusters an
[Internet of Things]
Sensorless control based on SMO + Matlab/Simulink simulation details
Preface This chapter uses the synovial film observer SMO to perform sensorless control of the permanent magnet synchronous motor. First, the principle of the state observer is introduced. Then, the principle of the synovial film observer is analyzed to design a traditional low-order synovial film observer. In v
[Embedded]
Sensorless control based on SMO + Matlab/Simulink simulation details
Simulink and the Development of Autonomous Driving (ADAS) Algorithms
What is the development architecture of autonomous driving? The basic architecture of autonomous driving software development cannot escape the three magic weapons we often talk about: perception --- decision-making (planning) --- execution (control). These three contents have different basic ideas for software
[Embedded]
Simulink and the Development of Autonomous Driving (ADAS) Algorithms
MathWorks announces 2024a releases of MATLAB and Simulink
MathWorks announces 2024a releases of MATLAB and Simulink Updated Satellite Communications Toolbox supports scenario modeling and analysis of communication systems and links Beijing, China, April 7, 2024 - MathWorks, the world's leading developer of mathematical computing software, today
[Network Communication]
MathWorks announces 2024a releases of MATLAB and Simulink
Freescale--Matlab image correction to estimate track length
Because of participating in the Freescale smart car competition, laying the track has become an important part. This time, the track was laid by splicing the track left over from the past, which made it difficult to calculate the length of the track. Therefore, the blogger and his friends came up with some ways to est
[Microcontroller]
Freescale--Matlab image correction to estimate track length
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号