Various devices, such as game controllers, may include magnetometers to determine the orientation of the device, and thus to effect control over the device and/or other devices. Although such sensors are typically calibrated one or more times during production, such sensors may be susceptible to a variety of environmental factors during use.
Embodiments are disclosed that relate to calibrating a game controller including a magnetometer during game play. For example, one disclosed embodiment provides a method comprising sampling magnetic information received from the magnetometer, each sample of the magnetic information including a vector component of an ambient magnetic field along each of a first axis, a second axis, and a third axis, the first axis, the second axis, and the third axis being orthogonal to each other. The method further comprises outputting, to a computing device, an initial game controller orientation signal derived from a first sample of a plurality of samples of the magnetic information and from directional offset data including a first directional offset along the first axis, a second directional offset along the second axis, and a third directional offset along the third axis. The method further comprises, for each of the first axis, the second axis, and the third axis, identifying a valid minimum observed value and a valid maximum observed value from the plurality of samples of the magnetic information, and calculating updated directional offset data based on the valid minimum observed value and the valid maximum observed value. The method further comprises outputting to the computing device a calibrated game controller orientation signal derived from a second sample of the plurality of samples of the magnetic information and from the updated directional offset data.
This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter. Furthermore, the claimed subject matter is not limited to implementations that solve any or all disadvantages noted in any part of this disclosure.
As mentioned above, various devices, such as game controllers, may include one or more magnetometers to determine orientation of the device. Typical magnetometers are configured to provide magnetic information comprising a representation (e.g., vector component(s)) of the ambient magnetic field along one or more axes. As used herein, “ambient magnetic field” refers to the earth's magnetic field plus any other detectable fields, such as magnetic field generated by one or more nearby devices, and/or distortion of the earth's magnetic field by one or more nearby materials.
Since the local ambient magnetic field is substantially time-independent during the use of said devices, the field may provide a reference point for detecting orientation of the device. In other words, upon determining the orientation of the ambient magnetic field, manipulation of a game controller including a magnetometer may be determined based on displacement of the game controller relative to the ambient magnetic field. Such a configuration is intended to be non-limiting, and the magnetic information provided by the magnetometer may be usable to determine orientation and/or position of the game controller via any suitable mechanism or combination of mechanisms.
However, it will be appreciated that measurement of the ambient magnetic field may be impacted by various materials that may be present in or around the device. For example, solder, connectors, screws, and other components comprising ferrous materials may distort earth's magnetic field. As such materials are typically not symmetrically distributed about the magnetometer, it will be appreciated that said distortion may be orientation-dependent. To compensate for this distortion, each magnetometer may be calibrated within the final product at the manufacturing level. Said calibration may comprise, for each axis the magnetometer is configured to measure, adjustment of the gain (sensitivity) and/or adjustment of the axis offset, for example.
Although such adjustments may provide accurate measurements “out-of-the-box,” it will be further appreciated that various factors may impact the accuracy of the magnetometer after the initial calibration(s). For example, batteries of varying chemistry (e.g., alkaline vs. NiMH) may distort the magnetic field differently, and may thus require unique calibrations. As another example, if the device housing includes one or more ferrous materials (e.g., via chrome-plating, etc.), changes in said housing (e.g., shift in position, microfractures due to physical trauma, etc.) may impact the performance of the magnetometer. As yet another example, external fields generated within the environment may also cause shifts to the calibration.
Given the dynamic nature of such factors, it will be appreciated that it may be desirable to dynamically calibrate the magnetometer during use. Accordingly, embodiments are disclosed herein that relate to calibrating a game controller including a magnetometer during game play. In other words, the game controller may be designed to provide the calibration while concurrently effecting control over a computing device. As such, no active user calibration (e.g., holding in a pre-defined position, performing a pre-defined motion, etc.) is needed before or during game play. In this way, a user may be able to pick up the controller, take any position, and begin using the controller without performing any explicit calibration.
It will be understood that a racing game scenario is presented for the purpose of example, and is not intended to be limiting in any manner. For example, in other embodiments, rendered object 108 may comprise a plane rendered by a flight simulation game, and thus rotation of controller 102 about axis 112 may effect a corresponding upward or downward pitch of object 108. In yet other embodiments, rotation of controller 102 about axis 114 may effect a corresponding leftward or rightward yaw of rendered object 108. It will be appreciated that motion of controller 102 may be detectable along any one or more degrees of freedom “DOF” and that said motion may effect any suitable control over computing device 104 without departing from the scope of the present disclosure.
As illustrated, controller 102 further comprises U-shaped handle portion 116 (e.g., yoke wheel) configured to be held in one or both hands by the game player. This is not meant to be limiting in any way. In other embodiments, handle portion 116 may comprise a substantially circular (e.g., O-shaped) configuration, as illustrated in
Regardless of the specific configuration, it will be appreciated that controller 102 may be manipulable to any suitable orientation. In other words, controller 102 may have any orientation during game play. Accordingly, as mentioned above, the ambient magnetic field may be usable to determine orientation of controller 102. Although the present disclosure is directed towards using magnetometers to determine orientation, it will be appreciated that additional sensors (e.g., accelerometers, gyroscopes, etc.) may be used in conjunction with the magnetometer. For example, in some embodiments, the magnetometer may be configured to detect the ambient magnetic field along two axes (e.g., axis 110 and axis 112). Accordingly, in such scenarios, when the ambient magnetic field is oriented along the third axis (e.g., axis 114), rotation of controller 102 along said axis may not be detectable via the magnetometer, and thus one or more additional sensors may be used. As another example, the magnetometer may be usable in conjunction with a rotation sensor (e.g., gyroscope) in order to attenuate non-idealities of the rotation sensor (e.g., gyroscopic drift). It will be appreciated that these scenarios are presented for the purpose of example.
Turning now to
As mentioned above, magnetometers may experience non-idealities due to various environmental factors. Further, said non-idealities may be axis-dependent. In other words, the magnetometer of controller 200 may not detect ambient magnetic field as illustrated by vector 216. Instead, for example, magnetometer may detect the ambient magnetic field as represented by uncalibrated vector 220. Uncalibrated vector 220 may be displaced from vector 216 by first directional offset 222 along first axis 206 and/or second directional offset 224 along second axis 208. It will be appreciated that said offsets are presented for the purpose of example, and that the magnetometer may comprise offsets along any one or more axes without departing from the scope of the present disclosure.
Turning now to
It will be appreciated from the preceding discussion that, since the magnetic field is substantially time-independent in both magnitude and direction during game play with reference to the external reference frame, measurement of the ambient magnetic field by a calibrated magnetometer should vary in orientation with the orientation of the magnetometer, while the magnitude stays the same. In other words, manipulation of the magnetometer through all possible orientations (i.e., 360 degree rotation about all three axes) should produce, within the internal reference frame of the magnetometer, an ambient field vector tracing the surface of a sphere centered at the origin with a radius equal to the magnitude of the ambient magnetic field.
It will be further appreciated that since the gain is substantially independent of environmental factors, the error in the measured ambient magnetic field may result in an offset of the center of the sphere from the origin and/or distortion of the sphere into an ellipsoid along one or more axes. Accordingly, providing calibration of the magnetometer may comprise determining an offset (e.g., center of sphere) along one or more axes and subsequently subtracting the offsets from the measured vector in order to provide a calibrated vector output. Two non-limiting embodiments for providing calibration of a game controller including a magnetometer will now be discussed in more detail.
Turning now to
At 404, method 400 may comprise calculating an average magnitude (e.g., root mean square) of the ambient magnetic field based on the magnetic information. For example, calculating the average magnitude may comprise, for each sample of the magnetic information, updating an average of the vector component along each of the first axis, the second axis, and the third axis. The average magnitude may therefore be calculated based on these averages.
Method 400 may further comprise, at 406, maintaining a minimum observed value of the vector component along the axis and a maximum observed value of the vector component along the axis for each of the first axis, the second axis, and the third axis. For example, each sample of the magnetic information may be compared to the maintained minimum and maximum values. If the sample includes a vector component that is less than the corresponding maintained minimum value, the maintained minimum value is updated based on the sample. Similarly, if the sample includes a vector component that is greater than the corresponding maintained maximum value, the maintained maximum value is updated based on the sample.
At 408, method 400 comprises outputting, to a computing device (e.g., computing device 104 of
At 410, method 400 comprises, for each of the first axis, the second axis, and the third axis, identifying a valid minimum observed value and a valid maximum observed value from the plurality of samples of the magnetic information. Identifying the valid minimum observed value and the maximum observed value may comprise determining 412 a magnitude range between the minimum observed value and the maximum observed value. Identifying 410 further comprises determining 414 a test range based on the average magnitude of the ambient magnetic field. For example, in some embodiments, the test range may be equal to twice the average magnitude along the axis scaled by a factor less than one (e.g., 0.93). Identifying 410 may further comprise comparing the magnitude range to the test range at 416, and, if the magnitude range is greater than the test range, acknowledging 418 the minimum observed value as the valid minimum observed value and the maximum observed value as the valid maximum observed value.
For example, turning briefly to
Returning to
At 424, method 400 further comprises outputting to the computing device a calibrated game controller orientation signal derived from a second sample of the plurality of samples of the magnetic information and from the updated directional offset data. As with the initial game controller orientation signal, the calibrated game controller orientation signal may be usable to effect control over the computing device and/or over applications presented thereby. In this way, it will be appreciated that method 400 may be usable to concurrently effect control over the computing device and to continuously and automatically calibrate the signal(s) effecting said control during normal use of the game controller.
Method 400 may further comprise, at 426, detecting a reinitialization trigger. Although the direction and magnitude of the ambient electric field may remain substantially constant during a given instance of use, it will be appreciated that the magnetic field may vary between the instances of use (e.g., different environments, different date/time, physical trauma to controller, etc.). Accordingly, in some embodiments, the reinitialization trigger may comprise a power event 428 of the game controller (e.g., on/off, standby, etc.). In other words, since power events typically delineate the various instances of use, it may be desirable to reinitialize the data upon detection of such events. In other embodiments, a user may initiate a reinitialization trigger. It will be appreciated that these scenarios are presented for the purpose of example, and that the directional offset data may be reinitialized according to any suitable trigger or combination of triggers without departing from the scope of the present disclosure. Regardless of the trigger, method 400 thus further comprises, at 430, reinitializing the directional offset data in response to detecting the trigger.
It will be further appreciated that the calibration provided by method 400 may be susceptible to spikes in the ambient magnetic field that may occur during game play. In other words, if an anomalous minimum or maximum value is detected, the above-described calibration may experience errors until the directional offset data is reinitialized. It may therefore be desirable to utilize a different calibration mechanism that is less-susceptible to such anomalous fields.
Accordingly, turning now to
At 606, method 600 comprises calculating updated directional offset data based on the plurality of samples of the magnetic information and on the directional offset data. Calculating 606 may comprise identifying 608 a first set of samples of the plurality of samples of the magnetic information, wherein the vector component of the magnetic information along the first axis is substantially zero for each of the samples of the first set of samples. Calculating 606 may further comprise identifying 610 a second set of samples of the plurality of samples of the magnetic information, wherein the vector component of the magnetic information along the second axis is substantially zero for each of the samples of the second set of samples.
For example, turning briefly to
Returning to
In order to provide said stable results, in some embodiments, the first set of samples and the second set of samples may be determined based on the angle between the samples. For example, in some embodiments, samples that are separated by an angle greater than or equal to a threshold voltage (e.g., 75 degrees) may be used. In such embodiments, determining the first set of samples and the second samples may therefore comprise identifying a first valid sample, identifying a first candidate sample, determining an angle between the vector components of the first valid sample and the vector components of the first candidate sample, and, if the angle is greater than a threshold angle, acknowledging the first candidate sample as a second valid sample.
Turning now to
A similar approach may be usable to determine the directional offsets along plane 714 (e.g., Yos and Zos) via samples 708, 712, and 712 with proper substitution of vector components. Although the above discussion was directed towards planes 714 and 722, it will be appreciated, as mentioned above, that any two planes may be usable to determine the offset along the three axes.
Returning to
Method 600 further comprises, at 616, outputting to the computing device a calibrated game controller orientation signal derived from a second sample of the plurality of samples of the magnetic information and the updated directional offset data. Further, in contrast to method 400 of
While discussed above in the context of a U-shaped handle, it is to be understood that wireless controllers may have virtually any shape without departing from the scope of this disclosure. As another nonlimiting example,
In some embodiments, the methods and processes described above may be tied to a computing system of one or more computing devices. In particular, such methods and processes may be implemented as a computer-application program or service, an application-programming interface (API), a library, and/or other computer-program product.
Computing system 900 includes a logic subsystem 902 and a storage subsystem 904. Computing system 900 may optionally include a display subsystem 906, input subsystem 908, communication subsystem 910, and/or other components not shown in
Logic subsystem 902 includes one or more physical devices configured to execute instructions. For example, the logic subsystem may be configured to execute instructions that are part of one or more applications, services, programs, routines, libraries, objects, components, data structures, or other logical constructs. Such instructions may be implemented to perform a task, implement a data type, transform the state of one or more components, or otherwise arrive at a desired result.
The logic subsystem may include one or more processors configured to execute software instructions. Additionally or alternatively, the logic subsystem may include one or more hardware or firmware logic machines configured to execute hardware or firmware instructions. The processors of the logic subsystem may be single-core or multi-core, and the programs executed thereon may be configured for sequential, parallel or distributed processing. The logic subsystem may optionally include individual components that are distributed among two or more devices, which can be remotely located and/or configured for coordinated processing. Aspects of the logic subsystem may be virtualized and executed by remotely accessible, networked computing devices configured in a cloud-computing configuration.
Storage subsystem 904 includes one or more physical, non-transitory, devices configured to hold data and/or instructions executable by the logic subsystem to implement the methods and processes described herein. When such methods and processes are implemented, the state of storage subsystem 904 may be transformed—e.g., to hold different data.
Storage subsystem 904 may include removable media and/or built-in devices. Storage subsystem 904 may include optical memory devices (e.g., CD, DVD, HD-DVD, Blu-Ray Disc, etc.), semiconductor memory devices (e.g., RAM, EPROM, EEPROM, etc.) and/or magnetic memory devices (e.g., hard-disk drive, floppy-disk drive, tape drive, MRAM, etc.), among others. Storage subsystem 904 may include volatile, nonvolatile, dynamic, static, read/write, read-only, random-access, sequential-access, location-addressable, file-addressable, and/or content-addressable devices.
It will be appreciated that storage subsystem 904 includes one or more physical, non-transitory devices. However, in some embodiments, aspects of the instructions described herein may be propagated in a transitory fashion by a pure signal (e.g., an electromagnetic signal, an optical signal, etc.) that is not held by a physical device for a finite duration. Furthermore, data and/or other forms of information pertaining to the present disclosure may be propagated by a pure signal.
In some embodiments, aspects of logic subsystem 902 and of storage subsystem 904 may be integrated together into one or more hardware-logic components through which the functionally described herein may be enacted. Such hardware-logic components may include field-programmable gate arrays (FPGAs), program- and application-specific integrated circuits (PASIC/ASICs), program- and application-specific standard products (PSSP/ASSPs), system-on-a-chip (SOC) systems, and complex programmable logic devices (CPLDs), for example.
The terms “module,” “program,” and “engine” may be used to describe an aspect of computing system 900 implemented to perform a particular function. In some cases, a module, program, or engine may be instantiated via logic subsystem 902 executing instructions held by storage subsystem 904. It will be understood that different modules, programs, and/or engines may be instantiated from the same application, service, code block, object, library, routine, API, function, etc. Likewise, the same module, program, and/or engine may be instantiated by different applications, services, code blocks, objects, routines, APIs, functions, etc. The terms “module,” “program,” and “engine” may encompass individual or groups of executable files, data files, libraries, drivers, scripts, database records, etc.
When included, display subsystem 906 may be used to present a visual representation of data held by storage subsystem 904. This visual representation may take the form of a graphical user interface (GUI). As the herein described methods and processes change the data held by the storage subsystem, and thus transform the state of the storage subsystem, the state of display subsystem 906 may likewise be transformed to visually represent changes in the underlying data. Display subsystem 906 may include one or more display devices utilizing virtually any type of technology. Such display devices may be combined with logic subsystem 902 and/or storage subsystem 904 in a shared enclosure, or such display devices may be peripheral display devices.
When included, input subsystem 908 may comprise or interface with one or more user-input devices such as a keyboard, mouse, touch screen, or game controller. In some embodiments, the input subsystem may comprise or interface with selected natural user input (NUI) componentry. Such componentry may be integrated or peripheral, and the transduction and/or processing of input actions may be handled on- or off-board. Example NUI componentry may include a microphone for speech and/or voice recognition; an infrared, color, steroscopic, and/or depth camera for machine vision and/or gesture recognition; a head tracker, eye tracker, accelerometer, and/or gyroscope for motion detection and/or intent recognition; as well as electric-field sensing componentry for assessing brain activity.
When included, communication subsystem 910 may be configured to communicatively couple computing system 900 with one or more other computing devices. Communication subsystem 910 may include wired and/or wireless communication devices compatible with one or more different communication protocols. As non-limiting examples, the communication subsystem may be configured for communication via a wireless telephone network, or a wired or wireless local- or wide-area network. In some embodiments, the communication subsystem may allow computing system 900 to send and/or receive messages to and/or from other devices via a network such as the Internet.
It will be understood that the configurations and/or approaches described herein are exemplary in nature, and that these specific embodiments or examples are not to be considered in a limiting sense, because numerous variations are possible. The specific routines or methods described herein may represent one or more of any number of processing strategies. As such, various acts illustrated and/or described may be performed in the sequence illustrated and/or described, in other sequences, in parallel, or omitted. Likewise, the order of the above-described processes may be changed.
The subject matter of the present disclosure includes all novel and nonobvious combinations and subcombinations of the various processes, systems and configurations, and other features, functions, acts, and/or properties disclosed herein, as well as any and all equivalents thereof.