1. Introduction to programming framework
The programming framework is a general framework for chasing and shearing applications. The functions of each part have been fully written. Users only need to modify the relevant processing parameter values based on this framework. After connecting to a touch screen, the parameters can be modified on the touch screen interface. It is simple and convenient to use.
The software framework contains two types of files, basic and HMI mixed program files written by the positive motion programming software ZDevelop, and touch screen files written by the Weintron programming software EasyBuilder Pro.
This system has two modes: hardware platform operation and software platform simulation, which can be customized on the touch screen.
In situations where there is no control system such as a controller or drive, it can be run on a simulation platform, allowing users to quickly get started.
There are two touch screen options: Weiluntong touch screen and ZHD touch screen. Even without a physical screen, simulation can be run on these two platforms.
2. Chasing shearing instruction
The shearing motion requires two axes. The main axis is axis 6, which is generally an encoder axis used to transport workpieces. The VMOVE instruction is used to control the main axis to run at a constant speed. The slave axis is axis 0. In the shearing motion, the slave axis follows the main axis. The slave axis uses the MOVESLINK automatic cam instruction to control the variable speed motion.
MOVESLINK -- Auto Cam 2
This instruction is used for custom cam motion, which automatically plans the intermediate curve without calculating the cam table.
The connected axis is the reference axis and the connected axis is the following axis.
MOVESLINK (distance,link dist,start sp,end sp,link axis[,link options][,ink pos][,link offpos])
[, link options] [, link pos] When optional parameters are not filled in, the comma cannot be omitted. The controller determines what parameter it is based on the position of the parameter.
Distance: The distance the following axis moves from the beginning to the end of the connection. This parameter can be positive or negative. A positive number means the axis follows in the positive direction, while a negative number means the axis follows in the negative direction. The parameter is in units.
link dist: The absolute distance the reference axis moves during the entire connection process, in units
start sp: The speed ratio of the following axis and the reference axis at startup, in units/units. A negative number indicates negative movement of the following axis.
end sp: The speed ratio of the following axis and the reference axis at the end, in units/units. Negative numbers indicate negative movement of the following axis. Note: When start sp = end sp = distance/link dist, the motion is uniform.
link axis: the axis number of the reference axis
link options: connection mode options, different binary bits represent different meanings
link pos: When the link options parameter is set to 2, this parameter indicates that the link starts at this absolute position of the reference axis.
Link offpos: When the link_options parameter bit4 is set to 1, this parameter indicates the relative position of the spindle after it has run. Supported by firmware 20170428 and above.
In order to match the speed during the acceleration and deceleration phases, the start sp of the next MOVESLINK must be the same as the end sp of the current MOVESLINK.
Please make sure that the distance parameter *units passed by the command is an integer number of pulses, otherwise floating point numbers will cause slight errors in the movement.
Example: During the shearing process, the reference axis (spindle axis 1) is the profile, and the worktable (slave axis 0) is the following axis. In one processing cycle, the worktable first moves a distance of 1, then moves in the opposite direction for 1, and returns to the original position. During the whole process, the profile moves a distance of 4.
RAPIDSTOP(2)
WAIT IDLE(0)
WAIT IDLE(1)
BASE(0,1)
UNITS=10000,10000
ATYPE=1,1
DPOS=0,0
SPEED=1,1 'profile running speed 1m/s, 60m/min
ACCEL=2,2
DECEL=2,2
VMOVE(1) AXIS(1) 'Continuous movement of profile
TRIGGER 'Automatically trigger the oscilloscope
MOVESLINK(0,1,0,0,1) AXIS(0) 'Before the profile moves 1 unit, the workbench is stationary
MOVESLINK(0.4,0.8,0,1,1) AXIS(0) 'In the stage of workbench acceleration, the workbench moves 0.4 and the profile moves 0.8. During acceleration, the speed of the following axis is 0, so the speed ratio of the following axis and the reference axis is 0. After acceleration, the speed of the following axis and the reference axis is equal, and the ratio is 1.
MOVESLINK(0.2,0.2,1,1,1) AXIS(0) 'Speed following stage, the speed is consistent, keep synchronous motion 0.2
MOVESLINK(0.4,0.8,1,0,1) AXIS(0) 'In the stage of table deceleration, the table moves 0.4 and the profile moves 0.8. During deceleration, the speed of the following axis and the reference axis are equal, and the ratio is 1. After deceleration, the speed of the following axis is 0, so the speed ratio of the following axis and the reference axis is 0.
MOVESLINK(-1,1.2,0,0,1) AXIS(0) 'The workbench returns to the starting point, the workbench moves -1, and the profile moves 1.2
END
Speed and position curves of master axis 1 and slave axis 0:
3. Program Structure
The main program of the controller is written in Basic language, and the HMI program is a ZHD touch screen program.
(I) View Window
1. File view: Contains four files, two automatically run tasks, and other tasks started by commands.
2. Process view: Each file contains SUB sub-functions, among which GLOBAL is a global sub-function that can be called by HMI components.
3. Configuration view: configuration window and components under each configuration window
(II) Task Allocation
The project contains a total of 4 tasks, three Basic tasks and one HMI task.
Task0: Main task
It is started by automatic operation task number 0, and the file "TaskMain.bas" is automatically run after power is turned on to perform parameter definition, axis parameter initialization, main program cyclic scanning, etc.
Task 1: Manual task
Started by the main loop of main task 0, task 1 runs the "TaskHands.bas" manual file task.
This file contains a while statement, which is automatically turned on initially, and the subsequent loop detects whether the triggering conditions for manual movement are met and executes manual movement.
The functions include JOG manual, MOVE inch movement and inch movement distance setting, axis return to zero, and storage of user parameters and mechanical parameters in FLASH block.
Task 2: Automatic task
Started by the main loop of main task 0, task 2 runs the "TaskAutoRun.bas" automatic processing file task.
This file executes the chasing shearing processing in a loop. The chasing shearing parameters can adopt the parameters set during the initialization process. The user can also customize the chasing shearing parameters on the touch screen interface. After each processing, the output is automatically increased by 1 and displayed on the touch screen.
Before executing automatic machining task 2, all basic tasks except the main task will be stopped, all axes will be stopped quickly, and then the machining program will be executed.
If the "Stop" button is pressed when Task 2 is automatically started, Task 2 will end and switch to Manual Task 1.
Task 5: Functional reservation
It is started by the automatic operation task number 5, and the file "Hmi1.hmi" is automatically run when powered on. This task is a ZHD touch screen program, which can be downloaded to the controller and connected to the ZHD touch screen for control, or connected to the xplc screen touch screen simulation platform.
If you use the Weiluntong configuration program, this file will not run. Remove the automatic run task number or delete this hmi file.
The calling relationship between the framework's tasks and subroutines:
4. Register Usage
The MODBUS register is mainly used. MODBUS_IEEE is used for data storage and transmission. The touch screen component calls the MODBUS_IEEE address to display the value of the register. MODBUS_BIT is used for function control and is used in conjunction with the function keys or bit components of the touch screen.
The VR register saves data in conjunction with the power-off interrupt, and reads from the VR when power is on.
VR_INT(30): Saves the production.
VR(35): Saves the target position DPOS(0) of the slave axis (shear axis 0).
FLASH block is used to save mechanical parameters and user parameters.
FLASH block 0: storage of mechanical parameters
FLASH block 1: store user parameters
5. Program operation instructions
1. Controller Platform
The general process of connecting the controller to the touch screen:
The program on the controller side is written using ZDevelop software and downloaded to the controller.
The program on the touch screen is written using the corresponding programming software and then downloaded to the touch screen for storage.
After the program is downloaded, select the serial port or network port to connect the touch screen and the controller for offline operation.
1. Wiring: Connect the controller, driver, touch screen, etc. as required.
2. Download the controller program: Open the zpj project program in the ZDevelop software, connect to the controller first, and download the program to the controller.
3. Download the touch screen program:
If you use a ZHD touch screen, directly download the basic and hmi files under the above zpj to the controller, and then use the ZHD400X touch screen to connect to the controller network port. After the operation is successfully connected, it can be used without downloading the program to the touch screen separately. For detailed usage methods, please refer to the article "Introduction to ZHMI Configuration Programming of ZHMI Controllers" in the Positive Motion Assistant.
Previous article:EtherCAT motion control card hardware wiring and C# single-axis motion control
Next article:VPLC Series Machine Vision Motion Control All-in-One Quick Start (V)
- Popular Resources
- Popular amplifiers
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- 【AT-START-F403A Review】3. Porting RTX operating system
- Problem with itoa function in embedded C language?
- HFSS simulation software field strength pattern and 3D diagram
- Contract issues
- Industrial 4-20mA Circuit
- c# System.Object class and safe transformation of data
- Please reinstate the invitation of 8 people, please, I beg you, I thought I would never give any suggestions again, I beg the maintenance staff on behalf of my boss
- Embedded software squeezes out the lowest power mode
- Sharing of experience in single board circuit design (2) -- Power socket selection
- 4-20mA current output design