intelacademic diy 05 maestro pololu usb card

Upload: mickey1222

Post on 03-Jun-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    1/35

    Intel Do-It-Yourself Challenge

    Maestro Pololu USB card

    Cdric Andreolliwww.Intel-Software-Academic-Program.com

    aul.guermonre!"intel.comIntel Software#$%&-$#-$'

    http://www.intel-software-academic-program.com/http://www.intel-software-academic-program.com/
  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    2/35

    Agenda

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    3/35

    Agenda

    Introduction

    Configuring the Android ro(ect

    USB Communications

    Manage the Pololu card

    Create an A

    Conclusion

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    4/35

    Introduction

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    5/35

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    6/35

    Configuring the AndroidPro(ect

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    7/35

    Configuring the Android Pro(ect

    5e will use Android Intentsto launch thealication.

    You won,t 6e a6le to start the a if 0ou don,t

    lug the Pololu to the hone.)his ro(ect uses the Micro Maestro 7 channelscard 6ut 0ou will 6e a6le to adat the code toanother card.

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    8/35

    Configuring the Android Pro(ect

    Create a new Android Application

    Create a 6asic Android alication. Choose aBlank Activity.

    In this course8 our alication is namedPololuUSBController.

    Our plan is to create an application that will be launched byAndroid when the Pololu is plugged.

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    9/35

    Configuring the Android Pro(ect

    Open the Manifest

    Automatic launch can 6e achie*e with Intents

    9irst8 change the intent-filter to

    You can directl0 add a meta-data mar:u to lin:a USB de*ice filter

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    10/35

    Configuring the Android Pro(ect

    Create the file device_filter

    Create a folderxmlin resand add a 3ml file(device_filter.xml)

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    11/35

    Configuring the Android Pro(ect

    Retrieve your card information

    Plug the Maestro card to 0our comuter andoen a terminal

    )0e the following command

    You can outut the command in a file and loo:for ;Maestroen PololuUSBController....=

    requestis the oeration code

    indexreresents the channel

    buffercan 6e set to null8 length to $

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    16/35

    USB Communications

    Operation codes

    ere are the different oeration codes a*aila6le+

    =@U@S)?S@)?S@=>?A=IABE@ $3'28

    =@U@S)?S@)?)A=F@) $3'G

    S@)?)A=F@) allows to change the osition ofthe ser*o

    S@)?S@=>?A=IABE@ allows to modif0 ser*oarameters 1such as seed and acceleration4

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    17/35

    USB Communications

    Encapsulate !" communications

    Eet,s create a new Ha*a interface

    And a new class that imlements this interface

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    18/35

    USB Communications

    Encapsulate !" communications

    Imlements the interface with thecontrol)ransfert method

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    19/35

    USB Communications

    Encapsulate !" communications

    Set osition uses the command $3'G8 numcorresonds to the ser*o num6er

    )he *alue of positionis in uarter of

    microseconds8 so we multil0 the position60 2

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    20/35

    USB Communications

    Encapsulate !" communications

    Seed can 6e set 60 using the command $3'21S@)?S@=>?A=IABE@4

    5e (ust need to ro*ide the speed*alue

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    21/35

    USB Communications

    Encapsulate !" communications

    Acceleration can 6e set 60 using the command$3'2 1S@)?S@=>?A=IABE@4

    5e must use the 2tharameter to set the ser*o

    num6er and to define the t0e of *aria6le)o set the acceleration8 the most significant 60teof the channel must 6e $3'

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    22/35

    Manage the Pololu card

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    23/35

    Manage the Pololu card

    Create a new class

    Create a class to manage the ololu card

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    24/35

    Manage the Pololu card

    #ill the constructor

    )he constructor is ri*ate and is called from astatic method 1createCard4

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    25/35

    Manage the Pololu card

    $rovide controls on the servos

    )he card must 6e a6le to send information to theser*o motors

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    26/35

    Manage the Pololu card

    $rovide a builder

    )he card is 6uilt *ia a static method

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    27/35

    Create an a

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    28/35

    Create an a

    Create your xml view

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    29/35

    Create an a

    Add behavior

    In 0our acti*it08 in the onCreatemethod

    You write similar code for accelerationand seed

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    30/35

    Create an a

    Add behavior

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    31/35

    Create an a

    Other improvements %

    You can use the sensors to automaticall0acti*ate the ser*o motors

    You can use the FPS data to modif0 ser*omotor,s 6eha*iors

    Intel organi!e a contest on ara-gliderautonomous drones using those technologies

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    32/35

    Conclusion

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    33/35

    Conclusion

    Control your card with your Intel phone

    An Intel hone is a comuter8 0ou can rogram itto control the Maestro card

    )a:e ad*antage of the owerful CPU8 sensors8FPS8 etc that the Intel hone can ro*ide

    If you have ideas that use Intel hardware and$ololu cards& feel free to let us 'now

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    34/35

  • 8/11/2019 IntelAcademic DIY 05 Maestro Pololu USB Card

    35/35

    Eicense Creati*e Commons - B0 &.$

    (ou are free)to !hareJ to co08 distri6ute and transmit the wor:

    to RemixJ to adat the wor:

    to ma:e commercial use of the wor:

    nder the followin* conditions)

    AttributionJ You must attri6ute the wor: in the manner secified 60 the author or licensor 16ut not in

    an0 wa0 that suggests that the0 endorse 0ou or 0our use of the wor:4.+ith the understandin* that)

    +aiverJ An0 of the a6o*e conditions can 6e wai*ed if 0ou get ermission from the co0right holder.

    $ublic ,omainJ 5here the wor: or an0 of its elements is in the u6lic domain under alica6le law8that status is in no wa0 affected 60 the license.

    Other Ri*htsJ In no wa0 are an0 of the following rights affected 60 the license+

    Your fair dealing or fair use rights8 or other alica6le co0right e3cetions and limitationsK)he author,s moral rightsK=ights other ersons ma0 ha*e either in the wor: itself or in how the wor: is used8 such as u6licit0 or ri*ac0 rights.

    -oticeJ 9or an0 reuse or distri6ution8 0ou must ma:e clear to others the license terms of this wor:.)he 6est wa0 to do this is with a lin: to this we6 age.

    htt+LLcreati*ecommons.orgLlicensesL60L&.$L

    http://creativecommons.org/licenses/by/3.0/http://creativecommons.org/licenses/by/3.0/http://creativecommons.org/licenses/by/3.0/