Difference between revisions of "PLC Interface"

From Wiki
m (Added configuration category)
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
It is often necessary to integrate the robot into a production system. One component is normally the master that orchestrates the other devices. With this interface the CPR robot can be controlled by a master, e.g. a [[Glossary|PLC]]. The PLC sets digital inputs to reference, reset and enable the robot, and it can start/stop the loaded program. The robot provides information on its current status using digital outputs.
+
The most basic way to integrate a robot into a production system is our PLC interface. By sending signals on digital inputs and outputs a [[Glossary|PLC]] can send commands and receive status information. It also allows connecting buttons and lights for a simple display-less control by users.
  
Availability: This feature is available since CPRog V902-09-011 (August 2017). Please see [[CPRog Updates]].
+
'''Video Tutorial''' https://youtu.be/A5bhbdmGZXU
  
----
+
=Available Channels=
'''1. Available Channels'''
 
  
Inputs from the Master to the Robot:
+
The inputs execute the following functions on rising edges:
* "Enable": The first rising edge will reset all errors, the second rising edge (min. 1 s later) will enable the robot. When the robot is enable, that means it is in "No Error" state, it will set the "NoFault" output high.
+
* "Enable": When in error state the errors are first reset. A second rising edge (at least 1s later) will enable the motors (the Fault/NoFault outputs will change). If the motors are enabled (no fault present) a rising edge will disable them.
* "RequestReference": A rising edge will start the reference procedure for all joints. The joint sequence (which joint at first, ...) is defined below. After referencing the robot is in an error state, reset and enable have to be done.
+
* "RequestReference": A rising edge will start the reference procedure for all joints.
* "Play": The first rising edge will start the currently loaded robot program, the second will stop (not pause) it. The program that is loaded at startup is also defined in the project file in line 5, or it is set automatically when saving the project.
+
* "Play": The first rising edge will start the currently loaded robot program, the second will stop (not pause) it.
 +
* "Pause": The rising edge will pause the program. If a program is paused it will be continued on another rising edge.
 +
* "Alt-Start": Two-button-control: Depending on the current state successive rising edges will: reset errors, enable motors, reference (if necessary) and start the loaded program.
 +
* "Alt-Stop": Two-button-control: Depending on the current state successive rising edges will: Pause the program, stop it, then reset errors (which disables the motors).
 +
* "Shutdown": Turns the embedded control computer or PC down.
 +
* "Start platform mission": Start the selected platform mission.
  
 
Outputs from the Robot to the Master:
 
Outputs from the Robot to the Master:
 
* "NoFault": This output is high when the robot is in "No Error" state
 
* "NoFault": This output is high when the robot is in "No Error" state
* "ProgramRunning": This output is high when the robot program is running.
+
* "Fault": The opposite of No Fault
 +
* "Program Running": This output is high when the robot program is running.
 +
* "Program Not Running": The opposite of Program Running
 +
* "Robot Is Referenced": This output is high when all joints are referenced.
 +
* "Platform Mission Running": This output is high when the platform mission is running.
  
----
+
=Configuration=
'''2. Configuration'''
 
  
The configuration of the PLC Interface is done in the project file, found in c:\CPRog\Data\Projects\
+
The PLC interface can be set up graphically using CPRog/iRC or by manually changing the configuration files.
  
* For the robolink D arms please use [[Additional_DIO-Modules#Use_in_CPRog_Programs|DIO numbers]] 21 to 27 '''reduced by one''', these are the seven inputs and seven outputs of the first DIO module of the SIN-Rail robot control electronics. Digital Output 26 means the last output of DIO module 1.
+
* Start CPRog/iRC and load the correct project for your robot
 +
* If your robot is using an embedded control (TinyCtrl) connect it
 +
* Click File -> Configure Interfaces -> PLC interface
 +
* Enable the PLC interface by checking 'Active'
 +
* Enter the DIn numbers according to your wiring. Unused functions can be disabled by setting a DIn number that does not exist, e.g. 1.
 +
* Click "Save project". The PLC interface should be enabled immediately.
  
* Note that early '''robolink DCi''' robots were shipped with only 4 digital outputs instead of 7, which is the standard for the DIN-rail system, hence digital output numbers 24, 25, 26 in the code snippet below would have to be '''21, 22, 23''' respectively. This would be the second, third and fourth digital output of the DIO module of the DCi (see [[DCi_quickstart_guide#DIO_Module_PinOut]]).
+
[[File:CPRog_Config_PLC_Interface.PNG|800px]]
  
 
+
[[Category:Configuration]][[Category:CPRog]][[Category:TinyCtrl]]
The first line activates the PLC interface and tells the software to automatically connect to the CAN bus.
 
The second line defines the which input channels to use, the third line defines the output input channels.
 
The last line defines the sequence of referencing the joints.
 
 
 
<syntaxhighlight lang=xml>
 
<PLCInterface Active="True" AutoConnect="True"/>
 
<PLCInterfaceIn EnableNumber="24" RequestReferenceNumber="25" PlayNumber="26" />
 
<PLCInterfaceOut NoFaultNumber="25"  ProgramRunningNumber="26"  RobotIsReferenced="24"/>
 
<PLCInterfaceRefSequence JointToRef0="2" JointToRef1="1" JointToRef2="3" JointToRef3="4" JointToRef4="0" JointToRef5="-1" JointToRef6="-1" JointToRef7="-1" JointToRef8="-1"/>
 
</syntaxhighlight>
 
 
 
=Activate PLC interface in TinyCtrl=
 
This is only relevant, if you are using a DCi robot or an external linux system mounted on the DIN rail to control the robot.
 
 
 
In addition to the steps described above you'll need to gain access to the linux PC to make the same changes on that system: [[FTP_and_putty_Access]].
 
The file to be edited is located here:
 
/home/root/TinyCtrl/Data/Projects/EmbeddedCtrl.prj
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
[[Category:CPRog]]
 

Latest revision as of 16:47, 8 March 2023

The most basic way to integrate a robot into a production system is our PLC interface. By sending signals on digital inputs and outputs a PLC can send commands and receive status information. It also allows connecting buttons and lights for a simple display-less control by users.

Video Tutorial https://youtu.be/A5bhbdmGZXU

Available Channels

The inputs execute the following functions on rising edges:

  • "Enable": When in error state the errors are first reset. A second rising edge (at least 1s later) will enable the motors (the Fault/NoFault outputs will change). If the motors are enabled (no fault present) a rising edge will disable them.
  • "RequestReference": A rising edge will start the reference procedure for all joints.
  • "Play": The first rising edge will start the currently loaded robot program, the second will stop (not pause) it.
  • "Pause": The rising edge will pause the program. If a program is paused it will be continued on another rising edge.
  • "Alt-Start": Two-button-control: Depending on the current state successive rising edges will: reset errors, enable motors, reference (if necessary) and start the loaded program.
  • "Alt-Stop": Two-button-control: Depending on the current state successive rising edges will: Pause the program, stop it, then reset errors (which disables the motors).
  • "Shutdown": Turns the embedded control computer or PC down.
  • "Start platform mission": Start the selected platform mission.

Outputs from the Robot to the Master:

  • "NoFault": This output is high when the robot is in "No Error" state
  • "Fault": The opposite of No Fault
  • "Program Running": This output is high when the robot program is running.
  • "Program Not Running": The opposite of Program Running
  • "Robot Is Referenced": This output is high when all joints are referenced.
  • "Platform Mission Running": This output is high when the platform mission is running.

Configuration

The PLC interface can be set up graphically using CPRog/iRC or by manually changing the configuration files.

  • Start CPRog/iRC and load the correct project for your robot
  • If your robot is using an embedded control (TinyCtrl) connect it
  • Click File -> Configure Interfaces -> PLC interface
  • Enable the PLC interface by checking 'Active'
  • Enter the DIn numbers according to your wiring. Unused functions can be disabled by setting a DIn number that does not exist, e.g. 1.
  • Click "Save project". The PLC interface should be enabled immediately.

CPRog Config PLC Interface.PNG