✅ (Solved) LinuxCNC + TwinSAFE | EL6900 information

More
06 Oct 2021 08:21 - 08 Oct 2021 09:16 #222338 by juniorfi
Hello,

I have been trying to find the way to implement TwinSAFE with LinuxCNC to have security terminals working on it. Unfortunately there is no information anywhere on how to implement it (updated...).

I saw some examples in the LCEC Github but those are made for/with TwinCAT 2 and now a days TwinCAT 3 is more used and there are not examples for them.
In my case, I have an EL6900|EL1904|EL2904.

Any hint will be more than helpful.


Regards
Last edit: 08 Oct 2021 09:16 by juniorfi.
The following user(s) said Thank You: abdelhalim

Please Log in or Create an account to join the conversation.

More
06 Oct 2021 11:07 #222346 by db1981
sorry i forgot....
<masters>
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="5">
<slave idx="0" type="EK1100"/>
<slave idx="1" type="EL1008"/>
<slave idx="2" type="EL1008"/>
<slave idx="3" type="EL1008"/>
<slave idx="4" type="EL1008"/>
<slave idx="5" type="EL2008"/>
<slave idx="6" type="EL2008"/>
<slave idx="7" type="EL7342"/>
<slave idx="8" type="EL7342"/>
<slave idx="9" type="EL9576"/>
<slave idx="10" type="EL6900">
<modParam name="fsoeSlaveIdx" value="11"/>
<modParam name="fsoeSlaveIdx" value="12"/>
</slave>
<slave idx="11" type="EL1904"/>
<slave idx="12" type="EL2904"/>
<slave idx="13" type="EL9505"/>
</master>
</masters>

this is the last ethercat_conf i have seen from you.

Does the slaves all reach ethercat op state?

explanation:

If you look in your TC3 Project,  Left Tree -> Devices -> Ethercat -> el6900 -> Connection Inputs  :
You will find the Twinsafe connections, in your case  Message_2 TX PDO and Message_3 TX PDO.
This are the connections between the Twinsafe Master EL6900 and the Slaves.

Message_2 is related to the EL1904 and Message_3 to EL2904. Inside the Lcec config you will have to tell the EL6900
which connection belongs to which slave id.
This happens with the modParam "fsoeSlaveIdx" , you have to do it in the same order they are listed in Twincat,  so in your conf file this is correct
first  "fsoeSlaveIdx" value="11" and in the second line  modParam modParam "fsoeSlaveIdx" value="12".

So, i hope the slaves all goes to op state. 

Please Log in or Create an account to join the conversation.

More
06 Oct 2021 11:28 #222347 by juniorfi
Hello,

Thanks for the reply. I managed to get the OP state in all the slaves. I'm taking a look inside the Lcec code. In concrete at lcec_el6900.h that looks like this.

Could you confirm me that is here where I have to change and declare the Slaves information?

i.imgur.com/Ppd04KW.png


Regards

Please Log in or Create an account to join the conversation.

More
06 Oct 2021 11:39 #222348 by db1981
I don't understand, what do you wan't to change or declare ? Nothing neccesary the code is working....

If the slave all goes to op, it's nice. FSOE Communication is working. You can check this if you look in Halshow -> el6900 there should be the 2 connections listed with FsoE CMD, DATA, CRC and ConnID at atleast CMD and DATA there should be values.....

How to go further im writing at the moment.....

Please Log in or Create an account to join the conversation.

More
06 Oct 2021 12:30 - 06 Oct 2021 12:40 #222350 by db1981
Twinsafe Group Inputs / Outputs

after getting your Twinsafe Cards to OP Mode and the FSOE Connection working,
you need to know at which of the standard IN and OUT Pins of the Safty PLC your
Twinsafe Group Pins are mapped.  

Look again in the Twincat Tree   Devices- Ethercat - EL6900
after the Twinsafe Connection Inputs/Outputs you will find the StandardInputs and
StandardOutputs. They are mapped from top to bottom to the correspondening  
std-in-0(..7) and std-out-0(..7) Pins of the EL6900.

In your case: (your TC Variable names are a little misleading...)

lcec.0.10.std-out-0  = b_ComErr
lcec.0.10.std-out-1  = b_Enable
lcec.0.10.std-out-2  = b_EstopError

lcec.0.10.std-in-0  = bErrAck
lcec.0.10.std-in-1  = b_EStopReset



Now you have to control your EL6900 for testing...

I suspect the red Error LED on the EL6900 is blinking after start,
this will be an ComError (Etherlab master is much slower then Twincat in
the startup, will cause that the FSOE Watchdog rises....)
You can check this with a look at lcec.0.10.std-out-0 (bComErr).


Set the lcec.0.10.std-in-0 (bErrAck) manualy to 1 (setp) and again to 0 to get the falling Edge,
Error Led should now be off..

If you now set lcec.0.10.std-in-1 (b_EtopReset) to 1 and 0 again, your estop circuit should turn on.


At my installations i have written an comp for resetting the com_error automatically at startup after the gui is loaded.




 
Last edit: 06 Oct 2021 12:40 by db1981.

Please Log in or Create an account to join the conversation.

More
07 Oct 2021 07:42 #222431 by juniorfi
Hello thanks for all the information. I will check and try all you sent me. I will be back if I got something.

Thanks again and regards.

Please Log in or Create an account to join the conversation.

More
08 Oct 2021 07:34 #222526 by juniorfi
Hello,

I did what you explained here, Actually I have this output from EL6900:

pastebin.com/4cx0R6qU

And this is all the pin information:

pastebin.com/BXCEWNHH

- Red led blinking from EL6900 is gone.
- Do I have to change something to be able to use the password used to configure the TwinSAFE? Or have to be as default?
- I have an EL2904 connected into a conductor and send the power to a EL9576. I changed all the lcec.0.12.out-* values to 1 but nothing is happening. Do that means that is not comunicating at all with the EL6900?


Regards

Please Log in or Create an account to join the conversation.

More
08 Oct 2021 07:49 #222527 by juniorfi
Got that working! Thanks a lot!

I will try to make a good documentation for that.

Please Log in or Create an account to join the conversation.

More
08 Oct 2021 08:32 #222529 by juniorfi
Could you tell me please, from where you figured out what was the pins for those?:


lcec.0.10.std-out-0 = b_ComErr
lcec.0.10.std-out-1 = b_Enable
lcec.0.10.std-out-2 = b_EstopError

lcec.0.10.std-in-0 = bErrAck
lcec.0.10.std-in-1 = b_EStopReset


To have a look and write that down. Thanks

Please Log in or Create an account to join the conversation.

More
08 Oct 2021 08:35 #222530 by db1981
- Do I have to change something to be able to use the password used to configure the TwinSAFE? Or have to be as default?

No, you can't configure this Twinsafe stuff with linuxcnc. All Configuration has to be done with Twincat. The safty project gets stored inside the device with AoE and EoE communication. (there is a way to store a hex.bin file with the project manually to the twinsafe cards, but for creating the file Twincat is needed again...)

All Safty Settings (input checking, output checking, input link, etc...) and the Logic is then stored in the Safty devices, and recalled at power up. The complete Safty System acts as an blackbox, you can't set outputs directly, i created the pins for the safty in and out cards only for diagnosis.
The only Interface to linuxcnc ( in Twincat the same) are the standart in and out pins of the Safty PLC (EL6900)

The safty cards talk to each other, the ethercat master handles the communication for this.
if you look at this:

13 u32 OUT 0x00000036 lcec.0.10.fsoe-0-master-cmd
13 u32 OUT 0x00000001 lcec.0.10.fsoe-0-master-connid
13 u32 OUT 0x00004991 lcec.0.10.fsoe-0-master-crc
13 u32 OUT 0x00000000 lcec.0.10.fsoe-0-master-data
13 u32 OUT 0x00000036 lcec.0.10.fsoe-0-slave-cmd
13 u32 OUT 0x00000001 lcec.0.10.fsoe-0-slave-connid
13 u32 OUT 0x00002E0C lcec.0.10.fsoe-0-slave-crc
13 u32 OUT 0x00000005 lcec.0.10.fsoe-0-slave-data

this 2x4 PDOs are the data which are transfered between the safty devices.
For each Twinsafe connection (fsoeslaveidx) that is defined in the ethercat-conf.xml such an block is created. The master pdos are send from the ethercat master to slaves and the slaves pdos are the date the ethercat master receives from the slaves and send back to the Safty Plc. You can see if the communication works when master/slave ConnID and master/slave CMD Pdo has the same values.

The important fact to get your safty system running is only to know on which of the std-in and std-out the rigth Twinsafe Group IN/OUTs are on. (ErrAck, Run/Stop, FBxx...)
The following user(s) said Thank You: juniorfi

Please Log in or Create an account to join the conversation.

Time to create page: 0.086 seconds
Powered by Kunena Forum