From: kilian@cray.com (Alan Kilian)
Subject: My robot project report #4
Date: 13 Apr 92 14:30:38 CDT


    Some folks have asked me to keep them up to date on my robot project
    here is the fourth update.

    Here are my plans for the project over the next 6 months.
	Add a speech synthesizer board. $150.00 From RC Systems
	Add a flux gate compass. Maybe from Radio Shack.
	Tons of software.

    Things done this week:
	The controller can reverse the motors!!!
	    Man this was a pain. The amount of knowledge I lose every year is
	    spectacular. Everyone knows how to drive a 120 Milliamp 5Vdc relay
	    right? Well here's the path I took: I decided to be smart and add
	    a buffer chip between the CPU and the relays to protect the CPU
	    in case I did something wrong. O.K. I looked through my chips and
	    found a really long one. Something like 18 or 20 pins. This must
	    be a buss driver chip. I think it was a 74LS240 or 74LS640 Well it
	    was an octal inverting driver chip. Great! I'm all set. so I hook it
	    up to two of the CPUs outputs bits (I have two motors to control)
	    and twiddle with the select lines to get it enabled and now I have
	    two inverted outputs. I'm all set now. So I hook the outputs up to
	    the +5Vdc side of the relays and the other side is connected to
	    ground. Each motor has two relays controlling it and the coils of
	    these relays are connected in parallel. They draw about 
	    120 Milliamp each. Well I wrote a little software to control the
	    output bits and nothing happened. Boo Hoo. So I poked around for a
	    while and figured out that the 74LSWhatever was not putting out 5Vdc
	    SURPRISE! The data book says it can only source 10 Milliamps. Source
	    current is the amount of current the device can put out when it's
	    trying to output a logic 1 (or High or +5Vdc) Well I needed 240 Ma
	    and I could only get 10 Ma from this chip. I knew this years ago.
	    So I decided to use a MOSFET to drive the relays from the 
	    74LSWhatever and so I hooked one up. It didn't work. So I rearranged
	    its Source/Drain connections. It didn't work. At this point I
	    realized that I was a moron. I was using an N-channel MOSFET to try
	    and control the + voltage to a relay. This is wrong. I should have
	    had the relays connected to +5Vdc and the MOSFET controlling the
	    ground connection. This is also what I should have been doing with
	    the 74LSWhatever from the beginning. The 74LSWhatever can "Sink"
	    about 40 Ma (Sink is the amount of current the device can handle
	    when it's trying to produce a logic 0 (or Low or 0Vdc)) So anyway
	    I threw out the 74LSWhatever and everything and simply added a
	    MOSFET to the motor driver/relay boards and drove the MOSFETs gate
	    directly from the CPUs output pins.
	One Infrared LED obstacle detector is working.
	    This was a really fun project. I got one of those infrared detector
	    modules from Radio Shack. This thing detects a 40,000 Hz carrier
	    and outputs a 0Vdc signal when It detects the carrier. I built a
	    LM555 timer running at 40,000 Hz and connected it to an infrared
	    LED (From the Shack). The LED and the detector module are pointing
	    in the same direction and they cannot see each other. If there is
	    something in front of these guys that reflects infrared light then
	    the detector module sees the 40,000 Hz carrier and outputs a 0Vdc
	    signal. Another cool thing about this part is that I used surface
	    mount resistors for the LM555 timer. I got these resistors from
	    Radio Shack again in an assortment pack. I soldered them directly
	    to the pins of the LM555. It made a really small oscillator. It is
	    barely larger than the LM555 itself. Just a .001 microfarad cap.
	All support software is now running from a Zeos notebook 386 PC.
	    This means I am really portable now.
	The speech synthesizer can say "Firmware Version 1.4" but that's all.
	    This is only the test mode for the synthesizer. I can't send any
	    data from the PC yet because I don't know how to send data to the 
	    COMM1 port yet.

    To do this week:
	Re-solder the wheel stubs so that the wheels don't twist off if the
	  platform stalls against a wall.
	Play around for a few days with platform to run any more bugs out.
	Test battery lifetimes. Maybe get larger batteries for the CPU.

    To do next week: 
	Add motor current detectors (Ala Fred Martin @ MIT).
	Add battery voltage detectors.
	Build a trickle charger for both sets of batteries.

    To do third week:
	Build a scanning platform for the front range module.
	    I'll take apart one of my "Induction resolvers" and use it for a
	    platform for the transducer. It has nice bearings and four slip
	    connection to the rotor that I can send the signals through for
	    the transducer. Pretty cool.
	Build a position encoder for the front range module.
	    I took apart a full sized video game that had a wheel that spun all
	    the way around. It used an optical shaft encoder. I think I will
	    use this encoder to produce pulses for each little rotation
	    increment and use the HC16's pulse accumulator to add them up. If
	    I add something (Like a microswitch or another detector) to reset
	    the counter when the scanner is pointing straight backwards then
	    I will be able to use the counts as a position. This should be
	    almost free in terms of external circuitry.
  	More software to avoid objects.

                         -Alan Kilian



-- 
 -Alan Kilian         kilian@cray.com 612.683.5499 (Work) 612.729.1652 (Home)
  Cray Research, Inc.           | 
  655 F Lone Oak Drive          | 
  Eagan  MN,     55121          |
Newsgroups: comp.robotics