Count robot movement beats

Forum Forums Visual Components 4.0 Robot Programming Count robot movement beats

This topic contains 5 replies, has 4 voices, and was last updated by Avatar jouha 4 weeks, 1 day ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #14986
    Avatar
    dada123
    Participant

    hi,

    I have a question. In the automation project, it is often necessary to count the movement beats of robots. In the figure below, multiple subroutines are created. Is there a way to count the beats of a single subroutine (that is, the robot’s movement time), or multiple subroutine beats at the same time?

    #15014
    Avatar
    ozan
    Participant

    Hi i think you can create a new variable for every subroutine to count how many times it ran. And simply you can increase it by 1 every time routine is called. In routine you can use your first command for assign Counter = Counter + 1.

    #15016
    Avatar
    dada123
    Participant

    Oh no, I want to calculate the motion time of the robot subroutine, not how many times it runs.

    #15039
    zesty
    zesty
    Moderator

    I would recommend you use the Post Processor add-on found on the forum along with a virtual controller for calculating the cycle times, e.g. Kuka OfficeLite. For example, use the add-on to export the robot program to a testable format, and then use a controller to measure cycle times.

    If you cannot do that… you can use API to try and calculate the motion time.

    Option 1

    The Robot Executor behavior of the robot should have a StatementHandler property, which you can use to the control the execution of statements. A StatementHandler is a Python Process Handler behavior. It has a script, which would allow you to calculate the time it takes to complete the routine.

    Option 2

    The Robot Executor in Python is vcExecutor, and it has a method for calling a routine in the robot program. So a simple test of comparing the simulation times before and after the call and completion of the routine could give you an idea.

    Option 3

    The Robot Controller in Python is vcRobotController, and it has a method for creating a motion interpolator and others for testing motion targets, but this is something you probably should not do in this case.

    Option 4

    A curve ball. I don’t remember, but I think the Print statement in a robot program does print the simulation time in the Output panel. Therefore, you could try to do option 2 via the GUI/Program Editor panel.

    Notes about Options 1-4

    It might not be accurate, but can serve as a rough idea/estimate. Be aware that you would have to implement a way to monitor motion statements and not other types in the routine. But if the goal is just to record the duration of a routine, you could create a script and run the routine several times to get a sample size and average time.

     

     

     

    #15053
    Avatar
    dada123
    Participant

    Thank you very much, but I think it will be a good feature to apply this function to a future version, which is combined with the request of my previous automation project, thank you again!

    #15057
    Avatar
    jouha
    Moderator

    Hi,

    I’d do it with a simple Python script as an application script, command or embedded to a component e.g. the robot.

    My recipe would be as follows:

    1. In vcExecutor register to OnCurrentStatementChanged event
    2. In the event handler
      1. capture SimTime
      2. get the CurrentStatement property (of VcExecutor)
      3. act based on the ParentRoutine property of that vcStamement (if it’s  different than in previous event start a new timer etc.)
      4. Store/output the times as needed
Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.