SlideShare a Scribd company logo
1 of 16
Download to read offline
TGC McGill Testing Facility
New Small Wheel ATLAS Experiment
State Machine Code and User Interface Documentation
Charlotte Qin
McGill University
Supervisor: Brigitte Vachon
Date: August 22rd, 2014
Abstract
As a significant component of New Small Wheel (NSW) project, Thin Gap Chambers have been
developed for usage in the trigger system of the end-cap muon spectrometer in the ATLAS experiment.
ATLAS group at McGill University is responsible for quality assurance before the TGC modules are
shipped to CERN for installation on NSW. A state machine coded in LabVIEW is required as a part of
slow control at McGill Testing Facility. It is used for monitoring the environment, sensors and hardware
parameters at different states to assure the safety of the laboratory environment.
Contents
1 Background 2
2 Slow Control System at McGill Testing Facility 2
2.1 Equipment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.2 State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Documentation Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Code Documentation 5
3.1 State Transition Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.1.1 Normal Operation States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.1.2 Error States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Code Structure Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3 The State Machine User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3.1 Global Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3.2 Gas System Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.3.3 HV System Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.4 HV Control Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.5 Sensor Monitor and Data Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4 Outlook 14
5 Acknowledgement 14
6 References 15
1
1 Background
ATLAS (A Toroidal LHC ApparatuS) is a particle physics experiment at the Large Hadro Collider (LHC),
a proton-proton accelerator located at CERN in Geneva, Switzerland. ATLAS is designed for a board
search of new discoveries at extraordinary high energy including unification of fundamental forces, extra
dimensions of space, evidence of dark matters, etc.
LHC is currently the highest energy collider in the world. Following the discovery of the Higgs boson in
2012, the ATLAS detector is planned to be upgraded to have better performance at higher luminosity. After
the second long shutdown (LS2) in 2018, the accelerator luminosity will be increased to 2−3×1034cm−2s−1
with a center-of-mass energy of 14 TeV. In order to maximize the luminosity performance, the first station
of the ATLAS muon end-cap system, Small Wheel(SW), has to be replaced. The improved trigger system
of ATLAS’s New Small Wheel (NSW) will significantly enhance its ability to detect muons travelling in
the forward region of the detector. The trigger system is composed of a series of gaseous detectors Thin
Gap Chambers (TGCs). The construction of TGCs involves the cooperation of several Canadian physics
institutions including TRIUMF and Simon Fraser University in Vancouver, BC. The components of the
TGCs will then be assembled at Carleton University in Ottawa. Before these chambers are shipped to
CERN for installation onto NSW, the TGC modules will be sent to McGill University in Montreal for
testing and quality assurance.
TGC Testing Facility at McGill University will perform tests on the chambers running gas mixture
of carbon dioxide and pentane under certain pressure, flow rate and high voltage. A well-developed slow
control system is required to ensure safe and smooth operations of TGC testing. From May 5th to August
22nd, 2014, I was responsible for developing such a state machine and its user interface in LabVIEW
programming language for TGC slow control.
2 Slow Control System at McGill Testing Facility
2.1 Equipment
Slow control system is responsible for setup of hardware components and monitoring of experimental pa-
rameters such as high voltage modules, temperature sensors, pressure gauges, leak detectors, etc. At TGC
Testing Facility at McGill, the slow control system consists of a LabVIEW-programmed state machine,
2
which is continuously running on a laptop without interruption, an uninterruptable power supply (UPS),
a data acquisition crate (cDAQ) from National Instrument, and a series of sensors, including two iTrans
pentane sniffers, a various resistive temperature device and thermocouples, a ambient pressure sensor, a
differential pressure sensor, a ambient humidity sensor and a mass flow controller.
2.2 State Machine
State Machine serves as a medium between the user and laboratory hardware. State Machine architecture
offers useful applications for creating user interfaces in which the user can perform certain tasks such as
hardware monitoring, error handling, data logging, etc. It implements complex decision-making algorithm,
usually presented by a state transition diagrams 1, into a number of states. The state machine is able to
recognize the occurrence of each state, where each state represents A segment of the process and a specific
action is performed for each state. When an action is received, it takes the user interface into a different
state in the state machine, which either leads to another state or performs more in-state actions until the
next user event is triggered.
TGC State Machine ensures the safety of McGill Testing Facility by controlling and continuously
monitoring the following three systems in the lab:
• Environment, which includes ambient temperature, humidity and pressure sensors
• Gas System, which contains mass flow controller, safety valves power and gas detectors
• High Voltage (HV) System, which consists of LabVIEW user interfaces to CAEN HV crate, with
added logging of data
The goal of TGC state machine design is to create a straight-forward, practical, and informative panel for
users; repetitive and unimportant information can be neglected in order to keep the display panel neat
and simplified.
TGC State Machine includes a central panel, which is called "State Machine Panel" in general
terms, and two extension panels: HV Panel 2, and DAQ and Sensor Monitoring Panel 3. The cen-
tral panel displays overall status of the three slow control systems, and sends commands to the extension
1
See section 3.1
2
Integrated with CEAN HV Crate applications. See section 3.4
3
Written by Robert A. Keyes, a PhD student at McGill University, see section 3.5
3
panels. It groups the three systems into three sub-panels: Global (Environment) Panel, Gas System panel,
and HV System Panel. Sensor monitoring and HV are two rather complex systems, and it is important
to know what is going on with the parameters’ status beyond the condensed information displayed on the
state machine panel; the two extension panels further control the system, and display instantaneous status
of the parameters and the history record of some parameters over a period of time.
2.3 Documentation Location
The documentations related to slow control are all saved to Google Drive. The LabVIEW codes have
been saved to the address: ATLAS-TGC-MCGILL/CODES/SLOW CONTROL. In the folder "SLOW
CONTROL", the central panel and the two extensions are saved under the folder "Main VIs". These
main VIs are:
• Central State Machine Panel, named as StateMachinePanel.vi
• HV Operation Panel, named as HVPanel.vi
• DAQ and Sensor Monitoring Panel, named as DAQPanel.vi
In the same folder "SLOW CONTROL", the support VIs are saved under five separate folders based on
its purpose. These folders are: "Support VIs", "Gas Support VIs", "HV Support VIs", "Controls" and
"Global Variables".
User interface related files for example, State Transition Diagram and user guide documents are saved
to the following address:
ATLAS-TGC-MCGILL/DOCUMENTATION/SLOW CONTROL/User Interface. The folder "User
Interface" contains the following editable Google image files:
• State Transition Diagram, named as StateTransitionDiagram
• User Guide 1 for State Machine - Global Pane
• User Guide 2 for State Machine - Gas Operation
• User Guide 3 for State Machine - HV Panel
4
3 Code Documentation
3.1 State Transition Diagram
State Transition Diagram presents the logic of a State Machine in a flow-chart form. A "state" represents
a segment of the big picture of operations, and a "transition" is a series of actions needs to be taken in
order to go from one state to another.
Figure 1: TGC State Transition Diagram
5
TGC State Transition Diagram consists of normal operation states, error states 4, and an emergency
stop bottom. When the system parameters do not meet the physical characteristics of each state, or the
user does not perform the required actions, the state machine will fall into a corresponding error state.
In cases of insignificant errors, such as sensor value mismatch, the system is able to go back to normal
state automatically or by clicking "Clear Error" Button after the existing error is physically corrected;
however, when critical errors occur, the system will drop back to dormant state to ensure the safety of
the operation. As an essential component of State Machine, the stop button is designed to shut down the
entire system in emergency situation.
3.1.1 Normal Operation States
Normal operation states include three categories: Global States, CO2 Operation States and HV Operation
States. These states are organized in a certain sequence, which will be discussed later in the section.
1. Global States: are operating states in which actions are applied to the overall system or environ-
ment. Global states further divides into three sub states which are Dormant State, CO2 Flush State
and Ready State.
(a) Dormant state: is the primary state of the system. Before the user applies any action, the
state machine is monitoring the environmental changes, whereas gas system and HV systems
are both turned off; there is no data acquisition in this state.
In this state, user is asked to turn on all the gas lines. After all the lines are turned on, the
mass flow control (MFC) rate will be updated automatically to 100 mL/min per line, and 1000
mL/min as "total Set MFC" input. If any of the gas lines is still open, or the total MFC value
does not match the set value, when click the forward command, the system will transition to
Dormant Error State; if no error occurs, the state machine will be able to move on to the next
state.
(b) CO2 Flush State: is a virtual state with 15-minute CO2 flush at a MFC rate of 100 mL/min
per gas line for elimination of air contamination in the gas tunnels. In the later states of gas
operation, if the a new line is turned on, the system has to perform 5 minute flush of CO2 gas
at 45 mL/min to ensure the safety of the tunnel.
4
As shown in Figure 1, error states are parallel to the normal states with identical names
6
This is a transition state where the user doesn’t need to perform anything directly on the state
machine panel other than waiting and prepare for the next step of the operation. If the user
wants to stop the operation in the middle of CO2 Flush State, State Machine returns back to
dormant. When the system finishes the 15 minutes flush, the system goes directly to Ready
State.
(c) Ready State: the system will be in error states when State Machine just transitions from CO2
Flush State until all the gas lines are turned off; in the mean time, MFC value needs to set to
zero. If the gas lines aren’t turned off entirely, the system will stay in Ready Error State.
Ready State has all the physical characteristics of Dormant State except that, at this point,
the system is fully flushed which enables gas operations to be carried out safely right away in
the next state.
2. Gas Operation States: are operating states where the user selects desired gas lines to give spe-
cific instructions and parameter inputs. Some operations can be performed remotely through TGC
State Machine such as setting the total MFC rate; some operations can only be done manually, for
example, setting the Peltier temperature and physically opening the solenoid valves of the selected
gas lines. Depending on the type of gas running through the gas tunnel, the channel status will be
set to "CO2 Run" at default value, 45 mL/min per line or "Pentane Run" at 25 mL/min.
In this state, first of all, the user has to turn on at least one line; next, he/she is asked to update
the total MFC rate by clicking the bottom on the top right "Set MFC to ’EXT’"; if CO2-pentane
gas mixture is running in the system, Peltier temperature has to be set to a desired value, and the
next state will be perform as soon as the Peltier temperature gets updated.
3. HV Operation States: while State Machine is continuously monitoring the gas system, the oper-
ation of HV system needs to perform on the extension panel of State Machine, HV (Operation) panel.
In HV Operating States, users can select desired HV channels to turn on power or to change the
parameter values such as voltage, current and ramping rate, on the HV Operation Panel5. Different
5
See section 3.4
7
status of HV lines such as on, off, ramping up and ramping down are coded in different colours.
While the HV extension controls and monitors the parameters and states of all the active 6 channels,
TGC State Machine condenses the information and displays only the status of powered HV panel
on the central panel.
4. Run State: is the final state of the program. Gas and HV systems are active and being monitored
continually. If any error occurs, the state machine will send a error flag and go into Run Error State.
3.1.2 Error States
In any state of the normal operations, the system can fall into an error state corresponding to the previous
normal operation state the system was in. There are two types of errors: Corrective Errors and Critical
Errors.
Critical errors are relatively more damaging or harmful to the lab safety. As an example, in the gas
system, it occurs in ambient gas, sensor trip and differential pressure spikes/offset from ambient, or Power
loss and Vacuum failure in the gas system. Once a critical error is detected, TGC State Machine will take
the entire system back to dormant states.
Corrective errors are relatively less significant and can be corrected easily. The system goes back to the
corresponding normal operating state after problems are conquered. In gas system, these errors include
Peltier temperate mismatch, gas temperature mismatch and MFC rate mismatch. In the HV system, since
the HV crate itself is a well-developed, safe system, it protects the system from safety hazard by tripping
the power and ramping down the voltage back to zero; these tripping-causing errors include over current,
over maximum voltage, external trip or disable, calibration error, under current, under voltage, remotely
unplugged, power fail and temperature error.
6
Meaning that the slots in the crate which are physically activated and connected to testing hardware
8
3.2 Code Structure Overview
TGC state machine is fundamentally composed of three while loops which are in charge of the three
system: one loop for obtaining the sensor information, one for controlling the gas system, and one is for
updating the powered HV channel status. These while loops continually monitor the systems until the
program is aborted 7.
There are a couple of other important LabVIEW infrastructures in TGC state machine such as shift
registers. They have small tunnel-like structure that contains state transition information, located on the
edge of a loop. The code for each specific state, also known as the transition code, is contained in a case
structure; the transition code determines the next state in the sequence.
Another significant component is event structure. Event structure enables the state machine to per-
form assigned actions regarding specific user inputs. In this case, events are triggered by activation of
specific booleans on the front panel such as forward command, reverse command, initialize button, etc.
There is 0.5 second time-out set for the event structure. The time out event is basically an event that
occurs at every set time-out period, and loops the same information from the previous iteration to the next
one. This function makes sure that the state machine updates frequently to have the latest information.
For loop is significant in terms of updating an array of gas channels or HV channels and continually
updates the parameter values and status of the array, and logs data. It is used a couple of times in TGC
State Machine both in the gas system and in HV system.
3.3 The State Machine User Interface
3.3.1 Global Panel
Global Panel (see Figure 2) contains the inputs/controls (indicated in black in the diagram) and out-
puts/indicators (indicated in blue) of the State Machine. Figure 2 explains the application of each com-
ponent in details. The global inputs include a series booleans that guide the user to go from one operation
state to another, while the global outputs display the overall state of the state machine, as well as the
sensor and environment information.
7
The safest way to abort the program is to press the emergency stop button
9
One thing to mention about the code is that since CO2 flush state is an virtual state which doesn’t
actually exist in the case structure, it is instead installed in the event structure where there is a wait time
of 15 minutes; during the flushing time, property nodes was used to update the display information on the
Global Panel output. After the execution, the system transitions directly to ready state and to the next
iteration.
The important VIs are GasCO2FlushProgress.vi saved in folder "Support VIs", which time could be
set to preferred wait time and number of execution. The global state saved as Type definition called
GasStateIndicator.ctl under "Contorls". The sensor update is made possible thanks to global variable
CurrentSensorValues.vi Global Variables.
Figure 2: Global Sub-panel- State Machine Central Panel
10
3.3.2 Gas System Panel
Gas system panel consists of an input panel and an output panel. On the input panel, the user is able to
select a number of gas lines and the type of gas running, and to change the MFC rate. By operating the
global status on the global panel, the output of the panel gets updated as the state machine moves on to
different stages. On top of the output panel, the users are also asked to submit Peltier Temperature and
MFC rate on this panel.
Figure 3: Gas System Sub-panel - State Machine Central Panel
Something to note is that for code and user interface simplification , I made the output panel in a
certain way that the output contains all the elements on the input panel; however the repeated elements
on the output panel is hidden to users.
In order to deliver information from the input panel to the output panel, a sub VI "GasSelectChan-
11
nel.vi" (saved in Support VIs) is used. We use a for loop to update all the channels. There is also a for
loop outside the case structure to update the MFC rate for each state.
A case structure is used to separate the normal operations from the error operations, and we have
a series of error handling VIs to determine which state the state machine should go into. These error
handling VIs are saved in Support VIs.
3.3.3 HV System Panel
This part of the front panel displays information of the powered HV channels. More details about HV
operation is explained in section 3.4. The HV information is updated with help of a global variable, saved
in ATLAS-TGC-MCGILL/CODES/SLOW CONTROL/Support VIs.
Figure 4: Condensed HV System Sub-panel - State Machine Central Panel
3.4 HV Control Panel
In terms of programmatic structure, HV control panel (see Figure 4) has no significant difference from
the other sub-panels on the global machine. Since HV is a rather complex system controlled remotely by
the state machine, we made another panel to control the system. Integrated with CEAN sub VIs, users
can control (input) and monitor (output) all the parameters of HV system on the panel.
12
Figure 5: Condensed HV System Subpanel - State Machine Central Panel
In order to access the control, the user firstly has to unlock the panel by clicking the start button on
the panel. Using the check box to select desired HV lines, the user is allowed to turn on/off the power,
change the parameter values of the specified HV line(s). It is also recommended, for memory storage, to
use this function to record the connection information between the HV lines and the gas lines. Following
this action, the HV light corresponding on each gas line output on the global panel will be turned on if
the gas line is connected to one or more HV lines.
The display information on HV Panel includes the crate map and error information on the top half of
the panel; on the bottom half, it displays the status of all the active HV channels. The background colour
of each channel indicates the current state of the channel, for example, when the HV is turned on, the
colour changes from grey to light blue while the voltage is ramping up, green when the voltage finishes
ramping and becomes stable, dark blue when ramping down. If a HV line trips, the background colour of
the corresponding column will turn red (central panel updates the information simultaneously), so does
the LED light on the HV panel.
13
There is an overall case structure to separate the normal operation from the error states of the HV
system. When the system is operating normally, the "ok" light on the front panel is bright green. As we
use CEAN VIs to obtain information of active channels, and the user interface of program is modified with
some LabVIEW infrastructures such as shift registers, case structure and event structure. In the beginning
of the program, a case structure is used to ensure that HV cluster gets updated with new parameter values
at every iteration, and the first iteration is initialized. Another function being installed is checking the
wavefront of voltage and current for each HV line over a period of time.
3.5 Sensor Monitor and Data Logging
Robert Keyes’ sensor monitor code The Sensor Monitor panel is located ATLAS-TGC-MCGILL/CODES/SLOW
CONTROL/Mains VIs. Robert Keyes has written the data logging code which is applied to both the sensor
monitoring as well as the state machine and HV Panel.
4 Outlook
There are a few aspects that are not completed perfectly, and the following tasks need to be done:
• The error handling VIs need to be tested in real scenarios.
• The Emergency Button needs to be implemented to the HV system
• The main state machine should be turned on before the other two panels to avoid execution conflicts
such as ’the calling VI is already running’.
• The user interface guide will be printed into posters or handbooks and made visible for users.
5 Acknowledgement
I would like to thank Robert Keyes for his technical help with LabVIEW. I would also like to thank Andrée
Robichaud-Véronneau, Andreas Warburton and Steve Roberson for guidance and for meeting weekly on
the Gas System - Slow Control meeting. I would also like to thank my supervisor Brigitte Vachon for
letting me work on this project and have this great learning opportunity.
14
6 References
ATLAS.ch
www.ni.com/white-paper/7595/en
ATLAS New Small Wheel Technical Design Report - CERN June 2013
15

More Related Content

What's hot

PID controller for microsatellite yaw-axis attitude control system using ITAE...
PID controller for microsatellite yaw-axis attitude control system using ITAE...PID controller for microsatellite yaw-axis attitude control system using ITAE...
PID controller for microsatellite yaw-axis attitude control system using ITAE...TELKOMNIKA JOURNAL
 
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic Analytics
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic AnalyticsSAND: A Fault-Tolerant Streaming Architecture for Network Traffic Analytics
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic AnalyticsQin Liu
 
Optimal Coordination of DOCR for Radial Distribution Systems in Presence of TCSC
Optimal Coordination of DOCR for Radial Distribution Systems in Presence of TCSCOptimal Coordination of DOCR for Radial Distribution Systems in Presence of TCSC
Optimal Coordination of DOCR for Radial Distribution Systems in Presence of TCSCIJPEDS-IAES
 
A real-time fault diagnosis system for high-speed power system protection bas...
A real-time fault diagnosis system for high-speed power system protection bas...A real-time fault diagnosis system for high-speed power system protection bas...
A real-time fault diagnosis system for high-speed power system protection bas...IJECEIAES
 
Actuator Fault Decoupled Residual Generation on Lateral Moving Aircraft
Actuator Fault Decoupled Residual Generation on Lateral Moving AircraftActuator Fault Decoupled Residual Generation on Lateral Moving Aircraft
Actuator Fault Decoupled Residual Generation on Lateral Moving AircraftTELKOMNIKA JOURNAL
 

What's hot (6)

PID controller for microsatellite yaw-axis attitude control system using ITAE...
PID controller for microsatellite yaw-axis attitude control system using ITAE...PID controller for microsatellite yaw-axis attitude control system using ITAE...
PID controller for microsatellite yaw-axis attitude control system using ITAE...
 
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic Analytics
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic AnalyticsSAND: A Fault-Tolerant Streaming Architecture for Network Traffic Analytics
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic Analytics
 
Optimal Coordination of DOCR for Radial Distribution Systems in Presence of TCSC
Optimal Coordination of DOCR for Radial Distribution Systems in Presence of TCSCOptimal Coordination of DOCR for Radial Distribution Systems in Presence of TCSC
Optimal Coordination of DOCR for Radial Distribution Systems in Presence of TCSC
 
A real-time fault diagnosis system for high-speed power system protection bas...
A real-time fault diagnosis system for high-speed power system protection bas...A real-time fault diagnosis system for high-speed power system protection bas...
A real-time fault diagnosis system for high-speed power system protection bas...
 
B010511015
B010511015B010511015
B010511015
 
Actuator Fault Decoupled Residual Generation on Lateral Moving Aircraft
Actuator Fault Decoupled Residual Generation on Lateral Moving AircraftActuator Fault Decoupled Residual Generation on Lateral Moving Aircraft
Actuator Fault Decoupled Residual Generation on Lateral Moving Aircraft
 

Similar to State_Machine_Documentation_ CharlotteQin_Summer2014

ENGINEERING PROJECT – CONVEYOR BLOCKAGE DETECTION
ENGINEERING PROJECT – CONVEYOR BLOCKAGE DETECTIONENGINEERING PROJECT – CONVEYOR BLOCKAGE DETECTION
ENGINEERING PROJECT – CONVEYOR BLOCKAGE DETECTIONAll Assignment Experts
 
aa-automation-apc-complex-industrial-processes
aa-automation-apc-complex-industrial-processesaa-automation-apc-complex-industrial-processes
aa-automation-apc-complex-industrial-processesDavid Lyon
 
IRJET- A Testbed for Real Time Water Level Control System
IRJET- 	  A Testbed for Real Time Water Level Control SystemIRJET- 	  A Testbed for Real Time Water Level Control System
IRJET- A Testbed for Real Time Water Level Control SystemIRJET Journal
 
ISE716 Semester Project Final Report final with appendix
ISE716 Semester Project Final Report final with appendixISE716 Semester Project Final Report final with appendix
ISE716 Semester Project Final Report final with appendixPrafulla Kumar Shahi
 
Group2 loca to test
Group2 loca to testGroup2 loca to test
Group2 loca to testcongthan1
 
Shimadzu hplc standard_operation_procedure_by_dr._sana_mustafa
Shimadzu hplc standard_operation_procedure_by_dr._sana_mustafaShimadzu hplc standard_operation_procedure_by_dr._sana_mustafa
Shimadzu hplc standard_operation_procedure_by_dr._sana_mustafaFelipe Machado
 
Minor_Project_Report
Minor_Project_ReportMinor_Project_Report
Minor_Project_ReportVansh Kumar
 
FAULT DETECTION AND DIAGNOSIS OF INDUCTION MACHINE WITH ON-LINE PARAMETER PR...
FAULT DETECTION AND DIAGNOSIS OF INDUCTION MACHINE  WITH ON-LINE PARAMETER PR...FAULT DETECTION AND DIAGNOSIS OF INDUCTION MACHINE  WITH ON-LINE PARAMETER PR...
FAULT DETECTION AND DIAGNOSIS OF INDUCTION MACHINE WITH ON-LINE PARAMETER PR...Sheikh R Manihar Ahmed
 
Monitoring and Controlling Of Electric Overhead Travelling Crane Using PLC an...
Monitoring and Controlling Of Electric Overhead Travelling Crane Using PLC an...Monitoring and Controlling Of Electric Overhead Travelling Crane Using PLC an...
Monitoring and Controlling Of Electric Overhead Travelling Crane Using PLC an...paperpublications3
 
Paper id 37201531
Paper id 37201531Paper id 37201531
Paper id 37201531IJRAT
 
REAL TIME OPERATING SYSTEM PART 1
REAL TIME OPERATING SYSTEM PART 1REAL TIME OPERATING SYSTEM PART 1
REAL TIME OPERATING SYSTEM PART 1Embeddedcraft Craft
 
Optimized sensor selection for control and fault tolerance of electromagnetic...
Optimized sensor selection for control and fault tolerance of electromagnetic...Optimized sensor selection for control and fault tolerance of electromagnetic...
Optimized sensor selection for control and fault tolerance of electromagnetic...ISA Interchange
 
Safety System Modularity
Safety System ModularitySafety System Modularity
Safety System ModularityFasiul Alam
 
Using Synchrophasor Data for Voltage Stability Assessment
Using Synchrophasor Data for Voltage Stability AssessmentUsing Synchrophasor Data for Voltage Stability Assessment
Using Synchrophasor Data for Voltage Stability AssessmentPower System Operation
 

Similar to State_Machine_Documentation_ CharlotteQin_Summer2014 (20)

ENGINEERING PROJECT – CONVEYOR BLOCKAGE DETECTION
ENGINEERING PROJECT – CONVEYOR BLOCKAGE DETECTIONENGINEERING PROJECT – CONVEYOR BLOCKAGE DETECTION
ENGINEERING PROJECT – CONVEYOR BLOCKAGE DETECTION
 
aa-automation-apc-complex-industrial-processes
aa-automation-apc-complex-industrial-processesaa-automation-apc-complex-industrial-processes
aa-automation-apc-complex-industrial-processes
 
Psoc
PsocPsoc
Psoc
 
IRJET- A Testbed for Real Time Water Level Control System
IRJET- 	  A Testbed for Real Time Water Level Control SystemIRJET- 	  A Testbed for Real Time Water Level Control System
IRJET- A Testbed for Real Time Water Level Control System
 
Real Time System
Real Time SystemReal Time System
Real Time System
 
Transformer
TransformerTransformer
Transformer
 
ISE716 Semester Project Final Report final with appendix
ISE716 Semester Project Final Report final with appendixISE716 Semester Project Final Report final with appendix
ISE716 Semester Project Final Report final with appendix
 
main
mainmain
main
 
Group2 loca to test
Group2 loca to testGroup2 loca to test
Group2 loca to test
 
AVIONIC CONTROL SYSTEMS FOR EDUCATION & DEVELOPMENT
AVIONIC CONTROL SYSTEMS FOR EDUCATION & DEVELOPMENTAVIONIC CONTROL SYSTEMS FOR EDUCATION & DEVELOPMENT
AVIONIC CONTROL SYSTEMS FOR EDUCATION & DEVELOPMENT
 
Shimadzu hplc standard_operation_procedure_by_dr._sana_mustafa
Shimadzu hplc standard_operation_procedure_by_dr._sana_mustafaShimadzu hplc standard_operation_procedure_by_dr._sana_mustafa
Shimadzu hplc standard_operation_procedure_by_dr._sana_mustafa
 
Minor_Project_Report
Minor_Project_ReportMinor_Project_Report
Minor_Project_Report
 
FAULT DETECTION AND DIAGNOSIS OF INDUCTION MACHINE WITH ON-LINE PARAMETER PR...
FAULT DETECTION AND DIAGNOSIS OF INDUCTION MACHINE  WITH ON-LINE PARAMETER PR...FAULT DETECTION AND DIAGNOSIS OF INDUCTION MACHINE  WITH ON-LINE PARAMETER PR...
FAULT DETECTION AND DIAGNOSIS OF INDUCTION MACHINE WITH ON-LINE PARAMETER PR...
 
Monitoring and Controlling Of Electric Overhead Travelling Crane Using PLC an...
Monitoring and Controlling Of Electric Overhead Travelling Crane Using PLC an...Monitoring and Controlling Of Electric Overhead Travelling Crane Using PLC an...
Monitoring and Controlling Of Electric Overhead Travelling Crane Using PLC an...
 
Paper id 37201531
Paper id 37201531Paper id 37201531
Paper id 37201531
 
REAL TIME OPERATING SYSTEM PART 1
REAL TIME OPERATING SYSTEM PART 1REAL TIME OPERATING SYSTEM PART 1
REAL TIME OPERATING SYSTEM PART 1
 
Optimized sensor selection for control and fault tolerance of electromagnetic...
Optimized sensor selection for control and fault tolerance of electromagnetic...Optimized sensor selection for control and fault tolerance of electromagnetic...
Optimized sensor selection for control and fault tolerance of electromagnetic...
 
Plc & Scada report 4
Plc & Scada report 4Plc & Scada report 4
Plc & Scada report 4
 
Safety System Modularity
Safety System ModularitySafety System Modularity
Safety System Modularity
 
Using Synchrophasor Data for Voltage Stability Assessment
Using Synchrophasor Data for Voltage Stability AssessmentUsing Synchrophasor Data for Voltage Stability Assessment
Using Synchrophasor Data for Voltage Stability Assessment
 

State_Machine_Documentation_ CharlotteQin_Summer2014

  • 1. TGC McGill Testing Facility New Small Wheel ATLAS Experiment State Machine Code and User Interface Documentation Charlotte Qin McGill University Supervisor: Brigitte Vachon Date: August 22rd, 2014
  • 2. Abstract As a significant component of New Small Wheel (NSW) project, Thin Gap Chambers have been developed for usage in the trigger system of the end-cap muon spectrometer in the ATLAS experiment. ATLAS group at McGill University is responsible for quality assurance before the TGC modules are shipped to CERN for installation on NSW. A state machine coded in LabVIEW is required as a part of slow control at McGill Testing Facility. It is used for monitoring the environment, sensors and hardware parameters at different states to assure the safety of the laboratory environment. Contents 1 Background 2 2 Slow Control System at McGill Testing Facility 2 2.1 Equipment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2.2 State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.3 Documentation Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3 Code Documentation 5 3.1 State Transition Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.1.1 Normal Operation States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.2 Error States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2 Code Structure Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.3 The State Machine User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.3.1 Global Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.3.2 Gas System Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.3.3 HV System Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.4 HV Control Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.5 Sensor Monitor and Data Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4 Outlook 14 5 Acknowledgement 14 6 References 15 1
  • 3. 1 Background ATLAS (A Toroidal LHC ApparatuS) is a particle physics experiment at the Large Hadro Collider (LHC), a proton-proton accelerator located at CERN in Geneva, Switzerland. ATLAS is designed for a board search of new discoveries at extraordinary high energy including unification of fundamental forces, extra dimensions of space, evidence of dark matters, etc. LHC is currently the highest energy collider in the world. Following the discovery of the Higgs boson in 2012, the ATLAS detector is planned to be upgraded to have better performance at higher luminosity. After the second long shutdown (LS2) in 2018, the accelerator luminosity will be increased to 2−3×1034cm−2s−1 with a center-of-mass energy of 14 TeV. In order to maximize the luminosity performance, the first station of the ATLAS muon end-cap system, Small Wheel(SW), has to be replaced. The improved trigger system of ATLAS’s New Small Wheel (NSW) will significantly enhance its ability to detect muons travelling in the forward region of the detector. The trigger system is composed of a series of gaseous detectors Thin Gap Chambers (TGCs). The construction of TGCs involves the cooperation of several Canadian physics institutions including TRIUMF and Simon Fraser University in Vancouver, BC. The components of the TGCs will then be assembled at Carleton University in Ottawa. Before these chambers are shipped to CERN for installation onto NSW, the TGC modules will be sent to McGill University in Montreal for testing and quality assurance. TGC Testing Facility at McGill University will perform tests on the chambers running gas mixture of carbon dioxide and pentane under certain pressure, flow rate and high voltage. A well-developed slow control system is required to ensure safe and smooth operations of TGC testing. From May 5th to August 22nd, 2014, I was responsible for developing such a state machine and its user interface in LabVIEW programming language for TGC slow control. 2 Slow Control System at McGill Testing Facility 2.1 Equipment Slow control system is responsible for setup of hardware components and monitoring of experimental pa- rameters such as high voltage modules, temperature sensors, pressure gauges, leak detectors, etc. At TGC Testing Facility at McGill, the slow control system consists of a LabVIEW-programmed state machine, 2
  • 4. which is continuously running on a laptop without interruption, an uninterruptable power supply (UPS), a data acquisition crate (cDAQ) from National Instrument, and a series of sensors, including two iTrans pentane sniffers, a various resistive temperature device and thermocouples, a ambient pressure sensor, a differential pressure sensor, a ambient humidity sensor and a mass flow controller. 2.2 State Machine State Machine serves as a medium between the user and laboratory hardware. State Machine architecture offers useful applications for creating user interfaces in which the user can perform certain tasks such as hardware monitoring, error handling, data logging, etc. It implements complex decision-making algorithm, usually presented by a state transition diagrams 1, into a number of states. The state machine is able to recognize the occurrence of each state, where each state represents A segment of the process and a specific action is performed for each state. When an action is received, it takes the user interface into a different state in the state machine, which either leads to another state or performs more in-state actions until the next user event is triggered. TGC State Machine ensures the safety of McGill Testing Facility by controlling and continuously monitoring the following three systems in the lab: • Environment, which includes ambient temperature, humidity and pressure sensors • Gas System, which contains mass flow controller, safety valves power and gas detectors • High Voltage (HV) System, which consists of LabVIEW user interfaces to CAEN HV crate, with added logging of data The goal of TGC state machine design is to create a straight-forward, practical, and informative panel for users; repetitive and unimportant information can be neglected in order to keep the display panel neat and simplified. TGC State Machine includes a central panel, which is called "State Machine Panel" in general terms, and two extension panels: HV Panel 2, and DAQ and Sensor Monitoring Panel 3. The cen- tral panel displays overall status of the three slow control systems, and sends commands to the extension 1 See section 3.1 2 Integrated with CEAN HV Crate applications. See section 3.4 3 Written by Robert A. Keyes, a PhD student at McGill University, see section 3.5 3
  • 5. panels. It groups the three systems into three sub-panels: Global (Environment) Panel, Gas System panel, and HV System Panel. Sensor monitoring and HV are two rather complex systems, and it is important to know what is going on with the parameters’ status beyond the condensed information displayed on the state machine panel; the two extension panels further control the system, and display instantaneous status of the parameters and the history record of some parameters over a period of time. 2.3 Documentation Location The documentations related to slow control are all saved to Google Drive. The LabVIEW codes have been saved to the address: ATLAS-TGC-MCGILL/CODES/SLOW CONTROL. In the folder "SLOW CONTROL", the central panel and the two extensions are saved under the folder "Main VIs". These main VIs are: • Central State Machine Panel, named as StateMachinePanel.vi • HV Operation Panel, named as HVPanel.vi • DAQ and Sensor Monitoring Panel, named as DAQPanel.vi In the same folder "SLOW CONTROL", the support VIs are saved under five separate folders based on its purpose. These folders are: "Support VIs", "Gas Support VIs", "HV Support VIs", "Controls" and "Global Variables". User interface related files for example, State Transition Diagram and user guide documents are saved to the following address: ATLAS-TGC-MCGILL/DOCUMENTATION/SLOW CONTROL/User Interface. The folder "User Interface" contains the following editable Google image files: • State Transition Diagram, named as StateTransitionDiagram • User Guide 1 for State Machine - Global Pane • User Guide 2 for State Machine - Gas Operation • User Guide 3 for State Machine - HV Panel 4
  • 6. 3 Code Documentation 3.1 State Transition Diagram State Transition Diagram presents the logic of a State Machine in a flow-chart form. A "state" represents a segment of the big picture of operations, and a "transition" is a series of actions needs to be taken in order to go from one state to another. Figure 1: TGC State Transition Diagram 5
  • 7. TGC State Transition Diagram consists of normal operation states, error states 4, and an emergency stop bottom. When the system parameters do not meet the physical characteristics of each state, or the user does not perform the required actions, the state machine will fall into a corresponding error state. In cases of insignificant errors, such as sensor value mismatch, the system is able to go back to normal state automatically or by clicking "Clear Error" Button after the existing error is physically corrected; however, when critical errors occur, the system will drop back to dormant state to ensure the safety of the operation. As an essential component of State Machine, the stop button is designed to shut down the entire system in emergency situation. 3.1.1 Normal Operation States Normal operation states include three categories: Global States, CO2 Operation States and HV Operation States. These states are organized in a certain sequence, which will be discussed later in the section. 1. Global States: are operating states in which actions are applied to the overall system or environ- ment. Global states further divides into three sub states which are Dormant State, CO2 Flush State and Ready State. (a) Dormant state: is the primary state of the system. Before the user applies any action, the state machine is monitoring the environmental changes, whereas gas system and HV systems are both turned off; there is no data acquisition in this state. In this state, user is asked to turn on all the gas lines. After all the lines are turned on, the mass flow control (MFC) rate will be updated automatically to 100 mL/min per line, and 1000 mL/min as "total Set MFC" input. If any of the gas lines is still open, or the total MFC value does not match the set value, when click the forward command, the system will transition to Dormant Error State; if no error occurs, the state machine will be able to move on to the next state. (b) CO2 Flush State: is a virtual state with 15-minute CO2 flush at a MFC rate of 100 mL/min per gas line for elimination of air contamination in the gas tunnels. In the later states of gas operation, if the a new line is turned on, the system has to perform 5 minute flush of CO2 gas at 45 mL/min to ensure the safety of the tunnel. 4 As shown in Figure 1, error states are parallel to the normal states with identical names 6
  • 8. This is a transition state where the user doesn’t need to perform anything directly on the state machine panel other than waiting and prepare for the next step of the operation. If the user wants to stop the operation in the middle of CO2 Flush State, State Machine returns back to dormant. When the system finishes the 15 minutes flush, the system goes directly to Ready State. (c) Ready State: the system will be in error states when State Machine just transitions from CO2 Flush State until all the gas lines are turned off; in the mean time, MFC value needs to set to zero. If the gas lines aren’t turned off entirely, the system will stay in Ready Error State. Ready State has all the physical characteristics of Dormant State except that, at this point, the system is fully flushed which enables gas operations to be carried out safely right away in the next state. 2. Gas Operation States: are operating states where the user selects desired gas lines to give spe- cific instructions and parameter inputs. Some operations can be performed remotely through TGC State Machine such as setting the total MFC rate; some operations can only be done manually, for example, setting the Peltier temperature and physically opening the solenoid valves of the selected gas lines. Depending on the type of gas running through the gas tunnel, the channel status will be set to "CO2 Run" at default value, 45 mL/min per line or "Pentane Run" at 25 mL/min. In this state, first of all, the user has to turn on at least one line; next, he/she is asked to update the total MFC rate by clicking the bottom on the top right "Set MFC to ’EXT’"; if CO2-pentane gas mixture is running in the system, Peltier temperature has to be set to a desired value, and the next state will be perform as soon as the Peltier temperature gets updated. 3. HV Operation States: while State Machine is continuously monitoring the gas system, the oper- ation of HV system needs to perform on the extension panel of State Machine, HV (Operation) panel. In HV Operating States, users can select desired HV channels to turn on power or to change the parameter values such as voltage, current and ramping rate, on the HV Operation Panel5. Different 5 See section 3.4 7
  • 9. status of HV lines such as on, off, ramping up and ramping down are coded in different colours. While the HV extension controls and monitors the parameters and states of all the active 6 channels, TGC State Machine condenses the information and displays only the status of powered HV panel on the central panel. 4. Run State: is the final state of the program. Gas and HV systems are active and being monitored continually. If any error occurs, the state machine will send a error flag and go into Run Error State. 3.1.2 Error States In any state of the normal operations, the system can fall into an error state corresponding to the previous normal operation state the system was in. There are two types of errors: Corrective Errors and Critical Errors. Critical errors are relatively more damaging or harmful to the lab safety. As an example, in the gas system, it occurs in ambient gas, sensor trip and differential pressure spikes/offset from ambient, or Power loss and Vacuum failure in the gas system. Once a critical error is detected, TGC State Machine will take the entire system back to dormant states. Corrective errors are relatively less significant and can be corrected easily. The system goes back to the corresponding normal operating state after problems are conquered. In gas system, these errors include Peltier temperate mismatch, gas temperature mismatch and MFC rate mismatch. In the HV system, since the HV crate itself is a well-developed, safe system, it protects the system from safety hazard by tripping the power and ramping down the voltage back to zero; these tripping-causing errors include over current, over maximum voltage, external trip or disable, calibration error, under current, under voltage, remotely unplugged, power fail and temperature error. 6 Meaning that the slots in the crate which are physically activated and connected to testing hardware 8
  • 10. 3.2 Code Structure Overview TGC state machine is fundamentally composed of three while loops which are in charge of the three system: one loop for obtaining the sensor information, one for controlling the gas system, and one is for updating the powered HV channel status. These while loops continually monitor the systems until the program is aborted 7. There are a couple of other important LabVIEW infrastructures in TGC state machine such as shift registers. They have small tunnel-like structure that contains state transition information, located on the edge of a loop. The code for each specific state, also known as the transition code, is contained in a case structure; the transition code determines the next state in the sequence. Another significant component is event structure. Event structure enables the state machine to per- form assigned actions regarding specific user inputs. In this case, events are triggered by activation of specific booleans on the front panel such as forward command, reverse command, initialize button, etc. There is 0.5 second time-out set for the event structure. The time out event is basically an event that occurs at every set time-out period, and loops the same information from the previous iteration to the next one. This function makes sure that the state machine updates frequently to have the latest information. For loop is significant in terms of updating an array of gas channels or HV channels and continually updates the parameter values and status of the array, and logs data. It is used a couple of times in TGC State Machine both in the gas system and in HV system. 3.3 The State Machine User Interface 3.3.1 Global Panel Global Panel (see Figure 2) contains the inputs/controls (indicated in black in the diagram) and out- puts/indicators (indicated in blue) of the State Machine. Figure 2 explains the application of each com- ponent in details. The global inputs include a series booleans that guide the user to go from one operation state to another, while the global outputs display the overall state of the state machine, as well as the sensor and environment information. 7 The safest way to abort the program is to press the emergency stop button 9
  • 11. One thing to mention about the code is that since CO2 flush state is an virtual state which doesn’t actually exist in the case structure, it is instead installed in the event structure where there is a wait time of 15 minutes; during the flushing time, property nodes was used to update the display information on the Global Panel output. After the execution, the system transitions directly to ready state and to the next iteration. The important VIs are GasCO2FlushProgress.vi saved in folder "Support VIs", which time could be set to preferred wait time and number of execution. The global state saved as Type definition called GasStateIndicator.ctl under "Contorls". The sensor update is made possible thanks to global variable CurrentSensorValues.vi Global Variables. Figure 2: Global Sub-panel- State Machine Central Panel 10
  • 12. 3.3.2 Gas System Panel Gas system panel consists of an input panel and an output panel. On the input panel, the user is able to select a number of gas lines and the type of gas running, and to change the MFC rate. By operating the global status on the global panel, the output of the panel gets updated as the state machine moves on to different stages. On top of the output panel, the users are also asked to submit Peltier Temperature and MFC rate on this panel. Figure 3: Gas System Sub-panel - State Machine Central Panel Something to note is that for code and user interface simplification , I made the output panel in a certain way that the output contains all the elements on the input panel; however the repeated elements on the output panel is hidden to users. In order to deliver information from the input panel to the output panel, a sub VI "GasSelectChan- 11
  • 13. nel.vi" (saved in Support VIs) is used. We use a for loop to update all the channels. There is also a for loop outside the case structure to update the MFC rate for each state. A case structure is used to separate the normal operations from the error operations, and we have a series of error handling VIs to determine which state the state machine should go into. These error handling VIs are saved in Support VIs. 3.3.3 HV System Panel This part of the front panel displays information of the powered HV channels. More details about HV operation is explained in section 3.4. The HV information is updated with help of a global variable, saved in ATLAS-TGC-MCGILL/CODES/SLOW CONTROL/Support VIs. Figure 4: Condensed HV System Sub-panel - State Machine Central Panel 3.4 HV Control Panel In terms of programmatic structure, HV control panel (see Figure 4) has no significant difference from the other sub-panels on the global machine. Since HV is a rather complex system controlled remotely by the state machine, we made another panel to control the system. Integrated with CEAN sub VIs, users can control (input) and monitor (output) all the parameters of HV system on the panel. 12
  • 14. Figure 5: Condensed HV System Subpanel - State Machine Central Panel In order to access the control, the user firstly has to unlock the panel by clicking the start button on the panel. Using the check box to select desired HV lines, the user is allowed to turn on/off the power, change the parameter values of the specified HV line(s). It is also recommended, for memory storage, to use this function to record the connection information between the HV lines and the gas lines. Following this action, the HV light corresponding on each gas line output on the global panel will be turned on if the gas line is connected to one or more HV lines. The display information on HV Panel includes the crate map and error information on the top half of the panel; on the bottom half, it displays the status of all the active HV channels. The background colour of each channel indicates the current state of the channel, for example, when the HV is turned on, the colour changes from grey to light blue while the voltage is ramping up, green when the voltage finishes ramping and becomes stable, dark blue when ramping down. If a HV line trips, the background colour of the corresponding column will turn red (central panel updates the information simultaneously), so does the LED light on the HV panel. 13
  • 15. There is an overall case structure to separate the normal operation from the error states of the HV system. When the system is operating normally, the "ok" light on the front panel is bright green. As we use CEAN VIs to obtain information of active channels, and the user interface of program is modified with some LabVIEW infrastructures such as shift registers, case structure and event structure. In the beginning of the program, a case structure is used to ensure that HV cluster gets updated with new parameter values at every iteration, and the first iteration is initialized. Another function being installed is checking the wavefront of voltage and current for each HV line over a period of time. 3.5 Sensor Monitor and Data Logging Robert Keyes’ sensor monitor code The Sensor Monitor panel is located ATLAS-TGC-MCGILL/CODES/SLOW CONTROL/Mains VIs. Robert Keyes has written the data logging code which is applied to both the sensor monitoring as well as the state machine and HV Panel. 4 Outlook There are a few aspects that are not completed perfectly, and the following tasks need to be done: • The error handling VIs need to be tested in real scenarios. • The Emergency Button needs to be implemented to the HV system • The main state machine should be turned on before the other two panels to avoid execution conflicts such as ’the calling VI is already running’. • The user interface guide will be printed into posters or handbooks and made visible for users. 5 Acknowledgement I would like to thank Robert Keyes for his technical help with LabVIEW. I would also like to thank Andrée Robichaud-Véronneau, Andreas Warburton and Steve Roberson for guidance and for meeting weekly on the Gas System - Slow Control meeting. I would also like to thank my supervisor Brigitte Vachon for letting me work on this project and have this great learning opportunity. 14
  • 16. 6 References ATLAS.ch www.ni.com/white-paper/7595/en ATLAS New Small Wheel Technical Design Report - CERN June 2013 15