Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Difference between Cycle Time and Simulation Time

#1
Dear RoboDK Team,

What is the difference between cycle time (showed at left-bottom GUI) and simulation time (triggered by call RDK.SimulationTime() - Python API)?

I created a robot program using Python API. In the Python code, I set Simulation Speed to 1 and used Simulation Time to show the elapsed time. It worked well and showed the elapsed time (I assume this as cycle time, since cycle time not showed in the GUI when executed Python program). The next day, I tried to run the Python program (without any changes) but the elapsed time was different (10 seconds difference). Why does this happen?

Thank You!
#2
Cycle time is the estimated time the task would take in the real world.
Simulation time is the ratio between what is displayed on screen and reality (ex: 1 sec in RDK represents 5 sec in real life)

There are a few reasons why this could have happened.
1 - The initial position of the robot wasn't the same, therefore increasing or decreasing the path length. (the position before you run the program)
2 - This initial robot speed wasn't the same.
3 - The initial rounding wasn't the same.

Take a look at this link: https://drive.google.com/drive/folders/1...CCTdy-p7GW
Open the Excel sheet and watch video Module 7 video 8 to 10. (Watching 6 and 7 wouldn't be a bad idea)
That should help you grasp a few more concepts.

Jeremy
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


#3
(01-20-2022, 12:26 PM)Jeremy Wrote: Cycle time is the estimated time the task would take in the real world.
Simulation time is the ratio between what is displayed on screen and reality (ex: 1 sec in RDK represents 5 sec in real life)

There are a few reasons why this could have happened.
1 - The initial position of the robot wasn't the same, therefore increasing or decreasing the path length. (the position before you run the program)
2 - This initial robot speed wasn't the same.
3 - The initial rounding wasn't the same.

Take a look at this link: https://drive.google.com/drive/folders/1...CCTdy-p7GW
Open the Excel sheet and watch video Module 7 video 8 to 10. (Watching 6 and 7  wouldn't be a bad idea)
That should help you grasp a few more concepts.

Jeremy

Hi Jeremy,

Thank you for your response. I will look at the module.
By the way is there any way to get cycle time for Python API Program?

Thanks!
#4
Go to "C:\RoboDK\Library\Scripts" and "CycleTime(...).py"
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


#5
(01-20-2022, 09:27 PM)Jeremy Wrote: Go to "C:\RoboDK\Library\Scripts" and "CycleTime(...).py"

Code:
from robolink import *    
RDK = Robolink()

# Load My Python code
program = RDK.ItemUserPick('Simulator', ITEM_TYPE_PROGRAM)

result = program.Update()

RDK.ShowMessage(result)

It shows error on line "result = program.Update()":
Quote:Invalid item provided: The item identifier provided is not valid or it does not exist.

Why this happen?
#6
Did you select a program?
It just means the station item provided, in this case a program, is not valid.
If you don't have a program in your station it won't work.
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


#7
(01-21-2022, 04:09 PM)Jeremy Wrote: Did you select a program?
It just means the station item provided, in this case a program, is not valid.
If you don't have a program in your station it won't work.

Yes, I select a Python Program.
To help you better understand the cases, I've been attached my program.


Attached Files
.rdk   220121_Existing.rdk (Size: 763.53 KB / Downloads: 237)
#8
(01-26-2022, 06:29 AM)john_17s Wrote:
(01-21-2022, 04:09 PM)Jeremy Wrote: Did you select a program?
It just means the station item provided, in this case a program, is not valid.
If you don't have a program in your station it won't work.

Yes, I select a Python Program.
To help you better understand the cases, I've been attached my program.

Since the program you selected is not a robot program. The Cycle Time Display Script does not work (You would be measuring the execution time of the python program, not the robot cycle).

What your Python program is doing is sending movement commands to the Robot, not creating a robot program.  

I believe you have 2 options:


1) Set the simulation speed to 1 and add a tic() at the beginning of the python program and a toc() at the end. You can display the difference. (Less work but less accurate)

2) Create a method in your simulator class that creates a RoboDK robot program with the functions that have been sent to the robot. (More work but more realistic)
#9
(01-26-2022, 10:29 PM)Alex Wrote:
(01-26-2022, 06:29 AM)john_17s Wrote:
(01-21-2022, 04:09 PM)Jeremy Wrote: Did you select a program?
It just means the station item provided, in this case a program, is not valid.
If you don't have a program in your station it won't work.

Yes, I select a Python Program.
To help you better understand the cases, I've been attached my program.

Since the program you selected is not a robot program. The Cycle Time Display Script does not work (You would be measuring the execution time of the python program, not the robot cycle).

What your Python program is doing is sending movement commands to the Robot, not creating a robot program.  

I believe you have 2 options:


1) Set the simulation speed to 1 and add a tic() at the beginning of the python program and a toc() at the end. You can display the difference. (Less work but less accurate)

2) Create a method in your simulator class that creates a RoboDK robot program with the functions that have been sent to the robot. (More work but more realistic)


Thank you for the information.
I will try the second method.
  




Users browsing this thread:
1 Guest(s)