Electronics Design Laboratory Lecture #3 ECEN 2270 Electronics Design Laboratory 1 Lessons from Lab 1 • Use the course calendar, it has all relevant dates • Use the course website, it has all lab materials • If you have questions ask the instructors ECEN 2270 Electronics Design Laboratory 2 Experiment 2 ‐ Robot DC Motor • Broader objectives: working with a load – – – – – 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 Hardware implementation, verification, and testing ECEN 2270 Electronics Design Laboratory 3 Two DC motors, each driving a wheel • Each DC motor has an optical encoder for sensing direction and rotational frequency • A gear box connects the motor to the wheel Robot Platform DC Motors wheel + ‐10 < VDC < +10 V _ IDC wheel shaft Optical Encoder VCC +_ ENCA ENCB DC Motor 64:1 gear motor shaft 12 pulses per motor shaft rotation ECEN 2270 Electronics Design Laboratory 4 DC Motor basics • DC currents create magnetic fields B iDC iDC B Ampere’s law relates current iDC to the magnetic field, B iDC • Magnetic fields want to alight with each other! The will exert force on each other… B2 ECEN 2270 F B1 F iDC B2 B1 F iDC l B2 Force [N] F Electronics Design Laboratory Unit Length Vector Current [A] Magnetic flux density vector [T] 5 Simple Motor N S F B1 B2 DC voltage creates DC current. ‘Split rings’ reverse polarity every half turn + _ iDC VDC Use permanent magnets to create a fixed magnetic field N S T kI • If an arm is connected to the rotating coil, we have a motor! • The torque of this motor is directly related to the DC current DC Torque [Nm] in our wire loops k = motor constant [Nm/A] ECEN 2270 Electronics Design Laboratory 6 Back EMF N S F We now have a time varying magnetic field… Faradays law tells us this should be generating an electromotive force! B1 B2 + _ iDC N S VDC Rate of change of magnetic flux through the armature winding VEMF Induced EMF [V] d dt VEMF k Induced EMF [V] Speed [rad/s] k = motor constant [Nm/A], [V/(rad/s)] • For analysis an equivalent circuit would be nice… ECEN 2270 Electronics Design Laboratory 7 Building an Equivalent Circuit. N S F VEMF k B1 B2 Induced EMF [V] + _ iDC N S ECEN 2270 ECEN 2830, Spring 2011 Speed [rad/s] T kI DC Torque [Nm] • DC Voltage source powers motor • Motor coils are simply one long piece of wire Electronics Design Laboratory 8 DC motor equations Electrical model (armature circuit) VDC RM I DC VEMF k dI DC LM VEMF dt Mechanical model d TJ B Tload dt T kI DC Tload Tint Text ECEN 2270 J = moment of inertia B = friction coefficient Load torque is a combination of internal gearbox load and external load Electronics Design Laboratory 9 DC motor equivalent circuit model IDC LM RM + + VDC VEMF = k + – T = kIDC 1/B J Tload _ _ VDC RM I DC dI DC LM VEMF dt VEMF k d TJ B Tload dt T kI DC Tload Tint Text • 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 ECEN 2270 Electronics Design Laboratory 10 Optical encoder Encoder output pulses, frequency fenc [Hz] is proportional to speed counterclockwise Encoder pulse output A Encoder pulse output B clockwise Encoder pulse output A Encoder 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 11 Encoder circuit +VCC = +5 V GND Pulse out A Pulse out B LEDs shine through a spinning wheel with notches Photo‐transistors short 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 Spinning disk goes here ECEN 2270 Electronics Design Laboratory 12 Speed conversions Example: wheel speed is 1 rotation per second: 1 rps rotation sec radians rad n 2 2 sec rotation f enc n 64 12 768Hz n 1 enc 64 12 4.8k rad sec n = wheel speed, rotations per second [rps] = wheel rotational speed [rad/s] fenc = frequency of encoder pulses [Hz] ECEN 2270 Electronics Design Laboratory 13 Input and output ports defined Model parameters to be determined by experiments: RM, k, J, B, Tint ECEN 2270 Spice model Encoder model: correct speed to fenc frequency conversion has already been done, no need to change anything in this part of the model • Download the model from the Experiment 2 website • Only edit the model designated parameters Electronics Design Laboratory 14 Testing Spice model External load torque Text attached here External load must sink to ground • Simulation set up to 1. Start motor: bring up VDC, over first 1ms 2. Pulse load torque: 0A (no load) for first 50ms, 1A for next 50ms 3. Stop motor: bring down VDC from 100ms to 101ms, 10V to 0V ECEN 2270 Electronics Design Laboratory 15 Motor Simulation Results • Consider waveforms and model in each mode: motor start, load change, motor stop IDC LM RM + VDC VEMF = k + – T = kIDC J 1/B Tload _ VDC RM I DC LM dI DC VEMF dt VEMF k ECEN 2270 d B Tload dt Tload Tint Text T kI DC TJ Electronics Design Laboratory 16