Data collector
This tool is made to collect sensor data from KUKA KR 3 R540 robotic arm. It collects the system vairables via a custom KRL submodule and trace data from the KUKA Trace module.
For each of the 6 motors, the following variables are measured:
- Position
- Torque
- Current draw
- Temperature
This program tries to collect the data in real time. The main latency factor is the network quality. An ethernet connection is preffered over Wi-Fi. The data is buffered on the robot side but has a hard-coded limit of 20000 samples. The sampling rate has to be configured in accordance of the length of an acquisition and with the network connection quality.
The data is acquired from a full-range motion of a motor. Each motor moves independently from each other.
The data collected by the program can be found in the data folder, each data file having an explicit name with the date of the colelction and details on the configuration.
Example :
[2024-05-17] 10h57 data [20%-60%] [36ms] [class 0] [10 10 10 10 10 10] - Robot 2
Format :
[date] hour data [speed] [sampling rate] [load class] [number of iteration by axis] - N° of the robot
NB : The file obtained using KUKA Trace has a _TRACE
suffix
Summary
- UI Description
- Program Structure
-
KRL Submodule
- Global variables
Data_collector.sub
- KUKA Trace Configuration
- The
Axis_Main.src
program
UI Description
The User interface is divided in 6 functions.
Collection settings
This section defines the configuration for the data acquisition.
The following parameters can be configured:
- Number of movement iteration per axis
- Sampling rate
- Speed range for the test
Due to software limitations from the KRL environment, the sampling rate is bound to be a multiple of 12.
The speed of the motors movement varies from min to max with the specified step. This value is defined as a percentage of the max value (i.e. 0 to 100). The speed range can be set to constant and thus only one acquisition is made.
KUKA traces
This selectors is used to select the KUKA Trace configuration that will be run along side of the system variable collection. The collected data is the same as with the system variables but with more precision and reliability. The acquisition is done by the RTOS of the robot.
Robots loads
Enter here the load on each robot, with weight or bungee coords It will be displayed in the result dataset for data processing
Latency test
Launch a latency test on the connected robots to print network timings Plots a graph of the latency versus time and distributions with histograms
Gripper commands
Command the gripper of the selected robot : open or close
Collected data plot
Accessible without robot connection, this section plots data by selecting a excel file and hitting corresponding buttons
Program Structure
The code is organized in two main parts in two folders :
kuka
and ui
The kuka
folder contains the classes to communicate with the robot controller
and its varaiables. KUKA_Handler
,
herited from openshowvar
,
is responsible of the connection to the robot controler.
KUKA_Reader
contains all the functions to operate a data
collection, as buffer readings and formating the result into a
Pandas DataFrame
.
The ui
folder contains all the classes related to the user interface
of the application. Python files with ui_
prefixes generate the frames shown
in the main window. The main window is generated by the
MainWindow
class, and latency measurement and robot
measurement are in Measure_latency
and
Measure_robot
.
The Measure_robot
class contains the functions to
execute a data collection,
with the dynamic UI in CollectionGraphWindow
showing the robot data buffer state.
The main
python file contains the main loop at the basis of the UI.
It is done by a main class, and allows organization with class variables and
class methods instead of global variables and functions.
KRL Submodule
This section describes how to deploy the data collection on a cell.
Global variables
The following declarations must be added in the System/$config.dat
file
on the robot KUKA workspace :
;FOLD ------DIAGNOSTIKA GLOBAL PROMENNE-------
;Program control
DECL BOOL PyRUN=FALSE
DECL BOOL PyDONE=FALSE
DECL INT PySPEED=30
DECL INT PyITER[6]
DECL BOOL PyOPEN_GRIPPER=FALSE
DECL BOOL PyCLOSE_GRIPPER=FALSE
DECL INT PyKNUCKLE
DECL REAL SPEED
;Data collection control
DECL BOOL ColRUN=FALSE
DECL BOOL ColRESET=FALSE
DECL BOOL ColBUFFER_FULL=FALSE
DECL BOOL ColKEEPING_UP=FALSE
DECL BOOL ColRESET_DONE=TRUE
DECL INT ColSAMPLING=12
DECL INT ColBUFFER_SIZE=20000
;Data communication buffers and flags
DECL INT SAMPLE_READ=772
DECL INT SAMPLE_NUMBER=772
DECL REAL __TAB_1[36]
DECL INT __PYTHON_HAS_READ=771 ;
DECL BOOL __PyResetTimer=FALSE ;
;Data collection buffers
DECL REAL ColBUFFER_TQ_A1[20000]
DECL REAL ColBUFFER_TQ_A2[20000]
DECL REAL ColBUFFER_TQ_A3[20000]
DECL REAL ColBUFFER_TQ_A4[20000]
DECL REAL ColBUFFER_TQ_A5[20000]
DECL REAL ColBUFFER_TQ_A6[20000]
DECL REAL ColBUFFER_TEMP_A1[20000]
DECL REAL ColBUFFER_TEMP_A2[20000]
DECL REAL ColBUFFER_TEMP_A3[20000]
DECL REAL ColBUFFER_TEMP_A4[20000]
DECL REAL ColBUFFER_TEMP_A5[20000]
DECL REAL ColBUFFER_TEMP_A6[20000]
DECL REAL ColBUFFER_CURR_A1[20000]
DECL REAL ColBUFFER_CURR_A2[20000]
DECL REAL ColBUFFER_CURR_A3[20000]
DECL REAL ColBUFFER_CURR_A4[20000]
DECL REAL ColBUFFER_CURR_A5[20000]
DECL REAL ColBUFFER_CURR_A6[20000]
DECL REAL ColBUFFER_TIME[20000]
DECL REAL ColBUFFER_ANALOG[20000]
DECL E6AXIS __LAST_POS_ACT
DECL E6AXIS ColBUFFER_POS_ACT[20000]
DECL E6AXIS __LAST_POS_MEAS
DECL E6AXIS ColBUFFER_POS_MEAS[20000]
;ENDFOLD
Data_collector.sub
To allow for data collection, please be sure to add the Data_collector.sub
to the list of running submodules. This submodules takes up to 3 minutes to
properly initialize the internal data buffers.
This progam can be found in robot/KRL/
.
KUKA Trace Configuration
Copy the provided configuration files found in robot/configurations/
to
the TRACE
folder of the robot.
Example path : \\192.168.1.151\roboter\TRACE\
Axis_Main.src
program
The The data collection uses the Axis_Main.src
program to create the data
to collect. It must be running in AUT
mode at 100%
of run speed to produce
valid data.
This progam can be found in robot/KRL/
`.