Best Practices to exchange conditions to and from the plc with the robot

Greetings,

I’m kind of new to the Robotics world; I’ve most likely worked only in motion control for machines.

I’ve read all the topics about mapp robotics and machine centric robotics here, and followed the getting started of the delta robots tutorials. I got the system running and moving. I’m playing around with it for quite some time now…

Now I’m starting to develop our machine, which has 2 delta robots. It’s not clear for me yet what is the best way to interact between the PLC and ROBOT.

I’ve read about the Path-Synchronous variables, M Functions, Do_PathSync(), the functions such as WaitUntilSync(), WaitMoveEnd(), ALAP() and etc. Got many examples from here and the B&R github as well… and I’ve seen many ways to deal with interfaces…

Considering that I need to send commands to the robot, get feedback of this commands, and look for conditions on the machine which impact what the robot must do, what are the best practices to be sure that the commands are sent, the feedbacks are received, and the conditions are met for such decisions?

Thanks in advance.

Hi @Frederico_Mantovani ,
we can answer soon to your questions but I would like to ask you to create a new post focus on “Best Practices to avoid collision between 2 Delta robots“.
Thanks
Ciao
Valerio

Hello Valerio.

Thank you for getting back to me.

The scope of my question is strictly about how to manage, with guarantees and best practices, the communication between the PLC and the ROBOT. However, the topic you mentioned is also of interest, and I think it is very relevant for us to have a discussion covering that subject as well.

I will create this secondary post with the title you suggested. But I ask that you keep this one open so we can address the best practices for this communication.

As I mentioned in my original question, I’d like to know the best way to manage this. I’ll give an example: I have a station where I always need to check whether there is a container available to receive a product. The positioning is managed by a mechanical transport system with a servo motor controlled by mapp Motion using a CAM curve. So, I pick up the product with the delta robot, and on the way to the drop-off position I need to check whether there are available containers, and among the available ones, which container I can place the product into.

It’s clear that I could use a WaitALAP to make the interpreter wait until the last possible moment to check, or use WaitUntilSync to wait for the signal. I’ve tested this and it works—the issue is that this causes the motion to end, or in other words, the interpreter briefly pauses while waiting for the condition. However, I would like the condition to be evaluated during the motion so that, if it is OK, I can blend the motion into the next one.

If I declare, in the PROGRAM feature under program elements, the PVs as Path-Synchronous, will the information from these variables be synchronized during the motion? Or should I use DO_PATH_SYNC and place the logic and the motions inside it?

Thank you.

Here is the new topic: https://community.br-automation.com/t/best-practices-to-avoid-collision-between-2-delta-robots/

1 Like

Hello,

You descripe the typical issue of a synchronisation of the Robot to the plc.
You have a condition which will lead to a different behaviour. As we can not delete information in the motion-packet-queue jet, you need to wait until the descition is made, to start filling the motion-packet-queue. Meanwhile the rest movement is to short and the robot comes to a stop.

If you want to prevent the stops on the path you must know how the path continues earlier. To fill up the path bevor a stop is nessesary due to lack of rest path.

WaitALAP does not lead to a stop, but it releases often very erly as the robots are really fast. Once the Decceleration has startet we must stop (there are ideas to improve this).

WaitUntilSync does at every time introduce a stop on the path and has to be avoided as long as possible. That was why we introduced WaitALAP, to have a possibility to skip WaitUntilSync or similar in situations where the decition was made early enouth.

There is a abort, and replaning Feature in development, which can create some new Use-Case in considertation to lose Parts and don’t move ahead , instead replan and repic a new part faster.

Reading Variables is almost at any time interpreter-synchronous. And in consideration to decide path planing it must be interpreter-synchronous. To select the packets you like to put into the motion queue. (Motion Commands ST/G-Code)

Only the Write part of a Variable is influenced by its poperty “Path-Synchronous” “Interpreter-Synchronous”
If you want to use a Variable to Programm Coordinates for the next G-Code , it is important to use it “Interpreter-Synchronous” it is interpreted in the context of the interpreter and at the moment the G-Code line is processed by the Interpreter it has its new Value.
If you want to use a Variable to Programm a Valve-Command it has to be used as “Path-Synchronous”. The Valve must be operated in the Context of the Path-Generator. With the Setting “Path-Synchronous” the Variable gets processed by the interpeter, there is a motion-packet created and moved throught the motion-packet-queue. The Path Generator accesses this packet at the right time on the path and writes the Variable in the context of the PathGenerator.

If you want to prevent stops on you path this is i think the best approach to achive it right now (MappMotion6.5.0), to only hole in this aproach is that your decission has to be available early enought.

Wait as long as possible and decide

VAR {AT PLC} 
    Left : BOOL; 
    DecisionAvailable : BOOL; 
END_VAR 
 
VAR CONSTANT 
    P0 : McPointType := (Pos:=(X:=0, Y:=100)); 
    PLeft : McPointType := (Pos:=(X:=-100, Y:=100)); 
    PRight : McPointType := (Pos:=(X:=100, Y:=100)); 
END_VAR 
 
PROGRAM _MAIN 
    RoundingEdges(25); 
    Feedrate(1000); 
    MoveL(P0); 
    WaitALAP(); 
    IF NOT DecisionAvailable THEN 
        // optionaly move to a waiting position 
        WaitUntilFlush(DecisionAvailable); 
    END_IF   
    IF Left THEN 
        MoveL(PLeft); 
    ELSE 
        MoveL(PRight); 
    END_IF     
END_PROGRAM 

And then there comes the discussion in which syntax you will program this or present this to a coustommer. There are options to use sub-Programs or the internal AIL to adapt the Code-Style. But i think this is not the scope of your discussion?

I am also interessted in others ideas to this topic, as it is a very interessting one.

Greetings
Michael

3 Likes

Hello Michael.

I really appreciate your explanation. It helped me a lot to start programming the application. I took into consideration the points you raised, and I am still running several tests regarding when and how to use WaitALAP() with or without WaitUntilFlush(), as well as WaitUntilSync() and WaitUntil().

So far, I have a running application that definitely needs improvement when it comes to the pauses between decisions. Especially because I am using Tracking, the conditions for the availability of a new frame are not yet fine‑tuned, so the pauses while waiting for the Pick frame, the Pick action, waiting for the Place frame, and the Place action still need optimization. When the timings and decisions align, the motion becomes very smooth, but there are many process variables I need to adjust in the machine to ensure the robots receive the necessary conditions in time so that no stoppages occur.

Regarding the interlocking between the machine process and the robot, I had some difficulties at the beginning, considering how the robot runtime works. I believe it is characteristic of a pointer‑based runtime and therefore different from a PLC runtime, for example. But that’s part of the learning curve, and with testing and the Help documentation, things are getting resolved.

It became clear when and how to use Path‑Synchronous, and I am taking into account what you pointed out about variables in Interpreter‑Synchronous mode.

If I have any insights, questions, or comments during my development period, I’ll come back here to share them.

Thank you.

1 Like