Difference between Cycle Time and Simulation Time- Printable Version +- RoboDK Forum (//www.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN) +--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API) +--- Thread: Difference between Cycle Time and Simulation Time (/Thread-Difference-between-Cycle-Time-and-Simulation-Time) |
Difference between Cycle Time and Simulation Time-john_17s-01-20-2022 Dear RoboDK Team, What is the difference between周期时间(showed at left-bottom GUI) andsimulation 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! 再保险:差异between Cycle Time and Simulation Time-Jeremy-01-20-2022 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/1CuDJ_cTwYwJp0edgH_b7LJCCTdy-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 再保险:差异between Cycle Time and Simulation Time-john_17s-01-20-2022 (01-20-2022, 12:26 PM)Jeremy Wrote:Cycle time is the estimated time the task would take in the real world. 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! 再保险:差异between Cycle Time and Simulation Time-Jeremy-01-20-2022 Go to "C:\RoboDK\Library\Scripts" and "CycleTime(...).py" 再保险:差异between Cycle Time and Simulation Time-john_17s-01-21-2022 (01-20-2022, 09:27 PM)Jeremy Wrote:Go to "C:\RoboDK\Library\Scripts" and "CycleTime(...).py"
Code:
from robolink import *
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? 再保险:差异between Cycle Time and Simulation Time-Jeremy-01-21-2022 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. 再保险:差异between Cycle Time and Simulation Time-john_17s-01-26-2022 (01-21-2022, 04:09 PM)Jeremy Wrote:Did you select a program? Yes, I select a Python Program. To help you better understand the cases, I've been attached my program. 再保险:差异between Cycle Time and Simulation Time-Alex-01-26-2022 (01-26-2022, 06:29 AM)john_17s Wrote:(01-21-2022, 04:09 PM)Jeremy Wrote:Did you select a 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 yoursimulator classthat creates a RoboDK robot program with the functions that have been sent to the robot. (More work but more realistic) 再保险:差异between Cycle Time and Simulation Time-john_17s-01-27-2022 (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? Thank you for the information. I will try the second method. |