Shop OBEX P1 Docs P2 Docs Learn Events
PING))) doesn't work while moving, even a little? — Parallax Forums

PING))) doesn't work while moving, even a little?

64mprice64mprice Posts: 2
edited 2011-11-14 20:28 in Accessories
I'm trying to use a PING))) on a robot platform that can drive around and the PING))) is mounted on a pan-tilt servo pair. If there is even a slight amount of movement I usually don't receive a response, the pulseIn call times out and returns a 0. Is that expected? I'm using the Arduino example code at http://www.arduino.cc/en/Tutorial/Ping

Comments

  • FranklinFranklin Posts: 4,747
    edited 2011-11-09 15:35
    The PING really shouldn't move between the time it is triggered and it gets the pulse back but I've seen many robots that sweep the PING while traveling and it seems to work OK.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-11-09 15:36
    Check for loose connections. A lot of movement will throw off the measurements since it takes up to about 18ms for the sound pulse to go out and bounce back and the beam is fairly narrow (the documentation gives the beam width), but you should at least get some incorrect measurements. You'll have to bring up the code with the folks on the Arduino forums, but the Ping should mostly work on a moving platform, just not accurately and worse the faster and more irregularly the platform is moving as you might expect.
  • ercoerco Posts: 20,256
    edited 2011-11-10 13:23
    Per Franklin, PINGs get swept around regularly with good results. For instance, the PING-dar project at http://forums.parallax.com/showthread.php?86110-Ping)))Dar-a-Radar-Style-Display&highlight=ping-dar
    moves the PING continuously and generates a nice onscreen DEBUG display. One of my favorite app notes.
  • graffixgraffix Posts: 389
    edited 2011-11-10 14:26
    Welcome to the forums 64mprice!
  • 64mprice64mprice Posts: 2
    edited 2011-11-14 20:21
    Heya, thanks for the tips, I got a chance to play with it again this weekend and I wanted to check back in.

    So it seems to be something about the small servos that I bought from Sparkfun ( http://www.sparkfun.com/products/9065 )

    When they are plugged in and trying to move, that's when the ultrasonic sensor seems to time out a lot. These servos have other problems where they don't have a full 180 degrees range of motion, sometimes become stuck in place until I physically nudge them, etc... After unplugging them the ultrasonic sensor seemed to work fine, and now I'm just moving the whole robot to sweep and it's good. Also I noticed that sometimes when getting close to the ultrasonic sensor, even when I'm not writing any new positions to the servos, one of them would twitch, so I think they have some kind of electronic interference problem or something, I'm not sure.

    Either way, I'm pretty sure the ultrasonic sensor is good. Thanks again for the help.
  • ercoerco Posts: 20,256
    edited 2011-11-14 20:26
    Is it a power issue? Try a seperate battery for the servo. Common ground...
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2011-11-14 20:28
    If the servo's are producing a lot of electrical noise (usually from the servo motor), you can try a diode cap filter to the servo's to see if that will help.

                Diode
    V+ Source >--->|--o------------> V+ Servo
                      | + 100uF
                      o----||--o
                               |
    Vss(GND) >-----------------o---> Servo Ground
    


    Edit
    ... if erco's suggestion above works, then you can more than likely use the Diode capacitor filter for a single supply.
Sign In or Register to comment.