[go: up one dir, main page]

CN105607764B - Track input device and track input method - Google Patents

Track input device and track input method Download PDF

Info

Publication number
CN105607764B
CN105607764B CN201510971483.4A CN201510971483A CN105607764B CN 105607764 B CN105607764 B CN 105607764B CN 201510971483 A CN201510971483 A CN 201510971483A CN 105607764 B CN105607764 B CN 105607764B
Authority
CN
China
Prior art keywords
input device
trajectory
stylus
track
posture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510971483.4A
Other languages
Chinese (zh)
Other versions
CN105607764A (en
Inventor
王杰
侯涛
段宇
曹长宏
宋柏君
陶铸鑫君
王信峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hanwang Technology Co Ltd
Original Assignee
Hanwang Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hanwang Technology Co Ltd filed Critical Hanwang Technology Co Ltd
Priority to CN201510971483.4A priority Critical patent/CN105607764B/en
Publication of CN105607764A publication Critical patent/CN105607764A/en
Application granted granted Critical
Publication of CN105607764B publication Critical patent/CN105607764B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0354Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of 2D relative movements between the device, or an operating part thereof, and a plane or surface, e.g. 2D mice, trackballs, pens or pucks
    • G06F3/03545Pens or stylus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/0304Detection arrangements using opto-electronic means

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Position Input By Displaying (AREA)
  • User Interface Of Digital Computer (AREA)
  • Gyroscopes (AREA)

Abstract

The invention provides a track input device and a track input method. The trajectory input device includes: an attitude sensor (101) for acquiring an attitude of the trajectory input device (10); a displacement sensor (102) for acquiring a movement locus of the locus input device (10) when moving on an input medium; and a processing unit (103) which corrects the movement locus of the trajectory input device (10) on an input medium, which is acquired by the displacement sensor (102), using the posture of the trajectory input device (10) acquired by the posture sensor (101).

Description

轨迹输入装置及轨迹输入方法Track input device and track input method

技术领域technical field

本发明涉及信息处理技术领域,尤其涉及一种轨迹输入装置及轨迹输入方法。The invention relates to the technical field of information processing, in particular to a trajectory input device and a trajectory input method.

背景技术Background technique

如今,随着计算机的普及,人们写字更多地使用键盘、鼠标等进行输入,后来又出现了语音输入。这些新颖的方式的确给人们带来了方便,但是有些内容并不适合用键盘和语音来输入,例如书法、签名等。Nowadays, with the popularization of computers, people use keyboards, mice, etc. for input more when writing, and voice input appeared later. These novel ways have indeed brought convenience to people, but some content is not suitable for inputting with keyboard and voice, such as calligraphy, signature and so on.

手写笔的出现解决了上述问题。手写笔中的传感器获取笔尖的移动轨迹,从而确定要输入给计算机的数据。The appearance of stylus has solved the above-mentioned problem. Sensors in the stylus pick up the movement of the tip to determine the data to be input to the computer.

目前市面上的手写笔大多需要配合专门的书写介质才能工作。例如在手写板上进行书写。相比之下,鼠标可以在鼠标垫、桌面,甚至其他大致平坦的介质表面进行移动从而控制光标的移动。Most of the stylus currently on the market needs to work with a special writing medium. For example, writing on a tablet. In contrast, a mouse can be moved across a mouse pad, a tabletop, or even other generally flat media surfaces to control cursor movement.

然而,在利用鼠标进行轨迹输入(例如,写字)的过程中,应当保持鼠标平移,而如果鼠标的姿态发生了改变,则无法正确地输入位移信息。However, in the process of using the mouse for track input (for example, writing), the mouse should be kept moving, and if the posture of the mouse changes, the displacement information cannot be input correctly.

可见,现有的轨迹输入装置或者需要特殊的输入介质,或者由于移动过程中姿态的改变而造成输入不准确。It can be seen that the existing trajectory input device either requires a special input medium, or the input is inaccurate due to the change of posture during the movement.

发明内容Contents of the invention

鉴于上述问题,本发明提供了一种轨迹输入装置及轨迹输入方法,其能够校正由于轨迹输入装置的姿态改变造成的误差,由此能够随时随地可以进行输入、不需要特殊的输入介质。In view of the above problems, the present invention provides a trajectory input device and a trajectory input method, which can correct the error caused by the posture change of the trajectory input device, so that input can be performed anytime and anywhere without special input media.

一方面,本发明实施例提供了一种轨迹输入装置,包括:姿态传感器,其用于获取所述轨迹输入装置的姿态;位移传感器,其用于获取所述轨迹输入装置在输入介质上移动时的移动轨迹;处理单元,其利用所述姿态传感器获取的所述轨迹输入装置的姿态,对所述位移传感器获取的所述轨迹输入装置在输入介质上的移动轨迹进行修正。On the one hand, an embodiment of the present invention provides a trajectory input device, including: an attitude sensor, which is used to obtain the posture of the trajectory input device; a displacement sensor, which is used to obtain the trajectory input device when it moves on the input medium. the movement trajectory of the trajectory; a processing unit, which uses the posture of the trajectory input device obtained by the posture sensor to correct the movement trajectory of the trajectory input device on the input medium obtained by the displacement sensor.

进一步的,所述轨迹输入装置是手写笔,所述姿态传感器包括陀螺仪、加速度计和磁强计,所述位移传感器包括光电传感器,所述姿态包括所述手写笔的俯仰角、横滚角和偏航角。Further, the trajectory input device is a stylus, the attitude sensor includes a gyroscope, an accelerometer, and a magnetometer, the displacement sensor includes a photoelectric sensor, and the attitude includes the pitch angle and roll angle of the stylus. and yaw angle.

进一步的,所述手写笔包括:具有内部空间的笔杆;位于所述笔杆一端的笔尖;其中,所述陀螺仪、所述加速度计、所述磁强计和所述光电传感器容纳在所述笔杆的所述内部空间中并与所述手写笔同轴;并且所述处理单元根据所述手写笔的所述姿态得到姿态转移矩阵,利用所述姿态转移矩阵对所述笔尖在所述输入介质上的移动轨迹进行修正。Further, the stylus includes: a pen holder with an internal space; a pen tip located at one end of the pen holder; wherein, the gyroscope, the accelerometer, the magnetometer and the photoelectric sensor are accommodated in the pen holder and coaxial with the stylus; and the processing unit obtains a posture transfer matrix according to the posture of the stylus, and uses the posture transfer matrix to compare the pen tip on the input medium The trajectory of the movement is corrected.

进一步的,所述处理单元进行的所述修正包括:通过对所述加速度计和所述磁强计获取的数据和所述陀螺仪获取的数据进行融合,获得所述手写笔的姿态。Further, the correction performed by the processing unit includes: obtaining the attitude of the stylus by fusing the data obtained by the accelerometer and the magnetometer with the data obtained by the gyroscope.

进一步的,所述处理单元利用互补滤波算法进行所述融合。Further, the processing unit uses a complementary filtering algorithm to perform the fusion.

进一步的,所述处理单元利用卡尔曼滤波算法进行所述融合。Further, the processing unit uses a Kalman filter algorithm to perform the fusion.

进一步的,所述输入介质是纸。Further, the input medium is paper.

另一方面,本发明实施例提供了一种利用轨迹输入装置的轨迹输入方法,包括以下步骤:步骤a,当所述轨迹输入装置在输入介质上移动时,获取所述轨迹输入装置的姿态和所述轨迹输入装置的移动轨迹;步骤b,利用所述轨迹输入装置的姿态,对所述轨迹输入装置在所述输入介质上的移动轨迹进行修正。On the other hand, an embodiment of the present invention provides a trajectory input method using a trajectory input device, including the following steps: step a, when the trajectory input device moves on the input medium, acquire the posture and The trajectory of the trajectory input device; step b, using the posture of the trajectory input device to correct the trajectory of the trajectory input device on the input medium.

进一步的,所述轨迹输入装置是手写笔,所述姿态传感器包括陀螺仪、加速度计和磁强计,所述位移传感器包括光电传感器,所述姿态包括所述手写笔的俯仰角、横滚角和偏航角。Further, the trajectory input device is a stylus, the attitude sensor includes a gyroscope, an accelerometer, and a magnetometer, the displacement sensor includes a photoelectric sensor, and the attitude includes the pitch angle and roll angle of the stylus. and yaw angle.

进一步的,所述手写笔包括:具有内部空间的笔杆;位于所述笔杆一端的笔尖;其中,所述陀螺仪、所述加速度计、所述磁强计和所述光电传感器容纳在所述笔杆的所述内部空间中并与所述手写笔同轴;并且所述步骤b包括:所述处理单元根据所述手写笔的姿态得到姿态转移矩阵,利用所述姿态转移矩阵对所述笔尖在所述输入介质上的移动轨迹进行修正。Further, the stylus includes: a pen holder with an internal space; a pen tip located at one end of the pen holder; wherein, the gyroscope, the accelerometer, the magnetometer and the photoelectric sensor are accommodated in the pen holder and coaxial with the stylus; and the step b includes: the processing unit obtains an attitude transfer matrix according to the attitude of the stylus, and uses the attitude transfer matrix to calculate the position of the pen tip at the Correct the movement trajectory on the input medium.

进一步的,所述步骤b还包括:所述处理单元通过对所述加速度计和所述磁强计获取的数据和所述陀螺仪获取的数据进行融合,获得所述手写笔的姿态。Further, the step b further includes: the processing unit obtains the attitude of the stylus by fusing the data obtained by the accelerometer and the magnetometer with the data obtained by the gyroscope.

进一步的,所述处理单元利用利用互补滤波算法进行所述融合。Further, the processing unit uses a complementary filtering algorithm to perform the fusion.

进一步的,所述处理单元利用卡尔曼滤波算法进行所述融合。Further, the processing unit uses a Kalman filter algorithm to perform the fusion.

进一步的,所述输入介质是纸。Further, the input medium is paper.

本发明通过位移传感器(光电传感器)可以得到轨迹输入装置的位移信息,通过姿态传感器(陀螺仪、加速度计、磁强计)可以得到轨迹输入装置的姿态,然后通过姿态转移矩阵对轨迹输入装置的位移信息进行修正,从而得到精确的输入数据。The present invention can obtain the displacement information of trajectory input device by displacement sensor (photoelectric sensor), can obtain the posture of trajectory input device by posture sensor (gyroscope, accelerometer, magnetometer), then pass the posture transfer matrix to the trajectory input device The displacement information is corrected to obtain accurate input data.

附图说明Description of drawings

图1示出了本发明的轨迹输入装置的示意图。Fig. 1 shows a schematic diagram of the track input device of the present invention.

图2的(a)是本发明的一个实施方式的手写笔的正面视图。(a) of FIG. 2 is a front view of a stylus according to one embodiment of the present invention.

图2的(b)是该实施方式的手写笔的背面视图。(b) of FIG. 2 is a back view of the stylus of this embodiment.

图3是本发明的手写笔的输入方法的流程图。FIG. 3 is a flow chart of the input method of the stylus of the present invention.

图4是本发明的互补滤波的原理图。Fig. 4 is a schematic diagram of the complementary filtering of the present invention.

具体实施方式Detailed ways

为使本领域技术人员更好地理解本发明的技术方案,下面结合附图和具体实施方式对本发明提供的轨迹输入装置及轨迹输入方法进行详细描述。在这些附图中,对于相同或者相当的构成要素,标注相同标号。以下仅为本发明的输入装置及轨迹输入方法的最佳实施方式,本发明并不仅限于下述内容。In order to enable those skilled in the art to better understand the technical solution of the present invention, the trajectory input device and the trajectory input method provided by the present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments. In these drawings, the same reference numerals are assigned to the same or corresponding components. The following are only the best implementation modes of the input device and track input method of the present invention, and the present invention is not limited to the following content.

下面结合图1说明本发明的轨迹输入装置。The trajectory input device of the present invention will be described below with reference to FIG. 1 .

图1示出了本发明的轨迹输入装置的示意图。如图1所示,轨迹输入装置10包括:姿态传感器101,其用于获取轨迹输入装置10的姿态;位移传感器102,其用于获取轨迹输入装置10在输入介质上移动时的移动轨迹;处理单元103,其利用姿态传感器101获取的轨迹输入装置10的姿态,对位移传感器102获取的轨迹输入装置10在输入介质上的移动轨迹进行修正。Fig. 1 shows a schematic diagram of the track input device of the present invention. As shown in Figure 1, track input device 10 comprises: attitude sensor 101, and it is used to obtain the attitude of track input device 10; Displacement sensor 102, it is used to obtain the moving track when track input device 10 moves on input medium; Processing The unit 103 uses the posture of the trajectory input device 10 obtained by the posture sensor 101 to correct the movement trajectory of the trajectory input device 10 obtained by the displacement sensor 102 on the input medium.

目前常用的姿态传感器包括陀螺仪、加速度计和磁强计。然而,这三种类型的姿态传感器在获取姿态方面均有不足之处。Attitude sensors commonly used today include gyroscopes, accelerometers, and magnetometers. However, these three types of attitude sensors have deficiencies in acquiring attitude.

例如,陀螺仪输出的角速度是瞬时量,需要角速度对时间积分而计算出角度,得到的角度变化量与初始角度相加,就得到目标角度。积分时间越小,输出角度越准,但陀螺仪的原理决定了它的测量基准是自身,并没有系统外的绝对参照物,加上积分时间不可能无限小,所以积分的累积误差就会随着时间迅速增加,最终导致输出角度与实际不符,所以陀螺仪只能工作在相对较短的时间尺度内。For example, the angular velocity output by the gyroscope is an instantaneous quantity, and the angular velocity needs to be integrated with time to calculate the angle, and the obtained angular change is added to the initial angle to obtain the target angle. The smaller the integration time, the more accurate the output angle, but the principle of the gyroscope determines that its measurement reference is itself, and there is no absolute reference outside the system. In addition, the integration time cannot be infinitely small, so the cumulative error of the integration will vary with time. As the time increases rapidly, eventually the output angle does not match the reality, so the gyroscope can only work in a relatively short time scale.

加速度计测量的是重力方向的加速度,有系统外绝对参照物“重力轴”,在无外力加速度的情况下,能准确输出横滚角和俯仰角,并且此角度不会有累积误差,在更长的时间尺度内都是准确的。但是加速度计测角度也有缺点。加速度计实际上是用MEMS技术检测惯性力造成的微小形变,而惯性力与重力本质是相同的,所以加速度计就不能区分重力加速度与外力加速度。当系统在三维空间做变速移动时,加速度计的输出就产生了误差。The accelerometer measures the acceleration in the direction of gravity. There is an absolute reference outside the system "gravity axis". In the case of no external acceleration, it can accurately output the roll angle and pitch angle, and there will be no cumulative error in this angle. Accurate over long time scales. However, accelerometers also have disadvantages in measuring angles. The accelerometer actually uses MEMS technology to detect the tiny deformation caused by the inertial force, and the inertial force and gravity are essentially the same, so the accelerometer cannot distinguish between the acceleration of gravity and the acceleration of external force. When the system moves at variable speeds in three-dimensional space, the output of the accelerometer produces an error.

磁强计测量的是地磁场的磁场强度和方向,与加速度计相似,能够输出没有累积误差的数据,在较长的时间尺度内都是准确的,而且能够得到偏航角。但是其缺点在于小范围测量不够精准,对于诸如手写笔这样相对移动距离不大的对象,不能提供足够高精度的测量结果,且容易受到干扰。Magnetometers measure the magnetic field strength and direction of the Earth's magnetic field. Similar to accelerometers, they can output data with no cumulative error, are accurate over longer time scales, and can get yaw angles. But its disadvantage is that the small-scale measurement is not accurate enough. For objects such as a stylus with a relatively small moving distance, it cannot provide sufficiently high-precision measurement results and is susceptible to interference.

所以,本发明利用加速度计和磁强计对陀螺仪的测量数据进行修正。例如,因为较短时间内陀螺仪的测量数据比较准确,但是有累积误差,而在较长时间下则不准确;相反,较短时间内磁强计和加速度计的测量数据不准确,但是不累积误差,而较长时间内则较为准确。基于这种事实,对三者的测量数据进行数据融合,从而集合三者的优点。Therefore, the present invention uses the accelerometer and the magnetometer to correct the measurement data of the gyroscope. For example, because the measurement data of the gyroscope is more accurate in a short period of time, but has accumulated errors, it is not accurate in a long period of time; on the contrary, the measurement data of the magnetometer and accelerometer in a short period of time are not accurate, but not Cumulative error, and more accurate over a longer period of time. Based on this fact, data fusion is performed on the measurement data of the three, so as to integrate the advantages of the three.

下面结合图2进一步详细说明本发明的轨迹输入装置。The track input device of the present invention will be further described in detail below in conjunction with FIG. 2 .

图2的(a)是本发明的轨迹输入装置的一个实施方式的手写笔的正面视图。图2的(b)是该实施方式的手写笔的背面视图。(a) of FIG. 2 is a front view of a stylus according to one embodiment of the trajectory input device of the present invention. (b) of FIG. 2 is a back view of the stylus of this embodiment.

需要注意的是,本发明的轨迹输入装置并不限于进行二维移动的手写笔,也可以是进行三维移动的任意轨迹输入装置。It should be noted that the track input device of the present invention is not limited to a stylus for two-dimensional movement, but can also be any track input device for three-dimensional movement.

如图2的(a)所示,手写笔20包括:具有内部空间的笔杆201;位于所述笔杆201一端的笔尖202;所述姿态传感器包括陀螺仪206a、加速度计206b和磁强计207,所述位移传感器包括光电传感器208,所述姿态包括所述手写笔20的俯仰角、横滚角和偏航角。As shown in (a) of Figure 2, the stylus 20 includes: a penholder 201 with an internal space; a nib 202 at one end of the penholder 201; the attitude sensor includes a gyroscope 206a, an accelerometer 206b and a magnetometer 207, The displacement sensor includes a photoelectric sensor 208 , and the attitude includes the pitch angle, roll angle and yaw angle of the stylus 20 .

陀螺仪206a、加速度计206b、磁强计207和光电传感器208容纳在笔杆201的内部空间中并与手写笔20同轴。A gyroscope 206 a , an accelerometer 206 b , a magnetometer 207 , and a photosensor 208 are accommodated in the inner space of the pen barrel 201 coaxially with the stylus 20 .

处理单元103根据手写笔20的姿态得到姿态转移矩阵,利用姿态转移矩阵对笔尖202在输入介质上的移动轨迹进行修正。The processing unit 103 obtains a posture transition matrix according to the posture of the stylus 20 , and uses the posture transition matrix to correct the moving track of the pen tip 202 on the input medium.

另外,笔杆201的内部空间中还安装有供电单元203和电源管理单元204。笔尖202附近设置有点触开关205,用于识别笔尖是否接触到纸面,是否已经开始书写。In addition, a power supply unit 203 and a power management unit 204 are installed in the inner space of the pen holder 201 . A touch switch 205 is arranged near the nib 202 for identifying whether the nib touches the paper and whether writing has started.

这里,供电单元203可以是3.7V锂电池,用于给整个手写笔供电。电源管理单元204可以是芯片Tp4056,用于对锂电池进行充电管理。Here, the power supply unit 203 may be a 3.7V lithium battery for powering the entire stylus. The power management unit 204 can be a chip Tp4056, which is used for charging and managing the lithium battery.

另外,加速度计206b和陀螺仪206a的功能可以集成在一起,例如芯片Mpu6050。磁强计207例如是HMC5883L。这里,陀螺仪206a获取手写笔20的三轴角速度,加速度计206b获取手写笔20的三轴加速度,磁强计207获取手写笔20的三轴磁场强度。In addition, the functions of the accelerometer 206b and the gyroscope 206a can be integrated together, such as the chip Mpu6050. The magnetometer 207 is, for example, HMC5883L. Here, the gyroscope 206 a acquires the three-axis angular velocity of the stylus 20 , the accelerometer 206 b acquires the three-axis acceleration of the stylus 20 , and the magnetometer 207 acquires the three-axis magnetic field intensity of the stylus 20 .

另外,光电传感器208,位于笔杆201的内部空间中靠近笔尖202处,用于获取笔尖202的移动轨迹。光电传感器208通过LED(未示出)的光照射输入介质表面,反射光通过透镜209被采集成像,通过对比移动前后的图像,可以确定笔尖202在输入介质上的移动方向和移动距离,从而确定移动轨迹。In addition, the photoelectric sensor 208 is located in the inner space of the pen holder 201 close to the pen tip 202 and is used to obtain the movement track of the pen tip 202 . The photoelectric sensor 208 irradiates the surface of the input medium with the light of the LED (not shown), and the reflected light is collected and imaged by the lens 209. By comparing the images before and after the movement, the moving direction and the moving distance of the nib 202 on the input medium can be determined, thereby determining moving track.

需要注意的是,陀螺仪206a、加速度计206b、磁强计207和光电传感器208必须安装在笔杆201的中轴线上,即,与笔杆201同轴,如图2所示。而且,光电传感器208相对于笔尖202的距离应当根据透镜209的景深来确定。因为只有保持在透镜景深范围内的移动才可以清晰地在光电传感器表面成像,从而检测出移动。It should be noted that the gyroscope 206a, accelerometer 206b, magnetometer 207 and photoelectric sensor 208 must be installed on the central axis of the pen holder 201, that is, coaxial with the pen holder 201, as shown in FIG. 2 . Moreover, the distance between the photoelectric sensor 208 and the pen tip 202 should be determined according to the depth of field of the lens 209 . Because only the movement within the depth of field of the lens can be clearly imaged on the surface of the photoelectric sensor, thereby detecting the movement.

如图2的(b)所示,笔杆201的内部空间中还安装有:转压芯片212,可以是RT9193,用于将供电单元203的电压降压到3.3V为整个手写笔供电;数据采集单元211,用于保存和/或发送检测到的数据。具体地,数据采集单元211可以包括TF卡槽和/或通讯模块,其中TF卡槽用于将姿态传感器和位移传感器采集到的数据存储到TF卡槽中,通讯模块用于将所述数据发送到上位机保存在云端。所述通讯模块可以为蓝牙模块。As shown in (b) of Figure 2, the internal space of the penholder 201 is also installed with: a turn-over chip 212, which can be an RT9193, used to step down the voltage of the power supply unit 203 to 3.3V to supply power for the entire stylus; Unit 211, configured to store and/or send detected data. Specifically, the data acquisition unit 211 may include a TF card slot and/or a communication module, wherein the TF card slot is used to store the data collected by the attitude sensor and the displacement sensor into the TF card slot, and the communication module is used to send the data Save it to the host computer in the cloud. The communication module may be a Bluetooth module.

另外,安装在笔杆201的内部空间中的处理单元103用于对上述部件进行整体控制,并进行数据处理。In addition, the processing unit 103 installed in the inner space of the penholder 201 is used to control the above-mentioned components as a whole and perform data processing.

当手写笔20在书写介质(未示出)上书写时,陀螺仪206a、加速度计206b、磁强计207获取手写笔20的笔姿态,光电传感器208获取笔尖202在书写介质上的移动轨迹。处理单元103利用姿态转移矩阵对笔尖202在书写介质上的移动轨迹进行修正,得到准确的输入数据。When the stylus 20 writes on the writing medium (not shown), the gyroscope 206a, the accelerometer 206b, and the magnetometer 207 acquire the pen posture of the stylus 20, and the photoelectric sensor 208 acquires the moving track of the pen tip 202 on the writing medium. The processing unit 103 uses the posture transfer matrix to correct the moving track of the pen tip 202 on the writing medium to obtain accurate input data.

下面参照图3说明本发明的输入方法。The input method of the present invention will be described below with reference to FIG. 3 .

图3是本发明的轨迹输入装置的轨迹输入方法的流程图。FIG. 3 is a flow chart of the trajectory input method of the trajectory input device of the present invention.

在轨迹输入装置是手写笔20的条件下,该轨迹输入方法开始于处理单元103根据点触开关205的信号判断笔尖202是否接触了输入介质(步骤S30)。如果是,则获取手写笔20的姿态传感器206a、206b和207的输出数据(步骤S31)。Under the condition that the trace input device is the stylus 20, the trace input method starts with the processing unit 103 judging whether the pen tip 202 touches the input medium according to the signal of the touch switch 205 (step S30). If yes, the output data of the attitude sensors 206a, 206b, and 207 of the stylus 20 are acquired (step S31).

在步骤S31中,通过IIC数据协议读取传感器206a、206b、207输出的3轴角速度、3轴加速度和3轴磁场强度的值。In step S31, the values of the 3-axis angular velocity, 3-axis acceleration and 3-axis magnetic field intensity output by the sensors 206a, 206b, 207 are read through the IIC data protocol.

3轴角速度是指绕笔杆201方向(设为z轴)转动的角速度、绕垂直笔杆201平面内的两个彼此正交的方向(设为x、y轴)转动的角速度。Three-axis angular velocity refers to the angular velocity of rotation around the penholder 201 direction (set as the z axis), and the angular velocity of the rotation around two mutually orthogonal directions (set as x and y axes) in the plane perpendicular to the penholder 201 .

3轴磁场强度是指沿上述x、y、z三个轴的磁场强度。The triaxial magnetic field strength refers to the magnetic field strength along the above-mentioned three axes of x, y, and z.

3轴加速度是指沿上述x、y、z三个轴的加速度。The 3-axis acceleration refers to the acceleration along the above-mentioned three axes of x, y, and z.

通过传感器206a、206b和207获取的3轴角速度、3轴加速度和3轴磁场强度,可以得到手写笔20的姿态信息。The attitude information of the stylus 20 can be obtained through the 3-axis angular velocity, 3-axis acceleration and 3-axis magnetic field intensity acquired by the sensors 206 a , 206 b and 207 .

在获取了姿态传感器的输出数据(步骤S31)之后,处理单元103对获取的输出数据进行校正(步骤S32)。After acquiring the output data of the posture sensor (step S31), the processing unit 103 corrects the acquired output data (step S32).

进行数据校正的原因是传感器输出的数据存在一定的误差,首先需要对每个传感器的基础数据进行单独的校正,得到一个相对比较准的数据,才能进而对它进行数据处理。The reason for data correction is that there is a certain error in the data output by the sensor. First, the basic data of each sensor needs to be corrected individually to obtain a relatively accurate data before it can be processed.

对3轴磁场强度进行数据校正的方法可以是最小二乘法。对3轴角速度和3轴加速度进行数据校正的方法可以是减去偏移量。下面分别进行说明。The method of data correction for the 3-axis magnetic field strength may be the method of least squares. A data correction method for the 3-axis angular velocity and 3-axis acceleration may be to subtract the offset. Each will be described below.

(1)关于3轴磁场强度(1) Regarding the 3-axis magnetic field strength

基于最小二乘法的原理进行数据拟合是校正磁场强度数据的一种方法,可以使处理后的数据更加准确。Data fitting based on the principle of the least square method is a method to correct the magnetic field strength data, which can make the processed data more accurate.

根据误差模型和采集大量数据,可以离线拟合出模型中的系数,作为矫正模型。According to the error model and collecting a large amount of data, the coefficients in the model can be fitted offline as a correction model.

接下来,利用matlab的yalmip工具箱,根据最小二乘法做数据拟合。Next, use the yalmip toolbox of matlab to do data fitting according to the least square method.

(2)关于3轴角速度(2) Regarding 3-axis angular velocity

静止状态得到零偏,只需消除零偏的影响即可。The zero bias is obtained in the static state, and it is only necessary to eliminate the influence of the zero bias.

(3)关于3轴加速度(3) About 3-axis acceleration

与3轴角速度相同,只需消除零偏的影响即可。It is the same as the 3-axis angular velocity, only need to eliminate the influence of zero bias.

对获取的输出数据进行校正(步骤S32)之后,处理单元103计算出手写笔的姿态数据(步骤S33)。After correcting the acquired output data (step S32), the processing unit 103 calculates the gesture data of the stylus (step S33).

在步骤S33中,处理单元103通过对加速度计206b和磁强计207获取的数据和陀螺仪206a获取的数据进行融合,获得手写笔20的姿态。In step S33, the processing unit 103 obtains the attitude of the stylus 20 by fusing the data obtained by the accelerometer 206b and the magnetometer 207 with the data obtained by the gyroscope 206a.

例如,处理单元103利用互补滤波算法进行上述融合。For example, the processing unit 103 uses a complementary filtering algorithm to perform the fusion described above.

由此,获得了手写笔20的笔姿态数据。Thus, the pen posture data of the stylus 20 is obtained.

在计算出手写笔的姿态数据(步骤S33)之后,处理单元103根据俯仰角、横滚角和偏航角确定姿态转移矩阵(步骤S34)。After calculating the attitude data of the stylus (step S33), the processing unit 103 determines an attitude transition matrix according to the pitch angle, roll angle and yaw angle (step S34).

在步骤S34中,处理单元103可以使用捷联惯导算法确定姿态转移矩阵如下式(1)所示,其中,θ、φ和ψ分别表示手写笔20的仰俯角、横滚角和航向角。In step S34, the processing unit 103 can use the strapdown inertial navigation algorithm to determine the attitude transition matrix shown in the following equation (1), where θ, φ and ψ represent the pitch angle, roll angle and heading angle of the stylus 20, respectively.

(式1) (Formula 1)

然后,处理单元103获取位移传感器102的输出数据(步骤S35)。这里,位移传感器102例如为光电传感器208,其获取笔头202在x方向和y方向的位移。由于手写笔20仅在例如纸张的书写介质上进行二维移动,所以光电传感器208仅获取两个方向的位移。对于进行三维移动的轨迹输入装置,位移传感器需要获取x、y、z三个方向的位移。Then, the processing unit 103 acquires the output data of the displacement sensor 102 (step S35). Here, the displacement sensor 102 is, for example, a photoelectric sensor 208, which acquires the displacement of the pen head 202 in the x direction and the y direction. Since the stylus 20 only moves two-dimensionally on the writing medium such as paper, the photoelectric sensor 208 only acquires displacements in two directions. For a trajectory input device that performs three-dimensional movement, the displacement sensor needs to obtain displacements in the three directions of x, y, and z.

最后,处理单元103利用姿态转移矩阵对笔尖202在书写介质上的移动轨迹进行修正(步骤S36)。Finally, the processing unit 103 corrects the moving track of the pen tip 202 on the writing medium by using the posture transition matrix (step S36 ).

步骤S36之后,处理单元103再次判断笔尖202是否接触了输入介质,如果没有,则暂停处理,直到笔尖202再次接触了输入介质,才继续重复步骤S30至步骤S36的操作。After step S36, the processing unit 103 judges again whether the pen tip 202 touches the input medium, if not, suspends the processing until the pen tip 202 touches the input medium again, and then continues to repeat the operations from step S30 to step S36.

设光电传感器208获取的笔尖202的位移为(x,y,z),则修正后的位移(x’,y’,z’)如下式(2)所示:Assuming that the displacement of the nib 202 obtained by the photoelectric sensor 208 is (x, y, z), the corrected displacement (x', y', z') is shown in the following formula (2):

(式2) (Formula 2)

由此,经过修正手写笔20在书写过程中发生的姿态变化,可以获得更为准确的输入数据。Thus, more accurate input data can be obtained by correcting the posture change of the stylus 20 during the writing process.

应当注意,在图3中,先获取姿态传感器101的输出数据,后获取位移传感器102的输出数据。然而,本发明并不限于这种顺序,也可以先获取位移传感器102的输出数据,后获取姿态传感器101的输出数据。It should be noted that in FIG. 3 , the output data of the attitude sensor 101 is obtained first, and then the output data of the displacement sensor 102 is obtained. However, the present invention is not limited to this order, and the output data of the displacement sensor 102 may be acquired first, and then the output data of the attitude sensor 101 may be acquired.

在本发明中,采用互补滤波进行数据融合。权重系数需要根据不同的场合变化以使误差变小。根据加速度计和陀螺仪、磁强计对不同测量时间的反应情况,长时间内加速度计206b、磁强计207对角度的测量准确,可以增加其权重系数,短时间内陀螺仪206a测量准确,可以增加其权重系数。In the present invention, complementary filtering is used for data fusion. The weight coefficient needs to be changed according to different occasions to make the error smaller. According to the reaction situation of accelerometer, gyroscope and magnetometer to different measurement times, the measurement of angle by accelerometer 206b and magnetometer 207 is accurate for a long time, and its weight coefficient can be increased, and the measurement of gyroscope 206a in a short period of time is accurate, Its weight coefficient can be increased.

下面结合图4详细说明互补滤波。Complementary filtering will be described in detail below in conjunction with FIG. 4 .

图4示出了本发明的互补滤波的原理图。Fig. 4 shows a schematic diagram of the complementary filtering of the present invention.

设磁强计207输出的数据为mx、my和mz,陀螺仪206a输出的数据为(p,q,r)T,加速度计206b输出的数据为ax、ay和az。手写笔20的仰俯角、横滚角和航向角分别记为θ、φ和ψ。Let the data output by the magnetometer 207 be m x , my and m z , the data output by the gyroscope 206 a be (p,q, r) T , and the data output by the accelerometer 206 b be a x , a y and a z . The pitch angle, roll angle and heading angle of the stylus 20 are denoted as θ, φ and ψ respectively.

根据陀螺仪206a的工作原理可知以下微分方程:According to the working principle of the gyroscope 206a, the following differential equation can be known:

(式3) (Formula 3)

其中,分别表示横滚角、仰俯角和航向角的角速度。in, Respectively represent the angular velocity of roll angle, pitch angle and heading angle.

另外,根据加速度计206b的工作原理可知以下公式:In addition, according to the working principle of the accelerometer 206b, the following formula can be known:

(式4) (Formula 4)

其中,θacc和φacc分别为加速度计206b估计的俯仰角和横滚角。Wherein, θ acc and φ acc are the pitch angle and roll angle estimated by the accelerometer 206b, respectively.

然后,利用式4中得到的俯仰角和横滚角对磁强计207的输出值进行补偿,可以得到磁强计207估计的航向角:Then, the output value of the magnetometer 207 is compensated by using the pitch angle and roll angle obtained in formula 4, and the heading angle estimated by the magnetometer 207 can be obtained:

(式5) (Formula 5)

然后,对加速度计206b估计的俯仰角和横滚角与陀螺仪206估计的俯仰角和横滚角进行互补滤波,得到融合后的俯仰角θ和横滚角φ。Then, complementary filtering is performed on the pitch angle and roll angle estimated by the accelerometer 206 b and the pitch angle and roll angle estimated by the gyroscope 206 to obtain the fused pitch angle θ and roll angle φ.

另一方面,对磁强计207估计的航向角与陀螺仪206估计的航向角进行互补滤波,得到融合后的航向角ψ。On the other hand, complementary filtering is performed on the heading angle estimated by the magnetometer 207 and the heading angle estimated by the gyroscope 206 to obtain the fused heading angle ψ.

如上所述,进行互补滤波的规则是:长时间时增大加速度计206b、磁强计207的权重系数,短时间时增大陀螺仪206a的权重系数。在本发明实施例中,可以根据处理单元103对手写笔20的控制周期来确定所述长时间和短时间,例如:以处理单元103的一个控制周期作为短时间,以处理单元103的20个处理周期作为长时间,该控制周期可以为6ms,则长时间为120ms,短时间为6ms。具体的长时间、短时间以及权重系数可以通过实验进行调整。As mentioned above, the rule for performing complementary filtering is: increase the weight coefficients of the accelerometer 206b and the magnetometer 207 for a long time, and increase the weight coefficient of the gyroscope 206a for a short time. In the embodiment of the present invention, the long time and short time can be determined according to the control period of the stylus 20 by the processing unit 103, for example: take one control period of the processing unit 103 as the short time, and take 20 control periods of the processing unit 103 as the short time. The processing cycle is long time, the control cycle can be 6ms, then the long time is 120ms, and the short time is 6ms. The specific long time, short time and weight coefficient can be adjusted through experiments.

另选的是,处理单元103还可以利用卡尔曼滤波算法对陀螺仪206a、加速度计206b和磁强计207获得的数据进行融合,得到融合后的手写笔2的横滚角、俯仰角和偏航角。Alternatively, the processing unit 103 can also use the Kalman filter algorithm to fuse the data obtained by the gyroscope 206a, the accelerometer 206b and the magnetometer 207 to obtain the fused roll angle, pitch angle and yaw angle of the stylus 2. flight angle.

上面以手写笔20为例对本发明的轨迹输入装置及轨迹输入方法进行了详细说明。通过本发明的手写笔20,可以随时随地在任意介质上书写,并精确获得手写笔20在书写介质上的移动轨迹,从而向计算机等输入精确的信息。The trajectory input device and trajectory input method of the present invention are described in detail above by taking the stylus 20 as an example. With the stylus 20 of the present invention, it is possible to write on any medium anytime and anywhere, and accurately obtain the movement track of the stylus 20 on the writing medium, thereby inputting accurate information to a computer or the like.

另外,在手写笔20的情况下,输入介质为纸。但是本发明并不限于纸这样的二维输入介质,而是可以为任意三维输入介质。In addition, in the case of the stylus 20, the input medium is paper. However, the present invention is not limited to a two-dimensional input medium such as paper, but may be any three-dimensional input medium.

以上实施方式仅仅是为了说明本发明的原理而采用的示例性实施方式,然而本发明并不局限于此。对于本领域内的普通技术人员而言,在不脱离本发明的精神和实质的情况下,可以做出各种变型和改进。这些变型和改进也视为本发明的保护范围。The above embodiments are only exemplary embodiments adopted to illustrate the principles of the present invention, but the present invention is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention. These variations and improvements are also regarded as the protection scope of the present invention.

Claims (12)

1. A trajectory input device (10), comprising:
attitude sensor (101) comprising: a gyroscope (206a) for obtaining an angle of the trajectory input device (10); an accelerometer (206b) for obtaining roll and pitch angles of the trajectory input device (10); and a magnetometer (207) for obtaining a yaw angle of the trajectory input device (10), and correcting data obtained by the gyroscope (206a) using data obtained by the accelerometer (206b) and the magnetometer (207) to obtain an attitude of the trajectory input device (10);
a displacement sensor (102) for acquiring a movement track of the track input device (10) when moving on an input medium, wherein the movement track is displacement in each direction of space;
and a processing unit (103) that corrects the movement trajectory of the trajectory input device (10) on an input medium, which is acquired by the displacement sensor (102), using the attitude of the input device (10) acquired by the attitude sensor (101).
2. The trace input device (10) as claimed in claim 1, wherein the trace input device is a stylus (20) and the displacement sensor comprises a photosensor (208).
3. The trajectory input device (10) of claim 2, wherein the stylus (20) includes: a barrel (201) having an inner space; a pen point (202) positioned at one end of the pen holder (201); wherein,
the gyroscope (206a), the accelerometer (206b), the magnetometer (207) and the photosensor (208) are housed in the internal space of the pen barrel (201) and coaxial with the stylus (20); and is
The processing unit (103) obtains a posture transfer matrix according to the posture of the stylus (20), and corrects the movement track of the pen tip (202) on the input medium by using the posture transfer matrix, wherein the correction comprises
Obtaining the posture of the stylus (20) by fusing data acquired by the accelerometer (206b) and the magnetometer (207) and data acquired by the gyroscope (206 a).
4. The trajectory input device (10) as set forth in claim 3, wherein the processing unit (103) performs the fusion using a complementary filtering algorithm.
5. The trajectory input device (10) according to claim 3, wherein the processing unit (103) performs the fusion using a Kalman filtering algorithm.
6. The trajectory input device (10) of any of claims 1-5, wherein the input medium is paper.
7. A trajectory input method using the trajectory input device (10) of claim 1, comprising the steps of:
step a, when the track input device (10) moves on an input medium, acquiring the posture of the track input device and the movement track of the track input device, wherein the movement track is displacement in each direction of space;
and b, correcting the moving track of the track input device (10) on the input medium by using the posture of the track input device (10).
8. The trajectory input method as set forth in claim 7, wherein the trajectory input device (10) is a stylus (20), and the displacement sensor includes a photosensor (208).
9. The trajectory input method according to claim 8, wherein the stylus (20) includes: a barrel (201) having an inner space; a pen point (202) positioned at one end of the pen holder (201); wherein,
the gyroscope (206a), the accelerometer (206b), the magnetometer (207) and the photosensor (208) are housed in the internal space of the pen barrel (201) and coaxial with the stylus (20); and is
The step b comprises the following steps:
the processing unit (103) obtains a posture transfer matrix according to the posture of the stylus (20), and corrects the moving track of the pen point (202) on the input medium by using the posture transfer matrix, wherein the correction comprises
Obtaining the posture of the stylus (20) by fusing data acquired by the accelerometer (206b) and the magnetometer (207) and data acquired by the gyroscope (206 a).
10. Trajectory input method according to claim 9, wherein said processing unit (103) performs said fusion by using a complementary filtering algorithm.
11. The trajectory input method according to claim 9, wherein the processing unit (103) performs the fusion using a kalman filter algorithm.
12. The trajectory input method according to any one of claims 7 to 11, wherein the input medium is paper.
CN201510971483.4A 2015-12-22 2015-12-22 Track input device and track input method Active CN105607764B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510971483.4A CN105607764B (en) 2015-12-22 2015-12-22 Track input device and track input method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510971483.4A CN105607764B (en) 2015-12-22 2015-12-22 Track input device and track input method

Publications (2)

Publication Number Publication Date
CN105607764A CN105607764A (en) 2016-05-25
CN105607764B true CN105607764B (en) 2019-08-13

Family

ID=55987746

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510971483.4A Active CN105607764B (en) 2015-12-22 2015-12-22 Track input device and track input method

Country Status (1)

Country Link
CN (1) CN105607764B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019090766A1 (en) * 2017-11-13 2019-05-16 深圳市柔宇科技有限公司 Method for calibrating handwriting on writing board, and writing board
CN108920126B (en) * 2018-06-14 2021-10-15 Oppo广东移动通信有限公司 Method, device, storage medium and terminal for processing ringtone volume
CN110262739A (en) * 2019-07-01 2019-09-20 联想(北京)有限公司 Switching method, device and electronic equipment
CN111312014A (en) * 2020-04-14 2020-06-19 青岛真水堂教育咨询有限公司 A high accuracy intelligence interconnection pen for calligraphy exercise
CN111475035A (en) * 2020-04-14 2020-07-31 青岛真水堂教育咨询有限公司 Intelligent writing equipment based on calligraphy exercise
CN113625887A (en) * 2021-07-01 2021-11-09 华东师范大学 Writing track acquisition equipment, writing pen, system and method applied to writing track acquisition equipment
CN117315790B (en) * 2023-11-28 2024-03-19 恒银金融科技股份有限公司 Analysis method of hand writing action and intelligent pen
CN118394229B (en) * 2024-04-22 2024-11-29 深圳市左木科技有限公司 Intelligent touch pen interaction method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915171A (en) * 2011-08-04 2013-02-06 王振兴 Method of generating trajectory
CN104007846A (en) * 2014-05-22 2014-08-27 深圳市宇恒互动科技开发有限公司 Three-dimensional figure generating method and electronic whiteboard system
CN205263759U (en) * 2015-12-22 2016-05-25 汉王科技股份有限公司 Trajectory input device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102375567A (en) * 2010-08-23 2012-03-14 圆展科技股份有限公司 Pen-shaped pointing device, displacement information providing method, and displacement information providing system
US9631956B2 (en) * 2014-01-03 2017-04-25 Google Technology Holdings LLC Methods and systems for calibrating sensors of a computing device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915171A (en) * 2011-08-04 2013-02-06 王振兴 Method of generating trajectory
CN104007846A (en) * 2014-05-22 2014-08-27 深圳市宇恒互动科技开发有限公司 Three-dimensional figure generating method and electronic whiteboard system
CN205263759U (en) * 2015-12-22 2016-05-25 汉王科技股份有限公司 Trajectory input device

Also Published As

Publication number Publication date
CN105607764A (en) 2016-05-25

Similar Documents

Publication Publication Date Title
CN105607764B (en) Track input device and track input method
TWI474265B (en) Moving trajectory calibration method and moving trajectory generation method
CN106933390B (en) Stylus detection method and system combining inertial technology and ultrasonic wave
CN101872259B (en) Natural interaction pen capable of automatically inputting written contents and handwriting detection method
US10521011B2 (en) Calibration of inertial measurement units attached to arms of a user and to a head mounted device
EP3022623B1 (en) Electronic pen
CN100432904C (en) Inertial sensor assembly
CN101872260B (en) Remote interactive pen and handwriting detection method
CN103226398B (en) Based on the data glove of micro-inertia sensor network technology
CN109798891B (en) Inertial measurement unit calibration system based on high-precision motion capture system
CN110785729B (en) Electronic device for generating analog strokes and for digital storage of analog strokes and input system and method for digitizing analog recordings
CN102375567A (en) Pen-shaped pointing device, displacement information providing method, and displacement information providing system
JP4033929B2 (en) Pen-type input device
CN111344654B (en) Determining writing direction by inertial sensor
JP2009223839A (en) Pen type input device and handwriting input method
CN103389808A (en) Space mouse and method for obtaining displacement of space mouse
CN205263759U (en) Trajectory input device
US9442577B2 (en) System for inputting graphical elements
CN110647282A (en) A method for acquiring handwritten track information
TW201610764A (en) Accurately positioning instruments
EP2965177B1 (en) Using portable electronic devices for user input on a computer
JP3655021B2 (en) Pen-type input device
CN113039511B (en) Writing device with electromagnetic tracking
US20070267229A1 (en) Method for Recognizing the Path of a Tip a Body on a Medium
CN114882148A (en) Handwriting recovery method and device, electronic pen and display device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant