当前位置:网站首页>Inverter Simulink model -- processor in the loop test (PIL)
Inverter Simulink model -- processor in the loop test (PIL)
2022-07-02 09:38:00 【Quikk】
List of articles
inverter simulink Model —— Processor in the loop test (PIL)
1 Basic idea of processor in the loop testing
1.1 Basic introduction of simulation model
During the simulation of normal power electronic system , The structure is mainly divided into main circuit + Control circuit ; The control circuit is generally divided into acquisition circuit and control core .

Take the inverter control system as an example :
DC side voltage source , Three phase inverter unit , filter , The load belongs to the main circuit ;
take 220V The voltage level is converted to the control unit ADC Collectable 0-3.3V Low voltage conditioning circuit is called acquisition circuit ;
take 0-3.3V pulse PWM The signal is converted to IGBT Driving signal (0-24V) The driving circuit of ;
The control core is generally composed of system on chip , Such as STM32、2833X And other basic computing cores ;
Next, let's introduce the basic principle of simulation , Whether the control circuit or the main circuit is simulink in They are all obtained by numerical calculation . And in the actual system : The main circuit is a real circuit , The control circuit is generally 10k,50k And other fixed frequency control units . In order to realize the simulation of this situation , It is necessary to minimize the calculation step of the main circuit , In order to achieve the purpose of simulating continuous system , And the control system must maintain Normal sampling frequency . Take a particle : If take Slover In steps of 10e-7; Then the external main circuit is represented by 10e-7 The step size is calculated once ; The control unit is 10e-4(10k); You need to 1000 An external step is calculated once for the internal element .
1.2 Processor in the loop test concept
In the actual simulation process , A large number of controllers and external main circuits are PC Terminal CPU To do the operation on . But the actual situation is that the dominant frequency of microprocessors is often much lower than that of computers CPU, The output results may be different from the real situation . However, it often needs lot of time , So you can build ** Processor in loop (PIL)** The test plan of the bottom layer MCU Analyze the operation .
Processor in the loop test , It is to calculate the main circuit in CPU On the implementation , The control circuit operation will be at the bottom MCU On the implementation . The basic process is :
PIL After starting ,MCU Received by PC All kinds of data transmitted ;
MCU Calculate according to the data to get PWM Output the signal and transmit it to PC End ;
PC Termination received PWM After the signal , Apply it to the main circuit , The state of the main circuit changes , Continue to repeat the second step (1) Step
The specific implementation of this scheme will be introduced below ;
2 Processor in the loop test process
2.1 Test model introduction
The test model uses the off grid inverter control model ; Model links : Model links
The output voltage waveform under the normal off grid state is shown in the figure ,0.1s Turn on the load supply switch ;0.8s Perform power step ;

2.2 Introduction to basic structure
PIL The system composition needs to ensure the system connection :1) Bottom hardware download port and matlab Keep connected 2) Bottom hardware serial port and matlab Keep connected ; Build the hardware platform shown in the figure below

2.3 Model settings
The model needs to be configured before setting MCU Code generation environment , Please refer to : Environment building
1) Create a processor in the loop model








notes : Make sure that COM9, Baud rate , Etc , Ensure smooth communication , Prevent in ring test failure .
2.4 In loop test module generation
Package the control module into subsystems , Post generation PIL modular ; At this time, we need to slover step and Powergui Step size of It's also set to 10e-4; And set up Initial communication status , Enter the following code on the command line and execute , Be sure to pay attention to The serial port information corresponds to the information in the device management ;
setpref('MathWorks_Embedded_IDE_Link_PIL_Preferences','COMPort','COM9');
setpref('MathWorks_Embedded_IDE_Link_PIL_Preferences','BaudRate',115200);
setpref('MathWorks_Embedded_IDE_Link_PIL_Preferences','enableserial',true);

Pop up the dialog box and click build that will do ( We need to pay attention to ,MCU It can only run Single Type variable , The variables in the control module need to be changed to single type ):

Pop up the generated PIL Model , Copy the model to the original file .

2.5 Model test

Get into SIL/PIL manager

Modify the simulation step size to 10e-6;

Set up PIL Parameters :

Click on run Verification
3 test result

After the test, get the above results , The result is divided into a software simulation result , One PIL In loop test results . At this point, you can compare the differences . compare You can also compare the differences between the two under the column .
Hardware :dsp28335
PC:simulink r2019b
Use serial port SCIA communicate
simulation model , I need to take it myself :PIL In loop model
The above process effectively realizes PIL test , The specific steps are generally shown in the figure , It should be noted that the generation PIL The test module must modify the model step size ( Change to controller execution step ). When testing , Be sure to change back to the original step .
边栏推荐
- Solution to amq4036 error in remote connection to IBM MQ
- Watermelon book -- Chapter 6 Support vector machine (SVM)
- 每天睡前30分钟阅读Day5_Map中全部Key值,全部Value值获取方式
- Microservice practice | Eureka registration center and cluster construction
- MySQL multi column in operation
- int与string、int与QString互转
- MySQL error: unblock with mysqladmin flush hosts
- Solutions to Chinese garbled code in CMD window
- 在SQL注入中,为什么union联合查询,id必须等于0
- Bold prediction: it will become the core player of 5g
猜你喜欢

图像识别-数据增广

Typeerror: X () got multiple values for argument 'y‘

Matplotlib swordsman - a stylist who can draw without tools and code

QT QLabel样式设置

MySQL default transaction isolation level and row lock

保存视频 opencv::VideoWriter

Chrome浏览器插件-Fatkun安装和介绍

Idea view bytecode configuration

Insight into cloud native | microservices and microservice architecture

2837xd 代码生成——总结篇
随机推荐
Pool de connexion redis personnalisé
自定義Redis連接池
Customize redis connection pool
Demand delineation executive summary
Fragmenttabhost implements the interface of housing loan calculator
Knowledge points are very detailed (code is annotated) number structure (C language) -- Chapter 3, stack and queue
Who is better for Beijing software development? How to find someone to develop system software
洞见云原生|微服务及微服务架构浅析
微服务实战|熔断器Hystrix初体验
微服务实战|微服务网关Zuul入门与实战
Enterprise level SaaS CRM implementation
Typeerror: X () got multiple values for argument 'y‘
大学生四六级作文模板(自创版,成功跨过六级)
A detailed explanation takes you to reproduce the statistical learning method again -- Chapter 2, perceptron model
互联网API接口幂等设计
JDBC review
c语言编程题
Read 30 minutes before going to bed every day_ day3_ Files
View the port of the application published by was
Solution to amq4036 error in remote connection to IBM MQ