1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
Blog Articles
  • Everywhere
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Blog
  3. Programming ABB robots, Rapid programming

Wait timers and why I don't like them

  • Lemster68
  • January 14, 2020 at 7:35 PM
  • 4,818 times read
  • 4 Comments

I have been to many installs, some have standard programs which must be used, others do not. I was struck by this one standard years ago at a tier1 frame supplier.

Code
  PROC main()
    CONST jointtarget jHome:=[[-48.11,-1.58,60,-0.01,32.72,-90.01],[9E+09,9E+09,9E+09,-169.572,88.8665,200.013]];

    DeactAll;
    IF nStartNum=0 THEN
      IF StationSense()=0 RecoverNtrchange;
      nStartNum:=1;
    ENDIF
    Offset 0;
    MoveJ pHome,v2000,z20,t_Gun;
    Set rdo_clr_tx_a;
    Set rdo_clr_fx_a;
    Set rdo_robot_home;
    reset_outputs;
    TPWrite "Cycle time including clean  "\Num:=ClkRead(clock1);
    WaitDI rdi_initiate,1;
    IF GInput(rgi_prog_num)<>200 Reset rdo_weld_comp;
    WaitTime 0.25;
    nProgNum:=GInput(rgi_prog_num);
    SetGO rgo_prog_num,nProgNum;
    WaitDI rdi_prog_ack,1;
    Reset rdo_robot_home;
    PulseDO\PLength:=0.2,rdo_robot_gone;
    CallByVar "prog_",nProgNum;
    RETURN;
  ENDPROC

This one was just a bit different than others because it had a positioner, or trunnion, as it is sometimes called.  Nevertheless, this one part was what I had to ask about:

    WaitDI rdi_initiate,1;
    IF GInput(rgi_prog_num)<>200 Reset rdo_weld_comp;
    WaitTime 0.25;
    nProgNum:=GInput(rgi_prog_num);

I asked "What is that WaitTime for?"  To which the reply was more or less "waiting for the IO to catch up."  What?  Well sometimes the robot got an initiate without having a valid group input for the style, it would still be 0, which would cause a fault in the CAllByVar which followed.  OK, so we throw away up to .25 seconds every cycle?  Multiply that by the thousands or hundreds of thousand cycles.  Yes, it adds up.  So what to do about this program?  We do need to Wait, but not an arbitrary amount of time, but for a CONDITION to be met.  This condition should be that the group input for style should no longer be 0.  It may take .25 seconds, a half a second, or as little as .02 seconds.  The condition may already be met, so no waiting is required at all.

WaiUntil GInput(rgi_prog_num) <> 0;

And off to the races we go!

Code from another job I had to go to after it was built and installed, robot did some spot welding.

  PROC CloseBackup()
    Reset doOpnBackup;
    Set doClsBackup;
    WaitTime 0.25;
  ENDPROC

  PROC OpenBackup()
    Reset doClsBackup;
    Set doOpnBackup;
    WaitTime 1;
  ENDPROC

Wait times because there were no switches to indicate the position of the gun retract.  That is no fault of the programmer, just poor controls design.  And then they want to push us to get cycle time!  Give us the darn switches so we can wait for the CONDITION to be satisfied, and then we can proceed.  Not only that, but also, when something is stuck open/closed, we can handle it.  Picture this scenario:  No switches, WaitTime 1 as a result of poor controls, gun is stuck closed, robot takes off and things get damaged, line stops.

So to sum it up, always look at how you can make your program waits CONDITIONAL, not based on an arbitrary time.  A good system design will provide for sensors/switches that can indicate the states of moving things before we move the robot or take corrective actions/error handling so we do not crash.
Display More
  • Share
  • Previous Article Another program that writes a program.
  • Next Article Rapid 201: Set yourself ahead of the crowd.

Comments 4

Werner Hampel
January 10, 2024 at 11:44 AM

great Job, thanks!

Lemster68
January 10, 2024 at 2:03 PM
Author

Thank you! :grinning_face_with_big_eyes:

Werner Hampel
January 10, 2024 at 6:25 PM

forgot, that we have a Blog and activated it again. I hope, more Members will write here.

Lemster68
January 10, 2024 at 6:41 PM
Author

:thumbs_up:

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Categories

  • ABB Robotics
  • General Industrial Robotics

Archive

  1. 2020 (4)
    1. May (1)
    2. March (1)
    3. January (2)
      • Wait timers and why I don't like them
      • Another program that writes a program.
  2. 2019 (3)
    1. November (3)

Tags

  • abb
  • WaitTime
  • Rapid programming
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download