Home
Using RoboPi - Mikronauts.com
Contents
1. copied Q Can we use the less expensive MCP3008 10 bit analog to digical converter instead of the MCP3208 A Yes you can but the driver needs to be modified and the RoboPi libraries and demonstration programs assume that an MCP3208 is used We intend to offer a merged MCP3208 MCP3008 driver soon which will allow a common code base Q Do you have any distributors in lt name of country gt A We are working hard to set up our distribution network Please email your favorite web stores and have them contact us if they are interested in RoboPi http Mikronauts com 19 2014 01 27
2. DO on ADC through a 2k4 current limiting resistor e P25 is MOSI e P26 is CLK e P27 is CS ADC1 ADC8 0 5V Analog inputs connects to the signal pin on ADC1 8 servo style header e the Pi s 5V is used for ADC1 8 to provide cleaner power to Ping s etc http Mikronauts com 5 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning Programming RoboPi with RoboPiLib Using the Raspberry Pi serial port with RoboPi The Raspberry Pi has 3 3V serial RX and TX signals available on its 26 pin header Normally this port is configured to display boot messages after which it becomes a serial console My favorite small text editor is joe which you can install with sudo apt get install joe then sudo joe boot cmdline txt remove console ttyAMAO 115200 kgdboc ttyAMAO 115200 sudo joe etc inittab Find the line T0 23 respawn sbin getty L ttyAMAO 115200 vt100 and insert a in front of T0 23 For the changes to take effect type sudo shutdown now r http Mikronauts com 6 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning RoboPiLib Constants Digital pins can be configured for one of the following four modes INPUT pin mode for a digital input OUTPUT pin mode for a digital output PWM pin mode for a PWM output 0 255 SERVO pin mode for a servo output 0 2500 RoboPiLib Functions void RoboPilnit char device int bps use RoboPilnit dev ttyAMAO 115200 void
3. power from Pi s 5VDC supply or external servo power supply o P16 P23 is powered by 5V from the Pi expansion header for sensors e Screw terminal for providing external power for Servo connectors PO P15 e 8 servo compatible headers for an eight channel 0 5V analog to digital converter with choice of o MCP3008 for 10 bit A D conversion o MCP3208 for 12 bit A D conversion e Choice of 256Kbit or 512Kbit boot EEPROM for the Propeller e On board voltage regulation providing 3 3V with power on LED from the 5V on the Pi header e 4pin I2C expansion header for the Raspberry Pi e 4pin I2C expansion header for the Propeller e 5 pin HCOM connector for use with PropPlug in stand alone operation optional e Mikronauts EZasPi prototyping board can stack below RoboPi e Mikronauts Pi Jumper can stack on top of RoboPi e Mikronauts SchoolBoard and other Propeller products are compatible with RoboPi http Mikronauts com 3 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning RoboPi Printed Circuit Board Here is a top view of where parts are located on the RoboPi printed circuit board AAAA AAAA AAAA 3 8228 0 00000 0 0 0 0j0 00 0 2 bttp Mikronauts com enning oPi iliam H 0 00 0000076 Z a ee o0 o0 000o N VBAT GND z You can refer to this image while wiring your robot after assembling your RoboPi PLEASE NOTE The PROPPLUG connection is for stand alone RoboPi o
4. 0 pos sleep 1 Controlling a Continuous Rotation Servo If you are using continous rotation servos the above code will cause the two servos to be running in the opposite direction ramping the speed down to stopping then ramping up in the other direction Controlling a Standard Servo If you are using standard servos the above code will turn the servos as far as possible in one direction then sweep in the other direction then repeat in the opposite direction http Mikronauts com 11 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning How to use PWM to control Gear Motors Standard motor drivers normally are controlled by two or three digital signals per motor EN A B Three Wire Driver The popular L293D and L298 motor drivers are often configured for EN A B three wire control Some driver boards permanently tie EN high in order to use only two pins however I do not recommend this practice as it is harder on both the motors and batteries more later EN Function 0 Disable the motor driver motor coasts 1 Enable the motor motor turns in direction specified by A or B Note Some motors have an active low input in which case 0 enables the motor and 1 coasts Check the data sheet for your motor controller or motor controller chip for details AB _ Function 0 0 Break 0 1 Rotate in one direction 1 0 Rotate in opposite direction 1 1 Break A B Two Wire interface The inexpensive low curr
5. 014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning How to use Digital Outputs The simplest way of demonstrating a digital output is to use it to light an LED Using LED s to show which bumper is pressed lt insert schematic of two LED s connected to EXP pins through 470R resistors gt include stdio h include RoboPiLib h define LEFT_ BUMPER 0 define RIGHT_BUMPER 1 define LEFT_LED 2 define RIGHT_LED 3 define PRESSED 0 int main int argc char argv pinMode LEFT_BUMPER INPUT pinMode RIGHT_BUMPER INPUT pinMode LEFT_LED OUTPUT pinMode RIGHT_LED OUTPUT while 1 digitalWrite LEFT_LED digitalRead LEFT_BUMPER digitalWrite RIGHT_LED digitalRead RIGHT_BUMPER http Mikronauts com 10 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning How to use Servos include stdio h include RoboPiLib h define LEFT SERVO 8 define RIGHT SERVO 9 define SERVO_MIN 500 may vary between different servos define SERVO_MAX 2500 may vary between different servos int main int argc char argv int pos pinMode LEFT_SERVO SERVO pinMode RIGHT_SERVO SERVO while 1 for pos SERVO_MIN pos lt SERVO_MAX pos 100 servoWrite LEFT_SERVO pos servoWrite RIGHT_SERVO 3000 pos sleep 1 for pos SERVO_MAX pos gt SERVO_MIN pos 100 servoWrite LEFT_SERVO pos servoWrite RIGHT_SERVO 300
6. ER EKEN EEA e EE 17 Appendix B Data SACS 3 5s 275aaecacicce ass teas nectecssva sea sasadeneemenna sa iadann sa cnigaeuaaacase ana ateiaam onc aivearey ie taeas 17 Appendix C SUI eyecare cise coiir inosine in ia AEE E a EE EER RE Semana meee een 17 Appendix D RoboProp Software Compatibility cc scssccsscscsscesessscesscsssscesscssnscescssnscescessenenesees 18 Appendix E Frequently Asked Questions ccsscssscssccsssccsssssscessccesscsenssessceseccesscesassensesessnsessseneeees 19 http Mikronauts com 2 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning Introduction RoboPi is the most advanced robot controller add on board for the Raspberry Pi available at this time RoboPi adds an eight core 32 bit microcontroller running at 100Mhz to the Raspberry Pi in order to off load hard real time I O and allow more precise timing than Linux running on the Pi allows RoboPi stacked on top of a Model A Raspberry Pi RoboPi can also be stacked on top of Model B Raspberry Pi s RoboPi Features e Parallax Propeller P8X32 eight core 32 bit Risc microcontroller running at 100Mhz e Each of the eight cores provides up to 25MIPS as most instructions take only 4 clock cycles e three ten pin Mikronauts I O module expansion connectors P0 P7 P8 P15 P16 P23 e 24 servo compatible headers on P0 P23 o POQ P7 jumper selectable power from Pi s 5VDC supply or external servo power supply o P8 P15 jumper selectable
7. RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning Using RoboPi Copyright 2014 William Henning RoboPi User Manual v0 81 poe os 9 wy s s 2 8 se ee ee ag Photo 1 F ully assembled RoboPi 00 The most up to date documentation will always be available at http www mikronauts com raspberry pi robopi http Mikronauts com 1 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning Table of Contents Jiri aye al Vlei 19 gl eoa ee tem meen te rte E EEEE rT see nee eta oy ae eee AEN 3 RoboPr Printed Circuit BO ar el iss vscscscsssssesisy cabs cused cnseissuhiy sean gstnvas i aisr T SCEE EED E en SESS EREE E Ear E CE eri eRe epet 4 RoboPi O Pin Definitions sses seision nerede iento vsi daane Eru Eede EESE AEE Eiaa aa Eas ERa EEEE Ees 5 PO P7 SERVO V SERVO Biiaaseaseteesscasiesbsdoupsacnasiupancasuu E OEE rE TEA E AEN EE R ER 5 P8 P 15 SERVO 9 SERVO 16 sceocsicesndnatecanbreatecas snide wi aiuoiedusesassivensersaisenbateruntealanasiantancuaiecneder 5 P16 P23 SENSOR 1 SENSOR Brione esaa i EEE RE sad SEEEN N ESE EEE EEEN 5 P24 P27 SPI port for MIC PSOUB MC P3208 vinsstsss carurcckctacssidaceunsnestrancuiaydeasshadanasqideniaxedaieditaceinasstennsiuts 5 ADC1 ADC8 0 5V Analog IUPUI ss yscisiecescescascesesncesidasnetceiunsetseuanns cassececsseieatea tan iectaiumnarvelentulentneasGas 5 Programming RoboPi with RoboPiLib essessssesesesessessesssessessesssesressresessessseseresrestessess
8. RoboPiEFxit close the serial connection with RoboPi int readMode int pin returns INPUT OUTPUT SERVO PWM void pinMode int pin int mode set pin to one of INPUT OUTPUT SERVO PWM int digitalRead int pin returns 0 or 1 state of pin void digitalWrite int pin int val sets pin to 0 or 1 int analogRead int chan returns 0 1023 from specified channel int analogReadRaw int pin returns 0 4095 from specified channel void analogWrite int pin int val write 0 255 to PWM pin off to full on int servoRead int pin return last servo value written to pin void servoWrite int pin int val set servo on pin to val 0 2500 us int readDistance int pin return distance to nearest object in milimeters In your program include RoboPiLib h and add RoboPiLib o to your command line as follows gcc o myprog myprog c RoboPiLib o http Mikronauts com 7 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning Programming RoboPi with RoboPiObj RoboPiObj Constants INPUT OUTPUT PWM SERVO RoboPiObj Methods start pinMode pin mode readMode pin digitalRead pin digitalWrite pin analogRead chan analogReadRaw chan analogWrite pin value servoWrite pin value servoRead pin value readDistance int pin delay ms delayMicroseconds us pin mode for a digital input pin mode for a digital output pin mode for a PWM output 0 255 pin mode for a servo output 0 2500 Initialize RoboPiObj start se
9. eavtaawuesibawesaaetaans 11 How to use PWM to control Gear MOtO ns 2iss icocseasecdsasasenotseeinadcsevercnevatsaicatanveotanainedanuereserenseacnnisoadeanees 12 EN A B Three Wire Diver inncnossaciesnesndia snin a a A E eee 12 A B Two Wire interface seseesesssseseesrestrseerestssessescescesesssscestestsseseesteseressresensesreseesesstsesseeseesrsseseeeses 12 EN DIRPWM Three Wire Dm y Gi cx cs ceeseacxcvsstsaseuetadeosemetags Readenatdnncdsaindetagedeandiocuadnoasanvecnamnncianiee 13 DIR PWM Iw Wire Dry OP rset ctsiw aah sina asco ececcuntocanberuectsomasunayuteecasacrarasenciauehautunsestacetutdbouaacigentius 13 Why the ENABLE signal of three wire drivers is USefUL eee eseeseeeceteeeseeeeeeeeeeaeenseeseeseneeeeseeees 13 Rea ding Analog Distanc SAMS OPS oxcscsccscdscevsivsusslevitelcoudvancvans vandal oddacsesinan used ENE o E EE a aeei e 14 Reading Digital Ultrasonic Range SensofS cssccssccsssccsssccssccssscesccsnssesscsseccesscesnscesecssnscessceeseseceees 15 Supported Ultrasonic SOCNSGIS 0 52 senqspeneveastaiacecaesdvacapenavanesdauunaetatushcnisdananspeiusheaieanuvaretanso vinnesnaveeninveny 15 How to connect your ultrasonic range SENSOL i csseccecacasnecssoneveacesaeeddnesaeceeseastderanvenensectosneeusesnsnceeunas 15 Stand Alone OH as ies ssansiies cosa cnn gic newer a ag Sins pals Sbawen ad unin SK EEEE dunn PE AEE E desea EEEE EEEE EiS 16 PATINA A UUW AM Gipso esi orden ieie e NERE rE yal eR RN E K A A OA S
10. eesesseresseressseets 6 Using the Raspberry Pi serial port with RoboPi sesesessssseseseseeseessresseseessreseessessressesseesresseeseeseessrese 6 R b PiLib Constants eidean rnini eaaa etnei asra Ad tas aE aiia aa aerer Nesai 7 Ropo PID FUNCHODS merno ana aE EE RE a ee eee 7 Programming RoboPi with RGDOPIOD escecasceccucesesqachesstrasanstecuwnadiandonrposdensasdevanseadaieonsditovargeaterpectananmenies 8 Rob PiObj Constants sj cases set asiascdusavancanpcnecsdesatiapastsndadedaycoad aE EEO EELEE Ea payne EEN SES ES 8 RoboPiObj Methods scsieisss cccnthsaciayecasscendieessenatd eneee aasa eaa e aaa e a aE ERE Eea 8 RoboPiObj Resource Utilization seseeeseeseeeeeeseeseeeseesresseesstsressteseessreseesersersstessesseessessesseesseressereeseee 8 How to use Digital Ta Ss cece ce pswes cc etecc goat sewenao EE ER N A a wenn ena ens 9 Reading Bumper Switch S ssion nE a E EEA ETE AEE E Eia e 9 How to se Digital ADM esvitar reden a ea e E R N LE A E E a E EE 10 Using LED s to show which bumper is pressed ciccs sccvesedesecancesoncesnsennceessnencaeedoredeunsanecesendecpenseruesnes 10 HOw touse SCY OS scasatraacits ceceecdearanceateganiendecuad re e e eea EE ENA EAE e E OR AEAEE ANER RRE ETEEN 11 Controlling a Continuous Rotation Servo ssesessessssessesssessersreseesresseesrestersreserssesssresseresssteessseesseees 11 Controlling i Standard SQLV Oxsyccssiedsocsnsscancansdesicsensinadesunssionanevanesivsdansevagseesssvia idoderadi
11. ent L9110S h bridge is one example of a two wire A B interface however many L293D and L298 boards tie EN high to effectively become two pin drivers Function Break Rotate in one direction Rotate in opposite direction Break PROC POoOrFOoOW http Mikronauts com 12 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning EN DIR PWM Three Wire Driver Some motor drivers will have an EN signal but use extra logic to to use one pin as motor direction and another as a PWM input to control the motor speed DIR PWM Two Wire Driver Other motor drivers use extra logic to to use one pin as motor direction and another as a PWM input to control the motor speed Why the ENABLE signal of three wire drivers is useful Most motor drivers will actively break the motor if the A and B inputs are at the same level When PWM speed control is used both inputs are guaranteed to be driven low during the off period of the PWM signal which will short the two motor leads actively breaking This is less than ideal for the motor as it will get short spurts of power then break repeatedly The practical effect of this is that low speed motor control will not be linear and the motor will sound like it is grinding http Mikronauts com 13 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning Reading Analog Distance Sensors The Sharp GP2YOA02YKOF is an excellent infrared distance sensor that us
12. es a 5V supply and typically draws only 33mA and can present a new reading every 50ms You can find the data sheet at http www sharpsma com webfm_send 1487 It has a very useful range of 20cm to 150cm and is extremely easy to use There are other sensors in the same family covering 10cm 80cm and even 100cm 500cm but neither are as useful as the 20cm 150cm GP2YOA02YKOF Please note that the analog output of the sensor is incorrect at ranges shorter than 15cm Unfortunately the output voltage is not linear with respect to the distance to the object however it is easy to construct a table of voltages corresponding to the distance to object in 10cm increments Finer distance measurement can be approximated by using linear interpolation as the line segments between the 10cm data points can be reasonably approximated by straigt line segments Dist analogRead IR_Channel As analogRead returns 0 for OV and 1023 for 5V we can scale its output to 1 100th of a volt by Dist 500 Dist 1024 Giving us Dist as 0 for OV and 500 for 5V Of course you could do the reading amp scaling in one step Dist 500 analogRead IR_Channel 1024 Please see page 5 of the data sheet for the graph of voltage vs distance http Mikronauts com 14 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning Reading Digital Ultrasonic Range Sensors The RoboPi firmware implements preliminary support ultrasonic range sensors Al
13. hz crystal for 100Mhz operation e use 24LC512 EEPROM e use MCP3208 While there is no motor driver on RoboPi if you connect a two channel motor controller as follows it will be RoboProp compatible e Tie EN1 2 and EN3 4 high e P8toIN1 P9to IN2 e P10toIN3 e P11 toIN4 If you want to have a uSD card compatible with RoboProp attach it as follows e P12 to MISO e P13 to MOSI P14to CLK e P15 to CS http Mikronauts com 18 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning Appendix E Frequently Asked Questions Q Where can we buy RoboPi A Currently you can buy RoboPi Directly from us please email us at mikronauts gmail com with desired quantity and postal address we will be happy to send you a quote We accept PayPal from verified buyers From our Ebay store please visit us at out Mikronauts Ebay store lt add actual URL gt Distributors and dealers are welcome to contact us for quantity discounts we would love to have you on board Q Are quantity and educational discounts available for RoboPi A Yes We are happy to offer quantity based discounts to our educational users and distributors Please contact us for a custom quote Q Can we make our own RoboPi printed circuit boards A I am afraid not While RoboPi is an open platform in that it is fully documented with source code available for its libraries and demo applications RoboPi is a commercial product and may not be
14. l supported ultrasonic distance sensors will use a generic interface RoboPiLib int readDistance int ch RoboPiObj readDistance ch will return the distance to the nearest object in millimeters Supported Ultrasonic Sensors HC SRO1 tested working PARALLAX _ PING not tested should function SEEDSTUDIO_136B not tested How to connect your ultrasonic range sensor HC SR04 pin RoboPi Pin use any of 24 servo three pin headers Vcc Servo header red wire any of 24 servo three pin headers Trig 10 pin female header corresponding to selected pin Echo Servo header white wire GND Servo header black wire Ping pin RoboPi Pin use any of 24 servo three pin headers 5V Servo header red wire SIG Servo header white wire GND Servo header black wire Ping pin RoboPi Pin use any of 24 servo three pin headers 5V Servo header red wire SIG Servo header white wire GND Servo header black wire http Mikronauts com 15 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning Stand Alone Operation Supply 5V to RoboPi via one of e pins 2 amp 4 of the 2x13 pin Pi Header e Pi5V terminal of power selection header SV2 or SV3 Supply GND to RoboPi via one of e pins 9 amp 14 of the Pi Header e GND terminal of the external motor power screw terminal If you will never mount your RoboPi on a Raspbery Pi you could mount a two pin screw terminal on pins 2 5V amp 6 GND for supplying 5V Use a PropPlug to prog
15. peration where RoboPi is NOT stacked on top of a Raspberry Pi Pins 1 4 are the same as PropPlug Pin 1 is GND Pin 5 adds 3 3V for SerPlug Plugging in a PropPlug while RoboPi is stacked on the Raspberry Pi may damage your Raspberry Pi and or RoboPi http Mikronauts com 4 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning RoboPi I O Pin Definitions Before you can write programs for your RoboPi based robot you have to learn what resources are available for you to connect to sensors motors and other devices or boards P0 P7 SERVO 1 SERVO 8 e 10 pin EXP1 connector connected directly to processor pins 3v3 I O only e connects to signal pin on SERVO1 8 through a 2k4 current limiting resistor 5V I O safe e For the servo header SV2 selects between the Pi s 5V and VBat from the screw terminal P8 P15 SERVO 9 SERVO 16 e 10 pin EXP2 connector connected directly to processor pins 3v3 I O only connects to signal pin on SERVO9 16 through a 2k4 current limiting resistor 5V I O safe e For the servo header SV3 selects between the Pi s 5V and VBat from the screw terminal P16 P23 SENSOR 1 SENSOR 8 10 pin EXP3 connector connected directly to processor pins 3v3 I O only e connects to signal pin on SENSOR1 8 through a 2k4 current limiting resistor 5V I O safe e the Pi s 5V is used for SENSOR1 8 to provide cleaner power to Ping s etc P24 P27 SPI port for MCP3008 MCP3208 e P24 is MISO connected to
16. ram your stand alone RoboPi http Mikronauts com 16 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning Appendix A Software e Raspbian Wheezy or later e SimpleIDE 0 8 4 or later e propeller load3 or later e RoboPi API v1 0 or later e RoboPiLib v1 0 or later Appendix B Data Sheets http www parallax com sites default files downloads P8X32A Propeller Datasheet v1 4 0_0 pdf http www parallax com sites default files downloads P8X32A Web PropellerManual v1 2 pdf http ww1 microchip com downloads en DeviceDoc 21298c pdf http ww1 microchip com downloads en DeviceDoc 21754M pdf You can find the data sheets for the listed Digikey part numbers at Digikey com by typing in the part number and clicking on the pdf icon on the resulting page Appendix C Support For Raspberry Pi support including Raspbian please see the Raspberry Pi forums at http www raspberrypi org forum For Parallax Propeller support see the Parallax forum at http forums parallax com forumdisplay php 65 Propeller 1 Multicore Microcontroller For RoboPi support please visit the RoboPi thread in the Propeller forum at http forums parallax com showthread php 153275 Propeller add on for Raspberry Pi RoboPi the most advanced robot controller for Pi http Mikronauts com 17 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning Appendix D RoboProp Software Compatibility e use the supplied 6 250M
17. rvice cogs set digital pin to specified mode read current mode of digital pin read current value 0 or 1 at pin regardless of mode write 0 or 1 to digital pin read analog input channel scale to 0 1023 return value read analog input channel return raw 0 4095 value write PWM value to pin 0 is off 255 is fully on write servo position to pin 0 to 2500 microseconds return last servo position written to pin return distance to nearest object in milimeters delay for ms milliseconds delay for us microseconds RoboPiObj Resource Utilization RoboPiObj uses 4944 bytes of EEPROM RAM and two cogs for drivers ADC_INPUT_DRIVER PWM_32_v4 http Mikronauts com MCP3208 driver object PWM Servo driver object 8 2014 01 27 RoboPi v1 00 User Manual v0 81 Copyright 2014 William Henning How to use Digital Inputs Reading Bumper Switches Probably the simplest digital input possible is a switch lt insert schematic of two bumper switches 10k pullup to 5v shorts to ground when closed gt include stdio h include RoboPiLib h define LEFT_BUMPER 0 define RIGHT_BUMPER 1 define PRESSED 0 int main int argc char argv pinMode LEFT_BUMPER INPUT pinMode RIGHT_BUMPER INPUT while 1 if digitalRead LEFT_BUMPER PRESSED puts Left Bumper Pressed if digitalRead RIGHT_BUMPER PRESSED puts Right Bumper Pressed sleep 1 only check once per second http Mikronauts com 9 2
Download Pdf Manuals
Related Search
Related Contents
NOUVEAUTES ESPACE JEUNESSE Manual USB 1210.indd GUIDE DE L`UTILISATEUR 取扱説明書 - オークセール comune di cinisello balsamo capitolato speciale d`appalto Software Utility Installation Instructions BCN-B62008-325 Titrette® et Burette Digitale Le géoservice de recherche – A nous la carte au trésor l`in n o va zio n e d e lla za n za rie ra ® Copyright © All rights reserved.
Failed to retrieve file