Shop OBEX P1 Docs P2 Docs Learn Events
Problem with PING, multiple servos and PULSIN — Parallax Forums

Problem with PING, multiple servos and PULSIN

SzarzynskiSzarzynski Posts: 16
edited 2006-07-11 06:03 in Robotics
Hello,

I have run into a problem that I cant figure out.· It's very simple.· I have a boe-bot with a ping sensor and servo mount.· I want to turn the·Ping and take measurements while moving, and I cant do it.

For example:

This works:

FOR pulseCount = 0 TO 20·············' Number Of Pulses To Spin PING)) 90 Left
··· LOW Ping································' Force PING))) Line Low
··· PULSOUT PingServo, 350············' Ping Servo·90 Left Pulse Value
··· PULSOUT Ping, 5······················ '·Activate PING)))
··· PULSIN· Ping, 1, distance··········· ' Receive Distance Value
··· PULSOUT Led, 850·····················' pulse LED
··· Pause 20
NEXT

Simple program·that turns the Ping left, the ping takes·a distance measurement,·and blinks an LED.

But this·doesnt work:

FOR pulseCount = 0 TO 20············· ' Number Of Pulses To Spin PING)) 90 Left
··· LOW Ping··························· ' Force PING))) Line Low
··· PULSOUT PingServo, 350············· ' Ping Servo·90 Left Pulse Value
··· PULSOUT Ping, 5···················· ' Activate PING)))
··· PULSIN· Ping, 1, distance·········· ' Receive Distance Value
··· PULSOUT Leftservo, 850············ ' activate left servo
··· PULSOUT RightServo, 650············ ' activate right servo
··· PAUSE 20
NEXT
LOW Led

The only thing I changed was Pulsing to servos instead of an LED.· The problem is that the PING sits at PULSIN for the max time.· (it works fine if I take out the PULSIN command)· So I guess that several servos cause ultrasonic·noise?· But that·should not be true - it works with one servo...· so I am asking this forum for advice.

Thanks.



·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-09 20:51
    Do you have the left and right servos connected (but inactive) when you try the first program? Often there's noise or too much drain on power sources when you start loading up function. If you're running off batteries, they may be weak. If you've connected the servos to the 5V regulated line, there may be noise. What's powering the PING? Assuming you've connected the servos and the PING to the 5V regulated line, the additional 2 servos may be causing a drop in the power supply voltage and causing the PING or Stamp to reset. Set the Vdd jumper for the servo sockets on the BOE to supply Vin to the servos. DO NOT plug the PING into these sockets now since they will supply too high a voltage to the PING. Use jumper wires to connect the PING extension cable to the Stamp (5V, Gnd, and an I/O pin), then try it again.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-09 21:39
    Hello,

    ·· Try this thread...Someone has already done some code which moves the PING while moving.

    http://forums.parallax.com/showthread.php?p=593286

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • SzarzynskiSzarzynski Posts: 16
    edited 2006-07-10 01:29
    Thanks Mike, that's the problem. Three servos and the PING must be causing a drop in the voltage - but only during the PULSIN. It must be close. I guess I have to figure out how to supply some of these things separately. Or can I plug in 5V to the Vin on the board? Or maybe a 9V battery instead of 4 AAA's? I dont know - I'll look it up. Thanks for cluing me in.
  • SzarzynskiSzarzynski Posts: 16
    edited 2006-07-10 03:31
    I fixed the problem. For those who may find this post in using the search, just follow Mike's advice - switch the jumper on your regulated line (the 4 servo plugs labeled X5 and X5) to Vin.

    Here is a quote from the board's user manual:

    "When using a six-volt battery pack (as on a Boe-Bot robot, for example), you may wish to move this jumper to the Vin position to provide extra power to the servos. When using Vin in the servo ports, always check to make sure the voltage supplied does not exceed the specifications of the particular brand of servos you are using."

    I switched, it works now, problem solved.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2006-07-10 04:40
    Szarzynski,

    I'm curious if the original 5V supply would work if you placed a series 4.7K resistor between the I/O and the signal line (white) going to each servo AND placed a 100uF cap across the power
    leads to each servo. I'm wondering if this is truly a voltage surge from the servo's or a voltage spike that may be causing a problem.

    Is there a way you could "test" this with parts you already have?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • SzarzynskiSzarzynski Posts: 16
    edited 2006-07-10 06:37
    Sorry Beau, but I only have 10uF capacitors.
  • Matt WhiteMatt White Posts: 60
    edited 2006-07-11 06:03
    I had similar issues with power consumption and running more than 2 or 3·servos at the same time.· Ultimatly I started driving my servos off a seperate battery pack... then just broke down and bought a USB servo controller board.· It mounts nicely to the back of my Boebot with a couple of standoffs.·=)

    http://www.parallax.com/detail.asp?product_id=28823
    http://www.parallax.com/detail.asp?product_id=700-00060

    Matt
    1600 x 1200 - 468K
Sign In or Register to comment.