Bring Values and Sucesses To Our Customers

Home / Support and services / Technical Support

Technical support

Technical Support

Motion Control Quick Start (9) | How to Use Oscilloscope


Motion Control Quick Start Knowledge keeps moving.
Before, we had learned: 
quick start (1) -- firmware update
quick start (2) -- ZBasic program development
quick start (3) -- ZPLC program development
quick start (4) -- Communicate with HMI
quick start (5) -- IO Input & Output 
quick start (6) -- Data Storage
quick start (7) -- ZCAN Expansion Module
quick start (8) -- EtherCAT Expansion Module

 Hi, everyone, nice to meet you.

 Today, let’s see one important part of debugging and running, oscilloscope.

1. Material Preparation

--Materials--

(1) One computer with ZDevelop3.01 or above installed.

(2) One controller.

(3) Two 24V DC power supply (Main power & IO power)

(4) Several bus drive + motor (or stepper drive + motor).

(5) A number of controller wiring terminals.

(6) Several network cables.

(7) A number of connecting wires.

(8)  Several expansion modules of different types.

--Wiring Reference--

IMAGE 1.png






2.  Oscilloscope Introduction

(1) The function of oscilloscope

Oscilloscop e is extremely important of program debugging and running. It is used to transfer signals that can’t be seen by naked eyes into graphics, then it is convenient to analyze change processes of all kinds of signals.

Oscilloscope shows controller internal data in graph, it can display different signals, like, axis parameter, axis status, etc. In “View” – “Scope”, then oscilloscope window can be opened, or click the shortcut button.

The oscilloscope must be powered on before triggering to successfully sample. Open the oscilloscope and set the relevant parameters, and then click “Start Scope” to trigger sampling manually, or add the "TRIGGER" command to the program to automatically trigger oscilloscope sampling.

IMAGE 2.png

 

(2) The basic setting of oscilloscope

IMAGE 3.png

Oscilloscope basic setting button function:

--Config: open oscilloscope configuration window, set relevant parameters

--Start Scope: start oscilloscope (but not to trigger oscilloscope capture)

--Stop: stop oscilloscope capture

--XY mode: when checked, switch to the XY plane to display the interpolated composite track of the two axes.

--<<: press to hide the channel name and peak value, and only display the channel number.

--Trigger: manually trigger oscilloscope capture button (use TIGGER instruction to trigger automatically)

--Follow: After the following is enabled, the horizontal axis automatically moves to the ---real-time sampling point and follows the waveform display.

--Show: choose whether the present channel curve shows or not

--Index: select the data source number that needs to be captured, such as, axis number, --digital IO number, analog IO number, TABLE number, VR number, MODUBUS number, etc.

--Source: select captured data type

--Offset: Set the offset of the vertical axis of the waveform.

--Xscale: The scale of one grid on the vertical axis.

--Yscale: The scale of one grid on the horizontal axis.

 

(3) Oscilloscope parameters configuration

If sets oscilloscope parameters, such as, axis number, data source and start oscilloscope configuration window, it should stop firstly, then to do configure. Click “Config” to pop up “Scope Config” window.

IMAGE 4.png

--Chanel Num: channel total numbers to be sampled.

--Depth: total sampling numbers, the depth is bigger, the sampling ranger is bigger.

--Space: sampling time space. The unit is system cycle, which is related to the firmware version of the controller. Generally, default is 1ms, and see it through SERVO_PERIOD instruction. Usually, the smaller the space, the more accurate the sampled data, and the larger the amount of data per unit time.

--TABLE Pos: Set the position where the captured data is stored. Generally, the space at the end of the TABLE data is automatically used by default, and you can also customize the configuration, but be careful not to overlap with the TABLE data area used by the program when setting.

--BackCor/Channel Color: set background and the color related to each channel’s waveform.

--ShowType: there are two curve types to be chosen, point and line. Abnormal data is easily found out by Line.

--Continuous acquisition: when the continuous acquisition is not enabled, the sampling will stop when the sampling depth is reached. After the continuous acquisition is enabled, the oscilloscope will continue to sample.

--Export parameters: export oscilloscope parameters.

 

(4) Oscilloscope data importing and exporting

--Import--

Data can be imported when oscilloscope stops, and if it is imported successfully, sampling waveform can reappear.

The method of importing sampling data:

Click “Import”, import data file that should be the former file type exported from oscilloscope, then open it.

--Export--

Export parameters, including oscilloscope parameter configuration, data type of each channel and each sampling point’s data.

IMAGE 5.png

The method of exporting data:

Click “Export parameters” in “Scope Config”, then start scope. After sampling, click “Export”, and select folder to store oscilloscope data, the exported data is text file.

IMAGE 6.png

 


3.  Usage of Oscilloscope

(1) Basic sampling steps

A. open project, connect to controller or simulator, then open the oscilloscope window (note: first, connect to controller or simulator, then operate the oscilloscope window).

B. click “Config” in oscilloscope window, select sampling channel numbers, sampling depth, sampling space, sampling data TABLE stored position (generally the end position of TABLE array will be used automatically) and sampling type, etc. Then, click “OK” for saving this configuration.

C. select sampling Index and Source, click “Start Scope”.

D. download program into controller, the program should include TRIGGER, the trigger oscilloscope sampling automatically instruction. Now, it starts sampling and shows different data source’s waveforms. It can adjust Show Scale and Wave Offset, this is for observing different waveforms.

E. If the waveform accuracy is not high or the display is incomplete, click the "Stop" button and then open the "Scope Config", and adjust the sampling space and sampling depth, and perform the above sampling process again.

If the sampling time is long, start “Continuous acquisition” function.

--Continuous acquisition--

When continuous acquisition is not selected, the oscilloscope automatically stops sampling when the sampling depth is reached.

First select “Continuous acquisition” in “Scope Config”, then start oscilloscope, it will continue to sampling after triggered, and sampling even if it reached the depth. It will stop until press “Stop” button manually.

All waveforms and captured data from continuous acquisition can be exported.

Oscilloscope sampling time calculation:

For example, depth: 1000, space: 5

If system cycle is SERVO_PERIOD=1000, which means 1ms trajectory planning cycle. Space 5 means sampling one data point per 5ms. Total sampling data number is 10000, so sampling time length is 50s.

 

(2) Usage notes

Set the position where the captured data is stored. Generally, the space at the end of the TABLE data is automatically used by default, now starting space address is calculated automatically according to captured data space.

Calculation method: captured data space = channel numbers * depth

For example, if TABLE space of controller is 320000, there are 4 sampling channels, depth is 30000, each sampling point occupies one TABLE, so it will occupy 4*30000=120000 TABLE positions. 320000-120000=200000, which means starting position of TABLE is 200000.

The position for storing data also can be self-defined, if according to above channel number and depth, TABLE starting space can’t exceed 200000 when it is self-defined, otherwise, it can’t be configured, please see below:

IMAGE 7.png

The space occupied by the oscilloscope sample data should not overlap with the TABLE data area used by the program.

Controller TABLE space can be read through TSIZE instruction, check “Controller Status” or input ?*max to print and check.

 

(3) Oscilloscope showing type

There are two types of oscilloscope sampling curve display: point and line segment.

--Point--

The data of a series of sampling points collected by the oscilloscope at a fixed cycle, as shown in the figure below.

IMAGE 8.png

--Line segment--

Connect the sampling points into a smooth line segment display, as shown in the figure below, the line segment is easier to find the data display of abnormal points. Generally, it is recommended to display the data as a line segment when the data fluctuates greatly.

IMAGE 9.png

 

(4) Oscilloscope XY mode

XY mode supports the display of interpolated synthetic trajectories for both axes. When the XY mode is not checked, the time is the horizontal axis, and the vertical axis is the display of each data value.

The waveforms are displayed in pairs, curves 1 and 2 are a pair, curves 3 and 4 are a pair, and so on.

IMAGE 10.png

(motion curve of each axis)

IMAGE 11.png

(interpolated synthetic trajectory under XY mode)

 

(5) Corresponding oscilloscope commands

SCOPE_POS: read-only parameter, returns the number of points currently sampled and saved.

SCOPE: oscilloscope data sampling, data are saved to TABLE, and 8 types of data can be sampled at the same time (enable, period, table_start, table_stop, p0 [,p1 [,p2 [,p3 [,p4 [,p5 [,p6 [,p7]]] ]]]]).

enable: enable or not.

period: the system period, generally 1ms, it can be viewed through SERVO_PERIOD.

table_start: the sampling data is stored at the starting position of the TABLE.

table_stop: TABLE end position, minus the start position is the number of samples.

p0~p7: sampling data type, equally divided and stored in the TABLE range.

Example:

SCOPE(ON,10,0,1000,DPOS(0),MSPEED(0))

'catch DPOS and MSPEED every 10ms and store in TABLE 0~1000, 0~499 for dpos, 500~1000 for MSPEED, total sampling (1000/2)*10=5000ms

 

(6) Oscilloscope display routine

A. Continuous trajectory look-ahead application

IMAGE 12.png

IMAGE 13.png
IMAGE 14.png

(XY mode)

B. electronic cam application

IMAGE 15.png
IMAGE 16.png

C. PSO position synchronization output

IMAGE 17.png

IMAGE 18.png




ABOUT ZMOTION

That's all, thank you for your reading -- Motion Control Quick Start (9) | How to Use Oscilloscope for Motion Controller.

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.

Copyright © 2013-2024 Shenzhen Zmotion Technology Co.,Ltd Design by Zmotion    粤ICP备13037187号 Motion Controller-Motion Control Card

Contact Us-Youtube