当前位置:网站首页>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 .
边栏推荐
- Actual combat of microservices | discovery and invocation of original ecosystem implementation services
- Who is better for Beijing software development? How to find someone to develop system software
- How to choose between efficiency and correctness of these three implementation methods of distributed locks?
- Read 30 minutes before going to bed every day_ day3_ Files
- Timed thread pool implements request merging
- kinect dk 获取CV::Mat格式的彩色RGB图像(openpose中使用)
- 企业级SaaS CRM实现
- 道阻且长,行则将至
- Chrome video download Plug-in – video downloader for Chrome
- Double non undergraduate students enter the factory, while I am still quietly climbing trees at the bottom (Part 1)
猜你喜欢
并网逆变器PI控制(并网模式)
逆变器simulink模型——处理器在环测试(PIL)
hystrix 实现请求合并
企业级SaaS CRM实现
Typora安装包分享
Navicat remote connection MySQL reports an error 1045 - access denied for user 'root' @ '222.173.220.236' (using password: yes)
JDBC回顾
Chrome browser tag management plug-in – onetab
c语言编程题
每天睡前30分钟阅读Day6_Day6_Date_Calendar_LocalDate_TimeStamp_LocalTime
随机推荐
BugkuCTF-web16(备份是个好习惯)
Watermelon book -- Chapter 6 Support vector machine (SVM)
Hystrix implements request consolidation
College Students' CET-4 and CET-6 composition template (self created version, successfully crossed CET-6)
C语言之二进制与十进制
并网逆变器PI控制(并网模式)
Activity的创建和跳转
保存视频 opencv::VideoWriter
The channel cannot be viewed when the queue manager is running
JDBC回顾
微服务实战|Eureka注册中心及集群搭建
微服务实战|熔断器Hystrix初体验
Mysql默认事务隔离级别及行锁
Methods of classfile
微服务实战|声明式服务调用OpenFeign实践
Idea view bytecode configuration
Required request body is missing:(跨域问题)
Creation and jump of activity
C语言之数据插入
互联网API接口幂等设计