Galvanometer motor control method
By acquiring the target and actual position signals of the galvanometer motor and combining them with the current signal for drive control, the problem of galvanometer motors being unable to balance accuracy and cost in existing technologies has been solved. This achieves high-precision, low-cost galvanometer motor control, improving the stability and reliability of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN MAGMETT WELDING TECH CO LTD
- Filing Date
- 2025-04-27
- Publication Date
- 2026-07-31
AI Technical Summary
Existing galvanometer motor control solutions cannot simultaneously achieve the advantages of control accuracy and cost.
By acquiring the target position signal, actual position signal, and real-time current signal of the galvanometer motor, a reference current signal is determined, and the galvanometer motor is driven in combination with the speed compensation signal. The power-on timing is managed using preset power-on rules, the initial parameters are updated, and the offset is detected and adjusted, thereby achieving high-precision and low-cost control of the galvanometer motor.
It improves the driving accuracy of the galvanometer motor, reduces control costs, enhances system stability and reliability, and improves compatibility and maintainability.
Smart Images

Figure CN120546548B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of laser welding technology, and in particular to a galvanometer motor control method. Background Technology
[0002] In modern welding technology, especially in the field of laser welding, the use of galvanometer motors plays a crucial role in improving welding accuracy and efficiency. A galvanometer motor typically refers to part of a high-speed scanning galvanometer system equipped with a reflector. It guides the laser beam to move rapidly and accurately across the workpiece surface by precisely controlling the angle of the reflector, thereby achieving a highly efficient and precise welding process.
[0003] However, existing control schemes for galvanometer motors cannot simultaneously achieve the advantages of control accuracy and cost. Summary of the Invention
[0004] To address the aforementioned technical problems, the advantage of this application lies in providing a galvanometer motor control method that, compared to existing galvanometer motor control schemes, can balance the advantages of control accuracy and cost.
[0005] In a first aspect, this application provides a galvanometer motor control method, which is applied to a galvanometer motor. The galvanometer motor control method includes: acquiring a target position signal of the galvanometer motor, an actual position signal of the galvanometer motor, and a real-time current signal of the galvanometer motor; determining a reference current signal based on the target position signal and the actual position signal; and driving the galvanometer motor based on the reference current signal and the real-time current signal.
[0006] According to one embodiment of this application, determining the reference current signal based on the target position signal and the actual position signal includes: obtaining a position difference signal of the galvanometer motor based on the target position signal and the actual position signal; obtaining a velocity compensation signal based on the actual position signal; and obtaining a reference current signal based on the position difference signal, the velocity compensation signal, and the target position signal.
[0007] According to one embodiment of this application, driving the galvanometer motor based on the reference current signal and the real-time current signal includes: obtaining an error current signal based on the reference current signal and the real-time current signal; obtaining a motor drive signal based on the error current signal; and driving the galvanometer motor based on the motor drive signal.
[0008] According to one embodiment of this application, the galvanometer motor control method further includes: performing power-on timing management on the galvanometer motor based on preset power-on rules; obtaining initial parameters of the galvanometer motor, the initial parameters including: the boundary position and center position of the galvanometer motor; and resetting the galvanometer motor according to the initial parameters.
[0009] According to one embodiment of this application, power-on timing management of the galvanometer motor based on preset power-on rules includes: controlling the control module of the galvanometer motor to power on; controlling the galvanometer motor to power on; controlling the drive module of the galvanometer motor to power on, and starting the timer; and after reaching a first preset time, controlling the position loop circuit and current loop circuit of the galvanometer motor to power on.
[0010] According to one embodiment of this application, after reaching a first preset time, controlling the position loop circuit and current loop circuit of the galvanometer motor to power on includes: before reaching the first preset time, turning off the integral circuit in the position loop circuit and current loop circuit to control the output of the position loop circuit and current loop circuit to be zero; after reaching the first preset time, turning on the integral circuit to control the position loop circuit and current loop circuit to output normally.
[0011] According to one embodiment of this application, after reaching a first preset time, controlling the position loop circuit and current loop circuit of the galvanometer motor to power on includes: before reaching the first preset time, controlling the position loop circuit and current loop circuit to make their output within a first preset range; and after reaching the first preset time, controlling the position loop circuit and current loop circuit of the galvanometer motor to power on.
[0012] According to one embodiment of this application, controlling the position loop circuit and the current loop circuit to have their outputs within a first preset range before reaching a first preset time, and controlling the galvanometer motor's position loop circuit and current loop circuit to power on after reaching the first preset time includes: determining a first integral voltage based on the actual position signal; determining a second preset time and a second integral voltage based on the first integral voltage and the first preset time; controlling the position loop circuit and the current loop circuit to output according to the first integral voltage after the timer starts timing; controlling the position loop circuit and the current loop circuit to output according to the second integral voltage after the timer reaches the second preset time, controlling the position loop circuit and the current loop circuit to have their outputs within the first preset range before reaching the first preset time; and controlling the position loop circuit and the current loop circuit to start normal output after reaching the first preset time.
[0013] According to one embodiment of this application, the galvanometer motor control method further includes: performing a width scan on the galvanometer motor and updating the initial parameters of the galvanometer motor.
[0014] According to one embodiment of this application, the step of performing a width scan on the galvanometer motor and updating the initial parameters of the galvanometer motor includes: controlling the galvanometer motor to deflect in the forward direction and acquiring the feedback voltage signal of the galvanometer motor; determining a first boundary position of the galvanometer motor when the feedback voltage signal meets a preset condition; controlling the galvanometer motor to deflect in the reverse direction and acquiring the feedback voltage signal of the galvanometer motor; determining a second boundary position of the galvanometer motor when the feedback voltage signal meets a preset condition; and updating the initial parameters of the galvanometer motor based on the first boundary position and the second boundary position.
[0015] According to one embodiment of this application, the galvanometer motor control method further includes: detecting whether there is an offset in the initial parameters; if there is an offset, obtaining an offset parameter; and adjusting the initial parameters of the galvanometer motor according to the offset parameter.
[0016] According to one embodiment of this application, the offset parameter includes an offset amount and a maximum angular offset percentage, and adjusting the initial parameters of the galvanometer motor according to the offset parameter includes: adjusting the center position and boundary position of the galvanometer motor according to the offset amount and the maximum angular offset percentage.
[0017] According to one embodiment of this application, driving the galvanometer motor according to the motor drive signal includes: driving the galvanometer motor according to the motor drive signal and setting a timer for a third preset time; controlling the galvanometer motor to move at a constant speed based on the timer for the third preset time.
[0018] According to one embodiment of this application, controlling the galvanometer motor to maintain a constant speed based on the timer for a third preset time includes: acquiring the oscillation period and the position step value; if the timer reaches the third preset time, acquiring the running time, and determining the corresponding position step value based on the running time; and controlling the galvanometer motor to maintain a constant speed based on the position step value, the third preset time, and the oscillation period.
[0019] According to one embodiment of this application, controlling the galvanometer motor to move at a constant speed based on the position step value, the third preset time, and the oscillation period includes: adjusting the speed of the galvanometer motor according to the position step value and the third preset time to make the galvanometer motor move at a constant speed; obtaining the oscillation period of the galvanometer motor and determining the duration difference between half of the oscillation period and the running time; if the duration difference is less than the third preset time, adjusting the timer based on the duration difference, and reversing the speed of the galvanometer motor after the timer reaches the duration difference, and setting the timer based on the third preset time.
[0020] The described galvanometer motor control method obtains a reference current signal by processing the target position signal and the actual position signal. Then, the reference current signal and the real-time current signal of the galvanometer motor are processed to drive the galvanometer motor. Compared with the scheme of directly driving the galvanometer motor based on the target position signal, this scheme has higher driving accuracy for the galvanometer motor. In summary, this scheme has the advantages of both control accuracy and cost. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the conventional technology, the drawings used in the description of the embodiments or the conventional technology will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 A flowchart of a galvanometer motor control method provided in one embodiment of this application;
[0023] Figure 2 A detailed flowchart of the method for obtaining the reference current signal in a galvanometer motor control method provided in another embodiment of this application;
[0024] Figure 3 A detailed flowchart of the galvanometer motor driving method provided in other embodiments of this application;
[0025] Figure 4 A flowchart illustrating the control of a galvanometer motor according to an embodiment of this application is shown;
[0026] Figure 5 A flowchart illustrating a swing-width scan of a galvanometer motor according to an embodiment of this application is shown;
[0027] Figure 6 A flowchart illustrating the correction of the center position of a galvanometer motor according to an embodiment of this application is shown;
[0028] Figure 7 A flowchart illustrating the control state of the galvanometer motor according to an embodiment of this application is shown;
[0029] Figure 8 A flowchart illustrating the waiting state of the galvanometer motor according to one embodiment of this application is shown;
[0030] Figure 9 A flowchart illustrating the test state of a galvanometer motor according to an embodiment of this application is shown;
[0031] Figure 10A flowchart illustrating the start-up state, running state, stop state, and error state of a galvanometer motor according to an embodiment of this application is shown.
[0032] Figure 11 A flowchart illustrating the speed control of a galvanometer motor according to an embodiment of this application is shown;
[0033] Figure 12 A flowchart of a speed ladder algorithm according to an embodiment of this application is shown;
[0034] Figure 13 A block diagram of a galvanometer motor control circuit provided for one embodiment of this application;
[0035] Figure 14 A circuit diagram of a light source control circuit according to the above embodiments of this application is shown;
[0036] Figure 15 A circuit diagram of a voltage sampling circuit according to the above embodiments of this application is shown;
[0037] Figure 16 A circuit diagram of a buffer circuit according to the above embodiments of this application is shown;
[0038] Figure 17 A circuit diagram of the position loop circuit according to the above embodiments of this application is shown;
[0039] Figure 18 A circuit diagram of a current sampling circuit according to the above embodiments of this application is shown;
[0040] Figure 19 A circuit diagram of a current loop circuit according to the above embodiments of this application is shown;
[0041] Figure 20 A circuit diagram of the integral control circuit according to the above embodiments of this application is shown;
[0042] Figure 21 A circuit diagram of a power amplifier control circuit according to the above embodiments of this application is shown;
[0043] Figure 22 A circuit diagram of the position processing module according to the above embodiments of this application is shown;
[0044] Figure 23 A circuit diagram of a speed compensation module according to the above embodiments of this application is shown;
[0045] Figure 24 A module block diagram of a position sampling circuit provided in one embodiment of this application;
[0046] Figure 25 A block diagram of an enable circuit provided for one embodiment of this application;
[0047] Figure 26 A schematic diagram of the process of using a speed ladder algorithm to control the galvanometer motor, provided as an embodiment of this application;
[0048] Figure 27 A flowchart illustrating a speed ladder algorithm provided in one embodiment of this application;
[0049] Figure 28 A flowchart illustrating the state of the galvanometer motor controlled by a control program, as provided in one embodiment of this application;
[0050] Figure 29 A flowchart illustrating a waiting state control procedure provided for one embodiment of this application;
[0051] Figure 30 A flowchart illustrating a test state control procedure provided for one embodiment of this application;
[0052] Figure 31 This is a schematic diagram of a width scan process provided for one embodiment of this application.
[0053] Reference numerals: 1. Galvanometer motor control circuit; 10. Control module; 20. Position correction module; 21. Position sampling circuit; 211. Photoelectric feedback component; 2111. Light source control circuit; 212. Voltage sampling circuit; 22. Position loop circuit; 30. Speed compensation module; 40. Current correction module; 41. Current sampling circuit; 42. Current loop circuit; 50. Drive module; 60. Buffer circuit; 70. Enable circuit; 71. Integral control circuit; 72. Power amplifier control circuit; 80. Position processing module. Detailed Implementation
[0054] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application are described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.
[0055] Existing control schemes for galvanometer motors cannot balance control accuracy and cost. To address this issue, this application provides a galvanometer motor control method that can balance control accuracy and cost.
[0056] For details, please refer to the appendix. Figure 1One embodiment of this application provides a galvanometer motor control method, the method being applied to a galvanometer motor, the galvanometer motor control method comprising:
[0057] Step 101: Obtain the target position signal of the galvanometer motor, the actual position signal of the galvanometer motor, and the real-time current signal of the galvanometer motor.
[0058] Step 102: Determine the reference current signal based on the target position signal and the actual position signal.
[0059] Step 103: Drive the galvanometer motor according to the reference current signal and the real-time current signal.
[0060] It should be noted that, in actual conditions, the galvanometer motor deflects within a certain angular range (typically ±10°) via its internal shaft. Therefore, the position of the galvanometer motor refers to the position where its shaft deflects at this angle. The target position signal represents the target position that the galvanometer motor's shaft is to move to, the actual position signal represents the current position of the galvanometer motor's shaft, and the real-time current signal is obtained by sampling the current current of the galvanometer motor through a current sampling module, representing the current magnitude of the galvanometer motor's current.
[0061] like Figure 13 As shown, this application also provides a galvanometer motor control circuit 1, which is used to drive a galvanometer motor. The galvanometer motor control circuit 1 includes: a control module 10, a position correction module 20, a speed compensation module 30, a current correction module 40, and a drive module 50. The position correction module 20 includes: a position sampling circuit 21 and a position loop circuit 22. The current correction module 40 includes: a current sampling circuit 41 and a current loop circuit 42.
[0062] The galvanometer motor control method described in this application obtains a reference current signal by processing the target position signal and the actual position signal. Then, the reference current signal and the real-time current signal of the galvanometer motor are processed to drive the galvanometer motor. Compared with the scheme of directly driving the galvanometer motor based on the target position signal, this scheme has higher driving accuracy for the galvanometer motor. Moreover, the steps of this scheme can be implemented with simple circuits. Compared with the scheme of controlling the galvanometer motor with a high-specification main control chip, this scheme has lower cost. In summary, this scheme has the advantages of both control accuracy and cost.
[0063] In other embodiments of this application, such as Figure 2 As shown, determining the reference current signal based on the target position signal and the actual position signal includes:
[0064] Step 201: Obtain the position difference signal of the galvanometer motor based on the target position signal and the actual position signal.
[0065] Step 202: Obtain the velocity compensation signal based on the actual position signal.
[0066] Step 203: Obtain the reference current signal based on the position difference signal, velocity compensation signal, and target position signal.
[0067] It should be noted that the position difference signal is obtained by subtracting the target position signal and the actual position signal, and the position difference signal represents the difference between the target position and the actual position of the galvanometer motor. A velocity signal is obtained by differentiating multiple actual position signals over a period of time. This velocity signal is obtained by processing the actual position signals through circuitry to represent the rate of position change, and then amplifying the velocity signal according to a preset rule to obtain a velocity compensation signal for circuit compensation. The reference current signal is obtained by superimposing the position difference signal, the velocity compensation signal, and the target position signal.
[0068] In this embodiment, the speed compensation signal is mainly used to compensate the loop part of the galvanometer motor circuit. When the position of the galvanometer motor changes abruptly, the speed compensation signal can be used for advance compensation, thereby reducing the occurrence of overshoot and speeding up the system response.
[0069] In one embodiment, such as Figure 3 As shown, driving the galvanometer motor according to the reference current signal and the real-time current signal includes:
[0070] Step 301: Obtain the error current signal based on the reference current signal and the real-time current signal.
[0071] Step 302: Obtain the motor drive signal based on the error current signal.
[0072] Step 303: Drive the galvanometer motor according to the motor drive signal.
[0073] It is worth noting that the error current signal is obtained by subtracting the reference current signal from the actual current signal. This error current signal characterizes the difference between the target current and the actual current of the galvanometer motor. The error current signal is then integrated according to a preset rule to obtain the motor drive signal, which is used to drive the galvanometer motor.
[0074] In other embodiments of this application, the galvanometer motor control method further includes:
[0075] Step 1: Based on the preset power-on rules, manage the power-on timing of the galvanometer motor.
[0076] Step 2: Obtain the initial parameters of the galvanometer motor, including the boundary position and center position of the galvanometer motor.
[0077] Step 3: Reset the galvanometer motor according to the initial parameters.
[0078] It should be noted that the boundary position refers to the extreme position to which the galvanometer motor can deflect, and the center position between the two extreme positions is the default initial position of the galvanometer motor. The reset process involves moving the position of the galvanometer motor to the center position.
[0079] This embodiment manages the power-on timing of the galvanometer motor, preventing hardware damage or logic errors caused by mismatched power supply voltage rise rates or incorrect power supply sequence, ensuring that each component starts operating under optimal conditions. Resetting the galvanometer motor clears its state or restores it to a known initial state, helping to eliminate potential problems from previous operation and ensuring consistent normal operation and response. This not only improves the stability and reliability of the galvanometer motor but also enhances its compatibility and maintainability, laying a solid foundation for subsequent functional expansion and troubleshooting.
[0080] In another embodiment of this application, such as Figure 4 As shown, the overall process of controlling the galvanometer motor is as follows: After starting, the galvanometer motor is powered on; initialization operations are performed, including: setting the timer, setting the SPI (three-wire, only sending and not receiving), setting the ADC, initializing the control I / O port, and initializing global variables; detecting the stability of the external +15V power supply; starting the timer and initializing the galvanometer motor, specifically: turning on the enable power amplifier switch, turning on the integration circuit after the integral saturation delay is reached, managing the power-on timing of the galvanometer motor, adjusting the position of the galvanometer motor to the middle position, and controlling the motor status. Simultaneously, it detects whether the timer has reached the motor sampling cycle, the motor status detection cycle (10ms), and the interrupt cycle. If the motor sampling cycle is reached, the actual position of the galvanometer motor is sampled (including motor position feedback and detection of the stability of the external +15V power supply). If the motor sampling cycle is not reached, the detection is repeated. If the motor status detection cycle is reached, motor status control is performed. If the motor status detection cycle is not reached, the detection is repeated. If the interrupt cycle is reached, an interrupt is performed, and the motor speed control program is started. If the interrupt cycle is not reached, the detection is repeated.
[0081] In other embodiments of this application, power-on timing management of the galvanometer motor based on preset power-on rules includes:
[0082] Step 1: Power on the control module that controls the galvanometer motor.
[0083] Step 2: Power on the galvanometer motor.
[0084] Step 3: Power on the drive module of the galvanometer motor and start the timer.
[0085] Step 4: After the first preset time is reached, the position loop module and current loop module of the control galvanometer motor are powered on.
[0086] The power-on timing management of the galvanometer motor is as follows: First, the control module 10 is connected to a 24V power supply to power it on. Then, the control module 10 turns on the power supply to the galvanometer motor circuit. Next, the drive module 50 is powered on and a delay time is set. Finally, after a preset power-on time, when the power amplifier starts to output normally, the control module 10 controls the integration circuit to be powered on, thereby achieving non-integral saturation start-up and completing the power-on of the entire galvanometer motor. This avoids hardware damage or logic errors caused by mismatch in power supply voltage rise speed or incorrect power supply sequence, and ensures that each component can start working under optimal conditions.
[0087] It should be noted that two solutions are provided in this embodiment. One is a hardware and software combined solution, specifically: powering on the control module 10 and initializing the control module 10; powering on the position correction module 20, current correction module 40, and drive module 50; turning on the drive module 50 and controlling the timer to start timing; turning on the position correction module 20 and current correction module 40 after the first preset time is reached; acquiring the actual position signal of the galvanometer motor; and controlling the galvanometer motor to reach the target position based on the actual position signal and the target position signal through the position correction module 20, current correction module 40, and drive module 50.
[0088] Another solution is a purely software implementation, specifically: powering on the control module 10 and initializing it; powering on the position correction module 20, current correction module 40, and drive module 50; turning on the drive module 50, position correction module 20, and current correction module 40; controlling the position correction module 20 and current correction module 40 to output 0 or close to 0 within a first preset time; acquiring the actual position signal of the galvanometer motor; and, based on the actual position signal and the target position signal, controlling the galvanometer motor to reach the target position through the position correction module 20, current correction module 40, and drive module 50.
[0089] In other embodiments of this application, for a hardware-software combined solution, after reaching a first preset time, controlling the position loop circuit and current loop circuit of the galvanometer motor to power on includes:
[0090] Step 1: Before the first preset time is reached, shut down the integral circuits in the position loop circuit and the current loop circuit, and control the outputs of the position loop circuit and the current loop circuit to be zero.
[0091] The first preset time is the startup time of the driver module 50, and the first preset time depends on the hardware characteristics of the driver module 50.
[0092] Step 2: After the first preset time is reached, the integral circuit is turned on to control the position loop circuit and the current loop circuit to output normally.
[0093] It should be noted that by enabling the integral circuits in the position loop circuit and current loop circuit, the control efficiency and safety of the galvanometer motor control system can be significantly improved. By controlling the operating state of the drive module 50, it can be made to work normally or stop working as needed, thereby avoiding accidental start-stop due to false triggering signals, thus reducing energy consumption and mechanical wear.
[0094] In other embodiments of this application, for a purely software-implemented scheme, powering on the position loop circuit and current loop circuit of the galvanometer motor after a first preset time includes:
[0095] Step 1: Before the first preset time is reached, control the position loop circuit and the current loop circuit so that their outputs are within the first preset range.
[0096] The first preset range is the preset output range of the position loop circuit 22 and the current loop circuit 42. If the outputs of the position loop circuit 22 and the current loop circuit 42 are within the first preset range, the edge-trimming problem caused by oversaturation as described in the background art will not occur.
[0097] Step 2: After the first preset time is reached, the position loop circuit and current loop circuit of the control galvanometer motor are powered on.
[0098] In other embodiments of this application, controlling the position loop circuit and the current loop circuit to have their outputs within a first preset range before reaching a first preset time, and controlling the position loop circuit and the current loop circuit of the galvanometer motor to power on after reaching the first preset time includes:
[0099] Step 1: Determine the first integral voltage based on the actual position signal.
[0100] The first integral voltage is the voltage applied to the integral circuits in the position loop circuit 22 and the current loop circuit 42 to enable the integral circuits to perform positive or negative integration. The first integral voltage is determined based on the actual position signal, specifically by: determining the saturation type of the integral circuit in the position setting module based on the actual position signal of the galvanometer motor; and determining the first integral voltage based on the saturation type and a preset integral value. The saturation type in the integral circuit refers to the type of saturation output the integral circuit enters. The sign of the actual position signal is related to the saturation type in the integral circuit. In this embodiment, if the actual position signal is positive, the saturation type of the integral circuit is negative saturation; if the actual position signal is negative, the saturation type of the integral circuit is positive saturation. The preset integral value is the magnitude of a pre-set integral voltage, i.e., the preset integral value is equal to the absolute value of the first integral voltage or the second integral voltage. The sign of the first integral voltage can be determined based on the saturation type, and then the first integral voltage is finally determined based on the magnitude of the preset integral value. In this embodiment, if the saturation type is positive, the first integral voltage is negative; if the saturation type is negative, the first integral voltage is positive. For example, if the preset integral value is 12V, when the saturation type is positive, the first integral voltage is determined to be negative, and then based on the preset integral value of 12V, the first integral voltage is finally determined to be -12V.
[0101] Step 2: Based on the first integral voltage and the first preset time, determine the second preset time and the second integral voltage.
[0102] The second preset time is the time during which the first integrating voltage acts on the integrating circuit, and the second preset time is less than the first preset time. The second integrating voltage is the opposite value of the first integrating voltage. Based on the first integrating voltage and the first preset time, the second preset time and the second integrating voltage are determined as follows: the integrating rate of the integrating circuit is determined according to the first integrating voltage and the hardware characteristics of the integrating circuit; the second preset time is determined according to the saturation type, the integrating rate, and the first preset time. The integrating rate of the integrating circuit is the change in the output of the integrating circuit per unit time.
[0103] It should be noted that the integration rate is a positive or negative value, such as -5 or +4. The integration rate is related to the first integrating voltage and the hardware characteristics of the integrating circuit. The sign of the integration rate is the same as that of the first integrating voltage; when the first integrating voltage is positive, the integration rate is also positive, and when the first integrating voltage is negative, the integration rate is also negative. The absolute value of the integration rate is related to the hardware characteristics of the integrating circuit. After determining the sign of the integration rate, it can be determined based on the hardware characteristics of the integrating circuit.
[0104] Specifically, determining the second preset time based on the saturation type, the integration rate, and the first preset time involves: determining the saturation voltage based on the preset saturation voltage value and the saturation type; and solving for the second preset time using the saturation voltage, the integration rate, the first preset range, and the first preset time as constraints.
[0105] The preset saturation voltage value is the magnitude of the preset saturation voltage, which is related to the hardware characteristics of the actual circuit. The saturation voltage is related to the saturation type. In this embodiment, when the saturation type is positive, the saturation voltage is positive; when the saturation type is negative, the saturation voltage is negative. After determining whether the saturation voltage is positive or negative, the preset saturation voltage value can be used to determine the saturation voltage.
[0106] For example, determining the second preset time specifically involves: using the saturation voltage as the initial output of the integrator circuit, solving for the time that satisfies the second preset time, and then changing the output of the integrator circuit according to the integration rate. When the time of the timer is greater than the second preset time and less than or equal to the first preset time, the output of the integrator circuit is changed according to the opposite value of the integration rate, and then the output of the integrator circuit is within the second preset time within the first preset range.
[0107] Step 3: After the timer starts counting, control the output of the position loop circuit and the current loop circuit according to the first integral voltage.
[0108] Step 4: After the timer reaches the second preset time, control the output of the position loop circuit and the current loop circuit according to the second integral voltage, and control the position loop circuit and the current loop circuit to keep their output within the first preset range before reaching the first preset time.
[0109] Step 5: After the first preset time is reached, the control position loop circuit and current loop circuit begin to output normally.
[0110] If the integrator circuit is not controlled separately, but instead controlled together with the drive module 50, the problem addressed in this embodiment is that the integral output saturation caused by the power amplifier startup time leads to the galvanometer motor swinging to the limit, triggering overcurrent and short-circuit protection, resulting in continuous start-stop and back-and-forth motor swinging. This can be resolved by software control to eliminate the integral saturation. Since the circuit simulates the position loop and current loop through the position loop circuit 22 and current loop circuit 42, only the integrator circuit of the position loop (position loop circuit 22) needs to be controlled. The core control idea is to change the DAC output voltage (i.e., the target position signal) during the time from power amplifier startup to output, causing the integrator circuit to perform positive or negative integration, making the integral output 0 before output, thus achieving desaturation. At this time, since the power amplifier has not yet outputted, the motor current itself is close to 0, so the integral effect of the current loop itself is very weak and negligible. Therefore, there will be no sudden current when the power amplifier starts outputting, thus avoiding the problem of motor swinging.
[0111] It should be noted that during the time from the start of the drive module 50 to its output, by changing the signals applied to the position correction module 20 and the current correction module 40 by the control module 10, the integration circuits in the position correction module 20 and the current correction module 40 can perform positive or negative integration, so that the integral output is 0 before the drive module 50 outputs, thereby achieving the effect of desaturation.
[0112] In other embodiments of this application, the galvanometer motor control method further includes:
[0113] A width scan is performed on the galvanometer motor to update its initial parameters.
[0114] Width scanning can determine the boundary and center positions of the galvanometer motor, thereby updating the boundary and center positions of the motor control program. By updating the boundary and center positions, different galvanometer motors can be better controlled, thus avoiding the impact on the control accuracy of the galvanometer motor due to subtle differences between different galvanometer motors. Furthermore, the galvanometer motor control method can be applied to different types of galvanometer motors, improving the compatibility of the galvanometer motor control method.
[0115] In other embodiments of this application, such as Figure 31 As shown, the step of performing a width scan on the galvanometer motor and updating the initial parameters of the galvanometer motor includes:
[0116] Step 3101: Control the galvanometer motor to deflect in the forward direction and obtain the feedback voltage signal of the galvanometer motor.
[0117] Step 3102: When the feedback voltage signal meets the preset conditions, determine the first boundary position of the galvanometer motor.
[0118] Step 3103: Control the galvanometer motor to deflect in the reverse direction and obtain the feedback voltage signal of the galvanometer motor.
[0119] Step 3104: When the feedback voltage signal meets the preset conditions, determine the second boundary position of the galvanometer motor.
[0120] Step 3105: Update the initial parameters of the galvanometer motor according to the first boundary position and the second boundary position.
[0121] It should be noted that the preset condition is that the first boundary position or the second boundary position is determined when the value of the feedback voltage signal no longer changes. Specifically, updating the initial parameters of the galvanometer motor based on the first boundary position and the second boundary position involves taking the median value of the first boundary position and the second boundary position as the center position of the motor, and using the first boundary position and the second boundary position as the boundary positions of the galvanometer motor.
[0122] It is worth noting that, such as Figure 5 As shown, a width scan is performed on the galvanometer motor to update its initial parameters. Specifically, the first and second boundary positions are repeatedly determined, and the average of multiple obtained first and second boundary positions is taken to obtain a more accurate result. Specifically: the swivel scan program is started; the motor is controlled to deflect forward, and the motor feedback voltage is collected until the motor feedback voltage no longer changes with the increase of the DAC output, at which point the forward limit VMAX of the motor is determined. The motor is controlled to deflect backward, and the motor feedback voltage is collected until the motor feedback voltage no longer changes with the decrease of the DAC output, at which point the reverse limit VMIN of the motor is determined. 90% of the interval corresponding to VMIN-VMAX is taken as the boundary limit value, and (VMAX-VMIN) / 2 is taken as the motor center value. It is checked whether the above steps are repeated three times. If so, the average value is taken to obtain the final value; if not, the above steps are repeated.
[0123] In other embodiments of this application, the galvanometer motor control method further includes:
[0124] Step 1: Check if there is an offset in the initial parameters.
[0125] Step 2: If an offset exists, obtain the offset parameter.
[0126] Step 3: Adjust the initial parameters of the galvanometer motor according to the offset parameters.
[0127] It should be noted that during actual use, the galvanometer motor may experience a certain center position offset. In this case, the center position of the galvanometer motor needs to be corrected through the steps provided in this embodiment. The offset parameter is a parameter preset in the control module 10 or a parameter input by the user to the control module 10. When offset correction is required, the control module 10 will send the offset parameter to perform offset correction. The offset parameter includes: offset amount and maximum angular offset percentage. The step of adjusting the initial parameters of the galvanometer motor according to the offset parameter specifically involves adjusting the center position and boundary position of the galvanometer motor according to the offset amount and the maximum angular offset percentage.
[0128] It is worth noting that since the mechanical position of the same welding torch can deviate to a certain degree during repeated use, detecting this deviation can significantly improve the operating accuracy and stability of the galvanometer motor, ensuring that it operates according to the expected trajectory or speed. Furthermore, monitoring and adjusting this deviation can prevent potential malfunctions and enhance the reliability and safety of the entire welding system.
[0129] In another embodiment of this application, such as Figure 6 As shown, the center value calibration program is initiated to check if the center value (center position) needs to be changed. If so, the DAC output voltage corresponding to the center value will be changed according to the issued offset, and the swing angle limit will be recalculated based on the offset value and the limit will be automatically adjusted. If not, the process ends. And / or, the motor angle fine-tuning control function is initiated to check if the maximum angle offset percentage is increased. If so, it is increased by %1 (maximum increase of 10%). If not, it checks if the maximum angle offset percentage is decreased. If so, it is decreased by %1 (maximum decrease of 10%). If not, the process ends.
[0130] It should be noted that the start-up motor angle fine-tuning control function is used to fine-tune the swing width of the galvanometer motor. In this embodiment, the start-up motor angle fine-tuning control function can be selected according to the environment in which the galvanometer motor is located. For example, the motor angle fine-tuning control function can be started after the center value calibration program runs; or after adjusting the initial parameters of the galvanometer motor according to the offset parameters mentioned above; or the motor angle fine-tuning control function can be started independently. In another embodiment of this application, after the center value calibration program runs, the swing width of the galvanometer motor can be adjusted according to the actual offset of the galvanometer motor.
[0131] It should be noted that, due to the mechanical position, the center value of the same welding torch may shift slightly during use, so... Figure 6The diagram shows a center value calibration program. The center value offset can be adjusted according to actual conditions. When the center value deviates, the normal operating range limit will be dynamically adjusted based on the offset value. For example, if the original swing width was ±3mm and the center value was 0, if the center value offset is set to 1, the swing width range will become -1 to +3mm, meaning the total swing width will decrease by 2mm to prevent the laser from hitting the welding torch and burning it during welding. Figure 6 The swing width fine-tuning shown on the right allows for fine-tuning of the scanning width within the working range to suit welding requirements.
[0132] In other embodiments of this application, driving the galvanometer motor according to the motor drive signal includes:
[0133] Step 1: Drive the galvanometer motor according to the motor drive signal, and set the timer with the third preset time.
[0134] Step 2: Control the galvanometer motor to move at a constant speed based on a timer for a third preset time.
[0135] It should be noted that, in this embodiment, driving the galvanometer motor according to the motor drive signal further includes: pre-setting an interrupt program. Controlling the galvanometer motor to move at a constant speed based on the timer for a third preset time specifically involves: executing the interrupt program based on the timer to control the galvanometer motor to move at a constant speed. That is, detecting whether the timer has reached the third preset time; if so, controlling the galvanometer motor to move at a constant speed.
[0136] It should be noted that the movement of the galvanometer motor tends to be uniform. The interrupt program is an interrupt program that controls the speed of the galvanometer motor. The third preset time is the interrupt cycle of the interrupt program.
[0137] In other embodiments of this application, controlling the galvanometer motor to move at a constant speed based on a timer for a third preset time includes:
[0138] Step 1: Obtain the oscillation period and position step value.
[0139] Step 2: If the timer reaches the third preset time, obtain the running time and determine the corresponding position step value based on the running time.
[0140] Step 3: Based on the position step value, the third preset time, and the oscillation period, control the galvanometer motor to move at a constant speed.
[0141] The oscillation period is the operating period of the galvanometer motor, and the position step value is a preset target position change value. That is, every third preset time interval, the galvanometer motor moves by the same position step value.
[0142] In other embodiments of this application, controlling the galvanometer motor to move at a constant speed based on the position step value, the third preset time, and the oscillation period includes:
[0143] Step 1: Adjust the speed of the galvanometer motor according to the position step value and the third preset time to make the galvanometer motor move at a constant speed.
[0144] Step 2: Obtain the oscillation period of the galvanometer motor and determine the difference between half of the oscillation period and the running time.
[0145] Step 3: If the duration difference is less than the third preset time, adjust the timer based on the duration difference, and reverse the speed of the galvanometer motor after the timer reaches the duration difference, and set the timer based on the third preset time.
[0146] It is worth noting that the running time is the total duration of rotation of the galvanometer motor shaft, and the position step value is a preset target position change value. That is, every third preset time, the galvanometer motor moves by the same position step value. Since speed is defined as the distance moved per unit time, controlling the galvanometer motor to move by the same position step value within the third preset time can make the galvanometer motor tend to move at a uniform speed. It should be noted that if the duration difference is less than the third preset time, the timer is adjusted based on the duration difference, and the speed of the galvanometer motor is reversed after the timer reaches the duration difference. The timer is set based on the third preset time. Adjusting the timer based on the duration difference is to adjust the galvanometer motor when the shaft rotates to a boundary position and speed reversal is required, in order to better control the galvanometer motor to move at a uniform speed.
[0147] In another embodiment of this application, such as Figure 26 As shown, the galvanometer motor control method, during the process of controlling the galvanometer motor, calls a speed ladder algorithm to control the galvanometer motor, including:
[0148] Step 2601: Execute the motor speed control program.
[0149] Step 2602: Check if it is in a waiting state. If so, initialize the galvanometer motor.
[0150] Step 2603: Check if it is in test state. If so, control the galvanometer motor according to the mode of the galvanometer motor.
[0151] Step 2604: Check if it is in the start-up or running state. If so, control the galvanometer motor to move at a constant speed.
[0152] Specifically: such as Figure 11As shown, step 2601 specifically involves executing the motor speed control program;
[0153] Step 2602 specifically involves: determining if the system is in a waiting state. If it is, checking if initialization is required. If initialization is not required, determining if the system is in test mode. If the system is not in a waiting state, determining if it is in test mode. If initialization is required, initializing the motor position to the center value, calling the speed ladder algorithm, and ending the process.
[0154] Step 2603 is as follows: If it is a test mode, then sequentially check whether it is test mode one, test mode two, and test mode four. If it is test mode one, rotate to the specified angle; if it is not test mode one, check whether it is test mode two. If it is test mode two, output a periodic square wave; if it is not test mode two, check whether it is test mode four. If it is test mode four, control the motor deflection according to the center value; if it is not test mode four, end the process.
[0155] Step 2604 is as follows: If the system is not in test mode, check if it is in start-up or running state. If it is in start-up or running state, check if the motor is rotating forward and end the process. If it is, call the speed step algorithm to rotate forward. If it is not rotating forward, call the speed step algorithm to rotate backward and end the process. If the system is not in start-up or running state, check if it is in stop state and end the process.
[0156] like Figure 27 As shown, the speed ladder algorithm includes:
[0157] Step 2701: Detect the rotation direction of the galvanometer motor.
[0158] Step 2702: If the rotation direction is forward, perform a difference calculation on the speed of the galvanometer motor to control the galvanometer motor to move at a constant speed in the forward direction.
[0159] Step 2703: If the rotation direction is reversed, perform a difference calculation on the speed of the galvanometer motor and control the galvanometer motor to move in the opposite direction at a constant speed.
[0160] Step 2704: If the galvanometer motor does not rotate, initialize the galvanometer motor.
[0161] like Figure 12As shown, specifically: the speed step algorithm detects the rotation direction (forward or reverse) of the galvanometer motor, and controls the speed of the galvanometer motor by difference calculation based on the relationship between the actual position of the galvanometer motor and the extreme value of the angle (i.e., the boundary position or the maximum and minimum angle values) and the third preset time and position step value. Specifically: The speed step algorithm is activated, checking if the rotation is forward. If it is forward, it checks if the angle is less than the maximum angle. If so, interpolation is performed to increase the angle at a constant speed. The algorithm then checks if the angle is greater than or equal to the maximum angle. If so, the reverse flag is set to one (changing to reverse rotation), and the process ends. If the angle is not greater than or equal to the maximum angle, the process ends. If the rotation is not forward, it checks if it is reverse. If so, it checks if the angle is greater than the minimum angle. If so, interpolation is performed to decrease the angle at a constant speed. The algorithm then checks if the angle is less than or equal to the maximum angle. If so, the forward flag is set to one (changing to forward rotation), and the process ends. If the angle is not less than or equal to the maximum angle, the process ends. If the rotation is not reverse, it checks if initialization is required. If so, the speed is uniformly restored to the motor center value, and the process ends. If no initialization is required, the process ends.
[0162] For example, the interrupt routine mainly executes the speed control algorithm based on the current state of the motor control state machine, performs the actual DAC input (target position signal) given calculation, and controls the required control quantity of its output through SPI communication with the DAC. For the motor's scanning behavior control, an interpolation method is used. For instance, if the motor swing width is set to 4mm, it controls the motor to swing back and forth ±2mm past the center position. Based on the welding process requirements, to ensure uniform laser power on the weld seam, the motor must move at a constant speed. Therefore, based on the swing period, such as 100Hz (10ms per swing), interpolation is performed every 100µs. This controls the DAC output to increase or decrease by the same step value every 100µs, and detects... If the current interpolation value exceeds the target value when the next step value is increased or decreased, and the time is fixed at 100us, it is impossible for the motor position to reach the target value exactly when changing direction. Usually, it will exceed the target value. Therefore, in order to solve this problem, special processing is done when changing direction. When changing direction, the time required to reach the target position based on the current position is calculated in the 100us update cycle before reaching or exceeding the target value. Then the timer is changed. After the change of direction is completed, the timer period is changed back to 100us. This ensures that the motor moves at a constant speed throughout the process. The actual output waveform is a triangular wave with a period of 10ms and an amplitude corresponding to the voltage value of the given swing width.
[0163] In another embodiment of this application, such as Figure 7 , Figure 28As shown, the state of the galvanometer motor controlled by the galvanometer motor control method in a control program includes:
[0164] Step 2801: Check the status of the galvanometer motor.
[0165] Step 2802: Determine and run the corresponding control program based on the status of the galvanometer motor.
[0166] The states of the galvanometer motor include: waiting state, motor test state, motor start state, motor running state, motor stop state, and motor error state.
[0167] The state of the galvanometer motor controlled by the aforementioned galvanometer motor control method in the form of a control program specifically includes: performing motor state control; performing motor state switching; if the galvanometer motor is in a waiting state, then running a waiting state control program; if the galvanometer motor is in a motor test state, then running a test state control program; if the galvanometer motor is in a motor start state, then running a start state control program; if the galvanometer motor is in a motor running state, then running a running state control program; if the galvanometer motor is in a motor stop state, then running a stop state control program; if the galvanometer motor is in a motor error state, then running an error state control program; and then breaking and ending.
[0168] like Figure 8 , Figure 29 As shown, the waiting state is the preparation stage for the galvanometer motor to start width scanning. The above-mentioned steps of power-on timing management and resetting of the galvanometer motor are all performed in this state.
[0169] The waiting state control procedure includes: Step 2901, initializing the galvanometer motor.
[0170] Step 2902: Calibrate the galvanometer motor.
[0171] Step 2903: Start the galvanometer motor.
[0172] Step 2904: Check whether the galvanometer motor is operating normally.
[0173] The waiting state control program specifically includes: starting the waiting state control program; detecting welding torch replacement and updating the motor's given parameters; checking if the power amplifier enable status is intact; if not, checking for errors; if the power amplifier enable status is intact, checking if it is the first power-on; if not, checking if the motor initialization is complete; if not, checking for errors; if it is the first power-on, initializing the motor, rotating it to the center angle, and checking if the motor initialization is complete; if not, checking for errors; if the motor initialization is complete, sequentially executing the swing width scanning program and the center value calibration program, and checking if the motor is in normal operating mode; if so, checking if the motor is started; if so, executing the motor angle fine-tuning control function, calculating the maximum and minimum values and steps corresponding to the step algorithm based on the given swing angle and frequency, and entering the start state; if the motor is not in normal operating mode, entering the test mode to check for errors; if no errors are found, ending the test; if errors are found, entering the error state. In the test state, the performance of the galvanometer motor will be tested.
[0174] It should be noted that, as Figure 9 , Figure 30 As shown, in the test state, the galvanometer motor has four modes: Mode 1, Mode 2, Mode 3, and Mode 4. In Mode 1, the galvanometer motor outputs a preset fixed value; in Mode 2, it outputs a square wave of a preset frequency. Modes 1 and 2 work together to detect the loop characteristics of the galvanometer motor; in Mode 3, the galvanometer motor stops working to detect its relevant characteristics; and in Mode 4, it corrects its center position.
[0175] The test status control program includes: Step 3001, determining the test mode based on the status of the galvanometer motor.
[0176] Step 3002: Test the galvanometer motor according to the test mode.
[0177] The test state control procedure is as follows: Start the test state control procedure; determine if the current mode is Mode 1 or Mode 2 (step). If yes, determine if the previous mode was Mode 3; if yes, enable the power amplifier output (PA) and check if the motor has started. If the previous mode was not Mode 3, check if the motor has started. If the motor has started, update the test jump angle; if it has not started, reset the motor to the center value and end. If the current mode is not Mode 1 or Mode 2 (step), determine if the current mode is Mode 3; if yes, stop the power amplifier output and end. If the current mode is not Mode 3, determine if the current mode is Mode 4; if yes, start the center value calibration procedure and end. If the current mode is not Mode 4, check if the power amplifier is off; if off, turn on the power amplifier and switch to the stop state, and end.
[0178] It should be noted that Mode 1 outputs a square wave with an adjustable frequency to the galvanometer motor; Mode 2 is the position mode, which outputs a specified target position to the galvanometer motor; Modes 1 and 2 are used to test the galvanometer motor's ability to handle step signals; Mode 3 is the free mode, which stops all input to the galvanometer motor; and Mode 4 is the calibration mode, which calibrates the center value of the galvanometer motor.
[0179] like Figure 10 As shown, the startup state is the transition phase from the preparation state to the running state of the galvanometer motor. Specifically, it involves: starting the control program; waiting for startup, switching the state to the running state, and then ending.
[0180] like Figure 10 As shown, the operating state is the normal operating state of the galvanometer motor. Specifically, the operating state control program sequentially checks whether the given parameters need to be changed, whether to stop, and whether there is an error. If the given parameters need to be changed, the given parameters (angle, frequency, angle correction percentage) are updated. If not, it checks whether to stop. If stopping is required, it enters the stop state. If stopping is not required, it checks whether there is an error. If an error exists, it enters the error state. If not, it terminates.
[0181] like Figure 10 As shown, the stopped state is the state after the galvanometer motor has finished running. In this state, the galvanometer motor will return to the center position and then return to the waiting state. Specifically, the stopped state control program sequentially checks whether the stop is complete and whether there is an error; if the stop is complete, it enters the waiting state; if the stop is not complete, it checks whether there is an error.
[0182] If an error exists, the system enters an error state; otherwise, the process ends.
[0183] like Figure 10 As shown, the error state is the state entered after an error occurs in the galvanometer motor. In this state, the galvanometer motor will stop working, and the drive module 50, position loop module, and current loop module of the galvanometer motor will be shut down. After the error is corrected, it will return to the waiting state. Specifically, the error state control program is started; the power amplifier and integrator circuit are turned off, the output is stopped, and it is checked whether the error is resolved. If resolved, it enters the waiting state, sets the welding machine initialization, turns on the power amplifier, and ends; if not resolved, it ends.
[0184] It is worth noting that this application addresses the problem in existing technologies where there is no module that feeds back to the MCU, and the MCU only issues commands without intervention during the control process, resulting in poor real-time control. This is achieved by monitoring the motor position in real time during operation to ensure the motor does not exceed its limits and by intervening in control when abnormal conditions occur, shutting down the drive output, or fine-tuning the control signal. Furthermore, by controlling the power-on timing with the MCU, this application solves the problem in existing technologies where the integrator circuit is uncontrollable or the timing between the integrator circuit and the power amplifier drive is not managed, leading to saturation before the power amplifier outputs. This application also addresses the problem in existing technologies where the LED power supply for the motor's photoelectric feedback is poorly designed, resulting in poor motor compatibility and the need for self-adjustment, by adding a width scanning step to determine the swing width limit and center value of the new motor. This updates the boundary limits and center value of the motor control program, thus solving the problem of uncertainty in the motor's operating limits due to variations in motor characteristics, which are not dynamically adjusted or measured, affecting its usability. Based on the speed step algorithm, the timer is adjusted according to the time point when the motor needs to change direction. This solves the problem in the existing technology where poor software interpolation and handling during direction change result in a slow curve and non-uniform speed transition during motor direction change, which is also a problem for some welding materials.
[0185] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0186] It is worth noting that, such as Figure 13 In the galvanometer motor control circuit 1 shown, the galvanometer motor control circuit 1 is used to drive the galvanometer motor. The galvanometer motor control circuit 1 includes: a control module 10, a position correction module 20, a speed compensation module 30, a current correction module 40, and a drive module 50.
[0187] The control module 10 is connected to the position correction module 20 and the current correction module 40 respectively; it is used to acquire the target position signal of the galvanometer motor and transmit the target position signal to the position correction module 20 and the current correction module 40.
[0188] The position correction module 20 is connected to the galvanometer motor, the speed compensation module 30, and the current correction module 40, respectively, and is used to acquire the actual position signal of the galvanometer motor, obtain the position difference signal of the galvanometer motor based on the target position signal and the actual position signal, transmit the position difference signal to the current correction module 40, and transmit the actual position signal to the speed compensation module 30.
[0189] The speed compensation module 30 is connected to the current correction module 40 and is used to obtain a speed compensation signal based on the actual position signal and transmit the speed compensation signal to the current correction module 40.
[0190] The current correction module 40 is connected to the galvanometer motor and the drive module 50, and is used to acquire the real-time current signal of the galvanometer motor, obtain a reference current signal based on the position difference signal, the speed compensation signal and the target position signal; and obtain a motor drive signal based on the reference current signal and the real-time current signal; and transmit the motor drive signal to the drive module 50.
[0191] The drive module 50 is connected to the galvanometer motor and is used to drive the galvanometer motor according to the motor drive signal.
[0192] It should be noted that, in actual conditions, the galvanometer motor is driven by a rotating shaft inside the galvanometer motor to deflect within a certain angle range (usually around ±10°). Therefore, the position of the galvanometer motor refers to the position where the galvanometer motor deflects at an angle. It should be noted that the target position signal represents the target position that the galvanometer motor is to move to; the actual position signal represents the current position of the galvanometer motor; the real-time current signal is a signal obtained by sampling the current current of the galvanometer motor through a current sampling module, representing the current magnitude of the galvanometer motor; the position difference signal is a signal representing the difference between the target position and the actual position of the galvanometer motor, obtained by subtracting the target position signal and the actual position signal; the speed compensation signal is a signal used to compensate the circuit, obtained by processing the actual position signal through the circuit to obtain the speed signal, which represents the rate of position change, and then amplifying the speed signal according to a preset rule to obtain the speed compensation signal; the error current signal is obtained by subtracting the reference current signal and the real-time current signal, representing the difference between the target current and the actual current of the galvanometer motor; the motor drive signal is obtained by integrating the error current signal according to a preset rule, and the motor drive signal is used to drive the galvanometer motor.
[0193] It is worth noting that the galvanometer motor control circuit 1, through the dual control structure of the position correction module 20 and the current correction module 40, and with the help of the speed compensation module 30 to compensate for the speed based on the actual position of the galvanometer motor, can significantly improve the driving accuracy of the galvanometer motor. Moreover, this solution is implemented through a simple circuit, and compared with the solution that uses a high-specification main control chip to control the galvanometer motor, this solution has a lower cost. In summary, this solution takes into account the advantages of control accuracy and cost.
[0194] In other embodiments of this application, the position correction module 20 includes: a position sampling circuit 21 and a position loop circuit 22; the position sampling circuit 21 is connected to the galvanometer motor, the position loop circuit 22 and the speed compensation module 30, and is used to acquire the actual position signal of the galvanometer motor and transmit the actual position signal to the position loop circuit 22 and the speed compensation module 30; the position loop circuit 22 is connected to the current correction module 40 and the control module 10, and is used to obtain the position difference signal of the galvanometer motor according to the target position signal and the actual position signal; and transmit the position difference signal to the current correction module 40.
[0195] Among them, such as Figure 24 As shown, the position sampling circuit 21 includes: a photoelectric feedback component 211 and a voltage sampling circuit 212; the photoelectric feedback component 211 is disposed on the motor shaft of the galvanometer motor; it is used to generate a first voltage signal and a second voltage signal based on the position of the motor shaft of the galvanometer motor according to the photoelectric feedback principle; the voltage sampling circuit 212 is connected to the photoelectric feedback component 211, the position loop circuit 22 and the speed compensation module 30, and is used to acquire the first voltage signal and the second voltage signal, and calculate the difference between the first voltage signal and the second voltage signal according to the first voltage signal and the second voltage signal, thereby generating an actual position signal, and transmitting the actual position signal to the position loop circuit 22 and the speed compensation module 30.
[0196] In other embodiments of this application, the photoelectric feedback component 211 includes: a first silicon photovoltaic cell group, a second silicon photovoltaic cell group, a light source device, and a light source control circuit 2111; the first silicon photovoltaic cell group is disposed on both sides of the motor shaft in a first direction; the second silicon photovoltaic cell group is disposed on both sides of the motor shaft in a second direction, the first direction being perpendicular to the second direction; the light source device is disposed above the center of the first silicon photovoltaic cell group and the second silicon photovoltaic cell group; the first silicon photovoltaic cell group is used to generate a first voltage signal based on the motor shaft position of the galvanometer motor; the second silicon photovoltaic cell group is used to generate a second voltage signal based on the motor shaft position of the galvanometer motor; the light source control circuit 2111 is connected to the first silicon photovoltaic cell group, the second silicon photovoltaic cell group, and the light source device, and is used to control the brightness of the light source device based on the first voltage signal and the second voltage signal.
[0197] It should be noted that since the galvanometer motor can only deflect within a certain angular range (usually around ±10°), its position feedback works as follows: silicon photovoltaic cells are evenly distributed around the motor shaft, divided into two diagonally distributed groups. The output voltage of the first diagonally distributed group of photovoltaic cells is denoted as the first voltage signal, and the output voltage of the second diagonally distributed group of photovoltaic cells is denoted as the second voltage signal. The baffle is fixed coaxially with the motor shaft, and the light source device is located directly above the center of the silicon photovoltaic cell array. When the motor rotates, causing the baffle to rotate, the light shading of the photovoltaic cells changes, resulting in a synchronous and opposite change in the voltage values of the first and second voltage signals. For example, if the first voltage signal increases by 10 mV, the second voltage signal decreases by 10 mV accordingly. At the same time, the sum of the first and second voltage signals remains constant (with the same DC bias). Therefore, the voltage value linearly related to the motor deflection angle can be obtained by calculating the difference between the first and second voltage signals. Based on this characteristic, a voltage sampling circuit 212 was designed. The circuit filters and differentially processes the first and second voltage signals, and the output signal is the feedback voltage value of the motor position. Subsequent motor position control will use this as the position feedback reference.
[0198] However, the illumination intensity of the light source device may fluctuate due to ambient light or other factors, resulting in a change in the linear proportionality coefficient between the motor position and the feedback voltage, and ultimately causing an error fluctuation in the actual deflection angle. To solve this problem, a light source control circuit 2111 is designed. In this circuit, a reference voltage is set as the sum of the desired first voltage signal and second voltage signal. When the sum of the first voltage signal and the second voltage signal deviates from the reference voltage, the circuit automatically adjusts the supply current of the light source device, thereby stabilizing the sum of the first voltage signal and the second voltage signal. The specific working principle is as follows: When |first voltage signal + second voltage signal| > Vref (the set reference voltage), the output of the operational amplifier decreases, that is, the base voltage of the first switching element is controlled to decrease, thereby controlling the emitter current to decrease; if |first voltage signal + second voltage signal| < Vref, the output of the operational amplifier increases, that is, the base voltage of the first switching element is controlled to increase, thereby controlling the emitter current to increase, and finally controlling |first voltage signal + second voltage signal| = Vref, that is, ensuring that the sum of the feedback voltages remains constant even when the light source device is affected.
[0199] It should be noted that a baffle is provided on the rotating shaft of the galvanometer motor. When the galvanometer motor drives the baffle to rotate, the light shielding conditions of the first silicon photovoltaic cell group and the second silicon photovoltaic cell group change, resulting in synchronous reverse changes in the voltage values of the first voltage signal and the second voltage signal. However, the sum of the voltage values of the first voltage signal and the second voltage signal always remains constant (with the same DC bias). However, the illumination intensity of the light source may fluctuate due to ambient light or other factors, resulting in a change in the linear proportionality coefficient between the position of the galvanometer motor and the first voltage signal and the second voltage signal. Therefore, in this solution, the light source control circuit 2111 is provided, which can control the brightness of the light source device based on the first voltage signal and the second voltage signal, thereby ensuring that the sum of the first voltage signal and the second voltage signal remains constant even when the illumination intensity of the light source is affected, and thus improving the stability of the galvanometer motor control circuit 1 in controlling the galvanometer motor.
[0200] In one embodiment, as Figure 14 shown, the light source control circuit 2111 includes: a first resistor R11, a second resistor R12, a third resistor R67, a fourth resistor R14, a fifth resistor R15, a sixth resistor R16, a first capacitor C5, a second capacitor C6, a first switching element Q1, and a first operational amplifier;
[0201] One end of the first resistor R11 is connected to a first voltage signal, and the other end is connected to the first input terminal of the first operational amplifier; one end of the second resistor R12 is connected to a second voltage signal, and the other end is connected to the first input terminal of the first operational amplifier; one end of the third resistor R67 is connected to a reference voltage, and the other end is connected to the first input terminal of the first operational amplifier; one end of the fourth resistor R14 is grounded, and the other end is connected to the second input terminal of the first operational amplifier; one end of the first capacitor C5 is connected to the second input terminal of the first operational amplifier, and the other end is connected to the output terminal of the first operational amplifier; the output terminal of the first operational amplifier is connected to the first terminal of the first switching element Q1; the second terminal of the first switching element Q1 is connected to an external power supply, and the third terminal of the first switching element Q1 is grounded through the second capacitor C6; one end of the fifth resistor R15 is connected to the output terminal of the first operational amplifier, and the other end of the fifth resistor R15 is connected to the light source device through the sixth resistor R16.
[0202] In another embodiment of this application, such as Figure 15As shown, the voltage sampling circuit 212 includes: a seventh resistor R77, an eighth resistor R2, a ninth resistor R5, a tenth resistor R6, an eleventh resistor R3, a twelfth resistor R7, a thirteenth resistor R4, a fourteenth resistor R8, a fifteenth resistor R9, a sixteenth resistor R10, a third capacitor C1, a fourth capacitor C2, a fifth capacitor C3, a sixth capacitor C4, a second operational amplifier, a third operational amplifier, and a fourth operational amplifier; one end of the seventh resistor R77 is connected to a first voltage signal, and the other end of the seventh resistor R77 is connected to the first input terminal of the second operational amplifier; one end of the eighth resistor R2 is grounded, and the other end of the eighth resistor R2 is connected to the second input terminal of the second operational amplifier. The input terminals are connected as follows: one end of the ninth resistor R5 is connected to the second voltage signal, and the other end of the ninth resistor R5 is connected to the first input terminal of the third operational amplifier; one end of the tenth resistor R6 is grounded, and the other end of the tenth resistor R6 is connected to the second input terminal of the third operational amplifier; one end of the third capacitor C1 is connected to the first input terminal of the second operational amplifier, and the other end of the third capacitor C1 is connected to the output terminal of the second operational amplifier; one end of the eleventh resistor R3 is connected to the first input terminal of the second operational amplifier, and the other end of the eleventh resistor R3 is connected to the output terminal of the second operational amplifier; one end of the fourth capacitor C2 is connected to the third operational amplifier... The first input terminal is connected, and the other end of the fourth capacitor C2 is connected to the output terminal of the third operational amplifier; one end of the twelfth resistor R7 is connected to the first input terminal of the third operational amplifier, and the other end of the twelfth resistor R7 is connected to the output terminal of the third operational amplifier; the output terminal of the second operational amplifier is connected to the first input terminal of the fourth operational amplifier via the thirteenth resistor R4, and the output terminal of the second operational amplifier is connected to the other end of the eleventh resistor R3; the output terminal of the third operational amplifier is connected to the second input terminal of the fourth operational amplifier via the fourteenth resistor R8, and the output terminal of the third operational amplifier is connected to the other end of the twelfth resistor R7. The fifth capacitor C3 is connected to the first input terminal of the fourth operational amplifier, and the other end of the fifth capacitor C3 is connected to the output terminal of the fourth operational amplifier; the fifteenth resistor R9 is connected to the first input terminal of the fourth operational amplifier, and the other end of the fifteenth resistor R9 is connected to the output terminal of the fourth operational amplifier; one end of the sixteenth resistor R10 is grounded, and the other end of the sixteenth resistor R10 is connected to the second input terminal of the fourth operational amplifier; one end of the sixth capacitor C4 is grounded, and the other end of the sixth capacitor C4 is connected to the second input terminal of the fourth operational amplifier; the output terminal of the fourth operational amplifier is connected to both the speed compensation module 30 and the position loop circuit 22.
[0203] like Figure 17 As shown, the position loop circuit 22 is a position PI controller, including: a 26th resistor R27, a 27th resistor R28, a 28th resistor R29, a 29th resistor R35, a 30th resistor R32, a 31st resistor R33, a 32nd resistor R34, a 33rd resistor R68, a 34th resistor R69, an 8th capacitor C8, a 9th capacitor C14, an 8th operational amplifier, a 9th operational amplifier, a 3rd diode D6, a 4th diode D7, and a 2nd switching element Q2; one end of the 26th resistor R27 is connected to the actual position signal, and the other end of the 26th resistor R27 is connected to the output of the 3rd diode D6. The input terminal, the output terminal of the fourth diode D7, and the first input terminal of the eighth operational amplifier are all connected; one end of the twenty-seventh resistor R28 is connected to the target position signal, and the other end of the twenty-seventh resistor R28 is connected to the input terminal of the third diode D6, the output terminal of the fourth diode D7, and the first input terminal of the eighth operational amplifier; the output terminal of the third diode D6 and the input terminal of the fourth diode D7 are both connected to the output terminal of the eighth operational amplifier; one end of the twenty-eighth resistor R29 is connected to the first input terminal of the eighth operational amplifier, and the other end of the twenty-eighth resistor R29 is connected to the eighth operational amplifier. The output terminal of the eighth operational amplifier is connected; one end of the twenty-ninth resistor R35 is grounded, and the other end of the twenty-ninth resistor R35 is connected to the second input terminal of the eighth operational amplifier; one end of the thirtieth resistor R32 is connected to the output terminal of the eighth operational amplifier, and the other end of the thirtieth resistor R32 is grounded; the output terminal of the eighth operational amplifier is connected to the first input terminal of the ninth operational amplifier via the thirty-first resistor R33 and the thirty-second resistor R34 in sequence; one end of the eighth capacitor C8 is connected to the first input terminal of the ninth operational amplifier, and the other end of the eighth capacitor C8 is connected to the output terminal of the ninth operational amplifier; The first terminal of the second switching element Q2 is connected to the first input terminal of the ninth operational amplifier, and the third terminal of the second switching element Q2 is connected to the output terminal of the ninth operational amplifier. The second terminal of the second switching element Q2 is connected to the integration control signal via the thirty-third resistor R68. One end of the thirty-fourth resistor R69 is connected to an external power supply, and the other end of the thirty-fourth resistor R69 is grounded via the ninth capacitor C14. The other end of the thirty-fourth resistor R69 is connected to the thirty-third resistor R68. The second input terminal of the ninth operational amplifier is grounded, and the output terminal of the ninth operational amplifier outputs a position difference signal. It should be noted that the integration control signal is the signal used by the integration control circuit 71 to control the operating state of the position correction module 20 and the current correction module 40 after receiving the integration enable signal.
[0204] It should be noted that the third diode D6 and the fourth diode D7 are used to limit the error of the position difference signal, and the eighth operational amplifier is used to amplify the position difference signal according to a preset ratio.
[0205] In other embodiments of this application, the current correction module 40 includes: a current sampling circuit 41 and a current loop circuit 42;
[0206] The current sampling circuit 41 is connected to the galvanometer motor and the current loop circuit 42, and is used to acquire the real-time current signal of the galvanometer motor and transmit the real-time current signal to the current loop circuit 42.
[0207] The current loop circuit 42 is connected to the control module 10, the position correction module 20, the speed compensation module 30, and the drive module 50. It is used to obtain a reference current signal based on the position difference signal, the speed compensation signal, and the target position signal; and to obtain a motor drive signal based on the reference current signal and the real-time current signal; and to transmit the motor drive signal to the drive module 50.
[0208] Among them, such as Figure 18 As shown, the current sampling circuit 41 includes a thirty-fifth resistor R85 and a tenth operational amplifier; one end of the thirty-fifth resistor R85 is connected to the second output terminal of the drive module 50 and to the first input terminal of the tenth operational amplifier, and the other end of the thirty-fifth resistor R85 is connected to the other end of the galvanometer motor and to the second input terminal of the tenth operational amplifier; the output terminal of the tenth operational amplifier outputs a real-time current signal.
[0209] like Figure 19As shown, the current loop circuit 42 includes: a 36th resistor R51, a 37th resistor R50, a 38th resistor R52, a 39th resistor R53, a 40th resistor R54, a 41st resistor R55, a 42nd resistor R56, a 43rd resistor R57, a 44th resistor R58, a 45th resistor R59, a 46th resistor R70, a 47th resistor R71, a 48th resistor R60, a 49th resistor R61, a 10th capacitor C10, an 11th capacitor C15, an 11th operational amplifier, a 12th operational amplifier, a 13th operational amplifier, and a third switching element Q3; one end of the 36th resistor R51 is connected to the target position signal, and the other end of the 36th resistor R51 is connected to the target position signal. The first input terminal of the eleventh operational amplifier is connected; one end of the thirty-seventh resistor R50 is connected to the first input terminal of the eleventh operational amplifier, and the other end of the thirty-seventh resistor R50 is connected to the output terminal of the eleventh operational amplifier; the second input terminal of the eleventh operational amplifier is grounded; the output terminal of the eleventh operational amplifier is connected to one end of the forty-first resistor R55 via the thirty-eighth resistor R52, and the output terminal of the eleventh operational amplifier is connected to one end of the forty-second resistor R56 via the thirty-eighth resistor R52; one end of the thirty-ninth resistor R53 is connected to the position difference signal, and the other end of the thirty-ninth resistor R53 is connected to one end of the forty-first resistor R55. One end of the forty-second resistor R56 is connected to the speed compensation signal; one end of the forty-first resistor R54 is connected to the speed compensation signal, and the other end of the forty-second resistor R54 is connected to one end of the forty-first resistor R55 and one end of the forty-second resistor R56; the other end of the forty-first resistor R55 is connected to the first input terminal of the twelfth operational amplifier; the other end of the forty-second resistor R56 is connected to the second input terminal of the twelfth operational amplifier; one end of the forty-third resistor R57 is connected to the first input terminal of the twelfth operational amplifier, and the other end of the forty-third resistor R57 is connected to the output terminal of the twelfth operational amplifier; the output terminal of the twelfth operational amplifier is connected via the forty-fourth resistor R56. Resistor R58 is connected to the first input terminal of the thirteenth operational amplifier; one end of the forty-fifth resistor R59 is connected to a real-time current signal, and the other end of the forty-fifth resistor R59 is connected to the first input terminal of the thirteenth operational amplifier; one end of the tenth capacitor C10 is connected to the first input terminal of the thirteenth operational amplifier, and the other end of the tenth capacitor C10 is connected to the output terminal of the thirteenth operational amplifier, and the other end of the tenth capacitor C10 is connected to the first terminal of the third switching element Q3; the third terminal of the third switching element Q3 is connected to the first input terminal of the thirteenth operational amplifier, and the second terminal of the third switching element Q3 is connected to an integration control signal via the forty-seventh resistor R71;One end of the forty-sixth resistor R70 is connected to an external power supply, and the other end of the forty-sixth resistor R70 is grounded via the eleventh capacitor C15. The other end of the forty-sixth resistor R70 is also connected to the second terminal of the three-switch element via the forty-seventh resistor R71. The output terminal of the thirteenth operational amplifier is grounded sequentially via the forty-eighth resistor R60 and the forty-ninth resistor R61, and the output terminal of the thirteenth operational amplifier outputs the motor drive signal via the forty-eighth resistor R60. It should be noted that the current loop circuit 42 uses the speed compensation signal and the target position signal as feedforward signals, which can improve the response time and make the control system more stable, thereby making the overall performance of the controlled galvanometer motor more excellent.
[0210] In other embodiments of this application, the galvanometer motor control circuit 1 further includes a buffer circuit 60;
[0211] The input terminal of the buffer circuit 60 is connected to the control module 10, and the output terminal of the buffer circuit 60 is connected to the position loop circuit 22 and the current loop circuit 42; it is used to acquire the target position signal, perform signal processing on the target position signal, and transmit the signal-processed target position signal to the position loop circuit 22 and the current loop circuit 42. The signal processing includes removing DC bias, controlling the signal amplitude, and smoothing.
[0212] It is worth noting that the buffer circuit 60 can buffer the target position signal, avoiding the situation where the target position signal in the form of a step signal will directly cause a sudden change in current, thereby improving the overall stability of the galvanometer motor control circuit 1.
[0213] Among them, such as Figure 16As shown, the buffer circuit 60 includes: a seventeenth resistor R49, an eighteenth resistor R80, a nineteenth resistor R42, a twentieth resistor R45, a twenty-first resistor R46, a twenty-second resistor R47, a twenty-third resistor R41, a twenty-fourth resistor R43, a twenty-fifth resistor R44, a seventh capacitor C9, a fifth operational amplifier, a sixth operational amplifier, a seventh operational amplifier, a first diode D7, and a second diode D8; one end of the seventeenth resistor R49 is connected to a reference voltage, and the other end of the seventeenth resistor R49 is connected to the first input terminal of the fifth operational amplifier; the eighteenth resistor R80... One end of the eighteenth resistor R80 is connected to the first input terminal of the fifth operational amplifier, and the other end of the eighteenth resistor R80 is connected to the output terminal of the fifth operational amplifier; the second input terminal of the fifth operational amplifier is connected to the target position signal, and the output terminal of the fifth operational amplifier is connected to the first input terminal of the sixth operational amplifier via the nineteenth resistor R42; one end of the twentieth resistor R45 is connected to the output terminal of the seventh operational amplifier, and the other end of the twentieth resistor R45 is connected to the second input terminal of the sixth operational amplifier; one end of the twenty-first resistor R46 is grounded, and the other end of the twenty-first resistor R46... One end of the resistor R47 is connected to the second input terminal of the sixth operational amplifier; one end of the 22nd resistor R47 is grounded, and the other end of the 22nd resistor R47 is connected to the second input terminal of the sixth operational amplifier; one end of the 23rd resistor R41 is connected to the first input terminal of the sixth operational amplifier, and the other end of the 23rd resistor R41 is connected to the output terminal of the sixth operational amplifier; the output terminal of the sixth operational amplifier is connected to the first input terminal of the seventh operational amplifier via the 24th resistor R43 and the 25th resistor R44 in sequence; the input terminal of the first diode D7 is grounded, and the output terminal of the first diode D7 is connected to the first input terminal of the seventh operational amplifier via the 25th resistor R44; the output terminal of the second diode D8 is grounded, and the input terminal of the second diode D8 is connected to the first input terminal of the seventh operational amplifier via the 25th resistor R44; one end of the seventh capacitor C9 is connected to the first input terminal of the seventh operational amplifier, and the other end of the seventh capacitor C9 is connected to the output terminal of the seventh operational amplifier; the second input terminal of the seventh operational amplifier is grounded, and the output terminal of the seventh operational amplifier is connected to both the position loop circuit 22 and the current loop circuit 42.
[0214] It should be noted that the buffer circuit 60 removes the DC bias through the fifth operational amplifier, and then forms a ramp generator with the help of the sixth and seventh operational amplifiers to buffer the signal of the circuit 60, avoiding the direct current surge caused by the step signal of the target position signal. The amplitude of the signal is controlled by the first diode D7 and the second diode D8, so that the output target position signal can change gradually at a certain rate until the target position signal equals the target value (the target value corresponding to the step signal of the target position signal). This can effectively alleviate the current surge problem caused by the signal surge and enhance the stability and reliability of the entire system.
[0215] In other embodiments of this application, the galvanometer motor control circuit 1 further includes an enable circuit 70; the enable circuit 70 is connected to the control module 10, the position correction module 20, the current correction module 40, and the drive module 50; it is used to control the working state of the position correction module 20 and the current correction module 40 according to the integral enable signal transmitted by the control module 10, and to control the working state of the drive module 50 according to the power amplifier enable signal transmitted by the control module 10.
[0216] It should be noted that when the integration enable signal is high, the fourth switch element Q4 is turned on, the first optocoupler P1 is turned on, and the position correction module 20 and the current correction module 40 are not working; when the integration enable signal is low, the fourth switch element Q4 is turned off, the first optocoupler P1 is turned off, and the position correction module 20 and the current correction module 40 are working normally; when the power amplifier enable signal is high, the fifth switch element Q5 is turned on, the second optocoupler P2 is turned on, and the drive module 50 is not working; when the power amplifier enable signal is low, the fifth switch element Q5 is turned off, the second optocoupler P2 is turned off, and the drive module 50 is working normally.
[0217] In other embodiments of this application, such as Figure 25 As shown, the enabling circuit 70 includes an integral control circuit 71 and a power amplifier control circuit 72. The integral control circuit 71 is connected to the control module 10, the position correction module 20, and the current correction module 40, and is used to receive the integral enable signal and control the working state of the position correction module 20 and the current correction module 40 according to the integral enable signal. The power amplifier control circuit 72 is connected to the control module 10 and the drive module 50, and is used to receive the power amplifier enable signal and control the working state of the drive module 50 according to the power amplifier enable signal.
[0218] It should be noted that this application divides the enabling circuit 70 into two parts: an integral control circuit 71 and a power amplifier control circuit 72. That is, the integral circuit and the power amplifier circuit are controlled independently. Compared with the scheme of directly controlling the integral circuit and the power amplifier circuit through the entire circuit (that is, the integral circuit and the power amplifier circuit can only be powered on at the same time), this scheme can manage the power-on timing of the galvanometer motor by means of the integral control circuit 71 and the power amplifier control circuit 72, thereby avoiding hardware damage or logic errors caused by mismatch of power supply voltage rise speed or incorrect power supply sequence, and ensuring that each component can start working under the best conditions.
[0219] like Figure 20 As shown, the integral control circuit 71 includes: a 50th resistor R72, a 51st resistor R73, a 52nd resistor R75, a 53rd resistor R74, a fourth switching element Q4, and a first optocoupler P1; one end of the 50th resistor R72 is connected to an integral enable signal, the other end of the 50th resistor R72 is connected to the first end of the fourth switching element Q4, and the other end of the 50th resistor R72 is grounded via the 51st resistor R73; the second end of the fourth switching element Q4 is connected to the fourth end of the first optocoupler P1, and the second end of the fourth switching element Q4 is connected to an external power supply sequentially via the 53rd resistor R74 and the 52nd resistor R75, and the third end of the fourth switching element Q4 is grounded; the first end of the first optocoupler P1 is connected to an external power supply via the 52nd resistor R75, the second end of the first optocoupler P1 outputs an integral control signal, and the third end of the first optocoupler P1 is grounded.
[0220] like Figure 21 As shown, the power amplifier control circuit 72 includes: the 54th resistor R76, the 55th resistor R86, the 56th resistor R79, the 57th resistor R78, the 58th resistor R87, the 59th resistor R81, the 60th resistor R82, the fifth switching element Q5, the second optocoupler P2, the 12th capacitor C16, and the fifth diode D16.
[0221] One end of the 54th resistor R76 is connected to the power amplifier enable signal, and the other end of the 54th resistor R76 is connected to the first end of the fifth switching element Q5, and the other end of the 54th resistor R76 is grounded via the 55th resistor R86; the second end of the fifth switching element Q5 is connected to the fourth end of the second optocoupler P2, and the second end of the fifth switching element Q5 is connected to an external power supply via the 57th resistor R78 and the 56th resistor R79 in sequence, and the third end of the fifth switching element Q5 is grounded; the first end of the second optocoupler P2 is connected to an external power supply via the 56th resistor R79. The second terminal of the second optocoupler P2 outputs a power amplifier control signal via the sixtieth resistor R82, and the third terminal of the second optocoupler P2 is grounded. One end of the fifty-eighth resistor R87 is connected to the second terminal of the second optocoupler P2, and the other end of the fifty-eighth resistor R87 is grounded. One end of the twelfth capacitor C16 is connected to the second terminal of the second optocoupler P2, and the other end of the twelfth capacitor C16 is grounded. The input terminal of the fifth diode D16 is grounded, and the output terminal of the fifth diode D16 is connected to an external power supply via the sixtieth resistor R82 and the fifty-ninth resistor R81. It should be noted that the power amplifier control signal is the signal used by the power amplifier control circuit 72 to control the operating state of the drive module 50 after receiving the power amplifier enable signal.
[0222] In other embodiments of this application, the galvanometer motor control circuit 1 further includes: a position processing module 80.
[0223] The input terminal of the position processing module 80 is connected to the voltage sampling circuit 212, and the output terminal of the position processing module 80 is connected to the speed compensation module 30 and the position loop circuit 22. It is used to receive the actual position signal, perform position processing on the actual position signal, and send the position-processed actual position signal to the speed compensation module 30 and the position loop circuit 22. The position processing includes: inverting and amplifying the actual position signal.
[0224] like Figure 22As shown, the position processing module 80 includes: a sixty-first resistor R24, a sixty-second resistor R26, a sixty-third resistor R25, and a fourteenth operational amplifier; one end of the sixty-first resistor R24 is connected to the actual position signal, and the other end of the sixty-first resistor R24 is connected to the first input terminal of the fourteenth operational amplifier; one end of the sixty-second resistor R26 is grounded, and the other end of the sixty-second resistor R26 is connected to the second input terminal of the fourteenth operational amplifier; one end of the sixty-third resistor R25 is connected to the first input terminal of the fourteenth operational amplifier, and the other end of the sixty-third resistor R25 is connected to the output terminal of the fourteenth operational amplifier; the output terminal of the fourteenth operational amplifier outputs the actual position signal after position processing.
[0225] like Figure 23 As shown, the speed compensation module 30 includes: a 30th resistor R32, a 64th resistor R19, a 65th resistor R20, a 66th resistor R21, a 67th resistor R22, a 68th resistor R30, a 69th resistor R31, a 70th resistor R23, a 13th capacitor C20, a 14th capacitor C7, a 15th operational amplifier, and a 16th operational amplifier; one end of the 64th resistor R19 is connected to the actual position signal, and the other end of the 64th resistor R19 is connected to the first input terminal of the 15th operational amplifier via the 13th capacitor C20; one end of the 14th capacitor C7 is connected to the first input terminal of the 15th operational amplifier, and the other end of the 14th capacitor C7 is connected to the output terminal of the 15th operational amplifier; one end of the 65th resistor R20 is connected to the 15th operational amplifier. The first input terminal of the 15th operational amplifier is connected, and the other end of the 65th resistor R20 is connected to the output terminal of the 15th operational amplifier via the 66th resistor R21. The second input terminal of the 15th operational amplifier is grounded, and the output terminal of the 15th operational amplifier is connected to the first input terminal of the 16th operational amplifier via the 67th resistor R22. The output terminal of the 15th operational amplifier is grounded sequentially via the 67th resistor R22, the 68th resistor R30, the 69th resistor R31, and the 30th resistor R32. One end of the 70th resistor R23 is connected to the first input terminal of the 16th operational amplifier, and the other end of the 70th resistor R23 is connected to the output terminal of the 16th operational amplifier. The second input terminal of the 16th operational amplifier is grounded, and the output terminal of the 16th operational amplifier is the speed compensation signal. It is worth noting that the 66th resistor R21 is an adjustable resistor, and its resistance value can be adjusted to improve the overall compensation effect. It should be noted that the speed compensation module 30 and the position loop circuit 22 share the 30th resistor R32.
[0226] It should be noted that the differential time of the actual position signal can be adjusted by adjusting the resistance value of the sixty-sixth resistor R21.
[0227] The galvanometer motor control circuit 1 uses a dual control structure of position correction module 20 and current correction module 40, and the speed compensation module 30 compensates for the speed based on the actual position of the galvanometer motor. This solution can significantly improve the driving accuracy of the galvanometer motor. Moreover, this solution is implemented with a simple circuit. Compared with the solution that uses a high-specification main control chip to control the galvanometer motor, this solution has a lower cost. In summary, this solution has the advantages of both control accuracy and cost.
[0228] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0229] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0230] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A galvanometer motor control method characterized by, The galvanometer motor control method is applied to the galvanometer motor, and the galvanometer motor control method includes: Acquire the target position signal of the galvanometer motor, the actual position signal of the galvanometer motor, and the real-time current signal of the galvanometer motor; A reference current signal is determined based on the target position signal and the actual position signal; The galvanometer motor is driven according to the reference current signal and the real-time current signal; The galvanometer motor control method further includes: managing the power-on timing of the galvanometer motor based on preset power-on rules, including: controlling the power-on of the control module of the galvanometer motor; controlling the power-on of the galvanometer motor; controlling the power-on of the drive module of the galvanometer motor, and starting the timer; determining a first integral voltage based on the actual position signal; determining a second preset time and a second integral voltage based on the first integral voltage and a first preset time, wherein the second preset time is less than the first preset time; controlling the output of the position loop circuit and the current loop circuit according to the first integral voltage after the timer starts counting; controlling the output of the position loop circuit and the current loop circuit according to the second integral voltage after the timer reaches the second preset time, and controlling the output of the position loop circuit and the current loop circuit to be within a first preset range before reaching the first preset time; and controlling the position loop circuit and the current loop circuit to start normal output after reaching the first preset time.
2. The galvanometer control method according to claim 1, wherein Determining the reference current signal based on the target position signal and the actual position signal includes: Based on the target position signal and the actual position signal, the position difference signal of the galvanometer motor is obtained; Based on the actual position signal, a velocity compensation signal is obtained; A reference current signal is obtained based on the position difference signal, the velocity compensation signal, and the target position signal.
3. The galvanometer motor control method according to claim 1, characterized in that, The step of driving the galvanometer motor according to the reference current signal and the real-time current signal includes: Based on the reference current signal and the real-time current signal, the error current signal is obtained; Based on the error current signal, the motor drive signal is obtained; The galvanometer motor is driven according to the motor drive signal.
4. The galvanometer motor control method according to claim 3, characterized in that, The galvanometer motor control method further includes: Obtain the initial parameters of the galvanometer motor, the initial parameters including: the boundary position and center position of the galvanometer motor; The galvanometer motor is reset according to the initial parameters.
5. The galvanometer motor control method according to claim 4, characterized in that, The galvanometer motor control method further includes: A width scan is performed on the galvanometer motor to update its initial parameters.
6. The galvanometer motor control method according to claim 5, characterized in that, The step of performing a width scan on the galvanometer motor and updating the initial parameters of the galvanometer motor includes: Control the galvanometer motor to deflect in the forward direction and acquire the feedback voltage signal of the galvanometer motor; When the feedback voltage signal meets the preset conditions, the first boundary position of the galvanometer motor is determined; Control the galvanometer motor to deflect in the reverse direction and obtain the feedback voltage signal of the galvanometer motor; When the feedback voltage signal meets the preset conditions, the second boundary position of the galvanometer motor is determined; The initial parameters of the galvanometer motor are updated based on the first boundary position and the second boundary position.
7. The galvanometer motor control method according to claim 4, characterized in that, The galvanometer motor control method further includes: Detect whether the initial parameters have an offset; If an offset exists, obtain the offset parameter; The initial parameters of the galvanometer motor are adjusted according to the offset parameters.
8. The galvanometer motor control method according to claim 7, characterized in that, The offset parameter includes the offset amount and the maximum angular offset percentage. Adjusting the initial parameters of the galvanometer motor according to the offset parameter includes: The center and boundary positions of the galvanometer motor are adjusted based on the offset and the maximum angular offset percentage.
9. The galvanometer motor control method according to claim 3, characterized in that, The step of driving the galvanometer motor according to the motor drive signal includes: The galvanometer motor is driven according to the motor drive signal, and a timer is set with a third preset time. The galvanometer motor is controlled to move at a constant speed based on the timer at a third preset time.
10. The galvanometer motor control method according to claim 9, characterized in that, The step of controlling the galvanometer motor to move at a constant speed based on the timer for a third preset time includes: Obtain the oscillation period and position step value; If the timer reaches the third preset time, the running time is obtained, and the corresponding position step value is determined based on the running time. Based on the position step value, the third preset time, and the oscillation period, the galvanometer motor is controlled to move at a constant speed.
11. The galvanometer motor control method according to claim 10, characterized in that, The step of controlling the galvanometer motor to move at a constant speed based on the position step value, the third preset time, and the oscillation period includes: The speed of the galvanometer motor is adjusted according to the position step value and the third preset time to make the galvanometer motor move at a constant speed. Obtain the oscillation period of the galvanometer motor, and determine the duration difference between half of the oscillation period and the running time; If the duration difference is less than the third preset time, the timer is adjusted based on the duration difference, and after the timer reaches the duration difference, the speed of the galvanometer motor is reversed, and the timer is set based on the third preset time.