Lab 2, Part B: Robot DC Motor: Speed Measurement Circuit Design

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Lab2,PartB:RobotDCMotor

Speedmeasurementcircuitdesign

ECEN2270

ElectronicsDesignLaboratory

Discussion
Comepreparedtothelab
Reviewlectureslides,preparetoaskquestions Reviewlabtasks LTspice simulationscanbecompletedoutsidethelab FinishPartA:LTspice simulations StartPartB:paperdesignandLTspice simulations,before you startbuildingyourcircuit

Inthelab
Attendanceismandatory Donotrushthroughexperiments,stopifyouhavequestions aboutwhyorwhatyouaredoing

Reports
Donotleavereportforlater,workonitasyoudolabtasks Followreportguidelines Makesureyouincludeeverythingstatedinthelabtask
ECEN2270 ElectronicsDesignLaboratory 2

Robotplatform

TwoDCmotors,eachdrivingawheel

DCsupply 10<VDC <+10V

wheel IDC
motor shaft wheel shaft

VDC

+ _

Optical encoder: 12 pulses permotor shaft rotation

DCmotor
12 3 4

64:1 gear

1EncoderpowersupplyVCC=+710V 2Encoderground 3EncoderoutputpulsesA,frequencyfenc 4EncoderoutputpulsesB,frequencyfenc

ECEN2270

ElectronicsDesignLaboratory

Lab2objectives
PartA MeasureDCmotorcharacteristics DevelopaSpicecircuitmodelfortheDCmotoranddetermine modelparametersbasedonexperiments Validatethemodel:compareexperimentalandsimulationresults PartB Designaspeedsensorcircuit(tachometer)thatoutputsvoltage proportionaltowheelspeed UseLTspice simulationstoverifyanddebugthedesign Build,testanddemothespeedsensorcircuit

ECEN2270

ElectronicsDesignLaboratory

PartB:SpeedSensorCircuit
Encoderoutputpulses,frequencyfenc [Hz]is proportionaltospeed

CanuseLab2PartAdatatodeterminetheexpectedrange ofencoderoutputfrequencies,particularlythemaximum frequency Althoughfrequencyvaries,thedutycycleisconstant (50%),thustheaverageencoderoutputvoltageisconstant Goal:Convertfrequencytovoltage Approach: Convertencoderoutputfrequencytodutycycleusingaoneshotcircuit Lowpassfiltertheoneshotcircuitoutputtoproduceavoltageproportional toencoderfrequency
ElectronicsDesignLaboratory 5

ECEN2270

Oneshotcircuit
Inputtrigger Oneshot Fixedton output

Oneshotout

Oneshotout

Frequencyoftheoneshotoutputtracksthefrequencyoftheencoder Thedutycycleoftheoneshotoutputisproportionaltofrequency Theaveragevalue(lowpassfiltered)oftheoneshotoutputis proportionaltofrequency


ElectronicsDesignLaboratory 6

ECEN2270

SpeedSensor(Tachometer)Circuit

ECEN2270

ElectronicsDesignLaboratory

Howtoapproachtheanalysis(ordesign,ordebugging) ofacomplexcircuit 1.DONT:diverightinandstartwritingalotofloopand nodeequations


Youwillmakeanalgebraicmessandgetnowhere Whendebugging:dontjustbuildthewholethingandturniton, expectingittoworkfirsttime

2.DO:Breakthecircuitdownintosmallerfunctionalblocks thatcanbeseparatelyunderstood
Firsttrytoexplaininwords(aparagraph)howeachblockworks Getthefirstblocktoworkbeforemovingontothenext

ECEN2270

ElectronicsDesignLaboratory

3.DO:Foreachblock,decidewhatyouneedtoknow, andwhatanalysiswillbetractableandfeasible
Identifytheinputandoutputsignals.Thegoalistofindthe functionalrelationshipbetweenthese. Writesimpleequationsthatyoucanreasonablysolve Solvetheequationsfortheelementvalues;oftenthereis morethanonevalidanswer
Developadditionalconstraintsbasedonyourunderstandingofhow thecircuitissupposedtowork Choseimpedancelevelssothatcurrentsandpowerconsumption arereasonable,e.g.mAnotA

ECEN2270

ElectronicsDesignLaboratory

Breakingthetachometercircuitintoblocks

Oneshot Block Trigger Block

Lowpassfilter Block

ECEN2270

ElectronicsDesignLaboratory

10

Oneshotblockpreliminaries:insidethe555timer
Includestwocomparators,a flipflop,dischargetransistor, outputbufferandaninternal resistordivider Upperthreshold,THRESH,is 2/3VCC usedforinternal Reset Lowerthreshold,TRIG_BAR,is 1/3VCC usedforinternalSet TransistorshortsDISCHpinto groundwhileoutputisLOW Canbeeasilysetupas monostable (oneshot)or astable (oscillator)
Viewtheyoutube 555tutorialpostedontheLab2page
11

Equivalentcircuit

Oneshotcircuit
Input:Setpulsefromtriggercircuit Output:Outsignalhavingpulsewidthton Thiscircuitresetsthelatchwhenthe capacitorvoltagevC2(t)reachesthe thresholdvoltageCTRL

Inputandoutputwaveforms Thingswewanttoknow: Howdoesthiscircuitgeneratetheton pulse? Howlongiston,andhowshouldwechoose R2 andC2?

ECEN2270

ElectronicsDesignLaboratory

12

555Timer:Monostable oneshotoperation
ttrig R2
2VCC/3

C2

Fixedton
2 VCC (1 e ton / R2C2 ) VCC 3

ton R2C2 ln3

Oneshottiming ttrig:triggermustdropbelowthreshold(1.6VatVcc=5V)longenoughfor reliabletrigger(>1s),butshorterthanton


Vtrigger_low <1.6V 1s<ttrig <ton

Designoutputpulseton tosetdutycycleatmaximumfrequency
ECEN2270 ElectronicsDesignLaboratory 13

Breakingthetachometercircuitintoblocks

Oneshot Block Trigger Block

Lowpassfilter Block

ECEN2270

ElectronicsDesignLaboratory

14

Equivalentcircuit

Triggercircuit
Input:venc(t),squarewavefromencoder Output:Setpulsegoingtolatch Thiscircuitsetsthelatchatthefalling edgeofvenc(t) Soonafterthelatchisset,wewantthe setpulsetogoaway:thesetpulseneeds toterminatebeforeitistimetoresetthe latch.Butthedatasheetforthe555timer specifiesaminimumpulsewidthof approximately1sec. Thingswewanttoknow: Howisf relatedtothegroundspeedofthe wheels?(leftasexerciseforstudents) Howdoesthiscircuitgeneratetheset pulse? Howlongisttrig,andhowshouldwechoose R1 andC1?
ElectronicsDesignLaboratory 15

Inputandoutputwaveforms

ttrig

ECEN2270

TriggerCircuit
DiodeD1clampstrignodetoVCCon risingedgeofencsquarewave CapC1pullstrignodedownonfalling edgeofencsquarewave ResistorR1chargesC1andpullstrig backuptocompletetriggerpulse

ttrig

ECEN2270

ElectronicsDesignLaboratory

16

Breakingthetachometercircuitintoblocks

Oneshot Block Trigger Block

Lowpassfilter Block

ECEN2270

ElectronicsDesignLaboratory

17

Lowpassfiltercircuit
Equivalentcircuit Input:PulsewidthmodulatedsignalOUT Output:speedsignalhavingaDCvalue proportionaltof Thiscircuitisalowpassfilterthatpasses theDCcomponentofOUT butremoves thefundamentalandhigherfrequency components Inputandoutputwaveforms Thingswewanttoknow: Howdoesthiscircuitoperateonthepulse widthmodulatedOUTsignaltoproducethe speed signal? HowshouldwechooseR3 andC3?

ECEN2270

ElectronicsDesignLaboratory

18

TimeConstantsintheTachometercircuit
Threetimeconstantstoselect R1,C1
1s<ttrig <<ton C1>>capacitanceatnodeTRIG R1>>Rencoder R1,C1determinesttrig

R2,C2
Setton todetermineoutputvoltageofspeedsensoratmaximum speed(basedonVCCanddutycycle)

R3,C3
LowpassfilterPWMoutput;determinesvoltagerippleonthe speedsensoroutputvoltage R3*C3>>lowestexpectedPWMperiod R3*C3<desiredresponsetimeofthespeedsensor(e.g.<<1sec)
ECEN2270 ElectronicsDesignLaboratory 19

Lab2,PartB
Designandsimulatethespeedsensorcircuit Build,testanddemothespeedsensorcircuit SeetheLab2Tasks,PartB,fortaskspecifications

ECEN2270

ElectronicsDesignLaboratory

20

Appendix:MoreDetails
TriggerCircuit OneShotCircuit LowPassFilterCircuit

ECEN2270

ElectronicsDesignLaboratory

21

Equivalentcircuit

Triggercircuit
Input:venc(t),squarewavefromencoder Output:Setpulsegoingtolatch Thiscircuitsetsthelatchatthefalling edgeofvenc(t) Soonafterthelatchisset,wewantthe setpulsetogoaway:thesetpulseneeds toterminatebeforeitistimetoresetthe latch.Butthedatasheetforthe555timer specifiesaminimumpulsewidthof approximately1sec. Thingswewanttoknow: Howisf relatedtothegroundspeedofthe wheels?(leftasexerciseforstudents) Howdoesthiscircuitgeneratetheset pulse? Howlongisttrig,andhowshouldwechoose R1 andC1?
ElectronicsDesignLaboratory 22

Inputandoutputwaveforms

ttrig

ECEN2270

Triggercircuitanalysis:preliminaries

Characteristics of silicon pn diode

1. V+ isdeterminedbyvoltagedivider:V+ =VCC (5k)/(15k)=VCC/3=1.67V 2.DiodeD1 behavesasanonoffswitch(aonewayvalve).Theconductingstate dependsonthevoltageandcurrentappliedtothediodebythecircuit:


Ifthecircuitmakesthevoltageattheanodeterminalgreaterthanthevoltageatthecathode(or ifthecircuitappliespositivecurrenttothediode),thenthediodeturnson.Thisclampsthe anodetoavoltageslightlygreaterthanthecathodevoltage(i.e.,thediodeisapproximatelya shortcircuit). Ifthecircuitattemptstoapplyreversecurrent(fromcathodetoanode)orreversevoltage,then thediodeturnsoff.Thiscausesthediodetobecome(approximately)anopencircuit.
ECEN2270 ElectronicsDesignLaboratory 23

Triggercircuit:waveforms

D1 ON

D1 OFF

vC1 dischargesto0throughD1 D1 doesnotallowTRIG >VCC sovC1 =0

ttrig

vC1 chargestoVCC throughR1

ECEN2270

ElectronicsDesignLaboratory

24

Triggercircuit:analysistofindttrig
Duringthesetpulseinterval: DiodeD1 isOFF(opencircuit) venc(t)=0 vC1 isinitiallyzero,andC1 charges throughR1 Therefore,forthisintervalthecircuit reducesto: Nowusepartialfractionexpansiontotake inverseLaplacetransform(exercisefor thestudent);theresultis: Thetriggercircuitcomparatorcausesthe setpulsetoendwhenvC1 =VCC/3,attime t =ttrig.Hence:
vC1 (t ) VCC 1 e

Letsdefinet =0atthebeginningof thisinterval,andtaketheLaplace transformofthecircuittosolvefor thecapacitorvoltage:

ttrig / R1C1

Solveforttrig:

ttrig

ECEN2270

ElectronicsDesignLaboratory

25

Equivalentcircuit

Oneshotcircuit
Input:Setpulsefromtriggercircuit Output:Outsignalhavingpulsewidthton Thiscircuitresetsthelatchwhenthe capacitorvoltagevC2(t)reachesthe thresholdvoltageCTRL

Inputandoutputwaveforms Thingswewanttoknow: Howdoesthiscircuitgeneratetheton pulse? Howlongiston,andhowshouldwechoose R2 andC2?

ttrig

ECEN2270

ElectronicsDesignLaboratory

26

Oneshotcircuit:waveforms
Thetransistoroperatesasanon/offswitch: WhenQishighthenthetransistorisoff, andviceversa. Whenon,thetransistorshortsoutC2 andholdsvC2 =0. Whenthetransistorisoff,capacitorC2 chargesthroughR2.

ttrig
TransistorON

OFF

vC2 chargestowardsVCC throughR2 ComparatorresetslatchwhenvC2 reachesCTRL (=2VCC/3)


ECEN2270 ElectronicsDesignLaboratory 27

Oneshotcircuit:analysis
Exerciseforthestudent:deriveanexpressionforton Showthestepsof: TheLaplacetransformedcircuittobesolved Deriverelevantequationandtakeinversetransform Solveforton ThenuseyourresulttoselectvaluesforR2 andC2.

ECEN2270

ElectronicsDesignLaboratory

28

Lowpassfiltercircuit
Equivalentcircuit Input:PulsewidthmodulatedsignalOUT Output:speedsignalhavingaDCvalue proportionaltof Thiscircuitisalowpassfilterthatpasses theDCcomponentofOUT butremoves thefundamentalandhigherfrequency components Inputandoutputwaveforms Thingswewanttoknow: Howdoesthiscircuitoperateonthepulse widthmodulatedOUTsignaltoproducethe speed signal? HowshouldwechooseR3 andC3?

ECEN2270

ElectronicsDesignLaboratory

29

Lowpassfiltercircuit:analysis
ThepulsewidthmodulatedsignalOUT(t)canberepresentedbyFourieranalysisasa DCcomponentV0 plusasumofsinusoidscalledharmonics:

Theharmonicshavefrequenciesthatareintegralmultiplesofthefundamental frequencyf.TheDCcomponentisgivenbytheaveragevalue:

Theamplitude spectrum isaplotoftheharmonicamplitudesvs.frequency:

ECEN2270

ElectronicsDesignLaboratory

30

Filterdesign
TheeffectoftheR3C3 filteroneachindividualharmoniccanbefoundbyphasor analysisofthecircuit:usephasors tosolvethecircuitandfindhowtheamplitudeofa sinusoidischangedbythecircuit,asafunctionoffrequency. WewanttochooseR3 andC3 sothatthefilterpassestheDCcomponentandanyvery lowfrequencyvariationsthatoccurasaresultofthechangingspeedoftherobot.But wewantthefiltertorejectthecomponentsofOUT atthefundamentalfrequencyf anditsharmonics.Sothefiltershouldhaveatransferfunction (i.e.,theratioofits outputvoltageamplitudetoitsinputvoltageamplitude,vs.frequency)thatlookslike this:

Exerciseforstudents:usephasor analysistosolveforthetransferfunctionoftheR3 C3 filter.SelectappropriatevaluesforR3 andC3.


ECEN2270, ElectronicsDesignLaboratory 31

You might also like