Using the robot as a PLC

Hi all,

I’m an intern and soon to be Automation Engineer.
As part of my final semester, I have to do a bigger self chosen project.

I’m contemplating doing a project, where I use the robot as a PLC.
Picture this:

I have 5 push buttons connected as inputs. I also have x amount of outputs.
I would like to be able to control the logics, so for example I press button 1, output 5 goes high.
Simple logics to begin with.

After reading and googling quite a few topics here, I turn to this forum for some guidance.
I’ve thought of making a URCap that can execute the logic behind the scenes, as I wan’t the functionality even if the robot program is stopped (perhaps even if the robot arm is powered off).
Other possible solutions I have stumbled upon are Python scripts run on the Linux kernel itself - but I’m not sure this would work with I/O.

So the question boils down to:
Which - if any - approach would you recommend or propose in order to solve this task?
Python scripts, URCaps, perhaps GUI-programming in Polyscope?

Hope my question was clear.
Any guidance is much appreciated

Best regards,
Mikkel

3 Likes

You could use python script and control the IO over RTDE. There are examples on the support site of using RTDE for control. The arm will need to be powered on but not necessarily initialized as you would need the RTDE server to be streaming and listening for data.

I did something like this years ago where the robot was used to to turn on a device using an output and relay and then monitor analog data, it ran 4 of the devices for life testing and turned them on for 1 minute, off for 30 seconds until we had 400 hours of run time on the device. It did all of this in a round robin fashion. We even used relay logic to turn the two analog inputs into 4 inputs by building a multiplexer. We actually had a bigger project where the robot controlled 16 motors and measured the starting current on each through a single analog input, we just used relays and outputs on the robot to build the multiplexer.

This sounds like a really fun project.

@mivb I shocked after reading this post. When i read the title robot as a PLC. Tell me how robot as a PLC. You need to make sure that what you wrote about this.

@sandersbud4 I’m sorry, but what?
I believe I explained in sufficient detail what the intention is.
Please elaborate on what you mean by your reply?

I would follow the advice of mbush and do this in a daemon and/or with Python script. I think the choice of using script depends on how editable you want this to be for other users. If the logic is hard-coded then you are going to get the best reatime performance. I would not do this within java if your goal is to keep it robust and possibly productize it (only because I don’t think you should be doing control tasks in java). You should also be careful that your code does not get stuck in any unintended tight loops and starve the rest of the control system for cpu cycles.