The following relates to systems and methods for obtaining magnetometer readings for performing a magnetometer calibration.
A magnetometer is an instrument used to measure the strength and/or direction of the magnetic field in the vicinity of the instrument. Many electronic devices exist that utilize a magnetometer for taking measurements for a particular application, e.g. metal detectors, geophysical instruments, aerospace equipment, and mobile communications devices such as cellular telephones, PDAs, smart phones, tablet computers, etc., to name a few.
Devices that comprise a magnetometer and have a display and processing capabilities, e.g. a smart phone may include a compass application for showing direction on the display.
Mobile communication devices, such as those listed above, can operate in many different locations and under various circumstances. Changes in the environment in which the device operates can affect the operation of the magnetometer. As such, the magnetometer may need to be calibrated at certain times.
Embodiments will now be described by way of example only with reference to the appended drawings wherein:
It will be appreciated that for simplicity and clarity of illustration, where considered appropriate, reference numerals may be repeated among the figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth in order to provide a thorough understanding of the example embodiments described herein. However, it will be understood by those of ordinary skill in the art that the example embodiments described herein may be practised without these specific details. In other instances, well-known methods, procedures and components have not been described in detail so as not to obscure the example embodiments described herein. Also, the description is not to be considered as limiting the scope of the example embodiments described herein.
An exterior view of an example mobile device 10 is shown in
An example configuration for a mobile device 10 comprising a magnetometer 20 is shown in
In operation, the magnetometer 20 typically determines quality measures for readings from the magnetometer sensor 22 as they are collected, and such quality measures are then associated with the corresponding data stored in the magnetometer sensor readings data store 24, to enable the magnetometer 20 to provide an indication of quality at the same time that it provides the magnetometer sensor reading itself. By applying quality indicators, the magnetometer calibration module 26 can detect whether or not a current magnetometer calibration (i.e. due to the last calibration performed on the magnetometer sensor 22) is of good or poor quality.
The quality indicators used for calibrating a three-axis magnetometer sensor 22 can be used separately by the magnetometer 20 to, in part, determine when to calibrate the magnetometer sensor 22. The magnetometer sensor 22 may be calibrated in various ways, including those calibration methods described later, for inaccuracies in gain (which can be different for each axis), DC offset (which can also be different for each axis), and inter-axis misalignment angles. DC offset refers to the steady state bias (i.e. offset) of sensor axes (e.g. 3 values, 1 per sensor axis for a 3-axis magnetometer). The DC offset is the sensor axes' measurement point of intersection origin, and the DC offset is usually is non-zero, as the DC offset typically has a bias due to the net effect of the hard iron inside the mobile device 10. As such, a calibration of the magnetometer sensor 22 can be performed to improve the accuracy of three calibration parameters, which may apply to each axis. Application of the calibration parameters enables the magnetometer sensor readings 24 to be improved, for example, to improve the shape of the magnetic field measured as shown in
One type of calibration that may be performed by the magnetometer calibration module 26 is a calibration method that relies on movement of the mobile device 10 to obtain various readings. For example, the magnetometer calibration module 26 may be operable to display one or more instructions in a UI using the display module 32, to have a user participate in facilitating such movements. The movements associated with a magnetometer calibration method are often referred to as a “magnetometer calibration gesture” or “gesture”, for short. A calibration method that involves such user interaction may be referred to as a “foreground” calibration.
It has been found that, in order to obtain a sufficient number of magnetometer readings to perform a foreground calibration, a desired path of movement of the mobile device 10 should be chosen that enables the calibration method to improve the magnetometer sensor's readings without requiring a lengthy calibration routine or onerous participation by the user (including frequent requests to re-calibrate). Such a path should be capable of orienting the mobile device 10 in such a way that readings can be obtained while the mobile device 10 is positioned such that the magnetometer sensor 22 can obtain readings comprising a range of values, for at least two axes.
Although various paths can be chosen to achieve the requisite number of positions, it can be difficult to instruct a user how to make the corresponding movements. For example, it has been found that instructing the user to move the mobile device 10 in a “Figure Eight” pattern can be insufficient. In particular, since a figure eight may be visualized as a two-dimensional pattern, it has been found that the user often performs the requested movements in a single plane, which has the effect of making it difficult to obtain a sufficient number of distinct readings, and may even fail to obtain both positive and negative readings along a single axis if, for example, the mobile device 10 is substantially facing magnetic north. Even if a calibration can be performed, the calibration may be of poor quality and repeated or frequent foreground calibrations are then required to maintain operability of an application 28 using the magnetometer 20.
In order to consistently obtain readings in both the positive and negative directions along two or more axes, a plurality of visual elements 34 can be used which represent at least a pair of movements. Each of the movements, when performed, have the mobile device oriented in substantially opposite positions, in an attempt to obtain a range of readings for one of the axes with respect to the device. By illustrating at least a pair of movements, at least two measurements can be obtained when the mobile device is oppositely directed, to acquire sufficient knowledge of the shape of magnetic field. In this way, the visual elements instruct the user in performing a series of movements that achieve such orientations. Magnetometer readings made during these movements may then be used to perform a foreground calibration that more efficiently calculates the necessary calibration parameters.
An example set of visual elements 34 is shown in
A first of the example movements shown in
It can be appreciated that in this example embodiment, “upright” refers to a positioning or orientation wherein the display 14 of the mobile device 10 is above the keyboard 18 and substantially aligned with the Y axis as shown in
A second of the example movements shown in
It can be appreciated that in this example embodiment, “face down” refers to a positioning or orientation wherein the display 14 is directed towards the ground or floor, i.e. substantially facing the negative Y direction according to what is shown in
It can be appreciated that the example movements and orientations depicted in
The movements made according to the visual elements 34 shown in the example embodiment illustrated in
At orientation (1) in
The path 38 arcs between orientation (1) and orientation (2), wherein the mobile device 10 is meant to be sideways or otherwise on its side, i.e. rotated approximately 90 degrees about an axis passing through the display 14, with respect to orientation (1). The magnetometer sensor 22 obtains a reading (X, Y, Z) in orientation (2) that is ideally (−MAX, 0, 0), where −MAX refers to a substantially maximum reading along the X axis in the negative (−) direction. Similar to orientation (1), at orientation (2), one or more of the Y reading and the Z reading may be SMALL, due to imperfect positioning. The path 38 continues the arc in completing the first movement to orientation (3), wherein the mobile device 10 is meant to be upside down with respect to the position shown in association with orientation (1), i.e. rotated approximately 180 degrees about an axis passing through the display 14, with respect to orientation (1). The magnetometer sensor 22 obtains a reading (X, Y, Z) in orientation (3) that is ideally (0, −MAX, 0), wherein −MAX refers to a substantially maximum reading along the Y axis in the negative (−) direction. Similar to orientations (1) and (2), at orientation (3), one or more of the X reading and the Z reading may be SMALL, due to imperfect positioning. It can be appreciated that completion of the first movement between orientations (1) and (3) encourages readings in the X direction that range from zero to −X (or +X if tilted the other way or with opposite coordinate system). By including orientation (2), the rotation about a single axis (Z in this example) is further clarified to avoid extraneous rotations that minimize the changes in X readings. For example, a movement between orientation (1) and orientation (3), without including an orientation (2) with the mobile device 10 facing the same direction, could result in transitions from topside up to face down, to top down, to face up, which would not achieve the same range of readings for X.
It can be appreciated that during movement of the mobile device 10 according to the path 38, the first of the at least a pair of movements comprises a rotation of the mobile device 10 about the Z axis from orientation (1), to orientation (2), to orientation (3), while the display 14 of the mobile device 10 faces the positive Z direction, in order to obtain a range of values for the X axis.
The second movement in this example embodiment begins by having the mobile device 10 positioned in orientation (4a), wherein the mobile device 10 is meant to be facing downwardly, i.e. the display 14 facing substantially towards the ground or floor. It can be appreciated that the path 38 shown in
The second movement continues by having the mobile device 10 rotated or “flipped” substantially about its Z axis while tilting or rotating substantially about the X axis to orientation (5), which is meant to be substantially the same as orientation (1). It can be appreciated from
It has been recognized that the path 38 between orientations (4a) and (5), namely by having the orientation of the mobile device 10 return to an upright position facing the user, encourages readings in the Z direction that range from zero or −Z to +Z. By obtaining both the positive and negative readings, the likelihood of crossing the origin of the ellipsoid is increased.
The second of the movements according to the path 38 thus includes a rotation of the mobile device 10 about the Z axis when the Z axis is aligned along the length of the mobile device 10, beginning with the display 14 of the mobile device facing downwardly, i.e. facing substantially towards the floor or ground along the negative Y direction at orientation (4a), and returning to orientation (1). During such a movement, the mobile device 10 is oppositely positioned by the mobile device 10 to obtain a range of values in the Z direction by being turned over to have the display 14 tilted back towards the user in order to return the mobile device 10 to a position facing the user, when the mobile device 10 is aligned in the upright position again. It can be appreciated that by having the second movement performed in such a way, the opposite positioning of the mobile device 10 at orientation 4(b), with respect to orientation 4(a), can be inherently achieved. In other words, in order to perform the movement depicted using visual elements 34g and 34h on a portion of the path 38 returning to the orientation depicted in visual element 34a, the mobile device 10 is inherently orientated in a position opposite the position depicted using visual element 34g to thereby obtain the range of readings in the Z direction.
The path 38 not only positions the mobile device 10 in opposite directions to enable a range of readings for at least two axes, but also facilitates a determination of how closely the magnetometer readings are to lying on a sphere. In this example embodiment, the path 38 from orientation (1) to orientation (3) obtains a portion of the sphere representing the magnetic field, which may be envisioned as a three-dimensional slice such as a segment of an orange. Additional portions of the sphere are also obtained along the path 38 from orientation (3) to orientation (4a) and from orientation (4b) to orientation (5). It can be appreciated that the portions of the sphere obtained between (1) and (3) and (4a) to (4b) would each define approximately ½ of the shape, whereas the portions obtained between (3) to (4a) and between (4b) to (5) would define approximately ¼ of the shape respectively.
By instructing the user to repeat the movements according to the visual elements 34, the magnetometer sensor 22 can repeatedly follow the path 38 shown in
As discussed above, the visual elements 34 may include a series of graphics that depict the way in which the mobile device 10 may appear to the user in the various orientations.
It can be appreciated that various identifying characteristic can be used to enable the orientations of the mobile device 10 to be distinguished from each other. For example,
It can be appreciated that the number of visual elements 34 displayed, and whether or not arrows, text, or other accompanying elements are used, can vary. For example, as shown in
It can also be appreciated that the plurality of visual elements 34 can be displayed using a plurality of screens, as shown in
It can be seen in
Turning now to
The foreground calibration, during execution, and while displaying the plurality of visual elements 34, includes a determination at 64, of whether or not a sufficient number of readings have been obtained in order to compute new calibration parameters at 66. An example of such a determination is provided below. After determining that a sufficient number of readings have been obtained, the new calibration parameters may be computed at 66, and a notification of a completed calibration can be provided at 68. The notification provided at 68 can include any one or more of: a visual alert such as an LED or camera flash, a screen flash, replacement of the graphic 53 with another graphic or textual message; an audible alert, such as a tone, beep, series of tones or beeps, etc.; and a haptic or tactile alert, such as a vibration. It can be appreciated that the notification of a completed calibration may also be provided by simply removing the visual elements 34 (e.g. graphic 53) and returning to the application 28, 30, homescreen or other UI that was being used prior to initiation of the foreground calibration.
An example set of computer executable operations for performing a foreground calibration 70 is shown in
The magnetometer calibration module 26 then determines at 64a and 64b if enough samples have been accumulated in order to initiate the fast calibration at 66a. As will be explained in greater detail below, the fast calibration 66a can be used to correct DC offset only, which is faster than performing a calibration of all three parameters and can be used to assist in increasing the number of samples in the list 74. In
In the present example, once the number of readings in the list 74 is greater than or equal to 4, but not yet greater than or equal to 9, the fast calibration is initiated at 66a. The fast calibration may be repeated in order to more quickly increase the number of readings in the list 74 in order to initiate the full calibration at 66b. Once the fast calibration is successful, the foreground calibration 70 enters the UNCALIBRATED_DCO state. If the foreground calibration 70 is in the UNCALIBRATED or UNCALIBRATED_DCO states, once 9 or more readings are in the list 74, the full calibration is initiated at 66b in order to correct all three calibration parameters. Once the full calibration succeeds, the foreground calibration 70 enters the CALIBRATED state and the calibration ends at 88.
It may be noted that in this example, if the foreground calibration 70 is in the UNCALIBRATED_DCO or CALIBRATED states, the calibration corrections may be applied to the raw input sensor data in order to obtain the calibrated output data. With the foreground calibration 70 complete, it can be appreciated that an ongoing calibration can take over, e.g. to perform background calibrations when appropriate.
It can also be appreciated that separating the foreground calibration 70 into two stages, one comprising a fast calibration and the other comprising a full calibration, several desirable advantages are realized. The fast calibration initially provides coarse heading information with very little device movement required. As the user continues to move the mobile device 10, the fast calibration is able continually refine the calibration. Once the user has moved the mobile device 10 through more movements, a full and more accurate calibration is performed to compensate for all three parameters. In other words, as the user begins moving the mobile device 10, the magnetometer calibration module 26 can quickly begin calibrating the magnetometer sensor 22, even if the user has not yet progressed through a significant portion of the path.
As discussed above, the foreground calibration 70 may utilize a fast calibration to estimate and remove DC offset/bias from a set of readings, in this example of a three-axis magnetometer 20. Removing such an offset is considered important as the DC offset can be a significant contributor to the overall magnetometer inaccuracy.
The fast calibration is initiated when 3 or more sufficiently different or unique readings have been obtained.
The full calibration is used to estimate and remove the effects of not only DC offset/bias, but also gain and inter-axis misalignment errors from a set of readings of a three-axis magnetometer 24. Removing such effects is important in order to maximize the overall accuracy of the magnetometer sensor 22 and the applications 28, 30 utilizing same.
In this example embodiment, the full calibration is initiated when 9 or more sufficiently different or unique readings have been obtained.
Referring now to
The main processor 202 also interacts with additional subsystems such as a Random Access Memory (RAM) 206, a flash memory 208, a display 32, an auxiliary input/output (I/O) subsystem 212, a data port 214, a keyboard 216, a speaker 218, a microphone 220, GPS receiver 221, magnetometer 20, short-range communications 222, and other device subsystems 224.
Some of the subsystems of the mobile device 10 perform communication-related functions, whereas other subsystems may provide “resident” or on-device functions. By way of example, the display 32 and the keyboard 216 may be used for both communication-related functions, such as entering a text message for transmission over the network 250, and device-resident functions such as a calculator or task list.
The mobile device 10 can send and receive communication signals over the wireless network 250 after required network registration or activation procedures have been completed. Network access is associated with a subscriber or user of the mobile device 10. To identify a subscriber, the mobile device 10 may use a subscriber module. Examples of such subscriber modules include a Subscriber Identity Module (SIM) developed for GSM networks, a Removable User Identity Module (RUIM) developed for CDMA networks and a Universal Subscriber Identity Module (USIM) developed for 3G networks such as UMTS. In the example shown, a SIM/RUIM/USIM 226 is to be inserted into a SIM/RUIM/USIM interface 228 in order to communicate with a network. The SIM/RUIM/USIM component 226 is one type of a conventional “smart card” that can be used to identify a subscriber of the mobile device 10 and to personalize the mobile device 10, among other things. Without the component 226, the mobile device 10 may not be fully operational for communication with the wireless network 250. By inserting the SIM/RUIM/USIM 226 into the SIM/RUIM/USIM interface 228, a subscriber can access all subscribed services. Services may include: web browsing and messaging such as e-mail, voice mail, SMS, and MMS. More advanced services may include: point of sale, field service and sales force automation. The SIM/RUIM/USIM 226 includes a processor and memory for storing information. Once the SIM/RUIM/USIM 226 is inserted into the SIM/RUIM/USIM interface 228, it is coupled to the main processor 202. In order to identify the subscriber, the SIM/RUIM/USIM 226 can include some user parameters such as an International Mobile Subscriber Identity (IMSI). An advantage of using the SIM/RUIM/USIM 226 is that a subscriber is not necessarily bound by any single physical mobile device. The SIM/RUIM/USIM 226 may store additional subscriber information for a mobile device as well, including datebook (or calendar) information and recent call information. Alternatively, user identification information can also be programmed into the flash memory 208.
The mobile device 10 is typically a battery-powered device and may include a battery interface 232 for receiving one or more batteries 230 (typically rechargeable). In at least some embodiments, the battery 230 can be a smart battery with an embedded microprocessor. The battery interface 232 is coupled to a regulator (not shown), which assists the battery 230 in providing power V+ to the mobile device 10. Although current technology makes use of a battery, future technologies such as micro fuel cells may provide the power to the mobile device 10.
The mobile device 10 also includes an operating system (OS) 234 and software components 236 to 246. The operating system 234 and the software components 236 to 246 that are executed by the main processor 202 are typically stored in a persistent store such as the flash memory 208, which may alternatively be a read-only memory (ROM) or similar storage element (not shown). Those skilled in the art will appreciate that portions of the operating system 234 and the software components 236 to 246, such as specific device applications, or parts thereof, may be temporarily loaded into a volatile store such as the RAM 206. Other software components can also be included, as is well known to those skilled in the art.
The subset of software applications 236 that control basic device operations, including data and voice communication applications, may be installed on the mobile device 10 during its manufacture. Other software applications include a message application 238 that can be any suitable software program that allows a user of the mobile device 10 to send and receive electronic messages. Various alternatives exist for the message application 238 as is well known to those skilled in the art. Messages that have been sent or received by the user are typically stored in the flash memory 208 of the mobile device 10 or some other suitable storage element in the mobile device 10. In at least some embodiments, some of the sent and received messages may be stored remotely from the mobile device 10 such as in a data store of an associated host system that the mobile device 10 communicates with.
The software applications can further comprise a device state module 240, a Personal Information Manager (PIM) 242, and other suitable modules (not shown). The device state module 240 provides persistence, i.e. the device state module 240 ensures that important device data is stored in persistent memory, such as the flash memory 208, so that the data is not lost when the mobile device 10 is turned off or loses power.
The PIM 242 includes functionality for organizing and managing data items of interest to the user, such as, but not limited to, e-mail, contacts, calendar events, voice mails, appointments, and task items. A PIM application has the ability to send and receive data items via the wireless network 250. PIM data items may be seamlessly integrated, synchronized, and updated via the wireless network 250 with the mobile device subscriber's corresponding data items stored and/or associated with a host computer system. This functionality creates a mirrored host computer on the mobile device 10 with respect to such items. This can be particularly advantageous when the host computer system is the mobile device subscriber's office computer system.
The mobile device 10 may also comprise a connect module 244, and an IT policy module 246. The connect module 244 implements the communication protocols that are required for the mobile device 10 to communicate with the wireless infrastructure and any host system, such as an enterprise system, that the mobile device 10 is authorized to interface with.
The connect module 244 includes a set of APIs that can be integrated with the mobile device 10 to allow the mobile device 10 to use any number of services associated with the enterprise system. The connect module 244 allows the mobile device 10 to establish an end-to-end secure, authenticated communication pipe with a host system (not shown). A subset of applications for which access is provided by the connect module 244 can be used to pass IT policy commands from the host system to the mobile device 10. This can be done in a wireless or wired manner. These instructions can then be passed to the IT policy module 246 to modify the configuration of the device 10. Alternatively, in some cases, the IT policy update can also be done over a wired connection.
The IT policy module 246 receives IT policy data that encodes the IT policy. The IT policy module 246 then ensures that the IT policy data is authenticated by the mobile device 10. The IT policy data can then be stored in the flash memory 206 in its native form. After the IT policy data is stored, a global notification can be sent by the IT policy module 246 to all of the applications residing on the mobile device 10. Applications for which the IT policy may be applicable then respond by reading the IT policy data to look for IT policy rules that are applicable.
Other types of software applications or components 239 can also be installed on the mobile device 10. These software applications 239 can be pre-installed applications (i.e. other than message application 238) or third party applications, which are added after the manufacture of the mobile device 10. Examples of third party applications include games, calculators, utilities, etc.
The additional applications 239 can be loaded onto the mobile device 10 through at least one of the wireless network 250, the auxiliary I/O subsystem 212, the data port 214, the short-range communications subsystem 222, or any other suitable device subsystem 224. This flexibility in application installation increases the functionality of the mobile device 10 and may provide enhanced on-device functions, communication-related functions, or both. For example, secure communication applications may enable electronic commerce functions and other such financial transactions to be performed using the mobile device 10.
The data port 214 enables a subscriber to set preferences through an external device or software application and extends the capabilities of the mobile device 10 by providing for information or software downloads to the mobile device 10 other than through a wireless communication network. The alternate download path may, for example, be used to load an encryption key onto the mobile device 10 through a direct and thus reliable and trusted connection to provide secure device communication.
The data port 214 can be any suitable port that enables data communication between the mobile device 10 and another computing device. The data port 214 can be a serial or a parallel port. In some instances, the data port 214 can be a USB port that includes data lines for data transfer and a supply line that can provide a charging current to charge the battery 230 of the mobile device 10.
The short-range communications subsystem 222 provides for communication between the mobile device 10 and different systems or devices, without the use of the wireless network 250. For example, the subsystem 222 may include an infrared device and associated circuits and components for short-range communication. Examples of short-range communication standards include standards developed by the Infrared Data Association (IrDA), Bluetooth, and the 802.11 family of standards developed by IEEE.
In use, a received signal such as a text message, an e-mail message, or web page download may be processed by the communication subsystem 204 and input to the main processor 202. The main processor 202 may then process the received signal for output to the display 32 or alternatively to the auxiliary I/O subsystem 212. A subscriber may also compose data items, such as e-mail messages, for example, using the keyboard 216 in conjunction with the display 32 and possibly the auxiliary I/O subsystem 212. The auxiliary subsystem 212 may comprise devices such as: a touch screen, mouse, track ball, infrared fingerprint detector, or a roller wheel with dynamic button pressing capability. The keyboard 216 is an alphanumeric keyboard and/or telephone-type keypad. However, other types of keyboards may also be used. A composed item may be transmitted over the wireless network 250 through the communication subsystem 204.
For voice communications, the overall operation of the mobile device 10 in this example is substantially similar, except that the received signals are output to the speaker 218, and signals for transmission are generated by the microphone 220. Alternative voice or audio I/O subsystems, such as a voice message recording subsystem, can also be implemented on the mobile device 10. Although voice or audio signal output is accomplished primarily through the speaker 218, the display 32 can also be used to provide additional information such as the identity of a calling party, duration of a voice call, or other voice call related information.
It will be appreciated that any module or component exemplified herein that executes instructions may include or otherwise have access to computer readable media such as storage media, computer storage media, or data storage devices (removable and/or non-removable) such as, for example, magnetic disks, optical disks, or tape. Computer storage media may include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. Examples of computer storage media include RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by an application, module, or both. Any such computer storage media may be part of the mobile device 10 (or other computing or communication device that utilizes similar principles) or accessible or connectable thereto. Any application or module herein described may be implemented using computer readable/executable instructions that may be stored or otherwise held by such computer readable media.
It will be appreciated that the example embodiments and corresponding diagrams used herein are for illustrative purposes only. Different configurations and terminology can be used without departing from the principles expressed herein. For instance, components and modules can be added, deleted, modified, or arranged with differing connections without departing from these principles.
The steps or operations in the flow charts and diagrams described herein are just for example. There may be many variations to these steps or operations without departing from the spirit of the invention or inventions. For instance, the steps may be performed in a differing order, or steps may be added, deleted, or modified.
Although the above principles have been described with reference to certain specific example embodiments, various modifications thereof will be apparent to those skilled in the art as outlined in the appended claims.