In this article, we will use Beckhoff TwinCAT 4026 and EL6910 to set up an EtherCAT and FSoE network and perform safety communication with Pilz’s PSEN rd1.x.The article also describes the detection area of Radar.
Come on, let’s enjoy FA.
Reference Link
Detection Area of PSEN rd1.x SD I
The field of view of each sensor in PSEN rd1.x SD I can consist of up to four detection fields, each of the four detection fields has its own dedicated detection signal.
Angular coverage
Angular coverage has the following values
- 10° to 100° in the first 5 meters (16.4 feet) of the field of view
- 10° to 40° range in the first 5 to 9 meters (16.4 to 29.5 feet) of the field of view.
The angular range of the detection field must be wider than or equal to the angular range of
Detection distance
The detection distance of the first detection field is from the sensor. The detection distance for a given field begins where the detection distance for the previous field ends.
The detection distance for one or more fields can be set to 0 (e.g., in the example below, detection field 3 was set to 0). The first detection field with a non-zero detection distance (e.g., detection field 1) will have a minimum detection distance of 200 mm.
Safety working modes
The PSEN rd1 Configurator allows each sensor to select the safety operating mode it will employ in each sensing field:
- restart prevention function(default):
- The sensor performs the access detection function during normal operation (no alarm condition).
- When the sensor is in alarm status, it performs the restart prevention function.
- Always-on access detection:
- The sensor always performs the access detection function (no alarm condition + alarm condition).
Detection fields dependency and detection signal generation
When the sensor detects movement in the detection field, the status of its detection signal changes and, depending on the configuration, the associated safety output is deactivated. The behavior of the outputs associated with the following detection fields depends on the dependency set of the detection field:
IF Dependent mode is set…
If Dependent mode is set and the detection fields are dependent on each other, when the sensor detects motion within a detection field, all outputs associated with the next detection field are also deactivated. Here is an example of detection.
- Detection fields set: 1, 2, 3
- Detection field with target detected: 2
- Alarm condition detected field: 2, 3
IF Independent mode is set…
Independent mode is set so that when the sensor detects motion within a detection field, the detection fields are independent of each other and only the outputs associated with that detection field are deactivated. Here is an example of detection.
- Detection fields set: 1, 2, 3
- Detection field with target detected: 2
- Alarm status detected field: 2
It is important to note that if the detection field is independent, the safety of the monitored area should be assessed during the risk assessment. Dead zones created by targets may prevent the sensor from detecting targets in the detection field below.
Example
In this example, for targets [A] and [B], detection fields 1 and 2 generate detection signals, respectively.
In this example, detection field 1 will produce a detection signal for target [A], but will not detect target [B].
use case
An example of the use of Independent mode is when it is useful to set the detection field as independent, such as when temporary movement of an object is planned within the detection field. As shown in the figure below, a robot arm might move from right to left within detection field 1 only during certain phases of the motion cycle.
That setting allows the detection signal in detection field 1 to be ignored, avoiding unnecessary downtime.
It is important to note that before deciding to ignore the detection signal in detection field 1, evaluate the safety of the monitored area with a risk assessment.
The blind spot areas created by the moving robot arm also prevent the sensor from detecting targets in other detection fields at time intervals. This time should be taken into account when defining the detection distance in detection field 2.
SafeCounter
SafeCounter is used to realize an up/down counter. The data types of the inputs Reset, CountUp, and CountDown are BOOL, as are the outputs Error, CounterOut, and CounterZero.
The output ActValue then indicates the current internal counter value, data type INT16, UINT16, INT32 or UINT32.
The parameters Preset Value and Counter Limit are used to parameterize the counter. When a logic 1 signal is input to the input Reset, the internal counter value is set to the value parameterized by Preset Value. The rising edge of input CountUp increments the internal counter value by 1.
When the counter value specified by CounterLimit is reached, the output CounterOut is set. When the counter value reaches 0, the output CounterZero is set.
If the TwinSAFE group is started (Run=1) and the reset input is TRUE, the output ActValue is set to PresetValue. When the group stops, ActValue is set to 0.
FB Counter inputs
Variable | Permittedtype | Data Type | Description |
Reset | TwinSAFE-InFB-OutStandard-InTwinSAFE SC | BOOL | Reset input to reset counter to preset value |
CountUp | TwinSAFE-InFB-OutStandard-InTwinSAFE SC | BOOL | CountUp input to increment the internal counter. |
CountDown | TwinSAFE-InFB-OutStandard-InTwinSAFE SC | BOOL | CountDown input to decrement the internal counter value by 1 |
FB Counter outputs
Variable | Permittedtype | Data Type | Description |
Error | TwinSAFE-OutFB-InStandard-Out | BOOL | Error output |
CounterOut | TwinSAFE-OutFB-InStandard-Out | BOOL | Output is set when the counter reaches its upper limit. |
CounterZero | TwinSAFE-OutFB-InStandard-Out | BOOL | Output is set when internal counter value is 0 |
ActValue | TwinSAFE-OutFB-InStandard-Out | INT16UINT16INT32UINT32 | Current internal counter value |
Implementation
Pilz PSEN rd1.x Side
Now we can Configure the PSEN rd1.x system.
Download Tools
Download the PSEN rd1.x Configurator Tools from the Pilz website.The tool has the following features
- Configure the system
- Create configuration reports
- Check system functionality
- Download system logs
To use the configurator, PSEN rd1.x must be connected to a computer with a data USB cable or an Ethernet cable if an Ethernet port is available.
Factory Reset
Press and hold the button below to return PSEN rd1.x to factory settings.
Start
The tool downloaded from Pilz HP has an Installed version or a Portable version, which can be used depending on the operation.
Connect via USB/Ethernet
Connect the USB Port or Ethernet as shown in the figure below to the PC.
Start Tool
Select Ethernet connection, enter the IP address of PSEN rd1.x and proceed with CONTINUE.(Default IP address is 192.168.0.20)
Setup Password
Set Password to PSEN rd1.x back to factory settings.
Hardware Configuration
Set the Hardware to be used for Hardware and proceed with PROCEED.
Country
Select the country where PSEN rd1.x will actually be used and proceed with PROCEED.
Stationary
Let’s set up the PSEN rd1.x application and apply the settings in END CONFIGURATION.
Please wait a moment…
Result
Done!
Node ID Assignment
Set or reset the CAN ID of the Rader sensor in Settings>Node ID Assignment.
Factory Reset
It is also possible to restore the device to factory settings by going to Administrator>FACTORY RESET.
Network parameters
You can change the IP address of the device in Network Parameters.
MODBUS Parameters
You can enable the device’s Modbus TCP Server with MODBUS Parameters.
Fieldbus Parameters
Set the FSoE address of PSEN rd1 in Fieldbus Parameters.
Configuration
Now open the Configuration Tab and configure the detection settings for Pilz’s PSEN rd1.x.
Click on Radar and you can select the Detection Area you wish to set with DF #.
Detection Fields
This one sets the detection distance for the corresponding D.F#.
Angular coverage
This sets the detection angle for each Detection Area.
Restart timeout
This is the delay time required to restore normal operation.
DF1/DF2/DF3/DF4
Set up other Detection Areas as well.
TwinCAT Side
The next step is to set up the TwinCAT side.
Download ESI File
Download the ESI File from the link below.
Install ESI File
Store the ESI File downloaded earlier in the following Directory.
(I am using TwinCAT3 4026)
C:\Program Files (x86)\Beckhoff\TwinCAT\3.1\Config\Io\EtherCAT
Add EtherCAT Master
Click on Devices>Right Click>Add New Item.
Select EtherCAT>EtherCAT Master.
Set the Ethernet Interface to be used as EtherCAT Master.
Scan network
Right-click on the EtherCAT Master you just added>Scan to detect the EtherCAT Slave.
Done!
Pilz’s PSEN rd1.x was also detected.
Add PLC
Next, to add a PLC project, go to PLC>Add New Item.
Select Standard PLC Project > Add to proceed.
Done!PLC projects have been added.
Add GVL
Now add a Global Variables List to define the variables to be exchanged with EL6910.
This is the variable defined in this article.
{attribute ‘qualified_only’} VAR_GLOBAL Run AT %Q*:BOOL; Ack AT %Q*:BOOL; CounterError ,CounterOut ,CounterZero AT %I*:BOOL; CounterValue AT %I*:INT; END_VAR |
Build Solution
Next, compile your project at Build>Build Solution.
Active Configuration
Donwload the TwinCAT project to the PLC.
OK to proceed.
Switch TwinCAT3 to Run Mode.
Login
Download the program in Login.
Proceed with Yes.
Finally, click the Play button to start the PLC program.
Add Safety Project
Now go to SAFETY>Add New Item to add the Safety project.
Select the Safety Project Template for TwinCAT3 and proceed with Add.
Select Hardware Safety PLC >Ok to proceed.
Done!The TwinSAFE project has been added.
Configure Target System
Click on Target System and set the EL6910 used in the article as the Target system.
Set the FSoE Master to be used from the Target System item.
Set EL6910 from the Drop-List.
Click on the button next to Physical Device to specify the EL6910 to be used within the actual EtherCAT network.
Done!
Configure Alias Devices
Now right-click on the Alias Devices Folder>Add >New Item.
Add Pilz’s PSEN rd1.x 2 Bytes used in this article.
Done!
FSoE Address
Set the FSoE address of Pilz’s PSEN rd1.x to match the configuration.
Physical Device
Also click on the button next to Physical Device to set the PSEN rd1.x Safety Radar that will actually be used.
Done!
Watchdog
Configure the FSoE network monitoring Watchdog to match your application.
Error Ack
The next step is to connect the ErroAcknowledgement variable with the PLC project variable.
Click the button next to Linkedin.
Select the variables you have just defined for your PLC project.
Add new Digital Output/Input
If you want to add other variables, do the same operation as before, Alias Devices>Add >New Item.
Choose Standard and set it to match the data type of the variable in your PLC project.
Result
Done!Don’t forget to connect those variables with those defined in the PLC project.
GVL
Define safety variables and tie them to Pilz’s PSEN rd1.x FSoE data.
Safety Program
The final step is to create a safety program.
Network1
Network1 transfers all safety variables to internal safety variables using SafetDecoupleFB.
Network3
Network3 outputs sDetectionFieldOK only when all detection areas of Pilz’s PSEN rd1.x are also OK.
Network2
Each time sDetectionFieldOK is turned on, the Count value of SafetCounter is increased.
Network4
Transfers the state of SafeCounter to a variable in the PLC project.
Check Safety Program
Now that you have finished creating the safety program, compile the safety project using the button in the red frame.
Download Safety Program
Download the compiled safety program to the EL6910.
Enter your Login information and press Next to proceed.
Select Complete Project Data and press Next to proceed.
Check the Download result and press Next to proceed.
Check the status of the project and proceed with Next.
Enter your Password again and restart EL6910.
Result
This is the test environment for this project.
First disable Dependenty Mode.
Next, only object 1 is placed.
The Monitor tool detected that there is stuff in DF3.
Next, place things on DF2 as well.
The Monitor tool detected that there is stuff in DF2.
Now enable Dependency Mode.
Place the two objects in the DF area.
Alarms are also output to DF2, DF3, and DF4.
Looking at the TwinSAFE side, SafeCounter is also working properly.