a simple shaft encoder for modified rc servos
TRANSCRIPT
-
7/31/2019 A Simple Shaft Encoder for Modified RC Servos
1/6
MOTOR
A Simple Shaft Encoder for Modified RC ServosRussianversion
ModiiedRCservosareperhapsthemostpopularmotorsusedinhobbyrobotics.Nootherkindofmotorhas
similaravailability,priceandpossibilities.Someusethemunmodiied,someonlymodifythemforcontinuous
rotation(whichissometimescalledhalf-lobotomy),butthebestcontrolbecomespossibleifthemotorssuffer
fulllobotomyirst-whenyouremoveeverythingexceptthemotorandgears.OfcourseaproperH-bridge
andcontrolcircuitisnecessaryinthiscase.
Foranyadvancedtaskthatinvolveswheelrotationitisnecessarytohavesomefeedbackfromthewheels.
Thecontrolprogrammustknowhowfarthewheelrotatestoadjustrotationspeedofdifferentwheels,orjust
tobesurethatthevehicleisstandingstillandnotbeingpulledsomewherebyanunknownforce.MyAkipaki
robotneedsthemtobeabletomoveinastraightlineandtobeabletodetectthatthemaincontrolloopis
undercompensatingthefallanditkeepsrollinginsteadofstandingorrockingaroundoneplace.
Therearedifferenttypesofshaftencodershobbyiststendtouse.I'veseenalotofdesignswhereapatternis
printedoutonthewheelitselfandaphotosensingcircuitismountedsomewhereonthechassis-thiskindof
designseemsweirdtome,afterallyoudon'tcarryyourgutsaround,youkeeptheminthebelly.Somemore
advanceddesignsimplementquadratureencoders,sometimesevenittedinsideofanoriginalgearhead
motorchassis.Althoughquadratureencodersgivehigherresolutionandallowtodetectthedirectionofspin,
theyusuallydependheavilyonrarelyavailableparts,becausethecircuitisboundtobeextremelysmall.Also,
quadratureencoderisnotrequiredincaseofamodiiedservobecausethegearreductionratioissohighthat
it'salmostimpossibletoturnthemotorbyrotatingtheoutputshaft.Wecanverysafelyassumethatthe
directionofrotationalwaysfollowscontrolandifitdoesn'twecouldn'tpossiblyhelpitanyway.
AdesignthatIfoundtobemostsuitableformyneedsbelongstoAlanMacek.Heusedservosverysimilarto
thosethatIhaveandheimplementedaverysimpleshaftencoderusingonlyonepreciousunavailablepart.
Thefollowingdesignisafurtherdevelopmentofhisideas,there'sverylittleoriginalinmyproject.Iuseno
unavailablepartsbecauseifididuseany,I'dnotbeabletomakeit.IfyouhavenoproblemsindingQRB1114
ortheirlikes,justfeelfreetoentertainyourselfbywatchingmesuffering.
Icouldnotindanyofsooftenmentionedonthe
netconvenientandusefulintegratedIRemitter-
receiverpairsspeciallydesignedforrelectivesensors.NeithercouldIindanypartsofthis
sortthathaveintegratedampliiersinthem.All
thatIhadavailablewereregularIRemittersand
phototransistors.SoIhadtoadoptthecircuita
littlebittomakeauseofwhatIhave.Hereismy
circuit.Itexplicitlyhaspoweriltertoavoidhard
noisethatmaybecausedbylongwires,
interferenceandwhatnotisthereinamotor.R4
is680ohminmycase,butitmustbechosen
experimentallyforyourIRemitter/receiver
combination.Italsoheavilydependsonthekind
ofnon-relectoryou'reusing(moreonthat
later).Alternatively,sensitivitycanbechanged
byalteringR1/R2,butIhaven'ttriedthat.
Providedyou'recapableofmakingexperiments
toindsuitablevalues,anykindof
emitter/transmittercanbeused-pickthe
cheapestonesyourretailerhastooffer.And
sincetheentirethingwillsitinsideofablack
case,it'snotnecessarytousepartswithvisible
lightilters.
Fig.1 Circuit (click)
Idesignedatemplatefor
PCBthatwoulditinsideof
aservomotor.
UnfortunatelyIthrewthe
originalservobrainsout
(aftereatingthemost
deliciouspartsofcourse),
soIwasn'tsureoftheir
mple Shaft Encoder for Modified RC Servos http://sensi.org/~svo/shaft_encoder/
6 29-07-2012 22:30
-
7/31/2019 A Simple Shaft Encoder for Modified RC Servos
2/6
Fig.3 Just etched
Fig.5 Harness
Fig.2 Phototemplate (click for PDF)
originalsize.Butthis
designitsinprettywell,
withahelpofaileanda
hammeranyway.Youcan
usetheprovidedPDFileto
makeyourownPCB's.Just
liketheonepicturedright.
ThisboardissosmallthatI
couldnotindplacetoput
anyobnoxioustextsonit...
N.B.TheboardsImade
havea(non-fatal)error,a
trainedeyewillspotthem
immediately.Thetemplate
givenherehasthiserror
corrected.
Fig.4 Populated board
Here'swhatapopulatedboardlookslike.Ididn'twashit
aftersolderinganddebugging,soitmaylooknotasfancyas
afactorymadeone,butitdeinitelylooksauthentic,
especiallywithmismatchedsizesofsalvagedSMDcomponents.Notethatalthoughthisboardissingle-sided,
thereversesideisstillpresentandisusedagroundplane.It
isnecessaryforinterconnectionsanditalsoservesasanEMI
shield.Onthispictureitisvisiblethatsmallsquareofthe
backplane(totheleft-top)isremovedtoavoidpossibleshort
circuitofwires.
Itisnowtimetothink
abouthowtomount
discretepartsintothe
casingofaservo.Ifwe
hadonesender-receivermodule,we'd
justcutaholeinthe
caseandglueitin
somewhere.Butwith
twoseparateparts,itis
reallyimportantto
keepthemaligned
together.Iusedsomeof
remainingcutsof
copper-laminated
iberglasstomakea
harness.Youwould
havetomaketwo
markingsatproper
distancestoittwo
3-mmled-likethings,
thendrillverysmall
holesforalignment,
thentakeyourbigdrill
andmake3mmholesto
itintheledandthe
receiver.Imadethe
holessothatthe
emitterandthe
receiverarelookingtowardseachother,kind
ofsimulatingthem
being"focused"toa
certaindistance.But
mple Shaft Encoder for Modified RC Servos http://sensi.org/~svo/shaft_encoder/
6 29-07-2012 22:30
-
7/31/2019 A Simple Shaft Encoder for Modified RC Servos
3/6
Fig.7 Encoder wheel
I'mreallynotsureif
thisworksand
importantatall.The
emitterledseemstobe
shiningprettymuch
omindirectionallyata
distancethissmall.
Aftersomesimple
testing(thecircuit
outputmustgodownfromhighwhen
somethingrelectiveis
nearthesensor)Iglued
bothcomponentstothe
harnessandsoldered
shortwirestoattach
themtothePCB
permanently.
Fig.6 Sensor window
Ontheleft
pictureyou
canseea
windowinthecasing,
thesensor
will"look"
throughiton
thegearwith
interrupter
(thisisa
viewwith
reductor
gears
removed,but
youmust
knowthatif
youwent
thisfarinto
servo
anatomy).
Theright
picture
showsthe
bottomside
ofthe
"encoder
wheel".Therealbeneit
ofthisdesign
isthatthe
encoder
wheelis
reallysimple
anddoesn't
require
complicated
printed
patterns
(although
youcantrythat,Idon't
recommend
becausethis
wheelis
mple Shaft Encoder for Modified RC Servos http://sensi.org/~svo/shaft_encoder/
6 29-07-2012 22:30
-
7/31/2019 A Simple Shaft Encoder for Modified RC Servos
4/6
reallysmall,I
barelycould
photograph
thepest).
Youcansee
tracesofall
kindsof
torturesI
triedonthis
poorgear.Intheendof
thisordealI
went
completely
medieval
andglued
ontoitatiny
patchof
insulation
tapemadeof
pitchblack
fabric.Paintingthe
gearwith
marker
didn'tgive
enough
contrast.
Evenglueing
apieceof
paperall
blackened
withapen
didn'tgive
enoughcontrast-at
distancethis
close
everything
exceptpitch
blackblastic
isvery
relectivefor
IR.Actually
glueinga
tinybitof
plasticfrom
SMDreel
packaging
wouldwork
too.
Fig.8 Gooed in
Leftpicture
showshow
theharness
isitted
insideofthe
servocasing.
Iusedsome
kindof
thermalglue.It'snot
exactlythe
kindusedin
gluepistols,
mple Shaft Encoder for Modified RC Servos http://sensi.org/~svo/shaft_encoder/
6 29-07-2012 22:30
-
7/31/2019 A Simple Shaft Encoder for Modified RC Servos
5/6
Fig.9 Peek-a-boo
Fig.11 Fat boy
it'snot
transparent
andmessy
andsmells
funny.Any
gluewilldo
though.
Rightpicture
showshowthe
makeshift
sensoris
peeking
throughthe
peepholein
thecasing.
Justalittle
moretime
andallitwill
everseewill
bethe
torture
encoder
wheel.Har.
Fig.10 Packing
Everything
mustbe
clearfrom
nowon.I
hadtocut
theboarda
littleonthe
sidestolet
thescrews
itin.
Protectedit
withtwo
layersof
insulation
tapetoavoid
anycontact
withthe
motor,then
itteditin.
The
capacitor
wasthemostprotruding
partonthe
board,Ieven
hadtocuta
littlewindow
inthecover
forittoo.But
still,the
boardisa
littlethicker
thanthe
casing
allows,afterIscrewed
backthe
coverthe
servolooksa
mple Shaft Encoder for Modified RC Servos http://sensi.org/~svo/shaft_encoder/
6 29-07-2012 22:30
-
7/31/2019 A Simple Shaft Encoder for Modified RC Servos
6/6
little
oversatiated.
Withthis
reductor
(theoriginal
servowas
Hi-Tec
HS-311,they
sayit'sthemost
unmodiiable
servoever
made,butI
don't
understand
why-I
modiiedthe
helloutofit
anditstill
works),Iget
42pulses
peroutput
shaft
revolution.
Theduty
cycleisnot
perfectly
50%asyou
mightguess
bylookingat
theencoder
wheelIuse.
Numberof
pulsesperrevolution
canbe
increasedat
least
two-foldby
adding
another
nonrelective
stripeof
blackgoo.
Conclusion:thisdesignisrelativelysimpletoimplementanditworkswiththemostunmodiiableservoin
theworld.Numberofpulsesperrevolutionhassacredmeaningwhichcannotbeabadthing.Afterthevalue
ofcurrent-limitingresistorforcertaintypeofemitter/receiverisfound,theentirethingmustbeeasyto
reproduceforasmanymotorsasneeded.Nohard-toindorexpensivecomponentsarenecessary,andthe
entiremodiicationitscompletelyintotheoriginalservocase.
* * *
2005 Viacheslav Slavinsky. Please do not republish without permission. Send all comments and criticisms to svofski a t gmail dot
c0m.
mple Shaft Encoder for Modified RC Servos http://sensi.org/~svo/shaft_encoder/