very simple pathfinding robot design help

Discussion in 'The Projects Forum' started by calvintennant, Jan 21, 2009.

  1. calvintennant

    Thread Starter Member

    Jan 21, 2009
    27
    0
    I'm designing and building a pathfinding robot as a 'children's toy' for my design materials class.

    It will only ever turn in one direction and is controlled by only one sensor. When the sensor is low both motors are in their forward state, when the sensor goes high one of the motors switches to its reverse state. This will result in one of two things, either my robot will spin in circles because my logic does not work fast enough, or it will swiftly spin until it is facing a direction in which there is no object within range. Hopefully it is the later of the two.

    I intend to build this without the use of an ic. I will use one if I have to, but I think that I can do without. I will have one motor hard wired to a forward position. The other motor will be dependent on a switch (hopefully not a logic gate, but I will use one if I have to) to control the other motor's direction. The file I have attached is the logic I will use if I cannot use some other switching device (please suggest). The shining light bulb shown in the schematic is the motor in its forward state, the light bulb that is off represents the motor in its reverse state.

    I also need help choosing an appropriate sensor technology for the robot. Following are two links to a IR LED and a IR phototransistor. They are both at a 940nm wavelength and very cost effective. I chose a phototransistor with a wider viewing angle than the diode in hopes to collect more of the emitted light without detecting objects that are clearly not in my way.
    Digi-Key part number: 67-1001-ND (ir emitter) - http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=67-1001-ND
    Digi-Key part number: 160-1065-ND (phototransistor) - http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=160-1065-ND

    Following are some more links to other products I will be using to build my project, please alert me if any red flags go up while going over these, I have checked over them thouroughly to ensure that they are all compatible, please double check.
    Small solid soft-rubber wheels (good for gripping floors) - http://www.robotshop.ca/banebots-04in-05hex-wheels.html
    1/2" hexagonal hub with 4mm bore - http://www.robotshop.ca/hex-hub-s40-4mm-1wide.html
    Motor geared at 30:1 with 427 RPM with no load (providing 6.62 Kg/cm of torque) with 4mm shaft - http://www.robotshop.ca/banebots-30-1-25mm-spur-motor-ff180.html

    I also have a rechargeable Li-ion battery from an old digital camera.The battery housing from the camera seems to be removable. I plan to mount the housing to the robot to have an easily removable/rechargeable battery (the battery itself removes to charge in an external charger). The battery is extremely light weight and runs at 3.7V with 740mAh. Should this be enough to run my logic circuit and both motors? The battery has three terminals (- / + / T), I was hoping you could tell me what the T terminal is for.

    Thank you so much for all your help, I've been completely lost without any of my old notes from my high school electronics class.
     
  2. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Can you post your circuit. I think that you have to use more than two sensors because if say you put one sensor facing forward and the robot moves to a wall with a 45 degrees angle the robot won't detect the wall (most times) and crash on it.
     
  3. calvintennant

    Thread Starter Member

    Jan 21, 2009
    27
    0
    Here's a block diagram I whipped up. Does this clear things up?

    If I need to use more sensors, thats no problem. I planned on ordering a couple extra in case this problem arose.
     
  4. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    What do you have for logic circuit? Is it a relay?
     
  5. calvintennant

    Thread Starter Member

    Jan 21, 2009
    27
    0
    My logic circuit is ridiculously simple. It is on the first post. My original was much more complicated, the robot turned in both directions. I decided that this project would make more sense for me, due to the fact that the assignment has nothing to do with electronics (I'm in an art program/I'm taking this project above and beyond).

    I've never worked with relays before, understanding that it is just a switch it might make more sense than that logic circuit (you'll see the NOT gate in my diagram above, I was planning on using a NAND but the program I used to design the circuit required me to draw an excessive amount of wire. We all know that its only one gate regardless).

    I was looking for something to replace the logic circuit, but it was beyond the scope of my knowledge. If you could educate me on the basics of a relay, it would be greatly appreciated.
     
  6. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    I asked you if you use relay because I want to tell not to use one because relays have slow response (compared to transistors). It is better to use your logic circuit and a MOS transistor to drive the motor.
     
  7. calvintennant

    Thread Starter Member

    Jan 21, 2009
    27
    0
    How does transistor logic compare to an IC? I'm only using one gate and its an inverter.. I think it might simplify the circuit to just toss a couple of transistors in there.

    I've never done transistor logic before however, what are your thoughts?
     
  8. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Are you driving the motor directly from the output of the NOT gate?
     
  9. calvintennant

    Thread Starter Member

    Jan 21, 2009
    27
    0
    I'm driving the motor out of both outputs, one output should drive the motor forward, the other backward. I haven't drawn the schematic for this part out yet, I think it should be fairly simple.

    2 transistors connected from the base of either output, both powered with three volts. A positive connection to both motors attaches directly to either lead on the motor, same with the negative. In my theory this should cause bi-directional control. Reflecting upon that, I may need to use diodes to control electrical flow. Is this correct?

    A combination of research and my limited understanding of transistors causes me to believe that: I can use a PNP transistor directly from the sensor that will switch to its ON state when the sensor is LOW and a NPN transistor that will switch to its ON state given a HIGH output from the sensor. This would eliminate my need for an IC. Is this correct?
     
  10. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    If the sensor is capable of supplying the current the transistors need through the base then you can do it. Otherwise you can use n and p channel MOS to do it. Also, you need to put a diode in parallel with each motor as to absorb the reverse emf created when switching off the transistor driving the motor. The diode's cathode has to be connected to the positive side of the motor. If you want post a schematic with your circuit to check it.
     
  11. calvintennant

    Thread Starter Member

    Jan 21, 2009
    27
    0
    I'll whip one up in the next couple hours, I've got some house-cleaning to do in the mean time. Thank you so much mik3, I've been panicking trying to remember everything from high school. I've never been very good with understanding resistor values and such so you'll have to bear with me.

    Again, thanks a lot.
     
  12. calvintennant

    Thread Starter Member

    Jan 21, 2009
    27
    0
    Also, my sensor is a phototransistor, this should be able to suply all the required current no?
     
  13. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    I guess it can. I haven't read the datasheet because I am busy with my exams right now. I am here because I like it and just to answer quick topics.:)
     
  14. calvintennant

    Thread Starter Member

    Jan 21, 2009
    27
    0
    I don't expect to have gotten it right the first time around, but here is my circuit thus far. In the past I have used a 5V power supply to power all my circuits, is this really necessary? The battery I have only goes up to 3.7V (with 740mAh). I don't have a complete understanding of these more basic principals, feel free to give me a hand :p.

    The first part of the circuit is an inverter, I got this idea from this ( http://www.flatspike.com/projects/electronics/single-transistor-logic-inverter/ ) website. The second part is my attempt at an H-bridge.

    Thanks again for all your help, it is greatly appreciated.

    EDIT!
    I should also mention that this is only for one wheel. The other wheel is always on, I will draw this part of the circuit up later.
    Also this is the transistor I plan on using - http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=2N4401-ND
    Just in case you don't have it from before the motor - http://www.robotshop.ca/banebots-30-1-25mm-spur-motor-ff180.html
     
  15. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    If you look closely you will see that the bases need to be cross connected for the motor to operate correctly.

    hgmjr
     
  16. calvintennant

    Thread Starter Member

    Jan 21, 2009
    27
    0
    Could you elaborate on that hgmjr, I don't quite understand. Maybe you can pull up an example? Thanks for the help. :)
     
  17. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Basically you can see that either the two top transistors are on or the two bottom transistors are on. In either case, the motor will never see any voltage drop across it.

    hgmjr
     
  18. calvintennant

    Thread Starter Member

    Jan 21, 2009
    27
    0
    I had thought of this myself actually, I disregarded it because the examples I saw either had exactly what you were talking about or had diodes in place to direct electrical flow. Is one solution better than the other, than the fact that the diode-free option uses less parts?
     
  19. calvintennant

    Thread Starter Member

    Jan 21, 2009
    27
    0
    Is this similar to what you were suggesting?
     
  20. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Yes. The second circuit you have cited should work just fine.

    hgmjr
     
Loading...