* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Digital-to-Analog Conversion PWM PWM
Surge protector wikipedia , lookup
Resistive opto-isolator wikipedia , lookup
Operational amplifier wikipedia , lookup
Valve RF amplifier wikipedia , lookup
Transistor–transistor logic wikipedia , lookup
Radio transmitter design wikipedia , lookup
Valve audio amplifier technical specification wikipedia , lookup
Switched-mode power supply wikipedia , lookup
Current mirror wikipedia , lookup
Opto-isolator wikipedia , lookup
Phys 253 - Lecture 4: • D/A Conversion, PWM Week 4 Lab: • Lab 4 – Motor Control • Wall-climbing Demo (Bernhard) Digital-to-Analog Conversion PWM • Motors - Intro ((Jon)) • Mech Design 2 (Robin Coope – separate notes) 1 D/A Conversion and power circuits 2 D/A conversion: Resistor ladders #1 (binary weighted DAC) When would you like to produce an output signal that is more than just on or off? (e.g. brightness of light, speed of a motor, current through electric heater, etc…. ) Analog Outputs An op-amp summing circuit Vout = - (50k / R) * 1.0V Digital-to-Analog Conversion (DAC): 10110011, 01010101, … V For a 4 bit ladder, what is the maximum |Vout| ? t 1) 4.375 V Two simple schemes we will use in 253 (of many possible schemes) 2) 5V 1. Resistor ladders (combine multiple digital outputs into one analog output) 2. Pulse Width Modulation (turn one digital output on and off at high frequency) 3) 9.375 V 4) 10V 3 D/A conversion: Resistor ladders #2 4 D/A conversion: Pulse Width Modulation (PWM) (R-2R Ladder) • This scheme uses a digital output to produce an analog voltage by digitally controlling the % of time that the output is high. • The TIME AVERAGED voltage produced can therefore be almost continuously variable. Tpulse Duty cycle = Tpulse/Tpwm 5V Another configuration for an op-amp summing circuit. What are the advantages/disadvantages of this arrangement? 0 t Tpwm 5 6 1 D/A conversion: PWM PWM Duty Cycle D/A conversion: PWM PWM Duty Cycle Average voltage: 0V 0 0 0 25% t 50% 0.25 * 5 V = 1.25 V 5V 2.5 V 5V t 0% Average voltage: 4.75 V 5V 0 t t 95% 7 8 D/A conversion: PWM PWM Duty Cycle Average voltage: Next: 2.5 V High-Current Circuits and Motor Control 50% 0 t • Must be low-pass filtered to be used as an analog output • To avoid ripple, low-pass filter at f << fpwm. Note that this can place a severe limit on the output bandwidth. • Resolution is limited by minimum switching time of the digital output. 9 High current and inductive loads Example load - High current and inductive loads Digital Outputs do not provide sufficient current to drive anything other than output signals to other electronics. Digital outputs can be “amplified” to turn on devices that require high currents. Mechanical/solid-state relays or Transistors can be used as electrically-controlled switches… Electromechanical relay V1 5V +V BJT used as a switch for load L1 (image from Lecture 1) S1 + V2 5V • LM311 sinks up to 50mA (works but poor choice) L1 Dout 5V +V U1 LM311 R1 1k RLY1 Q1 2N3904 Q1 3904 R2 100k R3 100k 11 R2 100 5V +V • Relay coil current at 5 V ~ 80 mA • 3904 rated to 200 mA (better choice) Q1 2N3904 V1 5V +V Eg. Load with 4 stages Electromechanical Relay R2 100 L1 R1 1k 10 Spike suppression diode (used in parallel with any 12 inductive loads) Image from CMU - http://www.vialab.org/Bioe_1010 2 Power output: H-bridges Power output: H-bridge driver The above circuits work for loads where current only travels in one direction – how to get current to travel FORWARDS and REVERSE? What is the proper operation of this circuit (red = on)? +V Q1 1) 1 3 , 2 4 – forward 1 3, 2 4 – reverse 1 2, or 3 4 – not allowed Q3 M1 Q2 2) 1 2, 3 4 – forward 1 2, 3 4 – reverse 1 3, or 2 4 – not allowed Q4 3) 1 4, 2 3 – forward 1 4, 2 3- reverse 1 2, or 3 4 – not allowed Image from wikipedia (H-Bridge) 4) 1, 2 3 4 – forward 4,1 2 3 - reverse 13 PWM on the TINAH Motor Outputs Power output: H-bridge driver +V Q1 The TINAH Board has a built-in software to generate a PWM signal, and hardware to use the PWM signal to power a small motor (max 9V, ~600 mA) either forward or reverse. What will happen with 1,3 OFF; 2,4 ON? TINAH motor output schematic Q3 1Kx5 1) Nothing – no effect on motor M1 14 LEDs indicate current direction +5V 2) Short circuit – MOSFETS will burn H-Bridge Chip (SN754410NE) Direction signal +5V 16 Vs 3) Active braking – motor will stop quickly 4) Motor will be driven LED5 LED1 LED6 LED2 LED7 J4 LED3 3 LED8 Q4 LED4 Q2 9V regulated out1 out2 8 Vss U10 cs1 1 2 in1 7 4 in2 U9b 3 SN754410NE 9 74HC04 cs2 out3 10 14 out4 in3 15 in4 U9c gnd 6 5 4 5 1213 11 1 2 3 4 5 6 7 8 9 10 11 12 Output header strip – note how the pins are grouped 6 74HC04 12 9 6 15 16 5 2 19 1Q 2Q 3Q 4Q 5Q 6Q 7Q 8Q PWM signal (Enable) 15 TINAH motor outputs – from data sheet of on-board H-Bridge PWM: TINAH motor outputs TINAH/Wiring : motor.speed(0,700); turn on motor 0 at ~70% duty cycle: Red trace H motor L V 10V Blue trace Intermediate voltage during high-Z state t 17 18 3 PWM – regulated power vs. high-power TINAH board uses a regulated 9V for each H-bridge (L78S09CV), increased repeatability. which remains constant under load HB -1 HB -2 STOP (BRAKE) lo lo FORWARD hi lo REVERSE lo hi NOT ALLOWED hi hi Some motors used in Phys 253 can use higher voltages and currents (e.g. 12V, 1.5 A) which cannot be achieved by the TINAH Board H-bridge chip outputs directly use additional circuitry to control an external H H-bridge bridge 12V +V 12V +V R7 100 12V +V R10 33k Q7 2N3906 Q5 2N3904 M1 HB 1 HB-1 12V +V Q7 2N3906 R5 10k R6 100 R9 33k Q6 2N3906 Q1 Q2 MTP3055 MTP3055 H-Bridge interface circuit R2 100 R9 33k Q6 2N3906 12V +V R6 100 TINAH Board R10 33k HB-1 IRF5305 IRF5305 12V +V R2 100 M1 Q4 Q4 MTP2955 Q8 Q 2N3904 HB 2 HB-2 12V +V Q5 2N3904 Q8 2N3904 12V +V R1 10k Q3 Q3 MTP2955 Q3 Q4 MTP2955 MTP2955 R7 100 HB-2 12V +V 12V +V R8 10k R1 10k R8 10k Power output: H-bridges R3 100 Q2 Q2 Q1Q1 MTP3055 MTP3055 HUF75321 HUF75321 R5 10k R4 10k R3 100 R4 10k 20 External H-Bridge 19 Power output: H-bridges Need to connect TINAH motor outputs to H-bridge inputs: Build an interface circuit for doing this To H-Bridge input H t Motors 10k to 50k Comparator level – USE 5V FROM TINAH Board!!! L TINAH Motor Output V (do not use voltage divider, since value decreases with decreasing battery voltage) 10V 3V t 21 22 DC electric motors: DC electric motors: estimating performance • Sometimes you are given a graph for motor specifications, but usually you are only given a few operating parameters: • • Example motor: torque curves There is a linear relationship torque & speed for most small DC motors (for geared or ungeared motors). You can estimate a torque-speed curve using the stall torque and no-load speed (max speed): For Motor Power : BaneBots, 11:1, 16mm Spur Gearmotor, FF-050 P Operating v : 4.5v - 8v Nominal v : 6v No Load RPM : 1366 No Load A : 0.2A Stall Current : 1.9A Stall Torque : 10 oz-in (72 mN-m) Kt : 5.4 oz-in/A (38 mN-m/A) Kv : 228 rpm/v P 23 =T * = (torque) * (ang velocity) = 0 when T=0 or = 0 when = 0 ~ maximum when at mid-point ( ½ Tmax * ½ max) 24 Image from: http://lancet.mit.edu/motors/index.html 4 Estimating whether or not your motor is appropriate for the job Info from MIT 2.007 course – a great resource! 1. Estimate desired power for the final application of the motor (How fast does it need to go? How much force is desired to get it to operate? How much max torque do you need at what speed?) Prequried = Fv F = T 2. Check that motor can provide adequate power (from torque and speed specs) 3. Design a drive train to go from the motor torque/speed to get the desired torque/speed. 25 26 http://stellar.mit.edu/S/course/2/sp10/2.007/courseMaterial/topics/topic5/resource/DCmotors/DCmotors.pdf Gear Train / Drive Train Ratios DC motors supplied in 253 lab Geared Barber Coleman motor (FYQF 63310-9) (at 12V) no-load speed: 470 rpm max torque: 28 oz-in (20 N-cm) no-load current: 0.1A stall current: 1.3 A Un-geared Barber Coleman motor (FYQM 63100-51) (at 12V): no-load speed: 2300 rpm max torque: 5.2 oz-in (3.7 N-cm) no-load current: 0.13A stall current: 2.75 A Princess Auto Double-shaft motor (at 12V): no-load l d speed: d 3700 rpm max ttorque: 8.0 8 0 oz-in i (5 (5.6 6 N N-cm)) no-load current: 0.24 A stall current: 2.2 A Futaba Servo Motor (S3003) (motor + built-in encoder) (at 5V) max torque: 44 oz-in torque (31 N-cm) max speed: 0.23sec/60 degrees at no load ` 27 Gears power in = power out N2 teeth Torque and speed both scale WRT the number of teeth on the input and output shafts. N1 teeth , T2 , T1 Slower = more torque. Faster = less torque Angular velocity: Torque: Drops in efficiency at each drive train stage are hard to estimate, and will depend on how well things are assembled, frictional losses, etc. Pulley drives •Use same ratio calculations as with gears, except use diameters instead of teeth • May slip, which may or may not be a good thing (bad for accuracy, good for protection) Spur Gears Rack and pinion Right-angle g g g gearing g with bevel gears (above) or crown gears (below) Timing belts have beads or rubber teeth to minimize the chance of slipping Worm gear - lots of torque but slow N:1 ratio (N = # teeth on spur gear) 5 12V +V 12V +V 12V +V R8 10k L/H OFF ON/OFF Q3 MTP2955 R1 10k R2 100 R7 100 H/L ON/OFF 12V +V R10 33k H Q5 2N3904 Q8 2N3904 HB-2 L OFF M1 HB-1 12V +V Q7 2N3906 R9 33k Q6 2N3906 OFF L/H ON/OFF R6 100 Q1 MTP3055 R5 10k H Q4 MTP2955 OFF Q2 MTP3055 ON/OFF R3 100 H/L R4 10k 31 6