Home Programming

Discussion

Left ArrowBack to discussions page
Jason_gJason_g Posts: 10 Apprentice
edited July 2018 in Programming

Hello,

We are running a fairly basic machine tending program. The main program consists of several If statements which call out subroutines.

Within the subroutines there are also If statements which direct robot which rack to pick build plates from. Within the If statements we are setting a flag so as not to enter this particular If statement again (rack is now empty). When program scan gets to bottom of If statements within subroutines, controller just randomly dies. This would be right before program would be expected to jump back to main program. There are no error logs. It only states that "prog stopped running" and "controller disconnected".


Any ideas?




Comments

  • Nicholas_FrancoeurNicholas_Francoeur Posts: 93 Handy
    @Jason_g,

    Can you share that program or the sequence that you think is faulty?

    I have seen that problem before when the user wrongly used the comparison equal sign (?=) versus the assignment equal sign (=). I don't remember the particular case though.
    Nicholas Francoeur
    Co-Founder | Vanguard Robotics
    e:   [email protected]
    w:  vanguard-robotics.com
  • Jason_gJason_g Posts: 10 Apprentice

    Nickolas,

    Attached is subprogram. Please not "monitoring expression continuously" is unchecked. 


    Program
       Robot Program
         MoveJ
           pMidway
         If Nest1_Full<1  and  Rack1>0  and HoldingNest≟ False
           MoveJ
             pApproachNest1
             rq_move_and_wait(150)
             MoveL
               pDwnNest1
               rq_close_and_wait()
               CheckHoldNest≔ True
               Wait: 0.2
               CheckHoldNest≔ False
               Wait HoldingNest≟ True
               pUpNest1
               pUpNest1Ret
               pApproachNest1
               pMidway
               Rack1≔0
               Wait: 0.2
         If Nest2_Full<1  and Rack2>0  and HoldingNest≟ False
           MoveJ
             pApproachNest2
             rq_move_and_wait(150)
             MoveL
               pDwnNest2
               rq_close_and_wait()
               CheckHoldNest≔ True
               Wait: 0.2
               CheckHoldNest≔ False
               Wait HoldingNest≟ True
               pUpNest2
               pUpNest2Ret
               pApproachNest2
               Rack2≟0
               Wait: 0.2
         If Nest3_Full<1 and Rack3>0  and HoldingNest≟ False
           MoveJ
             pApproachNest3
             rq_move_and_wait(150)
             MoveL
               pDownNest3
               rq_close_and_wait()
               CheckHoldNest≔ True
               Wait: 0.2
               CheckHoldNest≔ False
               Wait HoldingNest≟ True
               pUpnest3
               pUpNest3Ret
               pApproachNest3
               Wait: 0.2
         sync()

  • Jason_gJason_g Posts: 10 Apprentice
    Nicholas_Francoeur           
  • Nicholas_FrancoeurNicholas_Francoeur Posts: 93 Handy
    I can't find any potential errors in there. Have you tried removing all subprograms and putting them back in the main one?
    Nicholas Francoeur
    Co-Founder | Vanguard Robotics
    e:   [email protected]
    w:  vanguard-robotics.com
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,113 Handy
    @Jason_g is the CheckHoldNest flag triggering a thread or event to fire?  If so, can you post that code?  Also, does the controller disconnect at the same point in the program each time?  What version of Polyscope are you running?
  • Jason_gJason_g Posts: 10 Apprentice

    matthewd92                        

    Its running a thread to obtain feedback from adaptive gripper:

        Thread_2
         If CheckHoldNest≟ True
           GripperPose≔rq_current_pos()
         If GripperPose>210  and  GripperPose<229
           HoldingNest≔ True
         Else
           HoldingNest≔ False    

    Last night I revised to program to use Case statement in subroutines instead and its functioning just fine. I still don't know what was causing that though    

    Switch PullRackSeq
           Case 1
             MoveJ
               pApproachNest1
               rq_move_and_wait(150)
               MoveL
                 pDwnNest1
                 rq_close_and_wait()
                 CheckHoldNest≔ True
                 Wait: 0.2
                 CheckHoldNest≔ False
                 Wait HoldingNest≟ True
                 pUpNest1
                 pUpNest1Ret
                 pApproachNest1
                 pMidway
                 'Rack1≔0'
                 Wait: 0.2
           Case 2
             MoveJ
               pApproachNest2
               rq_move_and_wait(150)
               MoveL
                 pDwnNest2
                 rq_close_and_wait()
                 CheckHoldNest≔ True
                 Wait: 0.2
                 CheckHoldNest≔ False
                 Wait HoldingNest≟ True
                 pUpNest2
                 pUpNest2Ret
                 pApproachNest2
                 'Rack2≟0 '
                 Wait: 0.2

    If you look at Case 2 notice I had script code "Rack2≟0". This should be an assignment as I was attempting to set flag. Realistically its not doing anything. I wouldn't think that would cause controller to disconnect or fault out?   

            

  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,113 Handy
    We see this issue when the system encounters a fault that it doesn't know how to handle so its possible but i agree that it shouldn't as its a valid comparison.  If you put it back in what happens?
  • Jason_gJason_g Posts: 10 Apprentice

    Nicholas_Francoeur I have saved subroutines as file and ran them in a program by themselves

  • Nicholas_FrancoeurNicholas_Francoeur Posts: 93 Handy
    @Jason_g

    It is possible that this is in fact causing the problem. Have you tried putting it back as matthewd92 mentioned? What is happenning?

    I'm not exactly sure why you're using a thread to validate the gripper position? Why wouldn't you simply call a subprogram? You could also consider using the Grip Check node included in the latest Gripper URCap 1.2.1.


    Nicholas Francoeur
    Co-Founder | Vanguard Robotics
    e:   [email protected]
    w:  vanguard-robotics.com
  • Jason_gJason_g Posts: 10 Apprentice

    matthewd92

    If I comment out the Script code 'Rack2≟0 ' and replace with assignment 'Rack2=0" it runs just fine. When I flipflop it shuts down controller.

    I tested this several times both ways and results remained cosistent

  • Jason_gJason_g Posts: 10 Apprentice

    Nicholas_Francoeur           

    I was not aware I can call a subroutine from a subroutine. I needed to check gripper positions from subroutines after picking the part.


    I will look at Grip Check node. I was unaware of this feature as well

  • Nicholas_FrancoeurNicholas_Francoeur Posts: 93 Handy
    This is exactly the problem I previously saw then. You should consider sending that to UR as this is an easily made mistake.
    Nicholas Francoeur
    Co-Founder | Vanguard Robotics
    e:   [email protected]
    w:  vanguard-robotics.com
  • Nicholas_FrancoeurNicholas_Francoeur Posts: 93 Handy
    @Jason_g, I didn't think you were triggering the thread from a subroutine. But you're right, it is not possible to call a subprogram from a subprogram.
    Nicholas Francoeur
    Co-Founder | Vanguard Robotics
    e:   [email protected]
    w:  vanguard-robotics.com
Sign In or Register to comment.
Left ArrowBack to discussions page