Epics@GSI Webhome

HadCon2 Apfel Controls

Introduction

This projects objective is the control of the slow control parameters of an APFEL ASIC with the HadCon2 controller board, which itself could be connected to a computer (here a Raspberry Pi (1) Model B) running an EPICS IOC. The EPICS IOCs data are visualized using the Control System Studio CSS.

Thus the project comprises
  • The implementation of the APFEL specific procotol on HadCon2's AVR
  • The implementation of an APFEL specific API command on HadCon2's AVR
  • The implementation of the EPICS IOC able to access the HadCon2's APFEL API command
  • The implementation of an CSS based GUI set to operate the APFEL
  • optional: the preparation of a Raspberry Pi Image

Sources

    APFEL Controls git repository with git submodules:

    alternatively: the single repositories

    Raspberry Pi Image, 3GB,

    • https://sf.gsi.de/d/215c097937/
      • contains complete EPICS installation (user:panda (normal) and epics (sudo))
      • needs updates via git for EPICS IOC
      • includes crontab and procServ support for the EPICS IOC

Documentation

    Setup

    HadCon2 + Raspi + Apfel connection 20150527_113520.png ApfelHadCon2 Connection ApfelHadCon2-Connectors.PNG Apfelmatrix STL 20151120_125102.jpg Apfelmatrix 20150519_102130.jpg Apfel Apd 20150527_113358.jpg Apfel + Apfelmatrix 20150519_102221.jpg

    APFEL Asic


    HadCon2

    HadCon2
    HadCon2MultipurposeControlsApi

      HadCon2 Multipurpose Controls Protocol

      HadCon2MultipurposeControlsProtocol

        APFEL command
          General Operation Principles and Physical Layout

          The APFEL command set allows to talk to (several instances of) the APFEL ASIC. It uses a subset of the the I/O-Ports of the ATMEL μController to facilitate the communication to the proprietary protocol (q.v.Decoder.pdf) of the asic, sending a 22bit sequence for command, value, and chipId. ( → Apfel protocol code sequences)
          • Logically
            • Output:
              • CLK
                • quasi clock, only the level changes are important
              • DOUT
                • data out
              • Side Select
                • position
            • Input:
              • DIN
                • data in
            • GND
          • Electrical:
            • 3.3 Volt
          • Physically:
            • per default:
              • JDINOUT1/2, JADC
                • I/O ports:
                  I/O port A C F
                  Connector JDINOUT1 JDINOUT2 JADC
                  pins DIN1 1 DIN1 1 DIN1 1
                  DOUT1 2 DOUT1 2 DOUT1 2
                  CLK1 3 CLK1 3 CLK1 3
                  SS1 4 SS1 4 SS1 4
                  DIN2 5 DIN2 5 DIN2 5
                  DOUT2 6 DOUT2 6 DOUT2 6
                  CLK2 7 CLK2 7 CLK2 7
                  SS2 8 SS2 8 SS2 8

        more see:


    EPICS IOC


    CSS GUI


    Installation

      HadCon2 + Firmware


      Computer + EPICS IOC

      1. requires installation of EPICS Base 3.14.12.4 (or higher) and streamDevice module, optional but recommended procServ
      2. Get IOC code from github: https://git.gsi.de/HadCon2/Applications/APFEL/APFEL_Hadcon_IOC
      3. and change to protocol_v0 branch
        git checkout protocol_v0
      4. cd TOP directory
        cd APFEL_Hadcon_IOC
      5. adjust RELEASE files in sub directory configure, i.e. correct paths to EPICS base and modules * be aware, that you might have to change instead RELEASE.linux-arm.Common RELEASE.linux-x86_64.Common, which are included in RELEASE, but allows several architectures to be supported
      6. make
        make
      7. Depending on your target architecture
        cd iocBoot/iocapfel
        or
        cd iocBoot/iocapfel_linux-x86_64
      8. Start IOC:
        1. Manually start IOC:
          ../../bin/linux-arm/apfel st.cmd
          and you must not background 'bg' this process, better use procServ
        2. procServ:
          • needs procServ installed
          1. edit <TOP>/startup/procServ/start_apfel_IOC_procServ.sh and change myIOCBOOT and myARCH to your needs
          2. call procServ:
            procServ -q -n apfelControlIOC -l 4814 4813 <absolute path to TOP>/procServ/start_apfel_IOC_procServ.sh
          3. the EPICS IOC runs now inside the procServ environment:
            1. login:
              telnet localhost 4813
              (4814: read-only)
              • type CTRL+T to toggle automatic restart
              • type CTRL+X to kill child process (IOC)
              • type exit to end the EPICS session 2. leave session: type CTRL+] and
                telnet> quit
        3. crontab + procServ
          • to restart automatically 60 seconds after reboot use crontab features
          1. edit <TOP>/startup/crontab/start_procServ_EPICS_apfel.sh and adjust myProcServScript to your needs
          2. to simplify: create a directory and softlink at your home directory, e.g.
            mkdir -p ~/crontab/ && ln -s <TOP>/startup/crontab/start_procServ_EPICS_apfel.sh
          3. add the content of <TOP>/startup/crontab/crontab.entry to your crontab:
            (just a help xclip: puts the content to the clipboard)
            cat <TOP>/startup/crontab/start_procServ_EPICS_apfel.sh | xclip -sel clip && crontab -e
          4. reboot or start IOC via procServ only.


      CS-Studio

      • the GUI is based on CSS 3.2.16 doesn't matter if Windows / Linux / MAC
      1. Download CSS 3.2.16 and open a new workspace
      2. Install Apfel HadCon Control GUIs
        1. open perspective GIT Repository Exploring
          CSS-0a_open_perspective_apfel_hadcon.PNG
          CSS-0b-open_git_repository_perspective.PNG
        2. Clone git repository
          1. Enter URI: https://git.gsi.de/HadCon2/Applications/APFEL/APFEL_Hadcon_CSS==
                      CSS-1-git_clone_apfel_hadcon-1.PNG
                      and click ==NEXT
          2. Get all Branches
            CSS-2-git_clone_apfel_hadcon.PNG
            and click NEXT
          3. Set Initial Branch to v2.1
            CSS-3-git_clone_apfel_hadcon.PNG
            and click FINISH
        3. Import Project
          1. choose Import Projects from __Working Directory__'s context menu
            CSS-4-git_clone_apfel_hadcon.PNG
          2. choose __Import existing projects__
            CSS-4a-import_project.PNG
          3. select Apfel
            CSS-4b-import_project.PNG
          4. CSS-5-git_clone_apfel_hadcon.PNG

        4. Import Preferences
          1. In settings/ you find the file apfel-basic-preferences.epf, right click to get via Properties its physical Location and remember it.
            CSS-6-import_preferences.PNG
          2. In the Navigator choose Import from the context menu
            CSS-7-import_preferences.PNG
          3. Select __Preferences__
            CSS-8-import_preferences.PNG
          4. and insert the Location you should have just remembered
            CSS-9-import_preferences.PNG
          5. Restart CSS
        5. Start
          1. Open a new window
            CSS-10-new_window.PNG
          2. Select open Perspectives and select OPI Runtime
            CSS-11-open-runtime-perspektive.PNG
          3. By clicking the Top Files button: CSS-12-Top.PNG
            CSS-13_top.PNG
          4. You should get the Main Controls Window: (Press F8 for compact mode)
            CSS-14_apfel_hadcon-16.PNG


-- PeterZumbruch - 2017-05-29
-- PeterZumbruch - 2017-05-29
I Attachment Action Size Date Who Comment
20150519_102130.jpgjpg 20150519_102130.jpg manage 52 K 2015-05-28 - 17:13 PeterZumbruch Apfelmatrix
20150519_102221.jpgjpg 20150519_102221.jpg manage 74 K 2015-05-28 - 17:13 PeterZumbruch Apfel + Apfelmatrix
20150527_113358.jpgjpg 20150527_113358.jpg manage 166 K 2015-05-28 - 17:19 PeterZumbruch Apfel Apd
20150527_113520.pngpng 20150527_113520.png manage 183 K 2015-05-28 - 17:11 PeterZumbruch HadCon2 + Raspi + Apfel connection
20151120_125102.jpgjpg 20151120_125102.jpg manage 207 K 2015-11-20 - 13:01 PeterZumbruch Apfelmatrix Distribution
ApfelHadCon2-Connectors.PNGPNG ApfelHadCon2-Connectors.PNG manage 77 K 2015-05-28 - 17:41 PeterZumbruch ApfelHadCon2 Connection
CSS-0a_open_perspective_apfel_hadcon.PNGPNG CSS-0a_open_perspective_apfel_hadcon.PNG manage 16 K 2015-11-20 - 16:28 PeterZumbruch CSS open perspective
CSS-0b-open_git_repository_perspective.PNGPNG CSS-0b-open_git_repository_perspective.PNG manage 20 K 2015-11-20 - 16:30 PeterZumbruch CSS open perspective git repository
CSS-1-git_clone_apfel_hadcon-1.PNGPNG CSS-1-git_clone_apfel_hadcon-1.PNG manage 64 K 2015-11-20 - 16:30 PeterZumbruch CSS git clone apfel hadcon 1
CSS-10-new_window.PNGPNG CSS-10-new_window.PNG manage 15 K 2015-11-20 - 16:35 PeterZumbruch CSS new window
CSS-11-open-runtime-perspektive.PNGPNG CSS-11-open-runtime-perspektive.PNG manage 22 K 2015-11-20 - 16:36 PeterZumbruch CSS open perspective - runtime
CSS-12-Top.PNGPNG CSS-12-Top.PNG manage 4 K 2015-11-20 - 16:37 PeterZumbruch CSS Top files 1
CSS-13_top.PNGPNG CSS-13_top.PNG manage 9 K 2015-11-20 - 16:37 PeterZumbruch CSS Top files 2
CSS-14_apfel_hadcon-16.PNGPNG CSS-14_apfel_hadcon-16.PNG manage 140 K 2015-11-20 - 16:38 PeterZumbruch CSS apfel hadcon control
CSS-2-git_clone_apfel_hadcon.PNGPNG CSS-2-git_clone_apfel_hadcon.PNG manage 36 K 2015-11-20 - 16:31 PeterZumbruch CSS git clone apfel hadcon 2
CSS-3-git_clone_apfel_hadcon.PNGPNG CSS-3-git_clone_apfel_hadcon.PNG manage 40 K 2015-11-20 - 16:31 PeterZumbruch CSS git clone apfel hadcon 3
CSS-4-git_clone_apfel_hadcon.PNGPNG CSS-4-git_clone_apfel_hadcon.PNG manage 34 K 2015-11-20 - 16:32 PeterZumbruch CSS git clone apfel hadcon 4
CSS-4a-import_project.PNGPNG CSS-4a-import_project.PNG manage 40 K 2015-11-20 - 16:59 PeterZumbruch CSS import project 1
CSS-4b-import_project.PNGPNG CSS-4b-import_project.PNG manage 39 K 2015-11-20 - 17:01 PeterZumbruch CSS import project 2
CSS-5-git_clone_apfel_hadcon.PNGPNG CSS-5-git_clone_apfel_hadcon.PNG manage 23 K 2015-11-20 - 16:33 PeterZumbruch CSS git clone apfel hadcon 5
CSS-6-import_preferences.PNGPNG CSS-6-import_preferences.PNG manage 56 K 2015-11-20 - 16:33 PeterZumbruch CSS import preferences 1
CSS-7-import_preferences.PNGPNG CSS-7-import_preferences.PNG manage 16 K 2015-11-20 - 16:33 PeterZumbruch CSS import preferences 2
CSS-8-import_preferences.PNGPNG CSS-8-import_preferences.PNG manage 32 K 2015-11-20 - 16:34 PeterZumbruch CSS import preferences 3
CSS-9-import_preferences.PNGPNG CSS-9-import_preferences.PNG manage 33 K 2015-11-20 - 16:35 PeterZumbruch CSS import preferences 4
Topic revision: r13 - 2017-05-29, PeterZumbruch - This page was cached on 2024-12-19 - 19:52.

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback | Legal notice | Privacy Policy (german)