Changes between Version 3 and Version 4 of ControlSystems/Electrical/Training/Arduino/Lesson6


Ignore:
Timestamp:
Oct 22, 2015, 7:28:11 AM (10 years ago)
Author:
David Albert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/Electrical/Training/Arduino/Lesson6

    v3 v4  
    3232== Motor Control ==
    3333Like solenoids, the electromagnets in motors require a great deal of current; far more than the Arduino itself can source or sink.  External switches are required to control the flow of electricity through each motor in a robot.  Your kit contains a switching transistor; you can use the transistor to control the flow of electricity through a motor:
    34   **Exercise**: use the N-FET transistor in your kit to allow your arduino to control the flow of electricity through a motor.  Turn the motor on or off in response to a switch or to your ultrasonic controller.  Use a protection diode (also in your kit) to prevent the back EMF from the motor from destroying the transistor (and potentially you Arduino).  You can use the micro-motors provided (see a mentor if you don't have one) or you can use one of the gear-motors from the mini-bot kits (also ask a mentor).
     34
     35[[Image(http://38.media.tumblr.com/tumblr_luy74c89IH1qf00w4.png, align=right, width=200)]]
     36There are many different types of transistors, but most are three-terminal devices where the current or voltage at one terminal controls the flow of electricity through the other two terminals.  The most common transistors used today are either bipolar-junction transistors (BJTs) and field-effect transistors (FETs).  Both are used for motor control, but FETs used using metal-oxide-semiconductors (MOSFETs) offer many advantages.  A primary advantage of the MOSFET is that it has a very low resistance when on (when the control voltage on the gate terminal allows current to flow between the other two terminals (source and drain).  Because there is very little resistance, the transistor can pass large amounts of current without getting hot.  If you recall Ohms law, E=IR, if the resistance is very low (a few tenths or hundredths of an ohm), a lot of current can pass without the voltage drop getting large.  This is important because if you passed 10Amps (a lot of current) through a transistor that offered 10 ohms of resistance, it would drop 100 volts and the power dissipated (as heat) would be E*I = 1000 Watts!
     37
     38  **Exercise**: use the IRL3715Z N-FET transistor in your kit to allow your arduino to control the flow of electricity through a motor.  Turn the motor on or off in response to a switch or to your ultrasonic controller.  Use a protection diode (also in your kit) to prevent the back EMF from the motor from destroying the transistor (and potentially you Arduino).  You can use the micro-motors provided (see a mentor if you don't have one) or you can use one of the gear-motors from the mini-bot kits (also ask a mentor).  The first step in working with any electronic component is to review its [http://www.irf.com/product-info/datasheets/data/irl3715z.pdf datasheet].  The datasheet will give you all of the component's specifications and limits and will often give you examples of how to use it.  The IRL3175Z datasheet tells you that it turns on when the voltage between the gate and source terminals is above 4.5 volts (our Arduino uses 5v), that the absolute maximum voltage that can flow between the source and drain (to the motor) is 20v and above that, the device will be damaged.  It also tells you that the maximum resistance between the source and drain pins when the transistor is 'on' is 11 milli-ohms (very low), so if you used this transistor to switch 10A (a lot of current) to a motor, it would drop at most 10A * 0.011ohms = 0.11 volts and dissipate 0.11 volts * 10A  = 1.1W as heat which is quite manageable.  With a heat sink (metal fins attached to the transistor to give it more surface area for heat transfer), it can switch as much as 50A at room temperature.
    3539
    3640== Direction Control ==
     
    4650We will use an [https://www.adafruit.com/products/81 Arduino motor shield] to control the direction and speed of the DC motors in our mini-bots.  Although you can program the shield yourself, a convenient [https://learn.adafruit.com/adafruit-motor-shield/library-install library] is available for download.
    4751
     52The motor shields are based on the [http://www.rakeshmondal.info/L293D-Motor-Driver L293D motor driver].  The L293D is an integrated circuit (IC) designed for DC motor control made by Texas Instruments; you can see the datasheet [http://www.ti.com/lit/ds/symlink/l293.pdf here].  The L293D allows the 5v outputs of your Arduino to control the flow of electricity to motors up to 36v and 600mA (with suitable heat sink).  We use the L293D shields because they are very inexpensive, however they use BJT technology, not MOSFETs so they can easily overheat. 
     53
    4854**Exercise**: Connect a motor shield to an arduino and use it to control the speed and direction of one of the mini-bot gear motors.  If your USB port can't power the motor (very possible), use an AA battery pack (see a mentor) to provide a separate power source for the motors via the motor shield power connections.