CDC Control System is a precision capacitive measurement and control software designed for controlling the height and angle of parallel plate capacitors, real-time monitoring of capacitance changes, and data acquisition.
- π Serial Communication Management - Multi-device connection and management
- π― Precision Motor Control - Z-axis height and angle control
- π Real-time Sensor Monitoring - Multi-sensor data acquisition
- πΎ Data Recording & Export - CSV format data export
- βοΈ Hardware Integration - PSoC and sensor integration
- Programming Language: C++17
- UI Framework: Qt 6.9.1
- Build System: CMake 3.16+
- Compiler: Visual Studio 2022 (MSVC)
- Serial Communication: Qt SerialPort
- Testing Framework: Google Test (optional)
CDC_Control_System/
βββ src/ # Source code
β βββ app/ # Application modules
β β βββ include/ # Application headers
β β βββ src/ # Application implementation
β βββ core/ # Core business logic
β β βββ include/ # Core headers (motor, sensor, safety)
β β βββ src/ # Core implementation
β βββ data/ # Data processing modules
β β βββ include/ # Data processing headers
β β βββ src/ # Data implementation (CSV, export)
β βββ hardware/ # Hardware interface layer
β β βββ include/ # Hardware interface headers
β β βββ src/ # Serial/sensor communication
β βββ models/ # Data models
β β βββ include/ # Model headers (physics, config)
β β βββ src/ # Model implementation
β βββ utils/ # Utility classes
β βββ include/ # Utility headers (logger, math)
β βββ src/ # Utility implementation
βββ ui/ # User interface
β βββ forms/ # Qt UI files (.ui)
β βββ include/ # UI header files
β βββ src/ # UI implementation files
βββ tests/ # Unit tests
β βββ core_tests/ # Core module tests
β βββ data_tests/ # Data processing tests
β βββ hardware_tests/ # Hardware interface tests
β βββ models_tests/ # Model tests
β βββ utils_tests/ # Utility tests
βββ docs/ # Documentation
β βββ developer/ # Developer documentation
β βββ user_manual/ # User manual
βββ resources/ # Application resources
β βββ config/ # Configuration files
β βββ icons/ # Application icons
β βββ styles/ # UI stylesheets
βββ deploy/ # Deployment configuration
βββ package/ # Deployment packages
β βββ qt.conf # Qt configuration file
βββ windows/ # Windows-specific deployment
β βββ app.ico # Application icon
β βββ deploy_windows.bat # Deployment script
βββ macos/ # macOS-specific deployment
βββ deploy_macos.sh # Deployment script
- Primary Platform: Windows 10/11
- Secondary Platform: macOS 10.15+ (experimental)
- Qt Version: 6.9.1 or higher
- CMake: 3.16 or higher
- Compilers:
- Windows: Visual Studio 2022 (MSVC)
- macOS: Xcode 12+ (Clang)
- Clone Repository
git clone https://github.com/yourusername/CDC_Control_System.git
cd CDC_Control_System- Install Qt 6.9.1
Windows:
- Download and install Qt 6.9.1 for MSVC 2022 64-bit
- Ensure the following components are selected:
- Qt 6.9.1 MSVC 2022 64-bit
- Qt SerialPort
- CMake
- Ninja
macOS:
Option 1: Using Homebrew (Recommended)
# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Qt6
brew install qt@6Option 2: Using Qt Installer
- Download Qt installer from qt.io
- Install Qt 6.9.1 for macOS
- Ensure the following components are selected:
- Qt 6.9.1 macOS
- Qt SerialPort
- CMake (if not installed via Xcode)
- Install Build Tools
Windows:
- Install Visual Studio 2022 Community or higher
- Include "Desktop development with C++" workload
macOS:
- Install Xcode from App Store
- Install Xcode Command Line Tools:
xcode-select --install- Install Homebrew (if not already installed):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"- Build Project
Method 1: One-Click Build & Deploy (Recommended)
Windows:
# Modify paths in build_and_deploy.bat then run
build_and_deploy.batmacOS:
# Make executable and run
chmod +x build_and_deploy_macos.sh
./build_and_deploy_macos.shMethod 2: Manual Build
# 1. Navigate to project directory
cd C:\path\to\your\CDC_Set_Up_Control_Programm
# 2. Clean and create build directory
rmdir /s /q build
mkdir build && cd build
# 3. Configure CMake (modify Qt path to your actual installation)
cmake -G "Visual Studio 17 2022" -A x64 ^
-DCMAKE_PREFIX_PATH="C:\Qt\6.9.1\msvc2022_64" ..
# 4. Build project
cmake --build . --config Release
# 5. Navigate to executable directory
cd build\bin\Release
# 6. Deploy Qt dependencies
C:\Qt\6.9.1\msvc2022_64\bin\windeployqt.exe CDC_Control_System.exe
# 7. Run application
CDC_Control_System.exeMethod 1: Using Homebrew Qt
# Install Qt using Homebrew
brew install qt@6
# Navigate to project directory
cd /path/to/your/CDC_Set_Up_Control_Programm
# Create build directory
rm -rf build
mkdir build && cd build
# Configure CMake
cmake -DCMAKE_PREFIX_PATH="$(brew --prefix qt@6)" \
-DCMAKE_BUILD_TYPE=Release ..
# Build project
cmake --build . --parallel $(sysctl -n hw.ncpu)
# Run application
open bin/CDC_Control_System.app
# Or directly: ./bin/CDC_Control_SystemMethod 2: Using Qt Installer
# After installing Qt from qt.io to ~/Qt/6.9.1/macos
cd /path/to/your/CDC_Set_Up_Control_Programm
rm -rf build
mkdir build && cd build
# Configure CMake
cmake -DCMAKE_PREFIX_PATH="$HOME/Qt/6.9.1/macos" \
-DCMAKE_BUILD_TYPE=Release ..
# Build project
cmake --build . --parallel $(sysctl -n hw.ncpu)
# Deploy Qt frameworks (if needed for distribution)
$HOME/Qt/6.9.1/macos/bin/macdeployqt bin/CDC_Control_System.app
# Run application
open bin/CDC_Control_System.app- Create Distribution Package (Optional)
Windows:
# Run deployment script to create complete distribution package
deploy\windows\deploy_windows.batmacOS:
# Run deployment script to create complete distribution package
chmod +x deploy/macos/deploy_macos.sh
./deploy/macos/deploy_macos.sh
# Optional: Create DMG for distribution
cd deploy/package/macos
./create_dmg.sh- Open software, navigate to "Serial Communication" page
- Click "Add Device" to add serial port device
- Select correct COM port and baud rate (default 115200)
- Click "Connect" to establish connection
- Switch to "Motor Control" page
- Set target height (0-100mm) and angle (-90Β° to 90Β°)
- Click "Move to Position" to execute movement
- Use "Emergency Stop" for immediate halt
- View real-time data in "Sensor Monitor" page
- Click "Record Data" to log current data point
- Use "Export" to save data as CSV file
- Monitor sensor readings in real-time
- Track system status and error conditions
- Configure alarm thresholds and notifications
- Main Controller: PSoC 4500S
- Motor Driver: TMC2208-LA
- Distance Sensors: DFRobot SEN0427 (Γ4)
- Angle Sensor: Murata SCA830-D07-1
- Temperature Sensor: DS18B20+
- Servo Motor: SER0019
- Baud Rate: 9600/19200/38400/57600/115200 (selectable)
- Data Bits: 8
- Stop Bits: 1
- Parity: None
Timestamp,Set_Height(mm),Set_Angle(deg),Theoretical_Capacitance(pF),
Upper_Sensor_1(mm),Upper_Sensor_2(mm),Lower_Sensor_1(mm),Lower_Sensor_2(mm),
Temperature(C),Measured_Angle(deg),Measured_Capacitance(pF),...
Windows: The project includes complete automated deployment solution:
build_and_deploy.bat- One-click build and deploymentdeploy/windows/deploy_windows.bat- Windows-specific deployment scriptdeploy/package/qt.conf- Qt runtime configurationdeploy/windows/app.ico- Application icon
Deployed application package is located in deploy/package/windows/ directory and can be directly copied to other Windows computers.
macOS: Complete automated deployment with app bundle creation:
deploy/macos/deploy_macos.sh- macOS deployment script with auto Qt detection- Automatic
macdeployqtexecution - DMG creation script for distribution
- App bundle with all dependencies included
# One-command deployment
chmod +x deploy/macos/deploy_macos.sh
./deploy/macos/deploy_macos.sh
# The deployed .app bundle is located in deploy/package/macos/Windows: For manual distribution package creation:
- Copy all files from
build/bin/Release/ - Run
windeployqt.exeto deploy Qt dependencies - Include necessary runtime configuration files
macOS: For manual distribution:
- Build the application as shown above
- Use
macdeployqtto create a self-contained app bundle - Optionally create a DMG file for easier distribution
- For App Store distribution, code signing is required
-
Cannot Connect to Device
- Check if serial port is in use
- Verify correct baud rate setting
- Check USB driver installation
-
Build Errors
- Confirm Qt version >= 6.9.1
- Check CMake version >= 3.16
- Ensure Visual Studio 2022 is properly installed
- Verify Qt path configuration
-
windeployqt Cannot Find Dependencies
- Confirm correct Qt installation path
- Check system PATH environment variable
- Try running with administrator privileges
-
Application Won't Run on Other Computers
- Ensure target computer has Visual C++ Redistributable 2022 installed
- Verify deployment package includes