Smooth driving method and device of motor and OCT equipment
The smooth driving method of the motor is achieved through FPGA, which solves the problem of large instantaneous acceleration during start and stop of the motor, and achieves smooth start and stop of the motor, extends service life and reduces the current peak.
Patent Information
- Application Number
- CN202411464147.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-10-18
AI Technical Summary
The motor generates a large instantaneous acceleration when starting and stopping, resulting in damage to the mechanical structure and overloading the drive circuit, thereby shortening the service life.
The smooth driving method of the motor is realized through the FPGA, and the acquired scanning data and preset acceleration values are used to determine the scanning acceleration starting point voltage and the moving deceleration starting point voltage of the motor, thereby controlling the acceleration and deceleration process of the motor.
It realizes smooth start and stop of the motor, reduces damage to mechanical structures and electronic components, extends service life, and reduces current peaks, avoids overloading of the drive circuit.
Smart Images

Figure CN118971687B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of motor control technology, and in particular to a motor smooth driving method, device and OCT equipment. Background Art
[0002] When the motor is started and stopped, if it is not smoothed and the conventional drive waveform is directly input, it will cause the motor to generate a large instantaneous acceleration in a short period of time after starting and before stopping. Larger acceleration means larger torque. This will damage the mechanical structure of the motor in the long run, especially for precision motors used for optical imaging, which will significantly reduce the service life. At the same time, larger torque will cause the drive circuit to generate large current, and micro motors are generally powered by a PCB board connected to a power module. The instantaneous overshoot current will break through the circuit board components and cause the entire system to be scrapped. In the related technology, the Galvo motor can use bandwidth limitation and PID control to limit the input drive signal. Specifically, electronic components are used to rectify the input drive waveform and force the unreasonable drive waveform into a smooth waveform. This hardware-based solution has poor controllability and is difficult to ensure the smooth start and stop of the Galvo motor, resulting in the mechanical structure and related electronic components of the Galvo motor being easily damaged. Summary of the invention
[0003] The object of the present invention is to provide a method, device and OCT equipment for smoothly driving a motor, so as to achieve smooth driving of the motor and ensure smooth starting and stopping of the motor, thereby avoiding damage to the mechanical structure of the motor and related electronic components.
[0004] The present invention provides a smooth driving method for a motor, which is applied to FPGA; the method comprises: obtaining scanning data corresponding to the motor, a preset first acceleration value, and a current voltage corresponding to the current position of the motor in an initial state; wherein the scanning data comprises: a scanning step length, a moving step length, a scanning number, and a first voltage value corresponding to a scanning starting point; determining a scanning acceleration starting point voltage and a moving deceleration starting point voltage of the motor according to the scanning step length, the moving step length, the first voltage value, and the first acceleration value; driving the motor to operate based on the current voltage, the scanning number, the scanning acceleration starting point voltage, the moving deceleration starting point voltage, and the scanning deceleration starting point voltage and the moving acceleration starting point voltage acquired in advance; wherein, when the motor decelerates from a moving deceleration starting point position indicated by a moving deceleration starting point voltage to zero, the corresponding position is the scanning acceleration starting point position indicated by the scanning acceleration starting point voltage; when the motor accelerates from the scanning acceleration starting point position to the scanning step length, the corresponding position is the scanning starting point; when the motor decelerates from a scanning deceleration starting point position indicated by the scanning deceleration starting point voltage to zero, the corresponding position is the moving acceleration starting point position indicated by the moving acceleration starting point voltage; when the motor accelerates from the moving acceleration starting point position to the moving step length, the corresponding position is the uniform speed moving starting point.
[0005] Furthermore, based on the current voltage, the number of scans, the scan acceleration starting voltage, the moving deceleration starting voltage, and the pre-acquired scan deceleration starting voltage and the moving acceleration starting voltage, the step of driving the motor to operate includes: based on the first acceleration value and the current voltage, controlling the motor to accelerate from the current position, and when accelerating to the moving step length, moving at a uniform speed according to the moving step length to the moving deceleration starting position indicated by the moving deceleration starting voltage; based on the first acceleration value and the moving step length, controlling the motor to decelerate from the moving deceleration starting position, wherein the corresponding position when the motor decelerates to zero is the scanning acceleration starting position indicated by the scanning acceleration starting voltage; based on the first acceleration value, controlling the motor to decelerate from the scanning acceleration starting position Start acceleration, wherein the corresponding position when the motor accelerates to the scanning step length is the scanning starting point; starting from the scanning starting point, control the motor to move at a uniform speed according to the scanning step length to scan the object to be measured; when moving to the scanning deceleration starting position indicated by the scanning deceleration starting voltage, based on the first acceleration value, control the motor to decelerate from the scanning deceleration starting position, wherein the corresponding position when the motor decelerates to zero is the moving acceleration starting position corresponding to the moving acceleration starting voltage; use the moving acceleration starting voltage as the new current voltage, and the moving acceleration starting position as the new current position, and repeat the step of controlling the motor to accelerate from the current position based on the first acceleration value and the current voltage until the number of scans is reached.
[0006] Furthermore, the step of determining the scanning acceleration starting voltage and the moving deceleration starting voltage of the motor according to the scanning step length, the moving step length, the first voltage value and the first acceleration value includes: determining the scanning acceleration starting voltage of the motor according to the scanning step length, the first acceleration value and the first voltage value; determining the moving deceleration starting voltage of the motor according to the moving step length, the first acceleration value and the scanning acceleration starting voltage.
[0007] Furthermore, the step of determining the scanning acceleration starting voltage of the motor according to the scanning step length, the first acceleration value and the first voltage value includes: calculating the number of accelerations corresponding to the motor accelerating from zero to the scanning step length according to the scanning step length and the first acceleration value; calculating the second voltage value corresponding to the acceleration number according to the acceleration number; and determining the scanning acceleration starting voltage of the motor according to the second voltage value and the first voltage value.
[0008] Furthermore, the following formula is used to calculate the acceleration times:
[0009] MarkAccTimes=MarkStep / A;
[0010] Wherein, MarkAccTimes represents the number of acceleration times; MarkStep represents the scanning step length; A represents the first acceleration value;
[0011] The second voltage value is calculated using the following formula:
[0012] Mark Acceleration=0.5×MarkAccTimes×(MarkAccTimes + 1);
[0013] Wherein, Mark Acceleration represents the second voltage value;
[0014] The scan acceleration starting voltage is calculated using the following formula:
[0015] MarkAccStartPos=VStart-Mark Acceleration;
[0016] Wherein, MarkAccStartPos represents the scan acceleration starting point voltage; VStart represents the first voltage value.
[0017] Furthermore, the step of determining the motor's moving deceleration starting voltage based on the moving step length, the first acceleration value and the scanning acceleration starting voltage includes: calculating the number of deceleration times corresponding to the motor decelerating from the moving step length to zero based on the moving step length and the first acceleration value; calculating the third voltage value corresponding to the number of deceleration times based on the deceleration times; and calculating the motor's moving deceleration starting voltage based on the third voltage value and the scanning acceleration starting voltage.
[0018] Furthermore, the following formula is used to calculate the number of decelerations:
[0019] JumpDecTimes=JumpStep / A;
[0020] Wherein, JumpDecTimes represents the number of deceleration times; JumpStep represents the moving step length; A represents the first acceleration value;
[0021] The third voltage value is calculated using the following formula:
[0022] Jump Deceleration=0.5×JumpecTimes×(JumpDecTimes + 1);
[0023] Wherein, Jump Deceleration represents the third voltage value;
[0024] Use the following formula to calculate the moving deceleration starting point voltage:
[0025] JumpDecStartPos=MarkAccStartPos+Jump Deceleration;
[0026] Among them, JumpDecStartPos represents the starting voltage of movement deceleration; MarkAccStartPos represents the starting voltage of scan acceleration.
[0027] Furthermore, the first acceleration value is determined using the following formula:
[0028] ;
[0029] Wherein, A represents the first acceleration value; k represents the peak value of the specified sine wave; Indicates the frequency of the specified sine wave; T is the preset value;
[0030] The designated sine wave is determined in the following manner: a plurality of sine waves are input to the motor drive board corresponding to the motor in order of frequency from low to high, and the sine wave at which harmonics begin to appear in the motion feedback waveform of the motor is determined as the designated sine wave.
[0031] The present invention provides a smooth driving device for a motor, which is arranged in an FPGA; the device comprises: an acquisition module, which is used to acquire scanning data corresponding to the motor, a preset first acceleration value, and a current voltage corresponding to the current position of the motor in an initial state; wherein the scanning data comprises: a scanning step length, a moving step length, a scanning number of times and a first voltage value corresponding to a scanning starting point; a determination module, which is used to determine a scanning acceleration starting point voltage and a moving deceleration starting point voltage of the motor according to the scanning step length, the moving step length, the first voltage value and the first acceleration value; a driving operation module, which is used to determine a scanning acceleration starting point voltage and a moving deceleration starting point voltage of the motor based on the scanning number, the scanning acceleration starting point voltage and the moving deceleration starting point voltage. and the pre-acquired scanning deceleration starting voltage and moving acceleration starting voltage, drive the motor to run; wherein, when the motor decelerates from the moving deceleration starting position indicated by the moving deceleration starting voltage to zero, the corresponding position is the scanning acceleration starting position indicated by the scanning acceleration starting voltage; when the motor accelerates from the scanning acceleration starting position to the scanning step length, the corresponding position is the scanning starting point; when the motor decelerates from the scanning deceleration starting position indicated by the scanning deceleration starting voltage to zero, the corresponding position is the moving acceleration starting position indicated by the moving acceleration starting voltage; when the motor accelerates from the moving acceleration starting position to the moving step length, the corresponding position is the uniform speed moving starting point.
[0032] The present invention provides an OCT device, which includes: an FPGA, a motor driving board, a motor, an optical galvanometer and a light-emitting module; the FPGA is used to receive driving instructions from a host computer, and according to the driving instructions, execute any of the above-mentioned smooth driving methods of the motor to drive the motor to operate through the motor driving board; wherein the driving instructions include: scanning data corresponding to the motor; the motor is used to drive the optical galvanometer to rotate, and the coherent light emitted by the light-emitting module is reflected to the object to be measured through the optical galvanometer to scan the object to be measured and obtain a target image corresponding to the object to be measured.
[0033] The present invention provides a smooth driving method, device and OCT device for a motor, and the method is applied to FPGA; the method comprises: obtaining scanning data corresponding to the motor, a preset first acceleration value, and a current voltage corresponding to the current position of the motor in an initial state; wherein the scanning data comprises: a scanning step length, a moving step length, a scanning number of times and a first voltage value corresponding to the scanning starting point; according to the scanning step length, the moving step length, the first voltage value and the first acceleration value, determining the scanning acceleration starting point voltage and the moving deceleration starting point voltage of the motor; based on the current voltage, the scanning number of times, the scanning acceleration starting point voltage, the moving deceleration starting point voltage, and the pre-acquired The scanning deceleration starting voltage and the moving acceleration starting voltage drive the motor to run; wherein, when the motor decelerates from the moving deceleration starting position indicated by the moving deceleration starting voltage to zero, the corresponding position is the scanning acceleration starting position indicated by the scanning acceleration starting voltage; when the motor accelerates from the scanning acceleration starting position to the scanning step length, the corresponding position is the scanning starting point; when the motor decelerates from the scanning deceleration starting position indicated by the scanning deceleration starting voltage to zero, the corresponding position is the moving acceleration starting position indicated by the moving acceleration starting voltage; when the motor accelerates from the moving acceleration starting position to the moving step length, the corresponding position is the uniform speed moving starting point. This method can determine the scanning acceleration starting voltage and the moving deceleration starting voltage of the motor according to the acquired scanning data, and can realize smooth driving of the motor by combining the scanning deceleration starting voltage and the moving acceleration starting voltage acquired in advance, thereby ensuring smooth start and stop of the motor, thereby avoiding the problem of damage to the mechanical structure of the motor and related electronic components. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 is a schematic diagram of a driving waveform in the prior art;
[0036] Figure 2 A flow chart of a method for smoothly driving a motor provided by an embodiment of the present invention;
[0037] Figure 3 A schematic diagram of a scanning process provided by an embodiment of the present invention;
[0038] Figure 4 A schematic structural diagram of a smooth driving device for a motor provided by an embodiment of the present invention;
[0039] Figure 5 A schematic diagram of an OCT device provided by an embodiment of the present invention;
[0040] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] When the motor starts and stops, if the conventional drive waveform is directly input without smoothing, it will cause the motor to generate a large instantaneous acceleration in a short period of time after starting and before stopping, such as Figure 1 A schematic diagram of a driving waveform in the prior art is shown. From F=ma (where F represents the force giving acceleration to an object, m represents the mass of the accelerated object, and a represents the acceleration generated by the force F), it can be seen that a larger acceleration means a larger torque. If this continues for a long time, it will damage the mechanical structure of the motor, especially the precision motor used for optical imaging, which will significantly reduce the service life; at the same time, from F=BIL (where B represents the magnetic field strength; I represents the current strength; L represents the wire length), it can be seen that a larger torque will cause the drive circuit to generate a large current. Large motors used for load-carrying and dragging are not sensitive to such instantaneous current changes because they use electrical cables to connect to the mains power supply. However, micro motors are generally powered by a PCB board connected to a power module. The instantaneous overshoot current will break down the components of the circuit board and cause the entire system to be scrapped.
[0043] At present, the smoothing of motor drive signals mostly adopts filtering solutions based on stepper motor platforms. The stepper motor can minimize the instantaneous acceleration by reducing the step length at the beginning of startup. However, this solution does not physically analyze the maximum acceleration allowed by the motor, and the smoothing effect is not ideal. If the starting step length is too small, the stepper motor will start slowly. If the starting step length is too large, it will still cause large torque and high current. At the same time, the Galvo motor used for OCT (Optical Coherence Tomography) is a precision device. The moving distance can be freely adjusted each time. It does not have the concept of fixed step length of stepper motors. Traditional smoothing solutions cannot be applied to OCT Galvo motor drives. In the related art, the Galvo motor can use bandwidth limitation and PID (Proportional-Integral-Derivative) control to limit the input drive signal, specifically using electronic components to rectify the input drive waveform. This hardware-based solution has poor controllability and is difficult to ensure the smooth start and stop of the Galvo motor, which makes the mechanical structure and related electronic components of the Galvo motor easy to damage, and causes the actual motion curve of the Galvo to differ greatly from the drive curve in shape and time. Based on this, the embodiment of the present invention provides a smooth drive method, device and OCT device for a motor, which can be applied to applications that require smooth drive control of the motor.
[0044] To facilitate understanding of this embodiment, a smooth driving method of a motor disclosed in an embodiment of the present invention is first introduced. This method is applied to FPGA (Field Programmable Gate Array). FPGA is a semi-custom circuit in the field of application-specific integrated circuits. It not only solves the shortcomings of custom circuits, but also overcomes the shortcomings of the limited number of gate circuits of the original programmable device. Figure 2 As shown, the method comprises the following steps:
[0045] Step S202, obtaining scanning data corresponding to the motor, a preset first acceleration value, and a current voltage corresponding to the current position of the motor in the initial state; wherein the scanning data includes: scanning step length, moving step length, scanning times, and a first voltage value corresponding to the scanning starting point;
[0046] The above-mentioned motor can specifically be a Galvo motor used for OCT scanning. The Galvo motor is a laser scanning galvanometer motor with extremely high scanning accuracy, scanning speed and positioning accuracy. The above-mentioned first acceleration value is usually a predetermined acceleration value. In this embodiment, when acceleration or deceleration is required, the first acceleration value can be used as the acceleration. The above-mentioned initial state can be understood as the current state when it is necessary to start smooth drive control of the motor; the above-mentioned current voltage can be understood as the current input voltage of the FPGA currently input to the motor drive board used to drive the motor to run; because the position of the motor is usually linearly corresponding to the input voltage, for example, the input voltage is -3V~+3V, and the corresponding motor position is -3mm~+3mm; the corresponding current voltage can be obtained according to the current position of the motor in the initial state. The above-mentioned scanning step length can be understood as the distance or interval of each movement during the scanning process. In this embodiment, the scanning step length can be expressed as a voltage value, that is, the voltage change value of each movement during the scanning process. Due to the performance limitation of the upper computer for processing images, the scanning step length is usually not too large; the above-mentioned moving step length can be understood as the distance or interval of each movement during the uniform moving stage in the process of the motor moving to the next scanning starting point after the previous scan ends; in this embodiment, the moving step length can be expressed as a voltage value, that is, the voltage change value of each movement during the uniform moving stage. Since this process does not participate in imaging, the moving step length can usually be larger than the scanning step length.
[0047] The above-mentioned scanning times can be set according to actual needs; the above-mentioned scanning starting point can be understood as the scanning position corresponding to the scanning step size when the uniform speed scanning can be started; since the position of the motor is usually linearly corresponding to the input voltage, the corresponding first voltage value can be determined according to the position of the motor at the scanning starting point. In actual implementation, when it is necessary to control the motor for smooth driving, the scanning step size, moving step size, scanning times and the first voltage value corresponding to the scanning starting point, the preset first acceleration value, and the current voltage corresponding to the current position of the motor in the initial state can be obtained first.
[0048] Step S204, determining a scanning acceleration starting point voltage and a moving deceleration starting point voltage of the motor according to the scanning step length, the moving step length, the first voltage value and the first acceleration value;
[0049] When the motor is at the position corresponding to the scanning acceleration starting voltage, the speed of the motor is zero, and the motor starts to accelerate from this position until it reaches the speed corresponding to the scanning step; when the motor is at the position corresponding to the moving deceleration starting voltage, the motor starts to decelerate from the speed corresponding to the uniform moving step until it decelerates to zero; in actual implementation, the scanning acceleration starting voltage and the moving deceleration starting voltage of the motor can be calculated based on the above-mentioned scanning step, moving step, first voltage value and first acceleration value.
[0050] Step S206, based on the current voltage, number of scans, scan acceleration starting voltage, moving deceleration starting voltage, and pre-acquired scan deceleration starting voltage and moving acceleration starting voltage, drive the motor to run; wherein, when the motor decelerates from the moving deceleration starting position indicated by the moving deceleration starting voltage to zero, the corresponding position is the scanning acceleration starting position indicated by the scanning acceleration starting voltage; when the motor accelerates from the scanning acceleration starting position to the scanning step, the corresponding position is the scanning starting point; when the motor decelerates from the scanning deceleration starting position indicated by the scanning deceleration starting voltage to zero, the corresponding position is the moving acceleration starting position indicated by the moving acceleration starting voltage; when the motor accelerates from the moving acceleration starting position to the moving step, the corresponding position is the uniform speed moving starting point.
[0051] When the motor is at the position corresponding to the scanning deceleration starting voltage, the motor starts to decelerate from the speed corresponding to the uniform scanning step until it decelerates to zero; when the motor is at the position corresponding to the moving acceleration starting voltage, the speed of the motor is zero, and the motor starts to accelerate from this position until it reaches the speed corresponding to the moving step; in actual implementation, the above-mentioned scanning deceleration starting voltage and moving acceleration starting voltage can be obtained in advance, and then combined with the above-mentioned current voltage, number of scans, scanning acceleration starting voltage and moving deceleration starting voltage, to drive the above-mentioned motor to operate.
[0052] When the motor starts to decelerate from the speed corresponding to the moving step at the starting point of moving deceleration, it will stop exactly at the starting point of scanning acceleration; when the motor starts to accelerate from zero at the starting point of scanning acceleration, it will reach the speed corresponding to the scanning step at the scanning starting point, and enter the data acquisition process according to the scanning step; when the motor starts to decelerate from the speed corresponding to the scanning step at the starting point of scanning deceleration, it will stop exactly at the starting point of moving acceleration; when the motor starts to accelerate from zero at the starting point of moving acceleration, it will reach the speed corresponding to the moving step at the starting point of uniform movement, and move at a uniform speed according to the moving step.
[0053] The above-mentioned smooth driving method of the motor is applied to FPGA; the method includes: obtaining scanning data corresponding to the motor, a preset first acceleration value, and a current voltage corresponding to the current position of the motor in the initial state; wherein the scanning data includes: a scanning step length, a moving step length, a scanning number and a first voltage value corresponding to the scanning starting point; determining the scanning acceleration starting point voltage and the moving deceleration starting point voltage of the motor according to the scanning step length, the moving step length, the first voltage value and the first acceleration value; driving the motor to operate based on the current voltage, the scanning number, the scanning acceleration starting point voltage, the moving deceleration starting point voltage, and the pre-acquired scanning deceleration starting point voltage and the moving acceleration starting point voltage; wherein, when the motor decelerates from the moving deceleration starting point position indicated by the moving deceleration starting point voltage to zero, the corresponding position is the scanning acceleration starting point position indicated by the scanning acceleration starting point voltage; when the motor accelerates from the scanning acceleration starting point position to the scanning step length, the corresponding position is the scanning starting point; when the motor decelerates from the scanning deceleration starting point position indicated by the scanning deceleration starting point voltage to zero, the corresponding position is the moving acceleration starting point position indicated by the moving acceleration starting point voltage; when the motor accelerates from the moving acceleration starting point position to the moving step length, the corresponding position is the uniform speed moving starting point. This method can determine the scanning acceleration starting voltage and moving deceleration starting voltage of the motor based on the acquired scanning data. Combined with the pre-acquired scanning deceleration starting voltage and moving acceleration starting voltage, smooth driving of the motor can be achieved to ensure smooth starting and stopping of the motor, thereby avoiding damage to the mechanical structure of the motor and related electronic components.
[0054] The embodiment of the present invention further provides another method for smoothly driving a motor, which is implemented on the basis of the method in the above embodiment, and comprises the following steps:
[0055] Step 1, obtaining scanning data corresponding to the motor, a preset first acceleration value, and a current voltage corresponding to the current position of the motor in the initial state; wherein the scanning data includes: scanning step length, moving step length, scanning times, and a first voltage value corresponding to the scanning starting point;
[0056] The first acceleration value is determined using the following formula:
[0057] ;
[0058] Wherein, A represents the first acceleration value; k represents the peak value of the specified sine wave; Indicates the frequency of the specified sine wave; T is the preset value;
[0059] The designated sine wave is determined in the following manner: a plurality of sine waves are input to the motor drive board corresponding to the motor in order of frequency from low to high, and the sine wave at which harmonics begin to appear in the motion feedback waveform of the motor is determined as the designated sine wave.
[0060] In actual implementation, in order to control the smooth drive of the motor, it is usually necessary to first obtain the maximum acceleration allowed by the motor. Generally speaking, different manufacturers, different materials, and different processes will result in differences in the maximum acceleration allowed by the motor's mechanical structure, and special research is required for a specific model. At the same time, since the maximum acceleration is related to the current, the motor driver board, that is, the electrical structure of the motor, will also have a maximum acceleration. The maximum acceleration allowed by the electrical structure needs to refer to the circuit board design manual. The maximum acceleration allowed by a well-designed motor mechanical structure must be less than the maximum acceleration allowed by the electrical structure, or there is a corresponding current limiting device on the circuit board, otherwise the motor is very easy to burn out. Therefore, here we only consider how to obtain the maximum acceleration allowed by the mechanical structure, that is, the first acceleration value mentioned above.
[0061] In actual implementation, the signal generator can be connected to the input port of the motor driver board, and sine waves of different frequencies can be input in order from low to high frequency. The motor's motion feedback waveform can be connected to an oscilloscope for Fourier transform to observe whether harmonics appear. There are usually no harmonics when driving with low-frequency sine waves. As the frequency increases, the harmonics will gradually increase and eventually be detected by the oscilloscope. When harmonics appear, the Fourier transform graph on the oscilloscope will obviously have several more peaks. Of course, the sampling points of the Fourier transform graph on the oscilloscope can also be mathematically analyzed to determine whether harmonics appear. The sine wave when the harmonics begin to appear can be used as the specified sine wave, and the frequency of the specified sine wave can be recorded to derive the formula for the change of acceleration over time in the analog domain, as follows:
[0062] ;
[0063] in, represents the acceleration in the simulation domain; k represents the peak value of the specified sine wave; Indicates the frequency of the specified sine wave. The above k represents the maximum position that the motor can reach or reach, which is determined by the user according to the detection requirements. That is, the user can set the k value according to actual needs; It is determined by the mechanical properties of the motor itself. Once the k value is determined, it can be measured experimentally. .
[0064] The maximum acceleration a can be determined from the above formula max kω 2, to convert the maximum acceleration in the analog domain (continuous time) to the maximum acceleration in the digital domain (discrete time) A (unit: V per DAC Refresh), it is necessary to determine the DAC (Digital to Analog Converter, digital-to-analog converter) refresh cycle T (i.e., how often the driving voltage changes). The refresh cycle T can be set by the user according to actual needs. It should be noted that although the driving waveform of the motor looks like a "sine wave", neither the signal generator nor the FPGA can actually generate a continuous analog signal. Its essence is to output a voltage value V1, then maintain the V1 voltage for T seconds before outputting the next voltage V2, and then maintain it for T seconds before outputting V3...; connecting multiple output voltages is a sine wave. The smaller this T is, the more the waveform looks like a sine wave, that is, the resolution becomes larger and the sawtooth sense becomes smaller. However, due to the limitation that the digital-to-analog converter cannot change the voltage infinitely fast, and each change must wait until the camera has finished collecting images. This T has a minimum value, and users usually do not use the minimum value. Generally, there will be a margin. Users can set T to a reasonable value according to actual needs. By converting the above formula for the change of acceleration over time in the analog domain, the above formula for the first acceleration value can be obtained.
[0065] The host computer sends a line of instructions to the FPGA through the network port. This instruction contains the first voltage value Vstart of the scanning starting point, the scanning step length MarkStep, the moving step length JumpStep, and the number of scanning times StepSum (that is, the total number of moves). After receiving the instruction, the FPGA will split and analyze this information to obtain the corresponding information.
[0066] Step 2, determining a scanning acceleration starting point voltage of the motor according to the scanning step length, the first acceleration value and the first voltage value;
[0067] like Figure 3 A schematic diagram of a scanning process is shown, which shows a complete scanning process. For the convenience of explanation, in the figure, the upward direction along the waveform represents the scanning direction, and the downward direction along the waveform represents the moving direction; it includes: scanning acceleration process, data acquisition process, scanning deceleration process, movement acceleration process, uniform speed movement process and movement deceleration process.
[0068] The second step can be implemented by following steps 20 to 22:
[0069] Step 20, calculating the acceleration times corresponding to the motor accelerating from zero to the scanning step length according to the scanning step length and the first acceleration value;
[0070] The FPGA can first calculate the total number of times the motor needs to accelerate from zero to the scan step according to the scan step and the first acceleration value. The calculation formula is as follows:
[0071] The acceleration times are calculated using the following formula:
[0072] MarkAccTimes=MarkStep / A;
[0073] Wherein, MarkAccTimes represents the number of acceleration times; MarkStep represents the scanning step length; A represents the first acceleration value;
[0074] Step 21, calculating a second voltage value corresponding to the acceleration times according to the acceleration times;
[0075] Based on the acceleration times calculated above, the FPGA will calculate the total distance required to accelerate these acceleration times. Since the change of the driving voltage is linearly related to the actual moving distance of the motor, for example, when the driving voltage rises by 1V, the motor moves 1mm; the distance can be converted into the corresponding second voltage value; specifically, the second voltage value can be calculated using the following formula:
[0076] Mark Acceleration=0.5×MarkAccTimes×(MarkAccTimes + 1);
[0077] Wherein, Mark Acceleration represents the second voltage value.
[0078] Step 22, determining the scanning acceleration starting point voltage of the motor according to the second voltage value and the first voltage value.
[0079] After obtaining the second voltage value, the scan acceleration starting point voltage can be calculated using the following formula:
[0080] MarkAccStartPos=VStart-Mark Acceleration;
[0081] Wherein, MarkAccStartPos represents the scan acceleration starting point voltage; VStart represents the first voltage value.
[0082] Step 3, determining the movement deceleration starting voltage of the motor according to the movement step length, the first acceleration value and the scanning acceleration starting voltage;
[0083] The step three can be implemented by following steps 30 to 32:
[0084] Step 30, calculating the number of deceleration times corresponding to the motor decelerating from the moving step length to zero according to the moving step length and the first acceleration value;
[0085] The FPGA can calculate the total number of times the motor needs to decelerate from the moving step length to zero based on the moving step length and the first acceleration value, and use the following formula to calculate the number of deceleration times:
[0086] JumpDecTimes=JumpStep / A;
[0087] Wherein, JumpDecTimes represents the number of deceleration times; JumpStep represents the moving step length; A represents the first acceleration value;
[0088] Step 31, calculating a third voltage value corresponding to the number of deceleration times according to the number of deceleration times;
[0089] The FPGA will calculate the total distance required to decelerate the deceleration times according to the above calculated deceleration times, and the distance can be converted into a corresponding third voltage value; specifically, the third voltage value can be calculated using the following formula:
[0090] Jump Deceleration=0.5×JumpecTimes×(JumpDecTimes + 1);
[0091] Wherein, Jump Deceleration represents the third voltage value;
[0092] Step 32, calculating the movement deceleration starting voltage of the motor according to the third voltage value and the scanning acceleration starting voltage.
[0093] After obtaining the third voltage value, the moving deceleration starting point voltage can be calculated using the following formula:
[0094] JumpDecStartPos=MarkAccStartPos+Jump Deceleration;
[0095] Among them, JumpDecStartPos represents the starting voltage of movement deceleration; MarkAccStartPos represents the starting voltage of scan acceleration.
[0096] Step 4: Based on the first acceleration value and the current voltage, the motor is controlled to accelerate from the current position, and when accelerated to the moving step length, the motor is moved at a uniform speed according to the moving step length to the moving deceleration starting position indicated by the moving deceleration starting voltage;
[0097] The FPGA starts to accelerate downward to the moving step length based on the current voltage corresponding to the current position of the above-mentioned motor with a first acceleration value, and then moves at a uniform speed with the moving step length until the moving deceleration starting point position indicated by the moving deceleration starting point voltage.
[0098] Step 5: Based on the first acceleration value and the moving step length, the motor is controlled to start decelerating from the moving deceleration starting position, wherein the corresponding position when the motor decelerates to zero is the scanning acceleration starting position indicated by the scanning acceleration starting voltage;
[0099] The motor is controlled to start from the above-mentioned moving deceleration starting position, decelerate from the moving step length with a first acceleration value, and stop at the scanning acceleration starting position indicated by the scanning acceleration starting voltage.
[0100] Step 6: Based on the first acceleration value, control the motor to start accelerating from the scanning acceleration starting point, wherein the corresponding position when the motor accelerates to the scanning step length is the scanning starting point;
[0101] Then, starting from the scanning acceleration starting point, the system accelerates upward with a first acceleration value, and enters the data acquisition process at the scanning starting point according to the scanning step length.
[0102] Step 7, starting from the scanning starting point, controlling the motor to move at a uniform speed according to the scanning step length to scan the object to be measured;
[0103] Step eight, when the motor moves to the scanning deceleration starting position indicated by the scanning deceleration starting voltage, based on the first acceleration value, the motor is controlled to start deceleration from the scanning deceleration starting position, wherein the corresponding position when the motor decelerates to zero is the moving acceleration starting position corresponding to the moving acceleration starting voltage;
[0104] The motor is controlled to start from the above-mentioned scanning deceleration starting position, decelerate from the scanning step length with a first acceleration value, and stop at the moving acceleration starting position corresponding to the moving acceleration starting voltage.
[0105] Step nine, taking the moving acceleration starting point voltage as the new current voltage, and the moving acceleration starting point position as the new current position, and repeating the step of controlling the motor to accelerate from the current position based on the first acceleration value and the current voltage until the scanning number is reached.
[0106] Among them, when the motor decelerates from the moving deceleration starting position indicated by the moving deceleration starting voltage to zero, the corresponding position is the scanning acceleration starting position indicated by the scanning acceleration starting voltage; when the motor accelerates from the scanning acceleration starting position to the scanning step length, the corresponding position is the scanning starting point; when the motor decelerates from the scanning deceleration starting position indicated by the scanning deceleration starting voltage to zero, the corresponding position is the moving acceleration starting position indicated by the moving acceleration starting voltage; when the motor accelerates from the moving acceleration starting position to the moving step length, the corresponding position is the uniform speed moving starting point.
[0107] After the previous scan ends and decelerates to zero, the motor will first accelerate until the speed reaches the speed corresponding to the moving step length, and then the motor will move at a constant speed according to the moving step length to the moving deceleration starting point. The motor begins to decelerate and eventually stops. The stopped position is the scanning acceleration starting point for the next scan. It starts to accelerate from the scanning acceleration starting point. When it accelerates to the scanning step length, the corresponding position is the scanning starting point.
[0108] The above-mentioned smooth driving method of the motor effectively reduces the torque of the motor during acceleration and deceleration, avoids damage to the mechanical structure, and prolongs the service life of the galvanometer. It effectively reduces the current of the motor during acceleration and deceleration, avoids damage to electronic components, and prolongs the service life of the driver board. It effectively reduces the nonlinear effect of the motor at the scanning start and end point, avoids image distortion at the scanning start and end point, and improves the imaging effect.
[0109] The embodiment of the present invention provides a smooth driving device of a motor, such as Figure 4 As shown, the device is arranged in FPGA; the device comprises: an acquisition module 40, which is used to acquire scanning data corresponding to the motor, a preset first acceleration value, and a current voltage corresponding to the current position of the motor in the initial state; wherein the scanning data comprises: a scanning step length, a moving step length, a scanning number of times, and a first voltage value corresponding to the scanning starting point; a determination module 41, which is used to determine the scanning acceleration starting point voltage and the moving deceleration starting point voltage of the motor according to the scanning step length, the moving step length, the first voltage value, and the first acceleration value; a driving operation module 42, which is used to determine the scanning acceleration starting point voltage and the moving deceleration starting point voltage of the motor based on the current voltage, the scanning number of times, the scanning acceleration starting point voltage, the moving deceleration starting point voltage, and the preset first acceleration value. First, obtain the scanning deceleration starting voltage and the moving acceleration starting voltage to drive the motor to run; wherein, when the motor decelerates from the moving deceleration starting position indicated by the moving deceleration starting voltage to zero, the corresponding position is the scanning acceleration starting position indicated by the scanning acceleration starting voltage; when the motor accelerates from the scanning acceleration starting position to the scanning step length, the corresponding position is the scanning starting point; when the motor decelerates from the scanning deceleration starting position indicated by the scanning deceleration starting voltage to zero, the corresponding position is the moving acceleration starting position indicated by the moving acceleration starting voltage; when the motor accelerates from the moving acceleration starting position to the moving step length, the corresponding position is the uniform speed moving starting point.
[0110] The smooth driving device of the above-mentioned motor can determine the scanning acceleration starting voltage and moving deceleration starting voltage of the motor according to the acquired scanning data. Combined with the pre-acquired scanning deceleration starting voltage and moving acceleration starting voltage, it can realize smooth driving of the motor and ensure smooth starting and stopping of the motor, thereby avoiding damage to the mechanical structure of the motor and related electronic components.
[0111] Furthermore, the driving operation module is also used to: based on the first acceleration value and the current voltage, control the motor to accelerate from the current position, and when accelerating to the moving step length, move at a uniform speed according to the moving step length to the moving deceleration starting position indicated by the moving deceleration starting voltage; based on the first acceleration value and the moving step length, control the motor to decelerate from the moving deceleration starting position, wherein the corresponding position when the motor decelerates to zero is the scanning acceleration starting position indicated by the scanning acceleration starting voltage; based on the first acceleration value, control the motor to accelerate from the scanning acceleration starting position, wherein the corresponding position when the motor accelerates to the scanning step length is the scanning starting point; starting from the scanning starting point, control the motor to move at a uniform speed according to the scanning step length to scan the object to be measured; when moving to the scanning deceleration starting position indicated by the scanning deceleration starting voltage, control the motor to decelerate from the scanning deceleration starting position based on the first acceleration value, wherein the corresponding position when the motor decelerates to zero is the moving acceleration starting position corresponding to the moving acceleration starting voltage; using the moving acceleration starting voltage as the new current voltage and the moving acceleration starting position as the new current position, repeatedly executing the step of controlling the motor to accelerate from the current position based on the first acceleration value and the current voltage until the number of scans is reached.
[0112] Furthermore, the determination module is also used to: determine the scanning acceleration starting voltage of the motor according to the scanning step length, the first acceleration value and the first voltage value; determine the moving deceleration starting voltage of the motor according to the moving step length, the first acceleration value and the scanning acceleration starting voltage.
[0113] Furthermore, the determination module is also used to: calculate the number of accelerations corresponding to the motor accelerating from zero to the scanning step according to the scanning step and the first acceleration value; calculate the second voltage value corresponding to the acceleration number according to the acceleration number; and determine the scanning acceleration starting point voltage of the motor according to the second voltage value and the first voltage value.
[0114] Furthermore, the following formula is used to calculate the acceleration times:
[0115] MarkAccTimes=MarkStep / A;
[0116] Among them, MarkAccTimes represents the number of accelerations; MarkStep represents the scanning step length; A represents the first acceleration value; it should be noted that since MarkStep / A is not necessarily an integer, in order to facilitate code implementation, in actual applications, the first acceleration value A can be slightly adjusted to ensure that MarkAccTimes is an integer.
[0117] The second voltage value is calculated using the following formula:
[0118] Mark Acceleration=0.5×MarkAccTimes×(MarkAccTimes + 1);
[0119] Wherein, Mark Acceleration represents the second voltage value;
[0120] The scan acceleration starting voltage is calculated using the following formula:
[0121] MarkAccStartPos=VStart-Mark Acceleration;
[0122] Wherein, MarkAccStartPos represents the scan acceleration starting point voltage; VStart represents the first voltage value.
[0123] Furthermore, the determination module is also used to: calculate the number of deceleration times corresponding to the motor decelerating from the moving step length to zero based on the moving step length and the first acceleration value; calculate the third voltage value corresponding to the deceleration times based on the deceleration times; and calculate the moving deceleration starting voltage of the motor based on the third voltage value and the scanning acceleration starting voltage.
[0124] Furthermore, the following formula is used to calculate the number of decelerations:
[0125] JumpDecTimes=JumpStep / A;
[0126] Among them, JumpDecTimes represents the number of decelerations; JumpStep represents the moving step length; A represents the first acceleration value; it should be noted that, since JumpStep / A is not necessarily an integer, in order to facilitate code implementation, in actual applications, the first acceleration value A can be slightly adjusted to ensure that JumpDecTimes is an integer.
[0127] The third voltage value is calculated using the following formula:
[0128] Jump Deceleration=0.5×JumpecTimes×(JumpDecTimes + 1);
[0129] Wherein, Jump Deceleration represents the third voltage value;
[0130] Use the following formula to calculate the moving deceleration starting point voltage:
[0131] JumpDecStartPos=MarkAccStartPos+Jump Deceleration;
[0132] Among them, JumpDecStartPos represents the starting voltage of movement deceleration; MarkAccStartPos represents the starting voltage of scan acceleration.
[0133] Furthermore, the first acceleration value is determined using the following formula:
[0134] ;
[0135] Wherein, A represents the first acceleration value; k represents the peak value of the specified sine wave; Indicates the frequency of the specified sine wave; T is the preset value;
[0136] The designated sine wave is determined in the following manner: a plurality of sine waves are input to the motor drive board corresponding to the motor in order of frequency from low to high, and the sine wave at which harmonics begin to appear in the motion feedback waveform of the motor is determined as the designated sine wave.
[0137] The smooth driving device of the motor provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned smooth driving method embodiment of the motor. For the sake of brief description, for matters not mentioned in the embodiment of the smooth driving device of the motor, reference may be made to the corresponding contents in the aforementioned smooth driving method embodiment of the motor.
[0138] The present invention also provides an OCT device, such as Figure 5 As shown, the OCT device includes: FPGA50, motor drive board 51, motor 52, optical galvanometer 53 and light emitting module 54; wherein, the optical galvanometer 53 can emit reflected light at a specified angle, thereby realizing OCT imaging at a specified position.
[0139] FPGA50 is used to receive a driving instruction from a host computer, and execute any of the above-mentioned smooth driving methods of the motor according to the driving instruction, so as to drive the motor 52 to run through the motor driving board 51; wherein the driving instruction includes: scanning data corresponding to the motor 52;
[0140] The motor 52 is used to drive the optical galvanometer 53 to rotate, and the coherent light emitted by the light emitting module 54 is reflected to the object to be measured through the optical galvanometer 53, so as to scan the object to be measured and obtain a target image corresponding to the object to be measured.
[0141] In actual implementation, FPGA50 can receive the driving instructions sent by the host computer through the network port, execute the smooth driving method of the above-mentioned motor according to the driving instructions, continuously convert them into voltage signals, and transmit them to the motor driving board 51 through the digital-to-analog converter. The motor driving board 51 is responsible for receiving the voltage driving waveform and converting it into a position signal in the OCT scan to control the motor 52 to rotate the optical galvanometer 53 to the specified scanning position, and can also receive the motion feedback waveform of the motor 52 in real time; the input of the motor driving board is a voltage signal, and the feedback is also a voltage signal. The voltage signal input to the motor driving board is linear with the position signal of the motor, so the voltage The signal can be converted into the corresponding position signal. For example, if the input voltage signal is between -3V and +3V, then the feedback voltage signal is between -3V and +3V, and the corresponding motor position signal is between -3mm and 3mm, etc. The shape of the motion feedback waveform and the voltage signal input by the motor driver board are usually consistent. For example, the voltage signal input by the motor driver board is a sine wave, then the shape of the motor's motion feedback waveform is a sine wave, but due to the response delay, the motion feedback waveform will lag behind the voltage signal input by the motor driver board for a little time. This motion feedback waveform is collected by the motor driver board through the sensor and will eventually be transmitted to the FPGA.
[0142] The motor can drive the optical galvanometer to rotate by twisting the transmission shaft to achieve OCT surface scanning; different voltage signals input to the motor drive board can correspond to different motor position signals; different motor position signals correspond to the optical galvanometer rotating to different scanning positions; the light-emitting module can emit coherent light to reach the optical galvanometer, and when the optical galvanometer is twisted to a certain angle, the reflected light can form a scanning surface on the object to be measured, thereby imaging the object to be measured and obtaining the corresponding target image. The above-mentioned OCT device also includes a power supply module, which can power various components in the OCT device.
[0143] In specific applications, after the FPGA with the driving peripheral is powered on, the firmware with the algorithm of this scheme can be burned into the FPGA and connected to the motor driving board; the network cable is connected, and the host computer sends instructions to the FPGA through the network cable, so that the FPGA starts to output a smooth driving waveform and transmits it to the motor driving board through the driving peripheral; the motor driving board starts to drive the motor to run according to the driving waveform, and drives the optical galvanometer to rotate through the motor to refract the light source emitted by the light-emitting module; until the total number of steps in this instruction is executed, the motor will stop moving.
[0144] The embodiment of the present invention further provides an electronic device, see Figure 6 As shown, the electronic device includes a processor 130 and a memory 131 , wherein the memory 131 stores machine executable instructions that can be executed by the processor 130 , and the processor 130 executes the machine executable instructions to implement the above-mentioned smooth driving method of the motor.
[0145] Further, Figure 6 The electronic device shown further includes a bus 132 and a communication interface 133 , and the processor 130 , the communication interface 133 and the memory 131 are connected via the bus 132 .
[0146] The memory 131 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 133 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 132 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0147] The processor 130 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 130. The above processor 130 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 131, and the processor 130 reads the information in the memory 131 and completes the steps of the method of the above embodiment in combination with its hardware.
[0148] An embodiment of the present invention also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned smooth driving method of the motor. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0149] The computer program product of the motor smooth driving method, device and OCT device provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.
[0150] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for smoothly driving a motor, characterized in that: The method is applied to FPGA; the method comprises: Obtain scanning data corresponding to the motor, a preset first acceleration value, and a current voltage corresponding to the current position of the motor in the initial state; wherein the scanning data includes: a scanning step length, a moving step length, a scanning number, and a first voltage value corresponding to a scanning starting point; the current voltage is the current input voltage currently input by the FPGA to the motor driving board for driving the motor to run; the first voltage value is determined according to the position of the motor at the scanning starting point; the scanning starting point is the scanning position corresponding to when uniform speed scanning can be started at the scanning step length; Determine a scanning acceleration starting point voltage and a moving deceleration starting point voltage of the motor according to the scanning step length, the moving step length, the first voltage value and the first acceleration value; Based on the current voltage, the number of scans, the scan acceleration starting voltage, the movement deceleration starting voltage, and the pre-acquired scan deceleration starting voltage and movement acceleration starting voltage, the motor is driven to operate; Among them, when the motor decelerates from the moving deceleration starting position indicated by the moving deceleration starting voltage to zero, the corresponding position is the scanning acceleration starting position indicated by the scanning acceleration starting voltage; when the motor accelerates from the scanning acceleration starting position to the scanning step, the corresponding position is the scanning starting point; when the motor decelerates from the scanning deceleration starting position indicated by the scanning deceleration starting voltage to zero, the corresponding position is the moving acceleration starting position indicated by the moving acceleration starting voltage; when the motor accelerates from the moving acceleration starting position to the moving step, the corresponding position is the uniform speed moving starting point.
2. The method according to claim 1, characterized in that Based on the current voltage, the number of scans, the scan acceleration starting voltage, the movement deceleration starting voltage, and the pre-acquired scan deceleration starting voltage and movement acceleration starting voltage, the step of driving the motor to run includes: Based on the first acceleration value and the current voltage, control the motor to accelerate from the current position, and when accelerating to the moving step length, move at a uniform speed according to the moving step length to the moving deceleration starting position indicated by the moving deceleration starting voltage; Based on the first acceleration value and the moving step length, controlling the motor to start decelerating from the moving deceleration starting position, wherein the corresponding position when the motor decelerates to zero is the scanning acceleration starting position indicated by the scanning acceleration starting voltage; Based on the first acceleration value, controlling the motor to start accelerating from the scanning acceleration starting point, wherein the corresponding position when the motor accelerates to the scanning step length is the scanning starting point; Starting from the scanning starting point, controlling the motor to move at a uniform speed according to the scanning step length to scan the object to be measured; When the motor moves to the scanning deceleration starting position indicated by the scanning deceleration starting voltage, based on the first acceleration value, the motor is controlled to start decelerating from the scanning deceleration starting position, wherein the corresponding position when the motor decelerates to zero is the moving acceleration starting position corresponding to the moving acceleration starting voltage; The moving acceleration starting point voltage is used as the new current voltage, and the moving acceleration starting point position is used as the new current position, and the step of controlling the motor to accelerate from the current position based on the first acceleration value and the current voltage is repeatedly executed until the scanning number is reached.
3. The method according to claim 1, characterized in that The step of determining a scanning acceleration starting point voltage and a moving deceleration starting point voltage of the motor according to the scanning step length, the moving step length, the first voltage value and the first acceleration value comprises: Determining a scanning acceleration starting point voltage of the motor according to the scanning step length, the first acceleration value and the first voltage value; The movement deceleration starting point voltage of the motor is determined according to the movement step length, the first acceleration value and the scanning acceleration starting point voltage.
4. The method according to claim 3, characterized in that The step of determining the scanning acceleration starting point voltage of the motor according to the scanning step length, the first acceleration value and the first voltage value comprises: Calculating the number of accelerations corresponding to the motor accelerating from zero to the scanning step length according to the scanning step length and the first acceleration value; According to the acceleration times, calculating a second voltage value corresponding to the acceleration times; A scanning acceleration starting point voltage of the motor is determined according to the second voltage value and the first voltage value.
5. The method according to claim 4, characterized in that The acceleration times are calculated using the following formula: MarkAccTimes=MarkStep / A; Wherein, MarkAccTimes represents the acceleration times; MarkStep represents the scanning step length; A represents the first acceleration value; The second voltage value is calculated using the following formula: Mark Acceleration=0.5×MarkAccTimes×(MarkAccTimes + 1); Wherein, Mark Acceleration represents the second voltage value; The scanning acceleration starting point voltage is calculated using the following formula: MarkAccStartPos=VStart-Mark Acceleration; Wherein, MarkAccStartPos represents the scan acceleration starting point voltage; VStart represents the first voltage value.
6. The method according to claim 3, characterized in that: The step of determining the movement deceleration starting voltage of the motor according to the movement step length, the first acceleration value and the scanning acceleration starting voltage comprises: Calculating the number of deceleration times corresponding to the motor decelerating from the moving step length to zero according to the moving step length and the first acceleration value; According to the deceleration times, calculating a third voltage value corresponding to the deceleration times; The movement deceleration starting voltage of the motor is calculated based on the third voltage value and the scanning acceleration starting voltage.
7. The method according to claim 6, characterized in that The deceleration times are calculated using the following formula: JumpDecTimes=JumpStep / A; Wherein, JumpDecTimes represents the deceleration times; JumpStep represents the moving step length; A represents the first acceleration value; The third voltage value is calculated using the following formula: Jump Deceleration=0.5×JumpDecTimes×(JumpDecTimes + 1); Wherein, Jump Deceleration represents the third voltage value; The moving deceleration starting point voltage is calculated using the following formula: JumpDecStartPos=MarkAccStartPos+Jump Deceleration; Wherein, the JumpDecStartPos represents the movement deceleration starting point voltage; and the MarkAccStartPos represents the scan acceleration starting point voltage.
8. The method according to claim 1, characterized in that The first acceleration value is determined using the following formula: ; Wherein, A represents the first acceleration value; k represents the peak value of the specified sine wave; Indicates the frequency of the specified sine wave; T is a preset value; The designated sine wave is determined in the following manner: a plurality of sine waves are input into the motor drive board corresponding to the motor in order of frequency from low to high, and the sine wave when harmonics begin to appear in the motion feedback waveform of the motor is determined as the designated sine wave.
9. A smooth driving device for a motor, characterized in that: The device is arranged in FPGA; the device comprises: An acquisition module is used to acquire scanning data corresponding to the motor, a preset first acceleration value, and a current voltage corresponding to the current position of the motor in an initial state; wherein the scanning data includes: a scanning step length, a moving step length, a scanning number, and a first voltage value corresponding to a scanning starting point; the current voltage is the current input voltage currently input by the FPGA to the motor driving board for driving the motor to run; the first voltage value is determined according to the position of the motor at the scanning starting point; the scanning starting point is the scanning position corresponding to when uniform speed scanning can be started at the scanning step length; A determination module, configured to determine a scanning acceleration starting point voltage and a moving deceleration starting point voltage of the motor according to the scanning step length, the moving step length, the first voltage value, and the first acceleration value; A driving operation module, used for driving the motor to operate based on the current voltage, the number of scans, the scan acceleration starting voltage, the movement deceleration starting voltage, and the scan deceleration starting voltage and the movement acceleration starting voltage acquired in advance; Among them, when the motor decelerates from the moving deceleration starting position indicated by the moving deceleration starting voltage to zero, the corresponding position is the scanning acceleration starting position indicated by the scanning acceleration starting voltage; when the motor accelerates from the scanning acceleration starting position to the scanning step, the corresponding position is the scanning starting point; when the motor decelerates from the scanning deceleration starting position indicated by the scanning deceleration starting voltage to zero, the corresponding position is the moving acceleration starting position indicated by the moving acceleration starting voltage; when the motor accelerates from the moving acceleration starting position to the moving step, the corresponding position is the uniform speed moving starting point.
10. An OCT device, characterized in that: The OCT device includes: FPGA, motor drive board, motor, optical galvanometer and light-emitting module; The FPGA is used to receive a driving instruction from a host computer, and execute the smooth driving method of the motor according to any one of claims 1 to 8 according to the driving instruction, so as to drive the motor to operate through the motor driving board; wherein the driving instruction includes: scanning data corresponding to the motor; The motor is used to drive the optical galvanometer to rotate, and the coherent light emitted by the light emitting module is reflected to the object to be measured through the optical galvanometer, so as to scan the object to be measured and obtain a target image corresponding to the object to be measured.
Citation Information
Patent Citations
Optical mechanical scanning control device and motor control method
CN115931125A
Laser direct platemaking scanning control method and system and related equipment
CN117192905A