AN Theory of Operation. Abstract. 1 Introduction. Using the AS5046 Rotary Encoder in 3D Joystick Applications APPLICATION NOTE

Similar documents
ams AG austriamicrosystems AG is now The technical content of this austriamicrosystems application note is still valid. Contact information:

1 General Description

AS5161-EK-AB / AS5162-EK-AB 12 BIT Magnetic Angle Position Sensor

ams AG austriamicrosystems AG is now The technical content of this austriamicrosystems document is still valid. Contact information:

Operation Manual: AS5600-SO_EK_AB AS bit Programmable Contactless Potentiometer. Revision 1.0 /

AS5261-EK-AB / AS5262-EK-AB 12 BIT Magnetic Angle Position Sensor with 2 Outputs

Operation Manual: AS5048-EK-AB-STM1.0. AS5048 Eval-Kit Stepper Motor

AS5510. User Manual AS5510 Adapterboard. 10-bit Linear Incremental Position Sensor with Digital Angle output

AS1904, AS1905, AS1906 Ultra Low-Power µp Supervisory Circuit

User Manual AS5304 / AS5306 Demo Kit AS5304 / AS step Linear Incremental Position Sensor with ABI output

AS1370. Application Note: AS1370-AN01- Evaluation Board Description. High Voltage, Low Quiescent Current, 200mA LDO. AN01-Evaluation Board Description

1 AS5048 Demoboard. AS5048 Demoboard OPERATION MANUAL. Application Note

NSE5310. User Manual NSE5310 AB bit Linear Incremental Position Sensor with I 2 C and PWM output

Application Note: AS3935-AN01 Demo Board Description AS3935. Franklin Lightning Sensor Demo Board. Revision 1.1 / 21/11/12 page 1/20

Application Note: 48V-BMS-AN01 General Description 48V-BMS. AN01 General Description. Revision 1.0 / 06/10/15 page 1/15

Eval Kit Manual. DN[Document ID] AS6200. Adapter Board AS6200-WL_EK_AB. ams Eval Kit Manual Page 1

Application Note. DN [Document ID] AS72xx. How to Program AS72xx Firmware with FlashCatUSB. ams Application Note Page 1

US1881 CMOS Multi-purpose latch

Calibration Software PTC04 User Manual

TSL250R, TSL251R, TSL252R

The AS5055 is available in a small QFN 16-pin 4x4x0.85mm package and specified over an operating temperature of -20 to +85 C.

Applications Solid state switch Brushless DC motor commutation Speed sensing Linear position sensing Angular position sensing

DVK kHz RFID Development Kit User Manual

PTC04-DB-HALL05 Daughter Board for Melexis PTC devices

AS AS1918 Microprocessor Supervisory Circuits with Manual Reset and Watchdog

Eval Kit Manual. AS726x-iSPI Evaluation Kit User Guide. ams Eval Kit Manual Page 1

Eval Kit Manual. DN[Document ID] CCS811. Standard Board CCS811-LG_EK_ST. ams Eval Kit Manual Page 1

Documentation For Melexis USB LIN master used in demo setups and development kits

Temperature Sensor Module (TSM) Evaluation Board User Manual

AS General Description DEMOBOARD AND SOFTWARE OPERATION MANUAL PROGRAMMABLE MAGNETIC ROTARY ENCODER. 1.1 The AS5046 Demoboard

Eval Kit Manual. AS7265x Multispectral Chipset Evaluation Kit User Guide. ams Eval Kit Manual Page 1

ED-22 Analog Output Series Magnetic Encoder

ME15 Magnetic Encoder Manual Revision 1.1

DIGITAL COMPASS-RD DIGITAL COMPASS REFERENCE DESIGN KIT USER' S GUIDE. 1. Kit Contents. 2. Introduction. 3. Quick-Start Guide. 4. General Description

MLX Features and Benefits Chopper stabilized amplifier stage Micropower consumption for batterypowered

Eval Kit Manual. DN[Document ID] TDC-GPX2. Standard Board GPX2-EVA-KIT. ams Eval Kit Manual Page 1

AT60142H/HT. Rad-Hard 512Kx8 Very Low Power CMOS SRAM ERRATA-SHEET. Active Errata List. Errata History. Abbreviations. 1.

PTC04-DB-FastLoader Daughter Board for Melexis PTC devices

3D Magnetic Sensor 2 Go - TLE493D-A2B6

AppNote-US2400-EVB Low Power 2.4GHz Transceiver

US72/73 Single Coil Fan Driver

Atmel AVR1619: XMEGA-B1 Xplained Demonstration. 8-bit Atmel Microcontrollers. Application Note. Features. 1 Introduction

ZSSC5101 Evaluation Kit Description

SNL16000 MTP EV chip (with 2Mx16 Flash Memory)

Schematic Capture Lab 1

SUPPORT MATRIX. Comtrade OMi Management Pack for Citrix

TCS40DPR. Digital Output Magnetic Sensor. Feature. Marking Pin Assignment (Top View) Function Table PA8

ams AG austriamicrosystems AG is now The technical content of this austriamicrosystems application note is still valid. Contact information:

AVR42789: Writing to Flash on the New tinyavr Platform Using Assembly

Setup and Users Manual

Get Started with PTC-04 programmer

AS5055 AS General Description. 2 Block diagram EN_INT/ INT/ VDDp VSS VDD. Preliminary datasheet. Low power 12 bit magnetic rotary encoder

MLX90248 Micropower & Omnipolar Hall Switch

AS5055. Low Power 12 Bit Magnetic Rotary Encoder. 1 General Description. 3 Key Features. 2 Benefits. 4 Applications. Data Sheet

SKY LF: GHz, 20 db Variable Voltage Attenuator

SNC36060 Four Channels Speech Controller

AT03262: SAM D/R/L/C System Pin Multiplexer (SYSTEM PINMUX) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

Please refer to "4. Evaluation Board" on page 2 for more information about these steps. Figure 1. System Connections

Application Note: AS3953-AN01 Demoboard Description AS3953 NFC interface IC (Tag Demokit)

Si7005USB-DONGLE. EVALUATION DONGLE KIT FOR THE Si7005 TEMPERATURE AND HUMIDITY SENSOR. 1. Introduction. 2. Evaluation Kit Description

SUPPORT MATRIX. HYCU OMi Management Pack for Citrix

Release Information. Revision History. Version: build 018 Release Date: 23 rd November 2011

Placement & Routing. Lab 8. Placing Parts

EDBG. Description. Programmers and Debuggers USER GUIDE

SNC Four Channels Speech Controller

HID-USB-to-IR-RD HID USB TO IR REFERENCE DESIGN USER S GUIDE. 1. Kit Contents. 2. Software Download

TLE5xxx(D) Calibration 360

MEAS TEMPERATURE SYSTEM SENSOR (TSYS01) XPLAINED PRO BOARD

One Identity Quick Connect Express

Upgrading BankLink Books

Demo Kit Manual. DN[Document ID] AS3956. Standard Board AS3956-WL_DK_ST. ams Demo Kit Manual Page 1

T600 TACHOMETER MultiTasker - a measurement & monitoring instrument with 2 frequency and 1 analog inputs

SKY33108: BAW GHz WiFi Pass/ GHz WiMAX Reject Filter

Trimble S6 and SPS700 Total Station Firmware

Evaluation Board User Guide UG-047

AN205 CP210X BAUD RATE SUPPORT. Relevant Devices This application note applies to the following devices: CP2102, CP

Si1140-DK. Si1140 DEVELOPMENT KIT USER S GUIDE. 1. Kit Contents. Figure 1. Si1143 Evaluation Board

Dual Channel LVDT/RVDT Readout/Controller

BNO055 Quick start guide

AT21CS Series Reset and Discovery. Introduction. Serial EEPROM APPLICATION NOTE

MEAS HTU21D PERIPHERAL MODULE

HYCU SCOM Management Pack for F5 BIG-IP


One-channel Toggle-mode Touch Sensor IC with Power Management Functions AT42QT1012. Summary

EVB-USB2517 Evaluation Board User Manual (Revision A)

Smart Card Bridge to Full-Speed USB, SPI, and UART Interfaces

EMC2113. RPM-Based Fan Controller with Multiple Temperature Zones & Hardware Thermal Shutdown PRODUCT FEATURES. General Description.

SKY LF: GHz SP3T Switch

SKY LF: 20 MHz-2.5 GHz, 10 W phemt SPDT Switch

Native route discovery algorithm

ConnexLink. User s Manual Version 1.0

Tisio CE Release Notes

INTRODUCTION. Mechanical Considerations APPLICATION NOTE Z86E21 THERMAL PRINTER CONTROLLER ZILOG

Complete USB2.0 Digital Wireless Audio Dongle

Data Sheet for Joysticks

mcube Proprietary APS v1.0 1 / mcube Inc. All rights reserved.

ams AG austriamicrosystems AG is now The technical content of this austriamicrosystems application note is still valid. Contact information:

SKY LF: 0.1 to 3.0 GHz GaAs SPDT Switch

SKY LF: GHz Dual SPDT Crossed Switch

Part No. Temperature Code Package Code Option code MLX90809 L (-40 C to 150 C) XG EAD-000-RE. 1 Functional Diagram 2 General Description

Transcription:

AN5046-10 Using the AS5046 Rotary Encoder in 3D Joystick Applications APPLICATION NOTE This document introduces the background and details necessary to understand the joystick application. It is assumed that the reader of this document has knowledge of the operating principle of hall-based rotary encoders and the AS5046 data sheet. 2 Theory of Operation The three degrees of movement of the joystick are illustrated in Figure 1. The degrees of movement are tilt direction α tilt, tilt inclination relative to the z-axis ϕ tilt and the distance of the magnet to the center of the hall element array d. Note: The tilt angle s pivot point is located at the center of the hall element array. Abstract Integrated Hall Effect Rotary Encoders can be used for accurate contactless angle measurements. However, by using an axially magnetized magnet instead of a diametrically magnetized a rotary encoder can be used to determine tilt direction as well as the tilt inclination. Additionally the distance between the magnet and the encoder can be estimated which allows to implement a push button functionality. The AS5046 allows easy determination of this information and thus provides an ideal basis for various contactless joystick-like applications. ϕ 1 Introduction Hall Effect based Rotary Encoders like the austriamicrosystems AS5046 enable a robust way to measure angular positions when used in combination with an diametrically magnetized magnet. The immunity against dust and the absence of mechanical parts make sensors built upon the AS5000 series ideal for use within harsh operating environments. The application of these rotary encoders is not limited to angular measurements only. If the magnet is changed to an axially magnetized type the AS5046 can be used to measure the tilt direction and to estimate the tilt inclination. In addition to tilt direction and inclination a push button function can be implemented by using the so-called align mode of the rotary encoder. Figure 1: Illustration of the definitions α Revision 1.0, 21-May-2007 Page 1 of 5

2.1 Determining Tilt Direction, Tilt Inclination and Magnet Distance When tilting an axially magnetised magnet the Hall Elements will detect the inclined magnetic field lines. For this reason a change of the magnet is all that is required to change a rotary encoder into a 3-D joystick. Table 1 states the changes in application of the AS5046 SIU register reading when using an axially instead of diametrically magnetized magnet. Usage Rotary Encoder Used Bomatec Magnet Order # 6x2.5mm diametric 2694 Angular Position SIU Position SIU Magnitude Alignment Mode Vertical Distance Magnet Alignment 3-D Joystick 6x2.5mm axial magnetised 2991 Tilt Direction Tilt Inclination Vertical Distance of Magnet (important f. Push-Button) With just one serial read command (reading the SIU register) tilt direction and tilt inclination is available. When moving the magnet closer to the chip the absolute value of the flux density at the Hall Elements increases. For this reason the distance of the magnet can easily be read when using the Alignment-Mode of the AS5046 and reading the position related bytes of the SIU register. The relation of the flux density and tilt direction is nonlinear, depends on the diameter of the hall element array, the physical dimensions of the magnet, and the distance between the magnet and the hall element array. However, those properties are constant for a given magnet. 3 Implementing a 3D Joystick with an AS5046 The austriamicrosystems AS5046 magnetic rotary encoder features all components required to compute the tilt inclination and direction as well as the vertical distance (push button functionality). 3.1 Polar Coordinates Transformation Some applications require the magnet s inclination data to be represented in a polar form. For example the emulation of behaviour of hat switches used in gaming pads. For this application the AS5046 SIU register (in conjunction with the OTP zero position and CCW bits) provides all data required. The direction of tilt equals the position available in the SIU register of the AS5046. The tilt inclination is proportional to the magnitude value of the SIU. Example Code The following code illustrates the basic operation of a hat switch emulation. It uses the two MSB of the position information to determine the tilt direction (north, east, south, west, etc.) and compares the magnitude value to a threshold (with hysteresis to avoid fast toggling of states when the magnet is held at a transition level) to decide whether the joystick is tilted far enough or still considered to be in a centred position. // Variable f. Center Position Hysteresis static int CtrMagThresh = LOW_MAG_THRESHOLD; // read angle and magnitude information type_identifier = 0x05, num_bytes = 4); // decide whether the joystick is centered // from the magnitude information and threshold if(buffer[2] < CtrMagThresh) state = CENTER; CtrMagThresh = HIGH_MAG_THRESHOLD else // determine tilt direction by reading // the position information in SIU // three MSB will enable the detection of 8 positions switch(buffer[0] >> 5) case 0: state = NORTH; break; case 1: state = NORTH_EAST; break; case 2: state = EAST; break; case 3: state = SOUTH_EAST; break; case 4: state = SOUTH; break; case 5: state = SOUTH_WEST; break; case 6: state = WEST; break; case 7: state = NORTH_WEST; break; default: state = UNDEFINED; CtrMagThresh = LOW_MAG_THRESHOLD Revision 1.0, 21-May-2007 Page 2 of 5

3.2 Rectangular Application In many applications the joystick data is required to be in rectangular representation. A typical example is the data from USB Human Interface Devices (HID) like mice, gamepads, and joysticks. With those applications the tilt direction and inclination has to be represented by a polar coordinates vector x,y T = T tilt cos( α tilt ), ϕtilt sin( α tilt ) ϕ. This information is immediately available in the AS5046 CORDIC register. The x and y components are the input of the on-chip CORDIC (COordinate Rotation DIgital Computer) and can be directly read via the two wire serial interface of the chip. Any residual 22.5 position shift in relation to the chip axis caused by the Hall Element placement can be compensated either mechanically or by software. Example Code The following code snippet is part of an USB HID that enumerates as mouse and therefore allows the cursor on a PC screen to be moved by an AS5046 based joystick. The USB hardware used is a C8051F320 controller from Silicon Labs (see Figure 2). The firmware for the device is based on an example provided by Silicon Labs (AN249: www.silabs.com/public/documents/tpub_doc/anote/microcon trollers/usb/en/an249.pdf ) and the only necessary code change to create an AS5046 based joystick besides implementing the serial interface code is shown below. // read COS and SIN data // see data sheet for details type_identifier = 0x04, num_bytes = 3); // X_Axis (COS) IN_PACKET[1] = (buffer[0]>>1); The example code uses only the seven MSB of the 12 bit SIN and COS data of the AS5046 in order to create a hysteresis around the joystick s idle position. 3.3 Push Button Application As mentioned in the theory part the push button functionality uses the mean value of the flux density. In order to measure the magnetic flux density (so to say the magnitude) the Alignment Mode of the AS5046 is used. During Align Mode all eight Hall Element values are summed up. Instead of the position information the field strength is now available in the SIU position register. The following example code illustrates the operation but uses only the eight MSB for simplicity. // enable align mode of AS5046 CSn = 1; PROG = 1; CSn = 0; PROG = 0; // read flux density information type_identifier = 0x05, num_bytes = 4); // decide whether the magnet is pushed or not if(buffer[0] > FLUX_DENSITY_THRESHOLD) state = PUSHED; It should be noted, when using the Alignment Mode to measure flux density for push button functionality the magnet has to be in centred position (Magnitude = 0). Summing all Hall Element field strength values in tilted position may lead to a maximum readout even if the magnet is not pushed. // Y_Axis (SIN) IN_PACKET[2] = (buffer[1]>>1); Revision 1.0, 21-May-2007 Page 3 of 5

4 Schematic 4.1 USB Interface Board Figure 2: Schematic of USB Interface 4.2 AS5046 Interface Board (Joystick) Figure 3: Schematic of AS5046 Interface Board Revision 1.0, 21-May-2007 Page 4 of 5

5 Contact 5.1 Headquarters austriamicrosystems AG Fax: +43 3136 525 01 info@austriamicrosystems.com?subject=as5040 www.austriamicrosystems.com A 8141 Schloss Premstätten, Austria Phone: +43 3136 500 0 Copyrights Copyright 1997-2007, austriamicrosystems AG, Schloss Premstaetten, 8141 Unterpremstaetten, Austria-Europe. Trademarks Registered. All rights reserved. The material herein may not be reproduced, adapted, merged, translated, stored, or used without the prior written consent of the copyright owner. All products and companies mentioned are trademarks or registered trademarks of their respective companies. This product is protected by U.S. Patent No. 7,095,228. Disclaimer Devices sold by austriamicrosystems AG are covered by the warranty and patent indemnification provisions appearing in its Term of Sale. austriamicrosystems AG makes no warranty, express, statutory, implied, or by description regarding the information set forth herein or regarding the freedom of the described devices from patent infringement. austriamicrosystems AG reserves the right to change specifications and prices at any time and without notice. Therefore, prior to designing this product into a system, it is necessary to check with austriamicrosystems AG for current information. This product is intended for use in normal commercial applications. Applications requiring extended temperature range, unusual environmental requirements, or high reliability applications, such as military, medical life-support or life sustaining equipment are specifically not recommended without additional processing by austriamicrosystems AG for each application. The information furnished here by austriamicrosystems AG is believed to be correct and accurate. However, austriamicrosystems AG shall not be liable to recipient or any third party for any damages, including but not limited to personal injury, property damage, loss of profits, loss of use, interruption of business or indirect, special, incidental or consequential damages, of any kind, in connection with or arising out of the furnishing, performance or use of the technical data herein. No obligation or liability to recipient or any third party shall arise or flow out of austriamicrosystems AG rendering of technical or other services. Revision 1.0, 21-May-2007 Page 5 of 5