Electronics Design LaboratoryLecture #3
ECEN 2270 Electronics Design Laboratory 1
ECEN 2270 Electronics Design Laboratory 2
Lessons from Lab 1• All relevant dates are in the course calendar, which is
available on both D2L and on the course website.
• All lab materials are on the course website
http://ecee.colorado.edu/~ecen2270/
• If you have questions, ask the instructors
Electronics Design Laboratory 2
ECEN 2270 Electronics Design Laboratory 3
Experiment 2 – Robot DC Motor• Part A: working with a load, modeling, finding model
parameters based on experiments– Understand the physical behavior of the load: DC motor– Developing an electrical model for the DC motor as a load– Experimentally finding model parameters– Performing design and simulation using models
• Part B: speed sensor circuitry: hardware implementation, verification, and testing
Electronics Design Laboratory 3
ECEN 2270 Electronics Design Laboratory 4
Two DC motors, each driving a wheel• Each DC motor has an optical
encoder for sensing rotational frequency and direction
• A gear box connects the motor to the wheel
IDC
wheel
12 pulses per motor shaft rotation
-10 < VDC < +10 V
motorshaft
wheelshaft
+VCC
Robot Platform
DC Motors
64:1gear
Optical Encoder
_
+_
ENCAENCB
DC Motor
ECEN 2270 Electronics Design Laboratory 5
Current produces magnetic field (which is why conductors have inductance)
Basics: Current, Magnetic Field, Force
Electronics Design Laboratory 5ECEN 2830, Spring 2011
i
𝐵𝐵
i
𝐵𝐵
𝐵𝐵
𝐵𝐵𝑒𝑒
�⃗�𝐹
�⃗�𝐹
Magnetic fields tend to align with each other. As a result, mechanical force is exerted on a coil of wire carrying current i when the coil is placed in external magnetic field
ECEN 2270 Electronics Design Laboratory 6
NS
NS
Electronics Design Laboratory 6
Simple DC Motor
Torque [Nm] DCkIT =k = motor constant [Nm/A]
+_
VDC
iDC Use permanent magnets to create a fixed magnetic field
• If a shaft is connected to the rotating coil, we have a motor!• The torque of this motor is directly related to the DC current
in our wire loops
DC voltage creates DC current. ‘Split rings’ reverse
polarity every half turn
�⃗�𝐹 𝐵𝐵
𝐵𝐵𝑒𝑒
ECEN 2270 Electronics Design Laboratory 7
NS
NS
Electronics Design Laboratory 7
Back EMF
+_
VDC
IDC
We now have a time varying magnetic field through the coil… Faradays law tells us this
should be generating an electromotive force, i.e. an induced voltage!
dtdVEMFΦ
−=Induced EMF [V]
Rate of change of magnetic flux Φ through the coils (“armature
winding”)
ωkVEMF =
k = motor constant [Nm/A], [V/(rad/s)]
Induced EMF [V] Speed [rad/s]
�⃗�𝐹 𝐵𝐵
𝐵𝐵𝑒𝑒
ECEN 2270 Electronics Design Laboratory 8
Basic DC Motor Relationships
Electronics Design Laboratory 8ECEN 2830, Spring 2011
ωkVEMF =Induced EMF [V]
Speed [rad/s]
NS
NS
+_
IDC
Torque [Nm] DCkIT =�⃗�𝐹 𝐵𝐵
𝐵𝐵𝑒𝑒 VDC
For analysis, it would be nice to have an equivalent circuit of the motor…
ECEN 2270 Electronics Design Laboratory 9
DC motor equations
ωkVEMF =
Electrical model (armature circuit)
EMFDC
MDCMDC Vdt
dILIRV ++=
Mechanical model
loadTBdtdJT ++= ωω
DCkIT =
J = moment of inertiaB = friction coefficient
extintload TTT += Load torque is a combination of internal gearbox load and external load
ECEN 2270 Electronics Design Laboratory 10
DC motor equivalent circuit model
+–
+
VDC
_
IDCLM RM
VEMF = kω T = kIDC
ω
Tload1/BJ
EMFDC
MDCMDC Vdt
dILIRV ++=loadTB
dtdJT ++= ωω
ωkVEMF = DCkIT =
• Consider how to measure all circuit parameters from the model• Requires measurement of
• input terminals, VDC and IDC
• frequency ω in rad/s use optical encoder
extintload TTT +=
+
_
ECEN 2270 Electronics Design Laboratory 11
Optical encoder
Encoder output pulses, frequency fenc [Hz] is proportional to speed
counterclockwise
clockwise
Encoder pulse output AEncoder pulse output B
Encoder pulse output AEncoder pulse output B
In Lab 2, only one encoder pulse output is needed. Optional extra credit uses both pulses to determine direction
ECEN 2270 Electronics Design Laboratory 12
Encoder circuit
+VCC = +5 VGND
Pulse out APulse out B
Photo-transistorsshort a node to ground whenever light is shined on them
Logic inverters shape the sensed signals into square-wave output
pulses
Encoder connector takes VCC and ground and supplies
ENCA and ENCB
LEDs shine through a
spinning wheel with
notchesSpinning disk goes here
ECEN 2270 Electronics Design Laboratory 13
Speed conversions
n = wheel speed, rotations per second [rps]
ω = wheel rotational speed [rad/s]
fenc = frequency of encoder pulses [Hz]
Example: wheel speed is 1 rotation per second: 1 rps
( )
( )( )
( )( )secradk8.41264
Hz7681264secrad2
rotationradians2
secrotation1
≈×=
≈×=
=
=
=
ωω
ππω
enc
enc nf
n
n
ECEN 2270 Electronics Design Laboratory 14
DC motor Spice sub-circuit model
Model parameters to be determined by experiments:
RM, k, J, B, Tint
Encoder model: correct speed to fenc frequency conversion has already been done, no need to change anything in this part of the model
Input and output ports defined
• Download the model from the Experiment 2 website• Only edit the model designated parameters
ECEN 2270 Electronics Design Laboratory 15
Testing DC motor Spice model
Electronics Design Laboratory 15
External load torque Text attached here
External load must sink to
ground
• Simulation set up to1. Start motor: bring up VDC, over first 1ms2. Pulse load torque: 0A (no load) for first 50ms, 1A for next 50ms3. Stop motor: bring down VDC from 100ms to 101ms, 10V to 0V
ECEN 2270 Electronics Design Laboratory 16
Motor Simulation Results
Electronics Design Laboratory 16
+–
+
VDC
_
IDCLM RM
VEMF = kω T = kIDC
ω
Tload1/BJ
EMFDC
MDCMDC Vdt
dILIRV ++= loadTBdtdJT ++= ωω
ωkVEMF = DCkIT =
• Consider waveforms and model in each mode: motor start, load change, motor stop
extintload TTT +=