Welcome Zmotion technical support -- EtherCAT Motion Control Edge Controller ZMC432H.
Before, we had learnt some:
EtherCAT motion control edge controller ZMC432H (1): ZMC432H Hardware Information
EtherCAT motion control edge controller ZMC432H (2): ZMC432H API Function Encapsulation
Then, today, let's see the sixth part, Python + Qt development of continuous trajectory processing, including how to download RTBasic file.
There are still several parts to describe it for you, and the content can be obtained through word introduction, image showing and video description.
Let's begin.
1. ZMC432H Hardware Brief Introduction
EtherCAT motion control edge controller ZMC432H supports self-researched and self-controlled software and hardware. And this EtherCAT edge controller is an independent multi-axis motion controller that is compatible with EtherCAT bus and pulse.
32 axes motion control can be achieved. At the same time, Zmotion remote HMI function is valid, which means network configuration display is provided to watch and adjust parameters in real-time.
ZMC432H has rich hardware interfaces and control functional modules, then effective and stable motion control and real-time data acquisition can be achieved to meet application requirements of both industrial control and industrial internet.
What's more, Linux system is built in ZMC432H. That is, it can be connected through local LOCAL interface, then, instruction interaction speed can be faster. The one interaction time of one single instruction and multiple instructions is about 40us.
ZMC432H hardware video description
Configure Python + QT Development Environment & Install Required Tools
a. download python interpreter
b. install pyside 2 or pyside 6
This depends on python interpreter version, for interpreter with higher version, pyside should be used. There are 2 methods to install pyside2.
method 1: use win+r to open running interface, then input cmd (when installing python interpreter, configure environment variables well according to installment guidance, otherwise following commands can't be executed successfully), pip install pyside2 -i https://pypi.douban.com/simple/
method 2: install in pycharm
c. install PyCharm Community Edition
And then in below interface, click "+" to add required tool, for example, pyside2.
d. In Pycharm, configure customized tools (used for QT interface editing)
--open "Tool" editing as below steps--
--self-define Pyside2-uic--
Program filling & editing: Python install - \Scripts\pyside2-uic.exe
Arguments filling & editing: $FileName$ -o $FileNameWithoutExtension$.py
Working directory filling & editing: $FileDir$
--self-define QtDesigner--
Program filling & editing: Python install - \Scripts\pyside2-designer.exe
Working directory filling & editing: $ProjectFileDir$
--after configured custom tools, it can be used directly in "PyCharm" menu--
click "Tool -- Qt -- Qtdesigner" to enter UI design interface.
right click "ui" file, then click "Qt -- Pyside2 -- uic" to generate py file of ui file.
New Build Python Project and Add Function Library
a. use PyCharm Community Edition 2022 to open one new folder, or new build one directory after entering PyCharm Community Edition 2022, then add Python file in directory.
b. obtain Zmotion PYTHON function library and corresponding routines, you can download them from here or contact us. For Windows system, add zauxdll.dll、 zmotion.dll and zauxdllPython.Py into new created folder.
Check PC Function Manual
The PC programming function library manual can be obtained from "download/software manual", or please contact us.
Then there are many commands
a. controller connection: ZAux_OpenEth ()
b. download ".bas" file to controller for running
c. pause and resume controller inside Basic program
RTBasic File Downloading & Continuous Trajectory Processing through Python + Qt
a. routine interface
b. convert image in CAD to motion control codes of ".bas" through "ZmotionCadV1.0" tool.
--open this tool, click "file" -- "import", then select and open CAD graphic in dxf form that is to be converted--
--after opening, like this--
--click "file" -- "export" to export ".bas" file, then it can do above trajectory motion control when it is downloaded into control card--
--please refer to former corresponding article for CAD usage--
c. program example
--load UI file of QT in Python--
from PySide2.QtWidgets import QMessageBox
from PySide2.QtCore import QFile, QTimer
from PySide2.QtUiTools import QUiLoader
q_state_file = QFile("mainweiget.ui")
q_state_file.open(QFile.ReadOnly)
self.ui = QUiLoader().load(q_state_file)
q_state_file.close()
note: at this time, self.ui means ui in qt.
--in event processing function of link button, call controller connection interface function "ZAux_OpenEth()" to connect to controller, then open timer 1 to watch controller status after linked--
--watch controller state through timer--
--select corresponding bas file through event processing function of "select bas file" button--
--download and open selected bas file through event processing function of "opening" button--
note: ".bas" file also can be downloaded through our ZDevelop programming software. ZAux_BasDown command will generate one single bas file as ZAR and download it into controller.
--stop, pause and resume controller through event processing function of "stop", "pause", "resume" buttons--
3. Debug & Watch
Compile and run the routine, at the same time, connect to controller through ZDevelop to watch controller states.
And filename of ".bas" file inside the controller can be viewed when opening "debug" mode in ZDevelop during connection.
Also, there is oscilloscope function in ZDevelop, it can capture waveform of continuous small segments. Below shows waveforms captured by oscilloscope and CAD respectively.
4. Video Description
IMAGE 25
VIDEO DESCRIPTION
ABOUT ZMOTION
That's all, thank you for your reading -- EtherCAT Edge Programmable Industrial Motion Controller (6): Python + QT Continuous Trajectory Motion Control
For more information, please pay close attention to "Support" and "Download" , and there are other platforms about Zmotion - Youtube & LinkedIn & Twitter & Tiktok & Facebook, including technical information (development environment, routine code), product showing, company development, etc.
Hope to meet you, talk with you and be friends with you. Welcome!
This article is edited by ZMOTION, here, share with you, let's learn together.
ZMOTION: DO THE BEST TO USE MOTION CONTROL.
Note: Copyright belongs to Zmotion Technology, if there is reproduction, please indicate article source. Thank you.
Zmotion Technology focuses on development of motion control technology and general motion control products, it is a national high and new technology enterprise. Due to its concentration and hard work in motion control technology, ZMOTION already become one of the fastest growing industrial motion control companies in China, and is also the rare company who has managed core technologies of motion control and real time industrial control software completely. Here, Zmotion provides motion controller, motion control card, vision motion controller, expansion module and HMI. In addition, there is one program software developed by Zmotion -- ZDevelop. It is a good choice for you to program and compile. And program through upper computer, there is PC manual.
Zmotion Technology provides motion control card, motion controller, vision motion controller, expansion module and HMI. ( more keywords for Zmotion: EtherCAT motion control card, EtherCAT motion controller, motion control system, vision controller, motion control PLC, robot controller, vision positioning...)
Have a good day, best wishes, see you next time.