当前位置:网站首页>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 .
边栏推荐
猜你喜欢
Ram block memory generator of vivado IP core
FIR滤波器设计(1)——利用matlab的fdatool工具箱设计FIR滤波器参数
Network Security Learning (II)
注解(Annotation)
MerkleTree 构建QT实现UI
2022年的软件测试的岗位要求为何越来越高?这其中有什么不可告人的秘密吗?
day04_ array
Thinking about MySQL taking shell through OS shell
虹科为您分享EtherCAT demo,教您如何从其他协议快速过渡到EtherCAT工业总线
day15_泛型
随机推荐
Vivado IP核之浮点数加减法 Floating-point
右值引用和移动构造
三、广域通信网
多线程服务器编程
六、 网络互联与互联网
虹科为您分享EtherCAT demo,教您如何从其他协议快速过渡到EtherCAT工业总线
Leetcode刷题记录
Vivado IP核之浮点数开方 Floating-point
day16-集合上
案例补充、ATM
Thinking about MySQL taking shell through OS shell
Merkletree builds QT implementation UI
9、 Networking technology
Six common ways for hackers to attack servers
day04_ array
七、 下一代互联网IPV6
How to judge whether a business is attacked by DDoS? What harm will it cause?
Idea installing Scala
Several misunderstandings about DDoS
2022年的软件测试的岗位要求为何越来越高?这其中有什么不可告人的秘密吗?