Lab 2, Part B: Robot DC Motor: Speed Measurement Circuit Design
Lab 2, Part B: Robot DC Motor: Speed Measurement Circuit Design
Lab 2, Part B: Robot DC Motor: Speed Measurement Circuit Design
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
wheel IDC
motor shaft wheel shaft
VDC
+ _
DCmotor
12 3 4
64:1 gear
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
ECEN2270
SpeedSensor(Tachometer)Circuit
ECEN2270
ElectronicsDesignLaboratory
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
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
ECEN2270
ElectronicsDesignLaboratory
12
555Timer:Monostable oneshotoperation
ttrig R2
2VCC/3
C2
Fixedton
2 VCC (1 e ton / R2C2 ) VCC 3
Designoutputpulseton tosetdutycycleatmaximumfrequency
ECEN2270 ElectronicsDesignLaboratory 13
Breakingthetachometercircuitintoblocks
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
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
Triggercircuit:waveforms
D1 ON
D1 OFF
ttrig
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
ttrig / R1C1
Solveforttrig:
ttrig
ECEN2270
ElectronicsDesignLaboratory
25
Equivalentcircuit
Oneshotcircuit
Input:Setpulsefromtriggercircuit Output:Outsignalhavingpulsewidthton Thiscircuitresetsthelatchwhenthe capacitorvoltagevC2(t)reachesthe thresholdvoltageCTRL
ttrig
ECEN2270
ElectronicsDesignLaboratory
26
Oneshotcircuit:waveforms
Thetransistoroperatesasanon/offswitch: WhenQishighthenthetransistorisoff, andviceversa. Whenon,thetransistorshortsoutC2 andholdsvC2 =0. Whenthetransistorisoff,capacitorC2 chargesthroughR2.
ttrig
TransistorON
OFF
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:
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: