Shop OBEX P1 Docs P2 Docs Learn Events
servo to basic stamp II help ? — Parallax Forums

servo to basic stamp II help ?

ltmhallltmhall Posts: 102
edited 2006-10-12 20:33 in BASIC Stamp
I’m Building an autonomous mobile robot using differential drive and have a few questions. I’m using two continous rotation modified Hitec 422 servo motors, a Basic Stamp II (education board), two Dubro 2.75 in. wheels, and a NARP 4cm omni direction wheel.

1) If I’m using two HS 422 servo motors and a Basic Stamp II do I need an H-bridge. I was planning on connecting my servo motors to an L293 chip then connecting the L293 to a Basic Stamp, but a classmate told me I didn’t need one, I could connect the servos straight to the Basic Stamp. Please Help!

2) If I need to connect my servos to an H-bridge do I actually open my modified servos and connect the two pins of the motor to the H-bridge.

3) I read a regular caster is a very great ideal for the third wheel, does anyone know a good way to mount an omni directional wheel to an aluminum chassis.

ANY HELP WOULD BE APPRECIATED
<!-- / message --><!-- edit note -->

Comments

  • FranklinFranklin Posts: 4,747
    edited 2006-10-08 05:01
    You do not need anything to hook the SIGNAL lead to the BS2 the power wires go to your power supply (6V or less) and ground. The other wire goes to a pin and is feed a 1 to 2 ms pulse at 20ms intervals.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • ltmhallltmhall Posts: 102
    edited 2006-10-08 14:35
    And you just connect the Pulse Width Modulation pin to the servo.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-08 14:46
    Yes, although the Stamp pin isn't used for Pulse Width Modulation. The Stamp has to put out a single pulse about every 20ms with the width of the pulse (usually 1ms to 2ms) specifying the position of the servo. There are lots of examples and explanation in both the What's a Microcontroller? book and the Robotics book in the Parallax Stamps in Class page on their website.
  • ltmhallltmhall Posts: 102
    edited 2006-10-08 19:13
    So I would connect the servos to the spot on the board of education for connecting servo's(I saw an exampe in the What's a Microcontroller? book ). Also do I use an external 5 volts for the servos. I read somewhere its not recommended to use the regulated 5 volts from the board.
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-10-08 19:44
    1. Yes, you connect the 'signal' wire of each servo to its own BS2 pin. You then 'pulse' that pin with a "PULSOUT" of 1 to 2 mSec size (depending on desired direction -- 1.5 mSec should be 'stopped'), and repeat that signal every 20 mSec in your code.

    2. You can drive the servo's with Vdd. Note each servo will pull around 100 mA when active. Also, the linear regulator will use up some current as heat while regulating. So you COULD directly connect a 6-volt battery to the 'red' wire of each servo and get direct 6 volt drive with no losses. If you do this, you MUST insure the 'ground' (Vss) wire for that battery is connected to the +5 volt ground.
  • ltmhallltmhall Posts: 102
    edited 2006-10-08 22:41
    So I could power the servos with an external 6 volts but I would have to tie its ground
    to the ground on the board of education.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-08 22:56
    Yes. The servos depend on having a power supply ground that's the same as the ground for the device putting out the control pulses.
  • ltmhallltmhall Posts: 102
    edited 2006-10-09 00:00
    If I use a 7805 regulator, could I connect both servos to its supply. Or will I have to build a supply
    for each motor.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-09 03:20
    A lot depends on the kind of servos you're using and their maximum current requirement under the mechanical load of your application. The kind of servos Parallax sells can draw up to 1A when stalled, but around 120ma normally. A 7805 can supply around 1A. If you're not stalling out the servos (or nearly so) you can easily put both servos on the same 7805.
  • ltmhallltmhall Posts: 102
    edited 2006-10-09 12:52
    So I could use two 3 pin male/male headers, connect my power pins from each servo to two seperate 7805 5 volt supplies, connect my ground pins to the vss terminal (on the board of education) and connect a pulse pin from each servo to an output on the basic stamp. If I wanted to use 6 volts instead of 5 volts could I just use four 1.5 volt batteries in series instead of the 7805 supply. Do you think this is a good idea.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-09 13:35
    You confused me by bringing up the issue of two 7805 5V supplies. In normal use (not high mechanical load), you could use a single 7805 to supply power to both servos. Two 7805s would also work. A 6V battery pack would also work. Keep in mind that the BOE-BOT uses a single 6V battery pack to power a BOE and 2 or 3 servos. It's expensive to keep supplying AA alkaline cells, but a 5 cell rechargable (NiMH) battery pack will also work well.
  • ltmhallltmhall Posts: 102
    edited 2006-10-11 11:12
    Will I have to add a resistor to one of the basic stamp out puts or reverse one of the servos leads to make both rotate in the same direction when I add wheels to them? I heard from a Friend I will have to do something like this.
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-10-11 13:14
    Do NOT 'reverse the servo leads' -- the black wire is ground, the red wire is +V, and the white wire is signal. Reversing the servo leads routes the right voltages to the wrong places.

    If you look at the physics -- the right wheel servo does have to be commanded to run in the opposite direction of the left wheel servo, in order to get both wheels rolling 'forward'. That's assuming you've mounted both servo's "back-to-back", the most common mounting scheme. But you command that IN THE CODE, not in the hardware.

    There is no hardware way to tell a servo 'ok, you're the right servo, so you should REVERSE everything I tell you'. They're not that smart. But this is really not a major problem, and has been easily solved by a generation of 'modified-servo-robot-builders'.
  • ltmhallltmhall Posts: 102
    edited 2006-10-12 14:25
    Are there anyways I can run two modified servos without a microcontroller. Can I use a circuit built around a 555 timer.
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-10-12 14:36
    Yes, but why would you want to? The nice thing about a modified servo is that it IS simple to control with a microcontroller. If all you want is a speed-regulated motor get a variable resistor and a DC motor.
  • ltmhallltmhall Posts: 102
    edited 2006-10-12 15:33
    I haven't bought my microcontroller yet. I just wanted to too see how my chassis with the wheels and motors attached would perform.

    Post Edited (ltmhall) : 10/12/2006 3:47:03 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-12 16:35
    It would be much easier to use a microcontroller to exercise your servo motors. You'd need three 555 timers, one for each servo to set the width, and one to set the pulse repetition rate to 50-60/second plus the capacitors and resistors to make them work.
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-10-12 20:33
    Plus, I assume you would like to control your wheels under program control, right? A 555 based solution would prevent that.

    The idea of this is that you PULSOUT to your wheels, then do something else for 20 mSec, then repeat the PULSOUT. That way, you can have movement on a 'single-tasking' processor like the BS2.
Sign In or Register to comment.