Best practice for sequential operations on a robot?

So i am doing this little home project:

Its a small Dobot MG400 robot arm that takes my families old pictures, put them into a scanner, takes them out and on and on it goes.

It works using TCP, so I will inject a command and the robot arm will start doing that command. Once the robot arm is done, it returns the exact same message that started it, letting me know that the operation has been completed successfully.

What is the best/neatest code you would use for continuously injecting the commands in the given order (see above picture)? I am not quit sure how the best way to approach this.

1 Like

One way:

  1. Set your commands in a array e.g ["op1","op2","opn"]
  2. Feed that into a split node. (That will cause them to be split and released 1 at a time)
  3. Use something to queue the stream of messages and release them once you get a response (I'd use node-red-semaphore-plus (node) - Node-RED)

Wow, what a cool project - looks like a lot of fun!

Does the robot answer with state information, i.e., "the arm is at this position" - if so then you can have a switch node that ensures the appropriate command for the position is sent to the robot. Something like:

state --> command
arm is at rest --> send command to pick up photo
arm has picked up picture --> move arm to scanner
arm is at scanner --> drop picture on scanner
...

Sending blindly commands in order ensures that if something goes wrong, it will get worse! I.e. if you're not inspecting state of the robot arm then sending commands might well just make it worse.

Also do you get feedback from the scanner? Can you fully automate this process?

To guarantee that one command is finished before the next is started you can use this simple flow to run them sequentially. "wait until" node changed behavior after recent update - #2 by Colin

I used your suggestion and now it looks like this and it works. Feel free to criticize, that's the only way we can learn :slight_smile:

So, the next thing I need to solve is a mechanical "issue": When I apply a vacuum to the photos on the scanner, the suction goes right through the pictures (a photo is apparently VERY permeable), so instead of the robot lifting the picture as intended, it tries to lift the whole scanner... to be continued :roll_eyes:

You could strap a gecko to the robot arm and use his sticky feet. A cyborgecko.
https://stanforddaily.com/2023/02/01/lab-develops-stickiest-non-sticky-material/

1 Like

I could, but then I would also have to make the automatic feeding and watering system for him... and I am also a little bit skeptical about the reliability, how do you keep him motivated to keep taking photo number 151 of Aunt Gerdas infamous boring birthday party out of the scanner? I do not want to make him watch, what I have already lived :grimacing:

2 Likes

Perhaps you could train him to simply eat the boring photos! :rofl:

One possible approach might be to switch to a sliding motion rather than a lifting one? It would require some re-arrangement of the hoppers of course.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.