Future Technology Devices International Ltd. Application Note AN_202 VNC2 Android Robotic ARM Demo Guide Document Reference No.:FT_000586 Version 1.0 Issue Date: 2012-02-09 This document describes how the Vinculum device, VNC2 may be used with the VINCO Touch Key shield to control the servo motors of a Robotic Arm controlled from an Android platform in Android Open Accessory mode. Future Technology Devices International Limited (FTDI) Unit 1, 2 Seaward Place, Glasgow G41 1HH, United Kingdom Tel.: +44 (0) 141 429 2777 Fax: + 44 (0) 141 429 2758 E-Mail (Support): [email protected] Web: http://www.ftdichip.com Copyright © 2012 Future Technology Devices International Limited Application Note AN_202 VNC2_Android_Robotic_ARM_Demo Document Reference No.: FT_000586 Version 1.0 Clearance No.: FTDI# 278 Table of Contents 1 2 3 4 Introduction .................................................................... 2 1.1 Overview ................................................................................... 2 1.2 Hardware Requirements ........................................................... 2 1.3 Software Requirement .............................................................. 2 Hardware ........................................................................ 3 2.1 VNC2 ......................................................................................... 3 2.2 Vinco Touch Shield .................................................................... 3 2.3 Robotic ARM.............................................................................. 4 Setup .............................................................................. 5 3.1 Application software Setup ....................................................... 5 3.2 Hardware Setup ........................................................................ 5 Demo .............................................................................. 7 4.1 User Button ............................................................................... 8 4.2 Home Button ............................................................................. 8 4.3 Auto Button............................................................................... 8 4.4 Wrist Controller ........................................................................ 8 4.5 Grip Controller .......................................................................... 8 5 Contact Information ........................................................ 9 6 Appendix A – References............................................... 10 Document References ..................................................................... 10 Acronyms and Abbreviations ........................................................... 10 Appendix B – List of Tables & Figures ................................ 11 7 Appendix C – Revision History....................................... 12 Copyright © 2012 Future Technology Devices International Limited 1 Application Note AN_202 VNC2_Android_Robotic_ARM_Demo Document Reference No.: FT_000586 Version 1.0 Clearance No.: FTDI# 278 1 Introduction This document describes how the Vinculum device, VNC2, may be used with the VINCO Touch Key shield to control the servo motors of a Robotic Arm controlled from an Android platform. In this demonstration the Android platform is operating in Open Accessory Mode ie the peripheral, and the VNC2 chip is the USB host that bridges data from the Android USB port to the PWM interface of the servo motors on the robotic arm. Please contact FTDIChip for source code for Android and VNC2 firmware. 1.1 Overview Android Open Accessory mode is a new (Android OS 3.1+) feature that allows Android devices that do not have a USB host port to connect to peripheral hardware. This simplifies driver/application development on the Android platform as no additional drivers are required. Additionally this does not adversely affect battery life in portable platforms as the USB port power must be provided by the accessory attached to the Android platform. The Android Robotic Arm demo uses 4 servo motors connected to the joints of the arm to control the base (left/right), Arm (up/down), wrist (up/down) and Grip (open/close) of the Robotic Arm. Each of these servo motors is controlled from the PWM interface of the VNC2 IC mounted on a VINCO development PCB. One PWM channel is required for each motor. Firmware to connect to the Android platform over the Android Open Accessory Mode of the USB peripheral port and drive the PWM outputs was developed using the free VNC2 toolchain. 1.2 Hardware Requirements Vinco Development Module, pre-programmed with VNC2 Robotic Arm demo firmware. VNC2 Debugger/Programmer Module, optional if VNC2 is pre-programmed with Robotic Demo firmware. Vinco Touch Key Shield Robotic Arm, assembled. Motorola XOOM android tablet, running Android 3.1 or higher. 5volts output DC power supply adapter to Robotic Arm and VNC2. USB cable to power the VNC2 board. 1.3 Software Requirement 1. Pre-programmed VNC2 with Robotic-Arm firmware. 2. Android Robotic Arm source code or apk file. 3. PC with eclipse or some other tool to flash the apk file into Motorola tablet. Copyright © 2012 Future Technology Devices International Limited 2 Application Note AN_202 VNC2_Android_Robotic_ARM_Demo Document Reference No.: FT_000586 Version 1.0 Clearance No.: FTDI# 278 2 Hardware This section describes the hardware modules used in this demo. 2.1 VNC2 Figure 2.1 Vinco Development Module with VNC2 Debug Module 2.2 Vinco Touch Shield Servo 4 Servo 5 Power Input Servo 2 Servo 3 Power Input Jumper Servo 1 Figure 2.2 Vinco Touch-Key Shield Copyright © 2012 Future Technology Devices International Limited 3 Application Note AN_202 VNC2_Android_Robotic_ARM_Demo Document Reference No.: FT_000586 Version 1.0 Clearance No.: FTDI# 278 2.3 Robotic Arm Grip Wrist Arm Shoulder Base Figure 2.3 Robotic Arm The Robotic-Arm uses 5 servos for the control of its Base, shoulder , arm, wrist and grip components. The demo make use of 4 servos, shoulder servo is not being used in the demo, but should be supplied power and must kept in straight vertical position. The servos are from Hitec, http://www.hitecrcd.com/. All the servos require 3-5V peak-to-peak square wave pulse. The pulse duration is from 0.9 ms to 2.1 ms with 1.5 ms as centre. The pulse refreshe rate is 50 Hz. Hitec servos used in the robotic-Arm require supply voltages in the range of 4.8V-6V. Copyright © 2012 Future Technology Devices International Limited 4 Application Note AN_202 VNC2_Android_Robotic_ARM_Demo Document Reference No.: FT_000586 Version 1.0 Clearance No.: FTDI# 278 3 Setup This section describes the setup of demo. 3.1 Application software Setup An Android application was developed in JAVA for a Motorola Xoom tablet running Android 3.1. The Android application uses standard Android widgets, such as seekbar, edittext, textview, buttons, and, imageview. The compiled output that runs on the Android platform is called RoboticArmDemoActivity.apk. this is the file that must be loaded onto the Motorola Xoom/ To program the Android application, user need to setup the Eclipse environment as described in Android Developers at http://developer.android.com/sdk/installing.html. This web link will provide information on loading applications onto the Android platform over USB. 3.2 Hardware Setup Note: It is assumed that Robotic Arm is assembled as described by the manufacturer of the Robotic Arm. 1. Remove any power supplied to Vinco and Vinco Touch-Key Shield. 2. Mount the Vinco Touch-Key shield to Vinco; follow the connectors on touch-shield. 3. Connect Robotic Arm’s Base to Servo3. 4. Connect Robotic Arm’s shoulder to Servo 5. 5. Connect Robotic Arm’s Arm to servo 4. 6. Connect Robotic Arm’s wrist to Servo 1. 7. Connect Robotic Arm’s grip to Servo 2. 8. Put a jumper into 1 and 2 position of “Power Input Jumper”. 9. Hold the Robotic Arm’s shoulder into straight position, just like in figure 3.1 10. Connect the external power supply into the power input socket on Vinco Touch-Key Shield. Copyright © 2012 Future Technology Devices International Limited 5 Application Note AN_202 VNC2_Android_Robotic_ARM_Demo Document Reference No.: FT_000586 Version 1.0 Clearance No.: FTDI# 278 Figure 3.1 Robotic Arm Assembled Copyright © 2012 Future Technology Devices International Limited 6 Application Note AN_202 VNC2_Android_Robotic_ARM_Demo Document Reference No.: FT_000586 4 Version 1.0 Clearance No.: FTDI# 278 Demo After completing the configuration and assembly steps as described in section 3, supply power to VNC2. After supplying the power to VNC2, connect the Motorola Xoom tablet to host port of VNC2. Note: remember to hold the Robotic Arm’s shoulder in straight position before supplying power to Vinco touch-key shield and VNC2. Note: do not move any part of the Robotic Arm’s parts by force while power is supplied. For adjusting any part of Robotic Arm, remove the power supply to Vinco Touch-Key shield. When the USB port 1 (VINCO CN2) is connected to the Android platform the application shown below will automatically start. : Y Axis Grip Controller Auto Button Wrist controller X-axis Home Button User Button Figure 4.1 Android Application Copyright © 2012 Future Technology Devices International Limited 7 Application Note AN_202 VNC2_Android_Robotic_ARM_Demo Document Reference No.: FT_000586 Version 1.0 Clearance No.: FTDI# 278 4.1 User Button To control the movement of Robotic Arm, the user has to press User button. At the start, the demo setup is in user mode. In user mode user can control the movement of Robotic Arm. 1. To move the Arm up, rotate the Android tablet slowly along the x-axis in upwards direction. 2. To move the Arm down, rotate the Android tablet slowly along the x-axis in downward direction. 3. To move the Arm to left, rotate the Android tablet slowly along the y-axis in left direction. 4. To move the Arm to right, rotate the Android tablet slowly along the y-axis in right direction. 5. To move the wrist up, slide a finger to the right direction on the wrist controller. 6. To move the wrist down, slide a finger towards the left direction on the wrist controller. 7. To open the grip, slide a finger toward the right direction on the grip controller. 8. To close the grip, slide a finger towards the left direction on the grip controller. 4.2 Home Button To bring the Robotic Arm into a default state, i.e, straight arm, wrist and open grip, use the Home button. In Home mode, the user controls are disabled, i.e. user movement, touch wouldn’t affect the Robotic Arm’s movement. To control the Robotic Arm again by user, press the User button. 4.3 Auto Button The auto button puts the Robotic Arm in auto mode. In auto mode, the movements of Robotic Arm’s are fixed to pre-defined controls. In auto mode, the user controls are disabled, i.e. user movement, touch wouldn’t affect the Robotic Arm’s movement. To control the Robotic Arm again by user, press the User button. 4.4 Wrist Controller In User mode, Wrist controller controls the movement of wrist. To move the wrist up, slide a finger on wrist controller towards the right direction. To move the wrist down, slide a finger to the left direction on wrist controller. 4.5 Grip Controller In User mode, Grip controller controls the movement of grip. To open the grip, slide a finger on grip controller towards the right direction. To close grip, slide a finger to the left direction on grip controller. Copyright © 2012 Future Technology Devices International Limited 8 Application Note AN_202 VNC2_Android_Robotic_ARM_Demo Document Reference No.: FT_000586 Version 1.0 Clearance No.: FTDI# 278 5 Contact Information Head Office – Glasgow, UK Branch Office – Hillsboro, Oregon, USA Future Technology Devices International Limited Unit 1, 2 Seaward Place, Centurion Business Park Glasgow G41 1HH United Kingdom Tel: +44 (0) 141 429 2777 Fax: +44 (0) 141 429 2758 Future Technology Devices International Limited (USA) 7235 NW Evergreen Parkway, Suite 600 Hillsboro, OR 97123-5803 USA Tel: +1 (503) 547 0988 Fax: +1 (503) 547 0987 E-mail (Sales) E-mail (Support) E-mail (General Enquiries) E-Mail (Sales) E-Mail (Support) E-Mail (General Enquiries) [email protected] [email protected] [email protected] Branch Office – Taipei, Taiwan Future Technology Devices International Limited (Taiwan) 2F, No. 516, Sec. 1, NeiHu Road Taipei 114 Taiwan , R.O.C. Tel: +886 (0) 2 8791 3570 Fax: +886 (0) 2 8791 3576 E-mail (Sales) E-mail (Support) E-mail (General Enquiries) [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] Branch Office – Shanghai, China Future Technology Devices International Limited (China) Room 408, 317 Xianxia Road, Shanghai, 200051 China Tel: +86 21 62351596 Fax: +86 21 62351595 E-mail (Sales) E-mail (Support) E-mail (General Enquiries) [email protected] [email protected] [email protected] Web Site http://ftdichip.com System and equipment manufacturers and designers are responsible to ensure that their systems, and any Future Technology Devices International Ltd (FTDI) devices incorporated in their systems, meet all applicable safety, regulatory and system-level performance requirements. All application-related information in this document (including application descriptions, suggested FTDI devices and other materials) is provided for reference only. While FTDI has taken care to assure it is accurate, this information is subject to customer confirmation, and FTDI disclaims all liability for system designs and for any applications assistance provided by FTDI. Use of FTDI devices in life support and/or safety applications is entirely at the user’s risk, and the user agrees to defend, indemnify and hold harmless FTDI from any and all damages, claims, suits or expense resulting from such use. This document is subject to change without notice. No freedom to use patents or other intellectual property rights is implied by the publication of this document. Neither the whole nor any part of the information contained in, or the product described in this document, may be adapted or reproduced in any material or electronic form without the prior written consent of the copyright holder. Future Technology Devices International Ltd, Unit 1, 2 Seaward Place, Centurion Business Park, Glasgow G41 1HH, United Kingdom. Scotland Registered Company Number: SC136640 Copyright © 2012 Future Technology Devices International Limited 9 Application Note AN_202 VNC2_Android_Robotic_ARM_Demo Document Reference No.: FT_000586 Version 1.0 Clearance No.: FTDI# 278 6 Appendix A – References Document References [1] FTDI Application Note 142, http://www.ftdichip.com/Support/Documents/AppNotes/AN_142_VinculumII_Tool_Chain_Getting_Started_Guide.pdf [2] FTDI Application Note 151, http://www.ftdichip.com/Support/Documents/AppNotes/AN_151%20Vinculum%20II%20User%20Guide. pdf VNC2 Datasheet : http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_Vinculum-II.pdf VINCO Datasheet : http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_Vinco.pdf TouchKey Shield datasheet : http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_Vinco_Touchkey_Shield.pdf http://www.ftdichip.com/Support/Documents/AppNotes/AN_159%20VinculumII%20Firmware%20Flash%20Programming.pdf Acronyms and Abbreviations USB Universal Serial Bus Copyright © 2012 Future Technology Devices International Limited 10 Application Note AN_202 VNC2_Android_Robotic_ARM_Demo Document Reference No.: FT_000586 Version 1.0 Clearance No.: FTDI# 278 Appendix B – List of Tables & Figures List of Tables No table of figures entries found. List of Figures Figure 2.1 Vinco Development Module with VNC2 Debug Module ............................... 3 Figure 2.2 Vinco Touch-Key Shield ............................................................................. 3 Figure 2.3 Robotic Arm ............................................................................................... 4 Figure 3.1 Robotic Arm Assembled ............................................................................. 6 Figure 4.1 Android Application ................................................................................... 7 Copyright © 2012 Future Technology Devices International Limited 11 Application Note AN_202 VNC2_Android_Robotic_ARM_Demo Document Reference No.: FT_000586 Version 1.0 Clearance No.: FTDI# 278 7 Appendix C – Revision History Document Title: AN_202 VNC2_Android_Robotic_Arm_Demo Document Reference No.: FT_000586 Clearance No.: FTDI# 278 Product Page: http://www.ftdichip.com/Products/ICs/VNC2.htm Document Feedback: Send Feedback Revision Changes Date 1.0 Initial Release 2012-02-09 Copyright © 2012 Future Technology Devices International Limited 12