Control Sheet Cosylab’s Newsletter Volume 23
ISSN: 1855-9255
June 2015 Table of Contents
2
Paying homage to our roots We report on the successful conclusion to the Cosylab-sponsored student competition.
4
MedAustron: Supporting Oncology for the Future
6
Communication between OPC UA and EPICS
9
The Picture Board
MedAustron is one of the most advanced facilities for ion beam therapy and research in Europe. We look at the project as it nears completion.
In the industrial world, many devices use OPC as their communication protocol. However, in experimental physics control systems, EPICS CA is frequently desired in the control room and central servers. We a look at the options for integrating OPC UA with EPICS.
Pictures from the finals of the IEEE-Cosylab Student Competition.
Cosylab d.d., Teslova ulica 30, SI-1000 Ljubljana, SLOVENIA Phone: +386 1 477 66 76 Email: controlsheet@cosylab.com URL: www.cosylab.com
page:
Volume 23
Control Sheet
2
ISSN: 1855-9255
Paying homage to our roots By : Jaynie Padayachee (Cosylab) & David Pahor (Cosylab) The first student competition that Cosylab sponsored has come to a successful conclusion!
In the beginning Cosylab has its origins in the late Nineties when a group of students gathered around a visionary mentor and collaborated on a big physics project where a certain control system played a significant part [1]. The group successfully delivered the control system to the customer and, as it is often said in the movies, the rest is history. That is why we have not forgotten our student roots! We always acknowledge, both, our own beginnings and the beginnings of current gifted students from the technical and science faculties which have contributed so much to our success over the past 14 years, since these are the faculties that most of our employees studied at. We also see it as our social responsibility to give back to the community that has helped us become the company that we are today. One of the ways that we can contribute to student interests in the fields
of applied computing, electronics, physics and systems integration is by sponsoring competitions where the skills of young engineers can be exhibited to a wider audience of peers. Such an event also provides the opportunity for like-minded young people to meet and collaborate in a fun way and learn much about project management, presentation, cooperation, evaluation and overcoming real-life technical hurdles. We grabbed onto the opportunity to collaborate with the IEEE Student Branch of Ljubljana, who have extensive experience from organising previous student competitions, and so the logistics of the competition were executed flawlessly.
The Premise Students had to design, produce and present a project using the Arduino Due microcontroller [2] board. Competitors had to create their own electronic circuitry
that connected to the microcontroller and write the corresponding programs to operate the entire system. There were no limitations as to the type of system that had to be controlled and this yielded some fun entries :)
Blast-off The competition was launched on 4 November 2014 at the Faculty of Electronic Engineering of the University of Ljubljana. There were at least 100 students that attended the launch where the IEEE Student Branch of Ljubljana and Cosylab gave overview presentations. Even the presentation of the competition rules did not deter the attendees, who clearly used the time to come up with ways that they could turn the rules to their advantage, as judged by the questions that were asked in the Q&A session afterwards. The creativity of the students in trying to bend the rules promised some interesting entries, and we were not disappointed!
The Proposals and the Short-list Students had 4 weeks to submit a project proposal, where they had to describe their project and include a rough estimate of cost and also any technical diagrams that they had. The response to the call for proposals was much better than anyone could have imagined, with 24 project proposals submitted by the deadline. In typical student-fashion, most proposals arrived in the last few hours before the deadline, showing that they were really taking it down to the wire in the best of engineering traditions :) Of the 24, the 9 best proposals were selected and their teams were given Arduino Due microprocessor boards to use in the Contestants of the first Cosylab-sponsored student competition.
page:
Volume 23 building of their project. The projects selected were: n automated aquaponic system, ◊ A where the filtered-out refuse from a fish tank was fed to a small vegetable garden as fertilizer; ◊ An automatic system for detecting cars driving the wrong way on motorway entrances and exits, where micro-
wave transceivers were used to measure the Doppler shift of vehicles and trigger an alarm if wrong-way ingress was detected; ◊ An automatic coffee maker with rf id in the cup, where the system recognized the rf tag and prepared coffee in accordance with the user-taste profile associated with the tag; ◊ Interactive Clothing for Cyclists, where the developer envisioned integrating light-emitting functionality into a bicyclist’s clothing, enhancing signalization and visibility on the road; ◊ Project Hybrid Letterbox, where the designers envisioned a smart letterbox sensor-equipped system, that would notify recipients that mail had physically arrived; ◊ Robert Project – a smarter vacuum cleaner, where a robotic vacuum cleaner was guided though its cleaning territory via a WI-FI connected central unit that processed the images from commodity surveillance IP cameras; ◊ Security System for Bicycles, where the central unit communicated with the owner via SMS messaging and enabled remote locking/unlocking and tracking of the bicycle’s location; ◊ The Local Brewery, where a home brewery system with multiple pre-set beer-types was envisioned, to be controlled with actuated valves for liquid flow, heaters and temperature sensors, with additional pH meters as a future option;
Workshops and Finals We followed the tried and tested method of previous IEEE student competitions, and hosted 2 workshops for the competitors, with the first covering how to write technical articles and the second spotlighting the presentation skills needed to describe a project to an audience.
Control Sheet The finals of the competition was held on 15 April 2015 at the Faculty of Electrical Engineering and of the 9 teams originally selected, 8 of these made it through to the end – again, a very good showing! These teams presented and demonstrated their projects to an audience of about 100 who were all thoroughly entertained, and even got a chance to taste some of the beer manufactured by “The Local Brewery” project.
And the winners are… The winners were chosen based on points given for their written article, their live presentation, their demonstration of the working project “machine” at the finals and the points awarded to them by the audience. The latter was included as a measure of how well the teams could market themselves to their friends and family! With all of this, the first place went to the team of Aljaž Blatnik, Kaja Jarm and Janko Bukovec for their automatic system to detect cars driving the wrong way on motorway entrances and exits. This was followed by Janez Cimerman’s smarter (ultimate) robotic cleaner, Robert, and in third place by the security system for bicycles by the team of Urban Senica, Blaž Prah and Urban Rupnik.
3
ISSN: 1855-9255
ABOUT THE AUTHORS Jaynie Padayachee joined Cosylab in 2013 as a Technical Writer, which combined the experience from her previous positions as an Ion-Beam Analysis Material Scientist in an accelerator laboratory, an open source text-book editor and R&D portfolio assistant/researcher at a synthetic diamond manufacturer. Jaynie has a Ph.D. in Physics for work on computer-aided diagnosis of mammograms and has recently added more analytical Project Office duties to her Technical Writing. To relax, Jaynie enjoys reading, watching movies, beading, baking with alternative ingredients and - of course “testing” the results of the baking :) David Pahor has a Bachelor’s in Physics and has been twiddling with computers from the late 70’s onwards. He wrote his first Kalman filter with the original smuggled copy of the HISoft Pascal compiler for the Spectrum ZX. His youth was misspent writing C for testing and measurement systems with the IEEE-488 interface bus. David has written technical articles, translated software, developed web applications when broadband was a novelty act, designed and programmed server applications with the first commercial NoSQL database (from Lotus) and managed projects when server clusters started to be misnamed as the cloud. He has just moved from Cosylab’s HRM to the OverSeas Team where he will be overcoming challenges for Cosylab’s presence in lands far and wondrous.
Conclusions At Cosylab we are more than satisfied with the outcome of the competition and are glad we could cooperate with the IEEE Student Branch in Ljubljana in working on a purposeful student-team event. We found the competition to be intriguing, challenging, joyful, tense, informative, team-building and - in the end - tearful and tension releasing! We hope that we were able to give the students involved a taste of “real-world” circumstances of project management and execution while not constraining them in their dreams and aspirations.
REFERENCES [1] http://www.cosylab.com/about_cosylab/ history/ [2] http://www.arduino.cc/en/Main/arduinoBoardDue
First, second and third place teams (from top).
page:
Volume 23
Control Sheet
4
ISSN: 1855-9255
MedAustron: Supporting Oncology for the Future By : Luka Šepetavc (Cosylab) and Rupert Langegger (MedAustron) MedAustron is one of the most advanced facilities for ion beam therapy and research in Europe.
Cancer Worldwide
Enter MedAustron…
According to the International Agency for Research on Cancer, world-wide, in 2012, there were 14.1 million new diagnosed cases of cancer, 8.2 million cancer-related deaths and 32.6 million people living with cancer (who had been diagnosed in the previous 5 years) [1]. Of the various modalities available for treatment, ion beam therapy directly targets the DNA of cells. This makes cancer cells particularly vulnerable to ion beam therapy because of their high rate of division and the fact that they have difficulty repairing damaged DNA. Ion beam therapy is also more focused on the sites that need the treatment, resulting in reduced damage to surrounding tissue making it more effective in sensitive areas like the brain [2].
MedAustron is based around a synchrotron accelerator that will be used for cancer treatment as well as for medical and non-medical physics research, and is situated in Wiener Neustadt in Austria. The first patient treatments are planned for 2016, and installation and commissioning of the particle accelerator is already well under way. Only recently, the first of the state-ofthe-art, highly accurate patient positioning systems have been commissioned. The latter means that treatment is received where it is needed. [3][4]
The Accelerator The MedAustron accelerator will deliver beams of protons (energies ranging between 60 and 800 MeV/u, with a maximum
of 250 MeV for therapy) and carbon ions (energies ranging between 120 and 400 MeV/u). The accelerator features multiple ion sources, a Linac, a synchrotron and five beam lines including a proton gantry. [5, 8] We can consider the Control-System (CS) for the accelerator side of the operation to be more “industrial”, however certain development processes had to be followed. These allow for repeatable configuration and usage of all components as well as traceability between requirements and implementation. Robust architecture and very good documentation are also very important. Cosylab has been working closely with the MedAustron CS (MACS) team – initially based at CERN in Geneva, and later at Wiener Neustadt – since 2010 and we have contributed a significant amount of development to the core control system. We recently successfully completed site acceptance tests, having MACS working, allowing physicists to focus on beam commissioning.
Beam Delivery The delivery of the beam is one of the most important parts in any medical accelerator. It is no different for MedAustron so much attention was put into the careful construction of this aspect.
Figure 1: The overall construction of the facility is complete and commissioning of the various systems is well under way. Photo Credit: MedAustron [3]
Beam delivery is responsible for providing beam to the patient with extreme accuracy and the strictest safety. Essential systems that make up beam delivery are the treatment control system, the dose delivery system and the patient safety systems. The treatment control system, provided by radART [6], configures all systems involved in the beam delivery and acts as a user interface for the clinical personnel. The dose delivery system, provided by CNAO [7] and integrated by Cosylab, delivers the dose to the patient by precisely scanning the beam
page:
Volume 23
Control Sheet
within the boundaries of the tumor. Patient safety systems, provided by Cosylab, ensure safe treatment of the patients and immediate termination of the beam in the case of any anomalies. All of these components are subjected to medical certification and are therefore designed and developed according to high medical standards. Extensive planning, documentation and testing are needed to ensure safe operation and compliance with medical standards.
[1] International Agency for Research on Cancer. (http://globocan.iarc.fr/Pages/ fact_sheets_cancer.aspx) [2] Proton Therapy (http://en.wikipedia.org/ wiki/Proton_therapy) [3] MedAustron (http://www.medaustron. at/en) [4] New technology allows accuracy in the treatment of cancer never achieved before (http://www.medaustron.at/ en/2015/05/neue-technik-ermoeglichtnie-da-gewesene-praezision-in-derkrebsbehandlung/)
Getting to a Medical Accelerator Figure 3: Proton gantry. Photo Credit: MedAustron [3]
generic accelerator and a beam delivery together and expecting them to work would be naive. Both the accelerator and the beam delivery need to be carefully designed to work together seamlessly. Even the smallest subsystems can compromise the final operation of the facility if they are not chosen properly, thus making it very challenging or impossible to reach the targeted requirements for speed, uptime and throughput. With comprehensive knowledge and experiences of medical accelerator such challenges can be overcome, bringing the facility faster to operation and patients to receive the treatment.
Conclusions When the MedAustron facility is fully operational, as many as 1 200 patients are expected to be treated annually, thereby giving cancer patients the opportunity to access these effective treatment modalities and ultimately increasing the cancer survival rate, worldwide. [3]
Figure 2: A scale model of the facility. Photo Credit (top): MedAustron [3]
ISSN: 1855-9255
REFERENCES
At the moment, the beam delivery is being commissioned at MedAustron. The final touches are being put into place in order to prepare the facility for the first patients, next year.
Compared to experimental and research accelerators, where downtime is not as problematic and the patient throughput is not a priority, the story is different for a commercial hadron therapy facility. A commercial medical accelerator needs to work reliably, safely and allow efficient treatment so that as many patients as possible can benefit from it. The overall architecture of the system plays an important role in reaching these requirements. Plugging a
5
[5] The MedAustron Accelerator Control System, J. Gutleber, A. Brett, R. Moser, M. Marchhart, C. Torcato de Matos, J. Dedic, ICALEPCS 2011, Grenoble, France. (https:// accelconf.web.cern.ch/accelconf/icalepcs2011/papers/mobaust03.pdf ) [6] radART (http://www.open-radart.org/) [7] CNAO (http://www.cnao.it/) [8] Status Of MedAustron, The Austrian Ion Therapy and Research Centre, A. Koschik, F. Osmić, P. Urschütz, M. Benedikt, IPAC 2014, Dresden, Germany, (http://accelconf. web.cern.ch/accelconf/IPAC2014/papers/ wepro081.pdf )
ABOUT THE AUTHORS Luka Šepetavc joined Cosylab in 2009 as an FPGA & hardware developer, quickly moving onto software development on a medical real-time operating system. Later, he took over the system architecture, design and project management of a real-time power supply control system for a medical accelerator. Presently he’s designing and managing development of safety-critical medical systems. He likes to read, learn about new ideas and taste new food. Rupert Langegger was born in 1984 near Salzburg in Austria. He studied physics at TU Wien and finished his PhD on “Low energy heavy ions in Matter” in 2014, when he has since worked as a System Architect & Physicist at MedAustron in the Medical FrontEnd department.
page:
Volume 23
Control Sheet
6
ISSN: 1855-9255
Communication between OPC UA and EPICS By : Klemen Žagar (Cosylab) In the industrial world, many devices use OPC (and, more recently, OPC UA) as their communication protocol. However, in experimental physics control systems, EPICS CA is frequently desired in the control room and central servers (alarms, archiving, etc.). In this article, we take a look at what the options are for integrating OPC UA with EPICS.
Gateway with LabVIEW The first approach is to develop a gateway using LabVIEW. In this approach, the gateway application serves as a client to the OPC UA Server and an EPICS IOC with the architecture shown in Figure 1. Several implementation technologies for the gateway are possible, including LabVIEW, .NET, Java and C/C++. The advantages of a gateway are:
◊ N ational Instruments provides good support for LabVIEW. ◊ CA and OPC UA client libraries exist: The EPICS IOC can be accessed via the open-source CALab library developed by BESSY [1] and the OPC UA client library is part of LabVIEW. Also, C++ OPC UA client libraries also exist (e.g., MatrikonOPC) However, there are some disadvantages:
◊ F ull EPICS and OPC UA compatibility is complex to achieve. In order to ensure full compatibility, the gateway must support:
• All the data types that are foreseen to be used, including waveforms/ arrays. If a data type isn’t natively supported in OPC UA or EPICS, the gateway must perform an appropriate conversion. • Meta-information, such as alarms, timestamps, operating ranges, deadband limits for archiving and monitors, etc., must be properly handled. • Synchronous (get/put) as well as asynchronous (monitor/subscribe) data access methods must be supported.
◊ M aintainability. LabVIEW is very good for simple programs, but as complexity of a program increases, maintenance can become an issue, and highly skilled LabVIEW architects should be involved in the project. Using a different implementation language mitigates this limitation to a certain degree, however engagement of skilled architects is still necessary. ◊ Deployment limitations. For best results, it is advised that LabVIEW runs on a Windows computer. .NET solutions also only run on Windows, while C++ solutions run either on Windows or Linux. ◊ Large latency. Due to the nature of the architecture, data must be transmitted four times from its source to destination (passing from the source to OPC UA server, then to the gateway, EPICS IOC and finally the destination). ◊ Scalability. If a large number of EPICS PVs needs to be mapped to OPC UA data-points, the performance of a program can severely deteriorate, and options for improvement are limited due to lack of access to the internals of the libraries. ◊ Configurability. The EPICS Soft IOC and Gateway must both be configured, and the configuration must be consistent. The users of the gateway will need to ensure this is the case. The mapping between PVs and OPC UA data-points should be done through a configuration file, rather than hard-coding the mappings in the Gateway. ◊ Reliability. The architecture requires three processes to run (OPC UA server, EPICS IOC and the CA-OPC LabVIEW
process), which decreases reliability of the architecture. The gateway will also need a CA client and there are 2 possibilities: ◊ L abVIEW: CA Lab [2] (uses the original EPICS CA libraries) ◊ .NET: EpicsSharp [3] (not fully CA compatible, because it is rewritten in .NET)
EPICS Device Support for OPC UA The second solution to integrating OPC-UA with EPICS is to use the existing approach chosen by the BESSY EPICS-OPC gateway [1]. While technologies are more restricted in this case (C/C++ being the only feasible option), this approach has several advantages over the gateway approach:
EPICS CA Client (BOY, archiver, alarm server, …)
EPICS CA Client
Configuration file
Gateway OPC UA Client
OPC UA
CA
EPICS CA Client
CA EPICS CA Server
OPC UA Server
EPICS Soft IOC EPICS database configuration file
OPC UA OPC UA Client
Equipment
Legend Component exists
Must be developed
Figure 1: The Gateway Approach
page:
Control Sheet
Volume 23
EPICS CA Client (BOY, archiver, alarm server, …)
EPICS CA Client
CA EPICS CA Server
OPC UA Device Support OPC UA Client
EPICS IOC EPICS database configuration file
OPC UA
OPC UA Server OPC UA OPC UA Client
Equipment
Legend Component exists Must be developed
ISSN: 1855-9255
Dual Server The final approach to integrating OPC-UA with EPICS is to implement EPICS device support for OPC UA, based on an off-theshelf OPC UA server library. This device support provides an OPC UA server interface to the clients (the equipment). When the clients use the OPC UA protocol to push new values, the device support processes the associated EPICS records. Vice-versa, when a CA client puts a value into the EPICS record, the device support passes the value to the OPC UA client through the OPC UA subscription mechanism. Advantages of this approach are:
◊ Full EPICS and OPC UA compatibility. Mapping of meta-data is handled by the EPICS IOC itself. ◊ Maintainability, performance and scalability. The device support can be written in C/C++, which is more maintainable for complex applications and offers better run-time performance. Also, it is possible to achieve scalability through control of concurrency/multithreading. ◊ Low latency and high reliability: Data
is transferred between processes only twice: from source to server, and from server to destination, and there is only a single process. ◊ Ease of configuration: Only the EPICS database needs to be written. EPICS already provides mechanisms for parsing database configuration files, creating records and associating them with device support. Disadvantages:
◊ Good quality OPC UA Server libraries need to be purchased. ◊ Due to C/C++ and EPICS support development, a higher level of expertise is required for proper implementation. ◊ Some off-the-shelf equipment may already provide an embedded OPC UA server, but can’t act as an OPC UA client. Such equipment cannot be interconnected into EPICS with the Dual Server solution.
Conclusion The table (next page) summarizes the approaches and ranks them between 1 (best) and 5 (worst). In summary, there are two types of solutions. The quick solution is to develop a gateway using LabVIEW, but if this gets out of hand with e.g. increasing complexity of code, poor scalability, etc. then more robust (but unfortunately, more expensive) solutions would be to use either EPICS Device Support or a Dual Server.
Figure 2: The EPICS Device Support Approach
◊ Very good CA/OPC UA protocol compatibility: This approach is fully compatible with EPICS CA, because the EPICS IOC is used to host the gateway. Also, depending on the choice of the OPC UA client library, complete OPC UA compatibility can be achieved as well (e.g., with MatrikonOPC’s SDK). ◊ Maintainability: With a suitable choice of EPICS device support, libraries (e.g. asynDriver), and with a highly skilled C++ and EPICS architect, code can written to be easily maintained. ◊ Performance, scalability, latency and reliability: The number of network hops is reduced. C/C++ is used for implementation. Multiple EPICS IOC processes can be deployed to achieve virtually unlimited scalability. ◊ Deployment: Either Linux or Windows platforms can be used. ◊ Configurability: Configuration to establish the EPICS - OPC UA mapping needs to be done in only one place: the EPICS database file.
7
EPICS CA Client (BOY, archiver, alarm server, …)
EPICS CA Client
CA
REFERENCES
EPICS CA Server
EPICS Soft IOC OPC UA Device Support OPC UA Server
[1] http://www-csr.bessy.de/control/SoftDist/ OPCsupport/
EPICS database configuration file
OPC UA OPC UA Client
Equipment
[2] http://www-csr.bessy.de/control/SoftDist/ CA_Lab/ [3] http://sourceforge.net/p/epicssharp/wiki/ Home/
ABOUT THE AUTHOR Legend Component exists Must be developed
Figure 3: The Dual Server Approach
Klemen Žagar joined Cosylab in 1999 and started as a software developer. From there he continued as a software and systems architect and is now Chief Technology Officer. His professional interests are distributed control systems, real-time and networking. In his spare time, he enjoys hiking, cycling and running.
page:
Control Sheet
Volume 23
8
ISSN: 1855-9255
OPC UA Client library OPC UA Server library EPICS Client library EPICS/OPC UA interoperability level Maintainability Performance Deployment platforms Data communication latency Scalability Configurability Reliability Average rank
MatrikonOPC
Dual Server
EPICS Device Support
C/C++ Gateway
.NET Gateway
LabVIEW Gateway
Table 1: Summary of the approaches with ranking between 1 (best) and 5 (worst).
Built-in (NI)
QuickOPC
MatrikonOPC
Not needed
Not needed
Not need- Not needed ed
Not needed
Matrik onOPC Softing
CALab
EpicsSharp EPICS ca library Not needed
Not needed
4
5
3
1
1
5
3
4
1
1
4
4
3
2
1
Windows (4)
W i n d o w s W i n d o w s , Windows, Linux (1) W i n d o w s , (4) Linux (1) Linux (1)
4
4
3
2
1
4
4
3
2
1
3
4
5
1
1
4
5
3
2
1
4
4.125
3.125
1.5
1
News
Cosylab Sponsors PRST-AB Open Access Journal We are proud to announce that Cosylab is a sponsor of the open access journal Physical Review Special Topics - Accelerators and Beams (PRST-AB). This journal, published by the American Physical Society (APS), is a leading publication in the field of
accelerator science and technology. We jumped at the opportunity immediately after the possibility of sponsorship was first opened for industry partners. We are happy to help PRST-AB advance the field of
http://journals.aps.org/prstab/
accelerator science through free and open access publishing and expand the worldwide sharing of knowledge which is vital for humanity’s ability to address the major challenges which are lying ahead in the 21st century.
Bringing the post office into the digital age...
Some pictures from the finals of the IEEE-Cosylab Student Competition, held on 15 April 2015 Addressing the only crime in Ljubljana - bicycle theft! (The third place project)
Wearing a funny hat during the demo will cause the audience to vote in your favour. (The winning project)
Controlling acquaponics
Robert, the vacuum cleaner of the future. (The second place project)
Goodie bags
Wearable electronics to improve bicycle safety
The audience having their say
Controlling the Art of Brewing... An RFID tag in your cup really helps to get the cup of coffee you want. The Judges
Do you have a Cosylab T-shirt? We want to see you, your husband or wife, children, cats, dogs, goldfish ;) in the T-shirt. We will not only send you another T-shirt (there are many designs!), but we will also publish your picture in the next issue of Control Sheet. Send pictures to controlsheet@ cosylab.com.
How the results stacked up.
The Contestants
Cosylab d.d., Teslova ulica 30, SI-1000 Ljubljana, SLOVENIA Phone: +386 1 477 66 76
Email: controlsheet@cosylab.com
URL: www.cosylab.com
Cosylab T-shirt spotted at the FIFA Women’s World Cup
Or, as Dave Gurd, now retired, and previously head of control division at SNS, Oak Ridge National Laboratory, USA, puts it himself: “Needed a red shirt to cheer on Canada in the FIFA women’s World Cup quarter final against England. There are 54,000 red shirts here, but I bet only one Cosylab shirt. Go Canada! I’m sure that Canada would have won, If only all the other Canadian fans had worn a Cosylab T-shirt :-)”* *Alas, the Canadians lost 2-1 against England. (New Cosylab t-shirt going Dave’s way, for all practical purposes... a red one? :-))
Cosylab d.d., Teslova ulica 30, SI-1000 Ljubljana, SLOVENIA Phone: +386 1 477 66 76
Email: controlsheet@cosylab.com
URL: www.cosylab.com