A self-adaptive interpupillary distance and focal length adjustment control method based on motor driving
Patent Information
- Application Number
- CN202611035561.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-13
- Publication Date
- 2026-09-22
AI Technical Summary
[0005]综上所述,现有技术中缺乏一种在保证图像稳定、不引入倾斜重影的前提下,能够有机协同瞳距闭环调节与焦距混合搜索,同时补偿温度影响并抵御冲击扰动的自适应调节方法
[0016]本申请能够根据选择的用户标识快速调取预先存储的瞳距参数与焦距参数,并驱动机构直接到达对应位置作为调节基准,显著减少重复调节时间,实现“一键”个性化适配。
Smart Images

Figure CN122794618A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of adaptive adjustment technology for optical instruments, and more specifically, to an adaptive pupil distance and focal length adjustment control method based on motor drive. Background Technology
[0002] In binocular optical instruments, the adjustment of interpupillary distance and focal length are fundamental to user experience and observation accuracy. Traditional adjustment methods primarily rely on manual dials or knobs, requiring users to repeatedly try and subjectively judge to find a suitable position. This method is not only time-consuming but also depends on individual experience and visual perception, which varies greatly among different users. It is difficult to achieve rapid and precise alignment of the optical axis with the center of the pupil, and the accuracy and consistency of adjustment cannot be guaranteed.
[0003] To address the shortcomings of manual adjustment, various automatic or semi-automatic interpupillary distance (IPD) adjustment solutions have been proposed in the industry. Some solutions indirectly adapt to the user's IPD by rotating the entire lens barrel or deflecting the prism assembly to alter the optical path. However, these methods of introducing optical element rotation or deflection can easily produce additional image tilt or ghosting during imaging, especially noticeable at the periphery of the field of view, reducing observation comfort and measurement reliability. Furthermore, most automatic IPD adjustment devices only focus on the geometric alignment of the eyepiece distance, neglecting the refractive differences between users. That is, the user's myopia, hyperopia, or presbyopia is not compensated for synchronously, resulting in blurry images even when the IPD is aligned, requiring the user to manually refocus.
[0004] Regarding adaptive focus adjustment, current solutions include active refraction-based approaches, such as displaying a pattern for user confirmation, and passive image analysis to find contrast peaks. However, existing devices typically treat interpupillary distance (IPD) and focus adjustment as two completely independent subsystems, failing to effectively link them and lacking a hybrid search mechanism that reliably converges to optimal vision under interference conditions. Furthermore, many optical instruments require operation in harsh environments such as extreme cold and high-impact conditions, such as outdoor thermal imagers. Low temperatures increase grease viscosity, significantly increasing mechanical resistance, making conventional drive signals prone to insufficient driving force or adjustment stagnation; while high-impact conditions can cause displacement of already adjusted mechanisms, leading to IPD or focus parameter drift. Existing adjustment methods do not incorporate specific control strategies designed for these environmental factors.
[0005] In summary, existing technologies lack an adaptive adjustment method that can organically coordinate closed-loop interpupillary distance adjustment and hybrid focus search while ensuring image stability, avoiding the introduction of tilt ghosting, compensating for temperature effects, and resisting shock disturbances. How to achieve rapid, accurate, and personalized adaptive matching of interpupillary distance and focus in a wide temperature range and under vibration and shock environments has become an urgent technical problem to be solved. Summary of the Invention
[0006] This application provides an adaptive interpupillary distance and focal length adjustment control method based on motor drive, which at least solves the problems existing in the prior art.
[0007] A first aspect of this application provides an adaptive interpupillary distance and focal length adjustment control method based on motor drive, comprising the following steps: S1: Real-time acquisition of images including both pupils using a near-eye vision sensor; S2: Calculate the current interpupillary distance based on the image and compare it with the target interpupillary distance to generate an interpupillary distance deviation value; S3: Based on the interpupillary distance deviation value and the encoder feedback position, a PID calculation is performed to generate the first drive signal, which drives the DC geared motor to move the left and right eyepiece sliders toward or away from each other via a gear and rack, thus performing closed-loop interpupillary distance adjustment. S4: When the interpupillary distance deviation value enters the dead zone, the focus is automatically adjusted: the stepper motor is controlled to drive the compensation lens to move, the test pattern is displayed on the monitor to obtain the user's sharpness confirmation, and the virtual image contrast is analyzed by the auxiliary image sensor to search for the peak and determine the optimal viewing position. S5: Bind the focal length parameters corresponding to the current interpupillary distance and the best visual acuity to the user identifier and store them in non-volatile memory, and perform temperature compensation on the first drive signal and the stepper motor control signal according to the ambient temperature. S6: When the acceleration detected by the inertial measurement unit exceeds the threshold, a lock-up signal is generated to put the motor drive circuit into a lock-up state, maintaining the current interpupillary distance and focal length.
[0008] This application acquires pupil images using a visual sensor and calculates pupil distance deviation. Combined with encoder feedback, it forms a closed-loop PID adjustment for pupil distance. A DC geared motor, via a rack and pinion mechanism, enables pure translational movement of the eyepiece slider, avoiding image tilt and ghosting caused by optical component rotation. The adjustment process is smooth and the positioning is accurate. After the pupil distance is adjusted to the correct position, the focus adjustment is triggered, driving the compensation lens and using active confirmation and passive contrast analysis to search for the optimal viewing position, achieving coordinated adaptation between pupil distance and focus. The parameters are bound and stored with the user identifier, and the drive signal is compensated based on the ambient temperature. Simultaneously, an inertial measurement-based impact prediction and locking mechanism ensures stable optical parameters under wide temperature range and high vibration conditions, improving multi-user adaptation efficiency and observation experience.
[0009] In one or more embodiments of this application, performing closed-loop interpupillary distance adjustment in S3 specifically includes: S31: Generate friction feedforward compensation amount based on the current ambient temperature and the preset temperature-resistance model, and superimpose the feedforward compensation amount onto the basic control amount output by the PID calculation to obtain the first drive signal; S32: When the absolute value of the pupil distance deviation is lower than the first threshold, reduce the speed of the DC geared motor according to the preset deceleration curve until the deviation value enters the dead zone.
[0010] This application reduces regulation lag in low-temperature environments by superimposing a feedforward compensation amount generated based on a temperature-resistance model on the PID output, and reduces the motor speed according to the deceleration curve when the pupil distance deviation is small, which helps to avoid position overshoot and further improves the smoothness of regulation and positioning accuracy.
[0011] In one or more embodiments of this application, step S4 involves using a display to present a test pattern to obtain user sharpness confirmation and searching for peak values to determine the optimal viewing position, including: S41: Control the display to present at least one frame of sharpness test pattern, and detect the input signal associated with the confirmation operation. When the confirmation signal is received, record the current stepper motor position as a candidate visual position. S42: Control the stepper motor to move back and forth slightly on both sides of the candidate viewing position, and simultaneously use the auxiliary image sensor to acquire virtual images and calculate the contrast evaluation value of each position. By performing curve fitting on the discrete evaluation values, the peak point of contrast is obtained, and the position corresponding to the peak point is taken as the optimal viewing position.
[0012] This application first obtains the candidate viewing position confirmed by the user, and then searches for the peak value by slightly moving back and forth and fitting the contrast curve. This not only preserves the user's subjective judgment, but also optimizes the final position with the help of objective contrast analysis. It can take into account both adjustment speed and visual comfort, and improve the accuracy of determining the best viewing position.
[0013] In one or more embodiments of this application, step S7 is further included, which includes a manual dial hybrid control step, comprising: S71: Monitors the pulse signal generated by the manual dial. When a pulse is detected, it pauses the currently executing S3 automatic interpupillary distance adjustment or S4 automatic focus adjustment process. S72: Determine the direction of movement and displacement based on the pulse count and phase, and directly drive the DC geared motor or stepper motor corresponding to the currently activated adjustment channel to perform displacement. S73: After the dial remains inactive for more than a set time, update the current interpupillary distance and focal length parameters as manual correction values to the parameter area associated with the current user identifier in the non-volatile memory.
[0014] This application allows for the intervention and pause of the automatic adjustment process at any time by monitoring the pulse of the manual dial. The motor is directly driven to perform displacement based on the pulse, and the correction value is automatically stored after no operation. This achieves a smooth switch between automatic and manual modes, which retains the intuitiveness of traditional operation while meeting the needs of personalized fine-tuning.
[0015] In one or more embodiments of this application, the method further includes the following before S1: S01: Read the list of user identifiers stored in the non-volatile memory and display it on the screen; S02: In response to the user's selection command for a certain user identifier, retrieve the interpupillary distance and focal length parameters associated with that identifier, and control the DC geared motor and stepper motor to drive the eyepiece slider and the compensation lens to the positions corresponding to the parameters, which serve as the target interpupillary distance in S2 and the initial search starting position in S4.
[0016] This application can quickly retrieve pre-stored interpupillary distance and focal length parameters based on the selected user identifier, and drive the mechanism directly to the corresponding position as the adjustment reference, significantly reducing the time of repeated adjustment and achieving "one-click" personalized adaptation.
[0017] In one or more embodiments of this application, when a user selects to add a new user ID, the method further includes: S03: Execute the fully automatic process from S1 to S5 in sequence. In S5, bind the obtained pupil distance parameters and focal length parameters with the newly added user identifier and store them in non-volatile memory. At the same time, add the identifier to the user identifier list.
[0018] When adding a new user, this application can automatically execute the complete adaptive adjustment process of interpupillary distance and focal length, and bind and store the obtained parameters with the new identifier, eliminating the need for manual settings and simplifying the multi-user profile creation process.
[0019] In one or more embodiments of this application, the temperature compensation of the first drive signal and the stepper motor control signal based on the ambient temperature in step S5 includes: S51: Use a temperature sensor to collect ambient temperature and calculate the temperature compensation coefficient based on the stored temperature-mechanical resistance characteristic curve. S52: When generating the first drive signal and the stepper motor control signal, the corresponding temperature compensation coefficient is applied to the first drive signal and the stepper motor control signal in a multiplicative or additive manner to compensate for the loss of driving force caused by the increase in the viscosity of the lubricating grease at low temperatures.
[0020] This application uses ambient temperature collected by a temperature sensor and pre-stored temperature-mechanical resistance characteristic curves to calculate compensation coefficients, and corrects the drive signal in a multiplicative or additive manner. This can effectively compensate for the loss of driving force caused by the increase in lubricating grease viscosity at low temperatures, and ensure the consistency of adjustment performance over a wide temperature range.
[0021] In one or more embodiments of this application, generating the locking signal in step S6 specifically includes: S61: Perform sliding window filtering on the acceleration signal output by the inertial measurement unit and calculate the impact energy trend value; S62: When the impact energy trend value exceeds the warning threshold, a lock-up signal is generated in advance to control the drive bridge of the DC geared motor to enter the short-circuit braking state and control the stepper motor drive chip to output the rated holding current. S63: When the acceleration value is detected to return to below the safety threshold and remain below the preset duration, the lockout state is released and normal closed-loop regulation is restored.
[0022] This application performs sliding window filtering on the acceleration signal and calculates the impact energy trend value, which can trigger locking in advance before the impact occurs. The mechanism position is maintained by short-circuit braking and rated holding current, effectively preventing parameter drift caused by high impact, and automatically recovering and adjusting after the impact, thus improving the reliability of the equipment under harsh working conditions.
[0023] In one or more embodiments of this application, step S2 further includes a blinking and eye movement inhibition step: S21: Perform pupil state detection on the image to determine whether there is blinking or rapid scanning. S22: When a blinking or salivating state is detected, pause updating the pupil distance deviation value and maintain the pupil distance deviation value output of the previous effective cycle until a stable fixation state is detected.
[0024] This application pauses the update of the pupillary distance deviation value and maintains the previous valid output when blinking or rapid saccade is detected. This can avoid pupillary distance calculation errors and mechanism misadjustment caused by eye movements, and enhance the stability and anti-interference ability of the adjustment process.
[0025] In one or more embodiments of this application, the gear and rack mechanism in S3 has backlash, and the closed-loop interpupillary distance adjustment further includes a backlash adaptive compensation step: S33: Records the historical drive direction of the DC geared motor. When the new drive command direction is opposite to the historical direction, it is judged as a commutation event. Before the commutation event occurs, based on the number of backlash compensation pulses stored, an open-loop compensation pulse is inserted at the moment of direction switching to enable the motor to quickly pass through the backlash zone. S34: After the compensation pulse is executed, the actual displacement fed back by the encoder is obtained and compared with the ideal backlash-free displacement to obtain the backlash residual. When the backlash residual exceeds the preset tolerance, the number of backlash compensation pulses stored is updated using the residual.
[0026] This application inserts open-loop compensation based on the stored backlash compensation pulse count during commutation, and iteratively updates the compensation amount using the displacement residual feedback from the encoder. This can eliminate the influence of gear transmission return error on pupil distance positioning accuracy and improve the consistency and accuracy of repeatable positioning.
[0027] In one or more embodiments of this application, step S4 involves analyzing the virtual image contrast using an auxiliary image sensor and searching for peak values to determine the optimal viewing position, including: S411: Controls the stepper motor to traverse the full range of the compensation lens in one step advance angle, and at each step, it acquires the virtual image area image output by the auxiliary image sensor, calculates the contrast evaluation value, and forms a discrete contrast curve. S412: Determine the maximum value region of the discrete contrast curve, and perform fine scanning within this region at a second step angle smaller than the first step angle to obtain dense evaluation values; S413: Perform quadratic curve fitting on the dense evaluation values, remove abnormal evaluation values that deviate from the fitted curve beyond the preset threshold, and then refit the curve. The position corresponding to the vertex of the final fitted curve is taken as the optimal view position for sub-step resolution.
[0028] This application employs a coarse scan to locate the maximum value region, followed by a fine scan with a smaller step angle. It then performs a quadratic curve fitting on the dense evaluation values, removes outliers, and refits the data. This achieves the best visual positioning accuracy at sub-step resolution, and improves both the anti-interference capability and the precision of the focus search.
[0029] In one or more embodiments of this application, when driving the left and right eyepiece sliders in step S3, a cross-coupling synchronization control step is further included: S35: Real-time acquisition of encoder feedback positions corresponding to the left and right eyepiece sliders, and calculation of the offset of the midpoint of the actual positions of the two sliders as the synchronization error; S36: Input the synchronization error into the synchronization compensation controller to generate compensation amounts that act on the speed loops of the left and right DC geared motors respectively. The compensation amounts for the left motor and the right motor have opposite signs and equal magnitudes. When the synchronization error is lower than the dead zone threshold, the compensation amount is set to zero to avoid frequent fluctuations in speed commands.
[0030] This application calculates the offset of the midpoint of the actual position of the left and right eyepiece sliders as the synchronization error, and generates compensation amounts with opposite signs and equal amplitudes for cross-coupling control. When the synchronization error is lower than the dead zone, the compensation amount is set to zero, which can ensure that the left and right eyepieces always maintain positional symmetry during the adjustment process and avoid pupillary distance error caused by asynchrony.
[0031] A second aspect of this application provides a motor-driven adaptive interpupillary distance and focal length adjustment control system, comprising: a vision sensor for acquiring binocular images; a left and right eyepiece distance adjustment mechanism consisting of a DC geared motor, a drive gear, and a rack and pinion slider, and an encoder for detecting the slider position; a compensation lens moving mechanism built into the eyepiece assembly and driven by a stepper motor; a display; an auxiliary image sensor; a temperature sensor; an inertial measurement unit; a non-volatile memory; a manual dial; and a control unit configured to execute a motor-driven adaptive interpupillary distance and focal length adjustment control method.
[0032] This application integrates components such as a vision sensor, a dual-motor drive mechanism, a temperature sensor, an inertial measurement unit, and a control unit, and is able to execute the aforementioned adaptive adjustment control method to achieve precise, rapid, and environmentally adaptable adjustment of interpupillary distance and focal length. Attached Figure Description
[0033] Figure 1 This is a flowchart illustrating an adaptive interpupillary distance and focal length adjustment control method based on motor drive, provided in an embodiment of this application. Detailed Implementation
[0034] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0035] In existing interpupillary distance (IPD) and focal length (FDM) adjustment schemes, manual adjustment relies on user experience and repeated attempts, which is time-consuming and makes it difficult to ensure precise alignment of the optical axis. Some automatic adjustment devices use rotating lens barrels or prism compensation to change the optical path, which can easily introduce image tilt and ghosting, affecting observation comfort and measurement accuracy. In addition, conventional equipment usually only focuses on geometric alignment when adjusting IPD, without simultaneously addressing the problem of blurred vision caused by differences in refractive power among different users, and lacks measures to cope with changes in mechanical resistance in low-temperature environments and easy parameter drift under high-impact conditions. The reasons for these problems are: the transmission method involves the rotation of optical elements, which disrupts the original imaging relationship; focal length adjustment and IPD adjustment are isolated from each other; the control strategy does not consider the impact of temperature on the drive system, nor does it include an anti-vibration holding mechanism.
[0036] To address this, this application provides a motor-driven adaptive interpupillary distance and focal length adjustment control method. It employs a pure translational rack and pinion transmission to change the eyepiece distance, avoiding optical tilt and ghosting. An infrared or TOF vision sensor and encoder are combined to form a closed-loop PID control for interpupillary distance, ensuring smooth alignment. Furthermore, a stepper motor drives a compensating lens, and an optimal focal length is automatically searched using a hybrid approach of active refraction and passive contrast analysis, achieving diopter adaptation. Multiple user parameters are stored in non-volatile memory, and temperature compensation and an inertial measurement-based impact prediction and locking strategy are incorporated to maintain stable optical parameters in a wide temperature range and high-vibration environments. This method only changes the eyepiece distance without rotating the optics, resulting in image stability. It can simultaneously achieve adaptive matching of interpupillary distance and focal length, and possesses personalized call-to-action and environmental robustness.
[0037] The technical solution of this application will be described in detail below with reference to specific embodiments.
[0038] To make the purpose, technical solution, and advantages of this application clearer, the following will be described in conjunction with the appendix. Figure 1 The following is an explanation using specific examples.
[0039] Please refer to Figure 1 , Figure 1 As a first aspect of the embodiments of this application, an adaptive interpupillary distance and focal length adjustment control method based on motor drive is provided, comprising the following steps: A first aspect of this application provides an adaptive interpupillary distance and focal length adjustment control method based on motor drive, comprising the following steps: S1: Real-time acquisition of images including both pupils using a near-eye vision sensor; S2: Calculate the current interpupillary distance based on the image and compare it with the target interpupillary distance to generate an interpupillary distance deviation value; S3: Based on the interpupillary distance deviation value and the encoder feedback position, a PID calculation is performed to generate the first drive signal, which drives the DC geared motor to move the left and right eyepiece sliders toward or away from each other via a gear and rack, thus performing closed-loop interpupillary distance adjustment. S4: When the interpupillary distance deviation value enters the dead zone, the focus is automatically adjusted: the stepper motor is controlled to drive the compensation lens to move, the test pattern is displayed on the monitor to obtain the user's sharpness confirmation, and the virtual image contrast is analyzed by the auxiliary image sensor to search for the peak and determine the optimal viewing position. S5: Bind the focal length parameters corresponding to the current interpupillary distance and the best visual acuity to the user identifier and store them in non-volatile memory, and perform temperature compensation on the first drive signal and the stepper motor control signal according to the ambient temperature. S6: When the acceleration detected by the inertial measurement unit exceeds the threshold, a lock-up signal is generated to put the motor drive circuit into a lock-up state, maintaining the current interpupillary distance and focal length.
[0040] In this embodiment, the near-eyepiece vision sensor involved in step S1 refers to an image acquisition device installed close to the eyepiece, capable of directly or indirectly capturing images of the user's eye area. This sensor can be an infrared camera, using an infrared light source for active illumination to obtain stable pupil images; or it can be a TOF ranging array, obtaining point cloud images containing depth information by measuring the flight time of emitted light pulses. The acquired image containing both pupils can be a two-dimensional grayscale image or a depth image containing three-dimensional spatial coordinates.
[0041] In step S2, calculating the current interpupillary distance (IPD) based on the image involves using an image processing algorithm to identify the center positions of the two pupils in an image containing both pupils and calculating the actual distance between the two centers. The image processing algorithm may include steps such as pupil region segmentation, edge detection, and ellipse fitting; this part utilizes existing algorithms. The target IPD is the desired IPD value, which can be derived from pre-stored user parameters or manually input settings. The IPD deviation value is the difference between the current IPD and the target IPD, used to characterize the degree and direction of deviation of the current IPD relative to the target.
[0042] In step S3, the encoder feedback position refers to the position signal detected in real time by the encoder installed on the output shaft of the DC geared motor or the slider's travel path. This position signal reflects the actual displacement of the eyepiece slider. PID operation refers to the proportional-integral-derivative control algorithm, whose inputs are the interpupillary distance deviation value and the deviation determined by the encoder feedback position, and whose output is the first drive signal. The first drive signal is a control signal used to drive the DC geared motor, which can be the duty cycle of a PWM signal or an analog voltage. The DC geared motor refers to a DC motor with a reduction gearbox, which outputs high torque and low speed. The drive gear of the rack and pinion drive is installed on the motor output shaft and meshes with the rack fixed on the eyepiece slider, converting the rotational motion of the gear into the linear motion of the rack and slider. The left and right eyepiece sliders moving towards or away from each other means that the two sliders move in opposite directions; moving towards each other reduces the distance, and moving away from each other increases the distance. Interpupillary distance closed-loop adjustment refers to the complete closed loop of the entire control loop, including sensor measurement, deviation calculation, controller output, actuator action, and position feedback.
[0043] In step S4, the pupillary distance deviation value enters the dead zone, meaning the absolute value of the pupillary distance deviation decreases to a preset small threshold range. At this point, the pupillary distance is considered to be basically adjusted, and no further fine-tuning is needed to avoid frequent motor jitter near the target position. Triggering automatic focus adjustment means using the signal indicating completion of pupillary distance adjustment as one of the conditions for starting the focus adjustment process; the two form a sequential logic. The compensation lens is a movable optical lens located inside the eyepiece assembly, which compensates for different users' refractive errors by changing its axial position. The stepper motor drives the compensation lens to move, meaning that after receiving a pulse signal, the stepper motor rotates through a fixed angle, and the rotation is converted into linear displacement of the compensation lens through a lead screw or other transmission. The display shows the test pattern, meaning that a specific graphic is output as a visual target using the device's built-in micro-display, which can be a grid, letters, or a dot matrix pattern. Obtaining user clarity confirmation means that the user observes the test pattern and sends a confirmation signal through buttons, gestures, or voice, indicating that the current clarity has reached a satisfactory level. This method based on user subjective judgment can be called active refraction. Analyzing virtual image contrast using an auxiliary image sensor refers to capturing a virtual image formed by an optical system using an additional image sensor and calculating an evaluation value of the degree of difference in grayscale values of each pixel in the image. Higher contrast generally means a clearer image. The process of searching for the contrast peak can be called passive focusing. Determining the optimal focal length position by searching for the peak means driving the compensation lens to traverse or search different positions to find the position where the contrast evaluation value is maximized, which is the optimal focal length position for the current user's refractive power.
[0044] In step S5, the focal length parameters corresponding to the current interpupillary distance and optimal visual acuity refer to the actual interpupillary distance and compensation lens position values achieved after adjustments in S3 and S4, respectively. The user identifier refers to the identity information used to distinguish different users, which can be a numerical code, letter code, or biometric data. Binding and storing in non-volatile memory means establishing an association between the two parameters and the corresponding user identifier, and writing the data into a storage device where it is not lost after power failure. Temperature compensation for the first drive signal and stepper motor control signal based on ambient temperature means correcting the amplitude or pulse width of the output drive signal according to preset rules or models based on the ambient temperature measured by the temperature sensor, in order to offset the effects of temperature changes on mechanical resistance and lubrication characteristics.
[0045] In step S6, the inertial measurement unit (IMU) is a sensor module integrating inertial sensing devices such as accelerometers and gyroscopes, used to detect the acceleration and angular velocity of the device. Acceleration exceeding the threshold means that the acceleration amplitude output by the IMU or the processed impact characteristic value exceeds a preset safety limit. Generating a lock-up signal means outputting an enable or disable level to switch the operating mode of the motor drive circuit. The motor drive circuit entering the lock-up state means that the drive circuit short-circuits the motor windings or applies a specific current, causing the motor shaft to generate a large holding torque to resist rotation caused by external forces, thereby maintaining the current interpupillary distance and focal length unchanged.
[0046] In this embodiment, the pupil image acquired in S1 is the information source for the entire adjustment process. Only by accurately capturing eye information in real time can S2 reliably calculate the pupillary distance deviation value, providing correct input for subsequent closed-loop adjustment. The pupillary distance closed-loop adjustment performed in S3 is not an isolated operation; its drive signal incorporates encoder position feedback, constituting real-time monitoring and correction of motor movement. This allows the eyepiece slider to move smoothly and accurately to the target position, avoiding under-adjustment or over-adjustment that easily occurs when mechanical resistance changes in pure open-loop control. The focus adjustment in S4 is not started synchronously with S3, but is triggered only after the pupillary distance deviation value in S3 enters the dead zone. The purpose of this design is that the accuracy of refractive power compensation is based on the user's pupil being basically aligned with the eyepiece optical axis. If the pupillary distance is not aligned, the misalignment of the pupil relative to the optical axis will cause the light beam entering the eye to be deflected. At this time, even if the so-called contrast peak or sharpness confirmation point is found, the focus position may not be the true optimal visual acuity position after pupil alignment. Therefore, starting the focus search after the pupillary distance closed loop is in place can improve the reliability of determining the optimal visual acuity. The parameter storage and temperature compensation in S5 work synergistically to maintain and reproduce the entire adjustment chain. The current interpupillary distance and optimal viewing position are bound to the user's identifier and stored in non-volatile memory. This allows the device to quickly restore the user's personalized parameters after restarting or being used by another user, reducing repetitive full-range search time. Temperature compensation is integrated throughout the drive signal generation process of S3 and S4. When changes in ambient temperature alter the mechanical system's resistance, the drive signal is corrected to maintain the motor's response speed and positioning capability, ensuring consistent adjustment performance of the same set of control parameters at different temperatures. The impact lock in S6 forms a protective connection with the precise adjustments made in the preceding steps. After the interpupillary distance and focal length are finely adjusted in S3 and S4, the mechanical system is in a relatively accurate position. When the inertial measurement unit detects acceleration exceeding the threshold, indicating a potential drop or strong impact, a lock signal is generated, putting the motor drive circuit into a high holding torque state. This reduces the probability of external impacts causing the eyepiece slider or compensating lens to deviate from its set position, preventing the completed adjustment parameters from instantly becoming invalid. After the impact ends, the lock is released, and the system resumes normal closed-loop regulation without having to re-execute the complete regulation process, thereby improving the equipment's adaptability to dynamic and harsh operating conditions.
[0047] In one or more embodiments of this application, the method further includes the following before S1: S01: Read the list of user identifiers stored in the non-volatile memory and display it on the screen; S02: In response to the user's selection command for a certain user identifier, retrieve the interpupillary distance and focal length parameters associated with that identifier, and control the DC geared motor and stepper motor to drive the eyepiece slider and the compensation lens to the positions corresponding to the parameters, which serve as the target interpupillary distance in S2 and the initial search starting position in S4.
[0048] In one or more embodiments of this application, when a user selects to add a new user ID, the method further includes: S03: Execute the fully automatic process from S1 to S5 in sequence. In S5, bind the obtained pupil distance parameters and focal length parameters with the newly added user identifier and store them in non-volatile memory. At the same time, add the identifier to the user identifier list.
[0049] In this embodiment, S01, which involves reading the list of user identifiers stored in the non-volatile memory, refers to the control unit retrieving all previously saved user identification information from a storage device that retains data even when power is off. These user identifiers can be the user's initials, numerical serial numbers, or preset avatar icons. Presenting the list on a display means displaying the extracted user identifier list on the device's built-in micro-display screen or an external display interface for the user to browse and select.
[0050] In S02, responding to a user's selection command for a specific user identifier means that the control unit receives a confirmation signal from the user via buttons, touchscreen, dial, or voice, pointing to a specific user identifier in the list. Retrieving the interpupillary distance and focal length parameters associated with that identifier means reading the interpupillary distance value and compensation lens position value bound to that user identifier from non-volatile memory. Controlling the DC geared motor and stepper motor to drive the eyepiece slider and compensation lens to the positions corresponding to the parameters means using the read interpupillary distance value as the command position for moving the eyepiece slider, driving the slider to that position by the DC geared motor; simultaneously, using the read focal length parameter as the command position for moving the compensation lens, driving the lens to that position by the stepper motor. As the target interpupillary distance in S2 and the initial search starting position in S4, it can be understood that the retrieved interpupillary distance parameter directly serves as the target value expected to be achieved by the closed-loop adjustment of interpupillary distance in S2, and the system does not need to set the target interpupillary distance through other means; while the retrieved focal length parameter provides a starting reference point for the automatic search process in S4. The stepper motor starts the search for contrast peak or sharpness confirmation from this position, instead of starting the scan from the full-range zero position of the compensation lens every time.
[0051] The new user identifier involved in S03 refers to the user choosing to create a new user identity identifier that has not been previously stored in the device. The fully automatic process, executing S1 to S5 sequentially, means that for this new user, the control unit performs a complete adaptive adjustment process from scratch, following the steps outlined above: first, it acquires a pupil image using a vision sensor and calculates the pupillary distance deviation; then, it performs closed-loop pupillary distance adjustment; once the pupillary distance is reached, it triggers automatic focus search and determines the optimal visual position; finally, it binds the obtained pupillary distance and focus parameters with the new user identifier and stores them in non-volatile memory, while simultaneously adding the identifier to the user identifier list so that it can be displayed and selected upon subsequent power-on.
[0052] In this embodiment, before acquiring the pupil image in S1, the user identifier list is read and presented in S01, and then the associated parameters are retrieved and the mechanism is driven into position according to the selection command in S02. This ensures that when the vision sensor starts working, the eyepiece slider and the compensation lens are already close to or in a suitable historical position for the user. At this time, the pupillary distance deviation value calculated in S2 is often small, and the pupillary distance closed-loop adjustment only needs to be fine-tuned to enter the dead zone, shortening the execution time of S3. Similarly, the focal length search in S4 starts from an initial search starting position close to the optimal visual acuity, significantly reducing the search range and the number of steps required, thus accelerating the focal length convergence speed. When the user selects to add a new user identifier, the fully automatic process initiated in S03 connects S1 to S5 into a complete profile creation process. This process no longer relies on any historical parameters, but instead completes the measurement and optimization of interpupillary distance and focal length from scratch, and binds the adjustment results with the newly added identifiers for storage. This mechanism enables the device to provide both rapid parameter reuse for old users and seamless full adaptation for new users in multi-user shared scenarios. The user identifier list continues to expand as the device is used, gradually forming a parameter database covering different individuals.
[0053] Understandably, the parameters retrieved in S02 are directly used as the target interpupillary distance in S2 and the initial search starting position in S4, so that historical data is not only passively stored, but actively participates in the initialization and efficiency improvement of the current adjustment process. The parameter storage stage in S5 writes the final result of each adjustment back to the non-volatile memory, forming a self-iterative optimization closed loop of parameters. When the same user uses the device multiple times, the parameters retrieved each time may be the result of the previous confirmation or optimization. The device's adaptation to the user will become more accurate and personalized as the number of uses increases, and the adjustment speed will also gradually improve.
[0054] In one or more embodiments of this application, step S2 further includes a blinking and eye movement inhibition step: S21: Perform pupil state detection on the image to determine whether there is blinking or rapid scanning. S22: When a blinking or salivating state is detected, pause updating the pupil distance deviation value and maintain the pupil distance deviation value output of the previous effective cycle until a stable fixation state is detected.
[0055] In this embodiment, S21 involves pupil state detection, which refers to analyzing the pupil images acquired by the visual sensor using image processing algorithms, extracting the morphological features and temporal change features of the pupil, and determining the current state of the user's eyes. Blinking can be understood as the state where the pupil is partially or completely obscured during eyelid closure; its image characteristics are characterized by a rapid decrease or even disappearance of the pupil area within a short period. Rapid saccades refer to the process of the eyeball rapidly moving between fixation points; its image characteristics are characterized by a significant abrupt change in the pupil center position between adjacent frames. Determining whether blinking or rapid saccades exists can be achieved by setting thresholds for the pupil area change rate and pupil center displacement; when a feature exceeds the corresponding threshold, the corresponding state is determined.
[0056] In S22, pausing the update of the pupillary distance deviation value means that when S21 detects a blink or saccade, the control unit stops sending the new pupillary distance deviation value calculated in the current cycle into the subsequent PID calculation stage, avoiding the generation of erroneous drive commands based on unreliable pupil data. Maintaining the pupillary distance deviation value output from the previous valid cycle means continuing to maintain the pupillary distance deviation value calculated and confirmed to be valid in the most recent stable gaze state as the current output value, so that the closed-loop adjustment circuit always obtains a relatively reliable deviation signal. Stable gaze state means that the pupil area, outline integrity, and center position remain within a certain tolerance range in several consecutive frames of images, indicating that the user is stably gazing at the target and that there are no significant dynamic changes in the eyes.
[0057] In this embodiment, S1 acquires images in real time, providing raw data for pupil state detection in S21. S21 performs real-time discrimination of the pupil state in the image, generating a state marker signal. This marker signal directly controls the update logic of the pupillary distance deviation value in S22, forming a processing link from image acquisition and state recognition to data validity judgment. When the user blinks or saccades during adjustment, S21 can promptly capture this state change. S22 then freezes the update of the pupillary distance deviation value and maintains the previous valid value output. After this processing, the pupillary distance deviation value received by S3 will not jump due to instantaneous eye movements, and the DC geared motor will not perform unnecessary start-stop or reversal following false deviation signals.
[0058] It is understandable that blinking and saccades are common physiological actions during use. If they are not suppressed, each blink may cause a momentary abnormality in the interpupillary distance calculation value, which will cause the motor to make frequent fine adjustments. This will not only reduce the smoothness of the adjustment, but may also cause repeated overshoots when approaching the target position.
[0059] From the perspective of the entire adjustment sequence, S21 and S22 construct a data validity filtering layer within the S2 stage. Only the interpupillary distance deviation value calculated under a stable gaze state is allowed to pass through the PID control loop of S3, while data determined to be during blinking or saccades is intercepted and replaced with historical valid values. This mechanism ensures that the closed-loop adjustment of S3 is always based on the interpupillary distance information that truly reflects the user's intention, making the adjustment process smoother. It also reduces the misjudgment of the triggering timing of the subsequent automatic focus adjustment in S4 due to interpupillary distance adjustment errors caused by physiological interference, thereby improving the reliability and user experience of the entire adaptive process from interpupillary distance adjustment to focus adjustment.
[0060] In one or more embodiments of this application, performing closed-loop interpupillary distance adjustment in S3 specifically includes: S31: Generate friction feedforward compensation amount based on the current ambient temperature and the preset temperature-resistance model, and superimpose the feedforward compensation amount onto the basic control amount output by the PID calculation to obtain the first drive signal; S32: When the absolute value of the pupil distance deviation is lower than the first threshold, reduce the speed of the DC geared motor according to the preset deceleration curve until the deviation value enters the dead zone; S33: Records the historical drive direction of the DC geared motor. When the new drive command direction is opposite to the historical direction, it is judged as a commutation event. Before the commutation event occurs, based on the number of backlash compensation pulses stored, an open-loop compensation pulse is inserted at the moment of direction switching to enable the motor to quickly pass through the backlash zone. S34: After the compensation pulse is executed, the actual displacement fed back by the encoder is obtained and compared with the ideal backlash-free displacement to obtain the backlash residual. When the backlash residual exceeds the preset tolerance, the stored number of backlash compensation pulses is updated using the residual. S35: Real-time acquisition of encoder feedback positions corresponding to the left and right eyepiece sliders, and calculation of the offset of the midpoint of the actual positions of the two sliders as the synchronization error; S36: Input the synchronization error into the synchronization compensation controller to generate compensation amounts that act on the speed loops of the left and right DC geared motors respectively. The compensation amounts for the left motor and the right motor have opposite signs and equal magnitudes. When the synchronization error is lower than the dead zone threshold, the compensation amount is set to zero to avoid frequent fluctuations in speed commands.
[0061] In this embodiment, S31 relates to a preset temperature-resistance model, which refers to the mapping relationship between ambient temperature and mechanical transmission system resistance established in advance through experimental calibration. This model can be a data lookup table or a fitted mathematical function. The friction feedforward compensation amount refers to the incremental drive signal used to compensate for the increase in resistance caused by the increased viscosity of lubricating grease at low temperatures, which is retrieved or calculated from the temperature-resistance model based on the current ambient temperature. The basic control amount refers to the control amount output by the PID calculation, calculated solely based on the pupil distance deviation value and the encoder feedback position. Superimposing the feedforward compensation amount onto the basic control amount can be understood as introducing a model-based feedforward component on the basis of PID feedback control. The sum of the two constitutes the first drive signal for the drive motor operation.
[0062] In S32, the first threshold refers to a preset boundary value for the absolute value of the interpupillary distance deviation. This value is greater than the dead zone threshold and is used to distinguish between the rapid approach phase and the fine-tuning deceleration phase. The preset deceleration curve refers to a pre-set speed plan where the motor speed smoothly decreases as the deviation value decreases. It can be a linear descent curve or an S-shaped gradual descent curve. Reducing the speed of the DC geared motor until the deviation value enters the dead zone aims to gradually reduce the slider movement speed as the interpupillary distance deviation gradually decreases, preventing position overshoot near the target position due to inertia or excessive control gain.
[0063] In S33, the historical drive direction refers to the polarity of the drive voltage or current applied to the DC geared motor in the previous control cycle, recorded as either positive or negative. The new drive command direction refers to the target motion direction determined after PID calculation or feedforward compensation in the current cycle. A commutation event refers to the situation where the new drive command direction is opposite to the historical direction. The backlash compensation pulse count refers to the number of additional drive pulses required to eliminate the backlash caused by tooth backlash in gear and rack transmissions; this value can be pre-measured and stored. Inserting open-loop compensation pulses means that, based on PID closed-loop control, during the extremely short time of direction switching, without responding to encoder feedback, the pulse signal is directly output according to the backlash compensation pulse count, driving the motor to quickly rotate through the backlash zone.
[0064] In S34, the ideal backlash-free displacement refers to the theoretically expected slider displacement based on the motor output angle, assuming no backlash in the transmission chain. Backlash residual refers to the difference between the actual displacement fed back by the encoder and the ideal backlash-free displacement, representing the amount of residual backlash after backlash compensation. The preset tolerance is the upper limit of the allowable backlash residual. When the backlash residual exceeds this limit, the stored backlash compensation pulse count is considered insufficient to accurately reflect the backlash under the current wear condition and needs to be updated. Updating the stored backlash compensation pulse count using the residual can be understood as converting the measured backlash residual into a corresponding pulse count correction amount to correct the stored backlash compensation pulse count.
[0065] In S35, the encoder feedback position corresponding to the left and right eyepiece sliders refers to the real-time position reading output by the encoders of each slider. The offset of the midpoint between the actual positions of the two sliders is the deviation of half of the sum of the position values of the two encoders relative to the theoretical midpoint position corresponding to the target pupil distance. The synchronization error, i.e., this offset, is used to measure the degree of asymmetry in the movement of the left and right sliders.
[0066] In S36, the synchronization compensation controller refers to a control algorithm that takes synchronization error as input and motor speed compensation as output. It can be a proportional controller or a proportional-integral controller. The compensation amounts for the left and right motors have opposite signs and equal magnitudes. This can be understood as the increase in speed compensation for one motor being equal to the decrease in speed compensation for the other motor, thus correcting the synchronization error without changing the overall approach speed. The dead zone threshold refers to the insensitive range for synchronization error. When the synchronization error is below the dead zone threshold, the compensation amount is set to zero, which avoids continuous small adjustments to the motor speed command caused by minor encoder noise or extremely small position fluctuations.
[0067] In this embodiment, the temperature feedforward compensation in S31 is combined with PID feedback control, so that the first drive signal includes both closed-loop correction capability for interpupillary distance deviation and pre-compensation capability for changes in mechanical resistance in low-temperature environments. In frigid environments, the increased viscosity of lubricating grease leads to increased drive resistance, and relying solely on PID feedback for adjustment may result in response lag or steady-state deviation. After the temperature feedforward compensation is superimposed, the motor obtains a reference drive force that adapts to the current environmental resistance at the beginning of the deviation. The PID calculation is then dynamically fine-tuned based on this, thereby maintaining good adjustment response speed and following accuracy over a wide temperature range. There is a temporal connection between the deceleration strategy in S32 and the backlash processing in S33 and S34. When the interpupillary distance deviation value enters within the first threshold, the motor reduces its speed according to the preset deceleration curve. At this time, the slider approaches the target position. Any backlash error caused by backlash will have a significant impact on the final positioning accuracy. If backlash exists during reversal, even if the PID output has changed direction, the slider will not respond immediately in the backlash region, and overshoot may have occurred by the time the backlash is eliminated. S33 detects commutation events and pre-inserts open-loop compensation pulses to enable the motor to quickly pass through the backlash zone, allowing the change in PID output direction to directly drive the slider movement, avoiding response delays caused by backlash during low-speed fine-tuning. S34 further iteratively updates the backlash compensation pulse count by comparing the actual displacement after compensation with the ideal displacement, enabling the backlash compensation amount to adaptively adjust with the long-term wear of the transmission mechanism, maintaining accurate response during commutation at different usage stages. The deceleration strategy and backlash compensation work together to improve the accuracy and consistency of the final interpupillary distance positioning. The cross-coupled synchronous control of S35 and S36 acts on another dimension, namely the coordination of the left and right movement. Interpupillary distance adjustment requires symmetrical movement of the two eyepiece sliders. Due to assembly differences, uneven wear, or dispersed motor characteristics, the left and right transmission chains may produce asynchronous movement when controlled independently by the PID, manifested as one side's slider leading and the other side lagging. S35 calculates the synchronization error in real time, and S36 generates a compensation amount with the opposite sign, incorporating the synchronization error into the adjustment of the motor speed command. When one side of the slider lags, positive compensation is applied to that side to increase speed, and negative compensation is applied to the other side to decrease speed, pushing both sides back to align without changing the overall approach speed. When the synchronization error is below the dead zone threshold, the compensation amount is set to zero to avoid unnecessary speed fluctuations due to minor encoder noise when symmetry requirements are already met. The four control methods—temperature feedforward, deceleration strategy, backlash compensation, and cross-coupling synchronization—simultaneously act on the closed-loop regulation loop of S3, synergistically improving the quality of interpupillary distance adjustment from the perspectives of drive force adaptation, speed planning, mechanical backlash handling, and dual-axis coordination.
[0068] In one or more embodiments of this application, step S4 involves using a display to present a test pattern to obtain user sharpness confirmation and searching for peak values to determine the optimal viewing position, including: S41: Control the display to present at least one frame of sharpness test pattern, and detect the input signal associated with the confirmation operation. When the confirmation signal is received, record the current stepper motor position as a candidate visual position. S42: Control the stepper motor to move back and forth slightly on both sides of the candidate viewing position, and simultaneously use the auxiliary image sensor to acquire virtual images and calculate the contrast evaluation value of each position. By performing curve fitting on the discrete evaluation values, the peak point of contrast is obtained, and the position corresponding to the peak point is taken as the optimal viewing position.
[0069] In this embodiment, the sharpness test pattern involved in S41 refers to a specific visual graphic output by the display for the user to judge the current sharpness of the virtual image. It can be a black and white striped pattern, or letters or geometric shapes with sharp edges. The input signal associated with the detection and confirmation operation refers to the input channel monitored by the control unit and bound to the user's confirmation action. This input signal can originate from level changes caused by button presses, confirmation commands output by the voice recognition module, or specific blinking patterns detected by the eye-tracking module. The candidate visual acuity position refers to the position value of the compensation lens where the stepper motor is located at the moment the user issues the confirmation signal. This position reflects a reference point where the user subjectively considers the sharpness acceptable.
[0070] In S42, micro-amplitude reciprocating movement refers to controlling the stepper motor to move back and forth within a small range before and after the candidate diopter position, with both the movement amplitude and step size being smaller than the parameters during full-range scanning. The auxiliary image sensor acquires a virtual image, which refers to using an additional image sensor independent of the main observation optical path to capture the virtual image formed by the optical system, obtaining an electronic image suitable for digital image analysis. The contrast ratio is a numerical indicator reflecting the degree of brightness difference in the image, obtained after image processing of the virtual image acquired by the auxiliary image sensor. It can use the variance of regional pixel grayscale as the evaluation value or the statistical value of edge gradient amplitude. Curve fitting refers to approximating the discrete contrast ratio values and their corresponding stepper motor positions using a mathematical model. This can be a quadratic polynomial fitting or a Gaussian function fitting. The contrast peak point is the stepper motor position corresponding to the highest contrast ratio value in the fitted curve; this position is considered the optimal focal plane for the current user's diopter.
[0071] In this embodiment, step S41 obtains a candidate viewing position through subjective user confirmation. This step utilizes the human visual system's comprehensive judgment ability on sharpness, enabling the compensation lens to be quickly moved to a relatively reasonable focal plane. However, subjective confirmation usually has a certain degree of uncertainty; the user may issue a confirmation signal within a relatively flat area of the contrast curve. There may be a slight deviation between the candidate position and the actual optimal viewing position. Step S42 performs a small-amplitude reciprocating movement based on the candidate viewing position, simultaneously using an auxiliary image sensor to acquire a virtual image and calculate the contrast evaluation value. Then, the contrast peak point is obtained through curve fitting. At this point, the objective contrast analysis further refines the search within the local area defined by the subjective confirmation, improving the accuracy of determining the optimal viewing position from the full or half-step level of the stepper motor to the sub-step level obtained by curve interpolation. This hybrid search method combining subjective and objective methods shortens the time required to scan the contrast one by one across the entire range and compensates for the positioning deviation that may result from purely relying on subjective confirmation.
[0072] Understandably, the coordination between S41 and S42 is also related to the closed-loop interpupillary distance adjustment result in S3. When the interpupillary distance deviation enters the dead zone, it triggers automatic focus adjustment. At this point, the user's pupil is basically aligned with the eyepiece's optical axis. The virtual image seen by the user when judging sharpness in S41 is formed under the condition that the interpupillary distance is basically correct. If the interpupillary distance is not aligned, pupillary deviation may introduce asymmetric aberrations, and the user's judgment of sharpness may deviate from the actual refractive power requirement, resulting in a deviation in the candidate diopter position. Therefore, entering the subjective confirmation process in S41 and the contrast refinement process in S42 after the interpupillary distance is correct can, to some extent, avoid errors in the starting point of the diopter search caused by interpupillary distance deviation, making the entire adaptive adjustment process logically connected and progressively advanced, forming a reliable relationship.
[0073] In one or more embodiments of this application, step S4 involves analyzing the virtual image contrast using an auxiliary image sensor and searching for peak values to determine the optimal viewing position, including: S411: Controls the stepper motor to traverse the full range of the compensation lens in one step advance angle, and at each step, it acquires the virtual image area image output by the auxiliary image sensor, calculates the contrast evaluation value, and forms a discrete contrast curve. S412: Determine the maximum value region of the discrete contrast curve, and perform fine scanning within this region at a second step angle smaller than the first step angle to obtain dense evaluation values; S413: Perform quadratic curve fitting on the dense evaluation values, remove abnormal evaluation values that deviate from the fitted curve beyond the preset threshold, and then refit the curve. The position corresponding to the vertex of the final fitted curve is taken as the optimal view position for sub-step resolution.
[0074] In this embodiment, the first step angle involved in S411 refers to the step angle of each movement of the stepper motor during the full-range scanning phase. This angle is relatively large, allowing for a faster traversal of the entire range of the compensation lens. The full range of the compensation lens refers to the entire range of movement of the compensation lens within the eyepiece group, corresponding to the refractive power range that the device can adapt to. The virtual image region image refers to a pre-defined portion of the image captured by the auxiliary image sensor, corresponding to the virtual image region of the eyepiece. Analyzing this region can reduce interference from background stray light. The contrast evaluation value is a numerical value reflecting the image clarity obtained by image processing of the virtual image region image. It can be the regional pixel grayscale variance or the spatial frequency response value. The discrete contrast curve is a curve composed of discrete data points formed by plotting or storing each sampling position and its corresponding contrast evaluation value as a data sequence. It is used to reflect the overall trend of contrast variation with the position of the compensation lens.
[0075] In S412, the maximum value region refers to a continuous interval with relatively high contrast evaluation values in the discrete contrast curve. This interval includes the global highest point of the curve or its nearest points. The second step angle is smaller than the first step angle, which can be understood as using a finer step size for sampling during the fine scanning stage compared to full-range scanning. For example, the second step angle can be a fraction of the first step angle to obtain a more precise correspondence between position and contrast. Dense evaluation values refer to the sequence of contrast evaluation values with smaller positional spacing obtained by resampling within the maximum value region using the second step angle.
[0076] In S413, quadratic curve fitting refers to using the least squares method to perform a quadratic polynomial mathematical approximation on dense evaluation values to obtain a continuous contrast-position curve model. Anomalies deviating from the fitted curve beyond a preset threshold refer to residuals between the actual evaluation value of individual data points and the predicted value of the fitted curve at that point exceeding a preset threshold. These anomalies may be caused by instantaneous changes in external light, sensor noise, or minor obstructions. Refitting after removing anomalies involves removing the anomaly data points from the dataset and refitting the curve on the remaining valid data to reduce the impact of interfering data on the fitting results. The position corresponding to the peak of the final fitted curve refers to the stepper motor position value corresponding to the maximum value obtained in the quadratic fitted curve. The optimal viewpoint position for sub-stepping resolution means that the accuracy of this position value is not limited by a single step angle of the stepper motor, but is calculated through fitting interpolation between two adjacent physical step positions, thus obtaining a resolution higher than that corresponding to the motor step angle.
[0077] In this embodiment, step S411 rapidly traverses the entire range with a first step angle. The purpose is not to directly locate the optimal viewing position, but rather to obtain the contrast change trend across the entire range and identify the approximate interval where the maximum value region is located. This stage sacrifices positional resolution for a shorter scan time, allowing the system to quickly eliminate irrelevant regions with low contrast. Step S412 follows the maximum value region identified in S411, performing intensive resampling within this limited interval with a second step angle. Since the scanning range has been significantly narrowed, even with a smaller step angle, the impact of the increased number of sampling points on the overall search time remains controllable. Intensive resampling provides a data foundation for subsequent accurate peak localization, allowing the details of contrast changes within the maximum value region to be fully displayed. Step S413, based on the first two steps, further improves the accuracy and robustness of peak localization through quadratic curve fitting and outlier removal. In actual acquisition, contrast evaluation values may exhibit individual deviations from the true trend due to various instantaneous interferences. If these deviations are not addressed during fitting, the peak of the fitted curve may be pulled away from the true peak value by these deviations. By removing abnormal residual data points and then refitting, the influence of these interferences can be suppressed to a certain extent, making the final determined optimal viewing position more accurately reflect the true contrast peak of the optical system. At the same time, quadratic curve fitting itself can interpolate between discrete sampling points, and the determined vertex position can fall within a physical step position, thereby achieving sub-step level positioning accuracy and compensating for the limitations of stepper motor discrete drive in terms of position resolution.
[0078] In one or more embodiments of this application, the temperature compensation of the first drive signal and the stepper motor control signal based on the ambient temperature in step S5 includes: S51: Use a temperature sensor to collect ambient temperature and calculate the temperature compensation coefficient based on the stored temperature-mechanical resistance characteristic curve. S52: When generating the first drive signal and the stepper motor control signal, the corresponding temperature compensation coefficient is applied to the first drive signal and the stepper motor control signal in a multiplicative or additive manner to compensate for the loss of driving force caused by the increase in the viscosity of the lubricating grease at low temperatures.
[0079] In this embodiment, the temperature sensor involved in S51 refers to a sensitive element used to measure ambient temperature. It can be a digital temperature sensor that directly outputs temperature values, or a thermistor used in conjunction with an analog-to-digital converter to indirectly obtain temperature values. Ambient temperature typically refers to the air temperature of the external space where the device is located, but can also be the temperature inside the device housing near the transmission mechanism. The stored temperature-mechanical resistance characteristic curve refers to the corresponding relationship data of the driving force required by the transmission system at different temperatures, obtained through pre-calibration experiments. This data can be stored in non-volatile memory in tabular form, or in the form of a piecewise linear function or a polynomial fitting function. The temperature compensation coefficient is a numerical factor used to correct the driving signal, retrieved or calculated from the temperature-mechanical resistance characteristic curve based on the current ambient temperature.
[0080] In S52, applying the corresponding temperature compensation coefficient multiplicatively to the control quantity can be understood as multiplying the basic control quantity output by the PID calculation or other control algorithm by the temperature compensation coefficient. When the coefficient is greater than 1, the control quantity increases; when the coefficient is equal to 1, it remains unchanged. Applying the temperature compensation coefficient additively to the control quantity can be understood as directly adding a temperature-related offset to the basic control quantity. This offset can be positive to increase the driving force or negative to decrease the driving force. The driving force loss due to increased grease viscosity at low temperatures refers to the phenomenon where, as the ambient temperature decreases, the grease used in the transmission mechanism becomes less fluid and its viscous resistance increases significantly, leading to a decrease in the effective driving force actually output by the motor under the same driving signal, resulting in a reduction in the movement speed of the slider or lens, or even jamming.
[0081] In this embodiment, S51 and S52 are not independent adjustment processes, but rather common compensation links embedded in the drive signal generation links of S3 and S4. Whether it is the first drive signal generated during pupil distance adjustment to drive the DC geared motor, or the control signal generated during focal length adjustment to drive the stepper motor, before the signal is output to the motor drive circuit, both undergo the processing of S51 to collect the ambient temperature and calculate the temperature compensation coefficient, and then S52 to apply the compensation coefficient to the corresponding control quantity.
[0082] It is understandable that while both temperature compensation and friction feedforward compensation in S31 involve responding to ambient temperature, their functional levels and implementation methods differ. S31 focuses on superimposing a feedforward component on the PID basic control quantity of the interpupillary distance closed-loop regulation. The calculation of this feedforward component relies on the temperature-resistance model, aiming to directly compensate for the resistance increment caused by low temperature from the control structure. S51 and S52, on the other hand, provide a more general temperature compensation method, covering both the interpupillary distance regulation drive signal and the focal length regulation drive signal. They can be implemented using multiplicative or additive methods, and their temperature compensation coefficients can reuse the same set of temperature-mechanical resistance characteristic curves, thus ensuring the overall adaptability of the entire device's driving capability over a wide temperature range and reducing inconsistencies in regulation performance caused by uncompensated local components.
[0083] In one or more embodiments of this application, generating the locking signal in step S6 specifically includes: S61: Perform sliding window filtering on the acceleration signal output by the inertial measurement unit and calculate the impact energy trend value; S62: When the impact energy trend value exceeds the warning threshold, a lock-up signal is generated in advance to control the drive bridge of the DC geared motor to enter the short-circuit braking state and control the stepper motor drive chip to output the rated holding current. S63: When the acceleration value is detected to return to below the safety threshold and remain below the preset duration, the lockout state is released and normal closed-loop regulation is restored.
[0084] In this embodiment, the sliding window filtering involved in S61 refers to taking a fixed-length data sequence that is temporally adjacent to the continuous acceleration sample values output by the inertial measurement unit as a window, and performing mean or weighted average processing on the data within the window to suppress instantaneous spike noise. The impact energy trend value is an index obtained after sliding window filtering that reflects the magnitude of the continuously accumulated energy of the impact. This trend value can be the moving average of the square of the acceleration signal or the integral value of the acceleration amplitude within the window. Compared with directly using the instantaneous acceleration value, the impact energy trend value can more effectively capture the overall severity of the impact event, while reducing the possibility of false triggering caused by a single glitch signal.
[0085] In S62, the warning threshold refers to a pre-set threshold for judging the impact energy trend value. When the impact energy trend value exceeds this threshold, it is considered that an impact event that may cause the mechanism to shift is about to occur or is occurring. Pre-generating a locking signal can be understood as issuing a protection command based on the growth characteristics of the trend value before the impact fully acts on the mechanical structure, in order to gain response time. Short-circuit braking state refers to short-circuiting the two winding terminals of the DC geared motor together through the switching device of the drive bridge. When the motor rotor rotates under external force, it generates a back electromotive force and forms a braking current, thereby generating a torque that opposes rotation to maintain the current interpupillary distance. Rated holding current refers to the current value output by the stepper motor driver chip used to generate a continuous holding torque for the stepper motor rotor in a stationary state. This current value is usually given in the stepper motor's datasheet and can be applied for a long time without causing overheating.
[0086] In S63, the safety threshold refers to an acceleration amplitude threshold below the warning threshold, used to determine whether the impact event has ended and whether the equipment has returned to a relatively stable environment. The continuous preset duration refers to the length of time the acceleration value must remain below the safety threshold; this duration is set to avoid repeated threshold crossings caused by residual vibrations after the impact. Releasing the lockout state means canceling the short-circuit braking and rated holding current, returning control of the motor drive circuit to the normal closed-loop regulation loop. Resuming normal closed-loop regulation means that the interpupillary distance PID adjustment and focus search process re-enter the operating state.
[0087] In this embodiment, during the execution of S3 and S4, the pupil distance and focal length positions achieved through fine adjustment need to be effectively maintained under external impact. S61 quickly identifies the impact situation at the initial stage of the impact through sliding window filtering and impact energy trend value calculation, providing a trigger basis for S62. S62 generates a locking signal in advance when the impact energy trend value exceeds the warning threshold, and adopts a holding strategy that matches the structural characteristics of the two types of motors: DC geared motors use short-circuit braking, using their rotor inertial back EMF to establish a counteracting torque; stepper motors use their static torque characteristics to output rated holding current to lock the rotor in the current position. The combined effect of the two strategies is that the motor has entered a high impedance state before or at the beginning of the impact propagation to the transmission mechanism. S63 is responsible for the recovery judgment after the impact. It releases the lock only after detecting that the acceleration has recovered to below the safety threshold and remains below it for a certain period of time. This delayed recovery mechanism helps to avoid repeated locking and unlocking oscillations caused by residual vibration after the impact. After the lock is released, the system resumes normal closed-loop adjustment. If the impact has caused a slight positional shift, the closed-loop adjustment loop will automatically correct itself after recovery. The entire lock-up process, from prediction and execution to release, is asynchronously coordinated with the pupil distance and focal length adjustment processes in time. Locking is not performed during adjustment, and adjustment is paused during lock-up. The two processes run alternately without conflict, ensuring adjustment accuracy while also taking into account the responsiveness to sudden impacts.
[0088] In one or more embodiments of this application, step S7 is further included, which includes a manual dial hybrid control step, comprising: S71: Monitors the pulse signal generated by the manual dial. When a pulse is detected, it pauses the currently executing S3 automatic interpupillary distance adjustment or S4 automatic focus adjustment process. S72: Determine the direction of movement and displacement based on the pulse count and phase, and directly drive the DC geared motor or stepper motor corresponding to the currently activated adjustment channel to perform displacement. S73: After the dial remains inactive for more than a set time, update the current interpupillary distance and focal length parameters as manual correction values to the parameter area associated with the current user identifier in the non-volatile memory.
[0089] In this embodiment, the manual dial involved in S71 refers to a rotary input device mounted on the device housing that can be directly operated by hand. It can be a photoelectric encoder dial or a mechanical contact pulse generator dial. The pulse signal refers to a sequence of electrical signals output when the manual dial rotates, containing information about the rotation angle and direction; it typically consists of two square wave signals with a phase difference. Pausing the currently executing S3 automatic pupil distance adjustment or S4 automatic focus adjustment process can be understood as the control unit interrupting the operation of the automatic closed-loop adjustment algorithm, switching motor control from automatic adjustment logic to manual response logic. However, the system continues to monitor sensor signals and motor status; it does not cut off the power or completely stop working.
[0090] In S72, pulse counting refers to the cumulative count of pulses received by S71. This count reflects the angle rotated by the manual dial or the displacement amplitude desired by the user. Phase refers to the lead and lag relationship between two pulse signals in terms of timing. By determining the phase sequence, the rotation direction of the dial can be determined, thus determining the direction of movement. Displacement refers to the target movement distance calculated based on the pulse count and the preset displacement corresponding to a unit pulse. Direct drive means that the direction and displacement determined by the pulse count and phase are directly converted into motor drive commands to drive a DC geared motor or stepper motor to perform displacement, without going through PID closed-loop calculation or focal length search algorithm.
[0091] In S73, "Dial inactivity exceeding a set time" means that no new pulses are received after a preset silence period from the last detected pulse signal. The set time can be an empirical value between 2 and 5 seconds, for example, 3 seconds. "Current interpupillary distance and focal length parameters" refer to the actual interpupillary distance position value fed back by the encoder and the current focal length position value of the stepper motor. "Manual correction value" refers to the parameter value determined by the user through manual dial intervention, which differs from the automatic adjustment result. "Update to the parameter area associated with the current user ID in non-volatile memory" means writing the manual correction value to the storage area bound to that user ID in non-volatile memory, overwriting the previously saved automatic adjustment parameter value, so that the corrected parameters can be directly recalled the next time the user uses the device.
[0092] Those skilled in the art will understand that automatic adjustment processes provide rapid adaptation capabilities without manual intervention for most usage scenarios. However, users may have personalized fine-tuning needs in certain situations, such as making slight increases or decreases in the automatic adjustment results based on their daily vision or observation habits. In this application, S71 continuously monitors the dial pulses. Once user-initiated operation is detected, the automatic adjustment process is immediately paused, transferring control to the user. This pause mechanism avoids conflicting commands from the automatic adjustment algorithm and manual operation to the motor simultaneously. Only one of them has actual control over the motor at any given time. In S72, the pulse count and phase are interpreted as motor displacement commands and directly driven. The response path is short, and the latency is low. When the user rotates the dial, they can obtain a near-instantaneous following feel, consistent with traditional manual operation habits. In S73, after the dial remains silent for a set time, the current parameters are written back as manual correction values to the parameter area of the current user identifier in the non-volatile memory. This write-back action ensures that the result of manual intervention is not merely a one-time temporary adjustment, but is recorded as the user's updated adaptation parameters. Understandably, when the same user uses the device again, if the interpupillary distance and focal length parameters associated with that user identifier are retrieved via S02, the retrieved values will be the manually corrected and optimized values, rather than the initial automatic adjustment results. Thus, automatic adjustment provides an approximation benchmark, manual fine-tuning achieves personalized offset correction, and parameter storage completes experience accumulation. These three elements form a closed-loop human-machine collaboration mode of automatic adaptation, manual intervention, and memory iteration.
[0093] In one or more embodiments of this application, step S72 further includes: S721: Performs edge detection on two phase difference pulse signals, determines the rotation direction based on the order of the edges, and increments or decrements the pulse count to obtain the original pulse count value; S722: Calculates the target displacement based on the original pulse count value and the preset unit pulse displacement conversion coefficient, and distributes the target displacement to the corresponding DC geared motor or stepper motor according to the currently active adjustment channel (pupil distance channel or focal length channel); S723: Generates drive commands based on the target displacement. For DC geared motors, it outputs PWM signals to drive the motor to rotate at the corresponding speed. For stepper motors, it outputs a corresponding number of pulses and direction signals. At the same time, it reflects the rotation speed of the dial based on the pulse frequency, realizing real-time tracking of manual speed adjustment and dial rotation speed.
[0094] In this embodiment, the edge detection involved in S721 refers to simultaneously monitoring the level transitions of two phase difference pulse signals, using the rising or falling edge of one signal as a trigger to record the level state of the other signal at that moment. The rotation direction refers to the direction in which the manual dial is rotated. When the edge of one signal appears before the edge of the other, it is determined to be forward rotation; otherwise, it is determined to be reverse rotation. Incrementing or decrementing the count refers to incrementing or decrementing the pulse counter according to the determined rotation direction. The counter increments during forward rotation and decrements during reverse rotation. The original pulse count value is the current accumulated value of the counter, which can be positive or negative, reflecting the net rotation amount of the dial relative to its initial position.
[0095] In S722, the unit pulse displacement conversion factor refers to the pre-set motor displacement corresponding to each pulse. This factor can be a fixed constant or set separately according to different adjustment channels. The currently active adjustment channel refers to the adjustment object determined by the system based on the user's intention or mode selection; it can be an interpupillary distance adjustment channel or a focal length adjustment channel. Distributing the target displacement to the corresponding DC geared motor or stepper motor can be understood as follows: when the adjustment channel is interpupillary distance, the target displacement acts on the DC geared motor; when the adjustment channel is focal length, the target displacement acts on the stepper motor.
[0096] In the S723, the form of the drive command is related to the motor type: For a DC geared motor, a PWM signal with a certain duty cycle is output to drive its rotation to the number of revolutions corresponding to the target displacement, and position verification can be performed through encoder feedback; for a stepper motor, a corresponding number of pulses and direction signals are output, with the number of pulses corresponding to the number of steps and the direction signal controlling the direction of rotation. Reflecting the dial rotation speed based on pulse frequency means mapping the speed of the manual dial rotation to the frequency of the drive pulses. When the user rotates the dial quickly, the motor also follows at a higher speed, achieving real-time tracking between manual speed adjustment and the dial rotation speed.
[0097] In this embodiment, S721 converts the physical rotation of the dial into a digital count value with directional information. S722 further converts the count value into a target displacement with actual physical meaning based on the conversion factor and the current adjustment channel. S723 then converts the displacement into a specific drive command based on the motor type and executes it. This segmented processing structure allows signal analysis, channel allocation, and motor drive to be independent yet coordinated. For example, when switching adjustment channels, S722 only needs to change the allocated target motor, while S721 and S723 do not need to change the core logic, facilitating maintenance and expansion. From the coordination relationship between the steps after S72 and S71 and S73, S71 pauses the automatic adjustment process after detecting a pulse. At this time, S721 immediately begins edge detection and counting of subsequent pulses to ensure that every dial operation from the moment of pause is accurately captured. S722 allocates the displacement to the corresponding motor based on the currently active adjustment channel. This allocation mechanism forms a closed loop with the parameter write-back in S73: when the adjustment channel is interpupillary distance, the position of the DC geared motor is ultimately written to the non-volatile memory; when the adjustment channel is focal length, the position of the stepper motor is written. S723 adjusts the motor drive speed in real time based on the dial rotation speed, allowing for rapid motor response during quick coarse adjustments and smooth motor movement during slow fine adjustments. This provides a more intuitive operating experience than traditional manual adjustment. This speed mapping also helps avoid position overshoot or missing the optimal viewing point due to excessively fast movement during manual operation.
[0098] A second aspect of this application provides a motor-driven adaptive interpupillary distance and focal length adjustment control system, comprising: a vision sensor for acquiring binocular images; a left and right eyepiece distance adjustment mechanism consisting of a DC geared motor, a drive gear, and a rack and pinion slider, and an encoder for detecting the slider position; a compensation lens moving mechanism built into the eyepiece assembly and driven by a stepper motor; a display; an auxiliary image sensor; a temperature sensor; an inertial measurement unit; a non-volatile memory; a manual dial; and a control unit configured to execute a motor-driven adaptive interpupillary distance and focal length adjustment control method.
[0099] This application integrates components such as a vision sensor, a dual-motor drive mechanism, a temperature sensor, an inertial measurement unit, and a control unit, and is able to execute the aforementioned adaptive adjustment control method to achieve precise, rapid, and environmentally adaptable adjustment of interpupillary distance and focal length.
[0100] A third aspect of this application provides an electronic device, including: one or more processors, one or more input devices, one or more output devices, and one or more memories. The processors, input devices, output devices, and memories communicate with each other via a communication bus. The memories store computer programs, including program instructions. The processors execute the program instructions stored in the memories. Specifically, the processors are configured to invoke the program instructions to execute the aforementioned motor-driven adaptive interpupillary distance and focus adjustment control method.
[0101] It should be understood that in one or more embodiments of this application, the processor may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0102] Input devices may include touchpads, fingerprint sensors (for collecting the user's fingerprint information and fingerprint orientation information), microphones, etc., while output devices may include displays (LCDs, etc.), speakers, etc.
[0103] The memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also store information about the device type.
[0104] In specific implementations, the processor, input device, and output device described in one or more embodiments of this application can execute the implementation method described in any embodiment of the adaptive pupil distance and focal length adjustment control method based on motor drive provided in the embodiments of this application, or can execute the implementation method of the electronic device described in the embodiments of this application, which will not be repeated here.
[0105] In another embodiment of this application, an electronic device is provided. The electronic device stores a computer program, which includes program instructions. When executed by a processor, the program instructions implement all or part of the processes in the above-described adaptive interpupillary distance and focus adjustment control method based on motor drive. Alternatively, the computer program can instruct related hardware to implement these processes. The computer program can be stored in an electronic device, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0106] The computer-readable storage medium can be an internal storage unit of the electronic device in any of the foregoing embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the electronic device. Furthermore, the computer-readable storage medium can include both internal and external storage units of the electronic device. The computer-readable storage medium is used to store computer programs and other programs and data required by the electronic device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0107] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0108] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the electronic devices and units described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0109] In the several embodiments provided in this application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces or units, or it may be an electrical, mechanical, or other form of connection.
[0110] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.
[0111] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0112] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for adaptive pupillary distance and focal length adjustment control based on motor drive, characterized in that, include: S1: Real-time acquisition of images including both pupils using a near-eye vision sensor; S2: Calculate the current interpupillary distance based on the image, and compare it with the target interpupillary distance to generate an interpupillary distance deviation value; S3: Based on the interpupillary distance deviation value and the encoder feedback position, perform PID calculation to generate the first drive signal, drive the DC geared motor to drive the left and right eyepiece sliders to move towards or away from each other via gears and racks, and perform closed-loop interpupillary distance adjustment. S4: When the interpupillary distance deviation value enters the dead zone, the focus is automatically adjusted: the stepper motor is controlled to drive the compensation lens to move, the test pattern is displayed on the monitor to obtain the user's sharpness confirmation, and the virtual image contrast is analyzed by the auxiliary image sensor to search for the peak and determine the optimal viewing position. S5: Bind the focal length parameters corresponding to the current interpupillary distance and the best visual acuity to the user identifier and store them in non-volatile memory, and perform temperature compensation on the first drive signal and the stepper motor control signal according to the ambient temperature. S6: When the acceleration detected by the inertial measurement unit exceeds the threshold, a lock-up signal is generated to put the motor drive circuit into a lock-up state, maintaining the current interpupillary distance and focal length.
2. The method according to claim 1, characterized in that, The specific implementation of closed-loop interpupillary distance adjustment described in S3 includes: S31: Generate a frictional force feedforward compensation amount based on the current ambient temperature and the preset temperature-resistance model, and superimpose the feedforward compensation amount onto the basic control quantity output by the PID calculation to obtain the first drive signal; S32: When the absolute value of the pupil distance deviation is lower than the first threshold, the speed of the DC geared motor is reduced according to the preset deceleration curve until the deviation value enters the dead zone.
3. The method according to claim 1, characterized in that, The method described in S4, which uses a display to present a test pattern to obtain user sharpness confirmation and searches for peaks to determine the optimal viewing position, includes: S41: Control the display to present at least one frame of sharpness test pattern, and detect the input signal associated with the confirmation operation. When the confirmation signal is received, record the current stepper motor position as a candidate visual position. S42: Control the stepper motor to move back and forth slightly on both sides of the candidate viewing position, and simultaneously use the auxiliary image sensor to acquire virtual images and calculate the contrast evaluation value of each position. By performing curve fitting on the discrete evaluation values, the peak point of contrast is obtained, and the position corresponding to the peak point is taken as the optimal viewing position.
4. The method according to claim 1, characterized in that, It also includes step S7, which includes a manual dial hybrid control step, the manual dial hybrid control step including: S71: Monitors the pulse signal generated by the manual dial. When a pulse is detected, it pauses the currently executing S3 automatic interpupillary distance adjustment or S4 automatic focus adjustment process. S72: Determine the direction of movement and displacement based on the count and phase of the pulses, and directly drive the DC geared motor or stepper motor corresponding to the currently activated adjustment channel to perform displacement. S73: After the dial remains inactive for more than a set time, update the current interpupillary distance and focal length parameters as manual correction values to the parameter area associated with the current user identifier in the non-volatile memory.
5. The method according to claim 1, characterized in that, Before S1, it also includes: S01: Read the list of user identifiers stored in the non-volatile memory and display it on the screen; S02: In response to the user's selection instruction for a certain user identifier, retrieve the interpupillary distance parameter and focal length parameter associated with the identifier, and control the DC geared motor and stepper motor to drive the eyepiece slider and the compensation lens to the positions corresponding to the parameters, which serve as the target interpupillary distance in S2 and the initial search starting position in S4.
6. The method according to claim 5, characterized in that, When a user selects to add a new user ID, the following are also included: S03: Execute the fully automatic process from S1 to S5 in sequence. In S5, bind the obtained interpupillary distance parameters and focal length parameters with the newly added user identifier and store them in non-volatile memory. At the same time, add the identifier to the user identifier list.
7. The method according to claim 1, characterized in that, The temperature compensation of the first drive signal and the stepper motor control signal based on the ambient temperature described in S5 includes: S51: Use a temperature sensor to collect ambient temperature and calculate the temperature compensation coefficient based on the stored temperature-mechanical resistance characteristic curve. S52: When generating the first drive signal and the stepper motor control signal, the corresponding temperature compensation coefficient is applied to the first drive signal and the stepper motor control signal in a multiplicative or additive manner to compensate for the loss of driving force caused by the increase in the viscosity of the lubricating grease at low temperatures.
8. The method according to claim 1, characterized in that, The specific steps involved in generating the latching signal in S6 are: S61: Perform sliding window filtering on the acceleration signal output by the inertial measurement unit and calculate the impact energy trend value; S62: When the impact energy trend value exceeds the warning threshold, a lock-up signal is generated in advance to control the drive bridge of the DC geared motor to enter the short-circuit braking state and control the stepper motor drive chip to output the rated holding current. S63: When the acceleration value is detected to return to below the safety threshold and remain below the threshold for a preset duration, the locking state is released and normal closed-loop regulation is restored.
9. The method according to claim 1, characterized in that, S2 also includes blinking and eye movement inhibition steps: S21: Perform pupil state detection on the image to determine whether there is blinking or rapid scanning. S22: When a blinking or saccade state is detected, the update of the pupillary distance deviation value is paused, and the pupillary distance deviation value output of the previous effective cycle is maintained until a stable gaze state is detected.
10. The method according to claim 1, characterized in that, The gear and rack mechanism described in S3 has backlash, and the closed-loop interpupillary distance adjustment further includes a backlash adaptive compensation step: S33: Records the historical drive direction of the DC geared motor. When the new drive command direction is opposite to the historical direction, it is judged as a commutation event. Before the commutation event occurs, based on the number of backlash compensation pulses stored, an open-loop compensation pulse is inserted at the moment of direction switching to enable the motor to quickly pass through the backlash zone. S34: After the compensation pulse is executed, the actual displacement fed back by the encoder is obtained and compared with the ideal backlash-free displacement to obtain the backlash residual. When the backlash residual exceeds the preset tolerance, the number of backlash compensation pulses stored is updated using the residual.