Excitation light path slave control system and control method
By introducing the STM32F4 microcontroller and multi-device collaborative control architecture, combining the S-curve acceleration and deceleration algorithm and Kalman filtering algorithm, the speed, coordination and stability problems of optical path switching control technology are solved, and fast optical path switching and multi-device synchronization are achieved to meet the high-performance needs of modern optical experimental equipment.
Patent Information
- Application Number
- CN202510624885.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-08-15
AI Technical Summary
The existing optical path switching control technology has significant defects in speed, coordination, monitoring feedback, safety and stability and adaptability, and it is difficult to meet the high-speed, accurate, stable and intelligent control needs of modern optical experimental equipment.
It adopts STM32F4 series microcontrollers, multi-device collaborative control architecture, real-time monitoring and feedback mechanism, modular hardware design and hierarchical software architecture, combined with S-curve acceleration and deceleration algorithm, Kalman filtering algorithm, CRC-16 check-and-heartbeat packet mechanism to achieve fast optical path switching, multi-device synchronization, real-time monitoring and high security.
It realizes fast optical path switching, multi-equipment collaborative control, real-time monitoring and feedback, improves system security and stability, enhances system adaptability and scalability, and meets the high-performance needs of modern optical experimental equipment.
Smart Images

Figure CN120491533A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of laser control technology, and specifically to an excitation optical path slave machine control system and control method. Background Art
[0002] Currently, in the field of optical path experimental equipment, optical path switching control is typically implemented using traditional microcontrollers combined with simple communication protocols. Existing technologies primarily rely on single UART or SPI communication methods, providing relatively basic device control and struggling to meet the complex demands of rapid optical path switching and coordinated control of multiple devices. For example, some systems have slow response times when controlling safety shutter switching, failing to complete multiple shutter switching in a short period of time. Furthermore, existing systems often lack real-time monitoring and feedback mechanisms for device status, making it impossible to detect and address abnormalities in a timely manner. This, to a certain extent, impacts the accuracy and reliability of optical experiments. Furthermore, monitoring of ambient temperature and power status is also inadequate, failing to provide strong guarantees for the stable operation of the equipment, and exhibiting poor adaptability and scalability. In summary, existing optical path switching control technologies exhibit significant deficiencies in speed, coordination, monitoring and feedback, safety, stability, and adaptability, severely restricting the performance improvement and application expansion of optical experimental equipment.
[0003] Application Contents
[0004] Based on the numerous deficiencies and shortcomings of the existing technology in the field of optical path switching control, this application aims to propose a fully optimized excitation optical path slave control system and control method to overcome the limitations of existing technology and meet the requirements of modern optical experimental equipment for high-speed, precise, stable, and intelligent control. The objectives of this application are specifically embodied in the following key aspects: 1. Improving optical path switching speed and responsiveness. This application aims to address the slow optical path switching speed problem in the existing technology. By developing an efficient communication protocol and optimized instruction parsing algorithm, the system can complete complex optical path switching operations in a very short time. 2. Achieving precise coordinated control of multiple devices. To overcome the shortcomings of the existing technology in device coordinated control, this application designs a multi-device coordinated control architecture. By introducing a central coordinator and distributed control nodes, the system can achieve precise synchronous control of multiple components such as motors, safety shutters, and LEDs. 3. Establishing a comprehensive real-time monitoring and feedback mechanism. To address the lack of real-time monitoring and feedback mechanisms in the existing technology, this application constructs a comprehensive device status monitoring system. 4. Enhancing system security and stability. To improve system security and stability, this application incorporates technical innovations at multiple levels. At the instruction parsing level, the system adopts a two-layer verification mechanism, first verifying the grammatical structure of the instruction, and then checking the logical rationality of the instruction to ensure that only legal and feasible instructions are executed. 5. Improve the adaptability and scalability of the system. In order to meet the growing functional requirements of optical experimental equipment, this application has designed a highly flexible system architecture. By adopting modular hardware design and layered software architecture, the system can easily adapt to the diverse needs of different experimental scenarios.
[0005] The specific technical solutions and features of this application are as follows:
[0006] An excitation light path slave control system and control method, including a hardware part, a software part, a control algorithm design, a safety and stability design, and an adaptability and scalability design. The hardware part includes a microcontroller, a communication interface, and a control monitoring module. The microcontroller adopts an STM32F4 series microcontroller, uses an ARM Cortex-M4 core, has a main frequency of 180MHz, has a built-in 512KB flash memory and 192KB SRAM, supports a floating point unit (FPU), and meets the system's requirements for high-speed data processing and complex control algorithms. The communication interface includes a UART interface and an SPI interface. The UART interface is used for instruction and data interaction between the MCU and the FPGA and the subordinate motor equipment, and uses a 3.3V level. The baud rate can be configured from 115200bps to 460800bps, and supports hardware flow control (RTS / CTS). The SPI interface is used for data exchange between the MCU and the excitation optical path host. It uses the SPI bus protocol, with a maximum communication speed of 18 MHz in master mode and supports data packet lengths ranging from 8 to 32 bits. It uses the time-triggered protocol (TTA) to achieve multi-device coordinated control, ensuring synchronized operation of multiple devices with an error within ±2 milliseconds. The control and monitoring module includes an LED control module, a running motor component, a safety shutter, an ambient temperature sensor, and a board power detection circuit. The LED control module is designed as a high-brightness LED array with PWM dimming at a dimming frequency of 20 kHz and a duty cycle range of 0% to 100%. The running motor component can be selected from a variety of motor types, preferably stepper motors and servo motors. The stepper motor has a maximum torque of 5 N·m and a step angle of 1.8°; the servo motor supports closed-loop control with a position accuracy of ±0.01°. The safety shutter uses an electromagnetically driven shutter with seven independent shutter units and a switching interval of 10ms-20ms. The ambient temperature sensor uses an NTC thermistor with a measurement range of -20°C to +85°C and an accuracy of ±0.5°C. The board power detection circuit uses a high-precision voltage acquisition chip that supports 24V, 12V, 5V, and 3.3V power supply voltage monitoring with a measurement accuracy of ±0.1V.
[0007] The software includes an operating system design, a task management module, a communication protocol design, and a data processing module. The operating system, based on the FreeRTOS real-time operating system, supports multitasking scheduling, with task priorities configurable from 0 to 31. It utilizes a scheduling algorithm that combines time-slice rotation and priority preemption to ensure timely execution of critical tasks. The task management module includes bootloader task management, bootloader app task management, motor control task management, shutter control task management, actuator motor control task management, and ADC data acquisition task management. The bootloader task management module is responsible for firmware updates and is located in the Flash address range 0x08000000-0x0801FFFF, with a total size of 128KB. The bootloader app task management module is responsible for controlling underlying modules and communicating with the host computer and is located in the Flash address range 0x08020400-0x080A03FF, with a total size of 512KB. The motor control task management module is responsible for motor drive and state management, utilizing an S-curve acceleration and deceleration algorithm to ensure smooth motor operation. The shutter control task management is responsible for switching and controlling the safety shutter, using an IO analog PWM method to prevent motor overheating. The push rod motor control task management is responsible for controlling the push rod motor's direction and speed, and combines this with DAC settings to adjust the push rod's motion. The ADC data acquisition task management is responsible for periodically collecting ambient temperature and power supply voltage, processing the data using a Kalman filter algorithm. The communication protocol design includes UART and SPI communication protocols. The UART communication protocol packet format is: a 2-byte frame header field with a fixed address range of 0x7E7E; a 1-byte instruction type field; a 1-byte data length field; an N-byte data content field; and a 2-byte checksum field. The SPI communication protocol packet format is: a 2-byte frame header field with a fixed address range of 0xFC7E; a 1-byte instruction type field; a 1-byte header type field; a 2-byte data length field; an N-byte data content field; and a 2-byte checksum field.
[0008] The control algorithm design includes an S-curve acceleration and deceleration algorithm and a Kalman filter algorithm. The S-curve acceleration and deceleration algorithm reduces motor vibration and improves positioning accuracy through a smooth acceleration and deceleration process. Its mathematical expression is:
[0009]
[0010] Where a is the acceleration, v is the max is the maximum speed, t1 is the acceleration time, t2 is the deceleration time, and T is the total movement time.
[0011] Preferably, acceleration a=500 mm / s 2 , maximum speed v max =1000mm / s, acceleration time t1=0.1s, deceleration time t2=0.4s, total movement time T=0.5s.
[0012] The Kalman filter algorithm is used to process the data collected by the sensor and filter out noise interference. The state update equation of the Kalman filter is:
[0013] x k =x k∣k-1 +K k (z k -Hx k∣k-1 )
[0014] Among them, x k is the estimated value of the current state, x k∣k-1 is the predicted value based on the previous state, K k is the Kalman gain, z k is the current measurement value, and H is the observation matrix.
[0015] The security and stability design includes data verification, communication recovery and instruction verification. The data verification adopts the CRC-16 verification algorithm, and the generating polynomial is:
[0016] G(x)=x 16 +x 15 +x 2 +1
[0017] The communication recovery mechanism uses a heartbeat packet mechanism to monitor the status of the communication link. The master and slave devices exchange heartbeat packets at a 200-millisecond interval. If no heartbeat response is received three times in a row, the communication recovery process is initiated, including reinitializing the communication interface, sending a restart request, reestablishing the connection, and synchronizing the device status. The command verification mechanism uses a two-tiered verification mechanism for control commands. First, the command's syntax is verified to ensure the correct format. Second, the command's logical rationality is verified, for example, checking whether the shutter switching sequence complies with safety regulations. Only commands that pass this dual verification are executed.
[0018] The adaptable and scalable design includes modular hardware design, a layered software architecture, and a software update mechanism. The modular hardware design includes a motor driver module, a sensor module, and a communication module. The motor driver module can adapt to the control requirements of different motors by replacing the motor driver chip, supporting a variety of motor types. The sensor module uses a variety of standardized interfaces (such as I2C and SPI), facilitating the expansion of new sensor types. The communication module supports multiple communication protocols by switching between different communication modes through register configuration. The layered software architecture includes a hardware abstraction layer (HAL), a middleware layer, and an application layer. The hardware abstraction layer (HAL) provides a unified hardware driver interface to shield hardware differences. The middleware layer performs functions such as instruction parsing, data processing, and task scheduling, and supports dynamic loading of new functional modules. The application layer implements specific business logic and enables functional expansion by calling APIs provided by the middleware layer. The software update mechanism design uses a dual-partition firmware update, divided into two program segments: the bootloader program segment and the bootloaderAPP program segment. The bootloader segment, responsible for firmware updates, is located in the Flash memory address range 0x08000000-0x0801FFFF; the bootloader app segment is located in the Flash memory address range 0x08020400-0x080A03FF. During the update process, the bootloader verifies the integrity of the new firmware and backs up the old one. If the update fails, the system automatically rolls back to the old firmware to ensure stability.
[0019] In summary, this application addresses the deficiencies of conventional laser control systems in terms of responsiveness, coordinated control, monitoring and feedback mechanisms, safety and stability, and adaptability and scalability. Through the above-mentioned technical solutions and innovative designs, this application comprehensively resolves the deficiencies of the prior art, significantly improves the performance and reliability of the excitation optical path slave control system and control method, and meets the high-performance requirements of modern optical experimental equipment. The beneficial effects achieved are as follows:
[0020] 1. Fast optical path switching: Through the S-curve acceleration and deceleration algorithm and parallel processing technology, the system can complete stable switching of optical paths within 50 milliseconds.
[0021] 2. Multi-device collaborative control: The collaborative control architecture based on the time-triggered protocol (TTA) ensures the synchronization of multiple devices, with the error controlled within ±2 milliseconds.
[0022] 3. Real-time monitoring and feedback: Multi-sensor fusion technology combined with the Kalman filter algorithm enables real-time monitoring of ambient temperature and power supply voltage, with measurement errors controlled within ±0.5 degrees Celsius and ±0.1 volt.
[0023] 4. High security and stability: CRC-16 checksum algorithm and heartbeat packet mechanism are used to ensure the integrity of data transmission and the reliability of communication links.
[0024] 5. Strong adaptability and scalability: Modular hardware design and layered software architecture support multiple motor types and sensor expansion, facilitating system function upgrades. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is the principle block diagram of the equipment board for this application; DETAILED DESCRIPTION
[0026] The term "embodiment" is used herein specifically to describe any embodiment as "exemplary," and should not be construed as superior or preferable to other embodiments. Performance indicators in the embodiments of this application were tested using conventional testing methods in the art, unless otherwise specified. It should be understood that the terms used in this application are intended solely to describe specific implementations and are not intended to limit the disclosure herein.
[0027] Unless otherwise specified, the technical and scientific terms used herein have the same meanings as commonly understood by ordinary technicians in the technical field to which this application belongs; other experimental methods and technical means not specifically specified in this application refer to experimental methods and technical means commonly used by ordinary technicians in this field.
[0028] As used herein, the terms "substantially" and "approximately" are used to describe small fluctuations. For example, they can refer to less than or equal to ±5%, such as less than or equal to ±2%, such as less than or equal to ±1%, such as less than or equal to ±0.5%, such as less than or equal to ±0.2%, such as less than or equal to ±0.1%, such as less than or equal to ±0.05%. Numerical data expressed or presented in range format herein are used for convenience and brevity only and should therefore be interpreted flexibly to include not only the values explicitly listed as the limits of the range, but also all independent values or subranges contained within the range. For example, a numerical range of "1-5%" should be interpreted to include not only the explicitly listed values of 1% to 5%, but also the independent values and subranges within the indicated range. Thus, included in this numerical range are independent values such as 2%, 3.5%, and 4%, and subranges such as 1% to 3%, 2% to 4%, and 3% to 5%, etc. This principle also applies to ranges that only list a single value. Furthermore, this interpretation applies regardless of the width of the range or the characteristics described.
[0029] Throughout this document, including in the claims, transitional terms such as "comprises," "includes," "with," "having," "contains," "involving," and "accommodating" are understood to be open-ended, meaning "including but not limited to." Only the transitional terms "consisting of" and "composed of" are closed transitional terms.
[0030] In order to better illustrate the content of this application, numerous specific details are provided in the specific examples below. It should be understood by those skilled in the art that this application can be implemented without certain specific details. In the examples, some methods, means, instruments, equipment, etc. well known to those skilled in the art are not described in detail in order to highlight the main purpose of this application.
[0031] Under the premise of no conflict, the technical features disclosed in the embodiments of the present application can be arbitrarily combined, and the resulting technical solutions belong to the contents disclosed in the embodiments of the present application. It should be noted that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like mentioned in this application indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the technical features and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application, unless it conflicts with the context. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance, unless it conflicts with the context.
[0032] The specific implementation methods of the present application are described below to facilitate understanding of the present application by those skilled in the art. However, it should be clear that the present application is not limited to the scope of the specific implementation methods. For those skilled in the art in the present technology, as long as various changes are within the spirit and scope of the present application as defined and determined by the attached claims, these changes are obvious, and all application creations based on the concept of the present application are protected.
[0033] Example
[0034] See also Figure 1 In order to realize the excitation optical path slave control system and control method proposed in this application, this application has made a customized design for the device board.
[0035] This application provides an embodiment, and the specific implementation is as follows:
[0036] 1. System hardware implementation:
[0037] Microcontroller Selection and Interface Connections. Microcontroller Selection: The STM32F407VET6 microcontroller was selected. It features a high-performance ARM Cortex-M4 core operating at 180MHz, 512KB of internal flash memory, and 192KB of SRAM. Its floating-point unit (FPU) efficiently handles complex mathematical operations, meeting the real-time requirements of the optical path control algorithm. Interface Connections: UART Interface: Operating at 3.3V, it connects to the FPGA and its associated motor devices. It is configured with 8 data bits, 1 stop bit, and no parity bit. The baud rate is initially set to 115200bps. Hardware flow control pins (RTS / CTS) are used to prevent data overflow. SPI Interface: Connects to the excitation optical path host. Under the SPI bus protocol, master mode offers a maximum communication speed of 18MHz, flexible data packet length, and a chip select pin active low. Control and Monitoring Module Installation: LED Control Module: The high-brightness LED array is soldered to the PCB and controlled by a PWM signal with a dimming frequency of 20kHz. The duty cycle is generated by the MCU's TIM2 timer and ranges from 0% to 100%. Motor components: A stepper motor (such as the THK SF1605) is mounted on the optical path adjustment mechanism and connected to the MCU's TIM3 and TIM4 timers to generate direction (DIR) and pulse (PUL) signals with a pulse frequency range of 1kHz to 20kHz. A servo motor (such as the Panasonic MSMD082G1U) utilizes closed-loop control, with feedback signals connected to the MCU's external interrupt pin (EXTI) via a photoelectric encoder. Position accuracy reaches ±0.01°. Safety shutter: An electromagnetically driven shutter (such as the Sigma Kompakt) is mounted at the optical path exit. Seven independent shutter units are controlled by the MCU's GPIO, switching via analog PWM. The switching time for a shutter group is 50ms, and the cycle of eight shutter groups is completed within 60ms. Ambient temperature sensor: An NTC thermistor (such as the Murata NCP15XH103F03RB) is soldered on the PCB near the motor and power supply. Resistance changes are detected via the MCU's ADC1 channel. Board power detection circuit: A high-precision voltage acquisition chip (such as the LT3886) is connected to the 24V, 12V, 5V, and 3.3V power supplies. The output signal is fed into the MCU's ADC2 channel. An internal resistor divider network converts the voltage value to the measurable range of the MCU ADC (0V to 3.3V). Power supply design and electromagnetic compatibility. Power supply design: Multiple voltage regulator chips (such as the LM2596S and LD1117V33) are used to convert the external 24V power supply to the 5V and 3.3V voltages required by the MCU, motor drive, and sensors. Each output is equipped with an independent filter capacitor (such as 100μF / 50V and 10μF / 25V) and a ferrite bead (such as the B88157-S001-M) to ensure that the power supply ripple is less than 50mV.Electromagnetic compatibility: In the PCB layout, power, ground, and signal lines adopt a star topology, with shielded ground wires placed next to critical signal lines (such as motor drive signals). The motor drive circuit and control circuit are isolated by an optocoupler (such as the TLP751), with an isolation voltage of up to 5000V. All external interfaces are equipped with ESD protection diodes (such as the SMAJ5.0A) to prevent damage from static electricity.
[0038] 2. System software implementation:
[0039] Operating System Configuration and Task Scheduling. Operating System Configuration: FreeRTOS version 10.4.0. The system clock is provided by the MCU's SysTick timer, with a clock frequency set to 1kHz to ensure task scheduling accuracy. Task stack sizes are configured based on functional requirements: 256 bytes for the bootloader task, 512 bytes for the motor control task, 384 bytes for the shutter control task, 384 bytes for the actuator motor control task, and 256 bytes for the ADC data acquisition task. Task Scheduling: A scheduling algorithm combining time slicing and preemptive priority is used. The bootloader task has the lowest priority (level 31) and runs only during system initialization and firmware updates. The motor control task has a priority of level 5, enabling real-time adjustment of motor speed and position. The shutter control task has a priority of level 2, ensuring rapid response to optical path switching commands. The actuator motor control task has a priority of level 7, executing at a preset period. The ADC data acquisition task has a priority of level 10, periodically collecting temperature and voltage data. Communication Protocol Implementation and Data Processing. UART Communication Protocol Implementation: Data Packet Reception: The MCU receives data from the FPGA and its subordinate motor devices via USART2. The receiving function uses interrupt mode, and the receiving buffer size is 256 bytes. The received data packet first performs frame header detection (0x7E7E), and then parses the data content according to the instruction type (such as 0x01 indicates a control instruction) and data length. For example, when receiving the shutter control instruction "s a1-b0-c1", the system will parse it to find that shutter a switches to 1, shutter b switches to 0, and shutter c switches to 1. Data packet verification: The CRC-16 checksum algorithm is used, and the generating polynomial is G(x) = x 16 +x 15 +x 2 +1. The receiving end calculates the checksum of the received data packet and compares it with the checksum in the data packet. If they do not match, the data transmission is considered to be an error, the packet is discarded, and an error response is sent.
[0040] 3. Control algorithm implementation:
[0041] S-curve acceleration and deceleration algorithm implementation. Algorithm initialization: In the motor control task, define the parameters of the S-curve acceleration and deceleration algorithm: acceleration a = 500mm / s 2 , maximum speed vmax = 1000 mm / s, acceleration time t1 = 0.1 s, deceleration time t2 = 0.4 s, and total movement time T = 0.5 s. Algorithm execution: When the stepper motor needs to move 100 mm, the S_curve function is called to calculate the displacement at each time point and generate a corresponding pulse signal. For example, at 0.1 seconds, the displacement is 0.5 mm; at 0.2 seconds, the displacement is 20 mm; and at 0.5 seconds, the displacement reaches 100 mm.
[0042] Kalman filter algorithm implementation. Algorithm initialization: In the ADC data acquisition task, define the Kalman filter algorithm parameters: initial state estimate x0 = 0, initial error covariance matrix P0 = 1, process noise covariance matrix Q = 0.01, and measurement noise covariance matrix R = 0.1. Algorithm execution: Update the state estimate based on the measured value. When the resistance value of the ambient temperature sensor changes, call the kalman_filter function to filter the temperature. For example, if the collected resistance value sequence is [10.2kΩ, 10.3kΩ, 10.1kΩ, 10.4kΩ], after Kalman filtering, the resulting temperature estimate sequence is [25.1℃, 25.2℃, 25.1℃, 25.3℃], significantly reducing measurement noise.
[0043] 4. System security and stability realization:
[0044] Data Verification and Communication Recovery. Data Verification Implementation: In UART communication, the transmitter calculates the CRC-16 checksum of the data packet and appends it to the end. After receiving the data packet, the receiver recalculates the checksum and compares it with the received checksum. The receiver then calculates the checksum and verifies the data integrity. Communication Recovery Implementation: The system uses a heartbeat packet mechanism to monitor the status of the communication link. The master and slave devices exchange heartbeat packets at a 200 millisecond interval. If no heartbeat response is received three times in a row, the communication recovery process is initiated. Instruction Security Design. Instruction Verification Implementation: A two-layer verification mechanism is used for control instructions. First, the instruction syntax is verified to ensure the correct format; second, the logical rationality of the instruction is verified. For example, when receiving the shutter control instruction "s a1-b0-c1", the system first checks whether the instruction begins with "s", then checks whether the shutter number (a, b, c) is valid, and finally checks whether the switch state (1, 0) is reasonable. Only instructions that pass this dual verification are executed.
[0045] 5. System adaptability and scalability realization:
[0046] Modular hardware design. Motor driver module expansion: When adding a new motor type, simply add the corresponding motor driver module at the hardware level and call the universal motor control interface at the software level. For example, to add a servo motor driver module, the hardware connects to the servo motor's power, signal, and feedback lines. At the software level, control is implemented by calling the motor_control_servo() function. Sensor module expansion: Standardized interfaces (such as I2C and SPI) facilitate the expansion of new sensor types. For example, to add an optical sensor, the hardware connects to the sensor's I2C interface. At the software level, data acquisition is implemented by calling the i2c_read() and i2c_write() functions. Layered software architecture. Hardware abstraction layer (HAL) implementation: Provides a unified hardware driver interface to shield hardware differences. Middleware layer implementation: Implements functions such as instruction parsing, data processing, and task scheduling. The middleware layer adopts a plug-in design and supports dynamic loading of new functional modules. For example, to add a new instruction parsing module, simply register it at the middleware layer and add the corresponding task in the task scheduler. Application layer implementation: Implements specific business logic, such as optical path switching control and device status monitoring. The application layer implements functional expansion by calling APIs provided by the middleware layer. For example, to add new light path switching control logic, simply call the light_path_switch() function in the application layer and pass in the corresponding parameters. A dual-partition firmware update mechanism is implemented: the bootloader program segment is responsible for firmware updates and is located in the flash memory address range 0x08000000-0x0801FFFF; the bootloaderAPP program segment is located in the flash memory address range 0x08020400-0x080A03FF. During the update process, the bootloader verifies the integrity of the new firmware and backs up the old firmware. If the update fails, the system automatically rolls back to the old firmware to ensure stability.
[0047] 6. System integration and testing:
[0048] System Integration. Hardware Integration: Physically connect the microcontroller, motor driver module, sensor module, power supply module, and other components according to design requirements, ensuring proper connection of signal, power, and ground lines between modules. Use a multi-layer PCB design to reduce wiring length and signal interference. Software Integration: Integrate software modules such as the operating system, middleware layer, and application layer, ensuring proper function calls and data transfer between modules. Use C language and the Keil MDK development environment for code writing and debugging to ensure code readability and maintainability. System Testing. Functional Testing: Test various system functions, including optical path switching speed, multi-device coordinated control, and real-time monitoring feedback. For example, when testing optical path switching speed, use an oscilloscope to measure the time from receiving a command to stable optical path switching, ensuring it is within 50 milliseconds. Performance Testing: Test system performance, including response time, control accuracy, and stability. For example, when testing response time, use a logic analyzer to measure the time from sending a command to device response, ensuring it is within 10 milliseconds. Reliability testing: This test measures system reliability, including communication stability, data integrity, and anti-interference capabilities. For example, when testing communication stability, 1,000 data packets are sent in an electromagnetic interference environment, and the packet loss rate and error rate are calculated to ensure they are less than 0.1%.
[0049] Through the above detailed implementation methods, the excitation light path slave control system and control method of the present application can efficiently and reliably realize the precise control and status monitoring of multiple operating mechanism components in optical experimental equipment, and fully meet the high performance requirements of modern optical experimental equipment.
[0050] In addition, it should be understood that although this specification is described in terms of implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
[0051] The technical solutions disclosed in this application and the technical details disclosed in the embodiments are merely illustrative of the application concept of this application and do not constitute a limitation on the technical solutions of this application. Any conventional changes, replacements or combinations of the technical details disclosed in the embodiments of this application have the same application concept as this application and are within the scope of protection of the claims of this application.
Claims
1. An excitation optical path slave control system, characterized by: The invention comprises: (1) a control unit with an STM32 series microcontroller as the core, wherein the microcontroller is integrated with a UART interface and an SPI interface; (2) an FPGA and a subordinate motor device connected to the UART interface; (3) an excitation light path host connected to the SPI interface; (4) at least one LED control module controlled by the microcontroller; (5) at least one running motor component controlled by the microcontroller; (6) at least one safety shutter controlled by the microcontroller; (7) an NTC thermistor for monitoring the ambient temperature, which is connected to the ADC1 channel of the microcontroller; and (8) a high-precision voltage acquisition chip for monitoring the board power supply, which is connected to the ADC2 channel of the microcontroller. Among them, the microcontroller runs a FreeRTOS real-time operating system, which supports multi-task scheduling and the task priority can be configured from 0 to 31 levels. The microcontroller performs the following steps: S1, initializes the UART interface and SPI interface, and sets communication parameters; S2, initializes the LED control module, runs the motor components, safety shutter, NTC thermistor and high-precision voltage acquisition chip; S3, creates and starts the Bootloader task, motor control task, shutter control task, push rod motor control task and ADC data acquisition task; S4, receives control instructions through the UART interface and assigns them to the corresponding task processing according to the instruction type; S5, exchanges data with the excitation light path host through the SPI interface; S6, collects ambient temperature and power supply voltage data in real time, and issues alarms and reports data.
2. The excitation optical path slave control system according to claim 1, characterized in that: The running motor component is a stepper motor or a servo motor. The microcontroller controls the operation of the stepper motor by generating a direction signal and a pulse signal, and controls the position accuracy of the servo motor through a closed-loop control method.
3. The excitation optical path slave control system according to claim 1, characterized in that: The safety shutter is an electromagnetically driven shutter, and the microcontroller controls the switching of the safety shutter by IO analog PWM. The switching time of a group of safety shutters is 50ms, and the cycle processing time of 8 groups of safety shutters does not exceed 60ms.
4. The excitation optical path slave control system according to claim 1, characterized in that: The microcontroller uses an S-curve acceleration and deceleration algorithm to control the motor motion, and its mathematical expression is: Preferably, acceleration a=500 mm / s 2 , maximum speed v max =1000mm / s, acceleration time t1=0.1s, deceleration time t2=0.4s, total movement time T=0.5s.
5. The excitation optical path slave control system according to claim 1, characterized in that: The microcontroller uses the Kalman filter algorithm to process the data collected by the sensor, and its state update equation is: x k =x k∣k-1 +K k (z k -Hx k∣k-1 ) Among them, x k is the estimated value of the current state, x k∣k-1 is the predicted value based on the previous state, K k is the Kalman gain, z k is the current measurement value, and H is the observation matrix.
6. A control method for the excitation optical path slave control system according to claim 1, characterized in that: The following steps are involved: S1. Initialize the UART interface and SPI interface and set communication parameters; S2, initialize the LED control module, run the motor components, safety shutter, NTC thermistor and high-precision voltage acquisition chip; S3, create and start the Bootloader task, motor control task, shutter control task, push rod motor control task and ADC data acquisition task; S4, receiving control instructions through the UART interface and assigning them to corresponding tasks for processing according to the instruction type; S5, exchange data with the excitation optical path host through the SPI interface; S6. Collect ambient temperature and power supply voltage data in real time, and issue alarms and report data.
7. The control method according to claim 6, characterized in that: In step S4, the microcontroller performs a CRC-16 check on the received data packet, and the generating polynomial is: G(x)=x 16 +x 15 +x 2 +1 8. The control method according to claim 6, wherein: In step S5, the data exchange between the microcontroller and the excitation optical path host adopts a customized data packet format, and the data packet structure includes a frame header, instruction type, header type, data length, check field and extension field.
9. The control method according to claim 6, characterized in that: In step S6, the microcontroller uses multi-sensor fusion technology, combined with an NTC thermistor and a high-precision voltage acquisition chip, to monitor the ambient temperature and power supply voltage in real time, and processes the collected data through a Kalman filter algorithm.
10. The control method according to claim 6, characterized in that: In step S3, the microcontroller uses a time-triggered protocol (TTA) to implement multi-device collaborative control to ensure that the actions of multiple devices are synchronized and the error is controlled within ±2 milliseconds.
Citation Information
Patent Citations
Device for controlling motor rotating speed and shutter
CN102830639A
Optically configured modularized control system to enable wireless network control and sensing of other devices
CN104040530A
Laser control circuit and laser
CN107370014A
Distributed motor drive control system
CN108199627A
CO2 laser intelligent development control system based on radio frequency power supply
CN113075894A