This software serves as a control system for a prototype magnet impregnation machine as part of the CERN FCC-ee HTS4 research project. The impregnation machine utilizes the novel approach of using paraffin wax to impregnate prototype canted-cosine-theta (CCT) magnets built from high-temperature superconducting (HTS) tape. This software communicates with the machine via serial (USB) and provides a user interface featuring data display and control mechanisms for the machine. This software utilizes a modified version of the open-source pyMeCom API to control the thermoelectric-coolers (TECs) of the impregnator.
At the heart of this prototype machine are two copper heat exchanger plates. The magnet is placed in an upright position between these plates, one touching the magnet form above and one from below. These plates are heated by 4 TECs each, creating a temperature gradient along the magnet when heated to different temperatures. These 8 TECs in total are connected to 4 PID control boards with each board controlling two TECs. Two PT100 temperature sensors per control board provide temperature readings of the corresponding copper plate. The 4 PID control boards need to be connected to the device running this software via serial.
For the TECs, the ETX11-12-F1-4040-TA-RT-W6 model is used. For the PID control boards, the TEC-1161-10A-PT100-PIN model is used.
This application features two modes of controlling the TECs:
- Temperature Control Mode
- Users can manually set a target temperature for each plate independently.
- Sequence Mode
- Users can define a series of temperature setpoints with corresponding wait times.
- The sequence is executed automatically.
Live and historic data (temperature, current, voltage, power) is displayed in dynamic plots. All recorded data can be downloaded in CSV for further analysis.
- This software is designed for Windows with Python 3.
- This software is designed for the impregnation setup described above. However, it was designed in a modular way, allowing the support of different setups with minor changes.
- Navigate to the root directory and install the required dependencies, e.g., with pip:
pip install -r requirements.txt
Determine the serial ports assigned to each of the four PID control boards. This assignment may vary by device:
- Connect the control boards via USB.
- Open the
Device Manageron Windows and head to the sectionPorts (COM & LPT). The four connected control boards should appear asUSB Serial Port (COMX), where X is the assigned port number. - Identify each board's serial port by disconnecting and reconnecting them one by one, if necessary.
Create a file named serial_ports.py in the app directory. Fill in the code below, replacing COMX with the respective serial port.
Assign the serial ports for the top control boards to TOP_1 and TOP_2 and the bottom ones for BOTTOM_1 and BOTTOM_2.
If you have an additional control board for external sensors, set its serial port under "OPTIONAL_EXTERNAL". If not, remove the line or leave it blank. External boards are those that only read temperatures and do not control TECs.
# These are the serialport allocations for the 4 boards controlling the TECs (and externals) when connected via USB.
PORTS = {
"TOP_1": "COMX",
"TOP_2": "COMX",
"BOTTOM_1": "COMX",
"BOTTOM_2": "COMX",
"OPTIONAL_EXTERNAL": "COMX",
}
- Download and install Docker Desktop for Windows. (Restart the computer if prompted.)
- Verify the Docker installation with:
docker --version - Pull the latest Redis version with:
docker pull redis - Start the Redis container with:
docker run --name tec-data-redis -p 6379:6379 -d redis - Verify that Redis is running by entering the Redis CLI with:
Then, in the command line, type
docker exec -it tec-data-redis redis-cliping. Redis should returnPONG.
To set up debugging in Visual Studio Code, create a launch.json file in the .vscode folder at the root of your project with the following configurations:
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Dash",
"type": "debugpy",
"request": "launch",
"module": "ui.app",
"cwd": "${workspaceFolder}",
"args": [],
"env": {
"FLASK_ENV": "development",
"PYTHONUNBUFFERED": "1"
}
},
{
"name": "Python: Data Acquisition",
"type": "debugpy",
"request": "launch",
"module": "tec_interface",
"cwd": "${workspaceFolder}",
"args": [],
"env": {
"PYTHONUNBUFFERED": "1"
}
}
],
"compounds": [
{
"name": "Run All",
"configurations": ["Python: Dash", "Python: Data Acquisition"]
}
]
}This configuration allows you to debug in VSCode by simultaneously starting both components of this software. Make sure to select the Run All configuration when launching the debugger.
- Start the Redis Docker container using:
docker start tec-data-redis - Start this software by navigating to the root directory and executing the start file:
.\start.bat
The following images are a few excerpts from the pyTECController UI.
Ole Kuhlmann
Email: ole.kuhlmann@rwth-aachen.de
GitHub: olekuhlmann