arduino coursework outline
TRANSCRIPT
-
8/12/2019 Arduino Coursework outline
1/23
Unit0
WhatisArduino
Referredtohttps://learn.sparkfun.com/tutorials/whatisanarduino
Arduinoisanopensourcesingleboardmicrocontrollerusedforelectronicsprojectssuitableforboth
beginnersandadvancedusers.TheyaregodsendforDIYenthusiastsandtinkerersduetoitsflexibility
andunlimitedapplications.ItoriginatedfromItalybackin2005.ArduinoconsistsofanAtmel8bit
processer.TheArduinoUnoR3weuseinthiscoursefeaturestheATmega16U2, thereby offering
greater transfer rates and memory over its predecessors.
WheretofindResources
ArduinoWikipagehttp://en.wikipedia.org/wiki/Arduino
Arduinomainwebsitehttp://arduino.cc/
https://www.sparkfun.com/products/retired/11227
ExaminingtheSparkFunInventorsKit
Justlikeopeninganythingnewelectronicforthetime,Iwasreallyexcitedtofinallycrackopenthebox,
butitwasmorelikeboxofchocolates.Manylittlecomponents,someofwhichIrecognizelikethe
arduinouno,breadboard, motors,etc.
InstallingtheArduinodevelopmentenvironment
FollowedtheSIKinstructionsforinstallation.Usedthewindowsinstaller,prettystraightforward.ThenI
connectedthearduinounotomycomputerusingtheusbcable,andthedriverswereinstalled
automatically.NextIlaunchdthearduinoIDE.TheIDElooksamazing,verysleekandmodern.Butthisis
notsurprisingastheirwebsiteandoverallbrandinghaveaverysleek,simpleandmodernfeeltothem.
TheSIKguideandtheUnoboardalsodontwell,goodlookandbuildqualityrespectively.IntheIDE,my
boardandCOMportwerealreadyattherightselection.
Referredtohttps://learn.sparkfun.com/tutorials/installingarduino
Writing
and
executing
your
first
program
SIKCircuit1
MYfirstprogram!Ifollowedtheguide,itwasstraightforward,learnedaboutpinMode,digitalWriteand
delay functions.TheprogramransuccessfullywithLEDblinkingonandoffasexpected.ThenIchanged
thepinvalueinpinModefunctionandrantheprogramagain.Itworksafterofcoursemovingthejumper
-
8/12/2019 Arduino Coursework outline
2/23
cable.IthenchangedvaluesindelayfunctiontochangerateofLEDblinking. Makingadelay0makes
theledasexpectednotblinkatall.
VIDEO https://www.youtube.com/watch?v=03teMswFH8
Unit1
Unit1WorkbookExercisesRoboticComponents
Exercise1
1.ListSparkfunssensors
Tempsensor
FlexSensor
Photocell
Softpotentiometer
2.DefineSparkfunssensorspace. For each of the sensors, identify what it perceives and the range of
possible sensor readings.
Temp Sensor: The one in the sparkfun kit is a low voltage centigrade temperature sensor that can
measure temperature over the -40C to +125C with an accuracy of +or- 2C
Flex Sensor: Its 2.2 in length and measures flex as its bent (its resistance changes).Not meant to flex at
its base.
Photocell: Can sense ambient light as resistance changes based on exposure to light. Light resistance
approx.. 1K ohm, dark resistance approx. 10K ohm
Soft Potentiometer: Can sense the relative position on a strip. Resistance changes from 100Ohms to
10000Ohms as we press down on the strip
3.Now imagine a sonar sensor has been added to Sparkfun. What is the new sensor space?
With a sonar sensor, the sensor space would include the ability to detect objects by sound (pings) , the
result of such detection would be a distance value.
Exercise 2
1.Describe the difference between effectors and actuators.
-
8/12/2019 Arduino Coursework outline
3/23
An effector is the physical part of a robot that can affect the environment, such as arms, legs, etc.
Whereas, an actuator is the mechanism by which the effector is able to perform these operations.
2.List each of the Sparkfuns actuators and effectors.
Effectors:
Red, Yellow, and RGB LEDs
Piezo Buzzer
Actuators:
DC Motor
Servo
3.List the degrees of freedom for the Sparkfun.
Unlike the Create, for which these questions were intended for, the Sparkfun does not move and so I
would say it has 0 Degrees of Freedom.
Chapter1 FoodForThought
Whatelsecanyoudofromafar,bymeansofteleoperation?Youcantalk,write,andsee,asin
telephone,telegraph,andtelevision.Thereismore.Canyouthinkofit?
Youcancontrolmanythingsremotely.InfactIamremotelytypingthismessageonatabletinascreen
sharingappconnectedtoaPC.YoucanremotelycontrolRCcars,UAVs.Youcanremotelylistento
musicbymeansofBluetooth.Youcanremotelycontrolamousepointerwitha2.4ghzwirelessmouse.
Isthermostatarobot?
Iactuallydidntrealizethis,butaccordingtothedefinitionofarobot,athermostatisindeedarobot.
Thisisbecauseitisatangibleobjectintherealworldthatcansensetemperatureandreactaccordingly
toperformitsobjectives.
Istoasterarobot?
Bydefinition,atoasterisnotarobot,becausethoughtitexistsintherealworld,itdoesnotsenseor
reactonitsown.Itsamechanicaldeviceontimerthatrequiresphysicaloperationtomeetits
objectives.
Someintelligentprograms,alsocalledsoftwareagents,suchasWebCrawlers,arecalledsoftbots.Are
theyrobots?
No,becausetheydontexistphysicallyintherealworld,theyarenottangible.
IsHAL,fromthemovie2001,theSpaceOdyssey,arobot?
-
8/12/2019 Arduino Coursework outline
4/23
MostdefinitelyYES!HALcouldsenseandreactwithhisenvironmentandperformvarioustasksinthe
realworldonhisown.
Chapter2 FoodForThought
Howimportant
is
it
for
robots
to
be
inspired
by
biological
systems?...
Does
it
matter
what
kind
of
robot
youarebuilding?Doesitmatterifitisgoingtointeractwithpeople?
Ithinkitisveryimportantforrobotstobeinspiredbybiologicalsystems,mostofthetimeirrelevantof
whethertheyinteractwithpeopleorthekindofrobotyouarebuilding.Firstly,becauserobotsbasically
performtasksthathumansdo.Nowwecantrytodeviatearobotscapabilitiesfrommimickinga
humans,likeairplanes,etc.Butarobotwouldstilloperatewithinournature.Andbiologicalsystemsin
ourworldhaveevolvedtoworkinthisnature.Sowhathappensis,robotswouldatsomelevelinour
worldalwaysatsomelevelgetinspiredbysomebiologicalsystem.Soforhelicoptersitwouldstillbe
wings,andperhapsflightofsomeinsects.Nowifwebuildrobotsinouterspace,wherebiological
systemsmight
not
reign,
it
might
start
to
be
different
from
biological
systems.
For
starters,
dealing
with
antigravity.Forinstance,anobjectthatcanfloatinspacewiththrustersinvariousdirections,isnot
reallyinspiredbyanyorganismsflightinnature(ordeepsea),sincegravityplaysaroledownhere.So
thiswouldbetheexception.
Chapter3 FoodForThought
1.Whatdoyouthinkismoredifficult,manipulationormobility?Thinkofhowthoseabilitiesdevelop,in
children,babies,andadults.
Babiesfirstdeveloptheirbrainsandtorso.Theythendevelopgrossmotorskills,wheretheycanmove
theirhandsandlegsroughlybutnotinfullcontrol.Afterthisstagetheystartcrawlingandeventually
walkslowly.Duringthetimetheylearntowalkwell,theyalsodevelopfinemotorskills.
Soitishardtoanswerthisquestiondefinitively.Iwouldsay,basiccrudemanipulationiseasierthan
mobility.Butsomeprecisemanipulationisharderthanbasicmobility.Andadvancedmobilitylike
specialmaneuvers,etc.areroughlyjustasdifficultassomeadvancedmanipulation.
2.Howlargedoyouthinkyoursensorspaceis?
Wellwehaveour5senses.Wecanfeeltouchliketextures,temperatures,etc.Wecansee:wehave
peripheral20/20visionat24fps,wecanseevisiblelight.Wecansmellbymeansofourolfactorynerves,
sotheyhavealimitation(worsethandogsforexample).Wecanhearhear,between20and20,000Hz
frequencies,atlimiteddecibels.
Nowitseemswecansensemuchmorethanthis,butthatsonlybecauseofwhatweashumanscan
dofromthesesenseinputs.Forinstancewesmellsomething,andthatinstantlytriggerspastmemories,
itcouldbeatraumaticevent,andsowefeelwesensedsomethingmore.Ithinkthisisalsohowsome
peopleclaimsixthsense.Theystillhave5senses,itisjusttheirbrainsunderlyingprocessestagged
-
8/12/2019 Arduino Coursework outline
5/23
alongwiththeir5sensesthatcreatesthatillusion.Anotherexample,isthefeelingoflove,westillhave
our5senses,itsjustourbrainprocessing(releasingchemicals,etc)intandemwithoursensesthat
makesusfeellikewesensemuchmore.
Sooursensorspaceislimited,butisseeminglyvastgiventheprocessingbyourbrains.
3.Can
you
think
of
information
in
life
that
is
observable,
partially
observable,
hidden?
Observableinformationincludesthingsoursensescanpickup,likeobjects,sounds,etc. Hidden
informationincludesthingslikeemotionalfeelings.Partiallyobservableinformationcouldbethingslike
Iexplainedinthepreviousquestion,whereyouobservesomebasicinformationbutourbrainperceives
morebyprocessingthatinformation.Soforexample,instincts,wecanobservesomethingsubtlebut
dangerous,andthenourbraintriggerspastmemories,andsowecanbyinstinctrunawayfor
example.Buthappenedwasweonlypartiallyobservedsomething.
SIKCircuit
2
Thiscircuitissameascircuit1exceptthereisapotentiometeradded.Thispotentiometercanoutputa
voltageanywherebetween0and5volts.Thisiscontrolledphysicallybytheuserturningtheknob.My
potentiometerhadapinharshlybent,anditisflimsy,feelslikeitcanbreakanytime.Butotherthanthat
Circuitwasjustastrivialtosetupasthelasttime.Rotatingthepotentiometer,theLEDblinksfroma
slowintervaltofast.Thisisaccomplishedbythedelayfunctiontakinginthevaluebeingoutputted
(analog)bythepotentiometer.
VIDEO https://www.youtube.com/watch?v=Vsl8_5eURK0
SIKCircuit3
WhenIfirstputtogetherhastilyImissedtheresistors,butnoticedmyerrorandimmediatelyputthem
in,butthennothingworked.IthenrealizedIputtheGNDwireonthewrongsideofthebreadboard.
AfterfixingthatItworked.Followingtheguide,everythingworkedwithoutahiccup.Ijusthadtobe
extracarefulingettingthepinsinrightbyseparatingthem,andknowingtheshortoneisRed(sequence
isRed,GND,green,blue).Theprogramissimilartothepreviouscircuitsexceptitturnsonthevarious
Red,Green,BlueLEDsindifferentcombinationstooutputthedesiredcolor.
VIDEO https://www.youtube.com/watch?v=dnH7MVEjr1Y
SIKCircuit4
-
8/12/2019 Arduino Coursework outline
6/23
Thisprogramwasalsosimilartopreviouscircuits,exceptwith8LEDs.Assemblingwasjusteasythough.
Exceptputtingallthejumpercablesintodigitaloutputpins29wasannoying.Thepinsweretooclose
togetherandsothejumpercablesdidnothaveenoughroomnexttoeachother.Isomehowmanaged
tojamthemin.IusedalternatingyellowandredLEDsasopposedtoallsamecolorbecauseIplannedto
dosomechangestotheprogramforfun.Ifirstranthecircuitasitwasintendedanditwentsmoothly.It
wasjust
afor
loop
in
terms
of
code.
Then
Ichanged
the
code
in
the
loop
to
turn
on
all
even
LEDS
on
at
once,thenoff,andthenalloddatonce,thenoff.Itwassimple,butoutputwasasexpected,allyellow
LEDsturnedonatonceandthenallRedLEDsturnedonatoncenext,andsoon.
VIDEO https://www.youtube.com/watch?v=UIoPhlTdA4Q
SIKCircuit5
Finally,somethingotherthanjustLEDs.Iassembledthecircuitaccordingtotheguide.Seemedsimple
enough,exceptoneofthepushbuttonsIgothadallitspinsbent.Ihadtoalignthemcorrectlytofitinto
thebreadboard.
After
finishing
the
circuit
Iran
the
program
and
nothing
worked.
Ichecked
the
physical
connectionsacrossmyboard.Ihad2mistakes,Ididnothave1ofthewiresalignedcorrectlywitha
pushbuttonandIhadmyLEDwireinthewrongpin.Thecodeworkslikethis:IfIpusheitherbuttonit
connectstogroundandtheLEDwilllightup.IpushboththenbyBooleanlogictheLEDwillturnoff.It
worksasexpected.
VIDEO https://www.youtube.com/watch?v=5VfuqJ6efOw
SIKCircuit6
Iassembled
the
circuit
by
the
guide.
Assembly
was
smooth.
The
circuit
is
straightforward,
except
the
onlythingtonoteisthatavoltagedividerisrequired.Theoutputofthiswillbereadasananaloginput.
Analoginputrangefrom0to1023butwriteonlyrangesover0to255sotheinputismappedtooutput
rangeof0to255.Theprogramranasexpected.Aswritteninprogramdocumentation,thelightdidnt
completelyturnoff,soIplayedaroundwiththerange0to1023.Ieventuallypicked400700andit
workswellenough.TheLEDturnsoffwhenlightisdetectedbythephotocell.Ialsoreversedtheeffect
bywritingtotheanalogpin:255thelightlevel.SonowtheLEDisonwhenitlightissensed.
VIDEO https://www.youtube.com/watch?v=80_jkZpa3EM
SIKCircuit
7
Thiscircuitwasparticularlyeasytoassemble,onlyonepartneededwithnoresistors,justthetemp
sensorandwires.Hadtolearntoidentifythepinsforthetempsensor.Withthesensorflatfacingyou
(pinsdown)theleftmostpinis5v,andrightmostisGND.Ihookedupthewirescorrectly.Finallywriting
codeforoutputtingdataonscreen(serialportwindow).Restofthecodewasstraightforward.Execute
programandgetfollowingresults
-
8/12/2019 Arduino Coursework outline
7/23
voltage:2.89 degC:238.57 degF:461.43
*Facepalmtohead*
Evenafterknowingwhateachofthe3pinsonthetempsensorare,Imixedupthewirespositiveand
negativeonthebreadboard. FirstIthoughtthereadingwasoffandItouchedthesensoranditreally
washot.Irantitagainafterfixingthewires.Andthereadsweregoodnow,prettyconsistent.
voltage:0.72 degC:22.27 degF:72.08
voltage:0.72 degC:22.27 degF:72.08
voltage:0.72 degC:22.27 degF:72.08
voltage:0.73 degC:22.75 degF:72.96
voltage:0.72 degC:22.27 degF:72.08
Voltagefluctuatedupto.73anddownto.71.Thisisrelativelyminoranditsprettystableactually.I
touchedthesensorandthetemperaturespiked,butnothingerratic.Soitwasallnormal.
voltage:0.73 degC:23.24 degF:73.84
voltage:0.73 degC:23.24 degF:73.84
voltage:0.73 degC:23.24 degF:73.84
VIDEOhttps://www.youtube.com/watch?v=03teMs
wFH8
MeetingLearningObjectives
1)definethetermrobotandprovideabriefhistoryofrobotsandrobotics.
Arobotisanautonomousphysicalsystemintherealworldthatcansensethingsandservesome
purpose.
2)listthecomponentsofatypicalrobot.
Followingrobotcomponentsrelatestoahumanbeings
Bodytoexistinthephysicalworldanddothings
Effectorsandactuatorstodoperformactions
-
8/12/2019 Arduino Coursework outline
8/23
Sensorstosenseitsenvironment
Controllertothinkandactonitsown
Unit2
Unit2WorkbookExercisesLocomotion
ComparewhattheyaredoingwiththeiRoombatorobotkitslikeLegoMindstorms.Howdothey
compare?
TheLegoMindstormskitlookslikeitsgearedmoretowardsayoungeraudienceforasfunhobbyisttoy.
Thoughitcanmostdefinitelyserveotherpurposes,canbeusedforrapidprototypingforsmallprojects
thatcan
use
its
array
of
sensors,
wheels,
tracks
,etc.
The
iRoomba
kit
looks
more
professional
and
comesfullyassembled.Itcouldbeagoodforresearchapplications.Itisjustarobotbasethatcanadd
moresensorsandhasacargobayformountingotherthings.
HowdothemotorsusedintheiRoombacomparetothevariousmotorsinyourInventor'skit?
TheiRoombahas2motorsattachedtoitsdrivewheels.Icouldnotfindspecsonthesemotors.Iwould
assume,forthesizeoftheiRoombaandthecargoitcancarry,itsmotorsaremorepowerfulthanthe
Skparkfuns.
DiscusshowyoumightbuildarobotliketheiRoombausingyourInventor'skit,includingandadditional
partsyou
might
have
to
acquire.
Wow,sincetheiRoombaisacompleteunit,fullyassembled,Iwouldsaythattobuildsimilarlywith
Sparkfun,wewouldneed,wheels,gears,chassis,anadditionalmotor,motorshield.Wewouldalso
needahostofsensors,likedistancesensors,etc.
Chapter4 FoodForThought
1.How
would
you
measure
amotors
torque?
What
about
its
speed?
YoucanmeasureamotorsspeedbytheRPMsitgenerates.Iamnottoosureabouttorquebutmyguess
isyoucancalculatetorqueifyouknowthePowerandRPMsofamotor.IthinkPower=torquexRPM
2.HowmanyDOFarethereinthehumanhand?
-
8/12/2019 Arduino Coursework outline
9/23
Iamgoingtoassumethewristisnotincludedasthetextbookmentionedthewristwithoutthehand.
Myhandcanoverallmovein3dimensionalspaceandalsoroll,pitch,yawmovementssothats6
DOF.
Eachfingercanmovein3dimensionalspacethemselves,sothats3*5=15DOF
Eachofmyfingershas2joints,sothats10DOF.
Sototal31DOF
Chapter5 FoodForThought
HowdoesautomatedWebpathplannerlikeGoogleMapsfindtheoptimalpath?
Well,Iremember
from
my
combinatorics
class
that
we
calculated
the
optimal
path
between
2nodes
in
graphusingtheDijikstrasAlgorithm.Iguesssamecouldbeappliedhereasitsprettymuchthesame,the
edgesarestreetsandnodescanbeintersections.
SIKCircuit8
Assemblywaseasy.Ididntscrewintheattachmentfortheservo,asitfitquitesnug.ThistimeImade
sureIgotthewiringrightsoIwouldntscrewituplikethelastcircuit.Forthecode,Ilookedinthe
servo.hlibrarytounderstandthevariousfunctions.Itwasprettybasic.Thecodewasstraightforward
too.Ifirst
made
the
servo
just
go
to
various
positions
to
see
how
it
would
operate.
It
was
pretty
accurate,thoughIhadtoholditinmyhandthewholetime.ThenIranitwithincrementingpositions.
ThenIranitwithmanycommandssettingitatvariouspositions(Degrees)andtheservowasslow,
seemedliketheprogramwaspushingahead,IguessIneededdelays.
VIDEO https://www.youtube.com/watch?v=luoJWE3vTJA
SIKCircuit9
Assembly
was
again
straight
forward;
I
left
the
last
circuit
as
it
is
and
added
the
flex
sensor.
A
voltage
dividerisusedherejustlikethephotocellcircuit.Andjustlikethatcircuit,thevoltagedivideronlya
returnsaportionofthe0to1023range.Wehavetomapthatrangeto0to180deg.FirstIranthe
programtoseetheresult.Theservoisnotrunningsmoothly,itjitters.Ithencheckedtheoutputinthe
serialwindow.Theservo readingwasat120,Ichangedthedefaultrangeof600900to726900asthe
flexsensorreadingontheserialwindowstates726.Irantheprogramagainandtheservoreading
startedat0.Nowtoavoidthejitterymovement,Ihadtomakesharp,quickflexingonthesensor.
-
8/12/2019 Arduino Coursework outline
10/23
VIDEO https://www.youtube.com/watch?v=urDeeKREW68
SIKCircuit10
Justwanted
to
note
that
to
make
the
assembly
process
more
educational,
Istudy
the
circuit
guide
and
trytoassembleitwithoutreferringtoit.OfcourseIalmostalwaysmakeerrors,butatleastIthinkIam
learningbetter.InthiscaseIputtheGNDwireaccidentallyonthewrongRGBpin,butcaughttheerror
whenIdoublechecked.Ialsohadpushtheresistorsapartastheyweretouchingeachothersincethey
weretooclose.Forthecode,havingdonethepreviouscircuits,Iimmediatelyunderstandthewaytodo
thisone.Wejustreadasensorvaluethroughanaloginputlikebefore.Andjustlikepreviouscircuits,we
havetomapthevoltagerangefromsensor(01023)totheRGBrange(0255).Eachcolor,red,green,
andbluegetsathirdofthetotalvoltagerangeread.Finallywejustoutputthecolors.Rantheprogram
anditworks.Butthesoftpotwastooflimsy,itkeptcomingoutofthebreadboard,andIhadtoholdit
withonehandwhileIpresseditwiththeotherhand.Anotherwaywastopushdownonitwhilesliding
myfinger
along
the
strip,
the
colors
change
gradually.
VIDEO https://www.youtube.com/watch?v=vplSec_ODko
SIKCircuit11
Iwasexcitedtobuildthiscircuitandplaywithsound.Thepinsonmybuzzerwereseverelybent.After
workingthem
back
to
shape
Imanaged
to
securely
pin
it
to
the
breadboard.
There
was
hardly
anything
elseneededtobuildthiscircuit.Triedtoworkthroughthecodeandunderstanditfirst.Thenotes
correspondingtovariousfrequencieswashelpful!AllIneededtoknowthenwasthelengthofthesong
(numberofnotestoplay),tempo(thespeedtoplayalteredthroughdelays).Twoimportantarrayswere
neededtocustomizemusic,thenotesarraythatactuallyholdsthenotesforthesong,andthebeats
arraythatstateshowlongeachnoteisplayed.Iranthecircuitanditplayedthenotesbeautifully.Ithen
changedthenotestoplayjinglebellsfromwhatIrememberplayinginmusicclass.Iused:Songlength
26,tempo250andthefollowing:
charnotes[]="eeeeeeegcdefffffeeeeddedg";
intbeats[]
={1,1,2,1,1,2,1,1,1,1,2,,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2};
Anditplaysbeautifully.
VIDEO https://www.youtube.com/watch?v=wA2ObubzPmo
-
8/12/2019 Arduino Coursework outline
11/23
SIKCircuit12
Therewerealotmorethingstoputtogetherforthiscircuitthanthepreviousones.Ithoughtitwould
just beamatterofgivingpowertothemotor,butapparentlynot.ThenIlearnedthatthepinsonthe
arduinoarenotstrongenoughtorunthemotor,thatmakessense.Ifirstreadandlearnedthevarious
partsofthecircuitbeingused:Forinstance,thediodeisusedtopreventaspikeinvoltagefromthe
motordamagingthetransistor.Idoublecheckedmycircuitcarefullybeforerunningtheprogram.Itran
asexpected.Iattachedapieceofelectricaltapetothemotortoactasamakeshiftpropeller.
VIDEO https://www.youtube.com/watch?v=AOPCz9FbT4
MeetingLearningObjectives
1)listthevariousmechanismsofroboticmovement.
Somemechanismsofroboticmovementarearms,Legs,Tracks,Wheels,Tracksandpropellers
2)discussactiveversuspassiveactuation.
Activeactuationusesactivepowerconsumptiontoprovidepower,whereaspassiveactuationuses
potentialenergyintheeffectorsmechanicsanditsinteractionwiththeenvironmenttoprovidepower.
3)describedifferenttypesofactuators.
Thetypes
of
actuators
include
Electric
motors,
Hydraulics
(use
fluid
pressure),
Pneumatics
(use
air
pressure),Photoreactivematerials(reacttolight),Chemicallyreactivematerials(likefiberinacid&
alkalinesolutions),Thermallyreactivematerials(reacttotemperature), andPiezoelectricmaterials
(reacttopushingandpressing)
4)discussthesimilaritiesanddifferencesbetweenDCmotors,gearedmotors,andservomotors.
Allofthesemotorsconvertelectricalenergyintomechanicalenergybymeansofusingmagnets,loops,
wire,andcurrenttogeneratemagneticfieldsthatinturnrotatethemotorshaft.Gearedmotorsaddto
aDCmotorbyallowingittochangeforceandtorqueoutput. Thisisparticularlyusefulforrobotsas
robotscantradeaDCmotorsspeedwithmoretorqueinagearedmotor.ServomotorsaresimilartoDC
motorsexcept
for
the
fact
that
they
can
rotate
their
shaft
to
aparticular
position.
This
is
useful
in
roboticsforprecisecontrolovereffectors.
5)describeandcalculatethedegreesoffreedominmovement.
ADegreeofFreedom(DOF)istheminimumnumberofthecoordinatesneededtodescribeamechanical
systemsmotion.Forinstanceifarobotmovesin3dimensionalspace,themovementinthe3axis(x,
y,z)givesus3DOF.Ifthatrobotcanroll,pitch,oryaw(whichareallrotationsalongthedifferent
-
8/12/2019 Arduino Coursework outline
12/23
axis),thenthats3moreDOF.Themoretheindependentcomponentsthatcanmovelikethis,themore
DOFthatsystemwouldhave.
6)discussstabilityinroboticmovement.
Thereare2typesofstabilityforrobots,staticanddynamic.Arobotthatisstablestaticallycanhold
itselfupwithoutfallingwhileitisnotmovingbyhavingenoughstaticcomponentstosupportitself.A
robotisstabledynamicallyifitneedstomovetobeabletokeepitselfup,likeaflyingrobot.
Unit3
Chapter6 FoodForThought
1.HowmanyDOFarethereinthehumanhand?Canyoucontroleachofthemindependently?
Iamgoingtoassumethewristisnotincludedasthetextbookmentionedthewristwithoutthehand.
Myhandcanoverallmovein3dimensionalspaceandalsoroll,pitch,yawmovementssothats6
DOF.
Eachfingercanmovein3dimensionalspacethemselves,sothats3*5=15DOF
Eachofmyfingershas2joints,sothats10DOF.
Sototal
31
DOF
Yes,youcancontroleachofthemindependently.Although,somemovementsofthepinkiefingercause
minormovementinthenextfinger.
2.Whichofthetwojointtypeswediscussed,rotationalandprismatic,ismorecommonlyfoundin
biologicalbodies?Canyouthinkofexamplesofspecificanimals?
Biologicalbodiestypicallyhavearotationaljoint.Theyhavemusclesaroundajointactingasactuators
toallowthemtofreelymovearoundanaxisonthejoint.Forexampleadagcanmoveitsheadfreely
aroundanaxisparalleltoitslineofsightwhenlookingstraightahead.
3.Areastronautsuitsexoskeletons?Whataboutalevercontrolledbackhoe?
Yes,astronautsuitsareexoskeletons,becausetheywearitanditisanouterstructurethatprovides
protection.Backhoesarenotexoskeletonsbecauseeventhoughapersoncansitinone,theydont
exactlywearit.
-
8/12/2019 Arduino Coursework outline
13/23
4.Imagineanexoskeletonwhichhasitsownsensors,makesitsowndecisions,andactsonthem.Thisis
definitelyarobot,yetitisalsocontrolledbyahumanandattachedtothehumansbody.Canyou
imaginewherethiscouldbeuseful?
Thiscouldbeusefulinhazardousconditions,suchaswarzones,areaofachemicalspill,etc.Thesuitcan
senseexternal
dangers
and
react
accordingly
without
the
wearers
direction.
It
can
for
instance
automaticallysenddatabacktoacentralcomputer,etc.
5.Whataretheendeffectorsofthedogsinthatcase?Arethedogsnowpurelymobilerobots?
Ithinkthattheendeffectorsinthiscasearethedogfronttwolegs,becausethosearethemainlimbs
makingtheimpactonitsgoals.Thebacktwolegsarejustgettingthefronttwolegstotheirtarget.The
dogsarenotpurelymobilerobotsbecausetheirfronttwolegscanbeusedtoperformtasksotherthan
walking.
Unit3Exercises
DesignQuestion
Howmanymotors,andofwhattype,wouldyourequiretomakeafullyfunctionalroboticarmthat
hadaworkingelbow,wrist,andendaffector(i.e.asimpleclamp)?Whatcomponentswouldyouadd
ifyouwantedtheclamptobeabletotellhowharditwasgrabbinganobjectsuchasanegg(i.e.to
avoidcrushingit)?Discussyourdesigninyourweblogindetail,especiallydescribingthechoiceof
motorforeachjoint,thedegreesoffreedomandtherangeofmotion.
In
the
following
passage,
when
I
saw
a
joint
rotates
in
one
axis
,
I
mean
the
arm
moves
along
in
one
axis
likehowafoldedpocketknifeopensup.
Soweneedtosimulateshoulder,Elbow,wrist,clamp
Sofordegreesoffreedom:
1)Clamp:2DOFsincetheneedtobeabletorotateincircularmotionANDgraspthings
2)Wrist:1DOFtorotateinoneaxis
3)Elbow:1DOFtorotateinoneaxislikewrist
4)Shoulder:2DOF,1forrotatinginoneaxislikeelbow,andtheotherDOFforrotatingwholearm
(aroundthebase)
Sototal
6DOF,
so
we
would
need
6Servo
motors
to
implement
this.
Theclampjointcanrotate360degrees.
TheWristjointcanrotate180degrees,whichisrealisticandenoughsincetheelbowcanalsomove
allowingthewristtoreachmore
Theelbowcouldbemadetorotateinarangeof180degrees,butitispossibletomaketogoalltheway
aroundupto300degrees(cantdo360sinceitwillcollidewithbaseofarm),itdependsonhowone
wouldwanttoimplementit.Iwoulddo300degreestomakeitmoreversatile
-
8/12/2019 Arduino Coursework outline
14/23
Theshouldercanrotate180degrees,basicallystartingparalleltothefloorononesideandgoingallthe
wayover180degreestobeingparalleltotheflooragainonotherside.
Theshouldercanthenalsorotatealonganaxisperpendiculartothefloor,whichallowsthewholearm
totwist.
Grip:
Wewillalsoneedonemotorfortheclamptogripsomething.Ithinktherewouldbesometypeforforce
feedbacksensorsthatcanbeused.Suchsensorsfromthegripcanrelayinformationbacktothecontrol
unitwhichcanthencontroltheforcebeingapplied.Iamnotsurehowexactlytocontroltheforce,
perhapsthereiswaytovarythetorque.
Programming/CircuitTask
Soobviously
we
will
need
aservo
to
implement
this.
So
Ifirst
reviewed
circuit
8from
the
SIK
again
to
recaphowIusedtheservo.Nowtoimplementourelbowmovement,Ijustneedtogettheservoto
movetoaparticulardegreeinputfromuser.(startsat0degree,elbowfullyextended).SoobviouslyI
needaloopthatkeepscheckingforuserinputandmovestheservoaccordingly.GiventheSIKcircuitsI
did,thisisprettystraightforward.Iusedthecircuit8codeasatemplatetoworkfrom.Iknewthepin
assignmentsfortheservo.Iconnectedthepower,groundleadsandtheinputfromtheservotopin9
justasIdidbefore. Everythingworkedrightaway.Ijusthadanif structuretomakesureuserinputwas
withinlimits.Refertocodecommentsbelowforexplanation.
Testing:Ienteredlimitsoutofrange,andgottheappropriateresponse.IfIentersamedegreevalue
twice,
the
arm
just
stays
put,
which
is
fine.
CODE:
#include //servolibrary
Servoservo1; //servocontrolobject
voidsetup()
{
servo1.attach(9); //servoatpin9
Serial.begin(9600); //setbaudrate
servo1.write(0); //moveservoto0degrees
Serial.println("Enteradegree
value
to
contract
the
elbow
to
(0
170)");
}
voidloop()
{
intinput; //holdsuserinput
if(Serial.available()){
delay(1000); //Pausetoletservomove(includingwhenitsetsinitial0)
-
8/12/2019 Arduino Coursework outline
15/23
input=Serial.parseInt(); //getuserinput
if(input>=0&&input
-
8/12/2019 Arduino Coursework outline
16/23
Ofcoursenot,sensorsarenotthelimitingfactor.Nomatterhowmanysensorsyouhave,thecontroller
wouldstillneedtodobetterprocessing.SoIthinkthecontrolleristhelimitingfactorasevenwithfewer
processors,thecontrollerscouldprocessinformationmoreefficiently.Butofcourse,addingmore
sensorsdoesmakeiteasierforthecontrollerastherewillbebetterinformation,butsensorsarenotthe
limitingfactor.
3.Whatdoyouthinkitwilltaketogetrobotstobeselfawareandhighlyintelligent?Andifsomeday
theyareboth,whatwilltheirintelligencebelike,similartooursorcompletelydifferent?
Idontthinkrobotswilleverbeselfawarethewayweare.Ithinkwithenoughtechnological
advancement,theycansimulateselfawarenessorbeselfawaretosomedegree.Samegoesfortheir
intelligence.Themainissueisweourselvesdontfullyunderstandeverythingaboutourconsciousness.
Weknowwhenbabiesareborntheyarenotselfawareorintelligent.Thenafterafewyearsthey
becomeselfawareandtheirintelligencegrowsandtheylearnconstantly.Wedontfullyunderstandthe
underlyingprocessthatmakesallthishappen.Andsincewedontgetit,wecantexpecttobuildrobots
tobethatway.
Chapter8 FoodForThought
1.Whymightyoupreferapassivetoanactivesensor?
Imightpreferapassivesensortosaveenergyorpower.Someremoteapplicationsthathavenoaccess
topowerbenefitfrompassivesensorsduetotheirlowenergyusage.
2.Arepotentiometersactiveorpassivesensors?
Potentiometersarepassivesensorsbecausetheydontprovidetheirownsignalorstimuli,theydon't
havean
emitter.
They
measure
the
resistance
from
the
user
turning
the
knob.
3.Whatrobotsensorswouldyousayaremostsimilartosuchstretchreceptors?Aretheysimilarinform
(mechanismofhowtheydetect)orfunction(whattheydetect)?Whymightstretchreceptorsbeuseful
torobots,evenwithoutstomachsandeating?
Itishardtothinkofthetypeofsensorswithoutknowinghowtheexpandablestomachwillbe
constructed.GiventhetypeofsensorsIhavelearnedthusfar,flexsensorsseemthemostappropriate.
Youcanlinearobotstomachwithablanketofflexsensors,anddetecttheamounttheybend.Such
sensorswouldbeusefulforrobotsbecausetheycanavoidphysicalstressdamageoftherobot.
Chapter9 FoodForThought
1.Whatisthespeedofsoundinmetricunits?
Thespeedofsoundinmetricunitsis300m/s.
-
8/12/2019 Arduino Coursework outline
17/23
2.Howmuchgreateristhespeedoflightthanthespeedofsound?Whatdoesthistellyouaboutsensors
thatuseoneortheother?
Thespeedoflightinmetricunitsis 299792458m/s.Thereforethespeedoflightisgreaterthanthe
speedofsoundby299792458300=299792158m/s.Thistellsusthatwithlightsensorsyoucanget
informationmuch
faster
than
sound
sensors.
Therefore
processing
can
be
faster
with
light
sensors,
whereaswithsoundsensoryouneedtohavedelaysinbetweenprocessing.
3.Whathappenswhenmultiplerobotsneedtoworktogetherandallhavesonarsensors?Howmight
youdealwiththeirsensorinterference?InChapter20wewilllearnaboutcoordinatingteamsofrobots.
Onewayistotreattheuseofsonarasasharedresource,whereeachrobottransmitsasignalthatitis
pinging.Sotheonerobotexclusivelylockstheuseofsonar.Insteadoftransmittingasignal,Iguess
otherrobotscanlistenforanactiveping,butitcouldbenoisefromtheenvironment.
4.Whydontweuseshiftinfrequenciesbetweensentandreflectedsoundwavesinrobotics?
Iamguessingithastodowiththefactthatitischeaperandsimplertocalculatethetimeofflightas
opposedtoashiftinfrequency.
5.Sincetwoeyesaremuchbetterthanone,arethreeeyesmuchbetter,orevenanybetter,thantwo?
Twoeyesaresignificantlybetterthanoneeyebecauseitgivesasenseofdepth,andthereforelotmore
information.Thirdeyeinthesamedirectionwouldntaddmuchmorebenefit,ifitisveryclosetothe
other2eyes.Ifitisawayfromtheother2eyesinthesamedirection,itcanoffertheadvantageofa
differentangle.Ifthethirdeyeisfacinganotherdirectionthantheother2eyes,thenitcangive
significantlymoreinformationandthusismuchbetter.
Unit5
Chapter10 FoodForThought
1.Whathappenswhenyouhavesensorerrorinyoursystem?Whatifyoursensorincorrectlytellsyou
thattherobotisfarfromawallbutinfactitisnot?Whataboutviceversa?Howmightyouaddress
theseissues?
Whenthereisasensorerrorinasystem,therobotwillnotbehaveasexpected.Iftherobotfailstotell
youcorrectlythatitisclosetoawall,itcancollidewithit.Ifitincorrectlytellsyouthatisclosetowall,
thenitcouldstopevenifitissafetomoveforward.Itiscommonforsensorstofailnowandthen,and
weshouldevenaccountforapermanentfailure.Onewaytoaccountforincorrectsensordataistohave
thesensortakemultiplereadingsandaveragetheresults.Thiswilleliminateanyanomalies.Ifthey
sensorrepeatedlygivesincorrectdata,thenwecanhaveabackupsensortopreventacollision.For
instance,ifadistancesensor(IR)ismalfunctioning,aflexsensorinthefrontofarobotcanprevent
collisionbydetectingawall.
-
8/12/2019 Arduino Coursework outline
18/23
2.Whatcanyoudowithopenloopcontrolinyourrobot?Whenmightitbeuseful?
Withopenloopcontrol,arobotexecutescommandsbasedonwhatwaspreviouslypredictedas
opposedtorelyingonsensoryfeedback.Thiscouldbeusefulforrobotswhentheirsensorseitherdonot
orcannotrelyontheirsensors
Chapter11 FoodForThought
1.Howimportantistheprogramminglanguage?Coulditmakeorbreakaparticulargadget,device,or
robot?
Anyprogramminglanguagecanbeusedtoimplementsoftwareforarobot.Whatismoreimportantis
howthecontrolarchitectureisusedtoimplementthecontroller.However,certainprogramming
languagescanbebettersuitedforaparticularimplementation.Thiscanmaketheprogrammingeasier,
andthereforethesoftwarepotentiallybetter.Forinstance,theprogramminglanguagePrologcouldbe
wellsuitedforachattingrobot.Thischoiceofprogrammingwillmakethesoftwareimplementation
easierand
potentially
better.
So,
while
the
choice
of
programming
language
might
not
necessarily
break
arobotordevice,itcouldinhibititspotentialperformance.
2.Withtheconstantdevelopmentofnewtechnologiesthatusecomputation,doyouthinktherewillbe
increasinglymoreorincreasinglyfewerprogramminglanguages?
Ithinkwithdevelopmentofnewtechnologieswewouldseemanynewprogramminglanguages.
However,Ithinkmostofthesenewlanguageswouldbevariantsofcurrentprogramminglanguages,
withminorchanges.Thesenewprogramminglanguageswouldbebeneficialbecausetheycouldbe
tailoredtonewtechnologies,andtherebymakingsoftwaredevelopmentmoreefficient.
Unit6
Chapter12 FoodForThought
1.Doyouthinkanimalsuseinternalmodels?Whataboutinsects?
Ithinkanimalsdouseinternalmodels.Whenanimalsareborn,theyhaveunderlyinginstinctstoguide
them.ButIthinkastheyage,theydevelopinternalmodelsbasedontheirexperiences.Iamnotsure
aboutinsects;Ithinktheyarelesscapableofdevelopinginternalmodelsbecauseoftheirbrainsize.
Theystill
may
have
primitive
internal
models.
2.Whymightyounotwanttostoreanduseinternalmodels?
Storingandusinginternalmodelscouldbetaxingintermsofprocessing.Alsoforexample,ifthe
environmentisdynamicorchanging,thebenefitofstoringinternalmodelsactuallybecomesaburden.
Itwouldbebettertonotstoreinternalmodelsandinsteadforexample,userealtimesensorsand
processingtoachievethesamegoal.
-
8/12/2019 Arduino Coursework outline
19/23
Unit7
Chapter13 FoodForThought
1.Canyouusedeliberativecontrolwithouthavingsomeinternalrepresentation?
NoIdontthinkyoucandeliberativecontrolwithoutsomeinternalrepresentation.Because,ifarobot
needstobeabletodeliberateorthinkhardaboutwhatitneedstodo,itneedsinformationtoprocess.
Thisinformationhastobestoredinsomemannerwithintherobot,whichwouldbesomesortof
internalrepresentation.However,itispossibleforarobottoreacttorealtimesensoryinputbasedona
setofruleswithoutanunderstandingofitssurroundings.
2.Cananimalsplan?Whichones,andwhatdotheyplan?
Yesmostanimalscanplans,whentheyhavebrainsdevelopedtoacertaindegree.Thisisusually
correlatedwithbrainsize.Forinstance,Lions,KillerWhales,etc.canplanandhuntinapack.
3.Ifyouhadperfectmemory,wouldyoustillneedtoplan?
Ifwehadperfectmemory,Ithinkwewouldstillneedtoplaninsomecasesbecausewemightnothave
experiencedallscenariosinthepasttopurelyrelyonourmemory.Wemighthavetoextrapolate
informationfromourmemorytoplanforacurrentscenariothatisunexpected.
Chapter14 FoodForThought
1.Canyouchangethegoalofareactivesystem?Ifso,how?Ifnot,whynot?
No,youcannotchangethegoalofareactivesystembecausetheyhaveaspecificsetofrulesthatcouple
specificscenarios
to
specific
actions.
Since
these
factors
dont
change,
the
goal
cannot
ultimately
change.
2.Canyoualwaysavoidusinganyrepresentation/worldmodel?Ifso,how?Ifnot,whynot,andwhat
couldyoudoinstead?
Youcanavoidusingarepresentationmodelbyhavingtherobotrelyonsensoryinput.Gathering
informationinsuchmannerwouldalsoalleviateburdenontherobothavingtostorelargeamountof
data.
3.Canareactiverobotlearnamaze?
Yes,arobotcanlearnamazebystoringaninternalmodelonwhatitencounterswhileexploringallthe
pathwaysofthemaze.Itispossiblefortherobottotraverseallcornersofthemazeiftheyare
accessible,althoughitwouldtakealongtimeandalotofprocessingbytherobot.
Unit8
Chapter15 FoodForThought
-
8/12/2019 Arduino Coursework outline
20/23
-
8/12/2019 Arduino Coursework outline
21/23
However,suchinstinctscanalsoleadtoimperfections,justlikeinhumandecisionmaking.So,perhaps
wewouldavoidsuchrobotsincertaincriticalapplicationswhereweneedamorerigorouscontrolover
decisionmaking.
Unit10
Chapter18 FoodForThought
1.Besideswallfollowing,orfollowing(servoingtosometarget),whichisanaturalbehaviortoproduce
viaemergence,canyouthinkofothersyoumightwanttoimplementthisway?
Anotheremergentbehaviorissearching.Ifyougivearobotasetofrulestoavoidwallsandobjectsina
randommanner(i.e.randomizethedirectionafteravoidingobstacles),thentherobotwouldtechnically
bemappingitsentireenvironmenteventually.Iamnotsurethisisagoodexample,butwithout
explicitlytelling
the
robot
to
follow
aset
of
directions
to
map
it
environment
or
give
it
an
internal
model,randomlyavoidingitsobstaclescouldintheoryeventuallyhavetherobotmapitsentire
environment,thoughinanextremelytediousandinefficientway.
2.Canyouthinkofwaysofusingemergentbehaviortodosomethingquitecomplicated,suchasbuilda
bridgeorawallorabuilding?Antsdoitallthetime,seeChapter20.
Wecanhaveateamofrobotsworkingtogethertoachieveacomplexgoallikebuildingawall.Each
robotcouldbeassignedasimpletasksuchaspassingabrickorlayingabrick.Overall,buildingthewall
wouldthen
be
an
emergent
behavior.
Unit11
Chapter19 FoodForThought
1.Antsaretremendouslyeffectiveatdeadreckoning,findingtheirwayinthevastopenspacesofthe
desertthroughodometry.Theyseemtobemuchbetteratitthanpeople,basedonsomestudiesthat
havebeendone.Ofcourse,nostudieshaveactuallypittedahumanagainstanantinthedesert,but
comparableexperiments
find
people
lost
and
confused,
and
ants
on
anearly
straight
path
back
home.
Antsaresuperiorinnavigationduetotheirinternalcompassandamechanismbywhichtheycanjudge
thedistancetravelled.Itispossibleforhumanstonavigatealmostasgoodasants,althoughnot
naturallyatfirst.Humanscouldusecelestialnavigationtechniquestodeterminetheircurrentlocation
totheirstartinglocation.Theycouldalsokeeptrackofthenumberofstepstheywalkortimetheywalk,
eithermentallyorrecordingitsomewhere.ButIguesstonavigatelikeanant,itwouldhavetobe
-
8/12/2019 Arduino Coursework outline
22/23
-
8/12/2019 Arduino Coursework outline
23/23
goalshouldtocompletejobxinthemostefficientwaypossible.Ifthatmeansrobotstakingover
humanlabor,thenthatshouldbetheway.Economicstellsusthatthenthehumanworkforcewould
eventuallyadapttosuchshiftsinthemarketbyperhapstrainingmorehumansinskilledjobsthatrobots
cantperform.However,thereisaplaceforethics,andsoIthinkweshouldsoftenthenegativeimpact
onthelaidoffworkforcethroughvariousmethods.Forinstance,wecouldhaveagradual
implementationof
robots
as
opposed
to
asudden
massive
overhaul.
This
would
give
the
workforce
moretimetoadapt.
2.Somephilosophershavearguedthatoncerobotsbecomesufficientlyintelligentandselfaware,they
willbesomuchlikepeoplethatitwillbeunethicaltohavethemworkingforus,asitwillcreatearaceof
slaves.Whatdoyouthinkaboutthat?
Thisishardtothinkaboutasitisveryphilosophical.Itdependsonwhatexactlysufficientlyintelligent
means.Ifweassumethatarobotcanbeassmartashuman,havememories,etc.thentheyare
intelligent.Now
would
this
intelligent
robot
have
free
will
or
asense
of
itself?
Would
it
have
a
conscience?Suchthingsaretoocomplextoevenimaginearobotacquiring,soIwouldassumethatthey
wouldnothavetheseabilities.Inthatcase,sincewewouldbeabletohaveacleardistinctionbetween
humansandtheserobots,itwouldbeOKtonotgivethemequalrights.However,theycouldhaveas
muchrightsasapetwouldhave,whichisinterestingbecausemanypetsarealsointelligent.We
basicallykeeppetslikeslavesinsomemanner.