Skip to content

MBP-388: Safety Implementation - #23

Open
aslanliafichev wants to merge 41 commits into
masterfrom
MBP-388-safety-implementation
Open

aslanliafichev wants to merge 41 commits into
masterfrom
MBP-388-safety-implementation

Conversation

@aslanliafichev

@aslanliafichev aslanliafichev commented May 19, 2026 •

Copy link
Copy Markdown
Collaborator

This PR includes changes made MAIN related to SAFETY, the idea is that SAFETY functions from the safety controller PNOZmulti 2 will need to be configured by the programmer in TwinCAT depending on the instruments safety requirements and the specific safety functions written in the safety controller.

E_MMCSafetyFunctions is just an example of Safety Functions that are expected, furthermore MCC_SafetyFunctions includes structs describing what each incoming bit will represents.

For changes made to tc_mca_std_lib: https://github.com/EuropeanSpallationSource/tc_mca_std_lib/pull/54

@aslanliafichev aslanliafichev self-assigned this May 19, 2026
@aslanliafichev
aslanliafichev requested review from federrg, mac-kan, rubenmess and szilard-ess and removed request for szilard-ess May 19, 2026 08:14
@aslanliafichev
aslanliafichev force-pushed the MBP-388-safety-implementation branch from dbb5f32 to 0b08f72 Compare May 19, 2026 08:43
Updates DUT name from E_MCCSafetyFunctions
to E_SafetyFunctions.
Adds LED state for safety controller
Removes unused DUTs and places DUTs in progress
in WIP folder
Implements a hardware abstraction layer
for safety I/O
Implements DUTs for decoding raw PNOZ EtherCAT
input and output data into structs
Implements central DUT where all decoded raw
input and output signals from the safety
controller are gathered for structured access
Implements helper functions for handling raw
input and to output raw data back to the
safety controller.
Implements FB_MotionSafety for safety handling
with communication diagnostics, reference linking,
raw PNOZ EtherCAT input mapping, and cyclic output
writes through mLinkRefs, mReadECATInput, and
mWriteECATOutput.
Improves comments and keeps only necessary code to map
input/output from the safety controller.
@aslanliafichev

Copy link
Copy Markdown
Collaborator Author

The safety code has been updated to match the latest version currently running on ESTIA MCC3, MCC4, and MCC5.

This branch contains the base safety-code template required across the different MCC projects.

Notes about the structure

GVL_SafetyIO may differ between projects because safety-related
information can be mapped from different sources, including:

  • The safety controller
  • Technosoft drives
  • Hardwired signals connected directly to the CPU

Thus ST_Safety consisting of ST_SafetyIn/Out will look like a combination of these cases.

The base code is simple and I think the focus of this PR is to find a suitable way to map information despite project differences.

For example, MCC5 maps safety information from both the safety controller
and the Technosoft drives. The GVL_SafetyIO implementation included in
this pull request is based on the MCC5 configuration.

MCC-specific implementations

The complete MCC-specific safety implementations are available in the
following branches:

@aslanliafichev
aslanliafichev marked this pull request as ready for review July 14, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant