当前位置:网站首页>Hongke automation SoftPLC | Hongke kPa modk operation environment and construction steps (3) -- modk routine test
Hongke automation SoftPLC | Hongke kPa modk operation environment and construction steps (3) -- modk routine test
2022-07-29 06:40:00 【Hongke Industrial Communication Division】
This series of articles aims to help readers understand Hongke KPA Automation A brief understanding of the system , And can use MoDK Carry out quick hands-on operation , Include : Siphonaceae KPA
Automation、 Siphonaceae KPA MoDK brief introduction , Siphonaceae KPA MoDK Build the running environment and routine test . Hongke built in this document KPA
MoDK Running environment , Is based on Win10, And it is based on C/C++ For developing languages . If you have any questions , Welcome to comment on 、 Private letter or contact [email protected], Hongke engineers will give you professional answers .
Siphonaceae KPA Automation It is an automation solution development platform , Suitable for factory automation and process control applications . After the previous introduction and the construction of the operating environment , This part will test some official routines , Include EtherCAT From station ( combination MDK)、Vrep Robot simulation platform 、Simulation( Pure text simulation ).
This tweet will show the testing of some official routines . The following routines correspond to MoDK Controllable 3 Class object :EtherCAT From station ( combination MDK)、Vrep Robot simulation platform 、Simulation( Pure text simulation ). The last routine passes Motion Configuration Utility Settings in , The actual motor and Vrep Simultaneity control of simulation robot in .
1. Move_relative (EtherCAT & CiA402)
The test effect of this routine is to control a physical motor shaft 3 Related sports , We need an external EtherCAT Observe the phenomenon of slave servo and motor , In my testing environment , The choice is maxsine Servo of .

The steps of routine test are as follows :
① In Hongke KPA Studio Network configuration in
Open Hongke KPA Studio, Import maxsine servo ESI file . Danghongke KPA MRT After installation , Can be used as local EtherCAT Master And Studio Connect . take maxsine Servo drag to Master The location of , That is, the slave station is mounted , Also completed the network configuration .
② Configure the shaft , And export the configuration file
The next in Motion Configuration Utility Dock the shaft with the servo motor , And export the network configuration and axis configuration files , Then bind the motor shaft to the servo , And export relevant files .
③ Modify some parameters of the program source code
The routine reads the network configuration file and the axis configuration file MoDK Initialization of running environment , The read file name is set by macro . You can adapt the file name by modifying the macro . in addition , We still need to revise it ecatm Siphonaceae KPA15_helper.c The selected network card number in , Make local Master It can control the slave servo through the correct network card .
After the above configuration is completed , Click on “ctrl+F5”, You can run the program to observe the phenomenon .
2. Move_path (Vrep)
This routine not only embodies Hongke KPA MoDK Another kind of controlled object (Vrep), It also reflects another initialization method of shaft instances —— Source code configuration , That is, to modify the axis configuration parameters by adding the source code directly to the program . Compared with “ Interface configuration + Source code import ” Environment initialization method , This configuration method will undoubtedly be more cumbersome , And it will increase the amount of source code . But after this part of the code is completed , The steps of modifying the axis configuration parameters again can be carried out directly in the code , The other way of environment initialization still needs to be reconfigured ini file .
The steps of routine test are as follows :
① stay VREP Open the official three-axis linear robot model
Siphonaceae MoDK Provides a Vrep Three axis linear robot model , In the development package samples Under the folder , install Vrep after , Double click on Vrep Open the model in
② Modify... In the code VREP Port parameters for
Siphonaceae MoDK Provided Vrep Model USES 3.04.00 Version of Vrep Development , And currently downloaded on the official website Vrep The version has arrived 3.5.0. However, this does not require users to perform too many adaptation operations , The new version of the vrep Will be downward compatible with older versions vrep Model of .
③ Observe the control phenomenon
After the modification is completed , Routine tests can be carried out , Click on ctrl+F5, Switch to VREP window , It can be observed that the end of the robot moves according to the predetermined trajectory points . Users can also use their own algorithm to generate the required trajectory here demo Intermediate testing
3.Simulation_move_absolute (Simulation)
This routine is pure text emulation , There is no need for additional operations .MoDK In Hongke KPA The virtual axis handle is created in the running environment ,simulation That is, these virtual axis handles are virtualized , Reflected in the position of each axis read 、 The speed value changes .
Switch startup items , Press down ctrl+F5, You can start the simulation .
4. Move_complex_drawing (EtherCAT & CiA402 + Vrep)
For three controllable controlled objects , Siphonaceae MoDK You can control any two of them at the same time , Select EtherCAT Servo motor +Vrep The robot model is tested by two more intuitive controlled objects . The objects of test control are three maxsine Of EtherCAT Servo motor , add Vrep Three axis linear robot model in .
The steps of routine test are as follows :
① In Hongke KPA Studio Network configuration in
The operation of this part is the same as that of 1 Routine Move_relative (EtherCAT & CiA402) The operation is basically the same , Refer to the above .
② open Vrep Three axis linear robot model in , And connect the shaft with the servo motor
Notice the name of the linear robot model here , We will use . And notice , Robotic axis1 Use y Axis coordinates represent ,axis2 Use x Axis coordinates represent . The logic of the code is based on x、y The order of scanning . Therefore, when initializing the configuration, you need to pay attention to the number designation of the shaft , About to number 1(x Axis ) Assign to axis2, Number 2(y Axis ) Assign to axis1.
③ modify V-REP Parameters and general parameters , And clone the motor shaft
Change the parameter to the required parameter , Clone the motor shaft after completing the motor shaft parameter configuration , Then just bind the servo for the cloned motor axis 、 Set up Vrep Axis number of robot model 、 modify Vrep Port number is enough .
export file , Press... After modifying some parameters of the source code “ctrl+F5”, You can see the control phenomenon :Vrep The robot model in carries out circular motion ,EtherCAT The servo also drives the motor to move .

summary
- Observe MoDK Routine code , It can be found that its programming follows a relatively regular three-step pattern : Declare variables → Create examples → Function call , The axis control cycle is realized by state machine . But this PLC Although the way of programming is relatively clear , But the amount of code looks quite large , Maintainability is relatively poor .
- thus MoDK The best way to use , Still combined with Hongke Straton Use PLC Language development . Siphonaceae Straton Have an independent variable editor , also PLC Function block creation and invocation are integrated , It can greatly reduce the workload of development , The maintenance of the program has also become intuitive and simple .
Due to space limitation , Routine test examples failed to expand in detail . If you have any questions , Welcome to email [email protected] Contact our technical engineer .
边栏推荐
- 多路IO用法
- Redshift restore SP effect - SP map export settings and map import configuration
- Vivado IP核之浮点数乘除法 Floating-point
- 八、 网络安全
- The difference between DDoS attack and CC attack
- day15_泛型
- 三、广域通信网
- day09_ Static & Final & code block & abstract class & Interface & internal class
- 通过os-shell引发的mysql拿shell的思考
- Complex floating point division of vivado IP core floating point
猜你喜欢

基于udp通信的在线多人聊天室

day04_ array

虹科分享 | 为什么说EtherCAT是提高控制系统性能的最佳解决方案?

day15_ generic paradigm

day14_单元测试&日期常用类&字符串常用类

3、 Wide area communication network

On defect description style

2022 summer second day information competition learning achievement sharing 2
![Summary of winter vacation training (1.23~1.28) [first tier]](/img/cf/2f86ecc23bfe6d96ad0429c785663a.png)
Summary of winter vacation training (1.23~1.28) [first tier]

day03_1_流程控制
随机推荐
Clickhouse failed to import CSV without error but no data
The difference between DDoS attack and CC attack
多路IO用法
Vivado IP核之RAM Block Memery Generator
The performance and viewing methods of websites attacked by DDoS
超低成本DDoS攻击来袭,看WAF如何绝地防护
Common server faults and their solutions
Arrays & object & System & Math & random & Packaging
Vivado IP核之浮点数乘除法 Floating-point
Floating point square root of vivado IP core floating point
一文看懂网络安全五年之巨变
五、 无线通信网
Understand the great changes of network security in five years
【面试题】2022年最新软件测试面试题(400道)【附带答案】持续更新...
FIR滤波器设计(1)——利用matlab的fdatool工具箱设计FIR滤波器参数
Vivado IP核之浮点数加减法 Floating-point
Idea practical shortcut key novice must see
IGMP protocol software development experiment
Circular linked list and bidirectional linked list
Vivado IP核之定点数转为浮点数Floating-point