0

I am currently a university student working on an extracurricular project where we built a 3D printed SCARA robot that will be remotely controlled. On one end, you have the user that is moving their hand and gathering location based on x,y, and z coordinates. Those coordinates will then be sent to the SCARA robot which will move to those coordinates.

Currently we are attempting to figure out the best way to do this with as little latency as possible.

Our current idea is to create an API that sits between the two — with the users client making an update request to the API with the coordinates and pushing them to the SCARA robot.

Our greatest concern with this is latency and what happens when when there is a delay on one end.

The reason I am posting here is I'm looking to inquire into whether any of you have suggestions on where we should look for help with this or have any ideas that would be a better solution. We seem to be at a road block and just looking for some fresh eyes. We are all undergrad students.

So what would be the best way to accomplish this?

Thank you so much for your time and if there is anything I can add for clarity, please don't hesitate to ask.

Best

Doug
  • 3
  • 2
  • 2
    I think in order to answer this question we'd need to know how the API communicates with the robot. Is there a custom hardware peripheral? How is that accessed? – John Wu Oct 06 '21 at 06:13
  • 2
    A good idea is to start measuring and estimating the requirements. How fast does the robot respond? How long latency does the protocol have? for some uses 10ms latency is terrible, but completely irrelevant for others. When unfamiliar with a system, it is fairly easy miss-identify the problem areas. – JonasH Oct 06 '21 at 07:38
  • Besides the latency, also think about how often position updates need to be communicated to follow the user's movements and what the consequences are of missing some updates. – Bart van Ingen Schenau Oct 06 '21 at 08:18
  • Consider using a framework such as ROS. – JS Lavertu Oct 06 '21 at 13:51
  • Over a network (you mentioned HTTP in an answer comment), you inherently have to accept either eventual consistency and/or dropped messages. Depending on the content of the messages (relative vectors vs absolute positioning), this can create considerable issues with the movement of the robot arm. Your question is setting the bar high, but you're lacking the necessary analytical depth to actually weigh the options you need to weigh here. – Flater Oct 06 '21 at 14:52
  • @Flater thank you so much for the response. 100% agree. I'm taking a big step back and currently digging into the networking techniques of games, as suggested in an answer, to gain a better understanding of the issues I'm facing. – Doug Oct 06 '21 at 14:54
  • [..] I suggest you start analyzing what effects a [chaos monkey](https://arstechnica.com/information-technology/2012/07/netflix-attacks-own-network-with-chaos-monkey-and-now-you-can-too/) would have on the operation of your robot arm, list which downsides you can/can't live with, and then you can start considering which approach best protects against the downsides you can't live with. – Flater Oct 06 '21 at 14:54

1 Answers1

1

create an API that sits between the two — with the users client making an update request to the API with the coordinates and pushing them to the SCARA robot.

A classic HTTP API is most likely going to be too slow. But you need to start by defining the system and what you have available. What does the "client" look like? What does the networking environment look like? Are they in the same room being controlled visually, or is there a video link in the other direction (huge latency risk there).

The best case would be if the robot control PC and the client were on the same network, and using a continuous protocol for control. Websockets are probably adequate.

You might want to look at the networking techniques of games, since they focus heavily on latency management.

You will definitely need to consider safety: what happens if the link is lost, or latency spikes?

pjc50
  • 10,595
  • 1
  • 26
  • 29
  • Thank you for the response. Unfortunately, it will be over an internet connection which is making it more challenging. I'll dig into the networking techniques of games though! Thank you. – Doug Oct 06 '21 at 13:57
  • @Doug consider also looking into modern things like WebRTC, it can not only carry data, but also interfaces with the video api's for remote viewing. Web based games use this – Ferrybig Oct 06 '21 at 14:59
  • @Ferrybig thank you! – Doug Oct 06 '21 at 17:22