Vous êtes sur la page 1sur 6

Coursera

Hardware

Page 1 of 6

Help Center

QuickBot Hardware Component


The hardware component of the course is completely optional. The hardware component consist of
building a two wheel differential drive mobile robot called the QuickBot. The QuickBot has a wheel
encoder on each wheel to measure wheel rotations and five infrared (IR) distance sensors (proximity
sensor) to measure the distance of obstacles to the robot. The processing on the QuickBot is preformed
by a BeagleBone Black (BBB) microcomputer. Wifi on board is used to connect the QuickBot with the
Matlab simulator Sim.I.am, which allows for easy testing of programs in simulation and running of
programs on the real robot. The QuickBot is powered by 8 AA batteries.
In addition to the building of the QuickBot, the BBB is used to introduce simple physical computing
concepts. These include reading and writing both digital and analog values with the BBB. Also,
communicating with the BBB using varies serial communication protocols (e.g. UART, I2C, SPI). A
simple circuit is used to demonstrate these concepts.
(QuickBot Figure Here)
Week 1 - Ordering Parts
The first step to building the QuickBot is ordering all the necessary parts. This document (QuickBot
Parts List.pdf) has a list of all the parts as well as the price and the online vendor the parts can be
purchased from. The top section has the required parts while the lower sections show tools and other
parts that may be helpful. A large number of the parts can be purchased from SparkFun Electronics,
which is graciously providing a discount to all students enrolled in the course. Please use the following
discount code when making your SparkFun purchase:
SparkFun PromoCode: EDUMobileRobotsMOOC14
In addition, any order over $60 from SparkFun will receive free shipping. To make ordering from
SparkFun easier I have created a SparkFun wish list of all the SparkFun parts (except for the encoder
board because it has not been released yet).
SparkFun Parts List
(Lecture slides for week 1 hardware lectures are available here)
Week 2 -Building The QuickBot
Once all the parts have been obtained the next step is to build the QuickBot. Detailed instructions on
building the QuickBot are given in the second hardware lecture. The basic steps are:
1. Solder encoder header to board and attach encoder to lower chassis plate. (Currently the encoder
boards have not been released by SparkFun, just proceed without them. You can add them
later when you receive them.)
2. Attach motors to lower chassis plate positioned so the black wire of the motor is closest to the
chassis plate.
3. Attach the omni wheel to the back of the chassis.
4. Attach wheels and encoder disc to motors.
5. Stick breadboards to top of lower chassis plate.
6. Attach the upper chassis plate standoff spacers.
7. Attach BBB standoff spacers to upper plate.
8. Attach battery holders to upper plate.

An evaluation version of novaPDF was used to create this PDF file.


Purchase a license to generate PDF files without this notice.

https://class.coursera.org/conrob-002/wiki/Hardware

17/09/2015

Coursera

Page 2 of 6

9. Assemble the 5 IR sensor attachments.


10. Attach 2 of the IR assemblies to the lower chassis plate.
11. Attach 3 of the IR assemblies to the upper chassis plate.
12. Attach top chassis plate to bottom chassis plate.
13. Attach BBB to chassis. Note: The orientation of the BBB shown in the lecture slides is
incorrect (ethernet port on the left side of the robot). For easier wiring the ethernet port
should be on the right side of the robot.
(Lecture slides for week 2 hardware lectures are available here)
Week 3 - Wiring The QuickBot (If you see any mistakes in the lecture slides or the instructions
below please contact us and let us know)
The next is to wire up the QuickBot (diagram show here). Again detailed instruction on building the
QuickBot are given in the third hardware lecture. The basic steps are:
1. Assemble DC power plugs by cutting two M/M jumper wires, stripping the ends, and connecting to
the correct poles on the plugs.
2. Add H-Bridge to small breadboard. Take note of the IC orientation using the notch as a reference.
The datasheet for the H-Bridge can be found here.
3. Create the seven voltage dividers on the large breadboard using the 10k and 20K ohm resistors.
The 10K resistor is attached to GND and OUTPUT signal and 20K resistor is attached to OUTPUT
and INPUT signal.
4. Add the DC power plugs to the small breadboard connecting them in series.
5. Add power switch to the small breadboard connecting it in series with the power plugs.
6. Connect motor wires to H-Bridge.
-- Right motor red wire is connected to H-Bridge 1Y (pin 3).
-- Right motor black wire is connected to H-Bridge 2Y (pin 6).
-- Left motor red wire is connected to H-Bridge 3Y (pin 11).
-- Left motor black wire is connected to H-Bridge 4Y (pin 14).
7. Assemble power supply on the small breadboard using the voltage regulator, heat sink, capacitors,
and diode. See this schematic for the component connection layout. The datasheet for the voltage
regulator can be found here.
8. Connect power wires to H-Bridge. Caution: Connecting these wires incorrectly could cause the
Beaglebone Black to burn out.
-- Connect voltage regulator INPUT voltage (9V-12V) to H-Bridge Vcc2 (pin 8) [red wire].
-- Connect voltage regulator OUTPUT voltage (5V) to H-Bridge Vcc1 (pin 16) [red wire].
-- Connect voltage regulator GND to battery GND [black wire].
-- Connect H-Bridge GND (pin 5) to battery GND [black wire].
9. Connect motor control wires to H-Bridge. Caution: Connecting these wires incorrectly could
cause the Beaglebone Black to burn out.
-- Right motor wires connect to H-Bridge 1,2EN (pin 1) [blue wire], 1A (pin 2) [yellow wire], 2A (pin
7) [orange wire].
-- Left motor wires connect to H-Bridge 3,4EN (pin 9) [blue wire], 3A (pin 10) [yellow wire], 4A (pin
15) [orange wire].
10. Connect BBB power wires to H-Bridge. Caution: Connecting these wires incorrectly could
cause the Beaglebone Black to burn out.
-- Connect 5V wire to H-Bridge Vcc1 (pin 16) [red wire].
-- Connect GND wire to battery GND [black wire].
11. Connect big breadboard power wires.
-- Connect big breadboard 5V rail to H-Bridge Vcc1 (pin 16) [red wire].
-- Connect big breadboard GND rail to battery GND [black wire].
-- Connect big breadboard GND rails to each other [black wire].

An evaluation version of novaPDF was used to create this PDF file.


Purchase a license to generate PDF files without this notice.

https://class.coursera.org/conrob-002/wiki/Hardware

17/09/2015

Coursera

Page 3 of 6

12. Connect encoder board wires to big breadboard.


-- Connect encoder board GND to big breadboard GND rail [black wires].
-- Connect encoder board VCC to big breadboard 5V rail [red wire].
-- Connect encoder board OUT to the input of the middle voltage dividers on the big breadboard
[green, yellow wires].
13. Connect IR sensor wires to big breadboard. IR sensor datasheet can be found here.
-- Connect IR sensor GND to big breadboard GND rail [black wires].
-- Connect IR sensor Vcc to big breadboard 5V rail [red wires].
-- Connect IR sensor Vo to the input of the next outer voltage dividers on the big breadboard [yellow
wires].
14. Connect ADC wires to output of voltage dividers on the big breadboard.
15. Attach chassis top plate to bottom plate. Easiest if connect JST wire to front IR sensor before
attaching plates together. Then connect JST wire to side IR sensors after attaching plates together.
16. Connect wires to BBB. Caution: Connecting these wires incorrectly could cause the
Beaglebone Black to burn out.
-- Connect 5V power wire to BBB 5V_Raw (pin P9_05) [red wire].
-- Connect GND wire to BBB GND (pin P9_01) [black wire].
-- Connect right motor control wires to BBB GPIO_51 (pin P9_14) [blue wire], GPIO_68 (pin P8_10)
[yellow wire], GPIO_44 (pin P8_12) [orange wire].
-- Connect left motor control wires to BBB GPIO_05 (pin P9_16) [blue wire], GPIO_46 (pin P8_16)
[yellow wire], GPIO_26 (pin P8_14) [orange wire].
-- Connect left encoder wire to BBB Ain_0 (pin P9_39) [green wire].
-- Connect right encoder wire to BBB Ain_2 (pin P9_37) [yellow wire].
-- Connect left IR sensor to BBB Ain_1 (pin P9_ 40) [orange wire].
-- Connect left front IR sensor to BBB Ain_3 (pin P9_38 ) [blue wire].
-- Connect front IR sensor to BBB Ain_5 (pin P9_36 ) [brown wire].
-- Connect right front IR sensor to BBB Ain_6 (pin P9_35 ) [blue wire].
-- Connect right IR sensor to BBB Ain_4 (pin P9_33 ) [green wire].
17. Install batteries and connect DC plugs.
If you would like to run your QuickBot from wall power instead of batteries you can use a 9V-12V 1A DC
power supply. Connect this power supply into one of the female DC plugs on the robot. You will need to
short the other DC plug. An easy way to do attach both wires or poles of a male DC power plug and
insert that into the other female connector on the robot. Caution: You must remove all the batteries
before connecting these plugs to run the QuickBot off of wall power.
Learn from my mistakes! The BeagleBone Black is fairly sensitive beast. I have killed too many boards
with wiring mistakes and having the BBB powered while moving it around, which allowed objects to
come in contact with the underside of the board and thus shorting it out. Anything but 5V to the power
pins or 3.3V to the GPIO pins will must likely kill this fancy little microcomputer.
(Lecture slides for week 3 hardware lectures are available here)
Week 4 - Setting up the QuickBot
To be able to set up the QuickBot you must SSH into the BeagleBone Black. Adafruit and a nice tutorial
on how to setup SSH for each type of operating system. Go check out the tutorial:
http://learn.adafruit.com/ssh-to-beaglebone-black-over-usb/overview
(Step 1) Configure the Wifi settings
1. Connect an ethernet cable to the BBB and power with a 5V power supply or via USB
2. SSH into BBB via the ethernet not the USB (no password is needed just hit [enter])
>> ssh root@beaglebone.local

An evaluation version of novaPDF was used to create this PDF file.


Purchase a license to generate PDF files without this notice.

https://class.coursera.org/conrob-002/wiki/Hardware

17/09/2015

Coursera

Page 4 of 6

3. Check that the internet is connected (if bytes received then internet is working)
>> ping -o www.google.com
4. Set the time with the following (use your own timezone) and check the date at the end
>> opkg update
>> ln -sf /usr/share/zoneinfo/America/New_York/etc/localtime
>> ntpdate -b -s -u pool.ntp.org
>> /usr/lib/conn/test/set-global-timeservers pool.ntp.org
>> date
5. Plug Wifi adapter into BBB and restart the BBB with the following command
>> shutdown -r now
6. SSH back into BBB (may require new terminal window) and check that the wireless is working (if
you get an error it is not working)
>> ifconfig ra0
7. Config the network settings
(copy hash string from wpa_passphrase command)
>> wpa_passphrase "your network name here" 'your password here'
(edit configuration file)
>> nano /var/lib/connman/wifi.config
(type the following, then [ctrl-x],[y],[enter] to save and exit)
[service_home]
Type = wifi
Name = your network name here (no quotes this time)
Passphrase = paste hash string here
8. Restart BBB and unplug ethernet cable
>>> shutdown -r now
9. SSH back into BBB (may require new terminal window) then check internet and check IP address
>>> ping -o www.google.com
>> ifconfig ra0
If you have problems with getting the wifi working please see this post for a possible fix:
https://class.coursera.org/conrob-002/forum/thread?thread_id=737

(Step 2) Get the Adafruit code


1. Install python tools
>> opkg update
>> opkg install python-pip python-setuptools
2. Get Adafuit BBIO library
>> pip install Adafruit_BBIO
(Step 3) Get the QuickBot code
1. Change into home
>> cd ~
2. Clone the GIT repository
>> git clone https://bitbucket.org/rowoflo/quickbot_bbb.git
If you have problems with git please see this page for a possible fix:
http://derekmolloy.ie/fixing-git-and-curl-certificates-problem-on-beaglebone-blac/
(Step 4) Run the code on the BBB
1. Change into code directory
>> ~/quickbot_bbb

An evaluation version of novaPDF was used to create this PDF file.


Purchase a license to generate PDF files without this notice.

https://class.coursera.org/conrob-002/wiki/Hardware

17/09/2015

Coursera

Page 5 of 6

2. Get IP address of both your computer and the BBB (run command on terminal for BBB and on
terminal for local machine)
>> ifconfig
3. Run code on BBB
>> ./QuickBotRun.py your_pc_ip_address bbb_ip_address
Example
>> ./QuickBotRun.py 192.168.1.100 192.168.1.101
(Step 5) Send commands to QuickBot via Matlab simulator Sim.I.Am
1. Open Matlab
2. Edit Sim.I.Am "settings.xml" file to enter BBB IP address (~ line 7 in file)
<driver ip="bbb_ip_address" port="5005" />
Example
<driver ip="192.168.1.101" port="5005" />
3. Launch Sim.I.Am
4. Connect to robot
5. Press play
(Step 6) Shutdown the QuickBot
1. Close Sim.I.Am
2. Ctrl-C in BBB terminal to end QuickBotRun.py program
3. Shutdown the BBB
>> shutdown -H now
4. Turn off QuickBot

The QuickBot is just responding to commands that are sent to it. The commands are strings and are
listed below.
Command Set
Check that the QuickBot is up and running:
Command:
"$CHECK*\n"
Response
"Hello from QuickBot\n"

Get PWM values:


Command
"$PWM?*\n"
Example response
"[50, -50]\n"

Set PWM values:


Command
"$PWM=[-100,100]*\n"

Get IR values:
Command
"$IRVAL?*\n"
Example response
"[800, 810, 820, 830, 840]\n"

Get encoder position:


Command
"$ENVAL?*\n"

An evaluation version of novaPDF was used to create this PDF file.


Purchase a license to generate PDF files without this notice.

https://class.coursera.org/conrob-002/wiki/Hardware

17/09/2015

Coursera

Page 6 of 6

Example response
"[200, -200]\n"

Get encoder velocity (tick velocity -- 16 ticks per rotation):


Command
"$ENVEL?*\n"

Example response
"[20.0, -20.0]\n"
Reset encoder position to zero:
Command
"$RESET*\n"

End program:
Command:
"$END*\n"

(Lecture slides for week 4 hardware lectures are available here)


(Visit this page frequently to see any new updates)

Created Wed 15 Jan 2014 7:16 PM GMT


Last Modified Mon 17 Feb 2014 5:44 AM GMT

An evaluation version of novaPDF was used to create this PDF file.


Purchase a license to generate PDF files without this notice.

https://class.coursera.org/conrob-002/wiki/Hardware

17/09/2015

Vous aimerez peut-être aussi